Repository navigation
Keep one active lead per project task (T31) - #178
Merged
Merged
Conversation
This was referenced Oct 13, 2026
erickb336
marked this pull request as ready for review
October 13, 2026 15:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fromnpm 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.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 atsecond_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.