Repository navigation
Normalize executable names in shared write checks (T45) - #206
Merged
Merged
Conversation
erickb336
marked this pull request as ready for review
October 13, 2026 20:13
This was referenced Oct 13, 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.
Closes #205
Sage task T45
Codex's shared write checks now recognize executable names with mixed case and a trailing .exe. CP.exe cannot hide a protected logbook write; RG.exe --pre and FILE.exe -C retain their reader-option checks. Ordinary reader arguments still pass, including cat.exe cp and the lowercase -c option of FILE.exe.
This is the shared-classifier part of #97 and supports #88. It reuses the existing programName helper instead of adding another spelling rule. The active Claude hook, PowerShell parsing, and #140 files stay unchanged. No owner decision is needed. Full automatic Sage remains separate work.
Edit paths: packages/sage-core/shell-write-policy.mjs and shell-path-policy.mjs. npm run build generates both plugin copies. Tests call the public core API from isolated plugin copies and check both classification and protected paths.
Validation on 4b02a8c:
A final parser check found that PRINTF.exe treated printed logbook text as a protected target, unlike printf. The repair normalizes the path-check reader comparison and adds a positive scratch-output case plus a protected-redirection refusal. Two clean code/security/QA cycles passed on unchanged 4b02a8c. The full local command npm test -- --test-concurrency=1 passed: 1,174 passed, 0 failed, 0 skipped. Exact-head CI passed with 1,174 tests: https://github.com/erickb336/sage/actions/runs/38459702801. All six review cycles and required checks passed on the same commit. No real executable, sandbox enforcement, installed hook, or real-model pilot was tested by this change.