Repository navigation
refactor(cli): project WASM inspection and firmware commands from their contracts - #10648
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
Contributor
[Medium impact] The reviewed changes appear safe to merge, with no blocking issue found. SummaryMoves WASM inspection, firmware commands, and four Apple commands onto shared contract-based CLI descriptions.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[CLI arguments] --> B[Contract-based command description]
B --> C[Resolve caller paths and assemble input]
C --> D{Command kind}
D -->|WASM or firmware| E[Shared inspection service]
D -->|Apple command| F[Open session target and run operation]
E --> G[Finish cleanup]
F --> G
G --> H[Return Evidence or named input errors]
Reviews (2) · Last reviewed commit: "refactor(cli): project Apple bundle comm..." · Reviewed by Greptile |
Base automatically changed from
refactor/cli-contract-runtime-json-null-limits
to
refactor/cli-contract-option-effects
November 14, 2026 20:02
19 tasks
morluto
force-pushed
the
refactor/cli-contract-path-lists-flattened
branch
from
November 14, 2026 20:10
5ae577b to
886a42d
Compare
morluto
force-pushed
the
refactor/cli-contract-option-effects
branch
from
November 14, 2026 20:33
d9f8120 to
18d160e
Compare
morluto
force-pushed
the
refactor/cli-contract-path-lists-flattened
branch
2 times, most recently
from
November 15, 2026 01:45
15423d9 to
96f5467
Compare
morluto
force-pushed
the
refactor/cli-contract-option-effects
branch
2 times, most recently
from
November 15, 2026 05:58
eaeac7a to
4b81d9a
Compare
morluto
force-pushed
the
refactor/cli-contract-path-lists-flattened
branch
from
November 15, 2026 05:58
96f5467 to
70dd410
Compare
morluto
force-pushed
the
refactor/cli-contract-option-effects
branch
from
November 15, 2026 07:34
4b81d9a to
90bd307
Compare
morluto
force-pushed
the
refactor/cli-contract-path-lists-flattened
branch
from
November 15, 2026 07:34
70dd410 to
6d01705
Compare
Base automatically changed from
refactor/cli-contract-option-effects
to
fix/cli-apple-ips-join-path-spelling
November 15, 2026 08:39
morluto
force-pushed
the
refactor/cli-contract-path-lists-flattened
branch
from
November 15, 2026 08:48
6d01705 to
cc1f1b2
Compare
morluto
changed the base branch from
fix/cli-apple-ips-join-path-spelling
to
main
November 15, 2026 09:04
…ir contracts The contract command description gains lists of caller paths and optional object fields flattened into one option per member. inspect-wasm-artifact, inspect-firmware-regions and extract-firmware are derived from their contracts. extract-firmware now records the caller's output_directory spelling in Evidence, like every other caller-path field.
morluto
force-pushed
the
refactor/cli-contract-path-lists-flattened
branch
from
November 15, 2026 09:34
cc1f1b2 to
1fbcfd3
Compare
…target (#10656) Session-scoped operations take their target from the MCP session, so the CLI's target positional is not a contract field. The contract command description declares a session target: the CLI takes it as the first positional, opens it through runProviderAnalysis as the hand-written commands did, and passes the rest of the contract input. Input issues reported after argv parsing name renamed fields by their CLI key. inspect-keyed-archive, trace-dylib-resolution, inspect-asset-catalog and decode-interface-builder are the pilot; trace-dylib-resolution --root now admits only the roots its contract admits.
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.
Summary
Ninth slice of plan W1, stacked on #10635 (base
refactor/cli-contract-option-effects, which now includes #10643; retarget as the lower PRs merge). Refs #10583.The contract command description gains two features, and three commands are derived from their contracts with them:
inspect-wasm-artifact --glue_paths/--candidate_paths.extract-firmware --offset/--lengthforrange.inspect-firmware-regionsis migrated too.extract-firmwarenow records the caller'soutput_directoryspelling in Evidence, as every other caller-path field does (see below).Problem and expected behavior
caller_input_pathsitself.rangefrom two options, and passed onlypathas a caller spelling.output_directoryis also caller-selected, but its spelling was dropped.This is the sibling of #10606 (
--join-path). The derived commands must keep their flags, help,--schema, refusals (including the missing-companionrangerefusal fromfirmwareIncompleteRange) and service input.Change and scope
contractCliDescription.ts:callerPathsalso takes array fields. Each element is admitted as a nonempty, NUL-free local path and resolved.callerInputsreturnsCallerInputPaths, so lists keep their spelled order.flatten: an optional object field taken as one option per member. Every member must be projected. Any member given supplies the whole object, absent members included, so the contract still names the missing companion.contractCommand.ts:callerTargetPath(context)returns the spelled target path. The two binary-diagnostics handlers that readcallerInputs.pathuse it now that caller inputs may be lists.inspect-wasm-artifact:path,glue_pathsandcandidate_pathsare caller paths.detailis omitted with a reason, as before; the contract has adetailfield the hand-written command never exposed.FirmwareAnalysisServicethroughinspectWithService.extract-firmwaretakespathandoutput_directoryas caller-path positionals and flattensrange.cliInputSchemaRequired: the derived option admits an explicitundefined, as every projected command does, because argv cannot carry one. The assertion now checks what argv can do: an omitted--command-timeout-msis absent from the parsed options, so the contract default applies.compare-wasm-interfaces. It is a JSON-input command (inline JSON or a file, plus--evidence-bundle). It belongs with the other 17 JSON-input commands, which need one shared JSON-input projection; that projection would also add the contract'scontentSchemato its--schema([Bug] CLI --schema on JSON-input commands emits only the outer inputJson string wrapper #9195).Contract and boundary impact
--schema: semantically identical for all three commands.extract-firmwareEvidence gainscaller_input_paths.output_directory, keyed by contract field. WASM andinspect-firmware-regionsEvidence are unchanged.Expected effects:
(No effect changes.)
Evidence and regression coverage
--schema --format json,--helpand 23 argv runs before and after throughcreateCli().serve.rangemember, a zero length, a non-decimal offset, an over-limit depth, empty paths, and runs on a small fixture.--schema: semantically equal for all three commands.FirmwareAnalysisService.executewith recorders returning Evidence, then ran six argv lines.caller_input_paths: identical ({"glue_paths":["rel/a.js","/abs/b.js"],"candidate_paths":["./c.wasm"]}).extract-firmware: now addscaller_input_paths: {"output_directory": "rel/out"}.output_directoryrecording is shown only through the recording script and the guard'scallerInputscheck.Validation performed
npm run check:fast: passed.npm run knip: no findings.npm run test:focused -- tests/boundary/cli/cliContractCommandParity.test.ts: 225 passed.npm run test:focused --wasmAcquiredInputsCli,wasmCleanupCli,cliInputSchemaRequired,artifactInputLimits,cliDecimalArguments,firmwareIncompleteRange,nonBinaryComposition,localPathAdmissionCli,binaryDiagnosticsCliCleanup,commandFinalizationCancellation:cliInputSchemaRequiredfailed on the explicit-undefinedassertion described above. After that change it passed (25 tests); the other nine files passed (72 passed, 2 skipped across the run).Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.