Repository navigation
refactor(cli): register every command in an REA-owned command table - #11680
Conversation
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] No blocking issues found at the reviewed head; the available main-branch history already includes this change. SummaryREA now owns the CLI command table, and shell completion reads it instead of Incur’s private map.
No new actionable issues found. Tests were not rerun. Status check: the available Reviews (5) · Last reviewed commit: "fix(cli): flag grouped fields and named ..." · Reviewed by Greptile |
|
@greptileai review |
#11686) #11680 moved every CLI command onto registerCliCommand(cli, CLI_COMMANDS.x, ...), so the Stryker command-handler selector, which matched cli.command(CLI_COMMANDS.x, ...), found no target for debugWithGdb and debugWithRizin and the reverse-tools quality job failed to load its config. The selector now matches the registry call. Refs #11654
Reuse the core registrar for decompile-all instead of registering it twice after upstream morluto#11680. Assert the outer MCP start/completion notifications separately from provider cleanup progress introduced by morluto#11637, retaining cleanup, rate, timeout, cancellation, and evidence assertions.
* feat(evidence): paginate retained evidence discovery summaries Let callers page summary metadata in canonical Evidence ID order without loading record payloads into the response. Keep filter and link totals global to all matches and preserve the unpaged response for existing clients. * test(evidence): use the supported compact schema profile * docs(evidence): explain the summary pagination request default * test: align verification fixtures with current public contracts Keep the production changes from upstream and update the verification consumers that still asserted their retired contracts: - assert unknown workflow identity structurally and retain the bounded provider caveats; - observe the process capture's partial-error delivery while preserving live cleanup ownership assertions; - use the package's declared imports in the isolated release controller; - refresh the replay card digest after the Evidence subject identity migration; - use the supported compact Kimi profile while testing case-insensitive environment keys; - assert each public interface's own capture issue path. These are shared test and verifier compatibility repairs. The evidence summary pagination and config-printer feature changes remain separate. * test: observe the session close result in Kuna retry coverage * test: follow the persisted DOL snapshot target identity * test: align CLI and progress fixtures with shared owners Reuse the core registrar for decompile-all instead of registering it twice after upstream #11680. Assert the outer MCP start/completion notifications separately from provider cleanup progress introduced by #11637, retaining cleanup, rate, timeout, cancellation, and evidence assertions. * docs: link CLI paging guidance to its canonical contract
Summary
Adds REA's own command table, the registry the incur removal (#11654) builds on, and makes shell completion its first reader instead of incur's
Cli.toCommands. Each entry also records the contract operations the command runs and the flag of each contract field, the per-command table #11476 needs. No CLI output changes. Refs #11654, refs #11476.Problem and expected behavior
Command identity lived only in incur's private command map (read through
Cli.toCommands) plus three per-CLI description WeakMaps incontractCommand.ts. Replacing incur's parser, help and dispatch needs one REA-owned table holding what incur's map holds, and #11476's error projection needs each command's operations and field-to-flag mapping (registry design note: #11654 (comment)).Change and scope
src/cli/commandRegistry.ts:registerCliCommand(cli, name, definition, { operations, source })records the entry in registration order and hands the same definition object to incur, so the in-place rewrites by the shell owners (omittable defaults, result output, argument policy) stay visible to readers.cliCommands(cli)lists entries. A duplicate name is refused.CliCommandDefinitionis REA's own definition type (description, positionals, options, aliases, output policy, handler withargs,options,formatExplicit); every registrar compiles against it unchanged.operationByoption chooses, the contract that opens its session target (for exampleopen_binarywithformat: --target-format,entry_point: --entry-point,provider_id: --provider,snapshot_path: --snapshot), and the source of its Evidence targets. Routed commands (analyze) record every route.rea function,search,decompileandanalyzeare contract or routed commands, so they need no separate map.ContractCliSessionTargetnow names its opening contract.cli.command(...)sites and the 3 contract registration sites go throughregisterCliCommand; host commands record no operations.contractCommand.tsare removed;contractCommandDescriptions,routedCommandDescriptionsandcontractDocumentCommandDescriptionsnow read the table.completions.tsreads the table; the cast incliShell.tsis gone.inputBinding.flagsincontractCliDescription.ts, from review): each field of a field group now maps to the group's option (inspect-android-jni-bindings:class_name,method_names,descriptors,abis,library_paths->--query; the non-fieldqueryentry is gone), and a positional selector maps to its named option (procedure->--procedureonfunction,instructions,decompile;pattern->--patternonsearch). That map also feedscli_flagandrelated_cli_flagsin errors. Before/after: no current producer names a selector or group field indetails.limit.parameterordetails.related_parameters(I searched the producers; the related-parameter producers namepathandcolumns/table/schema_scope), so no error output changes today. A future error namingprocedureonrea functionwould now carrycli_flag: --procedureinstead of no flag, and one namingclass_nameoninspect-android-jni-bindingswould carry--queryinstead of no flag. Goldens unchanged.nativeOpenOptionFieldsexport insrc/cli/options.tsand the four option schemas only it used, plus the unusedsnapshotSelectionOption.cli-command-outside-registry(baseline 0):cli.command(outsidesrc/cli/commandRegistry.ts.Not included: the other
visitRegisteredCommandsreaders (argument errors, strict positionals, sensitive values, result output, omittable defaults) move in the errors/middleware PR; parser, help, formatting and dispatch follow. #11476's producer migrations are separate.Contract and boundary impact
src/cli/commandRegistry.tsowns command registration; readers are completion and the description accessors.docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): 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/cliCommandRegistry.test.ts(table matches incur's dispatched commands in order and by identity; operation and flag columns forfunction,search,decompile,analyze,inspect-byte-entropy; host commands have none);tests/boundary/cli/completions.test.tsregisters through the table.Validation performed
npm run test:focused -- tests/boundary/cli/cliCommandRegistry.test.ts tests/boundary/cli/completions.test.ts tests/boundary/cli/cliParityGoldens.test.ts tests/boundary/cli/cliContractCommandParity.test.ts tests/boundary/cli/routedCommand.test.ts tests/boundary/cli/cliLazyRegistration.test.ts— passed except a registry expectation I then corrected (searchalso recordssearch_procedures);cliCommandRegistry.test.tsrerun — 4 passednpm run test:focused --the 20 test files importing a changed registrar orcontractCommand.ts— 1260 passed, 8 skippednpm run test:focused --the 13 test files that read input bindings orcli_flagpluscliCommandRegistry,cliParityGoldens,cliContractCommandParity— 15 files, 1233 passed, 1 skippednpm run check:fast— passed (before and after the review fix)node scripts/verify/architecture-guards.mjs— passednpx oxfmt --check src/cli tests/boundary/cli scripts/verify— cleanCompatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.