C1 Staging Codex R1 Fixes Ready for R2 — Index
C1 STAGING — CODEX R1 FIXES READY FOR R2 — INDEX
Session: C1-STAGING-CODEX-R1-FIXES-2026-06-23 Date: 2026-06-23 Mode: PATCH staging-lane files only; static/no-write validation; NO dry-run; NO sandbox DB; official runtime read-only.
Input verdict (Codex review revision 1)
CODEX_REJECT_C1_STAGING_BAD_INPUT_FAIL_OPEN — dry-run NOT authorized.
Output verdict (this macro)
C1_STAGING_CODEX_R1_FIXES_READY_FOR_CODEX_R2
Preceded by self-review gate: CLAUDE_CODEX_STYLE_SELF_REVIEW_PASS.
What changed (only under /opt/incomex/staging/c1/)
- Fix 1 — injection:
_common.shnow invokes psql as explicit argv viadocker exec <c> psql. Nosh -lc, noeval, no$*re-parse. User values pass as psql-vargv words. Unpredictable in-containermktemptemp + EXIT-trap cleanup. TTL format validated. - Fix 2 — SBX propagation: P1 emits
SANDBOX_JSON {sandbox_id,sandbox_db,created}; new reviewedplan/c1-staging-fast-dry-run.plan.shcaptures it via jq underset -euo pipefailwith an EXIT-trap cleanup and a Codex-R2 confirmation gate. No placeholder. - Fix 3 — P5 fail-closed: exact-oracle harness; pass only on exact reject_code/SQLSTATE; accepted bad input or unexpected exception = FAIL; FATAL
DOgate raises unless 9/9 pass, 0 fail, 0 accepted, residue=3. - Fix 4 — P6 false-PASS: FATAL
DOgate (P3/P4/P5 ledger present, 3 validated ops, 9/9 matrix, isolation proof case8=42P01, 0 orphan) runs BEFORE any digest/PASS is emitted. - Fix 5 — TTL honesty: typed
expires_atstored; docs state TTL is advisory/manual; cleanup is P2 / dry-run EXIT trap, NOT an automatic timer. - Bonus (Codex-required #3 + A7): P4 fail-closed gate; P3 exact-set postcondition; P2 records drop-attempt before / drop-success only after readback.
Headline proofs
- Official runtime BEFORE == AFTER == AFTER-AFTER:
dot_tools=309, contracts=2, table_registry=21, gba=0, appr=231, apr_action_types=14, authorize_build_step.handler_ref=unimplemented, c1/staging-in-dot_tools=0, APR-0415=pending, staging_dbs=0; identical DB list (no new database). - staging_DBs = 0 throughout; no sandbox created; no dry-run executed; no
evidence/dir. bash -n8/8 OK; shellcheck CLEAN; injection grep = only quoted"$@"argv passthrough; guard self-tests 9/9 expected; SQL dollar-quote/txn balanced; registry sha256 self-consistent; registry+ledger valid JSONL.
Files
00-index · 01-codex-r1-findings · 02-before-official-runtime-snapshot · 03-fix-injection-risk · 04-fix-sbx-propagation · 05-fix-p5-fail-closed-harness · 06-fix-p6-evidence-false-pass · 07-fix-ttl-cleanup-policy · 08-static-no-write-validation · 09-after-official-runtime-snapshot · 10-final-decision · 11-codex-style-self-review-matrix · 12-self-review-command-outputs · 13-self-review-final-gate
Gates
- ready for Codex R2 review: YES
- ready to run dry-run without Codex: NO
- ready for promotion: NO
- ready for production: NO