Repository navigation
Add shared role admission and lead child limits - #83
Conversation
…sh-policy # Conflicts: # packages/sage-claude/hooks/command-policy.mjs # packages/sage-claude/hooks/sage-hook.mjs # packages/sage-core/command-policy.mjs # packages/sage-core/index.mjs # plugins/sage-codex/core/command-policy.mjs # plugins/sage-codex/core/index.mjs # plugins/sage/core/command-policy.mjs # plugins/sage/core/index.mjs # plugins/sage/hooks/command-policy.mjs # plugins/sage/hooks/sage-hook.mjs # scripts/providers.test.mjs
…e-policy # Conflicts: # packages/sage-claude/hooks/sage-hook.mjs # packages/sage-core/index.mjs # plugins/sage-codex/core/index.mjs # plugins/sage/core/index.mjs # plugins/sage/hooks/sage-hook.mjs # scripts/providers.test.mjs
…nto codex/shared-role-admission
erickb336
left a comment
There was a problem hiding this comment.
Codex review of cc7d5633c16b964e08446ff9300b1cacb9dfb8d1: no remaining findings.
Independent review checked role boundaries, atomic project/total/lead capacity limits, duplicate dispatch, durable preparations, journal corruption, and the prior UTF-8 repair. Existing hook, state, and launcher assertions remain unchanged.
Build and check pass. The full suite passes: 526 tests, 526 pass, 0 fail. All 47 new tests fail on detached main c1cd496; their names exactly match the added test inventory.
This core trusts authenticated provider identity. Capacity release, recovery, provider enforcement, and a live multi-agent workflow remain separate work. Merge #82 first.
…ission # Conflicts: # packages/sage-core/index.mjs # plugins/sage-codex/core/index.mjs # plugins/sage/core/index.mjs # scripts/providers.test.mjs
erickb336
left a comment
There was a problem hiding this comment.
Codex review of 7b000f3: no findings. Independent comparison confirms the merge has the identical tree as reviewed cc7d563; it only joins current main history. Build and check pass, and the full suite passes 526/526. All 47 new tests fail individually on detached main 8897db5. This PR now targets main; #82 is merged.
Fourth focused lifecycle split from #75. #82 is merged, and this PR includes current main
8897db5.This change packages the existing atomic role-admission core. It checks role rules and consumes capacity in the same journal operation. Only the chief can reserve a lead; leads can reserve only implementers, code/security/UX reviewers, and QA; specialists cannot reserve another layer. The three-lead and three-child limits stay inside project capacity and the temporary total fuse.
This does not activate the rules in installed sessions. The caller must authenticate issuer-role evidence. Native hooks, provider adapters, role instruction delivery, and the Claude nested-spawn work in #62 remain separate.
Validation
Fake
ps,pgrep, andkillwere first on PATH for every test run. The tests use temporary stores and parser or hook inputs; they run no real merge, push, or process-list command.npm run buildbuilt 130 filesnpm run checkall checks passnpm testtests 526; pass 526; fail 0git diff --check origin/mainThe 47 added tests cover assignment identity, immutable retries, both capacity limits, lead and child limits, concurrent last-slot publication, journal corruption, post-publication sync failure, child binding, durable briefs, and prepared dispatch. All 47 fail on detached
origin/main(8897db5) with the new test file copied in:tests 47; pass 0; fail 47. The exact test-name sets were compared. Existing hook, launcher, and provider test bodies remain unchanged.Review found and fixed one journal corruption gap: invalid UTF-8 could decode to the same replacement character as a valid original record. The new regression failed before the repair. The reader now checks the original bytes before JSON/hash validation; both reads and new admission refuse the damaged record.
Independent review found no remaining blocking issues.
Limits
Reservations remain held until a later verified completion protocol. Reports, stops, elapsed time, or reactivation do not free capacity. The legacy roleless API does not apply role rules; native integration must consistently select the appropriate role-aware API. No live Codex or Claude lifecycle is proved by this core split.