Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
baron
left a comment
There was a problem hiding this comment.
Source verdict: APPROVE at exact head 7c9f33fbafc0e99685fe5c91ce1c2ac3c3186bfe (PR base / reviewed merge base dfe31172ca0a090be3f40bc134f54d69c08e31d8). No concrete changed-source defects found.
Reviewed the complete seven-file diff and canonical contracts, CLI normalization, MCP registrations, shared validation, and Evidence consumers. The existing localPathStringSchema adds only NUL rejection to nonempty strings: it does not trim, resolve, redact, or reinterpret caller-selected paths. Host-native absolute-path validation remains in the application owner. WASM main/glue/candidate selections and both web-export paths are covered; defaults, array bounds, output schemas, provenance, and resource ownership remain unchanged. Reusing the established domain boundary avoids downstream exception patches or duplicate representations.
Changed-source anchors: src/domain/native/peResources.ts:19-21, src/domain/native/binaryLayout.ts:20-22, src/domain/native/recordedCrash.ts:54-56, src/domain/evm/evmInterface.ts:10-12, src/domain/wasm/wasmArtifact.ts:13-17, src/domain/webScriptExport.ts:10-15; regression matrix tests/acceptance/tools/localToolContracts.test.ts:94-108.
Validation on macOS in an isolated detached clone, Node 24.18.0 / npm 11.16.0:
- Locked dependency installation, focused runtime/catalog build,
npm run typecheck, and diff whitespace check passed. - Nine-file focused run: 15 passed / 5 failed. The changed real-stdio MCP NUL matrix passed. Eight advertised-schema tests, four injected-provider MCP tests preserving inline Evidence/session identity, and the MCP nonregular-capture test passed.
- Failures are disclosed, not counted as passes: three unrelated process-capture cases returned PTY
spawn EPERM; PE resources acceptance timed out at 30 seconds and web-script CLI selection exceeded its existing 5-second deadline. The latter two remain unresolved local validation gaps, not proven PR-caused regressions; no baseline comparison, retries, or timeout inflation was performed. - Additional compiled-contract probe: 72 exact-value preservation assertions (Unicode, whitespace, line breaks, punctuation, Windows-shaped paths) and 36 NUL rejection assertions passed across all nine changed fields. Windows-shaped schema strings do not establish native Windows filesystem behavior.
Not run locally: full gate, docs checks, real WABT/pwntools/pwndbg/EVM/provider lanes, or native Windows validation. Injected-provider boundary tests are not real-provider proof.
Hosted CI and integration readiness are independent: the latest pre-publication snapshot has successful static/build/docs/coverage and all four test shards, with Apple E2E and two Darwin package lanes still queued. GitHub reports MERGEABLE / UNSTABLE. This source approval is not a complete green local/hosted gate or merge authorization. Main was preserved; no fixes, commits, pushes, merges, or draft changes.
|
TL;DR: On Linux the PR works. Every NUL path is now rejected at the schema, in all six tools. The two tests that timed out on macOS pass here, on this PR and on its base. ResultsI tested head 7c9f33f against its merge base dfe3117. Main has since moved to d802304 (#1902). The PR conflicts with it. I tested the head as it stands and did not try a merge.
NUL paths over real MCP stdioI started each build's own server and sent the nine requests from the PR's matrix. A shell argument cannot carry NUL, so the CLI cannot test this.
Valid paths changed nothing. I sent 8 requests to both builds. The responses were byte for byte the same. Three were real successes: a PE file, an ELF file and an EVM hex file. Five were errors that match on both builds. They were a missing core file, a missing capture file, and three WASM requests with no WABT. Path fields the PR did not coverThe head build's schemas show eight more path inputs with no NUL pattern, across five tools. Two of three that I probed reached the file system on head. The PR names six tools, so this is a possible follow-up, not a flaw in this PR. The list is in the fold below. Not run
Edit: the two struck items are now covered in a follow-up at the new head. Thanks, baron, for the careful review and for naming the two unresolved timeouts. Other path fields without the NUL patternI walked every tool's input schema in the head build. The PR adds the pattern to the nine fields it names and changes nothing else. These file-path inputs still lack it:
The last pair may be module names, not files. I did not check. I sent NUL to three of these on head. Two reached the file system. Each returned a plain failure with Node's null-bytes note. The third stopped at "No app is open", so its path was never reached. Base results for the nine NUL requests
Test setup
Commands# one file at a time, per Node
node node_modules/vitest/vitest.mjs run --project acceptance tests/acceptance/tools/localToolContracts.test.ts
node node_modules/vitest/vitest.mjs run --project acceptance tests/acceptance/applications/peResources.test.ts
node node_modules/vitest/vitest.mjs run --project cli-boundary tests/boundary/cli/webScriptSelectionCli.test.ts
npm run test:fast
# NUL probe: starts the build's own server and calls each tool
node probe.mjs nul out.json
node probe.mjs valid out.json🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
039c7b3 to
b354b9b
Compare
…tools Enforce localPathStringSchema across inspect_pe_resources, inspect_binary_layout, inspect_recorded_crash, inspect_wasm_artifact, and inspect_evm_interface input schemas to reject embedded NUL bytes at the contract boundary instead of failing later during filesystem operations. Add corresponding acceptance test cases to the advertised MCP contracts matrix in localToolContracts.test.ts. Signed-off-by: Vinícius DS Andrade <[email protected]>
Wrap the inspectPeResourcesInputSchema path property description to keep lines within the 80-column oxfmt limit. Signed-off-by: Vinícius DS Andrade <[email protected]>
b354b9b to
29ef57b
Compare
|
TL;DR: Yes. This PR now refuses a NUL byte in all seven fields of its five tools, and #1899 covers five of the eight from my earlier note. Four fields in three tools still accept a NUL byte, but none returned Node's null-bytes error. ResultsI tested head 29ef57b against its base 89f5e48 (#1972). The PR was rebased since my last post. #1899 is now in the base, so this PR no longer touches
Still not run
Thanks, Vinícius, for the quick follow-up, and DeryFerd, for #1899. Commands# per tree, Node 24.18.0
npm ci && npm run build && npm run test:prepare
# probes: start the tree's own server, call each tool (sets: nul, web, control)
PROBE_WABT=1 node probe.mjs nul out.json
# the PR's test file, per Node
node node_modules/vitest/vitest.mjs run --project acceptance tests/acceptance/tools/localToolContracts.test.ts
# schema walk over each build's tool list
python3 walkschemas.py tools-head.jsonTest setup
🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
Summary
Enforce
localPathStringSchemaacrossinspect_pe_resources,inspect_binary_layout,inspect_recorded_crash,inspect_wasm_artifact, andinspect_evm_interfaceso OS-invalid paths containing NUL bytes (\x00) are rejected at the advertised schema contract boundary instead of propagating to filesystem operations or throwing untyped errors.export_web_scriptsreceived the same change in #1899, so this branch no longer touches it.Problem and expected behavior
Previously, these input schemas typed local filesystem path arguments using
z.string().min(1). When callers or agents passed paths containing embedded NUL bytes (e.g./tmp/selected\0filename), the inputs passed schema validation and reached backend services/subprocesses, risking raw filesystem exceptions or unhandled failures. Expected behavior is to reject them at the contract boundary with a typed schema error ("Local filesystem paths cannot contain NUL"), consistent with existing local path tools.Change and scope
localPathStringSchemafromlocalPath.tsfor:inspect_pe_resources(path)inspect_binary_layout(path)inspect_recorded_crash(path)inspect_wasm_artifact(path,glue_paths,candidate_paths)inspect_evm_interface(path)tests/acceptance/tools/localToolContracts.test.tsunder the real advertised MCP contracts test matrix.Contract and boundary impact
native/peResources,native/binaryLayout,native/recordedCrash,wasm/wasmArtifact,evm/evmInterface).docs/public/product-catalog.json), package, or installation impact: none.Evidence and regression coverage
tests/acceptance/tools/localToolContracts.test.tsadded test cases forinspect_pe_resources,inspect_binary_layout,inspect_recorded_crash,inspect_wasm_artifact, andinspect_evm_interface.For evidence-bearing changes:
Validation performed
node --experimental-strip-types --checkon touched domain and test files passed without errors.Compatibility, safety, and release
Review checklist
type(scope): outcome.