Files
cto/.sot/03-PROTOCOLS/CTO-CODEX-RETENTION-DRY-RUN-PACKET.md
2026-06-04 13:09:59 -04:00

73 lines
2.3 KiB
Markdown

---
name: cto-codex-retention-dry-run-packet
tier: T1
status: validated
owner: jp
source: CTO-WORK-093
last_reviewed: 2026-06-04
description: Local CTO dry-run packet for Codex retention pressure.
---
# CTO Codex Retention Dry-Run Packet
Local planning SOT only. Not a Core Protocol. Not active Core authority.
## Claim
Codex retention pressure is measurable without reading raw transcripts or mutating `~/.codex`.
## Context
Core S410 already reduced Core-owned successful Validator stdout. Remaining pressure is external Codex state: session JSONL files and Codex SQLite logs. CTO records the operator-facing dry-run boundary because Codex is an admitted model provider surface, not Cortex OS authority.
Measured state on 2026-06-04:
| Surface | Value |
| --- | --- |
| `~/.codex` | 5.4G |
| `~/.codex/sessions` | 2.3G |
| session JSONL files | 1,038 |
| JSONL files over 10MB | 51 |
| JSONL files over 50MB | 3 |
| `logs_2.sqlite` | 2.7G |
| `logs_2.sqlite-wal` | 268M |
| log rows | 1,140,357 |
| archived threads | 0 |
| active threads | 1,038 |
Largest log families are responses websocket, `codex_otel.log_only`, and `codex_otel.trace_safe`.
## Dry-Run Tool
`python3 tools/report_codex_retention_pressure.py` emits metadata-only JSON:
- storage bytes;
- session JSONL counts and size bands;
- thread archive counts;
- log row count and top log targets;
- blocked mutation list.
It does not read transcript bodies, update SQLite, delete files, vacuum databases, archive threads, mutate Core, start Runtime, read secrets, change Codex config, or claim product readiness.
## Policy
Prevention default: use `codex exec --ephemeral` for disposable non-interactive worker runs.
Blocked without explicit operator approval:
- direct `threads.archived` updates;
- session JSONL deletion;
- logs table deletion;
- SQLite vacuum or checkpoint;
- raw transcript import into Core;
- broad cleanup of `~/.codex`.
## Decision
Use the dry-run report as the next operator gate. If cleanup is approved later, execute it as backup-first, archive-first, delete-last work. Core remains out of raw transcript retention authority.
## New Issues
- must-fix: existing Codex state has 1,038 active threads and no archived threads.
- follow-up: check whether Codex 0.137.0 adds native retention commands before custom cleanup.