Commit Graph
985 Commits
Author SHA1 Message Date
Jason Chenandmorluto 55fd0ff590 fix(cli): preserve mcp doctor output choices on argument errors (#2693)
fix(cli): preserve doctor output choices on argument errors

Signed-off-by: Jason Chen <jasonhuang404505@gmail.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 10:56:53 -05:00
Paritosh LahreandClaude Opus 5.5 cb8096d522 fix(cutter): explain empty discovery when Cutter 2.5.0 rejects the plugin (#10310)
* fix(cutter): explain empty discovery when Cutter 2.5.0 rejects the plugin

Official Cutter 2.5.0 builds have been observed to reject Python plugins at
startup, including Cutter's own sample plugin and REA's bridge
(rizinorg/cutter#3659). No session is published, and list_cutter_sessions
returns no_live_bridge_found with nothing pointing at the Cutter release.

The list_cutter_sessions contract now says what no_live_bridge_found means
and names the observed 2.5.0 rejection. The Cutter bridge docs describe
installing the plugin, the startup log lines Cutter prints when it rejects
it, and that 2.4.1 loaded the bridge in the reported check. A minimal
independent plugin fails the same way, so the bridge itself is unchanged.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): report empty-discovery causes in the shared result

The guidance lived only in the MCP tool description, which
`rea list-cutter-sessions` never shows. The docs also assumed a known package
folder, which npx installations do not have.

The discovery result now carries limitations, owned by
cutterDiscoveryLimitations in the domain. For no_live_bridge_found they list
the causes discovery cannot tell apart, including the observed Cutter 2.5.0
Python-plugin rejection (rizinorg/cutter#3659). CLI and MCP project the same
text, and the tool description returns to its previous wording. The docs now
take the plugin from the published package of the matching version with
npm pack.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): name failed status probes among no-live causes

no_live_bridge_found also covers a published session whose status probe
fails: a stale descriptor after Cutter exited, an unresponsive bridge, or
an incompatible bridge version. The limitation named only process,
plugin-loading and directory causes. It now lists these too, and the
dead-status-endpoint test asserts that such a discovery carries it.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(cutter): give the finalization discovery fixture its limitations

commandFinalizationCancellation builds a Cutter discovery through the
list_cutter_sessions output schema, which now requires limitations. CI
shard 4 failed all five final-close cases with a ZodError. The fixture
now takes the owner's empty limitations for sessions_found.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): count unanswered sessions beside found ones

When one session answered and another published session failed its status
probe, discovery returned sessions_found with no limitation. The partial
result looked complete. The client already throws for live ceiling
mismatches, so every other descriptor without a session is a failed probe.
It now passes that count to cutterDiscoveryLimitations, which reports the
unlisted sessions for sessions_found. The stale-descriptor case in
cutterBridgeRequestLimit asserts it.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): name unpublished bridge sessions among no-live causes

When Cutter loads the plugin but the bridge cannot write its session
descriptor, for example in an unwritable or full bridge directory,
_BridgeServer.run closes the socket without logging. Cutter's log then shows
the plugin as loaded, yet discovery finds nothing. The no-live limitation now
names that cause and says the bridge does not log it. The Cutter docs say to
check the bridge directory when the plugin is loaded but no session appears.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): count unreadable descriptors among unlisted sessions

The descriptor loader dropped filename-matching candidates it could not read
before listSessions counted unanswered sessions, so a found session beside a
malformed, oversized, non-private or misnamed descriptor reported no
limitation. The loader now returns its unreadable count, and the discovery
limitation owner reports it beside failed status probes for both
sessions_found and no_live_bridge_found. The no-live text keeps only the
causes that leave nothing published; published sessions are now counted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): leave session existence unknown for unreadable descriptors

