Skip to content

Release admission slots from exact terminal evidence (T21) - #158

Merged
erickb336 merged 3 commits into
mainfrom
codex/t21-terminal-admission
Oct 13, 2026
Merged

erickb336 merged 3 commits into
mainfrom
codex/t21-terminal-admission

Conversation

@erickb336

@erickb336 erickb336 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Closes #157
Sage task T21

Verified completion and interruption can release an assignment's admission slot without deleting its history. The journal requires an exact saved child binding and current owner epoch. Identical retries preserve one terminal record; conflicting outcomes or interruption hashes are refused. A late event cannot release a newer assignment.

Unfinished work still occupies total, project, lead and team limits. Completing a lead keeps its children's slots held. Completed issuers cannot prepare or reserve new work. The Codex binding adapter refuses renewed instructions for a terminal assignment. Valid terminal evidence remains recordable while Sage is off without changing mode.

Security review found a race between the adapter snapshot and its binding call. The core now refuses terminal assignments inside the atomic binding transition, before the idempotent retry return. The new regression covers completed and interrupted bindings in both provider bundles.

The core APIs trust the provider adapter to authenticate the caller and prove native terminal evidence. No lifecycle callback is newly wired here. This changes packages/sage-core/admission.mjs, its public export and documentation, the Codex binding adapter, and packaged tests. The shared state tool and Claude hooks remain unchanged. Plugin output comes from the build.

Validation uses fake ps, pgrep and kill first on PATH:

Command Result
npm run build after main integration built 267 files
npm run check after main integration all checks pass
node --test scripts/providers.test.mjs before main integration tests 150; pass 150; fail 0
Nine new checks on detached main eac3614 tests 9; pass 0; fail 9
Final repaired focused checks tests 9; pass 9; fail 0
New binding regression on detached pre-repair 58ae322 tests 1; pass 0; fail 1: missing expected exception
Full suite started on 3b566a2 before main integration and the repair tests 1026; pass 1026; fail 0; cancelled 0; skipped 0

Each new test fails with only the updated test file copied to detached main. Main has no completion/interruption API. This proves missing functionality. The new terminal-binding regression also fails behaviorally on detached pre-repair 58ae322 and passes after the atomic repair. Tests cover identity mismatch, duplicate and late terminal events, preserved child capacity, project and role limits, off-mode evidence, and concurrent completion/reservation publication. Both provider bundles are tested in isolation.

The branch includes main 5d1345b through PR #156. All nine repaired-head focused tests pass. Two code, security and QA review cycles are clean at f93e82231217332f8964107ef990abdb47fb0b72. Final-head CI run 38387743694 passes: 1,033 tests, 1,033 pass, 0 fail, 0 cancelled, 0 skipped. All owned local test and push processes exited.

Not verified here: native terminal provenance, automatic reconciliation, report or verdict acceptance, logbook run completion, failed dispatch before binding, later-turn reuse, real-model behavior or installed automatic Sage. Those remain separate integration work. Automatic Sage remains incomplete; see #88.

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.

Release admission slots from exact terminal evidence (T21)

1 participant