Skip to content

Keep one active lead per project task (T31) - #178

Merged
erickb336 merged 2 commits into
mainfrom
codex/t31-lead-ownership
Oct 13, 2026
Merged

erickb336 merged 2 commits into
mainfrom
codex/t31-lead-ownership

Conversation

@erickb336

@erickb336 erickb336 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Closes #177
Sage task T31

A project task now keeps one active lead across owner sessions. Its team retains ownership until the matching work completes or has a proven dispatch failure. A child with a different task ID still retains its lead’s task through the issuer binding. Identical retries and unrelated tasks continue to work.

Existing journal records keep their original rules during replay. New reservations check ownership inside the atomic admission transaction. The upgrade fixture was generated by the public API on main c241ec1, with two overlapping leads and one later completion.

Sources: packages/sage-core/admission.mjs, packages/sage-core/role-policy.mjs, and admission documentation. Generated plugin copies come from npm run build. Provider fixture changes keep existing assertions and give independent leads distinct tasks.

Validation on 3b95d53748117739fad045ac55dc34d1073638bb:

  • npm run build: generated 278 files.
  • npm run check: all checks pass.
  • node --test --test-name-pattern='lead ownership|shared role delivery' scripts/providers.test.mjs: 6 tests, 6 pass, 0 fail.
  • node scripts/probe-codex-lifecycle.mjs --sage-lead-ownership: verified true on Codex CLI 0.160.0. Two spawn requests, one spawn result, one child, one reservation, normal completion, temporary profile removed.
  • npm test: 1,120 tests, 1,120 pass, 0 fail, 0 cancelled, 0 skipped.
  • Exact-head CI run 38417339414: success; 1,120 tests, 1,120 pass, 0 fail, 0 cancelled, 0 skipped.

Regression proof: copied the four new tests and historical fixture to a detached worktree at main c241ec1. node --test --test-name-pattern='lead ownership' scripts/providers.test.mjs: 4 tests, 0 pass, 4 fail. These are missing behavior failures. The same native probe fails main at second_lead_not_denied; its temporary profile is removed.

Review found and repaired historical replay, differing child-task ownership, and concurrent-worker cleanup. Code, security, and QA each completed two clean review cycles on unchanged final head 3b95d53748117739fad045ac55dc34d1073638bb.

Not verified: real-model consumption, installed automatic Sage, complete policy composition, or continuation on an existing lead. The native probe uses simulated model responses in an isolated profile. Installed automatic Sage remains disabled. This is one component of #88 and #138; those issues remain open.

Every test and probe uses fake ps, pgrep, and kill first on PATH. No attack strings run in a real shell. Owned probe children complete and temporary profiles are removed.

@erickb336
erickb336 marked this pull request as ready for review October 13, 2026 15:00
@erickb336
erickb336 merged commit eac1945 into main Oct 13, 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.

Keep one initial Sage lead per task across Codex owners (T31)

1 participant