Expand description
Identity subsystem — accounts and the direct junction that ties them to agents.
Layered model:
IdentityAccount(db_accounts): a single credential pointer (provider + kind + secret_ref).AgentIdentityLink(db_agent_identity_links): the sole credential-resolution path — binds an agent (definition) to an account directly, per provider.
The Identity bundle layer (Identity/IdentityBinding,
db_identity_bundles/db_identity_bindings) was retired in Phase 4c
of SPEC_PRESET_TO_BUNDLE_REFACTOR_2026_07_02.md — direct links had
already fully superseded it as the credential-resolution path (see
identity/resolver/inject.rs::resolve_bindings_for_instance).
Extracted from store.rs in Phase R.2 of the storage
modularization plan
(docs/specs/SPEC_STORE_MODULARIZATION_2026_05_27.md). The
method surface is unchanged — Store::identity_* and
agent_identity_* still live on Store via this impl block;
existing imports of the structs from storage::store::* keep
working thanks to re-exports.
Structs§
- Agent
Identity Link - Junction row: which identity an agent uses for a given provider.
- Identity
Account - An identity account (reusable credential, linked to agents via the
db_agent_identity_linksjunction). Replaces the browser localStorage identity store. - Identity
Delete Outcome - What
Store::identity_deleteremoved — the account row plus the cascadeddb_agent_identity_linksjunction rows. Consumed by thedeleteidentityaccounthandler foridentity.delete:logging and the layer-2/4 affected-agent disclosure (SPEC_ACCOUNT_DELETE_DEAUTH_LAYERS_2_4_2026_07_14.md§3/§4).
Enums§
- Secret
Ref - Provider-specific credential reference. Stored as JSON in
db_accounts.secret_ref.backendis the discriminator. The actual secret value is NEVER stored in the DB — only how to look it up at launch time (env var, secrets-manager path, etc.).PlaintextDevexists for local dev convenience and must never be the default path in production builds.
Functions§
- default_
context_ 🔒json - default_
identity_ 🔒status - repair_
bare_ 🔒backslashes - Escape every backslash in
rawunconditionally. Targets exactly the one corruption shape seen in production — a raw Windows path (C:\Users\...) pasted into a JSON string with NO escaping at all — so every backslash in a still-unparseable row is a literal path separator, never an intentional JSON escape (a document containing even one real\n/\t/\\escape alongside bare backslashes would imply two different corruption mechanisms touched the same row, which has no evidence and isn’t something this targeted repair needs to handle).