Codex / Arca compatibility boundaries
This page is the contract between application code, vox-db, and vox-pm for persisted data. It implements the boundaries implied by ADR 004: Codex over Arca over Turso.
Naming
| Layer | Name | Rust / code |
|---|---|---|
| Public product API | Codex | vox_db::Codex (type alias for VoxDb) |
| Stable ABI / legacy call sites | VoxDb | vox_db::VoxDb |
| Schema + SQL DDL ownership | Arca | crates/vox-db/src/schema/ (SCHEMA_FRAGMENTS, BASELINE_VERSION) |
| Engine | Turso / libSQL | Only supported SQL backend for the same data plane |
Do not introduce a second physical store for the same logical data without a new ADR.
What application code may call
- Prefer
VoxDb::connect/Codex::connectwithDbConfigfromvox-db. - Prefer
VoxDb::store/ domain helpers invox-dbfor CAS and schema-backed operations. - Avoid new direct
turso::usage outside the direct Turso allowlist. If you must extend the allowlist, update that document in the same change.
Configuration (canonical env)
| Variable | Role |
|---|---|
VOX_DB_URL | Remote libSQL / Turso URL |
VOX_DB_TOKEN | Remote auth token (never commit; env-only per ADR 004) |
VOX_DB_PATH | Local file path when using file-backed Codex |
Resolution for CLIs and long-running apps:
DbConfig::from_env— minimal parsing; withlocalfeature, empty env may yield in-memory for tests.DbConfig::resolve_canonical(alias ofresolve_standalone) — canonical user-global Codex:VOX_DB_*first, then legacyTURSO_URL+TURSO_AUTH_TOKEN, then a concrete file path (never silent:memory:whenlocalis enabled). See how-to-voxdb-canonical-store.open_project_db— non-canonical repo-local.vox/store.dbfor snippets/share/cache only.
Migrations and SQL rules (Arca)
- Schema DDL is owned by
vox-dbunderschema/domains/, ordered inmanifest.rsasSCHEMA_FRAGMENTSand applied once atBASELINE_VERSION(single maintained baseline row inschema_version). Older databases withMAX(schema_version) != BASELINE_VERSIONmust be exported (vox codex export-legacy), moved to a new file, then imported after baseline — no in-place bridge. Capability checks invox-dbuse required table sets, not numeric version thresholds (see codex-vnext-schema). - Higher-level writes for chat/search domains should go through
VoxDbhelpers incodex_chat.rswhere possible instead of ad-hoc SQL. - Bodies use patterns consistent with Turso batch execution:
execute_batchfor non-row-returning DDL/DML; pragmas viapragma_updatewhere applicable. Fragmentv7remains intentionally empty in the manifest (historical no-op).
Convex-like features
Subscriptions, change logs, invalidation, and HTTP streaming are Codex capabilities layered on one database — not a separate DB product (ADR 004 § Decision item 5).
Verification
vox ci check-codex-ssot(shim:scripts/check_codex_ssot.sh) — required SSOT files exist (includes this page).vox ci check-docs-ssot(shim:scripts/check_docs_ssot.sh) — doc inventory and path references.- Crate tests:
cargo test -p vox-db --lib(withlocalfeature as in CI) exercises in-memory Codex and theCodexalias.