ADR 004: Codex over Arca over Turso
[!NOTE] Historical note: the
TURSO_*env var names in this ADR are superseded byVOX_DB_URL/VOX_DB_TOKEN. ADR text is preserved for context.
Status
Accepted — greenfield release baseline.
Context
Vox persisted data through vox-db (VoxDb / Codex), with related crates (vox-pm, etc.) and scattered env names (VOX_DB_*, legacy TURSO_*). Documentation referred to Arca, Codex, and VoxDb interchangeably. The public product name for the database layer must be Codex (not “codecs” or other typos). Schema DDL and store operations live in crates/vox-db (schema/ domains + store/ops_*.rs); the only supported SQL engine is Turso / libSQL.
Decision
- Codex — The public, application-facing data API. In Rust,
vox_db::Codexis a type alias forVoxDb; new docs and APIs should say Codex. - Arca — Internal name for schema fragments, baseline migration, CAS tables, and SQL operations owned by
vox-db(schema/manifest.rs,store/). No second physical store. - Turso — Sole database engine. No parallel PostgreSQL/SQLite product paths for the same data plane.
- Greenfield baseline — Fresh releases use a forward migration chain from the current schema version; legacy shape is preserved via explicit importers, not an unbounded pile of historical migrations in docs.
- Convex-like behavior — Implemented as Codex capabilities (change log, subscriptions, invalidation, SSE/WebSocket), not a second database.
- Secrets —
VOX_DB_TOKEN(and auth material) are environment-only; never committed in TOML.VOX_DB_URLmay appear in config for convenience; token must not.
Consequences
- Repository tenancy — MCP and orchestration shard filesystem paths; coordination tables use
repository_idwhere applicable (e.g.a2a_messages). Theagent_eventstable does not currently includerepository_idon the baseline DDL. Session rows carry tenant context inagent_sessions.task_snapshotJSON when MCP setsSessionConfig::repository_idinvox-orchestrator. VoxDbremains the stable Rust identifier for ABI/compatibility; prefer Codex in user-facing text and new modules.- Compatibility aliases
VOX_TURSO_URL/VOX_TURSO_TOKENmap to the same remote resolution asVOX_DB_URL/VOX_DB_TOKENinvox_db::DbConfig::resolve_standalone(after canonical env, before legacy Turso names). - Legacy env vars
TURSO_URL/TURSO_AUTH_TOKENare deprecated; they remain a last-resort shim inresolve_standalonealongsideVOX_TURSO_*. - Direct
turso::usage outsidevox-db(and documented exceptions) is discouraged; domain code should callVoxDb/CodexAPIs (store/ops_*.rs). See direct Turso allowlist for the current enforcement story.
References
- Environment variables (SSOT) — canonical
VOX_DB_*/ Turso alias precedence - Codex / Arca compatibility boundaries — API, env, and migration contract
- Codex vNext schema domains
- Codex BaaS scaffolding
- Orphan surface inventory
- Crate:
crates/vox-db,crates/vox-pm