Skip to content

Validate shared command and push policy configuration - #75

Merged
erickb336 merged 47 commits into
mainfrom
codex/lifecycle
Oct 12, 2026
Merged

erickb336 merged 47 commits into
mainfrom
codex/lifecycle

Conversation

@erickb336

@erickb336 erickb336 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

This PR rejects malformed provider configuration before shared command and push checks run. It completes the remaining shared-core validation from the Codex lifecycle split. It references #55 and #88. The five original splits merged as #78, #80, #82, #83, and #84.

The remaining changes reject invalid trusted command-policy paths, invalid push-policy configuration, and malformed branch-reader results. They freeze returned policy objects and export the existing commandText reader. They do not change the parser. The diff also retains compatibility checks, command-reader documentation, and a complete-plugin test fixture.

The branch includes main 69cb227, through #123. Reviewed head: fa31ca00b04a67da612c41bf4985d797a5486510. The Claude hook and shared state tool match main exactly. No work from Claude's open #124 branch is included.

Validation

Every test command used fake ps, pgrep, and kill first on PATH. Test command text went to parsers or hook inputs, not a real shell. No test ran a real merge or push.

Command Last result
npm run build built 236 files
npm run check all checks pass
npm test tests 873; pass 873; fail 0; cancelled 0; skipped 0
git diff --check Exit 0

Regression comparison: the eleven retained provider tests ran unchanged on detached main 69cb227, with only the test file copied. Result: tests 11; pass 8; fail 3. The failures cover invalid trusted paths, refusal after an invalid path prevents command-policy loading, and invalid branch-reader/message configuration. These are behavior failures, not missing dependencies. The eight passing tests are compatibility controls, not evidence of new behavior. All eleven pass in the branch's full suite.

Baseline command: node --test --test-name-pattern='missing shared file policy|missing shared mode policy|shared command reader|shared command policy|shared push policy' scripts/providers.test.mjs.

Review and remaining limits

Independent code review found a P2 regression: the new validation rejected Unicode spaces that Git permits in branch names. Commit fa31ca0 fixes it by rejecting ASCII spaces and controls. Added assertions use Git's branch validator and parser-only push text for nonbreaking and em spaces. The assertion failed on prior head 9ab57f5 and passes after repair. This preserves behavior already accepted by main.

The repair restarted review cycles. Two clean cycles, each with separate code, security, and QA reviewers, completed on exact head fa31ca00b04a67da612c41bf4985d797a5486510. The second cycle used fresh reviewers. No source changes followed those reviews. Reviewers checked the full residual diff, caller denial handling, main push/merge boundaries, test evidence and generated copies. They did not rerun the parent-owned full suite.

Build, check, and all 873 tests pass on the repaired head. GitHub CI passed on that same head: https://github.com/erickb336/sage/actions/runs/38209677848. The PR is ready for owner merge review; no merge was performed.

Automatic Codex work remains on codex/issue-88-native-followup, tracked by #88. This PR does not contain its later runtime changes or establish installed operation. Complete policy, broader recovery, a real-project pilot, and gated autopilot remain incomplete. The SDK advisory remains tracked by #94.

No live Claude or real-model pilot ran. All validation processes exited.

@erickb336

Copy link
Copy Markdown
Owner Author

Two more focused splits are verified and backed up as branches. Their PRs remain unopened pending review of #78.

Split Branch Validation
Merge/push command policy codex/shared-merge-push-policy (c197078) Build/check pass; 474 tests pass; independent review has no blocking findings
File-edit policy and mode phrases codex/shared-file-mode-policy (261d216) Build/check pass; 478 tests pass; independent review clean after a saved-state compatibility repair

They form a chain on #78. Existing hook tests are unchanged. The file/mode split adds core files to one launcher fixture without changing assertions or release metadata.

#79 is the separate #76 follow-up; its CI passes and it awaits review. #77's documentation change is prepared locally. The lead/child split is under a dependency audit: atomic capacity checks must stay with role limits; native hooks remain the final split. No claim of installed Codex lifecycle enforcement is made by these prepared core branches.

@erickb336

Copy link
Copy Markdown
Owner Author

The fourth split is verified and backed up on codex/shared-role-admission (96b7aa7), following the file/mode split. Its PR remains unopened pending the preceding reviews.

Build: 130 files. Check: all checks pass. Full suite: 525 tests passed, 0 failed. All 47 added tests fail on detached main. Independent review found no remaining blockers after a malformed-UTF-8 journal corruption fix; that regression failed before repair.

This split checks role rules and capacity in one atomic core operation. It does not authenticate native actors, release completed reservations, or activate installed-session enforcement. Those boundaries remain explicit. Claude nested-spawn work in #62 remains separate, as does the final Codex runtime/native-hook split.

