Skip to main content

Crate vta_keyspaces

Crate vta_keyspaces 

Source
Expand description

Central registry of the VTA’s keyspace names.

Every store.keyspace(..) call in the VTA (vta-service server, offline CLIs, backup, tests) names its keyspace through a const here rather than a bare string literal. This is the single source of truth that killed the "imported" / "imported_secrets" test-vs-production divergence (a test opened a different, empty keyspace than the one production writes). The no_bare_keyspace_literals guard in vta-service keeps it that way by scanning that crate’s source for bare .keyspace("…") literals.

Keyspace names live here; per-keyspace key formats (the key:, seed:, path_counter: … record families inside a keyspace) are a separate concern and are not yet centralised.

A near-leaf crate: it holds the shared keyspace vocabulary (the name constants) plus the Keyspaces handle bundle, so that every VTA subsystem crate can name and pass keyspaces without depending on vta-service. Its only dependency is vti-common (for KeyspaceHandle).

Structs§

Keyspaces
Shared bundle of borrowed keyspace handles passed to operations that need several keyspaces at once.

Enums§

ContextDeleteEffect
What happens to a keyspace’s context-scoped contents when that context is deleted (vta/contexts/delete).
DidDeleteEffect
What happens to a keyspace’s DID-keyed contents when that DID is deleted.

Constants§

