Commit Graph
2711 Commits
Author SHA1 Message Date
ShuaixinHuang 8dc37bfcea perf(evidence): bound temporary storage for filtered unknown pages (#15747) 2026-12-02 13:36:47 +08:00
Vincent Koc 93dcb1a8a8 refactor(ledger): share Evidence links from bindings (#15775) 2026-12-02 04:57:09 +00:00
Vincent Koc c19f474453 refactor(config): share the final YAML member edit (#15766) 2026-12-02 03:44:20 +00:00
Vincent Koc 6bb42af594 refactor(apple): share missing bundle layout reporting (#15757) 2026-12-02 02:51:00 +00:00
Vincent Koc 8412025724 refactor(doctor): share provider check classification (#15754) 2026-12-02 02:47:27 +00:00
Vincent Koc cd2f4dd985 refactor(setup): reuse unresolved registration status projection (#15742) 2026-12-02 02:38:11 +00:00
Vincent Koc a795e1a46a refactor(setup): share MCP stdio connection profiles (#15734) 2026-12-02 02:17:12 +00:00
Vincent Koc b0a6081ef2 test(vsix): share the inspection report fixture (#15729) 2026-12-02 01:55:33 +00:00
Vincent Koc cacaefe8f8 refactor(api-contract): share parser heap admission (#15725)
* refactor(api-contract): share parser heap admission

* refactor(errors): centralize measured heap refusals

* test(api-contract): isolate parser heap regression
2026-12-02 01:47:46 +00:00
Vincent Koc 106dbf8e72 test(application): reuse inspection input refusals (#15724) 2026-12-02 01:31:18 +00:00
Vincent Koc 449fef2c03 test(packages): reuse late cancellation evidence fixture (#15720) 2026-12-02 01:18:45 +00:00
Vincent Koc 35a43708bf test(resources): reuse bundle cleanup promise fixtures (#15715) 2026-12-02 01:04:41 +00:00
Vincent Koc 98c7ee53a0 refactor(mcp): share client configuration presence checks (#15708) 2026-12-02 00:54:42 +00:00
Vincent Koc c40e85a9cf test(pcap): share empty capture fixture fields (#15707) 2026-12-02 00:53:00 +00:00
Vincent Koc 8c9516ae3e refactor(guidance): share documentation result formatting (#15700) 2026-12-02 00:29:31 +00:00
Vincent Koc 017c2de642 refactor(pe): reuse load-config evidence range projection (#15692) 2026-12-02 00:11:00 +00:00
2SinceJuly 6943bc32b5 fix(doctor): stop offering Hopper setup where its installer cannot run (#15633)
* fix(doctor): stop offering Hopper setup where its installer cannot run

Doctor told every host without HOPPER_LAUNCHER_PATH to run 'rea setup to install Hopper'. Setup already classifies that request: on Windows it refuses with 'REA supports Hopper on macOS and selected x86_64 Linux distributions', and on macOS older than 12 it says to upgrade. Users on those hosts were sent to a step that cannot work (a Windows dry run even printed the macOS hdiutil plan).

Move the per-platform install decision into a single hopperSetupSupport owner in LinuxHopper.ts. Setup planning now folds its result into the eligibility it already carried, and doctor reads the same host facts (macOS version, Linux distribution) to pick its remediation: point at 'rea setup' only where the installer can run, and otherwise name the hosts that support Hopper and point at an existing provider or launcher.

The probe host gains architecture, macosVersion, and linuxDistribution so a client-selected environment keeps the machine's platform facts.

* fix(doctor): keep an unreadable macOS version unknown in Hopper advice

hopperSetupSupport folded an unparseable macOS version into the macOS 12
floor refusal, so a host whose probe failed was told to upgrade while the
host check reported the same value as unknown. Report the version as
undeterminable instead, matching the host check's wording and preserving
the uncertainty across the boundary.
2026-12-01 18:57:54 -05:00
Vincent Koc 89fbd96bb9 test(mcp): share global registration client fixtures (#15690) 2026-12-01 23:56:40 +00:00
Vincent Koc c62e1fe51e refactor(environment): share state entity key extraction (#15688) 2026-12-01 23:55:48 +00:00
Vincent Koc 1ff9d32b35 refactor(shortcut): share evidence range selection (#15681) 2026-12-01 23:40:22 +00:00
Vincent Koc f147d79efd refactor(evidence): share metadata report subject facts (#15678) 2026-12-01 23:34:32 +00:00
morluto 44fbcfc787 feat(evtx)!: page event records with offset and report page facts (#15636)
* feat(evtx): page event records with offset and report page facts

inspect_evtx_archive stopped walking at max_records, so records past the first 20,000 (the newest events of a default-size Application log) could not be listed. The walk now covers every record. max_records stays a 20,000-record page bound, which limits retained Evidence. A new zero-based offset selects the first record listed. The result reports page { offset, limit, returned, total, next_offset }, and the record-limit-reached diagnostic names offset=next_offset. Coverage now describes parse loss only, so a page that leaves records out by selection is no longer partial, and chunk ending facts and endpoint checks cover records past the page.

Fixes #15612

* feat(evtx)!: qualify the file-tail offset for small and wrapped logs

The suggested tail offset is now the larger of 0 and page.total minus max_records, so a log smaller than one page gets a valid offset. File order is oldest first only in a log that has not wrapped; the guide and descriptions now say how chunks[] locates the newest records in a wrapped log.

BREAKING CHANGE: inspect_evtx_archive results now require page. Evidence saved before this change has no page, and inspect_analysis_view refuses to summarise it. Re-run inspect_evtx_archive on the log to produce current Evidence.
2026-12-01 17:15:02 -05:00
Vincent Koc 2e5147ffd2 refactor(reference): share import key ordering (#15642) 2026-12-01 22:13:32 +00:00
morluto 62e7c0b050 fix(views): size evidence-json pages to the effective agent result budget (#15638)
* fix(views): size evidence-json pages to the effective agent result budget

An over-budget delivery names inspect_analysis_view evidence-json at offset
0 as its next call. With limit omitted, a page held at most 24,576 bytes of
escaped text, sized for the 32 KiB default budget with a fixed 8 KiB
allowance for its view Evidence. Below about 32 KiB (the minimum is 4,096),
following next returned another answer over the budget.

The view service now pages an omitted limit as the largest page whose
view Evidence, measured as delivered, fits the effective budget (the
runtime override, then REA_AGENT_RESULT_BUDGET_BYTES, then the default).
A page over the budget shrinks by its measured excess and is projected
again. The MCP binding, application-execution views and the CLI pass the
launch seed they captured. A default page also never spans more code
units than the largest explicit limit, so large budgets keep fitting the
stdio frame. The fixed envelope constant and default page size are gone.

* perf(views): reuse the last window while shrinking an uncached evidence-json page
2026-12-01 17:13:14 -05:00
morluto 2271e21a00 fix(setup): keep Hopper advice and plans off hosts without Hopper (#15635)
* fix(setup): keep Hopper advice and plans off hosts without Hopper

On Windows, doctor told people to run rea setup to install Hopper, and
rea setup --install-hopper --dry-run then showed the macOS installer before
refusing. Hopper runs only on macOS and Linux.

The Hopper provider, doctor and setup now share one host rule. On another
host doctor reports Hopper as unsupported_host, even for a configured
launcher the provider would refuse, and names Ghidra or IDA as the next
step. Setup refuses an explicit Hopper installation before planning, so no
host shows an installer it cannot run, and its Windows refusal names the
command to run instead.

* test(package): expect no Hopper plan where setup refuses it

The package verifier required an install_hopper plan from
setup --install-hopper on every host, including Linux arm64 and Windows,
where setup refuses. Setup now refuses before planning there, so the
verifier expects the installer plan only where Hopper setup is supported.
2026-12-01 21:55:49 +00:00
morluto 05a9e8fb66 fix(desktop): recognize unpacked resources/app Electron applications (#15632)
* fix(desktop): recognize unpacked resources/app Electron applications

Electron loads an application from resources/app.asar, resources/app or
resources/default_app.asar. The desktop path convention recognized only the
ASAR names, so VS Code and GitHub Desktop, which ship an unpacked
resources/app folder, got no Electron candidate and only .NET probes for the
managed helpers they bundle.

The convention owner now reports the Electron application layout and its
depth for both forms. inspect_desktop_application emits an
electron-app-directory-convention fact for resources/app/package.json, adds it
to the Electron candidate and offers analyze_javascript_application on the
folder. Electron application probes are now application priority, so bundled
managed or native helpers no longer lead next_probes. Release exposure reads
the layout folder from the same convention, so an unpacked build names its
fuse host like an ASAR build.

* fix(desktop): derive Electron probes before bundled managed helpers

A bundled managed helper with its own .runtimeconfig.json, such as Git
Credential Manager in GitHub Desktop, is application priority too. Its probe
was derived first, so the stable priority sort still put it ahead of the
Electron application. Derive the Electron candidate and probes first.
2026-12-01 16:35:04 -05:00
Vincent Koc 52c712c26d refactor(setup): share aggregate uninstall status (#15629) 2026-12-01 21:30:29 +00:00
Vincent Koc e6edca0403 refactor(views): reuse indexed load-image paging (#15628) 2026-12-01 21:17:59 +00:00
Vincent Koc cab1047870 refactor(contracts): share API Evidence construction (#15623) 2026-12-01 21:06:24 +00:00
Vincent Koc da0760f7f5 refactor(setup): share installer output normalization (#15609) 2026-12-01 20:53:51 +00:00
Vincent Koc 9decdc0e2f refactor(contracts): share verified API document identity (#15616) 2026-12-01 20:48:42 +00:00
Vincent Koc 1fe1aa975c refactor(setup): share Git client configuration paths (#15605) 2026-12-01 20:26:39 +00:00
Vincent Koc 67a348e60e refactor(setup): share registration path containment (#15597) 2026-12-01 19:50:28 +00:00
Vincent Koc 5f226de4ae refactor(setup): share Kiro agent selection (#15586) 2026-12-01 19:18:43 +00:00
Vincent Koc 14971020db refactor(dwarf): reuse file inspection evidence (#15585) 2026-12-01 19:08:26 +00:00
morluto 6991e735a2 test: require a matcher for every toThrow assertion (#15577)
A bare toThrow() or rejects.toThrow() passes on any error, including one
from a broken fixture or a refusal for the wrong reason. The suite's 429
bare sites now assert the specific refusal, so turn on
vitest/require-to-throw-message as an error to keep it that way.

Tighten the one site added since (malformed TOML now asserts smol-toml's
line and column). The two sites whose refusal cannot be observed outside
Linux or without a native capture bound keep a bare matcher with a
disable comment saying why.
2026-12-01 14:03:47 -05:00
morluto 65499cd329 fix(call-graph)!: report each node's coverage limits once, in relationship_coverage (#15582)
get_call_graph copied each node's relationship coverage into the node's
limitations: a partial coverage's limitations, an unknown coverage's
reason (including the synthesized "Provider did not report relationship
coverage."), and its diagnostics. Every ok node therefore repeated what
its relationship_coverage already said, which costs tokens on every node
of a large graph.

A node now keeps limitations only for the provider's own caveats that no
coverage classified, when the provider reported no relationship coverage.
Graph-wide limitations are unchanged.

BREAKING CHANGE: get_call_graph nodes no longer repeat
relationship_coverage limitations, reason or diagnostics in their
limitations field. Read relationship_coverage for a node's coverage
limits; node limitations now hold only unclassified provider caveats.
2026-12-01 14:03:38 -05:00
Vincent Koc 38de12c9b9 refactor(desktop): reuse withheld export refusal helper (#15580) 2026-12-01 18:42:25 +00:00
Vincent Koc d3544eb95d refactor(guidance): share token envelope decoding (#15578) 2026-12-01 18:40:36 +00:00
morluto a69837647b test: fix false-pass assertions, consolidate suites, and close coverage gaps (#15519)
* test: fix false-pass assertions, consolidate suites, and close coverage gaps

* test: finish signal-0, unchecked close_binary, and vacuous .every() audit

* test(registration): run shared capture inside test so child inherits scaled deadline

* test(artifacts): bind final verification fault to reader source and post-read phase
2026-12-01 18:10:12 +00:00
morluto a1a0f4287c fix(guidance): report an oversized guide file as over its allowance (#15568)
readSkillFile refused a file larger than the caller's allowance with
RegularFileChangedError (ESTALE, "Selected input changed while being
read"), so search_guidance and read_guidance reported an oversized
packaged guide as missing or unreadable. Throw SkillFileTooLargeError with
the measured size and the allowance, and report it as the 1 MiB per-file
allowance, as the bundle and index allowances already are.
2026-12-01 18:08:47 +00:00
morluto c082574efc fix(desktop): refuse an invalid withheld-file handle as invalid, not as no free handle (#15571)
DesktopBuildSecrets.keep stops at the first candidate handle that is not a
secret's handle. When that was the computer's own handle, such as
../escaped, the refusal said REA had no handle free and told the person to
delete old secret files. Refuse the invalid handle up front and say so.
2026-12-01 18:04:48 +00:00
Vincent Koc 3b73422004 refactor(json): centralize input read failure handling (#15567) 2026-12-01 17:59:51 +00:00
Vincent Koc 11cbd62d11 refactor(capabilities): share configured provider availability (#15555) 2026-12-01 17:44:11 +00:00
morluto 08db65115f test(application/desktop/browser/process): assert the specific refusal behind each bare toThrow (#15524)
* test(application,desktop,browser,process): assert the specific refusal behind each bare toThrow

Replace bare toThrow() with the errno code of a removed or occupied path, the Zod issue path and code, the YAML parser error code, the cleanup retry failure and the resources it still holds, the analysis error tag and reason, or the contract message each refusal reports.

* test(desktop,process): assert retained cleanup resources and the nested metadata issue
2026-12-01 12:19:11 -05:00
2f92d2699b fix(views)!: refuse an unsupported parent's view kind and name evidence-json (#15535)
inspect_analysis_view refused a view that no projector of the parent
operation serves as an unsupported target: "the selected target's
evidence form is outside what inspect_analysis_view reads",
retry_class never, pointing to get_evidence_bundle. The evidence-json
view reads every parent, so the same call with view
{"kind": "evidence-json"} succeeds on that record within the response
budget; the refusal contradicted it.

The refusal is now a schema-conforming input error at view.kind that
names the requested view kind, with retry_class change_first and a
recovery naming the evidence-json view and the summary receipt's
parent_evidence_id. It does not claim evidence-json is the only view,
because parent-independent views such as recorded-array may apply. The
recovery names no adapter-specific tool, because the CLI shows it too.

Refs #15319

BREAKING CHANGE: inspect_analysis_view on a parent Evidence operation
without a projector for the requested view now fails with code
invalid_request (category invalid_input, retry_class change_first) and a
view.kind issue, instead of unsupported_target with
details.failure_kind "unsupported", format "evidence" and
related_operations.

Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-02 01:16:03 +08:00
gensokyo-devandgensokyo-dev 630ce39c22 fix(target): name the raw-binary load when no route recognizes a header
When header detection admitted no route for a file, open_binary and
inspect_artifact refused it with the generic "select a supported,
well-formed target", leaving no next step for a headerless firmware or
memory image. The explicit raw-binary load is the only route that admits
such a file, so the producer now names it with its required architecture
and entry_point. inspect_artifact shares the same detection, so it is
not offered as a way to identify the file.

Refs #15319

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-02 00:52:36 +08:00
morluto 6549264a54 fix(errors): name the next step for schema-valid refusals, including missing files (#15435)
* fix(errors): report a missing selected file with its next step, not the schema

Nine readers hand-built their own copy of the selected-file refusal
(access denied, or an input issue for ENOENT, ENOTDIR, ELOOP and the
other path errnos) instead of using the shared
projectSelectedArtifactFileFailure. The copies left out the conforming
outcome and next step, so a well-formed path to a missing file was
presented as a schema mismatch with inspect_input_contract.

API contract, APK signature, byte entropy, Electron fuse, Playwright
trace, NTFS journal, release exposure, Android mapping and web capture
reads now use the shared owner. A missing OCI image-layout directory
names a directory as its next step.

The first-contact sweep lists none of these as known failures any more;
#15372 already fixed the other 35 entries and the stale-revision replay.

Refs #15312

* fix(errors): give the remaining schema-valid refusals their next step

These refusals accepted a well-formed request and still sent the caller
back to the input schema:

- update_analysis_settings with a stale expected_revision now names
  inspect_analysis_settings and the current revision.
- inspect_electron_fuses on an app or file that is not Electron names
  what to select; capture_electron_scenario reports the same refusal
  on executable_path instead of path.
- inspect_analysis_view on a multi-record Evidence bundle without
  source.evidence_id, or with an absent one, says to pick a listed id.
- extract_uefi_firmware with an unmapped or ambiguous target names
  inspect_uefi_firmware or target.source_stream.
- inspect_labview_artifact on a file without LabVIEW RSRC data names
  what to select.

Refs #15312
2026-12-01 10:36:08 -05:00
morluto 82613c0ace fix(session): never overwrite the open target with a snapshot or bundle (#15449)
* fix(session): never overwrite the open target with a snapshot or bundle

* test(session): cover a hard-linked target and own the test directory cleanup
2026-12-01 15:29:12 +00:00
Vincent Koc 3e565f4bf6 refactor(javascript): share Electron graph edge projection (#15479) 2026-12-01 14:17:07 +00:00