* fix(artifacts): explain ASAR PE signed-after-packing mismatches
When an unpacked PE companion fails ASAR integrity only because Authenticode
was applied after packing, record a verifiable signing_explanation on the
SHA-256 contradiction and error details instead of an opaque untrusted
mismatch. Bytes stay observed-untrusted; any other mutation remains an
unexplained contradiction.
Fixes#7212
* fix(artifacts): address signed-after-packing Greptile review
Catch ParseFailureError so unreadable PKCS#7 keeps the digest explanation,
share WIN_CERTIFICATE structural walks, index signer lookups, charge optional
reads to acquisition budgets with reported skips, preserve mismatch details
through cleanup failures, and inherit the shared MCP test deadline.
* fix(pe): walk WIN_CERTIFICATE entries lazily under max_entries
Convert the certificate-table walker into a generator so inspection stops at
the entry budget without materializing every range, and reconstruction can
validate structure with constant memory.
* fix(verify): bound concurrent file reads in architecture and limit guards
`scripts/verify/architecture-guards.mjs` reads every `.ts`, `.mts`, `.mjs`,
and `.py` file under `src/`, `tests/`, `scripts/`, and `bridge/` (8,203 files
on current `main`) via unbounded `Promise.all(paths.map(readFile))`. On
Windows, queuing all `open()` calls at once exceeds the UCRT 8,192 file
descriptor ceiling and deterministically fails `npm run verify:architecture-guards`,
`npm run check:fast`, and the pre-push hook with `EMFILE: too many open files`.
Add a zero-dependency JSDoc-typed `mapWithConcurrency` helper in
`scripts/verify/bounded-file-reads.mjs` (default cap 64, registered in
`tsconfig.scripts.json` so it runs before `npm ci`), apply it across all four
bulk `readFile` loops in `scripts/verify/architecture-guards.mjs` and the
sibling `src/` scan in `scripts/verify/rea-numeric-limits.mjs`, and add unit
coverage in `tests/evaluation/boundedFileReads.test.ts`.
* test(verify): copy bounded-file-reads helper in numericLimitGuardPermission fixture
`scripts/verify/rea-numeric-limits.mjs` now imports
`./bounded-file-reads.mjs`. Copy both scripts into the temporary checkout
in `tests/boundary/process/numericLimitGuardPermission.test.ts` so the
copied verifier starts cleanly on non-root Linux/macOS runs instead of
failing with `ERR_MODULE_NOT_FOUND`.
* feat(artifacts): inventory and expand Android sparse images offline
* chore(schemas): update artifact tool schema summaries for the sparse image limit
* fix(artifacts): retire undrained sparse image streams on cancellation
* fix(artifacts): keep large RAW reads in the sparse stream's owner
A large RAW run was streamed through a nested readFileHandleChunks
Readable, which could prefetch a descriptor read while the outer
iterator was idle, so close or cancellation could retire the stream
with that read still running. Read the run directly in the expansion
iterator so every read is pending in the owner that cancellation waits
on, and add held-read close and cancellation regressions.
* fix(firmware): drop unused ANDROID_SPARSE_MAGIC_BYTES export
* test(artifacts): release held sparse reads before restoring mocks
Release the held RAW read and join the retiring close or cancellation in
finally before restoring the read spy, so a failed assertion cannot leave
reader.close() waiting on a read nobody will finish. Use
awaitAcknowledgement for the held-read start barrier and drop the
per-test five-second timeouts in favor of the shared test deadlines.
* fix(lint): register sparse-image forwarded fixed ceiling
Upstream main added the fixed-ceiling registry check. The sparse-image
reader projects the parser's own named ceiling, so register it as
forwarding like the boot-image reader.
* Address review feedback
* test(android-sparse): expect partial code for chunk budget refusal
* test(android-sparse): expect partial code in MCP chunk budget refusal
* fix(artifacts): keep the chunk_sz offset when a RAW chunk outgrows its header
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Matt Van Horn <mvanhorn@MacBook-Pro-10.local>
The inspect_android_class summary was the complete normalized class: on
VLC's org.videolan.vlc.PlaybackService, with 302 methods, it was 70,266
bytes, twice the agent result budget it was delivered for. Claude Code
saved it to a file, and REA-only agents read the class back through about
five evidence-json pages.
The class summary now carries the class name, engine, counts of methods,
constructors, overloaded method names, fields, encoded static values and
inner classes, the overloaded method names with their overload counts,
and the mapping's identity and record counts. The android-class view pages
methods (exact names, name prefixes, constructors), fields (exact names,
name prefixes, static values), inner classes and mapping symbols, and
inspect_android_class accepts it with detail summary in the same call.
Method summaries are unchanged and keep their own projector.
With real JADX on VLC the class summary was 4,601 bytes.
BREAKING CHANGE: the inspect_android_class summary, delivered for detail
summary or above the agent result budget, no longer lists methods, fields,
inner classes or mapping symbols. Page them with the android-class view,
or pass detail: "complete".
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
trace_android_references returned every using node inline. On VLC's
org.videolan.vlc.PlaybackService the MCP result was 214,955 bytes, so
Claude Code saved it to a file a REA-only agent could not read, and
inspect_analysis_view did not support the operation. In two trials asking
which outer classes reference the class, Claude Code answered nothing
after 17 to 20 calls and about 870,000 tokens.
trace_android_references now takes detail and view and joins the agent
result budget. Omitted, a trace that fits delivery.agent_result_budget_bytes
is inline and a larger one is retained behind its summary. With detail
summary, view returns one android-references page in the same call. The
CLI uses the shared Evidence delivery with --view.
With real JADX on VLC the default reply was 5,987 bytes, and the
top-classes page of all 97 top classes 16,724 bytes. In two trials each,
Claude Code then answered correctly with 92,000 to 125,000 tokens, and
Codex with 208,000 to 217,000 tokens instead of 364,000 to 408,000.
BREAKING CHANGE: a trace_android_references call that omits detail on a
trace above the agent result budget now returns the retained summary.
Pass detail: "complete" (--detail complete) for the previous shape.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
decode_android_resources returned the complete decode inline. Claude Code
saves an MCP result above about 25,000 tokens to a file, so on VLC 3.7.2
(180,996 bytes) a Claude Code agent limited to REA tools never saw the
strings: in two trials it failed every answer after 20 or more calls and
about 900,000 tokens. Even string_limit 1 returned 77 KB, because the
manifest text is always inline.
decode_android_resources now takes detail and joins the agent result
budget. Omitted, a decode that fits delivery.agent_result_budget_bytes is
inline and a larger one is retained behind its summary. With detail
summary, view returns one android-resources page in the same call, so the
German and Japanese values of one string take one call. The CLI uses the
shared Evidence delivery with --view.
On VLC with real Apktool 3.0.3 the default reply was 3,368 bytes, and the
two-locale strings page 2,695 bytes.
BREAKING CHANGE: a decode_android_resources call that omits detail on a
decode above the agent result budget now returns the retained summary.
Pass detail: "complete" (--detail complete) for the previous shape.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* fix(ghidra): resolve bare java command against PATH on Windows
The Windows owned-process launcher requires absolute executable paths and
rejects bare names (ERR_REA_WINDOWS_NATIVE, Win32 87). When JAVA_HOME is
unset, ghidraJavaLaunch handed the bare "java.exe" to that launcher, so the
documented remediation ("a 64-bit full JDK 21 or newer on PATH") could never
work on Windows even with Java on PATH.
Resolve the bare command against PATH (Path/PATH, join + existsSync) before
spawning; if no candidate is found, keep the bare name so the existing
probe-failure diagnostics stay unchanged. POSIX behavior is unchanged.
Reproduction: Node 24 / Windows 11 x64, Ghidra 12.1.2, JDK 21 on PATH
(via javapath shim), no JAVA_HOME -> provider unavailable,
java_probe_failure ERR_REA_WINDOWS_NATIVE. Setting JAVA_HOME to an absolute
JDK root makes the provider available, confirming the launch path.
* fix(ghidra): resolve PATH java for inspection and harden the resolver
- resolve java.exe for installation inspection on win32: the provider-
availability decision comes from the inspection probe, which still sent
the bare name to the Windows owned-process launcher after the launch-path
fix (Greptile P1)
- unwrap quoted PATH entries so installer-written directories resolve
(XiaoBinGan Gap 1)
- throw GhidraAdmissionError java_command_unresolved with the searched
PATH instead of silently falling back to the bare name on the launch path
(XiaoBinGan Gap 2); an already-aborted caller keeps its cancellation
- extract the shared resolver into GhidraJavaPathResolution.ts
- add subprocess-free regression tests: inspection through a quoted Path
entry, bare-fallback parity when java.exe is absent, resolver unit cases,
and the launch rejection code
* test(ghidra): translate win32 fixture paths for POSIX hosts
The win32 platform option makes appendCallerPath join with backslashes
(win32.join), so the inspection tests' host readText/executable received
backslash-separated paths that only resolve on Windows. Translate the
separator back to the host's before touching the real filesystem; fixture
directories contain no literal backslashes and Windows accepts forward
slashes, so the translation is safe on both (greptile review finding).
* fix(ghidra): parse Windows PATH through the executable search owner
GhidraJavaPathResolution split PATH on every semicolon, so a quoted entry
such as "C:\Tools;Local\jdk\bin" became two candidates and the installation
inspection missed java.exe. The environment variable lookup was also
case-sensitive.
Reuse windowsPathCandidates, which preserves quoted entries, matches
environment names without case, and keeps relative entries out of the
absolute-only selection. The launch diagnostic now reads the same normalized
snapshot. Add a regression test for a quoted entry containing a semicolon.
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
---------
Co-authored-by: Z <Z@example.com>
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* fix(mcp): paginate tools/list under the FastMCP SSE limit
Unsloth's FastMCP client rejects the single tools/list event because the full 241-tool catalog serializes to about 4.2 MB, over its 1 MiB SSE cap, so every refresh fails. The MCP SDK returns the whole catalog with no nextCursor, and the server never handled the cursor at all.
Page oversized listings at the transport seam, per the MCP cursor contract: pages stay under 896 KiB, cursors are bound to the catalog snapshot, and catalogs that fit are returned in one response as before.
* fix(mcp): track pending tools/list requests in one map
pendingToolListCursors already held every tools/list id, including
requests without a cursor. Membership, cancellation, and cleanup now
use that map.
Cursor rejection tests assert JSON-RPC -32602, then a cursorless
listing returns the complete current catalog.
* fix(mcp): count one schema discovery per tools/list pagination
The paged tools/list turns one logical discovery into several wire
requests, which broke the artifact verifier probe's per-request
counting and its duplicate injection assumed the target tool on the
first page. Count one discovery per listTools call and inject the
duplicate only on the page carrying the tool.
* fix(mcp): bind tools/list cursors to full tool definitions
A cursor digest now covers each advertised tool, so a schema change
invalidates it. One tool larger than REA_MCP_TOOLS_LIST_PAGE_BYTES
fails with a resource_constraint error instead of a successful page.
* test(doctor): keep the configuration table within its line limit
The page-budget refusal stays covered by the setting parser tests.
* fix(mcp): honor the tools/list page budget on the stdio path and register the setting
Register REA_MCP_TOOLS_LIST_PAGE_BYTES in the numeric limit registry and
the limit inventory so the numeric limit check passes.
Carry the parsed page budget from AppConfig into DeferredEvidenceMcpServer
so the default stdio startup path honors the setting instead of always
using the 917504-byte default.
Harden the page budget parser tests to surface the parse error instead of
returning early on failure.
* fix(mcp): return a fitting final tools/list page and use the parsed page budget
verifiedPage returns the remaining tools as one final page without a
cursor when they fit, instead of failing a resumed listing whose first
tool plus a cursor exceeds the budget.
parseConfig builds the page budget from parseEnvironment's admitted
number instead of re-parsing the raw environment, and the now-unused
resolveMcpToolsListPageBudget helper is removed.
* fix(mcp): use shared isRecord in tools/list pagination
Static checks flagged the local record predicate in toolListPagination.ts:
import the shared isRecord from src/domain/isRecord.ts instead.
The numeric-limit registry test still expected 15 entries after the
REA_MCP_TOOLS_LIST_PAGE_BYTES entry was added; bump it to 16.
* test(mcp): page tools/list fixtures under explicit small budgets
The compact-only presentation strips field descriptions before advertising, so the 80-tool catalog fits one page and the oversized tool fits too. Set explicit small page budgets against the advertised size. The parseConfig success test now throws the typed error before reading the value, per the test guide.
* test(config): throw typed parse errors in tools/list budget test
Greptile P2 on #9142: the budget test checked the selected parse via
an inline toMatchObject on the Result, hiding the typed error on
failure. Bind both parse results and throw their errors before
asserting values, per the repo test guide.
* fix(mcp): format tools/list pagination test to repo style
oxfmt --check flagged src/server/toolListPagination.test.ts
(the cursor-identity expectation was written expanded; oxfmt
collapses the two-element array onto one line). No behavior change.
* style(mcp): oxfmt the page-budget assertion
The Greptile P2 fix re-wrapped the expect call past oxfmt's width; run
the pinned formatter so Static checks stays green.
* fix(mcp): use the shared sha256Hex helper for the tools/list catalog digest
The architecture guards forbid a second one-shot SHA-256 hex digest;
use the shared helper from src/kernel/sha256Hex instead.
* fix(mcp): build the tools/list page-budget refusal through the shared owner helper
The architecture guard counts hand-built AnalysisResourceConstraintError
constructions; toolsListPageBudgetError() held the only new copy. The
refusal cause is a page budget, not a parse limit, so parseLimitConstraint
does not fit. Add toolsListPageBudgetConstraint() beside it in
parseFailureAnalysisError.ts and build the refusal from the page-budget
facts there; the produced error is unchanged.
Also give the pagination test SDK client the shared schema validator
from createMcpSchemaValidation, released with the client.
* fix(server): adapt instructions call to the predicate API
Main changed serverInstructions to take an advertisesTool predicate
instead of a tool-family set, and RecordedMcpCatalog gained required
toolFamilies and promptRequirements fields. The merge head no longer
typechecked, failing Build package, Documentation and Static checks.
Adapt the call site to main's own adapter shape and add the two empty
fixture fields.
* fix(mcp): restore main's tool-family scope in deferred startup
The merge dropped the family scoping main added to the deferred
startup path. A scoped stdio start advertised every recorded tool and
saved the full catalog identity, so attachRuntime rejected the selected
identity on first use. Restore the toolFamilies option, scoped
capabilities/instructions/identity, and the shared helper through
runDeferred and the deferred constructor.
* fix(mcp): share page limit facts and stream catalog sizing
---------
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
compare_web_captures now advertises the request schema and admits it in
the application, which reads the session's retained Evidence. Each
capture field is the opaque complete observation or an exact
retained-evidence reference. The tool description says either ID works,
and inspect_web_page no longer says comparison needs the complete
capture.
Because the fields are declared reference alternatives, an inline
comparison refused for exceeding REA_MCP_MAX_INPUT_ELEMENTS names the
retained reference as its recovery. On a local Chromium 156 page with
2,000 list rows and three libraries, two complete captures were 6,701,922
bytes of arguments and were refused at the shipped allowance; the
reference request was 274 bytes and returned the same result and
parameters.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* fix(limits)!: budget Rust dependency parser ceilings per call
inspect_rust_binary refused a compressed .dep-v0 stream or its inflated
JSON with one fixed parser allowance. Those ceilings are now the per-call
parameters max_compressed_dependency_bytes (1 MiB),
max_inflated_dependency_bytes (8 MiB) and max_dependency_inflate_ratio
(64). A refusal is adjustable_budget and names the parameter that stopped
the parse. Allocation before the consumed length is known uses the stored
extent, including PE alignment padding. Omitted fields keep the previous
defaults.
BREAKING CHANGE: Rust dependency-parser refusals report details.limit for
the binding parameter instead of a fixed_ceiling allowance.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* test(rust): admit dependency sections above the former ceilings
A stored section larger than 1 MiB and 8 MiB is refused at those defaults
and parsed once both budgets are raised. A stream that inflates more than
64 times is refused at the default ratio and parsed once the ratio is raised.
Co-authored-by: morluto <morluto@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(limits)!: let apktool and assetutil take producer_limits.output_bytes and type Android and process capture refusals
decode_android_resources and inspect_asset_catalog refused larger apktool or
assetutil output with a fixed capture ceiling. Both now accept
producer_limits.output_bytes (defaults 4 MiB and 64 MiB) and report
details.limit for it. assetutil's budget covers each stream and the JSON
retained across catalogs, capped at 128 MiB for the in-process decode.
capture_process's retained-frame refusal reports details.limit for
limits.output_bytes, and a JADX JVM heap failure is marked as measured
exhaustion. The lipo field-retention allowance is reclassified as derived from
the native command output capture, and the JADX external DEX representation
allowance as protocol (a fraction of the bridge's local MCP frame).
BREAKING CHANGE: apktool and assetutil output refusals report details.limit for
producer_limits.output_bytes instead of a fixed_ceiling refusal.
* test(apktool): decode raised output after the default refuses it, and check deadlines leave the output budget unchanged
* fix(resources): keep a file-size refusal's observed size through failure rebuilds
* feat(native)!: give the Go and Rust readers max_structure_bytes and Rust max_wasm_sections
inspect_go_binary and inspect_rust_binary read the ELF directory and
Mach-O load commands through the shared container reader with the fixed
16 MiB structural allowance. Both now accept max_structure_bytes, threaded
through readBinaryContainerFromReader. inspect_rust_binary's fixed
65,536-section WebAssembly walk becomes max_wasm_sections (default 65,536,
at most 16,777,216).
Refusals report details.limit and the generated recovery. The Go budget
refusals drop their authored prose and always report their limit, so a
value at its maximum gets the generated narrowing advice.
Part of #14235.
BREAKING CHANGE: Go and Rust structural refusals and the WebAssembly
section refusal report details.limit instead of a fixed_ceiling refusal.
* chore: refresh the Go and Rust advertised schema summaries
* test: keep the Rust section-walk admission check type-correct
* refactor(native): own the max_structure_bytes refusal in the native domain
The Go and Rust providers may not import src/native, so nativeStructureConstraint moves to src/domain/native/nativeStructureBudget.ts next to the limit it builds, and every provider imports it from there.
* fix(native): report the effective Go structure budget and document max_wasm_sections
The Go limitation text named a fixed 16 MiB structural bound after a caller could raise it; it now names the effective max_structure_bytes. The Rust guide and MCP boundary test describe max_wasm_sections as a per-call control, and the admission test requires a raised value to succeed.
* fix(native): report the effective Go structure budget and Rust section control
Go inspection limitations named a fixed 16 MiB structural bound after
max_structure_bytes selected another value. The report now uses that
effective budget, including the shared default when the field is omitted.
Rust WebAssembly section refusals are an adjustable max_wasm_sections
budget. The MCP expectation, the Rust guide, and the CLI and MCP checks
follow that control, and a raised budget must admit the same module.
* style(rust): format the section-walk CLI assertion
oxfmt rejects the wrapped cast in the CLI recovery check. Static checks
run format:check, which check:fast does not.
Co-authored-by: morluto <morluto@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
* feat(limits): register producer.output_bytes as the session default for bounded producer output
inspect_packet_capture, decode_signal_recording and inspect_signal_decoders
share BOUNDED_PRODUCER_LIMITS, and an agent decoding several large captures or
recordings raised producer_limits.output_bytes on every call. The registered
setting producer.output_bytes (seed REA_PRODUCER_OUTPUT_BYTES, default 4 MiB)
now supplies the omitted field. A per-call value wins, then the runtime
override, then the seed, then the default. An output refusal reports the
setting's limit with its parameter and source, so the generated recovery
names both routes.
* fix(limits): refuse an invalid producer output seed after retained cleanup, forward it through setup, and cover the seed
observe_web_execution returned complete script sources inline. On a local
page loading rxjs, openpgp and isomorphic-git in Chromium 156, the
complete observation was 1,888,024 bytes of structured content, nearly all
source text.
observe_web_execution now takes detail and joins the agent result budget.
Omitted, an observation that fits delivery.agent_result_budget_bytes is
inline and a larger one is retained behind its summary, which pages
through the web-execution view. On that page the default reply was 7,458
bytes. detail summary retains the observation through the shared retained
summary binding. rea observe-web-execution uses the shared CLI Evidence
delivery. The real-browser verifiers request the complete observation
they assert on.
BREAKING CHANGE: an observe_web_execution call that omits detail on an
observation above the agent result budget now returns the retained
summary. Pass detail: "complete" (--detail complete) for the previous
shape.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
* feat(native)!: give the PE readers per-call text, entry and metadata budgets
inspect_pe_imports refused at a fixed 16 MiB of retained names,
inspect_pe_unwind_ranges at a fixed 2,097,152 exception-directory entries
and inspect_pe_resources at a fixed 8 MiB result. They now accept
max_text_bytes (default 16 MiB, at most 256 MiB), max_entries (default
2,097,152, at most 16,777,216) and max_metadata_bytes (default 8 MiB, at
most 256 MiB). The DLL, function and TLS callback refusals report
details.limit for max_dlls, max_functions and max_callbacks instead of
authored recovery, and an unwind refusal reports the declared entry count
as required_value.
The shared PE failure projection no longer maps an unnamed
BinaryResourceFailure to "The PE structural decoding allowance": no PE
reader produces one, since PE header and section tables are bounded by the
format.
Part of #14234 and #14235.
BREAKING CHANGE: the PE retained-text, exception-directory entry and
resource metadata refusals report details.limit instead of a fixed_ceiling
refusal.
* fix(native): update PE advertised schema summaries, test types, and assert retry success
* test: compare PE resource refusals across adapters with each adapter's control spelling
* test: avoid shadowing the CLI fixture in the PE resources parity check
* feat(native)!: give inspect_native_exports per-call inventory, text and structure budgets
The native export reader refused at a fixed 262,144-row inventory, a fixed
16 MiB retained-text allowance and the fixed 16 MiB structural allowance.
It now accepts max_entries (rows and declared symbol counts; default 262,144,
at most 4,194,304), max_text_bytes (default 16 MiB, at most 256 MiB) and
max_structure_bytes, which now also bounds the ELF dynamic, symbol and
version tables located through PT_DYNAMIC.
The parser threads one NativeExportBudgets object through the ELF and PE
paths and elfDynamicExportTables; the Android JNI reader keeps the defaults.
Refusals report details.limit and the generated recovery. A declared table
count is reported as required_value; the text budget stops at the first
excess and reports none.
Part of #14235.
BREAKING CHANGE: export inventory and retained-text refusals report
details.limit for max_entries or max_text_bytes instead of a fixed_ceiling
refusal, and MAX_NATIVE_EXPORT_ROWS is renamed DEFAULT_NATIVE_EXPORT_ROWS.
* chore: refresh the inspect_native_exports advertised schema summary
* fix(native): omit lower-bound GNU hash required_value, decouple version work from max_entries, and update export recovery tests
* test: expect the lower-bound marker on a stopped GNU hash chain walk
* fix(native): cap ELF version traversal work and aggregate malformed version definition diagnostics
* feat(native)!: give inspect_dwarf_units a per-call max_decompressed_bytes
inspect_dwarf_units refused at a fixed 256 MiB of decompressed DWARF
sections for one image. It now accepts max_decompressed_bytes (default
256 MiB, at most 1 GiB) and reports details.limit; the sections decompress
in turn, so the refusal reports no required_value.
The ELF note text, hash and scan allowance is reclassified as derived: it
equals the admitted image length plus its decoded section names.
Part of #14235.
BREAKING CHANGE: a DWARF decompression refusal reports details.limit for
max_decompressed_bytes instead of a fixed_ceiling refusal.
* fix(native): document DWARF decompression budget charges, update schema summary, and test raise-and-retry
* feat(artifacts): back archive member counts with the artifact.member_count setting
Archive member, entry, module and asset counts are the reader limit an
agent is most likely to raise repeatedly in one session. A new runtime
setting, artifact.member_count (launch seed REA_ARTIFACT_MEMBER_COUNT,
default 100,000), now supplies the default for artifact_limits
bun.module_count, dotnet_bundle.entry_count, node_sea.asset_count and
deno.vfs_entries. An explicit artifact_limits field still wins for that
call. A refusal at one of those fields reports the setting's limit with
the field as parameter and the value's source, so its recovery names
the per-call field and update_analysis_settings (or the launch seed on
the CLI). When a non-default session value applies, Evidence reports
the resolved effective_limits.
* test(artifacts): cover the artifact.member_count session route over stdio MCP
update_analysis_settings at 1 refuses a two-entry .NET bundle with the
setting, source runtime and both recovery routes; an explicit
artifact_limits field wins over the session value; raising the setting
to 2 admits the same bundle.
* fix(artifacts): resolve caller member counts before the session seed
When a call selects every field artifact.member_count backs, the
session value and its launch seed are no longer read, so an invalid
REA_ARTIFACT_MEMBER_COUNT cannot block an explicit per-call recovery;
a request-sourced refusal still names the setting. The setting now
lists inventory_artifact, which it also applies to.
* fix(config): own the artifact.member_count seed outside the runtime settings module
Resolving the seed through launchAnalysisSetting made
runtimeAnalysisSettings import the launch schema map, which imports
modules that import runtimeAnalysisSettings; the cycle left the bridge
reply schema uninitialized in some load orders. The seed now has its
own owner, src/config/artifactMemberCount.ts, like the pwntools input
seed, and the definition names its environment variable literally as
the numeric-limits guard requires.
* fix(native)!: report details.limit for native reader per-call budgets
Devicetree, Windows shortcut, kernel build config, firmware staging and
byte-entropy refusals of caller-selected budgets named their control only
in remediation prose. Each now sets details.limit from a domain-owned
budget object that also builds the schema (src/domain/parameterBudget.ts),
so the reported range is the one the next call accepts.
inspect_devicetree's fixed 32 MiB decoded representation allowance becomes
the per-call max_decoded_bytes (default 32 MiB, 1 KiB to 256 MiB); its
refusal reports boundary max_decoded_bytes instead of decoded_bytes.
The pwntools allocation failure declares measuredExhaustion, the firmware
inherited RLIMIT_FSIZE refusal declares measuredExhaustion, and the LLDB
combined-result ceiling is a registered representation bound.
Part of #14234 and #14235.
BREAKING CHANGE: inspect_devicetree's decoded-representation refusal reports
reported_limits.boundary "max_decoded_bytes" with details.limit, instead of
"decoded_bytes".
* fix(native): keep FIT decoded-budget boundary, LLDB narrowing and entropy length range exact
The FIT reader compared the renamed devicetree limit against decoded_bytes, so a decoded-budget refusal became capacity; it now checks max_decoded_bytes, with a test. The LLDB representation ceiling keeps a short name and carries its recovery as narrowing. The byte-entropy length maximum is the window the selected block_size admits.
* fix(cli): describe inspect-devicetree --max-decoded-bytes
* refactor(native): let the generated adjustable-budget recovery name the native reader controls
With #14625 the refusal owns per-call recovery, so the devicetree, Windows shortcut, kernel build config, firmware staging and byte-entropy refusals drop their authored sentences. inspect_byte_entropy reports the smallest admitting block_size as required_value.
* fix(native)!: report details.limit for remaining native reader budgets and make BEAM table rows adjustable
inspect_elf_dependencies, inspect_elf_unwind_ranges, inspect_apple_ips,
inspect_dwarf_units, inspect_native_initializers and inspect_pe_resources
named their per-call budgets only in remediation prose. Each now reports
details.limit from a domain-owned budget object that also builds the
schema. The unwind per-page symbol-name text refusal names the page size
`limit`, the control that admits it.
The fixed 65,536-row BEAM table ceiling becomes the per-call
max_table_rows (default 65,536, at most 1,048,576).
The plist nesting allowance is reclassified as a representation bound
(MAX_JSON_DEPTH less the report envelope). GPU and APK input refusals that
named their fixed allowances only in prose now declare them, registered
as pending #14235.
Part of #14234 and #14235.
BREAKING CHANGE: a BEAM table-row refusal reports details.limit for
max_table_rows instead of a fixed_ceiling refusal.
* fix(native): keep naming the dependency and BEAM row controls in recovery
* refactor(native): let the generated adjustable-budget recovery name the remaining native controls
With #14625 the refusal owns per-call recovery, so the ELF dependency, ELF unwind, Apple IPS, DWARF, initializer, PE resource and BEAM refusals drop their authored sentences. BEAM reports the complete row and atom counts as required_value. The unwind per-page text allowance is a registered fixed allowance whose narrowing names a smaller limit, because a larger page would not admit it.
* style: format the PE resources provider test
* refactor(native): keep one owner of the IPS budget bounds and document the unwind text allowance
* fix(native)!: report details.limit for native reader per-call budgets
Devicetree, Windows shortcut, kernel build config, firmware staging and
byte-entropy refusals of caller-selected budgets named their control only
in remediation prose. Each now sets details.limit from a domain-owned
budget object that also builds the schema (src/domain/parameterBudget.ts),
so the reported range is the one the next call accepts.
inspect_devicetree's fixed 32 MiB decoded representation allowance becomes
the per-call max_decoded_bytes (default 32 MiB, 1 KiB to 256 MiB); its
refusal reports boundary max_decoded_bytes instead of decoded_bytes.
The pwntools allocation failure declares measuredExhaustion, the firmware
inherited RLIMIT_FSIZE refusal declares measuredExhaustion, and the LLDB
combined-result ceiling is a registered representation bound.
Part of #14234 and #14235.
BREAKING CHANGE: inspect_devicetree's decoded-representation refusal reports
reported_limits.boundary "max_decoded_bytes" with details.limit, instead of
"decoded_bytes".
* fix(native): keep FIT decoded-budget boundary, LLDB narrowing and entropy length range exact
The FIT reader compared the renamed devicetree limit against decoded_bytes, so a decoded-budget refusal became capacity; it now checks max_decoded_bytes, with a test. The LLDB representation ceiling keeps a short name and carries its recovery as narrowing. The byte-entropy length maximum is the window the selected block_size admits.
* fix(cli): describe inspect-devicetree --max-decoded-bytes
* refactor(native): let the generated adjustable-budget recovery name the native reader controls
With #14625 the refusal owns per-call recovery, so the devicetree, Windows shortcut, kernel build config, firmware staging and byte-entropy refusals drop their authored sentences. inspect_byte_entropy reports the smallest admitting block_size as required_value.
* fix(limits)!: let inspect_sqlite_database take producer_limits.input_bytes and type SQLite, Kuna and web-bundle refusals
The SQLite snapshot refused a database and WAL above a fixed 256 MiB. The copy
streams to private disk, so inspect_sqlite_database now accepts
producer_limits.input_bytes (default 256 MiB) and reports details.limit for it.
Refusals that carried recovery only in prose are typed: SQLite's result-column
limit and the 16 MiB value/statement/reply allowance as fixed ceilings, occupied
SQLite slots and live Kuna and web-bundle heap headroom as measured exhaustion,
and the Kuna cache capacity as the REA_KUNA_CACHE_MAX_BYTES environment control.
The SQLite worker diagnostic capture is reclassified as protocol.
BREAKING CHANGE: the SQLite snapshot refusal reports details.limit for
producer_limits.input_bytes, and the SQLite column and reply refusals carry a
fixed_ceiling refusal in place of their authored remediation.
* fix(sqlite): keep producer_limits in Evidence parameters and report the effective input bound
* feat(trace)!: give Playwright trace import per-call trace_limits
inspect_playwright_trace refused large ordinary traces at a fixed archive
allowance, a fixed record nesting allowance and four authored-only
budgets (decoded streams, retained facts, metadata reads, line bytes).
It now accepts trace_limits (CLI --trace-limits JSON) with today's values
as defaults, and each refusal reports details.limit. The record parser
node allowance is derived from facts_bytes and recovers through it;
nesting_depth is capped where a retained record still fits the Evidence
JSON depth. The capture JSON parser takes the trace's depth from the
caller instead of a format special case.
The source-location view's page refusal now reports view.max_bytes in
details.limit. GraphQL AST nesting is registered as a representation
bound, and GraphQL host-limit, web-bundle host-capacity and the trace
decoder's occupied slot declare measured exhaustion.
BREAKING CHANGE: PlaywrightTracePort.inspect takes the resolved limits,
and trace archive and nesting refusals report details.limit instead of a
fixed_ceiling refusal.
* fix(trace): project trace records at the selected depth and record trace_limits
The HAR projection of a trace record read the network capture's depth
(64 by default), so a record admitted under a raised
trace_limits.nesting_depth was dropped as malformed. Projection now runs
under the selected trace depth. Evidence parameters record the caller's
trace_limits selection as given, in complete and partial results.
* feat(native)!: give the native structural decoding allowance a per-call max_structure_bytes
The 16 MiB structural budget on native header, section, load-command and
ELF dynamic-directory table reads, and on decoded section names, was a
fixed ceiling with no override. inspect_elf_unwind_ranges,
inspect_kernel_module, inspect_elf_debug_link, inspect_dwarf_units,
inspect_binary_hardening and inspect_native_initializers now accept
max_structure_bytes (64 bytes to 512 MiB, default 16 MiB) and report
details.limit when it stops them.
binaryContainer owns the default, the limit name and the failure
(nativeStructureFailure); the directory readers take a
NativeDirectoryBudgets object in place of the positional decoded-name
budget, and Mach-O, the ELF dynamic directory and the ELF pointer
relocation pass take the same budget. Other allowances that shared the
"structure" limit name now carry their own: the PE per-name decode, the
retained DWARF section bound (derived from the admitted image), and the
hardening table-entry count. The ELF dependency provider's structural
projection was unreachable and is removed.
Part of #14235.
BREAKING CHANGE: refusals at the structural budget report
reported_limits.boundary "max_structure_bytes" instead of "structure".
* fix(native): apply max_structure_bytes to the ELF hardening dynamic table and scope its help
inspect_binary_hardening read PT_DYNAMIC under its entry count only, so a sectionless ELF could exceed the selected max_structure_bytes; the dynamic table is now checked first. The shared help no longer names tables a reader does not bound, and the limits reference states hardening's Mach-O and PE coverage. The initializer CLI recovery test asserts a parsed successful report.
* fix(native): refuse a partial ELF hardening dynamic table as malformed before its budget
* feat(metadata)!: give NTFS, Maven report and NuGet budgets typed per-call controls
inspect_ntfs_journal refused acquisitions above a fixed 64 MiB allowance;
it now takes max_file_bytes (default 64 MiB) and re-admits a retained
acquisition under the call's budget, so lowering it cannot reuse a larger
cached read. inspect_maven_gradle_metadata refused at six fixed report
allowances; they are now report_limits fields (CLI --report-limits JSON)
with today's values as defaults. Maven max_file_bytes and NuGet
max_file_bytes, max_entries and max_nuspec_bytes refusals now report
details.limit from the same bounds objects the schemas use.
The Ghidra installation-properties read allowance is registered as a
protocol bound: it reads the provider's own short installation
descriptor, not analysis input.
BREAKING CHANGE: NTFS and Maven report refusals report details.limit
instead of a fixed_ceiling refusal, and parseMavenGradleMetadata and the
inspect_ntfs_journal input contract gain the new controls.
* fix(metadata): keep omitted NTFS budgets omitted and type host and maximum recovery
inspect_ntfs_journal recorded the default max_file_bytes as if the caller
had chosen it; the field is now optional and resolved for execution only,
so Evidence keeps omission. A host allocation failure while holding an
admitted acquisition is reported as measured memory exhaustion instead
of generic I/O. A Maven report refusal whose need exceeds the control's
maximum no longer suggests raising it. A public CLI/MCP test covers
report_limits refusal and recovery for a POM.
* feat(flutter)!: give Flutter APK admission per-call apk_limits
identify_flutter_build and inspect_dart_aot refused a large but ordinary
APK at seven fixed allowances (APK snapshot, ZIP metadata, library read,
cumulative extraction, ABI count, library path and snapshot-hash
candidates) with no recovery. They now accept apk_limits (CLI
--apk-limits JSON) with today's values as defaults. Each refusal reports
details.limit naming the apk_limits field, its effective value and range.
The domain owns one bounds object that feeds both the schema and the
reported limit. library_path_bytes is capped by the 16-bit ZIP name
field, and the inspect_dart_aot ABI selector length now follows that
maximum instead of the old 1 KiB default.
BREAKING CHANGE: Flutter size, inventory and candidate refusals report
details.limit instead of a fixed_ceiling refusal, and the inspect_dart_aot
abi selector admits labels up to 65,521 characters.
* fix(flutter): bound library_path_bytes by the decoded ZIP name size
Inventory counts a library path's decoded UTF-8 bytes, and one stored
byte decodes to at most three (a CP437 box-drawing character), so the
maximum is three times the 16-bit stored name length rather than the
stored length itself. The ABI selector keeps its character bound from
the stored name. Recovery tests now assert the reported facts after
raising a limit.
* feat(artifacts)!: give Deno, wxapkg and tar readers artifact_limits controls
Deno compile, wxapkg and tar readers refused large ordinary inputs at
fixed allowances with no recovery. Their admission budgets are now
per-call artifact_limits.deno, .wxapkg and .tar fields with today's
values as defaults, and each refusal reports details.reader_limit.
artifact_limits.expanded_bytes now also applies to Deno and wxapkg.
The shared artifact path registry names its owning group's path_parts
and path_nodes controls instead of a fixed fallback.
audit_release_exposure max_file_bytes keeps its 256 MiB default but is
no longer capped there; its refusal reports details.limit.
The Deno VFS recursion depth is registered as a representation bound
and the wxapkg member-I/O allowance as derived from expanded_bytes.
BREAKING CHANGE: artifactReaderLimitsSchema now requires deno, wxapkg
and tar groups, so saved Evidence whose effective_limits predates them
fails validation and must be re-inspected. A release-exposure refusal
at max_file_bytes reports details.limit instead of a fixed_ceiling
refusal.
* fix(artifacts): keep Deno indexed paths representable and omit undercounted retained size
artifact_limits.deno.path_parts now has a minimum of 2: indexed fallbacks
live under a reserved top-level namespace directory, so a one-part
selection could only refuse the whole inspection. The retained-bytes
refusal no longer reports a required value, because the bounded byte
count stops at the allowance and understates it.
* fix(limits)!: report packet and signal producer budgets as details.limit and page discovery at its record budget
Owned packet and signal producers (inspect_packet_capture, inspect_packet_fields,
decode_signal_recording, inspect_signal_decoders) refused an exhausted
producer_limits.input_bytes, output_bytes or command_timeout_ms with the control
named only in remediation prose. ArtifactAnalysisResources now takes the
selected input budget as an AnalysisParameterLimit and the command's selected
and default budgets, so each refusal carries details.limit.
Packet-field and sigrok decoder discovery refused a page whose records exceeded
a fixed representation budget. The budget now ends the page early with
has_more and output_window.record_budget_reached, so the rest is retrieved from
offset + returned instead of being refused.
BREAKING CHANGE: discovery output_window gains record_budget_reached, a page can
return fewer than limit records, and discovery no longer refuses at the record
or line budget.
* test(verify): expect record_budget_reached in real discovery pages
* feat(cli)!: keep over-budget CLI results recoverable by default
An over-budget CLI result without --evidence_output now saves its
complete Evidence to a private retained-Evidence cache under the user
cache directory and returns the summary with the file's path, size and
digest, so it pages with inspect-analysis-view without a rerun.
Files are named by the complete record's Evidence ID, created
exclusively as 0600 by the Evidence bundle writer in a 0700 directory
the user owns, reused by repeat runs and never overwritten. Each
retention removes records unused for 7 days, then the least recently
used over delivery.cli_retained_evidence_bytes (REA_CLI_RETAINED_EVIDENCE_BYTES,
default 256 MiB). --no-retain or a 0 setting writes nothing; a record
that cannot be kept falls back to the rerun arguments with the reason.
Fixes#14594
BREAKING CHANGE: An over-budget CLI result without --evidence_output is
now saved to REA's private retained-Evidence cache and reported as
{summary, evidence_bundle, delivery} with delivery.retained cache-file,
instead of writing nothing. Pass --no-retain, or set
REA_CLI_RETAINED_EVIDENCE_BYTES=0, to write nothing as before.
* fix(cli): key retained Evidence by its content and keep its owner's facts
Review fixes for default CLI retention:
- Name files by the SHA-256 of the complete record's exact JSON, since
the Evidence ID leaves out caller paths; report it as
evidence_bundle.sha256.
- Remove a bundle that outgrows the cache after the write.
- Renew a record's age when inspect-analysis-view reads it.
- Re-check a record's use time before evicting it.
- Never use a cache whose path holds a value marked sensitive, and
redact retention failure reasons.
- Report a save that committed but then failed with its receipt and
cleanup owner, as --evidence_output does.
- Request source records whenever the cache may receive a bundle.
- Refresh the advertised-schema summaries for the new setting.
* fix(cli): withdraw the receipt of a bundle the cache discards
A bundle that outgrew the cache was removed after the writer had already
recorded its publication receipt, so output recovery could name a
missing file. Retention now withdraws that receipt whenever it keeps
nothing, unless the file committed and its failure is reported.
* fix(cli): retain publication receipt when removing an oversized retained bundle fails
inspect_byte_entropy's retained summary now lists the first 64 runs in
offset order beside the ten longest, and inspect_analysis_view gains
view {kind: "byte-entropy", collection: "blocks" | "runs", offset, limit},
which pages the retained series by index with a coverage cursor. The
summary's run list is page zero of that view, so both read one selection.
xrefs and inspect_nuget_nupkg gain the delivery detail selector and join
the agent result budget, reusing their existing summary projections and,
for xrefs, native-observation pages.
BREAKING CHANGE: xrefs and inspect_nuget_nupkg with detail omitted now
return their retained summary when complete Evidence exceeds
delivery.agent_result_budget_bytes in a session that can page it. Pass
detail "complete" (CLI --detail complete) for complete inline delivery.
Pull requests ran the macOS lane only for its listed paths, so a change
to a test gated to macOS never ran it before main's full sweep. The CI
planner runs before dependencies are installed and cannot load the
parser, so a dependency-free candidate test now admits every module
that could gate a test to macOS: one that names a "darwin" or "linux"
literal and has a skipIf/runIf gate or a case list chosen by a
conditional on that literal. The planner selects the lane when a changed
test at head is a candidate, and the exact discovery parses only
candidates, so the two cannot disagree about a gated module. The test
over-selects modules that are not gated; a deleted test selects nothing.
* feat(delivery)!: bound default results by an agent result budget
Omitted detail now returns complete Evidence only when it fits the new
delivery.agent_result_budget_bytes runtime setting (default 49152 compact
JSON bytes, about 12k tokens at an estimated 4 bytes per token). Larger
results are retained and delivered as the producer's summary with a
limitation naming the budget and the recovery call; nothing is refused or
truncated. inspect_analysis_view gains an evidence-json view that pages the
exact JSON text of retained Evidence. The CLI applies the same budget and
publishes the complete bundle with --evidence_output.
inspect_managed_members type_names now also narrows member_refs and
exported_types, and inspect-byte-entropy gains CLI evidence delivery.
BREAKING CHANGE: An omitted detail no longer always returns complete
Evidence inline on MCP or the CLI for tools with a detail selector
(including inspect_managed_members, inspect_managed_artifact,
inspect_byte_entropy, inspect_artifact, analyze_javascript_application,
list_procedures, list_strings and the other operations listed in
src/domain/agentBudgetOperations.ts). Over the budget they return the
retained summary; pass detail complete (--detail complete) for complete
inline delivery. inspect_managed_members type_names narrows member_refs
and exported_types.
Fixes#14172Fixes#14180
Part of #14187
Part of #14156
* test(schemas): record advertised summaries for budgeted detail
* fix(delivery): keep budgeted summaries canonical and carry delivery facts beside them
Review fixes for the agent result budget:
- Deliver the producer's own summary record, identical to detail summary,
so its identity holds in summary consumers such as compare_artifacts.
The budget, sizes, retention and the exact paging call travel as
delivery facts: a second MCP text block and _meta, or a delivery field
in CLI output.
- Capture the caller's detail for application-validated tools too, so
inspect_binary_layout and similar tools are budgeted.
- Keep recovery facts when a budgeted summary itself exceeds the frame.
- Size an omitted evidence-json limit by escaped UTF-8 bytes and never
split a surrogate pair, even in a one-unit page.
- Add the REA_AGENT_RESULT_BUDGET_BYTES launch seed; the shared test
environment raises it for semantic tests, and budget tests clear it.
- Align tool descriptions and verifiers that read complete Evidence.
* fix(delivery): retain the budgeted summary like an explicit summary
* fix(delivery): read the budget seed from the captured environment and count delivery facts in the frame
- The agent result budget seed is read from the environment the server or
CLI invocation captured: ToolResultDelivery takes it at construction,
and a CLI invocation binds it in its publication context. The ambient
process environment is no longer read.
- The frame check reserves the bytes of the delivery block and _meta that
are added after encoding, so a budgeted response cannot exceed the frame.
- Conformance workflows that resend complete Evidence raise the budget
through the shared inline-Evidence environment, as do the artifact and
binary layout verifiers.
* fix(delivery)!: request complete Evidence explicitly and never spill CLI overflow
- Shared test and verifier environments no longer raise the agent result
budget. Every test and verifier workflow that reads complete Evidence
from a budgeted tool now requests it with detail complete or --detail
complete, including the real-provider verifiers outside PR CI (Ghidra,
Hopper, IDA, Kuna and client verifiers). Default delivery is exercised
as shipped.
- Budgeting applies only to tools with a detail selector, so every
budgeted call has a complete opt-out.
- CLI overflow without --evidence_output writes nothing; its delivery
facts carry exact rerun argv for --detail complete and
--evidence_output, omitted when the command declares sensitive values.
* test(delivery): prove captured budget seeds with valid in-range values
* test: state complete-detail requests once and fix codemod regressions
- Add tests/support/completeDetail.ts with COMPLETE_DETAIL and
completeArguments so tests that read complete Evidence request it in one
place, keeping functions within max-lines-per-function without raising
the limit.
- Restore provider-client tests (GhidraClient, Hopper health): their
callTool("name", ...) calls are bridge requests, not MCP tools, and take
no detail.
- Update the game-scale type inventory test for member_refs narrowing.
* test: request complete Evidence in shared JavaScript analysis helpers and remaining CLI workflows
* test: request complete Evidence by default in the shared test transports
The shared MCP client helpers (createTestMcp, connectLocalToolsMcp and
the CLI fixture's shared MCP session) and the CLI runners (the cli
fixture and the shared CLI session) now apply one named default,
completeEvidenceByDefault. A budgeted tool called with neither detail nor
view gets detail complete; the CLI does the same with --detail complete,
chosen by the command's tool contract. A budgeted operation that resolves
to no contract fails loudly at load. Tests whose subject is delivery opt
out with delivery "budgeted". This is a test-harness choice; production
delivery is unchanged and the budget tests prove the default path.
Per-call complete-detail edits are reverted in the 204 test files whose
transports all apply the default. Explicit requests remain where a test
drives its own SDK client, server, CLI instance or process, and where
the detail choice is the test's subject.
* test: resolve CLI complete-detail defaults from the CLI registry
The Real Apple and browser verifiers read complete Evidence through
artifactCliEvidence, which ran the compiled CLI without a detail choice
and got the budgeted {summary, delivery} output. The helper now requests
complete Evidence for commands that take --detail, read from the compiled
CLI's own registry (scripts/lib/complete-evidence-cli.mjs).
The test harness default had a sibling bug: it treated every cli-flagged
budgeted contract as taking --detail, but only Evidence-delivery commands
do (inspect-binary-layout does not). It now reads the source CLI registry
too, and covers every command the CLI budgets.
* test(verifiers): request complete Evidence at each verifier's SDK client and CLI argv
The real-browser failure was the same missing normalized_result as the
Apple one: browser-capture-metadata-budget-e2e reads analyze-web-bundle
through artifactCliEvidence, fixed in the previous commit.
The shared verifier module, scripts/lib/complete-evidence.mjs, now owns
both transports:
- completeEvidenceClient wraps each verifier's SDK Client once, so every
callTool to a budgeted tool with neither detail nor view requests
complete Evidence, whatever local call helper a verifier uses (86
clients, including the Ghidra, Hopper, IDA and Kuna verifiers'
argument-less list_procedures and inspect_native_load_image calls).
- completeEvidenceCliArguments covers the remaining verifier CLI argv
that chose no detail, such as function, decompile, analyze and the
Android and Apple commands.
Commands and tools that are not budgeted are sent as written.
* test(delivery): await async completeEvidenceCliArguments helper in boundary test
* test(delivery): request complete detail in Electron CLI artifact format test
* docs(delivery): document delivery.rerun as add-only argument arrays
* test(schemas): record advertised summaries for the unified delivery budget
Tool descriptions now name the agent result budget, and the evidence-json default page is derived from the 32 KiB default, which changes the advertised input digests of the 28 affected tools. Recorded from the Build package job's output.
* test(delivery): pin the budget boundary and keep failures unbudgeted
Main's retainedSummaryDelivery tests pinned the size decision at exactly
32,768 and 32,769 UTF-8 JSON bytes. Unifying that decision into
budgetedSummaryBytes deleted them, and their port never landed, so the
byte measurement went unchecked.
Restore them against budgetedSummaryBytes at the configured budget and
one byte over, for the default and a runtime budget, with ASCII, escaped
and multibyte text, plus each condition of the decision. Off-by-one
mutants (< for <=, a cap one byte short) fail six cases; measuring UTF-16
code units instead of UTF-8 bytes fails the multibyte cases.
An MCP case pins that a target failure from a budgeted tool under the
minimum budget is identical with detail omitted and complete, with no
delivery facts.
* test(verifiers): route literal CLI argv for budgeted commands through complete Evidence
real-browser failed with "Scenario CLI did not report external disconnect
ownership": runScenarioCli ran capture-browser-scenario without --detail,
so an over-budget capture came back as its summary, which has no
browser.cleanup. The earlier sweep counted these files as covered
because their MCP clients were wrapped, but their CLI argv was not.
Route the shared runScenarioCli helper (five callers), the local cli
helpers in the module, source-map and script-export verifiers, and
every other literal argv for a budgeted CLI command without --detail or
--view (EVM interface, binary layout, packet capture, devicetree, DOM
destinations, Ghidra relocation symbols, WABT cleanup, Termux browser)
through completeEvidenceCliArguments. A sweep of scripts/ for budgeted
command literals with --json and no detail selection now finds none.
* fix(verifiers): leave clients without callTool unwrapped
The native verifier cleanup test drives native-value-e2e with a connection double whose Client has only connect and close. completeEvidenceClient bound client.callTool unconditionally, so wrapping threw a TypeError before connect ran. That TypeError replaced the primary connection failure the test asserts is preserved, and all four fault cases failed in Test shard 5 and Portable tests. A client without callTool has no tool call to complete, so the helper now returns it unchanged. Locally all five fault modes of the fixture now exit 0.
* fix(delivery): keep the catalog recorder on shipped helpers and expect view-implied summary
The verifier sweep wrapped record-mcp-catalog.mjs in completeEvidenceClient,
which lives in an unshipped helper. deferredRuntime copies only the
package's shipped files plus the recorder, so the recorder failed to load
(ERR_MODULE_NOT_FOUND) and its cleanup recorder never wrote. The recorder
only lists tools and prompts, so the wrapper had no effect; it is removed.
This branch makes a view with no --detail select summary delivery, as MCP
does for a view. Three CLI cases still expected the old view refusal; with
a view alone the missing input is now the summary bundle, so they expect
evidence_output, and a view with --detail complete still refuses the view.
* fix(delivery): request complete Evidence where callers need the whole result
Budgeted delivery made four callers receive a summary they cannot use:
- The GitHub Actions example uploads the analysis as a CI artifact, so it
now asks for --detail complete; over budget it had saved a summary.
- javascriptIntegrityPolicyCli spawns the CLI itself, outside the test
harness default, and reads normalized_result; it now applies the same
completeEvidenceCliArguments default.
- nativeObservationViewsMcp builds its own client to prove complete
observations overflow into a paging continuation; it now applies the
harness default so each call asks for complete Evidence.
- The CLI parity goldens are re-recorded for the --detail and
--evidence_output options the budgeted commands now advertise.
* fix(tests): give processes tests spawn the largest agent result budget
About 90 tests spawn scripts/rea.mjs or a server directly, outside the
harness default that asks for complete Evidence, and read analysis facts
from the result. Over the default budget they received a summary instead;
javascriptChildHandleOwnership failed this way.
The Vitest environment now seeds REA_AGENT_RESULT_BUDGET_BYTES with the
largest accepted value, so a spawned CLI or server delivers complete
Evidence, as the in-process default does. Delivery tests keep their own
budget: agentResultBudgetMcp builds its server without the seed, so its
default-budget cases still exercise the shipped default.
* fix(tests): give budgeted harness tests the shipped agent result budget
The test environment seeds the largest agent result budget so spawned
processes deliver complete Evidence. In-memory servers built by
createApplicationMcpHarness (and connectGhidraMcp, which uses it) inherit
process.env too, so a test that chose testDelivery "budgeted" kept the
seed: the 600-row list_procedures case and the omitted-detail web page
views returned complete Evidence instead of a summary.
testDeliveryEnvironment now owns that choice: a budgeted test's server
environment drops the seed and uses the shipped default. The application
harness applies it to every server it builds.
* fix(tests): expect view-implied summary delivery in the Playwright trace refusal
A view with no --detail now selects summary delivery, so its refusal
names the missing evidence_output bundle; --detail complete still refuses
the view. The trace test still expected a view refusal in both cases.