Skip to content

Recognize output-file programs in shared write checks (T44) - #204

Merged
erickb336 merged 3 commits into
mainfrom
codex/t44-output-file-writers
Oct 13, 2026
Merged

erickb336 merged 3 commits into
mainfrom
codex/t44-output-file-writers

Conversation

@erickb336

@erickb336 erickb336 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Closes #203
Sage task T44

Codex's shared role and path checks now recognize common output-file programs. For example, curl -o and git diff --output now count as writes. The protected-path check refuses a logbook target and still permits an explicit scratch target. This is a component of #99 and #88; the remaining Claude-hook work in #99 stays open.

The shared core uses actual parsed dispatches and preserves curl option values and case. Unknown curl options count as writes. Programs with ordinary writing operands (ditto, scp, wget, sqlite3) count conservatively as writers. OpenSSL output options also count. Generated plugin copies come from npm run build. No owner decision is needed.

Sources: packages/sage-core/output-writes.mjs and shell-write-policy.mjs. Claude's hook and active #140 files are unchanged. This is not a complete arbitrary-command policy and does not inspect external configuration contents. No sandbox enforcement or installed activation was verified.

Validation on 7321ce1:

  • npm run build: built files successfully.
  • npm run check: all checks pass (3 timing bounds carry a timing-ok annotation).
  • node --test --test-name-pattern=T44: scripts/providers.test.mjs: 4 passed, 0 failed.
  • Detached main 1b6ffcd with the same tests: 0 passed, 4 failed on behavior. Main misses curl's output form, misses it after a header value, permits a protected output target, and misses OpenSSL double-hyphen output.
  • Every test uses fake ps, pgrep, and kill first on PATH. Command examples go only to the parser, never to a real shell or program.

Review repairs questioned the premise that an argument's spelling identifies whether it is an option. The first scanner mistook values for output flags and missed consumed delimiters. The delimiter heuristic then mistook an already consumed value for an unknown option. OpenSSL also stops options at its first operand. The current scanner tracks consumed arguments explicitly, respects that operand boundary, and conservatively treats unknown OpenSSL options as writes. All reported cases have regression controls. Review cycles restart on 7321ce1.

Two clean code/security/QA cycles passed on unchanged 7321ce1. The full local command npm test -- --test-concurrency=1 passed: 1,171 passed, 0 failed, 0 skipped. Exact-head CI passed with 1,171 tests: https://github.com/erickb336/sage/actions/runs/38457664464. All required checks and six review cycles passed on the same commit.

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.

Recognize output-file programs in the shared Codex write policy (T44)

1 participant