MindAttic.Vault/rfc/0003-lamp
LAMP — MindAttic.Vault.Desktop: one settings & secrets app for the whole workspace
Code name: LAMP. When the user says "LAMP" (in any window, on any login), that means: start implementing this plan.
Step 0 — make LAMP findable from any login (first thing after approval)
This file lives under one login's .claude-accounts folder, so another login can't see it. Before any code:
- Copy this plan into the repo as
D:\Projects\MindAttic\MindAttic.Vault\docs\rfc\0003-lamp.mdand commit it, so it travels with the code. - Add a note to RFC ticket M.VALT-T35: "Code name LAMP — full plan in docs/rfc/0003-lamp.md".
- Save a memory in this repo's and MindAttic.Vault's memory: "LAMP = docs/rfc/0003-lamp.md in MindAttic.Vault (M.VALT-T35); 'do LAMP' means start implementing it."
- Run
/quicksaveso/quickload <code>restores the context from any login.
Context
Every MindAttic app with a settings/options screen builds its own (IdiotProof, Tutor, ThinkTank, Prose, Orchestrator, JobHunt, MediaButler, Browser, TaxRateCollector, ...), and each stores keys its own way. LLM keys get re-entered per app. A new user can't get going without hand-configuring every app.
RFC 0002 (M.VALT-T26, now wont-do) tried to fix this with a split Vault.Web + Vault.Desktop pair. Rejected: a web-hosted settings editor is a standing attack surface for credential-adjacent data, and running a web app locally just to edit settings is pointless.
Outcome wanted:
- One native WPF app,
MindAttic.Vault.Desktop, never network-exposed, is the only place any app's settings or secrets are edited. - Profiles:
Desktop(local AppData) andAzure(Key Vault + App Configuration), with more to come. Same tabs and fields in every Profile; only the backend changes. On the Azure Profile, Load pulls the live values into the fields and Save writes them back, so you never use the Azure portal. - LLM keys shared across every app through Vault, with several keys per provider you can switch between when one stops working.
- Remembers its last state (Profile, tab, selected keys, window).
- First run works out of the box: every non-secret setting has a shipped default, so a new user only brings their own keys (BYOK).
- Every app's own settings screen goes away; its cog opens Vault.Desktop at its tab.
What already exists (reuse, don't rebuild)
Vault core (D:\Projects\MindAttic\MindAttic.Vault\MindAttic.Vault\):
Credentials\ICredentialStore.cs— secrets contract; file implementations (CredentialStore,LlmCredentialStore,BrokerCredentialStore,FtpCredentialStore,TokenStore), read-onlyConfigurationCredentialStore(how Key Vault reaches apps today, via IConfiguration),CompositeCredentialStore(read first non-null, write first writable),AppScopedCredentialStore.Credentials\IRotatingKeyStore.cs— key pools already exist and are already on the LLM path:CredentialPoolEntry(string Key, string? Label),GetKeys(providerId)in priority order,SetKeys(...).GetKey= first entry (CredentialStore.cs:70). Stored asapiKeys: [{key,label}]inproviders.jsononly when a provider has more than one key (single-key files unchanged).LlmCredentialStoreandLlmCredentialResolver(Composite: Configuration over File) both implement it. Missing: per-key health (disabled / last failure / last success) and any automatic failover — callers today only ever use key 0.Settings\JsonSettingsStore.cs— concrete, no interface.Load()returnsnew T()when the file is missing/empty/corrupt (never null, never throws). No seed hook; defaults come only from property initializers onT. MediaButler'sSettingsServiceis the one app that writes those defaults to disk on first run.DependencyInjection\ServiceCollectionExtensions.cs:107—AddVaultAppSettings<T>(where T : class, new()),AddMindAtticVault(),AddMindAtticVault(IConfiguration).Paths\VaultPaths.cs— roaming/local roots withMINDATTIC_VAULT_ROAMING_ROOT/_LOCAL_ROOToverrides;VaultPaths.LoggingDbPath(app).- Laws (
docs\BIBLE.md): LAW-1 one schema, every source · LAW-2 folder name == config section · LAW-3 APPDATA is the single local source of truth; no User Secrets · LAW-4 read-only in production · LAW-5 no Azure SDK in the core package · LAW-6 atomic writes, never touch real %APPDATA% in tests · LAW-7 root resolution never throws.
Security conventions in use:
- Secrets are never put on any display or log path; output says only whether it's set and where it came from (IdiotProof
Operations\Llm\LlmKeysOperation.cs"Keys are never displayed";KeysStatusOperation.csshows only a 4-char prefix of a key id). No shared masking helper exists. - Diagnostic logging: MindAttic.Log via Serilog (
WriteToMindAtticLog,AddMindAtticLog). - Audit ("who changed what, when"): a separate append-only store, not the diagnostic log — IdiotProof
Core\Data\AuditLog.cs+Core\Services\AuditLogRepository.cs(write failures logged, never thrown; overflow kept inDataJson). - Azure SDK versions in the workspace:
Azure.Identity 1.21.0(current; Vault.Dashboard's 1.13.1 is stale),Azure.Security.KeyVault.Secrets 4.11.1(MindAttic.Ideas.Blazor). NoAzure.ResourceManager.*orAzure.Data.AppConfigurationanywhere yet. - No reveal-on-demand secret control exists in Components (no
MaPasswordBox/MaSecretField). - No remembered-UI-state convention exists in any WPF app.
Test conventions in use:
- One
*.Testsproject per source project. Vault and IdiotProof use NUnit ([TestFixture]/[Test]/Assert.That); MindAttic.Components uses xunit. - WPF control tests (
MindAttic.Components\dotnet\tests\MindAttic.Components.Wpf.Tests\, e.g.MaTabStripTests.cs:231): a real STA thread per test with its own Dispatcher,Host.Pump()to flush, windows fromOffScreenWindow.csso nothing flashes on screen (enforced byTestWindowHygieneTests.cs). - Razor tab tests:
IdiotProof.Blazor.Tests\IdiotProofSettingsTabTests.cs— NUnit + bunit 2.11.3,JSInterop.Mode = Loose, in-memory EF,WaitForAssertion. - Fake HTTP: subclass
HttpMessageHandlerand script responses — reusable version atAutomata\Automata.Tests\Fakes\ScriptedHttpMessageHandler.cs; alsoIdiotProof.Brokers.Tests\AlpacaApiTests.cs. Azure SDK clients accept it throughClientOptions.Transport = new HttpClientTransport(handler). - Vault file tests:
MindAttic.Vault.Tests\TempDirectory.cs(GUID temp folder, deleted on dispose) +VaultPathsenv overrides;JsonSettingsStoreTests.cs,CredentialStoreTests.cs,CompositeCredentialStoreTests.csalready cover today's stores. - CI: no
dotnet testworkflow in Vault, Components or Tickets (only docs workflows). Tests run locally / via/test.
Components (D:\Projects\MindAttic\MindAttic.Components\dotnet\src\MindAttic.Components.Wpf\):
Controls\MaTabControl.cs(tabs with accent, trailing badge, status light),MaModal,MaMessageBox,MaToast/MaToastHost,MaPicker(status-aware combo),MaTextBoxplaceholder +MaTextBox/MaTextAreastyles, button styles,MaTheme(live dark/light),MaWindow(themed title bar),MaBadge,MaStatusLight,MaLayout,MaToolTips.KeepOpen().Mvvm\ObservableObject,RelayCommand,CollectionSync.SyncBy(in-place diff of a bound collection; drives Orchestrator's dynamic tabs).- Gaps: no
MaCheck/checkbox style, noAsyncRelayCommand, noIUiDispatcher, no masked-secret field.
Host-app patterns to copy:
- Orchestrator
src\MindAttic.Orchestrator.Core\Setup\SingleInstance.cs— named mutex + show-event + per-user named pipe for argument hand-off. Reuse for "cog opens Vault.Desktop at my tab". - Orchestrator
src\MindAttic.Orchestrator.Wpf\ViewModels\MainViewModel.Tabs.cs— runtime tab list viaSyncBybound toMaTabControl. - Tickets Desktop
TicketsLog.cs— Serilog → MindAttic.Log,VaultPaths.LoggingDbPath(app). App.OnStartupwiresDispatcherUnhandledException,AppDomain.UnhandledException,TaskScheduler.UnobservedTaskException.- Publish: self-contained single-file
win-x64viarun.ps1. - No DI container in existing WPF apps (manual composition). No tray pattern exists anywhere.
Earlier work: the M.COMP-T153 open-my-settings helper is marked closed but its code was reverted in Components a9391c4, so it gets re-filed. IdiotProof ccd6119 extracted /settings into the IdiotProof.Settings Razor library; manifest-generated tabs make it unnecessary and its migration removes it.
Decisions (from the user, 2026-10-31)
- LLM keys: one shared, named list of keys per provider for the whole workspace (e.g.
ClaudeApiKeys["key1"],ClaudeApiKeys["2026-10-31 IdiotProof"]). An app overrides by picking which named key(s) from that list it uses — never by holding its own copy of a key. - Everything is Name/Value: every setting and every key has one readable full name that is the same in the UI, the local files, App Configuration and the deployed app's
IConfiguration. - A key that fails (401/403/quota): apps fail over to the next key automatically, and the bad key is flagged in Vault.Desktop.
- First-run defaults live in each app's own settings class (property initializers); Vault writes them to disk on first run.
- App tabs are generated from each app's settings manifest (no app UI code inside Vault.Desktop).
- Local keys stay plain text in
providers.json(no DPAPI); protection is the user's Windows profile folder permissions. - Delivery: everything at once — Desktop and Azure Profiles, key pools, first-run, every app migrated. Work is still ordered by dependency (phases below); nothing ships half-done.
Amendments (2026-10-31, during implementation)
These supersede anything below that disagrees.
- Exe name:
MindAttic.Vault.Desktop.Wpf.exe. - Deep links: a cog opens the app's tab and scrolls to one setting:
--app <id> [--setting <full name>]. Every setting is one full-width row. - Collections: list-of-object settings (profiles, users) get Add / Remove / Edit, generated on the fly from the manifest by MindAttic.Components (M.COMP-T159); no app UI code runs in Desktop.
- Web apps: a locally hosted web app calls
VaultSettings.Openserver-side over the current-user-only pipe; a deployed one rendersVaultSettings.Link(mindattic-vault://open?app=&setting=, a per-user protocol handler, M.VALT-T56). Azure changes are made by Desktop's Azure Profile under the operator's sign-in. Still no network listener. VaultSettings.Openlives in Vault core (M.VALT-T58), not Components, so Blazor and console apps can call it.- JSON layout: one
%APPDATA%\MindAttic\{AppId}\settings.jsonper app plusGlobal\settings.json, keys in their own files, all exposed as one IConfiguration tree byAddMindAtticVaultConfiguration()(M.VALT-T55). Per-app files avoid cross-app write races and contain corruption to one app. - Names keep Vault's existing schema (M.VALT-LAW-1) and avoid colliding with sections apps already have in
appsettings.json: settings areMindAttic:Settings:{AppId}:{property}; keysMindAttic:Vault:LLM:{provider}:keys:{name}withkeyOrder/disabledKeys; assignmentsMindAttic:Vault:Assignments:{AppId}:{provider}:{i}. Full table in lamp-migration.md. - Today's data: every non-broker key stays in the
LLMbucket (ElevenLabs, fal, maps keys already live there). Alias entries already on disk (xai,anthropic) are kept and mirrored with the same list rather than collapsed, so an app still reading the alias is unaffected..keyoverride files lead the list and are folded into the pool (renamed.key.imported) on the first edit. - App-scoped copies move automatically on the app's first start (
KeyImporter.ImportAppScopedFor); env vars andlegion.jsonkeys are offered on Get Started. - Done means: every app migrated in one effort, today's values imported and organized, a separate test per setting, every app's cog opens its tab, full suites green, and restarting MindAttic.Orchestrator leaves every app working as before (M.VALT-T57).
Design
0. What counts as a setting (scope line)
Vault.Desktop owns every app-level and machine-level setting and every key — anything one person configures once for an install or a deployment. It does not own data that belongs to the app's own users or content, because a single-person desktop tool can't sensibly edit another user's data:
- IdiotProof per-user
SettingsKv/UserPreferences(each trader's own limits) — stays in IdiotProof's UI; IdiotProof's app-level settings move. - Prose per-universe
Settingrows — stays in Prose; Prose's app-level settings move. - MindAttic.Ideas site and widget-instance settings (CMS content) — stays in Ideas; its app-level settings move.
- JobHunt (single-row SQLite
AppSettings) and Orchestrator (JsonStorein its db) are single-machine: their settings move entirely to Vault (JsonSettingsStore), with a one-time import from the database on first run.
Each migrated app keeps a settings screen only for user/content data; the cog for app-level settings opens Vault.Desktop.
MindAttic.Vault (core NuGet, no Azure SDK, no UI) used by every app ISettingsStore<T>, JsonSettingsStore<T> (Desktop backend) settings manifest: [Setting]/[SettingsApp] attributes -> settings.manifest.json LoadOrSeed (first-run defaults), key pools + key health + KeySelector (failover) ConfigurationCredentialStore learns named key lists + app assignments (Azure read path) MindAttic.Components.Wpf (NuGet) shared UI + MaSecretBox, + AsyncRelayCommand, + MaCheck style (M.COMP-T121) MindAttic.Vault.Desktop (WPF exe, in the Vault repo, not packaged) the only editor Profiles: DesktopProfile, AzureProfile (Azure SDKs live only here) tab per app, generated from that app's manifest Keys tab: shared provider pools, health, per-app overrides Get Started checklist (BYOK), remembered state, audit log
1. One settings contract in Vault core
- Extract
ISettingsStore<T>(Exists,Load,LoadAsync,Save,SaveAsync,Update, plusLoadOrSeed) fromJsonSettingsStore<T>.JsonSettingsStore<T>implements it unchanged.AddVaultAppSettings<T>registers the interface. LoadOrSeed(): if the file doesn't exist, savenew T()(the app's property-initializer defaults) atomically and return it. This is MediaButler'sSettingsService.Load()pattern moved into Vault so every app gets it. Existing files are never overwritten.- No secret ever lives in a settings class. Secrets stay in credential stores (that's already how Vault is built; now it's a rule with a test).
2. Settings manifest — tabs are generated, not hand-built per app
Instead of each app shipping its own settings screen (Razor or WPF) for Vault.Desktop to host, each app describes its settings and Vault.Desktop renders them. Reasons: the user said every field is fixed per app; no app UI code ever runs inside the secrets app; no BlazorWebView (no browser engine in the secrets app); Desktop never has to be rebuilt when an app adds a setting; works the same for WPF, Blazor and console apps.
- Attributes in Vault core:
[SettingsApp(Id, DisplayName, Icon)]on the settings class;[Setting(Label, Group, Help, Order)]on properties; optional[Range],[Choices],[PathPicker(File|Folder)],[Url],[Multiline]. Field kind is inferred from the property type (string, bool, int/decimal, enum, string list, path, url, TimeSpan). [UsesCredential(ProviderId, Required, Purpose)]on the settings class declares which key pools the app needs (e.g.claude,openai,alpaca). This drives the Get Started checklist and the app tab's "Keys used" section. No key value ever appears in the manifest.- On every startup,
AddVaultAppSettings<T>(orLoadOrSeed) writessettings.manifest.jsonnext tosettings.jsonin the app's bucket: schema version, app id, fields, defaults, credentials used. Atomic write; only rewritten when content changes. - Vault.Desktop discovers apps by scanning
%APPDATA%\MindAttic\*\settings.manifest.jsonand keeps the tab list in sync withCollectionSync.SyncBy(Orchestrator'sMainViewModel.Tabs.cspattern). - An app that hasn't run yet has no manifest. Each app's install/
run.ps1runs it once with--write-settings-manifest(seed + manifest, then exit) so a fresh ecosystem install shows every app immediately. - Extending: a new field kind = one
IFieldEditor(a DataTemplate + a value converter) registered in Desktop. Nothing else changes.
3. Names, and LLM keys shared across all apps (named keys, selection, health, failover)
Naming (Name/Value everywhere). Every value has one canonical name in IConfiguration path form, Section:Name:
- App settings:
{AppId}:{Property}— e.g.IdiotProof:MaxLossPerTrade = 50. The localsettings.jsonkeeps today's JSON shape, whose paths are exactly these names, so existing files and code don't change. - Keys:
Llm:{provider}:ApiKeys:{keyName} = <secret>— the user'sClaudeApiKeys["2026-10-31 IdiotProof"]isLlm:claude:ApiKeys:2026-10-31 IdiotProof. Key names are free text you choose (trimmed, unique per provider, no:), shown everywhere; they are the key's identity. - Which keys an app uses:
{AppId}:Keys:{provider} = ["2026-10-31 IdiotProof", "key1"]— a non-secret ordered list of key names; the first is the app's active key, the rest are its fallbacks. Missing = use the shared list in its default order. - Desktop shows every field's full name (copyable) next to its label, so any value can be found by name in files, App Configuration or logs.
Named key lists.
- The existing
LlmCredentialStorebucket becomes the workspace-wide named list per provider.CredentialPoolEntry'sLabelbecomes the required, unique Name (old unlabeled entries are namedkey1,key2... on first load), plus an optionalDisabledflag.providers.jsonstays back-compatible: single-key and today'sapiKeys:[{key,label}]files both load. - Order of the shared list = default failover order. Rename keeps the key's health and every app's selection pointing at it (Desktop rewrites the references in one atomic operation and audits it).
- Keys are managed only on the Keys tab; apps are assigned keys on their own tab. Each app tab has a "Keys" section with one row per provider the app uses (
[UsesCredential]): an Active key picker (MaPickerlisting the provider's key names, each with its status light) and an optional ordered Fallback keys list. Choosing2026-10-31 IdiotProofstores only names:IdiotProof:Keys:claude = ["2026-10-31 IdiotProof", ...fallbacks](first = active). "Use shared default" clears the assignment. Deleting a key that an app still has assigned is blocked with "assigned to IdiotProof, Tutor" until you reassign. No secret is ever copied per app (replaces the oldAppScopedCredentialStoreoverride idea). - Resolution in apps:
KeySelectorreads the app's selected names (or the shared order), then the values from the shared list.
Provider catalog (one list for everyone). Vault core gets a static ProviderCatalog: id, display name, category (LLM, broker, media, TTS, other), key-page URL, aliases. Canonical LLM ids from the inventory: claude (alias anthropic), openai, gemini (alias google), deepseek, kimi, mistral, grok (alias xai), groq, perplexity, cohere, openrouter, ollama; non-LLM: alpaca (broker), elevenlabs (TTS), jellyfin (media). Aliases resolve on read, so anthropic and claude keys merge into one list. The Keys tab groups by category, so non-LLM keys (Alpaca, ElevenLabs, Jellyfin) get the same named-list treatment. Legion's provider list is reconciled to this catalog.
Migrating today's per-app key copies. Automata, MediaButler, Tutor, IdiotProof, JobHunt and TaxRateCollector wrap the keyring in AppScopedCredentialStore today. On first run of the new Vault, each app-scoped key is moved into the shared list (named {app} (imported), deduplicated if the value already exists under another name) and set as that app's active key. Behavior is unchanged and no copies remain. Same for keys in .key override files, env vars the apps read today (JF_API_KEY, ELEVENLABS_API_KEY) and legion.json: the import is offered on the Get Started screen, never silent.
Key health is observed state, kept separately: %LOCALAPPDATA%\MindAttic\Vault\key-health.json keyed by {provider, keyName} (never the key or a hash of it): last success, last failure, failure kind, cool-down-until. Written atomically (LAW-6), shared by every app on the machine, so a key one app finds broken is skipped by all.
KeySelector(new, core):ExecuteAsync(providerId, appId, Func<string key, Task<T>> call)tries the app's active key, then its fallbacks in order (or the shared order when the app has no assignment), skipping disabled and cooling-down ones. It classifies the result: auth failures (401/403) mark the key failed (needs you), quota/429 sets a cool-down (honors Retry-After), network errors don't blame the key. On success it records health and returns. When every key fails it throws oneAllKeysFailedExceptionlisting providers and failure kinds, never keys. Apps call LLMs through this instead ofGetKey().- Desktop's Keys tab: one section per provider listing its named keys in default order (drag to reorder) — name, masked value (
MaSecretBox), status light (healthy / cooling down / failed / disabled / never used), last used, "used by" apps, Test (one cheap authenticated call through the same classifier), add / rename / disable / remove.
4. Profiles
IProfile { Id, DisplayName, bool IsReady, ISettingsBackend For(AppManifest), IRotatingKeyStore Keys(appId) }. Registered in Desktop; the profile picker binds to the list. A future platform is one new class.- Desktop Profile:
JsonSettingsStore<T>(untyped JSON variant driven by the manifest, since Desktop doesn't reference app assemblies) and the file credential stores. - Azure Profile: one environment = (app → Key Vault + App Configuration store) mappings, picked once per app through the resource picker and remembered.
- Sign-in:
InteractiveBrowserCredentialwith a persisted, OS-encrypted MSAL token cache (TokenCachePersistenceOptions), so you sign in once. Your own identity; no secrets stored by Desktop for Azure access. - Picker:
Azure.ResourceManagerlists subscriptions → resource groups → Key Vaults / App Configuration stores. - Names live in App Configuration, secret values live in Key Vault. Every name from section 3 is an App Configuration key with exactly that name (App Configuration allows spaces, so
Llm:claude:ApiKeys:2026-10-31 IdiotProofis stored as-is). Plain settings hold their value; key entries hold a Key Vault reference to the secret. ETag optimistic concurrency on every write. - Key Vault secret names only allow letters, digits and dashes, so each secret gets a generated name (
llm-claude-<slug>-<6-char id>) and carries the readable key name in anametag. You never see or type it; App Configuration's reference maps the readable name to it. One naming function, contract-tested. Save writes a new secret version; rename only changes the App Configuration key and the tag. - Deployed apps stay read-only (LAW-4) and read everything by name through
IConfigurationusing the App Configuration provider with Key Vault reference resolution, wired by the host (LAW-5: the core package still has no Azure SDK).ConfigurationCredentialStoregains named-key-list reading (Llm:{provider}:ApiKeys:*) and app selections ({AppId}:Keys:{provider}), so selection and failover behave the same in Azure as locally. - Missing RBAC role (Key Vault Secrets Officer / App Configuration Data Owner) gets a plain explanation of which role is needed on which resource, not a stack trace.
- After Save, Desktop says when the app will see it (App Configuration refresh vs restart).
- Sign-in:
- Load / edit / Save is identical in every Profile. Dirty tracking per field; Save writes only changed fields; Revert reloads.
5. Remembers its state
VaultDesktopState (non-secret) via JsonSettingsStore<VaultDesktopState> in the Vault.Desktop bucket: last Profile, last tab, window bounds (clamped to a monitor that still exists), theme, collapsed groups, Azure environment mappings. Saved debounced on change and on exit. Corrupt/missing file → defaults (that's JsonSettingsStore's existing behavior).
6. First run / BYOK
- Every app seeds its own defaults (
LoadOrSeed) and writes its manifest, so nothing is blank except keys. - Desktop opens on Get Started when any required credential (
[UsesCredential(Required=true)]) has no key: one row per provider ("Claude — needed by Tutor, Prose, IdiotProof"), a key field, a link to that provider's key page, and Test. Done when every required provider has a working key; it then never shows again unless a required key goes missing.
7. Opening from an app
- Re-file the open-my-settings helper (M.COMP-T153's code was reverted in Components
a9391c4):VaultSettings.Open(appId)launches or activates Vault.Desktop at that app's tab. - Single instance: copy Orchestrator's
SingleInstance.cs(named mutex + show event +PipeOptions.CurrentUserOnlypipe). Desktop accepts exactly one argument shape,--app <id>, length-capped, validated against discovered manifests; anything else is ignored and logged. - Each app deletes its own settings screen/route/window and points its cog at the helper.
8. Composition and code layout
- Desktop uses
Microsoft.Extensions.DependencyInjection(no Generic Host). Existing WPF apps hand-compose, but Vault already exposesIServiceCollectionextensions and DI makes every ViewModel testable with fakes. - MVVM on
MindAttic.Components.Wpf.Mvvm(ObservableObject,RelayCommand, newAsyncRelayCommand). Views are DataTemplates keyed by ViewModel type inApp.xaml. - Startup copies the house pattern:
MaToolTips.KeepOpen(), three unhandled-exception hooks, Serilog → MindAttic.Log (TicketsLog.csshape),MaTheme,MaWindow.SetThemedTitleBar. - Publish like the other apps: self-contained single-file win-x64 via
run.ps1.
Security
Threat model: local malware/other users on the machine, accidental leaks (logs, screenshots, clipboard history, crash dumps, git), a compromised app on the ecosystem, Azure credential misuse.
- No network listener, ever. No Kestrel, no WebView, no HTTP server. Only outbound HTTPS to Azure and to LLM providers for Test. Pipe is
CurrentUserOnlyand accepts only--app <known id>. - Secrets are write-mostly in the UI. New
MaSecretBox(Components): masked by default; Reveal needs a click and hides again after 30 s or when focus/window changes; the automation/accessibility name never contains the value; Copy puts the value on the clipboard excluded from clipboard history/cloud sync and clears it after 30 s. Values are held only in the edit buffer, never in a bindable string property that logging or diagnostics could read. - Never logged. A Serilog destructuring/enricher policy redacts anything typed as a secret; audit and diagnostic messages carry field names and key
Ids, never values or hashes. Canary-secret tests enforce it (Testing #6). - Audit. Every Save appends one entry: time, Windows user (and Azure UPN on Azure), Profile, app, fields changed (secrets as "changed", no value). Append-only SQLite at
VaultPathslocalVault\audit.dbwith insert-only triggers (the Tickets DB technique). Audit write failures are logged, not thrown (IdiotProofAuditLogRepositoryconvention). Azure writes also land in Azure's own Key Vault/App Configuration logs. - Local keys at rest: plain text, by decision.
providers.jsonstays readable JSON under%APPDATA%\MindAttic\. Desktop checks at startup that the Vault folders aren't readable by other users or Everyone (a too-open ACL shows a warning with a one-click fix), and keys are never written anywhere else locally (no state file, temp file, log or crash dump). - Least privilege on Azure. Your own identity, interactive sign-in, OS-encrypted token cache; the exact RBAC roles are documented; production apps keep managed-identity read-only access (LAW-4).
- Concurrency and integrity. Atomic writes (LAW-6); file watcher warns when another process changed a file you're editing; ETags on App Configuration; Azure Save shows a confirm listing changed field names (never values).
- Input handling. Values are validated by kind (Range, Url, Path) before Save; path pickers don't follow into other users' profiles; manifests are parsed with size limits and unknown kinds render read-only rather than crash.
- Supply chain. Exact package versions:
Azure.Identity 1.21.0(match the workspace),Azure.Security.KeyVault.Secrets 4.11.1(match MindAttic.Ideas), current stableAzure.Data.AppConfiguration,Azure.ResourceManager,.KeyVault,.AppConfigurationpinned exactly. Only Vault.Desktop references them. - Crash safety. Unhandled-exception handlers log type/message/stack only; no ViewModel dumps.
Testing
All NUnit except Components (xunit), matching each repo.
MindAttic.Vault.Tests- An abstract
SettingsStoreContractfixture (load missing → defaults, seed writes once and never overwrites, round-trip, corrupt → defaults, atomic write) run againstJsonSettingsStore<T>, the manifest-driven JSON store and the App Configuration store (fake HTTP). - Manifest: attributes → manifest JSON (kinds, defaults, groups, credentials used), unchanged content isn't rewritten, schema version present, no secret-typed property allowed on a settings class (fails the build test).
- Named keys: old single-key and
apiKeysfiles both load and unlabeled entries becomekey1,key2...; names unique per provider,:rejected; rename moves health and every app's selection atomically; delete blocked while selected;Disabledround-trips; the on-disk format stays plain JSON readable by older Vault versions for single-key providers. - Catalog:
anthropic→claude,google→gemini,xai→grokmerge into one list; unknown ids still work as their own provider. - Import: an
AppScopedCredentialStorekey becomes{app} (imported)and that app's active key; a value already present under another name is reused, not duplicated; running import twice changes nothing. - Selection: app with no selection uses shared order; app selecting
["2026-10-31 IdiotProof","key1"]uses exactly those in that order; a selected name that no longer exists is skipped and reported. KeySelector: 401 → next key and key marked failed; 429 + Retry-After → cool-down; network error → key not blamed; disabled skipped; all fail →AllKeysFailedExceptionwithout key text; health file written atomically and never contains a key.- Names: every manifest field's full name equals its
IConfigurationpath;ConfigurationCredentialStorereads named key lists and selections from config; Key Vault secret-name generation is valid for any key name (spaces, unicode, long) and stable. - Reuse
TempDirectory.csandVaultPathsenv overrides (LAW-6: never real %APPDATA%).
- An abstract
MindAttic.Vault.Desktop.Tests(new, ViewModel level, no window): tab sync from manifests, Profile switch reloads every tab from the new backend, dirty tracking and Save of only changed fields, Revert, Get Started appears/disappears correctly, state saved/restored (incl. off-screen window clamp), argument validation for--app, audit entry per Save. FakeIProfiles and in-memory stores.- Azure Profile: Key Vault and App Configuration stores against
ScriptedHttpMessageHandler(copyAutomata.Tests\Fakes\ScriptedHttpMessageHandler.cs) viaClientOptions.Transport: new secret version on Save, ETag conflict surfaced, 403 → role explanation, picker paging. A separate[Category("AzureLive")]suite runs only whenMINDATTIC_VAULT_AZURE_TEST_*env vars point at a throwaway subscription. MindAttic.Components.Wpf.Tests(xunit, STA +OffScreenWindowlikeMaTabStripTests.cs):MaSecretBoxmasked by default, Reveal/auto-hide, automation name has no value, Copy clears;AsyncRelayCommandcan-execute while running and error surfacing;MaCheckstyle.- Each migrated app: its settings class produces a manifest with every field labeled;
LoadOrSeedseeds the expected defaults; LLM calls go throughKeySelector(fake handler: first key 401 → second key used); old settings page/route is gone. - Leak tests: a canary secret value is pushed through every store, Save, audit, log and state path; tests assert it appears in none of the log DB, audit DB, state file, manifest or exception messages.
Rollout / tickets
Delivered together, built in this order (each step depends on the one before):
- Vault core:
ISettingsStore<T>+LoadOrSeed(M.VALT-T36); manifest attributes/writer; named keys (Name +Disabled) and app assignments; key health +KeySelector;ConfigurationCredentialStorenamed keys and assignments. Publish next major MindAttic.Vault (HOUSE-LAW-1 whole numbers). - Components:
MaSecretBox,AsyncRelayCommand,MaCheck(existing M.COMP-T121), re-filed open-my-settings helper. Publish next major MindAttic.Components.Wpf. - Vault.Desktop: scaffold (M.VALT-T37), tab host + Profile switcher (M.VALT-T38), single instance (M.VALT-T39), Keys tab, Get Started, remembered state, audit.
- Azure Profile: resource picker (M.VALT-T40), Key Vault store (M.VALT-T41), App Configuration store (M.VALT-T42).
- Every app (one ticket per app). Each one: move to the new Vault major (apps are on 1.0–6.0 today), put its app-level settings in one
[SettingsApp]class read throughISettingsStore<T>/LoadOrSeed(with a one-time import from wherever they live now), declare[UsesCredential]s, resolve keys throughKeySelectorand the shared named lists, add--write-settings-manifestto its run script, remove its app-level settings UI and point its cog at Vault.Desktop.App Settings UI to remove / today's storage to import Keys Tutor Tutor.Shared\...\Settings.razor;ISecurePreferences/secure-preferences.jsonclaude, openai, gemini, deepseek, kimi (scoped copy → import) ThinkTank Settings.razor,SettingsAppearance.razor;%LOCALAPPDATA%\MindAttic\ThinkTank\Settings.jsonclaude/anthropic, openai, gemini, deepseek, kimi IdiotProof Pages\Settings.razorapp-level parts; dropIdiotProof.SettingsRCL (ccd6119); per-userSettingsKvstaysclaude, openai, gemini, deepseek, mistral; alpaca MindAttic.Orchestrator SettingsViewModelmodal;OrchestratorSettings/GatewaySettingsfrom its dbclaude, gemini, kimi, mistral ( BillingSwitch, GatewayVaultSecrets)Prose Prose.WriterUi\...\SettingsPanel.razorapp-level parts; per-universe rows stay~14 providers JobHunt settings area in JobHunt.App\MainWindow.xaml; SQLiteAppSettingsclaude, openai, gemini, kimi ( ByokKeys)MediaButler MediaButler.Wpf.UI\Pages\Settings.razor+SettingsEditor.cs; alreadyJsonSettingsStoreclaude (scoped copy → import) MindAttic.Browser SettingsWindow.xaml; alreadyJsonSettingsStorenone today (uses a "claude" string) TaxRateCollector Settings.razor;settings.jsonvia own serviceclaude/anthropic Automata settings area in Automata.App\MainWindow.xaml;AutomataSettingsStoreclaude, openai, gemini, kimi (scoped copy → import) MindAttic.Launcher console Menus\SettingsMenu.cs(becomes "Open settings"); alreadyJsonSettingsStoreclaude, gemini, grok, kimi (+ KimiConfigSync)OpenCredentials v2\Blazor\...\Settings.razor;Settings.cs(Vault 1.0)own anthropic/openai store → import MindAttic.Ideas Admin\SettingsPanel.razorapp-level parts only; CMS site/widget settings staynone MindAttic.Capture Tray\SettingsForm.cs;%LOCALAPPDATA%\MindAttic\Capture\tray.jsonnone MindAttic.Tickets.Desktop (no page) desktop.json→ manifest + importnone MindAttic.Log (Reader), Unstuck no UI; already JsonSettingsStore→ manifest onlynone MindAttic.Legion, Gadfly legion.json; Legion resolves keys throughKeySelector, Gadfly inheritsall LLM providers MindAttic.Psst, ProcessLogger, Formicarium Dashboard, Unity.Multiplayer Hosting.Cli, MindAttic.Authentication, Cursory config file / appsettings.json→ manifest for what's user-configurablenone JellyFinPoster, Claudia env vars → Keys tab jellyfin, elevenlabs
Out of scope: MindAttic.Deploy (CLI arguments only) and the repos with no settings or keys.
Ticket housekeeping:
- M.VALT-T35 (RFC): replace its description with this plan's summary and point it at
docs/rfc/0003-lamp.md. - M.COMP-T154 (dual Razor/WPF tab contract): close wont-do, superseded by manifest-driven tabs.
- File new tickets for: provider catalog + aliases, key import from app-scoped copies/env/legion.json, manifest, named keys + app assignments, key health +
KeySelector, config named keys, folder-ACL check, audit, Keys tab, Get Started, remembered state,MaSecretBox,AsyncRelayCommand, open-my-settings helper, and one migration ticket per app — each linkedpart-ofM.VALT-T35. - IdiotProof
ccd6119(IdiotProof.SettingsRazor library): no longer needed once its tab is manifest-generated; its migration ticket removes it.
Verification
dotnet testin MindAttic.Vault, MindAttic.Components and each migrated app: all green, including the leak tests.- Fresh-machine run (point
MINDATTIC_VAULT_ROAMING_ROOT/_LOCAL_ROOTat empty temp folders): run each app's--write-settings-manifest, open Vault.Desktop → every app has a tab with defaults filled in and Get Started lists only the missing keys. Enter one Claude key, Test → healthy, checklist done. - Failover: add a deliberately bad key first and a good key second; run an LLM call from one app → it succeeds on key 2, key 1 shows failed in Desktop, and the audit/log contain no key text.
- Remembered state: change Profile, tab, window size; close; reopen → restored.
- Cog: click an app's cog with Desktop closed (opens at that tab) and open (activates and switches tab).
- Azure Profile on a throwaway resource group: sign in once, pick resources, Load shows live values, edit and Save, confirm the deployed app reads the new value after refresh/restart; remove your role → clear role message.
- Security spot checks:
netstatshows no listening port for Vault.Desktop; Windows clipboard history doesn't contain a copied key; loosening the Vault folder ACL triggers the warning; searching the log DB, audit DB, state file and manifests for a test key finds nothing. - Assignment: on the Keys tab add
2026-10-31 IdiotProof; on IdiotProof's tab set it as Active key; IdiotProof's next LLM call uses it (audit shows the assignment, never the value); try deleting the key → blocked with "assigned to IdiotProof".