@erickb336

Copy link
Copy Markdown
Owner Author

The fifth split is backed up on codex/codex-runtime at 249f16a, built on the four preceding splits. It has no PR yet; publication waits for the preceding review.

It packages the inactive Codex runtime and shared role instructions. Build produced 212 files, check passed, and the full suite passed all 642 tests. All 117 added tests fail individually on detached main (ea9f728); their names match the passing test inventory. Independent review found no blocking findings. The generated Claude agents and report skill are byte-identical to the prior split. Existing assertions, earlier policy fixes, and installed hook manifests remain unchanged.

Automatic Sage remains unfinished: complete tool policy, report acceptance, capacity release, lifecycle recovery, activation wiring, and a real-project pilot remain. The draft also records the unresolved fast-uri 3.1.0 advisory embedded in MCP SDK 2.3.1. This split preserves the existing pins and does not activate the runtime.

@erickb336

Copy link
Copy Markdown
Owner Author

Extraction coverage note: the five prepared branches preserve the earlier policy fixes and installed Claude behavior. The saved broad draft also validates command-policy setup paths and push-policy callbacks, validates branch-reader return values, and freezes those policy objects. Those extra API changes are not runtime dependencies and were not included in the behavior-preserving extractions. They remain here for separate review.

The draft's command-reader and mode-policy notes also remain here. The former predates merged T199; the latter describes an earlier fixture-based mode probe. The extracted runtime has current contracts for its tested behavior and remaining gaps.

Issue #77 is now fully checked and backed up on codex/t199-expanded-word-docs at 32203d7: build 102 files, check passed, tests 468 passed / 0 failed. It changes one README row and one skill sentence, plus generated output. No code or tests changed. Its PR remains queued while the current reviews are open.

# Conflicts:
#	packages/sage-claude/agents/chief-of-staff.md
#	packages/sage-claude/hooks/command-policy.mjs
#	packages/sage-claude/hooks/command-reader.mjs
#	packages/sage-claude/hooks/sage-hook.mjs
#	packages/sage-core/command-policy.mjs
#	packages/sage-core/command-reader.mjs
#	packages/sage-core/index.mjs
#	plugins/sage-codex/core/command-policy.mjs
#	plugins/sage-codex/core/command-reader.mjs
#	plugins/sage-codex/core/index.mjs
#	plugins/sage/core/command-policy.mjs
#	plugins/sage/core/command-reader.mjs
#	plugins/sage/core/index.mjs
#	plugins/sage/hooks/command-policy.mjs
#	plugins/sage/hooks/command-reader.mjs
#	plugins/sage/hooks/sage-hook.mjs
#	scripts/providers.test.mjs
#	scripts/sage-hook.test.mjs
# Conflicts:
#	packages/sage-claude/hooks/sage-hook.mjs
#	packages/sage-core/command-policy.mjs
#	packages/sage-core/index.mjs
#	packages/sage-core/pull-request.mjs
#	packages/sage-core/push-policy.mjs
#	plugins/sage-codex/core/command-policy.mjs
#	plugins/sage-codex/core/index.mjs
#	plugins/sage-codex/core/pull-request.mjs
#	plugins/sage-codex/core/push-policy.mjs
#	plugins/sage/core/command-policy.mjs
#	plugins/sage/core/index.mjs
#	plugins/sage/core/pull-request.mjs
#	plugins/sage/core/push-policy.mjs
#	plugins/sage/hooks/sage-hook.mjs
# Conflicts:
#	packages/sage-claude/hooks/sage-hook.mjs
#	plugins/sage/hooks/sage-hook.mjs
#	scripts/providers.test.mjs
# Conflicts:
#	packages/sage-core/admission.md
#	packages/sage-core/admission.mjs
#	packages/sage-core/index.mjs
#	plugins/sage-codex/core/admission.md
#	plugins/sage-codex/core/admission.mjs
#	plugins/sage-codex/core/index.mjs
#	plugins/sage/core/admission.md
#	plugins/sage/core/admission.mjs
#	plugins/sage/core/index.mjs
#	scripts/providers.test.mjs
# Conflicts:
#	packages/sage-codex/runtime/mcp-sdk.md
#	packages/sage-core/index.mjs
#	plugins/sage-codex/core/index.mjs
#	plugins/sage-codex/runtime/mcp-sdk.md
#	plugins/sage/core/index.mjs
#	scripts/providers.test.mjs
@erickb336 erickb336 changed the title Preserve Codex lifecycle work for staged review Validate shared command and push policy configuration Oct 12, 2026
@erickb336
erickb336 marked this pull request as ready for review October 12, 2026 05:57
@erickb336
erickb336 merged commit e8b823d into main Oct 12, 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.

1 participant