Repository navigation
Codex gate judges the programs that run, not shell text (T903, part 2 of the cut) - #464
Merged
Merged
Conversation
… of the cut) As T815 did for core and the Claude hook, the Codex gate's own shell-text heuristics are cut (PE R2786, J7 and F7): - The gh path rule no longer refuses gh from a variable or a substitution, or a setting before gh (pager, editor, browser, HOME, config folder): documented limits. GH_PATHS is unchanged. - The sage folder and config file rules read literal paths (also from ~), not $HOME, $SAGE_HOME, $SAGE_SHARED_HOME or $CODEX_HOME. - The logbook name rule (tasks.tsv and the like refused anywhere outside the project) is gone, for the shell and for patches. - The refusal of any shell write with an uncertain target is gone. - In their place, core's logbookWrite with the Codex sage folder and the shared root: a literal write into a root, also through a link, and a remove, move or recursive lock of a folder that holds one, refuse in every mode. Tests: keep-matrix rows for the Codex chief (logbookWrite forms, the Codex sage folder through a link, .git writes from ~ and with a pattern), with the Codex logbook refusal checked by its own words. codex-gates tests of the removed rules are flipped, each with a T903 reason line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
rules-in-code.md, SECURITY.md and the Codex guide say what the Codex gate judges now and which forms are documented limits; core's notes name the Codex gate as a caller of logbookWrite. changes/T903.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ex workflow reference, a test title, LOGBOOK_FILES removed - docs/guide/codex.md: the gate check names the guarded folder by its absolute path or a ~ path, not by $SAGE_HOME, and covers CODEX_HOME too (F-T903-4). - The Codex workflow reference says what the shell guard reads now: literal paths; a variable or pattern form is a documented limit (F-T903-5). - The T594 worktree test title matches its body (F-T903-3). - LOGBOOK_FILES and its export go: the Codex gate was its last caller (F-T903-1). Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What this is. Part 2 of the shell-text cut (T903). PR 463 (T815) made core and the Claude hook judge only the programs that a command line runs and the literal paths in their words. This PR does the same for the Codex-only rules of
packages/sage-codex/hooks/gate-hook.mjs, by the PE plan R2786 (J7 and F7). A deliberate forgery by a variable, a pattern or an alias is a documented limit (owner 2026-11-07); Codex's sandbox is the full guard.Removed (each with its flipped tests in
scripts/codex-gates.test.mjs, oneT903:reason line each):GH_PAGER,EDITOR,BROWSER,HOME,GH_CONFIG_DIRand the like)ghProblem(GH_LITERAL,GH_SETTINGS)GH_PATHSunchanged$HOME,$SAGE_HOME,$SAGE_SHARED_HOME,$CODEX_HOMEforms of the sage folder and config file rules, and$words counted as leaving the projectnamesSageFolder,names,leavingPaths,namesCodexSettings~tasks.tsv,config.json...) refused anywhere outside the project in sage modenamesLogbookFile, 4 call sites> $DEST,> out*)parsedWrites?.uncertainrefusalAdded in their place: core's
logbookWritewith the Codex sage folder and the shared root, in every mode and thread: a literal write into a root (also through a link, aftercd, from~), and a remove, move or recursive lock of a folder that holds one (rm -rf ~/..,find <dir> -delete,mv <Codex home> x).Kept, unchanged in effect:
GH_PATHS; the merge rule and sage's merge command; the push rule and its owning chief; the.gitwrite rule (core's push policy still refuses.gitwrites from~and with a pattern, now keep-matrix rows); the state tool rule; the owner record and merge permit of autopilot; the.codexfolder, Codex run and read-only role rules; the.hooks/codexand.sagename parts of the sage folder rule.Evidence (each file alone, scratch homes):
scripts/keep-matrix.test.mjs4/4: refused rows by role{"claude chief":157,"claude agent":169,"codex chief":158}of 173 rows; every Codex chief row refuses (158 of 158), and Codex logbook rows refuse by their own words.rm -rf ~/..,rm -rf ~/../*,find <base> -delete,mv <Codex home> ...andcd <link> && rm -rf .hookspassed there.scripts/codex-gates.test.mjs130/130;scripts/fixtures/codex-native/autopilot-{change,gate,merge,record}.test.mjs1, 18, 13, 28 pass;chiefs130,codex-plugin10,codex-state-mcp40,providers261 pass.npm run buildandnpm run checkpass.Docs:
docs/design/rules-in-code.md,SECURITY.mdanddocs/guide/codex.mdsay that the Codex gate follows the same rule;changes/T903.md.Not in this PR: T906, T907, T908. The Codex gate still has no board, process or stash rule (it had none before).
🤖 Generated with Claude Code