Skip to content

Recover authenticated Codex task updates safely (T13) - #257

Merged
erickb336 merged 4 commits into
mainfrom
codex/t13-task-update-boundary
Oct 17, 2026
Merged

erickb336 merged 4 commits into
mainfrom
codex/t13-task-update-boundary

Conversation

@erickb336

@erickb336 erickb336 commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #253

Sage task T13

The authenticated chief can update a task's title, branch, PR and state through sage_update_task. Exact retries return the saved historical result without overwriting later changes. Unknown outcomes preserve the transaction until recovery. Stale versions now request a fresh read and new UUID; pending updates request the original UUID and identical contents.

The shared planner preserves CLI argument order and lead retirement. The native route uses fixed ownership, task versions, current readiness checks and a recoverable transaction across tasks, runs, decisions and admission. Managed work cannot gain authority during publication. Disruptive changes invalidate earlier preparations. Authenticated terminal evidence can settle old work without granting new authority.

Candidate 7cec7f5cfaa68144f7cf28509c26d0eabca26001 repairs CODE-T13-1 and has two clean independent code/security/UX/QA cycles. All findings are closed. Exact-head CI run38995483360 passed all1,604 tests with zero failures, cancellations or skips. Both clean cycles, local checks and native verification are complete. The terminal reader distinguishes the exact pending receipt from completed history. It checks the full intent and independent journal outcome. Only that pending receipt may lack an acknowledgement; an existing hash must match. Pending receipts never supply completed transition edges. Every other receipt keeps full history authentication. SEC-T13-1 and earlier UX/QA findings remain independently resolved.

Changes and validation

Sources are in packages/sage-core/ and packages/sage-codex/runtime/. Plugin copies come only from the build. The repairs add bounded recovery guidance, six deterministic publication races, twenty interrupted-publication terminal/report cases, and authenticated historical outcomes with seventeen security and control tests.

Every test command uses fake process commands first on PATH and unsets NODE_TEST_CONTEXT. Attack inputs never go to a real shell.

Command Result
npm run build built 317 files
npm run check all checks pass (4 timing bounds carry "// timing-ok:")
node --test --test-name-pattern='T13:' scripts/codex-server.test.mjs Prior published candidate: 47 passed; included again in the final full suite
node --test --test-name-pattern='UX-T13-1:|QA-T13-1:|QA-T13-2:' scripts/codex-server.test.mjs Prior published candidate: 34 passed; included again in the final full suite
npm test 1,604 tests, 1,604 passed, 0 failed, 0 cancelled, 0 skipped; exit 0
git diff --check No output; exit 0
node scripts/probe-codex-lifecycle.mjs --sage-update-task Codex CLI 0.160.0: fresh update, historical retry, current snapshot, released fence, no dispatch; verified true; cleanup true; exit 0

The native probe uses simulated model responses in a temporary profile. It changes no installed trust or mode settings. The earlier read-only control passed on the parent commit; it was not repeated for this repair.

Round-two evidence

The 40 focused history, publication and security checks passed. The round-two native update probe passed with simulated responses; the round-three probe also passed with five requests, exact fresh/retry evidence and cleanup.

The first 16 security tests failed on detached main because its task-update module is absent. On published parent c9becc1, nine failed and seven passed: seven failures expose outcome or terminal-history gaps, and two expose incorrect corruption guidance. Four passing invalid-callback cases were weak: the test helper failed during release for an unrelated reason. The corrected helper resolves the exact saved update and includes a valid-history control.

An isolated control passed all five callback tests. Removing only proof validation, while preserving callback invocation and release, made all four invalid-proof tests fail with a missing-exception assertion. The valid callback still passed. The isolated mutation was restored. This is sensitivity evidence; the earlier callback passes alone were insufficient. The terminal-history regression changes a rejected receipt and its proposed table after-images while leaving the journal rejected; it is broader than receipt-only corruption.

Round-three evidence

The final combined task-update, security, recovery, guidance and publication checks passed 115/115. Twelve new tests cover held-child completion before and after acknowledgement, corrupted outcomes, mismatched intents, malformed pending markers, unrelated historical corruption and an incorrect acknowledgement hash. Corrupt-data cases restore valid bytes and then complete the same child. Valid completion preserves pending work and the unfinished logbook run; it grants no tool authority.

The final twelve tests were copied without production changes to detached ac8e957. Seven controls passed; five assertions failed behaviorally: the direct pre-ack completion and four completion assertions after valid bytes were restored. On detached main 5cf760a, all twelve fail because the task-update API is absent. The baseline proves feature absence only; the parent failures isolate the repaired behavior.

Failure evidence

The original 47 tests were copied, without production backports, to detached main 5cf760a8d856c921d97f0753011c1bc3d2d06148. All failed: one CLI planner test observed two retirement decisions instead of one; the other 46 failed because the task-update API is absent. All 34 repair tests also fail on that detached main because the API is absent. These missing-API results prove absence, not internal correctness.

The eight new UX tests all fail behaviorally on published parent 6984b89, which returns the same generic retry message. The repaired implementation passes all eight.

The six race tests pass against the unchanged published parent. Removing only its retired-preparation generation guard in an isolated copy makes all three update-wins cases fail: initial dispatch, continuation and another owner. The three reservation-wins controls still pass. The mutation was restored.

Earlier controlled mutations also showed that the tests detect removal of the post-evaluator transaction fence, captured preparation generation, current-head readiness filter, and running-reviewer refusal. Each unmodified control passed. The legacy-table test failed before its compatibility repair and passes afterward.

The first repair-test drafts had fixture errors: rejected transactions have no accepted-fence release field, core preparation returns a wrapper, unchanged tables have no rename boundary, and report receipts contain parsed fields. Valid CLI arguments and legal state transitions were also corrected. Failed outputs were retained. No admission or terminal protection was weakened to make these tests pass.

Reachability and limits

Eight tests exercise first authenticated completion before and after the changed tasks/decisions publications. They first corrupt the pending proof and confirm refusal, then restore exact proof and confirm one completion. Runs remain unchanged in this case, so no runs rename occurs.

Twelve tests cover all three changed tables after authentic child completion. They verify late reports, idempotent completion replay, blocked logbook writes, and exact recovery. These completed replays do not prove traversal of the first-completion snapshot validator. Each case first proves that unsettled work prevents the disruptive update.

This does not complete cross-worktree PR ownership (#239), trusted execution context (#243), abrupt-child recovery (#246), or installed automatic Sage. No real-model pilot or operating-system power-loss test is claimed. Defaults remain unchanged. Claude-owned #119, #105 and #67 are outside this change.

@erickb336
erickb336 marked this pull request as ready for review October 17, 2026 02:42
@erickb336
erickb336 merged commit 443c00a into main Oct 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish authenticated Codex task updates with full transition recovery (T13)

1 participant