Skip to content

Use shared output-writer checks in the active hook (T49) - #211

Merged
erickb336 merged 2 commits into
mainfrom
codex/t49-hook-output-writers
Oct 14, 2026
Merged

erickb336 merged 2 commits into
mainfrom
codex/t49-hook-output-writers

Conversation

@erickb336

@erickb336 erickb336 commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Closes #99
Sage task T49

The active hook now uses shared output-writer checks. Both the chief and child agents refuse recognized output commands aimed at the logbook. Ordinary scratch outputs and reads retain their behavior.

This completes the remaining hook portion of #99. Shared API branch-write protection already merged in #198; shared output-file classification merged in #204/#206. The hook adapter preserves its fail-closed import and parse behavior. This changes only writes() in the hook; Claude #140's lead changes and test-file reorganization remain untouched.

Final head: d7e6cce2a6df86980b0d292a45a7c694f3638357, including main 748b267.

Validation:

  • npm run build: 286 generated files; committed the generated hook.
  • npm run check: all checks pass.
  • Focused writer/import compatibility checks before the main merge: tests 9, pass 9, fail 0. The topic files are unchanged by that merge.
  • The new built-hook matrix covers 17 writer forms for both roles: curl, git diff/show/log, ditto, scp, wget, openssl, sqlite3, tar, unzip, rsync, install and dd. It includes mixed-case/.exe names, quoted argument data, scratch outputs, reads, chief API GET, malformed input and broken core imports.
  • The new test copied unchanged to detached main 5b2385a fails behaviorally: a chief curl output aimed at the logbook passes instead of being denied.
  • Two clean code/security/QA review cycles on the unchanged final head.
  • npm test -- --test-concurrency=1: tests 1185, pass 1185, fail 0, cancelled 0, skipped 0.
  • Exact-head CI run 38501267725: tests 1185, pass 1185, fail 0.

All command strings go to the hook parser only. Fake ps, pgrep and kill are first on PATH for every test. No attack command was executed. The host sandbox was not tested, so this PR does not claim that it blocks these paths. This does not enable automatic Sage or resolve native required-hook failure behavior.

@erickb336
erickb336 marked this pull request as ready for review October 14, 2026 02:39
@erickb336
erickb336 merged commit 598a2a9 into main Oct 14, 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.

Hook: other GitHub API routes to main (main session), and programs that can write a logbook table (pre-existing, high)

1 participant