Repository navigation
refactor(cli): project search from its contracts with --kind choosing the operation - #10761
Merged
morluto merged 2 commits intoNov 15, 2026
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
[Low impact] The PR appears safe to merge; both previous findings are fixed and no new actionable issues were found. Summary
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Parse search arguments and options"] --> B{"kind"}
B -->|strings or default| C["search_strings"]
B -->|procedures| D["search_procedures"]
C --> E["Check selectors and opening options"]
D --> E
E -->|refused| F["Return error naming selected contract"]
E -->|accepted| G["Open target and run selected operation"]
Reviews (2) · Last reviewed commit: "fix(cli): check operation choices' optio..." · Reviewed by Greptile |
…e selected contract
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
… 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
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
… 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
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
Next slice of plan W1, stacked on #10753 (which now carries #10756). Refs #10583.
searchis now derived from its contracts.--kindis a CLI-only option that selectssearch_proceduresin place of the registeredsearch_strings; both contracts must project to the same arguments and options, which is checked when the command is described.Problem and expected behavior
searchre-declaredpattern,mode,case_sensitiveand the native open flags by hand, and chose the operation inline. The contract-derived registration could describe only one contract per command.Expected: the same arguments, options, defaults, refusals and help, with each invocation admitted by the contract
--kindselects (errors keep namingsearch_stringsorsearch_procedures).Change and scope
contractCliDescription.ts: a projection may declareoperationBy: { option, contracts }.describeOperationChoicesdescribes each alternative contract with the same projection and throws if its arguments/options differ from the registered contract's, so help and--schemahold for every choice.contractCommand.ts: the handler admits, opens and runs with the selected contract's description, and passes that contract's name as the operation.coreBinaryCommands.ts:searchis registered fromsearch_stringswith--kind(stringsdefault,procedures) selectingsearch_procedures.documentanddetailare omitted as before.analyze(JavaScript lane routing),decompile-directory, the utility and managed families, and the item-4 families.Contribution scope: not applicable. Target selection and authority are unchanged.
Contract and boundary impact
search_strings/search_proceduresown the inputs; the shared registration owns contract selection. Removed: the hand-writtensearchschemas and inline operation choice.searchis unchanged except option order. Refusals keep their codes, paths and operation names.searchnow runs under the command's cancellation signal. Otherwise unchanged.Expected effects (unchanged from the existing command; left for the human owner to check):
Evidence and regression coverage
cliContractCommandParity.test.ts:searchjoins the parity checks; new case that an operation choice projecting other options is refused when described.analysisSelectorCli.test.ts: new real-CLI case that a conflicting selector is refused namingsearch_stringsby default and with--kind strings, andsearch_procedureswith--kind procedures, before the target is opened.search,cliInputSchemaRequired.test.ts, and the search CLI tests listed below.rea search --helpfrom this branch lists the same arguments and options as before.For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/cli/analysisSelectorCli.test.ts tests/boundary/cli/cliContractCommandParity.test.ts tests/boundary/cli/cliInputSchemaRequired.test.ts— 565 passed.npm run test:focused -- tests/boundary/go/goBinaryProvider.test.ts tests/boundary/cli/emptyLocalTargetAdmission.test.ts tests/boundary/cli/argumentGuidance.test.ts tests/boundary/filesystem/productCatalog.test.ts tests/acceptance/applications/applicationWorkflowCli.test.ts tests/boundary/cli/markdownArgumentErrors.test.ts tests/boundary/cli/cliOutput.test.ts— 182 passed, 1 failed:applicationWorkflowCli"keeps Electron identity unresolved for conditional initializers ([Bug] Electron APIs are not recovered through aliasing variables (e.g.const ipc = ipcMain) #1656)" ran 900 s and failed. That case runs the JavaScript application lane, notsearch; it is reported to the coordinator as a slow-test defect in the JavaScript analyzer, not investigated here.npm run check:fast— passed.node scripts/rea.mjs search --help— inspected.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.