ACCEPTED_IDS
The record of accepted Trust Task document identifiers (VTI-OPS-025 … 027, SPEC §7.2 item 11): one row per document id accepted for execution, accepted:<id>, holding the digest of the document accepted under it, the instant the row may be dropped (the end of that document’s acceptance window) and, for a task whose response may be replayed, that response.
ACL
ACL entries + the seal record + the integrity-anchor root.
ALL
Every production keyspace. Partitioned by BACKED_UP + EXCLUDED_FROM_BACKUP; the [tests::backup_partition_is_total] guard asserts the partition stays exhaustive so a newly-added keyspace can’t be silently omitted from the backup decision.
APP_STATE
Versioned, namespaced application state (vta/app-state/{get,put,list, delete,get-many,put-many}/1.0) — the third store, beside VAULT (secrets and credentials) and MEMORY (agent memory), for JSON an application owns and the VTA does not interpret.
AUDIT
Audit log.
AUDIT_KEY
The keyed-hash keys the audit log commits actor and target identifiers under, and their history.
BACKED_UP
Keyspaces a backup carries, every row of each, as a raw dump.
BACKUP_BUNDLES
In-flight backup-bundle control-plane records.
BOOTSTRAP
KMS-protected, unencrypted boot keyspace (TEE integrity manifest, etc.).
COLLECTION
Collection of the principal’s identifiers (vta/collection/*, VTI-NTF-080 – 098): the collection claims — claim:<contextId>\0<did>, a client’s lease on being a persona DID’s one collector at its mediator — the identifiers the VTA stopped collecting for after another connection kept closing its own (conflict:<contextId>\0<did>), the identities provisioned for another party, which their holders collect for (provisioned:<did>), each context’s collection-by-default setting once changed (context-setting:<contextId>, VTI-NTF-094), the operator’s suspension as last applied at boot (suspension, VTI-NTF-098), and the record that the upgrade backfill of provisioned: has run (backfill:provisioned).
CONSENT
Inbound-messaging consent: durable grants + TTL’d pending requests (vti_common::consent). The VTA is the first gate for bridged conversations.
CONSENT_APPROVERS
Per-(platform, context) approver bindings — who decides consent and how the prompt routes (vti_common::consent::ApproverBinding).
CONTEXTS
Trust contexts (the BIP-32 key hierarchy roots).
DID_TEMPLATES
Stored DID templates (global + context-scoped).
DRAINS
Persisted protocol-management drain set.
ENVIRONMENT_BOUND_ROWS
Rows inside a BACKED_UP keyspace that belong to the deployment, not to the agent, as (keyspace, key prefix).
EXCLUDED_FROM_BACKUP
Keyspaces deliberately not in a backup, each for a stated reason.
EXTERNAL_ACCOUNTS
External accounts a VTA holds at clouds and third-party providers (external/accounts/*), keyed acct:<context>:<accountId>, plus a retired:<context>:<accountId> tombstone per deleted id so an id is never reused while a provider-side trust policy may still name it.
EXTERNAL_SECRETS
The secret halves of external accounts whose model holds one (s3-static-presign, static-secret), set by external/accounts/secret/set/0.1 and wrapped under the seed-derived KEK the way imported keys are. Keyed secret:<context>:<accountId>.
IDEMPOTENCY
Idempotency records for keyed Trust Tasks — one row per (actor, idempotency-key), holding the request digest and, for tasks whose response may be replayed, the original response. Lets a client’s retry of a lost reply converge on the first execution instead of producing a second durable effect.
IMPORTED_SECRETS
Imported secret material (KEK-wrapped). Named imported_secrets, not imported — the latter was a long-standing test-only typo that operated on an empty keyspace disjoint from production. Always reference this const.
INTERNAL_KEYS
Non-extractable internal signing keys.
ISSUED_CREDENTIALS
VTA-issued credentials (minted by vta/credentials/issue/0.1, revoked by vta/credentials/revoke/0.1). One record per credential keyed cred:<id>; revocation is a tombstone (revokedAt set in place), not a delete. Distinct from VAULT (which stores credentials the holder holds).
KEYS
Master seed + key records (key:, seed:, path_counter:, active_seed_id, imported_kek_salt, …) and the backup import sentinel.
MEMORY
Per-context key/value store for AI-agent memory (vta/memory/{put,list, delete}/0.1). One record per (contextId, key) pair, keyed mem:<contextId>:<key>; list is a mem:<contextId>: prefix scan. Durable user data → in BACKED_UP.
NOTIFICATIONS
The notifications this VTA holds for its principal (notifications/notify, notifications/relay, vta/notifications/*, VTI-NTF-050): one record per (originator, notificationId) a DID it holds keys of was sent, keyed held:<contextId>\0<recordId> with the dedup index dedup:<digest of addressee, originator and notificationId> beside it. Each record keeps the delivering document exactly as received, so a client can verify every proof itself.
OUTBOX
Durable reliable-messaging outbox backing vti_common::outbox_store:: VtiOutboxStore for the delivery-layer MessagingService (D2 P2a cut-over). Holds Guaranteed-delivery outbox entries; dormant in P2a (all current sends are BestEffort) but wired so the drain/confirmation loops persist across restarts once P2b adds guaranteed VTA pushes. Runtime state, not backed up.
PASSKEY_VMS
In-flight passkey-as-verificationMethod enrolment state.
PCS_ENGINE
The VTA’s hidden-vetting PCS engine state (vta/pcs/*): one vetter engine per (context, community), keyed vetter:<digest(context, community)>, one applicant engine per application, keyed app:<applicationId>, and the voter and trustee engines (voter:<digest>, trustee:<digest>). The keys are digests, so finding a context’s records means reading each record’s contextId; the wrapped state sits beside each under secret:<key>.
PERSONA
The holder’s identity attributes, profiles, bindings and contacts (persona/*) — the fourth store, beside VAULT (secrets and credentials), MEMORY (agent memory) and APP_STATE (uninterpreted application JSON).
POLICY
Rego policy modules for the Policy Decision Point (policy/{upsert,list, delete,evaluate}). One policy::PolicyModule per id, keyed policy:<id>; the active set is every enabled row, priority-ordered. Durable operator security config → in BACKED_UP (a lost policy set would silently drop enforcement on restore).
RELATIONSHIPS
Durable TSP relationship state, backing the SDK’s RelationshipStore for the TSP transport. One record per facet per (our_vid, their_vid) pair — the relationship FSM state, thread digests, reply path and learned capability.
ROOM_GROUPS
A member’s MLS group state for each data room they belong to (rooms/keys/{welcome,commit,open}), keyed per member: room-group/<roomId>/<persona>, beside the member’s pending KeyPackage (room-kp/…), pending epoch advance (room-advance/…), root memory (room-roots/…), the epoch a commit removed the member at (room-removed/…) and an owner’s last applied admission, Welcome included, kept for at most 24 hours so a repeated request can be answered (room-admitted/…, rooms/owner/group/add/0.3 item 8) under the same <roomId>/<persona>. One VTA may hold several members of one room — several principals, or several personas of one — and each is a different leaf with different secrets. Rows a per-room build wrote (room-group:<roomId>, …) are moved under their member on first touch.
ROOM_INVITATIONS
Invitation credentials this VTA has consumed by joining a room (rooms/keys/welcome), keyed room-vic:<credentialId>.
ROOM_KEY_WATCHES
The watches this VTA holds for its principal’s clients (rooms/keys/watch/0.1): one record per armed watch, keyed by a digest of (caller, member, host, room), holding exactly what Recipient item 6 lets it keep — the caller, the member, the room, the host, the address it armed with and that address’s key material, and when the watch lapses. Never a watermark, a signalled version or the time a signal arrived. A record is deleted when its watch fires, is cancelled or lapses (30 days at most), when the caller’s standing to act as the member is withdrawn, or when the member’s credentials for the room are gone.
SEALED_NONCES
Sealed-bootstrap anti-replay nonce log.
SERVICE_STATE
Persistent runtime service-enable state (operations::protocol::runtime_state).
SESSIONS
Auth sessions + challenges.
SNAPSHOT
Per-kind previous-config snapshots for fail-forward rollback. (Historically operations::protocol::snapshot::KEYSPACE_NAME.)
TASK_CONSENT
Task-execution consent for the PDP’s requireConsent disposition: pending approvals keyed by payload digest, and granted consents a re-submitted task consumes. Distinct from CONSENT (messaging-bridge conversation consent). One vti_common::task_consent::PendingTaskConsent per pending:<digest> and vti_common::task_consent::TaskConsentGrant per grant:<digest>:<requester>. Durable operator-facing security state → BACKED_UP.
TRUST_TASK_PUSHES
Trust Task pushes in flight or recently finished — one record per push, holding the signed document, the transport plan and the outcome (vti_common::trust_task_push). Encrypted at rest; runtime delivery state like OUTBOX, not backed up.
VAULT
Holder credential vault (third-party secrets stored on this VTA).
WEBVH
WebVH DID records + did.jsonl state.
WITNESS_SESSIONS
The VTA’s records of witnessed sessions in flight (vta/witness/*): one per session, keyed session:<sessionId>, from vta/witness/open until the record expires — minutes, near the witness’s own session lifetime — with an accepted session reduced to its stub (vta/_shared/0.6/CONVENTIONS.md §3).

Functions§

context_delete_effect
The effect a context deletion has on keyspace, or None if the name is not a keyspace this build knows.
did_delete_effect
The effect a DID deletion has on keyspace, or None if the name is not a keyspace this build knows.
is_environment_bound
Whether key in keyspace is an ENVIRONMENT_BOUND_ROWS row.