A filename-matching candidate the loader could not read does not establish
that any session exists: it may be malformed, misnamed or removed while
reading. The limitation now counts unreadable descriptor candidates and
says whether they describe Cutter sessions is unknown, instead of saying
their sessions are not listed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(mcp): record the list_cutter_sessions limitations in the advertised summary

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 10:49:22 -05:00
ShuaixinHuangandShuaixinHuang 5fd543c59c fix(tests): reject truncated shared CLI frames at EOF (#12010)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 10:09:11 -05:00
RRFZ 7b02fec30b fix(cli): reuse decoded inline JSON during admission (#11790) 2026-11-18 22:33:07 +08:00
morluto d96f0380aa test(cli): verify the advertised outline-depth range (#12061) 2026-11-18 09:15:24 -05:00
Nianze Wuandmorluto a42f96d0bd fix(cli): preserve JSON version reports with timing flags (#8871)
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 09:12:01 -05:00
IvenKoo 80f533da8a fix(cli): bound advertised decimal-token schemas by the domain range (#9808)
`cliDecimalField` published the domain range on the integer branch and only
the fixed `^[0-9]+$` guard on the decimal-token branch, and JSON Schema
bounds do not constrain strings. A client validating raw argv text against
`--schema` therefore admitted out-of-range tokens such as `--row-limit=0` or
`--block-size=255` that the parser rejects with `VALIDATION_ERROR`.

Publish the domain range on the token branch through the schema-constraint
owner, keeping the CLI's decimal leading-zero convention and the existing
parser diagnostics: the declaration is metadata, so accepted values and
`too_small`/`too_big` messages are unchanged. Non-range refinements such as
the power-of-two entropy block size stay parser-only, and an open-ended
domain still publishes its floor. The getting-started guide states the same
contract.

Fixes #9348
2026-11-18 09:11:20 -05:00
fceb4693fc fix(cli): admit activity extras with the runtime contract (#10289)
Discovery accepted any nonempty --extra string, so start-adb-activity advertised inputs the activity contract rejects.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 09:05:26 -05:00
morluto 39e8403306 fix(cli): show --json in global help (#12058) 2026-11-18 08:54:35 -05:00
RRFZ eb0d1df3cc fix(cli): reject blank paths in JSON input schemas (#11794)
* fix(cli): reject blank paths in JSON input schemas

* docs(cli): describe JSON caller paths as nonblank
2026-11-18 08:42:59 -05:00
morluto 69e263b0b1 test(runtime): consolidate Inspector and reconciliation coverage 2026-11-17 23:02:01 -05:00
morluto 1584d908b4 test(environment): consolidate terminal destination safety (#11952) 2026-11-18 11:14:13 +08:00
morluto a85f228198 test(environment): consolidate build report checks (#11948) 2026-11-18 10:59:19 +08:00
morluto e6e4215227 test(environment): consolidate export publication receipts (#11945) 2026-11-18 10:52:03 +08:00
morluto 52ceaafe64 test(environment): consolidate compare chronology probes (#11940) 2026-11-18 10:39:58 +08:00
morluto e2e3881c0e test(environment): consolidate serve refusals at the CLI (#11930) 2026-11-18 10:00:19 +08:00
morluto 20e932fac7 test(environment): consolidate scenario manifest exclusions (#11919)
* test(environment): consolidate scenario manifest exclusions

* test(environment): match scenario coverage facts
2026-11-18 09:44:34 +08:00
morluto 48e27e19b7 test: prune redundant and implementation-coupled coverage 2026-11-17 18:48:24 -05:00
morluto 26d6cf39e6 test(cli): consolidate JSON admission and status checks (#11898)
* test(cli): consolidate JSON admission and status checks

* test(cli): retain delimiter-led paths in browser validation
2026-11-18 07:45:34 +08:00
morluto a5041f2e7a test(json): consolidate file ingestion and cancellation checks (#11896) 2026-11-17 18:38:16 -05:00
morluto 49d876af87 test(cli): prove stdin heap admission before end of input (#11895) 2026-11-18 07:31:37 +08:00
morluto 8717f9398f test(cli): verify process cleanup through owned scopes (#11893) 2026-11-18 07:30:45 +08:00
morluto c3209239c3 test(cli): consolidate recovery and result control checks (#11891) 2026-11-18 07:17:37 +08:00
morluto ebb606a139 test(wabt): consolidate framing and representation checks (#11890) 2026-11-18 07:14:50 +08:00
morluto 400bcebf2b test(mcp): retire the generated test catalog (#11875) 2026-11-18 07:00:09 +08:00
morluto 8871ee882e test(mcp): consolidate guided workflow coverage across public adapters (#11886) 2026-11-18 06:59:02 +08:00
morluto dbfb9bade2 test(jeb): verify configured deadlines at the real protocol boundary (#11883) 2026-11-17 17:53:28 -05:00
morluto e9cc643198 test(environment): verify registry pins in the exported bundle (#11870) 2026-11-18 06:23:31 +08:00
morluto 84ee604c6d perf(ci): optimize semantic graph construction, directory containment checks, gate checkouts, and boundary stragglers (#11851)
* perf(javascript): avoid redundant semantic graph validation and node hashing

* perf(resources): deduplicate directory containment checks and root lstat calls

* perf(ci): trace script fixture modules, sparse-checkout gate jobs, and parallelize built doc checks

* perf(tests): memoize live MCP doctor expectations and reuse CLI and verifier compilation

* fix(ci): enforce containment after skipped entries, validate interned contexts, and supervise doc and verifier teardowns

* fix(docs): decode buffered check output once to preserve multi-byte UTF-8
2026-11-17 14:57:30 -05:00
morluto 015f726a9e test: prune redundant and obsolete coverage 2026-11-17 14:16:24 -05:00
ShuaixinHuangandShuaixinHuang 5ccb7c59c8 fix(environment): preserve HAR body source identity and scan coverage (#11829)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-17 09:11:48 -05:00
morluto 116f159a8a fix: isolate concurrent doctor cleanup scopes, trace JS fixture helpers, and share MCP/home lifecycles
Address all four PR review findings structurally:
- Isolate concurrent Doctor probes and host subsystems in child
  ArtifactResourceScope instances tracked via resources.track() so a failed
  cleanup on one probe cannot deadlock or abort sibling reads before close().
- Include tests/ JS/TS helper modules and fixture path literals in
  throughHelpers() and named() so changes to JS fixtures such as
  fakeHopperReplies.mjs reach transitive helper and socket tests.
- Extract generic createSharedMcpSession() and reuse it in lazyLocalToolsMcp()
  to preserve retryable cleanup draining and startup-failure attribution.
- Replace test-scoped createTestTempDirectory() with a file-scoped workspace
  in jsonInputStatus.test.ts so the shared isolated home persists across tests.
2026-11-17 19:58:40 +08:00
morluto 455c269566 perf(tests): share CLI environments and lazy MCP sessions in Electron, web, and Hermes suites
Align REA_LOG_LEVEL=silent across CLI calls and reuse a file-scoped
lazyLocalToolsMcp() session in electronWrappedCallPaths and webSourceLocationCli,
and reuse a cleaned file-scoped home across hermesClientSetup.
2026-11-17 19:58:40 +08:00
morluto de12494939 perf(tests): share isolated homes per environment across setup and profile CLI suites 2026-11-17 19:58:40 +08:00
morluto 5c1f58e24f perf(tests): admit registration guard in shared CLI session and cache boundary compiles 2026-11-17 19:58:40 +08:00
morluto 108d821e2a perf(tests): share lazy stdio MCP and CLI sessions across stateless suites 2026-11-17 19:58:40 +08:00
morluto fea7648f68 perf(tests): share CLI session across read-only JSON/view boundaries and mcp subcommands 2026-11-17 19:58:40 +08:00
Matt Van Hornandgensokyo-dev e9c72dbd1f feat(elf): inspect dynamic dependencies and required symbol versions
Add offline ELF dependency, search-path, symbol-version and import inspection with retained Evidence summaries and pages. Bound GNU-hash work and preserve cancellation, stable identity and caller-selected parameters across CLI/MCP.

Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-17 08:19:52 +00:00
morluto 7107abf8b8 fix(adb): run adb commands under owned supervision and start the adb server explicitly (#11772)
* fix(adb): run adb commands under owned supervision and start the adb server explicitly

The adb version probe and device commands now run through runOwnedCommand
in their own process group, keeping adb's SIGTERM-first stop through the
termination policy. A device command's escaped descendants are swept with
its cleanup, and cleanup that fails stays owned by the provider, which
retries it before its next operation.

Device operations start the adb server with an explicit `adb start-server`
first. The server is an external shared service: REA may start it but never
stops it, so a device command never forks it into its own cleanup.

runOwnedCommand gains a byte-limited stdout collector: output beyond
maxStdoutBytes is an output-limit failure, like an exceeded diagnostic
budget, and the collected bytes are kept exactly for binary protocols such
as screencap. Ownership preparation that cannot start its own helper for
lack of host capacity is reported as the command's host-capacity launch
failure.

* fix(adb): preserve completed refusals, server startup facts, and lazy server start

* fix(adb): scope runtime-root command cleanup and preserve incomplete command cleanup

* fix(adb): preserve completed bugreports and staging directories across command cleanup failures

* fix(adb): preserve bugreport command cleanup across readback failures and project live cleanup resources
2026-11-16 21:13:43 -05:00
morluto d5a942177f feat(errors): carry related parameters and operations and derive CLI flags and commands (#11777)
* feat(errors): carry related parameters and operations and derive CLI flags and commands

* fix(cli,errors): preserve operation-selector flags in CLI hints and clarify snapshot load/save
2026-11-16 16:42:07 -05:00
morluto ddd0d6d4a4 refactor(errors): derive parse-limit resource_constraint refusals from LimitRef (#11775)
* refactor(errors): derive parse-limit resource_constraint refusals from LimitRef

* docs(guides): update plist and IL2CPP reported_limits documentation
2026-11-16 16:31:52 -05:00
morluto ab904c793c fix(cli): refuse csv and tsv formats on --llms, --llms-full, and --schema (#11778)
* fix(cli): refuse csv and tsv formats on --llms, --llms-full, and --schema

* fix(cli): validate discovery row-format refusals at the shared output boundary
2026-11-16 16:30:51 -05:00
morluto e44f0077c9 test(cli): derive CLI tool coverage and schema parity from command registry (#11776)
* test(cli): derive CLI tool coverage and schema parity from command registry

* test(cli): check recorded routed operations and host operation bindings
2026-11-16 16:30:36 -05:00
RRFZ d511e8baf1 fix(cli): reject extra shell completion arguments (#11767) 2026-11-16 15:04:33 -05:00
Ysopwnableandgensokyo-dev 62014b566d refactor(cli)!: dispatch commands through REA-owned execution
Run ordinary CLI commands through REA's registry, argv parser and result owner.
Remove Incur, the second admission parse, SDK error middleware, output capture
and redundant command traversal. Preserve explicit redaction, publication
receipts, incremental output, terminal notice eligibility and drain ownership.
Migrate fixtures to real registrations and retain the derived-source notices.

Validation includes unchanged public parity goldens, public and lifecycle
regressions, repaired fixture consumers, real TTY base comparisons, exports
beyond the engine string limit, four schema catalogs and final static/docs
checks. Native provider and optional validator coverage limits are in the PR.

Fixes #11654. Fixes #10583. Refs #11682, #11476 and #10511.

BREAKING CHANGE: Markdown argument diagnostics use REA's literal escaping,
table widths and token counts. Flag-shaped unknown MCP subcommands honor the
selected format. Completion --schema/--version routes use the canonical
REA-owned hook rather than the retired SDK generator. Refresh affected literal
snapshots and regenerate completion hooks with rea completions <shell>.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-16 13:56:34 +00:00
Ysopwnableandgensokyo-dev 4ea24b6f8e refactor(cli): derive build catalogs from the REA command registry
Read CLI catalogs and registrar ownership from the REA command records, type-check the catalog helper and consolidate registrar types. Preserve the generated catalogs, mapping and CLI parity.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-16 18:57:12 +08:00
Ysopwnableandgensokyo-dev 7d502ddb0d refactor(cli)!: own builtin refusals and retire per-command MCP
Own builtin refusal paths and Markdown schemas in REA. Reject retired per-command MCP before loading command registrars, preserve invoked identity, and apply token controls to the complete selected failure document.

BREAKING CHANGE: rea <command> --mcp is removed. Start REA's MCP server with rea mcp or rea --mcp.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-16 18:26:02 +08:00
a10037ef10 refactor(cli): report unknown commands and the update notice from REA (#11692)
* refactor(cli): render help pages with REA's help owner

REA now renders the root page, every command page, help after an unknown command, the mcp group page, the mcp doctor builtin page and the completions page before incur sees argv, with incur's precedence (update check, --update without help, --mcp and the LLM manifests first; then the integrations; then --version; then root and command pages). help.ts gains arguments, custom global options, the root-only flags and integrations, and a command-list page.

The --format row on the root and command pages now lists csv and tsv (#10250), the approved difference; the mcp and mcp add pages keep the document formats they accept. Every other help byte is unchanged: 397 pages compared with incur's Help for all 196 registered commands.

Fixes #10250

* test(cli): elide the root command list wherever the root page is printed

The golden renderer chose root-page elision by case name, so help after an unknown command froze the whole command list. It now elides any stdout that opens with the root page's rea@<version> title.

* refactor(cli): answer --version, --schema and the LLM manifests in REA

src/cli/discovery.ts answers help, --version, --schema, --llms and --llms-full with incur's precedence, reading the arguments as the dispatcher receives them (after result output has adapted them, so token counts and buffering are unchanged). commandManifests.ts renders the Markdown index and full manifest, the structured manifests and the --schema document; commandSuggestion.ts ranks Did-you-mean candidates. Both are adapted from incur under its MIT licence.

--schema --format md stays with incur: incur renders it without Markdown escaping, unlike REA's renderer, and that difference awaits a decision on #11654. Compared with incur's serve for every registered command and format, 3746 of 3945 discovery invocations are identical; the rest are the 196 Markdown schemas left to incur and the three root help pages with the approved csv/tsv row.

* test(cli): pin which discovery document wins when several are asked for

Goldens for --llms with --help, --llms with --version, --llms with --llms-full, --schema with --version and --schema with --help, recorded with incur's rendering on the base branch.

* refactor(cli): report unknown commands and the update notice from REA

src/cli/updateNotice.ts owns the terminal update notice: the same trigger (terminal stdout, no explicit format), text, cache file ($XDG_CACHE_HOME/incur/updates/<package>.json), daily detached refresh through rea --incur-update-check, and opt-outs (NO_UPDATE_NOTIFIER, npm_config_update_notifier=false, CI). Discovery answers the detached refresh first, and reports an unknown command with incur's Did-you-mean suggestion, corrected invocation, help command and notice, as text on a terminal or as the error document, full-output envelope, token count or token window otherwise. outputEnvelope.ts renders these dispatcher failures.

Unknown commands with --format md stay with incur pending the Markdown escaping decision on #11654. Compared with incur's serve, 224 of 224 unknown-command invocations are identical, piped and on a terminal with a due notice.

* fix(cli): redact unknown-command guidance before rendering

Share the producing reply boundary for root lookup, unknown schemas and MCP subcommands. Preserve ordinary argument identity and existing MCP suggestion policies; omit sensitive or unsafe replay commands and redact full-output command metadata.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

---------

Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-16 14:46:48 +08:00
morluto a8cd584ccf fix(cli): render help in REA and list csv and tsv formats (#11688)
* refactor(cli): render help pages with REA's help owner

REA now renders the root page, every command page, help after an unknown command, the mcp group page, the mcp doctor builtin page and the completions page before incur sees argv, with incur's precedence (update check, --update without help, --mcp and the LLM manifests first; then the integrations; then --version; then root and command pages). help.ts gains arguments, custom global options, the root-only flags and integrations, and a command-list page.

The --format row on the root and command pages now lists csv and tsv (#10250), the approved difference; the mcp and mcp add pages keep the document formats they accept. Every other help byte is unchanged: 397 pages compared with incur's Help for all 196 registered commands.

Fixes #10250

* test(cli): elide the root command list wherever the root page is printed

The golden renderer chose root-page elision by case name, so help after an unknown command froze the whole command list. It now elides any stdout that opens with the root page's rea@<version> title.

* refactor(cli): answer --version, --schema and the LLM manifests in REA (#11690)

* refactor(cli): answer --version, --schema and the LLM manifests in REA

src/cli/discovery.ts answers help, --version, --schema, --llms and --llms-full with incur's precedence, reading the arguments as the dispatcher receives them (after result output has adapted them, so token counts and buffering are unchanged). commandManifests.ts renders the Markdown index and full manifest, the structured manifests and the --schema document; commandSuggestion.ts ranks Did-you-mean candidates. Both are adapted from incur under its MIT licence.

--schema --format md stays with incur: incur renders it without Markdown escaping, unlike REA's renderer, and that difference awaits a decision on #11654. Compared with incur's serve for every registered command and format, 3746 of 3945 discovery invocations are identical; the rest are the 196 Markdown schemas left to incur and the three root help pages with the approved csv/tsv row.

* test(cli): pin which discovery document wins when several are asked for

Goldens for --llms with --help, --llms with --version, --llms with --llms-full, --schema with --version and --schema with --help, recorded with incur's rendering on the base branch.
2026-11-16 12:55:30 +08:00
morluto 6c4e2bba9d test(cli): register decompile-all once in the overnight CLI schema registry (#11689)
registerCoreBinaryCommands already registers decompile-all; the test registered it a second time. incur overwrote the duplicate silently; REA's command table (#11680) rejects it, so every case in the file failed on main.
2026-11-16 12:34:19 +08:00