VoxDB data cutover and telemetry sidecar runbook
VoxDB data cutover & telemetry sidecar runbook
Section titled “VoxDB data cutover & telemetry sidecar runbook”Operator-facing sequence for converging on canonical vox.db, telemetry contracts, and retiring reliance on vox_training_telemetry.db.
Stage 0 — Preconditions
Section titled “Stage 0 — Preconditions”- Read
docs/src/architecture/voxdb-connect-policy.md(strict vs degraded vs legacy primary). - Ensure
vox ci ssot-driftandvox ci data-ssot-guardspass on main.
Contributors / local tooling — fresh canonical DB (preferred when data is disposable)
Section titled “Contributors / local tooling — fresh canonical DB (preferred when data is disposable)”If you do not need to keep existing Codex rows (for example stub-check, repro scripts, or CI-style checks), do not rely on an old user-default vox.db that may still be on a legacy schema_version chain.
Use a fresh file: set VOX_DB_PATH to a scratch path. When that file is missing, the next normal open (VoxDb::open / connect_default path) creates it and runs migrate to the current repository baseline — no export/import loop.
- PowerShell:
$scratch = Join-Path $env:TEMP "vox-scratch-$(Get-Date -Format yyyyMMddHHmmss).db"; Remove-Item $scratch -ErrorAction SilentlyContinue; $env:VOX_DB_PATH = $scratchthen run your command (repeat with a new name if you want a clean slate). - Bash:
export VOX_DB_PATH="${TMPDIR:-/tmp}/vox-scratch-$$.db"; rm -f "$VOX_DB_PATH"then run your command.
Unset remote replica env (VOX_DB_URL / VOX_DB_TOKEN and compatibility aliases) when you intend local file mode only.
Fact check vs code: DbConfig::resolve_canonical (used by VoxDb::connect_default / Codex default) never selects in-memory SQLite when the environment is empty — it falls back to a concrete path (VOX_DB_PATH, then platform default, then app.db). In-memory (:memory:) is for explicit test helpers such as VoxDb::open_memory, not for “I cleared env vars.”
When you do need historical rows, keep using your real path and complete Stage 1 if you hit LegacySchemaChain / vox_db::legacy_schema.
Baseline bumps (repository releases)
Section titled “Baseline bumps (repository releases)”When the monolithic Arca baseline advances (new SCHEMA_FRAGMENTS slice, new seed DDL, or digest change), three layers must stay aligned:
- Rust SSOT:
pub const BASELINE_VERSIONincrates/vox-db/src/schema/manifest.rsand the ordered fragment list used bybaseline_sql(). - Contract SSOT:
contracts/db/baseline-version-policy.yaml—repository_baseline_integermust equalBASELINE_VERSION, andrepository_baseline_digest_hexmust equal the Keccak-256 ofvox_db::schema::baseline_sql()(runcargo test -p vox-db baseline_digest_manual -- --ignored --nocapture, then paste the printed0x…digest). CI enforces parity viavox ci check-codex-ssot(bundled invox ci ssot-drift). - Existing user databases: On the next normal
VoxDb::connect/ migrate, a file whoseMAX(schema_version)is greater than zero and strictly less than the new baseline is advanced in place by applying the idempotent baseline DDL batch (seemigrateincrates/vox-db/src/store/open.rs). Narrow, version-gated SQL (for example the v51 reliability flatten) runs only when the pre-migrate version is below the gate called out in that module.
When Stage 1 export/import still applies: if MAX(schema_version) is not equal to the current baseline and the chain is not a simple “behind baseline” case the migrator can fold (mixed ad-hoc migration rows, unknown fork, or other non-baseline history), normal connect returns StoreError::LegacySchemaChain and logs vox_db::legacy_schema. Operators must follow Stage 1 below (export-legacy → new file → baseline migrate → import-legacy). vox codex verify prints baseline / digest hints and points here for legacy primaries (see also VoxDB connect policy).
Stage 1 — Legacy schema_version chain (blocking)
Section titled “Stage 1 — Legacy schema_version chain (blocking)”Symptom: StoreError::LegacySchemaChain on normal VoxDb::connect.
vox codex export-legacy backup.jsonl(opens source without baseline migrate).- Point
VOX_DB_PATHat a new file or delete the old DB. - Run any command that connects normally (e.g.
vox codex verify) -> apply baseline. vox codex import-legacy backup.jsonl(replace semantics — tables cleared then loaded).
Stage 2 — Historical vox_training_telemetry.db
Section titled “Stage 2 — Historical vox_training_telemetry.db”When: Older releases may have created vox_training_telemetry.db beside vox.db. Current Mens training uses VoxDb::connect_default against the canonical file only; a legacy primary returns LegacySchemaChain until Stage 1 completes (no automatic sidecar open or reset).
Cleanup: After primary migration, training rows live in canonical vox.db; delete or archive the sidecar file only after backup if it is no longer needed.
Stage 3 — Telemetry consumers
Section titled “Stage 3 — Telemetry consumers”- Align JSONL viewers with Populi envelope (
docs/src/reference/telemetry-metric-contract.md). - When changing
telemetry_schema, updatevox mens watch-telemetryand re-runvox ci data-ssot-guards.
Stage 4 — Publication / news
Section titled “Stage 4 — Publication / news”published_news.content_sha3_256gates syndication per content revision; seedocs/architecture/news_syndication_security.md.publication_attemptsis canonical for attempt history;news_publish_attemptsis legacy.
Rollback
Section titled “Rollback”- Keep
export-legacyJSONL artifacts until Stage 1 verification passes on a clone. - Do not delete primary DB until export verified.