Repository navigation
Share merge and push command rules across provider packages - #80
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
erickb336
left a comment
There was a problem hiding this comment.
Codex review at 317fe252dad9795aedbf7ca8be84926aa3310441: no blocking findings. Independent code review confirmed that T199, the verified/pr-ready transition, import failure guards, and broken-state merge diagnostics remain intact. Existing hook, launcher, and state tests are unchanged from main. Generated files match source.
Fresh validation on main 886b1f6: build 112 files; check passed; full suite 475 tests, 475 pass, 0 fail. The three new tests all fail individually on detached main with only the test file copied over. CI run 37685382433 passed on this commit.
No live provider session or real GitHub write was tested. The shared push API still requires its documented synchronous branch-reader contract. Ready for the owner's merge; this review does not claim automatic Codex enforcement.
Second focused lifecycle split from #75, based on main
886b1f6after #78 and #79 merged. The branch includes both merged behaviors and the reviewed whitespace correction.Claude keeps its existing merge and push rules. Their command classification now lives in core, so both provider bundles can use the same rules. The provider still reads the checkout branch, checks the verdicts, and handles the first creation of main.
Scope and compatibility
packages/sage-core/command-policy.mjsandpackages/sage-core/push-policy.mjs. Provider first-upload handling stays in the Claude hook.Validation
Fake
ps,pgrep, andkillwere first on PATH for every test run. Command strings went only to parsers and hook inputs, never to a real shell.npm run buildbuilt 112 filesnpm run checkall checks passnode --test scripts/providers.test.mjstests 14; pass 14; fail 0npm testtests 475; pass 475; fail 0git diff --exit-code origin/main -- scripts/sage-hook.test.mjs scripts/launcher.test.mjs scripts/sage.test.mjsgit diff --check origin/mainThree new tests cover merge syntax and harmless text, push restrictions and injected branch evidence, and missing transitive modules plus broken-state diagnostics. In a detached worktree from
origin/main(886b1f6), copy only the provider test file and run itsshared merge and push extractioncases:tests 3; pass 0; fail 3. Main lacks the shared APIs and transitive-module checks.Independent review found no blocking issues.
Not verified
The push API expects a synchronous branch reader that returns a normalized branch name or undefined. Claude already supplies that form; other provider callers are not integrated here.
Live provider sessions and real GitHub writes were not tested. Automatic Codex enforcement remains separate work in #75.