Repository navigation
Share file restrictions and mode phrases across provider packages - #82
Merged
Merged
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
erickb336
commented
Oct 7, 2026
erickb336
left a comment
Owner
Author
There was a problem hiding this comment.
Codex review of commit 7f78dafcbcd31bd8429cd39f0c8fb1321fd4e403: no remaining findings.
Independent review checked mode phrases, owner checks, off precedence, saved-state compatibility, missing-module refusal, and unchanged existing hook/state tests. The launcher fixture only copies the newly required core directory; its assertions remain unchanged.
Build and check pass. The full suite passes: 479 tests, 479 pass, 0 fail. All four new test groups fail on detached main c1cd496 with only the test file copied over. Live provider sessions and automatic Codex enforcement were not tested in this extraction.
This was referenced Oct 7, 2026
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.
Third focused lifecycle split from #75, based on main
c1cd496after #80 and #81 merged.Mode-phrase recognition and the chief's direct-edit decision now live in the public core API. Claude still classifies prompt origin, changes session state, and supplies the actor and operation. Logbook path checks remain in its hook.
Scope and compatibility
sageflags withBooleanat its adapter boundary. This preserves the old handling of truthy saved values such as1and"on"and avoids an exception that could permit an edit.packages/sage-core/mode-policy.mjs; the direct-edit decision belongs inpackages/sage-core/file-policy.mjs. Provider prompt framing and logbook path checks stay in the Claude hook.Validation
Fake
ps,pgrep, andkillwere first on PATH for every test run. Fixtures use temporary saved state and logbook folders. Test commands reached parsers or hook inputs only.npm run buildbuilt 118 filesnpm run checkall checks passnode --test scripts/providers.test.mjs scripts/launcher.test.mjstests 35; pass 35; fail 0npm testtests 479; pass 479; fail 0git diff --exit-code origin/main -- scripts/sage-hook.test.mjs scripts/sage.test.mjsgit diff --check origin/mainFour new shared-policy tests fail on detached
origin/main(c1cd496) with only the provider test file copied over:tests 4; pass 0; fail 4. Main lacks the shared APIs and new module-failure handling. Run the cases withnode --test --test-name-pattern='shared file and mode extraction' scripts/providers.test.mjs.The saved-flag cases extend the new file-policy test. They exercise the real hook subprocess across four file tools with truthy and falsey saved flags. The added case failed on this extraction before repair at
Editwithsage=1, with no refusal. All 24 compatibility cases pass on main, confirming that the fix restores prior behavior.Independent review found no remaining issues after the saved-flag repair.
Not verified
A live Claude or Codex session and automatic Codex enforcement are outside this extraction.