Repository navigation
refactor(cli): project decompile-all from its contract onto a native session target - #10778
Merged
morluto merged 2 commits intoNov 15, 2026
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 actionable new issues found. SummaryMoves
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[CLI arguments] --> B[Contract-derived options]
B --> C[Decode JSON and check input]
C --> D[Shared cancellation]
D --> E[Open selected target]
E --> F[Run operation]
F --> G[Await cleanup]
G --> H[Return Evidence or error]
Reviews (3) · Last reviewed commit: "refactor(cli): project native Mach-O, Sw..." · Reviewed by Greptile |
…om their contracts
morluto
force-pushed
the
fix/selector-contracts-refuse-empty
branch
from
November 15, 2026 05:58
175d82a to
2720e58
Compare
morluto
force-pushed
the
refactor/cli-contract-decompile-directory
branch
from
November 15, 2026 05:58
df32573 to
2b33228
Compare
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…session target (#10778) * refactor(cli): project decompile-all from its contract onto a native session target * refactor(cli): project native Mach-O, Swift and native UI commands from their contracts
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…ontracts (#10753) * fix(contracts): refuse empty address and procedure selectors in the contracts * refactor(cli): project decompile from its contract with --file-offset as an alternative selector (#10756) * refactor(cli): project search from its contracts with --kind choosing the operation (#10761) * refactor(cli): project search from its contracts with --kind choosing the operation * fix(cli): check operation choices' option rules and bind errors to the selected contract * test(cli): group operation-choice checks in their own block * refactor(cli): project decompile-all from its contract onto a native session target (#10778) * refactor(cli): project decompile-all from its contract onto a native session target * refactor(cli): project native Mach-O, Swift and native UI commands from their contracts * fix(cli): read search, decompile-all and native utility contracts from their groups so startup stays lazy * test(cli): drop the empty-selector admission mismatches the contracts now refuse
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
Part of plan W1 (CLI commands derived from their contracts).
rea decompile-allre-declared everydecompile_allinput field by hand (11 options plus a field-by-field argument mapper). It now registers throughregisterContractCommandwith a native session target, so its options, help and--schemacome from the contract.Refs #10583
This branch also carries #10784 (collapsed into it): six native utility commands are projected from their contracts, required runtime-JSON options are supported, and the shared JSON-option refusal now includes
expected: "JSON". See #10784 for its scope, theinspect-plistexclusion and its validation.Problem and expected behavior
The hand-written options duplicated the contract's fields with separate descriptions and a separate mapping, so contract changes had to be repeated in the CLI, and the command did not run under the shared command cancellation. Expected: one definition (the contract) drives both MCP and CLI admission.
Change and scope
src/cli/decompileDirectoryCommand.ts: replaced the hand-builtcli.commandanddecompileAllArgumentswith aregisterContractCommandprojection:pathsession target vianativeTarget(snapshot, target format, architecture, entry point, provider),output_directoryas caller path--output. Every other option is derived from the contract.runDirectOnTargethandler, which runs underwithCommandCancellationand binds input errors to CLI keys.decompile-alljoins the parity test's migrated list; the session-target parity case now checks that the target is never a caller input, rather than that a session-target command has no caller paths at all.Not included:
analyze, utility, managed and remaining families (later W1 PRs).Contract and boundary impact
decompile_allcontract (decompileDirectoryInputSchema) now owns CLI admission; the CLI's copied option shape and mapper are removed.--outputand--snapshot, which keep CLI wording). MCP unchanged.output_directoryis still recorded resolved, as before.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
tests/boundary/cli/cliContractCommandParity.test.ts(decompile-all in the migrated list, so every parity case covers it; session-target case generalized).decompileAllCli.test.ts(relative--output, filters,--limit, resume against fake Kuna) passes unchanged through the new path.rea decompile-all --helplists the same options (--output,--layout,--resume,--retry-failed,--name,--namespace,--address-start,--address-end,--limit,--snapshot,--target-format,--architecture,--entry-point,--provider) with contract descriptions.For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/cli/cliContractCommandParity.test.ts tests/boundary/cli/decompileAllCli.test.ts tests/boundary/cli/overnightBatch1CliSchemas.test.ts tests/boundary/cli/cliDecimalArguments.test.ts tests/acceptance/localPathAdmissionCli.test.ts— 535 passed, 1 failed (the session-target parity case, generalized as described)npm run test:focused -- tests/boundary/cli/cliContractCommandParity.test.ts tests/boundary/cli/decompileAllCli.test.tsafter the fix — 514 passednpm run check:fast— passednpm run docs:check— passednode scripts/rea.mjs decompile-all --help— options as listed aboveCompatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.