Nightly Codex vacuum
A direct housekeeping timer that checkpoints and vacuums Codex local sqlite stores so long-running Symphony usage does not accumulate bloated telemetry databases.
Operating model
timed jobUnlike report routes, this timer does not create a Linear issue. It runs as the symphony user, scans CODEX_HOME for Codex sqlite stores, folds WAL files back into the main databases, and vacuums each store.
Large WAL-backed stores can stall checkpoints and make agent sessions sluggish. This job keeps the local rollout stores from becoming an operational drag.
System shape
click the nodesThe direct housekeeping path is intentionally narrower than the report routes: no workspace, no Codex turn, and no Linear issue.
Cadence design
compare modesEach timed job has a small set of modes that decide whether the run is healthy, degraded, or ready to create follow-up work. Use the controls to compare the operating contract.
Find only Codex sqlite stores
The script uses a narrow CODEX_HOME search and nullglob so missing stores are a no-op, not a failure.
- CODEX_HOME resolved
- logs_*.sqlite glob checked
- state_*.sqlite glob checked
- no-store path exits 0
Run manually and inspect journal output before trusting the nightly cadence.
Execution tracks
interactiveThe tracks make each run inspectable. They separate inputs, outputs, and failure modes so reports do not collapse into vague status updates.
Scope
Limit maintenance to Codex telemetry and state stores under CODEX_HOME.
- CODEX_HOME
- logs_*.sqlite
- state_*.sqlite
- database list
- nothing-to-vacuum message
- bounded maintenance scope
Maintenance risk map
priority mapThe script is narrow, but these details protect it from being either ineffective or too aggressive.
968884786854Output rubric
ticket rulesThe run should create follow-up work only when the output is concrete. Use the rubric to keep reports, bug tickets, and operational follow-ups separated.
Vacuumed
One or more stores were compacted and before or after byte counts were printed.
- logs_2026.sqlite compacted
- state_2026.sqlite compacted
Run contract
evidence rowsThe contract is small: discover bounded database files, compact them with SQLite, and print enough evidence for systemd logs.
Direct timer
symphony-codex-vacuum.timer starts symphony-codex-vacuum.service as the symphony user.
No issue route
The job does not create Linear issues and does not invoke Codex. It is host maintenance with systemd as the control plane.
CODEX_HOMEsqlite3 present on PATHlogs_*.sqlite files discoveredstate_*.sqlite files discoveredwal_checkpoint(TRUNCATE) runVACUUM runBefore and after byte countsNo-store no-op message when applicableCommand plan
operator pathOperators can install, run, and inspect this job entirely through systemd and the script.
sudo -u symphony /opt/symphony/elixir/scripts/codex_logs_vacuum.shsudo systemctl enable --now symphony-codex-vacuum.timersystemctl list-timers | grep symphony-codex-vacuumjournalctl -u symphony-codex-vacuum.service -n 80 --no-pagerThe script intentionally fails when sqlite3 is unavailable. Install the package instead of hiding the failure.
Rollout path
ship safelyInstall sqlite3 dependency
Confirm sqlite3 is on PATH for the symphony user.
Run manually once evidence
Inspect before and after byte counts and no-op behavior before enabling the timer.
Enable nightly timer systemd
Install the service and timer units, daemon-reload, and enable the timer.
Inspect journal drift ops
Check for repeated setup failures, wrong CODEX_HOME, or unexpectedly large stores.