Skip to content

Verify native patch policy with fixed local context (T19) - #263

Merged
erickb336 merged 1 commit into
mainfrom
codex/t19-native-patch-proof
Oct 17, 2026
Merged

erickb336 merged 1 commit into
mainfrom
codex/t19-native-patch-proof

Conversation

@erickb336

@erickb336 erickb336 commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #262
Sage task T19

This adds native evidence for Sage's existing patch checks. A disposable local fixture runs three actual CLI 0.160.0 apply_patch routes with fixed simulated responses: ordinary edit while off, protected-path edit while off, and a chief edit while on. Production policy and installed defaults are unchanged.

The ordinary edit writes exact contents and records a policy pass. The protected edit returns the exact packaged-policy denial with a matching session/turn/call receipt. The chief edit returns the production role denial before the fixture evaluator. Both denied cases leave no file. The protected target is outside the workspace, so native sandbox rules may also restrict it; missing files alone are not used as proof.

The opt-in fixture calls the packaged patchEditDecision with its own fixed local directory and protected root. This is not a general trusted execution-context producer. Issues #243 and #239 remain unfinished. All three native trials confirmed unchanged logbooks and complete process/profile cleanup.

Verification on 17086a7

  • npm run build: built 317 files.
  • npm run check: all checks pass.
  • Focused diagnostic, generated fixture and shared cleanup checks: tests 34; pass 34; fail 0.
  • node scripts/probe-codex-patch.mjs, with no flag, --protected-target, and --chief: each passed once. Each made two fixed response requests and verified the actual native tool output, hook identity and file result. Cleanup: complete true, ownedHandlesClosed true, temporaryRootRemoved true.
  • git diff --check: passed.
  • Independent code review: tests 19; pass 19; fail 0.
  • Independent QA: tests 34; pass 34; fail 0, plus all three native routes passed again on this exact head with complete cleanup.
  • One required code/QA cycle is clean on this diagnostic-only change.
  • Full npm test: tests 1644; pass 1644; fail 0; cancelled 0; skipped 0 (347.99 seconds). Exact-head CI run 39001423629 passed with the same 1,644 tests, zero failures, cancellations or skips.

Tests used fake ps, pgrep and kill first on PATH. Initial fixture-only checks exposed a noncanonical temporary root and an omitted explicit chief boolean; these setup failures were corrected and retained separately. The lead caught missing evaluator composition before native execution. The generated-MCP test now invokes the real policy instead of merely checking a validator.

Evidence limits

Detached main cf557ea ran the 16 new diagnostic tests with only their helper and opt-in test fixture supplied: tests 16; pass 16; fail 0. No production or generated modules were copied or changed.

This is diagnostic coverage of existing behavior, not a production regression repair. The native responses are simulated, and the execution directory/root are fixed by the fixture. It does not prove real-model application, remote execution, arbitrary filesystem races, installed automatic Sage, or other native versions. Issue #88 remains open. Claude-owned work is untouched.

@erickb336
erickb336 marked this pull request as ready for review October 17, 2026 04:20
@erickb336
erickb336 merged commit f643a90 into main Oct 17, 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.

Verify native patch decisions with explicit local fixture boundaries (T19)

1 participant