34 Commits
Author SHA1 Message Date
Edgar Arakelyanandgensokyo-dev 60bd646478 feat(mcp): add opt-in streamable HTTP transport (#4955)
Add an explicit Streamable HTTP entry for environment/gateway hosts while keeping stdio registrations and default behavior. Preserve the shared provider/session owner across DELETE and replacement; fence and drain tool/completion work before handover or teardown.

Bound HTTP input and plain-response admission, cancel refused bodies, join whole exchanges and asynchronous response cleanup before provider hooks, gate startup readiness, and reject queued HTTP/1.1 pipelining while retaining sequential keep-alive.

Validation: 8 static/build tasks, 83 adapter tests and registry metadata pass. A real installed gh binary produces seven equivalent CLI/stdio/HTTP reports with DELETE/replacement and clean signal shutdown. Broader local native-provider/ownership failures reproduce on clean main and are documented with limitations in the PR.

Co-authored-by: Edgar Arakelyan <edgar.arakelyan@scale.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-19 23:58:51 +08:00
morluto 4f7b5fb602 fix(cli): route update flag through verified updater
Normalize the unambiguous root --update alias before output handling and
through direct createCli().serve calls. Reuse the existing output-value scan
and canonical update command, including selected environment, installation
ownership, Windows-aware launch, verification, maintenance and failure facts.
Retain option data and help/check precedence. Reject remaining Incur install
requests: update:false does not disable its explicit installer in0.6.1.
Remove the superseded output-only normalizer name and update its consumers.

Validation:123focused checks/7files pass, including compiled CLI with an owned
rejecting fake npm and direct serve across5formats. Original argument owner
fails6new controls/7pass; isolated baseline fails8workflow checks/2controls
pass. Static/docs/discovery1561 pass. Both scoped source reviews are clear.
Six completed equivalent current-version workflows compare baseline canonical
update with the alias; complete replies identical. Native Windows upgrade,
real package-manager installation and full install costs remain unverified.

The first baseline escaped a Vitest-only builtin mock and installed REA in the
pinned Node global prefix. Removed the newly added package and verified original
Node/npm/Corepack tools. Re-ran using the real builtin spy with synchronized
ESM exports, an independently rejecting PATH shim and owned npm prefix/cache.
Keep heavy tests/profiling stopped. Independent updater output bounds remain
tracked in #4888 rather than changing collection policy in this routing fix.

Fixes #4883
2026-10-18 05:33:21 +08:00
morluto fd6da70920 fix(cli): report string capacity failures during result formatting
Recover completed ordinary command results when pinned Incur formatting
exceeds the runtime string limit before stdout begins. Emit a small typed
memory constraint with an explicit unknown formatted size, the runtime limit
and JSON/filter remediation. Preserve full-output framing and leave normal
CTA, human and token-window formatting with Incur. Never rerun analysis.

Capture canonical failure identity at its logging owner, including thrown
AnalysisError projections. Recovery reads compact captured facts without
revalidating or retaining large diagnostics. Keep destination failure ownership,
prevent a second stdout document and retain quiet SIGPIPE status during recovery.

Validation: 111 distinct focused tests across 10 files; check:fast,
docs:check and discovery of all 1555 test files. Sixteen authored formatter
controls fail unchanged e103ae0ce and pass with this fix. A separate closed
reader control caught and now covers recovery EPIPE handling. The heavy JSON
string-limit regression remains excluded; no large Electron reproduction ran.

Twelve small public CLI artifact inspections preserve identical raw replies
and token estimates in TOON and JSON. Timings are noise-level, with no speedup,
cold-cache, large-result memory or real-provider qualification claim. Sentinel
and generator protocols keep their existing ownership.

Fixes #4806
2026-10-18 04:00:15 +08:00
Kaoru0822andClaude Opus 5.5 0781716788 fix(cli): accept --flag=value for global output flags (#3811)
* fix(cli): accept --flag=value for global output flags

`rea <command> --format=json` failed with "Unknown flag: --format".
`--filter-output=...`, `--token-limit=...` and `--token-offset=...`
failed the same way. Incur reads these global flags only in spaced form,
so the equals form fell through to the command parser. Command options
already accept both forms, and `rea mcp doctor` parses `--format=` itself.

A valued output flag with no value (`--format` last, or `--format=`)
also reported the flag as unknown with code UNKNOWN.

normalizeCliOutputArguments, in the module that owns output-argument
interpretation, now splits the equals forms of the four valued output
flags. The entry point passes the normalized argv to rea's output
validation and to Incur, so both read the same effective values. A
missing value now fails with MISSING_OUTPUT_VALUE and names the flag.

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

* fix(cli): detect missing output values while parsing output flags

The missing-value check scanned argv again after parsing, so it also
checked tokens the parser had already consumed as values. For example,
`--filter-output --format` selects the field `--format`, yet the second
scan reported `--format` as missing a value. parseCliOutputArguments
now records the first valued flag it skips for lack of a value, in the
same pass that consumes values.

Cover normalizeCliOutputArguments directly: values containing `=`, empty
values, and command options that only share a prefix. Export it in the
dispatcher test's runtime stub as well.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 20:22:02 -07:00
Kaoru0822andClaude Opus 5.5 5e8f7c536e fix(cli): stop quietly when the stdout reader closes early (#3781)
* fix(cli): stop quietly when the stdout reader closes early

`rea ... | head` crashed once head closed the pipe. TOON and YAML output
raised an unhandled EPIPE 'error' event with a Node stack trace. JSON
output reported {"code":"UNKNOWN","message":"write EPIPE"} on stderr.
Both exited 1, as if the analysis had failed.

The CLI entry point owns process.stdout, so it now treats EPIPE as the
reader declining the rest of the output. It stops writing, suppresses
the failure report and exits 141 like a SIGPIPE-terminated writer, also
when Incur exits through its own failure path. Other stdout errors are
handled as before.

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

* fix(cli): guard mcp doctor output and cover midstream reader closure

The closed-reader guard was only installed for ordinary CLI commands. As a
result `rea mcp doctor | head` still crashed on EPIPE. The guard now lives
in one entry-point function shared by both CLI branches; MCP stdio keeps
its own lifecycle.

The tests now also close the reader after the first chunk of a 4 MiB
streamed JSON result, so later writes in writeJsonOutput are covered.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 18:20:19 -07:00
Ysopwnable fa4b828865 fix(cli): normalize empty Windows profile before imports (#2482)
Follow-up to #2345; thanks to @gefrezim for the import-time home lookup diagnosis.

Normalize only an empty Windows USERPROFILE before runtime dependency imports, preserving all nonempty caller selections. Reuse the existing public setup dry-run regression in the Windows curated CI lane. No additional filesystem query, engine call, cache or retry.

Verified real Windows Node 24.18.0 CLI unset/empty/selected-profile controls, setup dry-run home selection and unchanged configuration, and baseline/candidate SDK stdio MCP catalogue parity. Nine related tests and static/docs checks passed. No IDA or Ghidra engine was used. Scoped resource observations and measurement limits are recorded in experiments/analysis-efficiency/windows-empty-profile.md.

Fixed the review finding and original CI package-scope ownership failure. Current-head CI is green; the unrelated MCP identity timeout passed on a failed-job rerun without changing its code or timeout. Current-head review completed with no further findings.
2026-10-13 12:43:52 +08:00
morluto 570c40cde5 fix(cli): preserve failure semantics across full-output formats 2026-10-13 03:33:27 +08:00
Kaoru0822andClaude Opus 5.5 3159732597 fix(cli): report an invalid REA_LOG_LEVEL as configuration (#2140)
createCli parsed REA_LOG_LEVEL with a throwing schema, so an invalid or
uppercase value crashed every command, including doctor and --help, with
a ZodError stack trace. Parse it into a ConfigurationError result and have
the executable print the same configuration message as the MCP adapter
and exit 1 before building the CLI.

Fixes #2135

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 06:07:37 -07:00
YsopwnableandKaoru0822 d93fbda390 perf(cli): bundle runtime entries to reduce Windows startup I/O (#1996)
Bundle ordinary CLI and output entries to reduce Windows module filesystem resolution while preserving source URLs, lazy loading and worker resources. Keep release identity in its shared owning module.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-12 09:25:27 +08:00
Ysopwnable 76e4153d34 perf(mcp): reduce Windows startup module resolution (#1814)
perf(mcp): bundle internal modules to reduce Windows startup I/O
2026-10-11 21:01:01 +08:00
87edf14940 fix(browser): support Termux Android scenarios (#1655)
* fix(browser): support Termux Android scenarios

* fix(build): lock Termux artifact generation

* ci(android): add manual Termux browser smoke verification

---------

Co-authored-by: tyloryang <[邮箱]>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-10-11 08:10:06 +08:00
morluto abc4f47683 build: separate runtime artifacts and supervise command ownership 2026-10-09 20:11:17 +08:00
Ysopwnable 0e25befe78 fix(cli): stream large JavaScript JSON results (#1024)
* fix(javascript): report application analysis progress on the CLI

* test(cli): preserve progress in filtered output checks

* fix(cli): stream large JavaScript JSON results

* test(cli): include streaming output in dispatcher fixture
2026-10-08 03:44:51 +08:00
Kaoru0822 2db668f6ca fix(cli): emit empty structured filter projections (#914) 2026-10-07 17:51:10 +08:00
Kaoru0822 ae72abd019 fix(cli): include build step in missing-runtime recovery 2026-10-05 22:19:35 -07:00
morluto 1783bf6dfd fix(npm): preserve explicit setup versions (#465)
* fix(npm): refresh stale setup bootstraps

* fix(npm): preserve explicit setup versions

* docs: distinguish first-run and refresh setup
2026-08-10 02:59:52 +08:00
morluto 90bb1610f5 fix(setup): refresh stale local npx bootstrap 2026-07-26 06:39:28 +00:00
N0zoM1z0 d25e98c3f9 feat: complete REA remediation program 2026-07-22 22:09:12 +09:00
morluto ee1cd40405 feat(mcp)!: harden contracts and evidence references
BREAKING CHANGE: comparison tools now require session-owned Evidence IDs or approved bundle paths, and structured Evidence results use compact references.
2026-07-16 19:49:58 +08:00
N0zoM1z0 8c67dbd49e feat(electron): reconcile static artifacts with passive runtime 2026-07-16 09:55:21 +09:00
N0zoM1z0 3fa2304bc7 feat(electron): map static process and IPC boundaries 2026-07-16 07:56:13 +09:00
morluto 6ba97656ca fix(cli): make clean source checkouts start reliably 2026-07-15 14:44:04 +00:00
N0zoM1z0 190e5d3282 fix(cli): restrict production MCP dispatch 2026-07-14 20:33:23 +00:00
N0zoM1z0 be76f8090b feat: add web and Electron reverse-engineering workflows 2026-07-14 20:24:12 +09:00
N0zoM1z0 2c1ceabbf1 feat: add passive website reverse engineering 2026-07-14 12:27:13 +08:00
morluto 77454dc8f4 fix(errors): improve recovery guidance 2026-07-13 19:09:27 +00:00
morluto e651cb65db feat: add cross-platform installation lifecycle 2026-07-12 23:43:24 +00:00
morluto 4ff4c11a00 Add evidence-backed investigation workflows 2026-07-12 21:12:18 +00:00
morluto cc8681a856 feat: add evidence-backed process investigations 2026-07-12 20:36:00 +08:00
morluto 4f18e26ee5 feat: evolve REA analysis platform 2026-07-12 19:32:13 +08:00
morluto 1f235cb52f docs: document the 43-tool workflow 2026-07-12 19:00:03 +08:00
morluto 62ede515b7 docs: record runtime and release constraints 2026-07-12 08:45:35 +08:00
morluto c6bf2799e6 chore(package): prepare public npm release 2026-07-12 08:19:36 +08:00
morluto 97541d8dad refactor(cli): share runtime between CLI and MCP 2026-07-12 07:44:21 +08:00