Commit Graph
1246 Commits
Author SHA1 Message Date
Vincent Koc 917646c723 test(cli): share managed summary arguments (#16442) 2026-12-03 18:58:32 +00:00
Vincent Koc dda05bfa5d test(cli): share command projection context fixtures (#16408) 2026-12-03 17:14:21 +00:00
Vincent Koc fcf976e8aa test(cli): share stream graph output fixtures (#16388) 2026-12-03 15:09:02 +00:00
Vincent Koc b352b301c7 test(javascript): share CLI and MCP session app fixtures (#16368)
* test(javascript): share CLI and MCP session app fixtures

* test(mcp): remove unused session fixture import
2026-12-03 13:55:28 +00:00
Vincent Koc a0d9275951 test(png): share chunk encoding across image fixtures (#16347) 2026-12-03 12:44:47 +00:00
Vincent Koc 085ffaf5f3 test(cli): share failure-output fixture setup (#16344) 2026-12-03 12:34:26 +00:00
Vincent Koc ae19a87dd5 refactor(cli): share help row alignment (#16336)
* refactor(cli): share help row alignment

* test(cli): cover blank help description spacing
2026-12-03 12:19:10 +00:00
Vincent Koc 34599ec5ff test(cli): share instructions completion fixtures (#16330) 2026-12-03 12:00:02 +00:00
Vincent Koc b635ff751e test(cli): share timing flag fixture matrix (#16327) 2026-12-03 11:29:03 +00:00
Vincent Koc d3e70b88a2 test(cli): share logged command fixture execution (#16320) 2026-12-03 11:00:55 +00:00
Vincent Koc baaabb3dfa test(cli): share accessibility comparison result checks (#16317) 2026-12-03 10:46:10 +00:00
Vincent Koc b013a2ff28 test(cli): share analysis view request fixtures (#16314) 2026-12-03 10:36:10 +00:00
Vincent Koc d5ed402722 test(plist): share native CLI fixture invocations (#16310) 2026-12-03 10:30:12 +00:00
Vincent Koc 246f63a304 test(cli): share Unicode output capture setup (#16307) 2026-12-03 09:49:21 +00:00
Vincent Koc 77235a7fd3 test(apple): share archive CLI projection fixtures (#16304) 2026-12-03 09:35:00 +00:00
Vincent Koc 753feb550d test(cli): share filtered rows command fixtures (#16301) 2026-12-03 09:21:01 +00:00
Vincent Koc 2ecbb734c8 test(cli): share expected require resolution edges (#16298) 2026-12-03 09:07:45 +00:00
Vincent Koc cf54d0af98 test(cli): share literal Evidence bundle arguments (#16291) 2026-12-03 08:41:32 +00:00
Vincent Koc 4f0f74f43b test(cli): share probe contract fixtures (#16278) 2026-12-03 07:53:01 +00:00
Vincent Koc 8eabbd1ca4 test(macho): share dylib platform fixtures (#16254) 2026-12-03 06:29:43 +00:00
2SinceJuly 30bac88e18 feat(config): persist REA_WABT_BIN_DIRECTORY in the user config file
A plugin install has no `rea setup` registration to carry a WABT
tool directory, so the only way to enable inspect_wasm_artifact was a
client-wide environment variable, even though #3016 persisted the other
host-stable tool paths.

Add REA_WABT_BIN_DIRECTORY to PERSISTED_SETTINGS and the environment
schema as an absolute path, so `rea config --set`,
`rea config --get --json` and startup precedence (env > config > auto)
behave like REA_ILSPY_CMD_PATH and HOPPER_LAUNCHER_PATH. The value is
merged into the effective environment before the WASM provider reads it,
so no provider change is needed. Setup still leaves saved values in the
file rather than copying them into a client registration.
2026-12-03 12:22:58 +08:00
Vincent Koc 5951ceb105 test(cli): share reference-source import fixture (#16166) 2026-12-03 01:07:49 +00:00
Vincent Koc 753cd9d51b test(cli): reuse formatting recovery output capture (#16106) 2026-12-02 21:09:31 +00:00
Vincent Koc e9447b2ad8 test(cli): reuse captured result output setup (#16045) 2026-12-02 16:26:18 +00:00
Vincent Koc 2ab61af2a9 test(cli): reuse Unicode output capture streams (#15900) 2026-12-02 11:44:59 +00:00
Vincent Koc dda7527516 test(cli): reuse filtered output capture streams (#15897) 2026-12-02 11:39:31 +00:00
Vincent Koc 48f886bdef test(cli): share address and procedure discovery fixtures (#15871) 2026-12-02 10:05:35 +00:00
Vincent Koc 23c43186c8 test(cli): share Markdown literal Evidence fixtures (#15858) 2026-12-02 09:08:25 +00:00
Vincent Koc 58d36e5550 test(environment): share export CLI fixture arguments (#15777) 2026-12-02 04:55:05 +00:00
morluto 925dce1ded fix(pe)!: deliver inspect_pe_imports and inspect_pe_resources within the agent result budget (#15687)
* fix(pe)!: deliver inspect_pe_imports and inspect_pe_resources within the agent result budget

Neither tool had a detail input or a summary view, so their complete
Evidence was always delivered inline: about 200-480 KB of CLI JSON for
stock kernel32.dll, shell32.dll and explorer.exe, and over 1 MB over MCP.

Both now follow the inspect_deb_package pattern. With detail omitted,
complete Evidence is returned when it fits the agent result budget, and
otherwise the retained summary with delivery facts; detail complete always
returns everything, and inspect_analysis_view evidence-json pages the
retained record. The CLI gains --detail and --evidence_output.

The imports summary carries image identity, imphash, coverage with DLL
and function counts, issue/limitation counts and one name/function_count/
delay_load row per DLL, bounded to 16 KiB of rows with an omitted count.
The resources summary carries image identity, the resource directory,
coverage, directory/resource/icon-group counts and resource counts by type
and by language, each bounded to 8 KiB of rows with an omitted count.

The byte-bounded leading-prefix rule extract_artifact's summary used is
now byteBoundedList, shared by the three summaries.

BREAKING CHANGE: inspect_pe_imports and inspect_pe_resources output is now
complete Evidence or, when detail is omitted and the Evidence exceeds the
agent result budget, the inspect_analysis_view summary with delivery facts.
Callers that need the complete record inline pass detail "complete"
(CLI --detail complete); otherwise follow delivery.next.

Fixes #15619

* test(pe): cover byte-bounded lists and named resource identities in summaries

* fix(cli): withhold an over-budget summary answer and print its paging facts

The CLI printed {summary, evidence_bundle, delivery} for over-budget Evidence without measuring it, so a summary larger than a smaller configured agent result budget was printed whole. Like MCP since #15591, the CLI now measures that answer and, when it is over the budget, prints the bundle receipt and the delivery facts marked withheld, whose next call pages the saved Evidence.
2026-12-01 19:32:41 -05:00
morluto 51b91c873d test(artifacts): expect resource_constraint for the ZIP zstd window ceiling (#15696)
The fixed 128 MiB ZIP Zstandard window allowance refuses the read at
admission, which #15588 reports as resource_constraint. The test still
pinned partial through a ternary keyed by the fixture size.
2026-12-01 19:12:16 -05:00
morluto efbb66c16a fix(errors)!: report wrong-format, missing-file and missing-Evidence refusals by their cause (#15581)
* fix(errors)!: report wrong-format, missing-file and missing-Evidence refusals by their cause

- inspect_labview_artifact refuses a file with no LabVIEW RSRC data as an
  unrecognized target (code unsupported_target, failure_kind unrecognized),
  as its format siblings do, instead of invalid_request. A PE whose
  resource tree could not be fully read is a malformed PE target.
- inspect_gpu_code_objects, inspect_model_artifact and Apktool reported a
  missing or non-regular selected file through their own copy of the
  selected-file refusal (BinaryTargetError, target_unavailable). They now
  use the shared projectSelectedArtifactFileFailure owner
  (invalid_request, conforming, with its own next step), and the copy is
  removed. The shared owner keeps the verified-symlink recovery the copy
  carried.
- A retained Evidence reference the session does not hold is
  invalid_request / invalid_input instead of evidence_integrity_mismatch.
  Altered or unauthenticated Evidence stays evidence_integrity_mismatch.

BREAKING CHANGE: error codes change for three refusals. A non-LabVIEW
file given to inspect_labview_artifact is unsupported_target (was
invalid_request). A missing or non-regular selected file for
inspect_gpu_code_objects, inspect_model_artifact or Apktool operations is
invalid_request (was target_unavailable). A missing retained Evidence
reference (details.reason "missing") is invalid_request with category
invalid_input (was evidence_integrity_mismatch / integrity_mismatch).
Callers that branch on these codes should match the new values;
details.reason, retry_class and the remediation are unchanged in meaning.

* test(model): expect the shared selected-file refusal for a missing model path

The process-global host read failure test still expected
target_unavailable for path errors on a model file. Those are now the
shared selected-file input refusal.

* fix(resources): name a rejected symlink in the shared selected-file refusal

The GPU and model readers' copy of the selected-file refusal said the
path was a symbolic link; the shared owner reported only ELOOP, so
rejectedSymlinkRecovery failed once they moved to it. Use the rejected
symlink's own message, and keep the errno message for every other
selected-path refusal.

* docs(errors): describe missing references and closure members as the caller's selection

The comment above RESOURCE_SNAPSHOT_NOT_APPLICABLE still said a missing
Evidence reference stays an integrity failure. Missing references,
including retained sources and closure members, are invalid_request; only
altered or unauthenticated Evidence stays an integrity failure.
2026-12-01 17:11:08 -05:00
morluto a5bf175e06 fix(artifacts)!: report reader admission limits as resource_constraint (#15588)
* fix(artifacts)!: report reader admission limits as resource_constraint

An artifact read refused by a reader limit (artifact_limits.*) or a
release-fixed allowance was code partial, which the error contract
reserves for a result cut short by a delivery or decode limit. The
read was refused at admission, so it is now resource_constraint, like
every other admission limit. The retry class is unchanged: change_first
when the limit can be raised, never when it cannot. A limit without
admission facts, such as a parser budget, stays partial.

The reader's own recovery, which names the parameter, its supported
range and the next step, and the reader_limit fact are unchanged.

Refs #15323

BREAKING CHANGE: artifact refusals with details.reason "limit" and a
details.reader_limit or fixed allowance report code and category
resource_constraint instead of partial. Match resource_constraint, or
read details.reason and details.reader_limit, which are unchanged.

* fix(errors): catalogue each artifact admission limit with the retry it returns

The catalogue listed one row for reader limits and fixed allowances with
change_first, though a fixed allowance and a reader limit already at its
maximum return never, and the release-fixed row still said partial.
List the raisable reader limit, the reader limit at its maximum and the
release-fixed allowance as separate rows, and test each row against the
error it projects.
2026-12-01 17:10:56 -05: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
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 751b97ad12 test: assert the CLI-only option and DOL detection cases that checked nothing (#15570)
"keeps its CLI-only options out of the contract input" ran for every
contract command, but 121 commands have no CLI-only options, so their loop
asserted nothing. Run it only for commands that have them, and assert that
list is not empty.

"never auto-detects a DOL without the caller's format selection" only
asserted when parsing succeeded. Without a selection the DOL is refused as
an unsupported binary format; assert that refusal.
2026-12-01 13:04:26 -05:00
morluto fb5b6d4abb test: assert the refusal each MCP, boundary and verifier check expects (#15531)
Replace bare toThrow() across the MCP, CLI and other boundary tests, the
Hopper and fixture conformance verifiers, the evaluation guards and the
process-global tests with the SDK cancellation code and reason, schema
issue paths, tagged error reasons, cleanup facts, errno codes and
verifier messages each case is meant to refuse.
2026-12-01 17:02:41 +00: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
hhangandhhang 2c78ff1f75 fix(cli): reject non-integer output filter indices (#15491)
Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
2026-12-02 00:01:25 +08:00
morluto 6ac87697e7 fix(errors)!: make retry_class the only retry field of a target failure (#15450)
* fix(errors)!: make retry_class the only retry field of a target failure

A target failure reported two retry fields: its own `retry` hint
(`none | backoff | after_change`) and the `retry_class` every error
carries. They mapped one to one, so readers had to reconcile both.
`retry_class` is now the single owner: the target-failure table declares
it directly, the projection no longer emits `retry`, the error schema no
longer accepts it, and the CLI recovery rewrite reads `retry_class`.

BREAKING CHANGE: target failures no longer include `retry`, and the
error schema rejects it. Read `retry_class` instead: `backoff` is
`same_call`, `after_change` is `change_first` and `none` is `never`.

* test(errors): readers reject the removed target-failure retry field
2026-12-01 10:36:15 -05:00
Vincent Koc 569c4fbe96 test(environment-state): share timestamp-order fixtures (#15498) 2026-12-01 15:29:03 +00:00
Vincent Koc 9bce30bd20 test(keyed-archive): share XML and bundle fixtures (#15475) 2026-12-01 13:17:25 +00:00
Afloat dfc987577e fix(cli): honor index and open-ended output selectors (#15417)
* fix(cli): honor index and open-ended output selectors

* test(cli): count tokens for the selected array-shaped output
2026-12-01 19:57:18 +08:00
Vincent Koc bb3bf139ea perf(cli): isolate JavaScript application command startup (#15209)
* perf(cli): isolate JavaScript application command startup

* fix(cli): finalize direct JavaScript analysis before returning
2026-12-01 19:31:28 +08:00
Vincent Koc 4766b20a1e test(providers): share effect declarations for inert fixtures (#15204) 2026-12-01 19:31:17 +08:00
morluto 0e07a3c876 fix(delivery)!: deliver over-budget results and errors inside the agent result budget (#15396)
* fix(mcp)!: deliver over-budget delivery facts inside the structured result

Codex and VS Code forward only structuredContent to the model, and Gemini
CLI and LangChain forward only the text blocks; _meta reaches no model. An
over-budget result put its delivery facts in a second text block and in
_meta, so Codex and VS Code agents received a summary with no sign that it
was one.

An over-budget result is now {summary, delivery} in structuredContent,
the shape the CLI already prints, and its one text block is that value's
serialization. The delivery layer owns the alternative: every budgeted
operation's registered output schema admits it, so canonical and compact
advertisements validate the result.

An overflowing completed result no longer picks its recovery by tool
name. The producer declares an overflow recovery (stateless, retained or
committed, with its next call and identities): list_unknowns,
get_evidence_bundle, inspect_address_context and committed unknowns
declare theirs in their bindings, and retained Evidence declares its own.
Undeclared results fall back to the contract's effects. Only a CLI
contract that reads no session is told to use its `rea` command, so
session reads and committed mutations are never told to use CLI JSON.

BREAKING CHANGE: When a budgeted tool's omitted detail returns a retained
summary, structuredContent is {"summary": <summary Evidence>, "delivery":
<delivery facts>} instead of the summary Evidence, the second
{"delivery": ...} text block is gone, and _meta["rea/agent-budget-delivery"]
is no longer set. Read the summary from structuredContent.summary and the
delivery facts from structuredContent.delivery (or the same members of the
text block). Pass detail "summary" or "complete" to receive Evidence at the
root as before.

Refs #15338
Refs #15326

* fix(delivery)!: deliver every error result under the agent result budget

A failure whose text exceeds delivery.agent_result_budget_bytes is now
retained whole as Evidence (mcp_tool_error in the MCP session,
cli_command_error in the CLI's private cache) and replaced by a bounded
summary. The summary keeps the code, category, retry, recovery and
remediation and every detail field that fits, names the fields it left
out, and carries details.failure_delivery with the inspect_analysis_view
call that pages the complete failure. Non-Evidence facts such as a
mid-extraction artifact inventory were previously inlined whole.

The transport's unretained string-ceiling fallback no longer points at
complete CLI JSON output.

BREAKING CHANGE: An MCP error, or a one-shot CLI failure without
--evidence_output, larger than the agent result budget is delivered as a
bounded summary: oversized details fields are listed in
details.omitted_details instead of being inlined, and
details.failure_delivery names the retained failure Evidence and the
inspect_analysis_view call that pages it. Pass detail complete (CLI
--detail complete) for the complete failure inline, or raise
delivery.agent_result_budget_bytes.

Refs #15326

* fix(delivery): keep overflow recovery from repeating effects or losing the session target

A retained overflow no longer offers the CLI command: the retained record is the complete result, and a call with effects is told not to repeat it. The CLI fallback for an unretained result excludes session tools. The MCP result guarantee is limited to successful results. The schema validity test selects the complete-result alternative of a budgeted output schema.

* fix(delivery): keep failure summaries schema-valid and CLI failure retention self-contained

boundedFailureSummary restores the details a code's schema requires. The CLI retains the failure as it was before its partial observation was summarized, so the record does not depend on a partial file the cache could evict, and a cache write that commits before failing or leaves cleanup incomplete keeps its receipt and cleanup owner.

* fix(delivery): retain the delivered CLI failure with its complete partial restored

* fix(delivery): budget CLI-enveloped failures through the envelope's owner

Provider-backed CLI commands wrap the canonical failure in their error envelope (a label and input diagnostics). The strict projection schema rejected the wrapped failure, so an over-budget failure printed whole without being retained. The envelope's owner now splits it; delivery budgets the canonical failure and keeps the envelope fields on the bounded result. CLI logging uses the same splitter instead of its own destructuring.

* fix(cli): print a bounded failure's retrieval facts on a terminal

A failure bounded to the agent budget carries its retained record and paging call in details.failure_delivery. The terminal presentation printed only the concise error for it, because its preserved-Evidence check did not know that field. It now does, so the structured failure is printed whole.
2026-12-01 04:10:00 +00:00
morluto 0b7f2229b5 test(cli): select export-web-scripts' capture file in the contract parity check (#15418)
Since #15385 export_web_scripts takes exactly one of capture_path or capture, so neither is required alone and the parity check's argv builder supplied no capture source; the contract refused the input. The check now selects the positional capture file.
2026-12-01 03:29:05 +00:00
morluto 080635e7eb fix(artifacts)!: refuse an unusable extract_artifact output_root first, as caller input (#15387)
* fix(artifacts): refuse an unusable extract_artifact output_root before scanning

extract_artifact checked output_root only when it created the output tree,
after scanning the whole archive and preparing its reader. A destination
that already existed was refused there, and the refusal carried the
archive's complete inventory as its partial observation: 1.7 MB of error
text for a 2,000-entry ZIP.

The read-only SafeOutputTree.checkDestination admission, which firmware
and environment-bundle extraction already use, now runs before the archive
is read. SafeOutputTree.create still rechecks and acquires the destination
exclusively, so a destination that changes after the early check is still
refused there.

Refs #15326

* fix(artifacts)!: report a refused extract_artifact output_root as caller input

A destination refusal on extract_artifact is now an input error on
output_root, as firmware, UEFI, script and bundle export report theirs.
Every destination refusal conforms to the input contract and names the
fix instead of pointing at the schema.

BREAKING CHANGE: extract_artifact reports a refused output_root as
invalid_request with an issue at output_root (CLI: outputRoot) instead of
artifact_operation_failed with reason path. Destination refusals of
extract_firmware, UEFI extraction, export_web_scripts,
export_environment_bundle, environment-export/build and desktop build
exports no longer carry recovery.kind inspect_input_contract; read
remediation.action and details.issues instead.

Refs #15326

* test(artifacts): expect the caller-input refusal for a refused extract_artifact output_root

The provider extraction boundary tests still asserted ArtifactOperationError reason path, the shape this change replaces; they now expect AnalysisInputError with an issue at output_root.

* test(artifacts): prove extract_artifact refuses the destination before reading the source
2026-12-01 02:23:38 +00:00
morluto d09fa76eca fix(debuggers)!: report the inferior disposition that debugger cleanup established (#15353)
* fix(debuggers)!: report the inferior disposition that debugger cleanup established

The shared owned-debugger stop returned `stopped` or `already_exited`
without saying what happened to the inferior, so close_gdb_session
re-derived a local target_state (reporting a verified -target-detach as
"unknown") and close_rizin_debug_session always returned the literal
"unknown".

The stop result now carries one InferiorDisposition (none_observed,
detached, exited, or unknown with the provider's reason), mapped once
from the recorded detach outcome. `stopped_inferior_unknown` is folded
into it. Providers report a verified state through `verifiedInferior`
(replacing `inferiorStateUnknown`), and a detach whose identified
inferior then ended reports `inferior-ended` instead of `no-inferior`.
GDB tracks its verified inferior state as a union instead of a boolean,
so the detach that close performed is still reported after the debugger
stops. Both close tools return `target_state` from the stop result.

Refs #15324

BREAKING CHANGE: close_gdb_session and close_rizin_debug_session
output `target_state` is now one of none_observed, detached, exited or
unknown. close_gdb_session previously returned only none_observed or
unknown; close_rizin_debug_session always returned unknown. Clients that
validate output against the previous schemas must accept the new values;
`unknown` keeps its meaning (the debugger was terminated without a
verified detach, so the inferior may still be running).

* test(debuggers): type the lifecycle close fake with the full inferior disposition

* test(debuggers): commit close schema summaries and prove what a failed close keeps

Commits the advertised schema summaries for close_gdb_session and
close_rizin_debug_session. The GDB manager test now asserts the close
itself stopped the owned process, and the external-mutation lifecycle
test asserts a command refused behind a failed close is that retained
cleanup blocker and never reaches the debugger.
2026-12-01 02:19:09 +00:00
Vincent Koc fcdb137120 test(setup): use owned launchers in uninstall fixtures (#15296) 2026-12-01 02:36:15 +08:00