Skip to content

Add shared role admission and lead child limits - #83

Merged
erickb336 merged 11 commits into
mainfrom
codex/shared-role-admission
Oct 7, 2026
Merged

erickb336 merged 11 commits into
mainfrom
codex/shared-role-admission

Conversation

@erickb336

@erickb336 erickb336 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

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, and kill were 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.

Command Last result
npm run build built 130 files
npm run check all checks pass
npm test tests 526; pass 526; fail 0
git diff --check origin/main Exit 0

The 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.

…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

@erickb336 erickb336 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
erickb336 changed the base branch from codex/shared-file-mode-policy to main October 7, 2026 22:32

@erickb336 erickb336 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

1 participant