Skip to content

Normalize executable names in shared write checks (T45) - #206

Merged
erickb336 merged 2 commits into
mainfrom
codex/t45-writer-program-names
Oct 13, 2026
Merged

erickb336 merged 2 commits into
mainfrom
codex/t45-writer-program-names

Conversation

@erickb336

@erickb336 erickb336 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

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:

  • npm run build: passed.
  • npm run check: all checks pass (3 timing bounds carry a timing-ok annotation).
  • node --test --test-name-pattern=T45: scripts/providers.test.mjs: 3 passed, 0 failed.
  • Detached main 40c085a with the same tests: 0 passed, 3 failed behaviorally. Main misses CP.exe as a writer permits its protected output target, and falsely refuses printed data under a normalized reader name.
  • Fake ps, pgrep, and kill come first on PATH. Test command strings go only to the parser.

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.

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.

Normalize executable spellings in shared shell-write checks (T45)

1 participant