Repository navigation
fix(cli): preserve caller paths in format inspections - #7855
Conversation
[Medium impact] The PR appears safe to merge; the previous WASM verifier failure is fixed. SummaryPreserves the caller’s exact file path in CLI Evidence without changing Evidence identity or adding CLI-only metadata to MCP results.
No new actionable issues were found. Supersession could not be checked because GitHub access was unavailable. This review used source checks; no runtime tests were run. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[CLI file selection] --> B[Inspect selected file]
B --> C[Bind exact caller path]
C --> D[Finish cleanup]
D --> E[Complete Evidence or summary and bundle]
D --> F[Error with retained Evidence]
G[MCP request] --> H[Shared inspection without CLI metadata]
Reviews (6) · Last reviewed commit: "fix(wasm): compare shared cli and mcp ev..." · Reviewed by Greptile |
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. |
Summary
Fixes #7587. Format-specific one-shot CLI inspections retain the exact caller-selected input path in Evidence, including summary and bundle delivery.
Problem and expected behavior
For example,
inspect-model-artifact ./model.safetensors --jsonpreviously returned an absolute analysis path but omitted the documentedcaller_input_path. The caller's original spelling is now retained separately from the inspected identity.Change and scope
The CLI delivery boundary binds the original file argument before final cleanup and publication. Format-specific one-shot commands use that owner; direct inspection commands share the same binding helper. MCP callers do not acquire CLI-only metadata. The related Flutter and pcap adapters use the same rule. Existing Evidence identity and complete source records are retained.
Contribution scope and maintainer decision: ordinary existing read-only inspection; no new authority or provider capability.
Contract and boundary impact
Evidence and regression coverage
The built CLI regression covers relative model, ELF and entropy selections, summary and bundle delivery, and an MCP control without CLI-only metadata. Boundary regressions cover cleanup failure, authenticated partial Evidence, and preservation of raw partial observations. Flutter cleanup-retry controls cover recovered success, late cancellation, and incomplete cleanup. Flutter, Android, JEB and Apktool CLI controls exercise adjacent adapters. Real JEB, Android, TShark and firmware providers were not tested; the pcap CLI controls cover admission rather than a successful real-provider capture.
Validation performed
npm run test:focused -- tests/acceptance/formatSpecificCallerPathCli.test.ts tests/boundary/cli/cliEvidenceCallerPath.test.ts— 2 passed.npm run test:focused -- tests/boundary/cli/jebCli.test.ts tests/boundary/cli/apktoolBooleanOptions.test.ts tests/boundary/cli/androidPackageViewCli.test.ts— 23 passed.npm run test:focused -- tests/boundary/cli/flutterCli.test.ts tests/boundary/cli/pcapCli.test.ts— 14 passed.npm run test:focused -- tests/boundary/cli/cliEvidenceCallerPath.test.ts tests/boundary/cli/flutterCli.test.ts— 11 passed after the partial-observation follow-up.npm run check:fastandgit diff --check— passed.Compatibility, safety, and release
Additive CLI Evidence metadata; no migration or provider change. Validation was on macOS; no external provider or Windows verification was performed.
CI parity follow-up: Go, Rust, SQLite and Flutter checks now assert the CLI-only caller spelling, verify MCP omits it, and compare the remaining Evidence exactly. The TShark and APK-signature verifiers use the same explicit comparison. Six built acceptance files passed (78 tests, one skipped),
check:fastandgit diff --checkpassed. TShark and Android SDK tools were unavailable locally, so those real verifier lanes await CI.Author readiness
Human owner: @morluto
Before merge
type(scope): outcome.