* fix(sqlite): accept the documented sqlite_master spelling of the schema catalog
SQLite's schema-table documentation, "Alternative Names", recognizes four spellings and says
plainly that `sqlite_master` "works anywhere" while the two `sqlite_temp_*` forms only resolve for
the TEMP database. The inspector accepted exactly one of them.
`table: "sqlite_master"` was refused with "Selected ordinary table does not exist with that exact
name: sqlite_master", which is factually wrong for a name the engine resolves:
| same library, same connection | result |
| --- | --- |
| `SELECT count(*) FROM sqlite_master` | 1 |
| `SELECT count(*) FROM sqlite_schema` | 1 |
| `SELECT count(*) FROM pragma_table_list WHERE name = 'sqlite_master'` | **0** |
| `pragma_table_xinfo('sqlite_master', 'main')` | `type, name, tbl_name, rootpage, sql` |
The stored-catalog identity comes from `temp.pragma_table_list` with a `COLLATE BINARY` exact-name
match, and that inventory lists the catalog under its canonical spelling only, so the alias never
reached the row-source facts that already work. All three schema scopes threw.
Both spellings now yield the same rows and order, and the catalog still publishes no invented
declaration:
| spelling | before | after |
| --- | --- | --- |
| `sqlite_schema` | rows, `order: rowid` | unchanged |
| `sqlite_master` | THREW | rows, `order: rowid`, no self-declaration |
| `sqlite_temp_schema`, `sqlite_temp_master`, `SQLITE_MASTER` | THREW | still THREW |
| `absent` | THREW | still THREW |
Only the everywhere-alias is added. The TEMP-only spellings and a case variant stay refused,
because SQLite does not resolve them here either.
The guide now names both spellings instead of promising one exact name.
`tests/boundary/sqlite` and `src/application/sqlite` — 79 passing, 1 skipped, 6 new cases.
Reverting the normalization fails three of them.
* test(sqlite): cover the alias through the service boundary
A review finding on the previous commit: the shared predicate change also alters
`SqliteDatabaseService.matchesSelectedSchema`, which decides CLI and MCP result admission, and
nothing exercised the alias there.
The alias case now runs through the service twice — once against a report whose catalog carries no
self-declaration, which must be admitted, and once against a report that declares the table, which
must stay an output error. Dropping the alias from `sqliteSchemaHasObjectDeclaration` fails it.
* refactor(sqlite): derive the catalog declaration check from its spelling owner
---------
Co-authored-by: 吴佳浩 <wujiahao@supremind.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
* 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(native): decode Objective-C categories that Swift lists in __objc_catlist2
Swift lists categories on a class it reaches through a Swift class stub
in __objc_catlist2, and the Objective-C runtime loads that list like
__objc_catlist. inspect_native_dispatch_metadata read only __objc_catlist,
so these categories, their methods and protocols were missing while
objc_properties_categories coverage reported complete.
Read both lists. A stub's first word is a plain value from 1 to 15, as
the runtime's isStubClass checks, and it holds no class_t, so a category
whose class reference is a stub keeps a null class and coverage names
the reference instead of reading unrelated bytes as a class name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(native): version the dispatch reader profile for __objc_catlist2 categories
Reading __objc_catlist2 changes inspect_native_dispatch_metadata results,
but the reader still declared apple-metadata-reader-4, so a snapshot saved
before this change matched the current profile and replayed its empty,
complete category result. Declare reader version and revision 5 so those
snapshots are refused with a binding mismatch and the image is read again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Resolve a protocol_t `_classProperties` slot through `resolvePointer`
instead of `read.pointer(...) !== 0n`, sharing the undecoded class-property
slot check in `AppleObjcProperties.ts` with `AppleObjcCategories.ts`.
A bound slot now counts as present and undecoded, and an unreadable or
unknown-fixup zero slot keeps the protocol record and coverage partial
rather than treating the list as absent.
When planEspFlashLayout locates a bootloader whose flash address is at or
after the selected partition table, it omits the bootloader region and
records a limitation. finishEspFlashLayout previously checked only
plan.input.bootloader === undefined, so a dump whose partitions covered
the rest of the image could still report coverage: "complete".
Check whether a bootloader region was actually placed in plan.regions
instead of re-deriving presence from plan.input.bootloader, matching
EspFlashImageArtifactReader. Update docs/esp-flash-image.md and add unit,
reader, and CLI regressions.
* fix(artifacts): keep boot image coverage unknown when layout bytes are not exposed
Android boot and vendor_boot inventories reported complete coverage while
a limitation said declared layout bytes were not exposed as children: a
vendor_boot v4 section without table entries, table entries that cover
only part of the section, and bytes between the sequential layout and a
v1/v2 recovery_dtbo. The same section bytes already left coverage unknown
when the vendor table failed to parse.
The header and vendor table parsers now report unexposed bytes as typed
facts (unexposedLayoutBytes, unexposedSectionBytes) next to the existing
limitations, and the reader derives coverage from them instead of from
the parse-failure flags alone. The legacy tail's facts are named as the
parse fields they become and are spread into the parse result.
Fixes#14369
* docs(artifacts): separate boot image metadata ranges from children in the coverage rule
---------
Co-authored-by: Anurag Singh <211784907+Anurag-5ingh@users.noreply.github.com>
* fix(tar): read pax values that hdrcharset=BINARY leaves as raw bytes
A pax extended header may declare hdrcharset=BINARY, and then its path,
linkpath, uname and gname values are raw bytes rather than UTF-8 (POSIX
pax, "hdrcharset"). Python tarfile and libarchive write exactly this for
a file name that is not UTF-8. parsePaxRecords refused every non-UTF-8
value, so the walk stopped as malformed at that header and no member
from it on was inventoried.
Under hdrcharset=BINARY those four values are now decoded as Latin-1,
with a limitation giving the raw bytes, as header names already are.
Any other non-UTF-8 value still stops the walk.
* fix(tar): charge hdrcharset=BINARY warnings to the metadata allowance
Each Latin-1 warning carries the raw value in hex, twice its size, and a
repeated global header appends a new one while a same-sized replacement
leaves the global map charge unchanged. Charge every warning to
artifact_limits.tar.metadata_bytes before building it.
* fix(tar): refund hdrcharset=BINARY warnings no member keeps
A local pax header's warnings were charged to
artifact_limits.tar.metadata_bytes but never refunded when they were
discarded: by the next local header that replaces them, or by an omitted
member or the archive root, which do not keep them. Repeated binary owner
names on omitted members could exhaust the allowance while the retained
data fit. Refund the charge whenever the warnings are dropped.
* 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>
* fix(artifacts): read the next tar header after header-only members
POSIX ustar stores no data blocks for symbolic links, devices,
directories and FIFOs, and a directory's size field may be nonzero by
design. The tar walk skipped the declared size after every header, so
such a header hid the members that followed. When the skipped span
landed on a later header, those members were missing while coverage
stayed complete. Otherwise the walk stopped as malformed.
The stored data length now comes from the header's type, through the
same directory rule that classifies members. Hard links keep their
declared size, because pax interchange archives may store a body.
Fixes#14497
* test(artifacts): cover pax and long-name sizes on header-only tar members
---------
Co-authored-by: Anurag Singh <211784907+Anurag-5ingh@users.noreply.github.com>
* fix(browser): return completed scenario capture when cleanup is unconfirmed
When every scenario action completed but session cleanup timed out or
failed, capture_browser_scenario reported a hard cleanup_incomplete
failure and retained the finished observation only as a raw partial
with no evidence_id, so the caller lost a result that had succeeded.
Model capture and cleanup separately: the capture schema now admits
cleanup "incomplete" for a completed capture, and the Playwright
provider returns the completed capture in that case, with the cleanup
reason and the resources that may remain reported as a limitation.
The cleanup lease stays retained, so provider close and the next
capture still retry and surface unconfirmed cleanup. Captures whose
operation failed keep the existing cleanup error and partial
observation behavior.
Fixes#6166
Co-authored-by: Saim Shafique <128062316+sx4im@users.noreply.github.com>
* test(browser): update the retained-cleanup CLI test for the completed-capture behavior
When every action completed but cleanup is unconfirmed, the one-shot CLI
now returns the completed capture as Evidence instead of failing with
cleanup_incomplete and exit 1. The retained-cleanup test still asserts the
retry (provider close once, browser close retried, profile removed once)
but now expects the success output: the capture with browser.cleanup
"incomplete", both steps completed, and the unconfirmed-cleanup limitation.
* fix(browser): preserve typed cleanup failure reasons
* test(browser): model capture finalization in session mock
---------
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>
* feat(cli): retain over-budget partial observations from failed CLI runs
When a failed CLI command carries an over-budget partial observation without
--evidence_output, retain the complete partial Evidence in the private
retained-Evidence cache instead of dropping it to a rerun-only fallback.
- Pass the composed source closure into budgetFailurePartialEvidence so cited
source records are written into the retained bundle alongside the partial
observation.
- Report the retained path, byte size, and record_sha256 under
details.diagnostics.evidence_bundle, set details.partial_observation_delivery
to retained: "cache-file" with a paging cursor, and keep all failure facts
(code, message, failure_kind, retryable, remediation, limits, existing
diagnostics) unchanged.
- Honor --no-retain and REA_CLI_RETAINED_EVIDENCE_BYTES=0, fall back to
retained: "not-retained" with rerun arguments and redacted retention_failure
on uncommitted write errors, preserve the original failure and committed
cache receipt on post-commit staging cleanup failures, and keep cancelled
failures on the no-publication contract.
- Document the behavior in docs/reference/limits-and-recovery.md and add
boundary and CLI acceptance tests.
Fixes#14618
* fix(cli): preserve pre-commit cleanup ownership and surviving oversized cache receipts
Address two gaps in the shared retainOverBudgetEvidence path that affected
both successful (deliverRetainedSummary) and failed (budgetFailurePartialEvidence)
CLI retention:
- Preserve pre-commit writer errors whose staging cleanup stayed incomplete
(including exists failures with unfinished cleanup), reporting cleanup_incomplete
and remaining resources via projectFailure on successes and via
refusedPartialPublication (keeping execution_failure and complete inline
partial_observation) on failures.
- When removing an oversized retained cache bundle fails (fileRemains), carry
the surviving file metadata through RetentionStop.remainingFile, record the
complete receipt (path, bytes, record_sha256), and report retained: "cache-file"
with its paging cursor and retention_failure instead of a not-retained fallback.
- Simplify refusedPartialPublication back to a plain delivery value now that
retainOverBudgetEvidence tracks the attempted cache path directly.
- Add public CLI tests for both paths (success and failure) using
evidencePublicationPreload.mjs and update docs/reference/limits-and-recovery.md.
* fix(cli): key retained bundles by complete source closure
* chore(format): format retained evidence publication
* fix(cli): canonicalize retained bundle cache keys
* test(cli): compare retained bundle bytes directly
---------
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* fix(android): admit DEX-bearing ZIP packages by directory content
A ZIP root without an .apk suffix was classified as a generic zip, so
inspect_android_package refused extensionless DEX archives. Generic ZIP
roots are now admitted as APKs when the central directory lists a root
AndroidManifest.xml or classes*.dex entry.
* fix(artifacts): bound Android ZIP probing and preserve selected formats
* chore(format): format Android ZIP admission changes
* fix(artifacts): bind ZIP classification to final file identity
---------
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* fix(javascript): keep Electron options visible past conditional literal spreads
The static object-literal model treated a spread such as
`...(isMac && { titleBarStyle: "hidden" })` or
`...(isMac ? { frame: false } : {})` as an unknown write, so every earlier
key became dynamic. BrowserWindow webPreferences and the preload association
were lost, and child-process options such as stdio lost their values too.
Expand `&&` and `?:` spreads whose branches are bounded literal copies into
one conditional-keys member. Only the keys a branch may copy stay
unresolved, and a falsy `&&` operand may still copy index keys
(document.all). `||`, `??`, unresolved branches, getters and computed keys
stay unknown, and nesting counts against the existing expression depth
limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(javascript): leave spread keys unknown after an unresolved && operand
A falsy `&&` operand is copied itself, and the conditional spread model
assumed it could add only index keys. document.all, the only falsy
object, can also carry expando properties with any key, so
`{ webPreferences, ...(isMac && { title: 1 }) }` reported the earlier
`webPreferences` as explicit while `isMac` was unresolved.
Bound the left operand with the same spread rules as a branch. A
comparison, `!` negation or other primitive result copies no named keys
and keeps earlier options readable; an unresolved operand, such as an
identifier, leaves the spread unknown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(limits): apply producer.output_bytes within each producer's maximum
decode_android_resources and inspect_asset_catalog ignored the session
output setting because their defaults and maxima differ from the shared
4 MiB default. An unset setting still uses 4 MiB and 64 MiB. An explicit
runtime value or REA_PRODUCER_OUTPUT_BYTES supplies the omitted field and
is clamped to each producer's maximum. A per-call value still wins.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* test(limits): show above-cap producer output settings are reduced
A runtime override or REA_PRODUCER_OUTPUT_BYTES above a producer's maximum
is enforced as that maximum. Apktool's capture budget and assetutil's
refusal both report the reduced value.
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)!: 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
* 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(limits)!: raise disk-backed admission defaults for large ordinary targets
Raise four per-call input defaults whose work streams from disk or reads
by range, so large but ordinary targets are admitted without a retry:
- inspect_sqlite_database producer_limits.input_bytes: 256 MiB -> 2 GiB.
The database and WAL stream into a private on-disk snapshot that
node:sqlite reads by page with mmap disabled; the worker heap stays
256 MiB.
- inspect_go_binary max_input_bytes: 256 MiB -> 2 GiB. One streaming
hash pass, a header prefix and range reads with chunked build-info
search.
- inspect_rust_binary producer_limits.input_bytes: 256 MiB -> 2 GiB.
One streaming hash pass, a header prefix and a windowed rustc scan.
- inspect_nuget_nupkg max_file_bytes: 64 MiB -> 256 MiB, above
nuget.org's 250 MB package ceiling. The ZIP is read by range; only
the directory and .nuspec are retained.
Descriptions and remediation text that restated the old Rust and NuGet
values now derive from the owning constants.
BREAKING CHANGE: omitted input budgets for inspect_sqlite_database,
inspect_go_binary, inspect_rust_binary and inspect_nuget_nupkg now admit
larger files. Callers relying on the old default refusal must pass the
old value explicitly.
* test(nuget): pin the default max_file_bytes refusal boundary through CLI and MCP
* 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
The reads counted before a read-budget refusal are a lower bound: later reads
depend on structures not yet decoded, so retrying at that value can refuse
again. Keep the bound in reported_limits.required_read_bytes and report no
required_value, which promises the smallest admitting value.
* 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(limits)!: report the value a per-call limit needs and derive its recovery
A per-call parameter limit (`control_kind: "parameter"`) now carries an
optional `required_value`, and its refusal projects the typed
`adjustable_budget` under `details.refusal` with `control`, `default_value`
and `required_value`. The refusal owns the recovery: "Pass a larger
<parameter> on the next <operation> call (at least N; range a..b), then
retry", or a narrower request when the control is at or below the need's
maximum. The CLI renders the step with the command's flag and command.
ELF notes and debug-link, pcap producer limits, PE/native read budgets and
WASM artifact paths drop their duplicate authored recovery and report the
measured need where they compute it.
BREAKING CHANGE: per-call parameter refusals gain `details.refusal`, and
their `remediation.action` wording changes to the generated form.
* feat(limits): offer the session setting beside a setting-backed per-call limit
The adjustable_budget recovery is now rendered from its details.refusal
facts alone (which gain `source` for settings), so the CLI parses those facts
and re-renders the recovery with its flag and command instead of matching
display text; authored recovery is never rewritten. A per-call control backed
by a registered setting names both routes: the next call, then the setting
through update_analysis_settings, or its launch environment variable for a
one-invocation caller. Per-call-only controls keep one route.
inspect_wasm_artifact reports the larger of its oversized selection counts
as required_value, so one retry admits both fields.
* refactor(limits): render refusal recovery once in the delivering adapter's spelling
Refusal recovery is rendered at projection in the spelling of the adapter
that delivers it: MCP names the contract field and tool; a CLI command binds
its own spelling (flag or JSON-option path, rea <command>, launch
environment route) around its run. Authored recovery never reaches the
renderer, so nothing distinguishes it by text. The CLI no longer re-parses
details.refusal or rewrites the generated sentence; the prefix-matching
rewrite and its fact schema are removed.
* test: expect the typed refusal for Flutter APK and NTFS per-call limits
Per-call parameter limits now carry details.refusal; these tests landed on
main asserting its absence.
* 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
* feat(delivery)!: budget the partial observation carried by failure results
A failure's details.partial_observation, the complete Evidence of work
that finished before it, now gets the agent result budget's one
decision with the budget the rest of the failure leaves. The failure's
own facts are never budgeted.
When it does not fit, it is replaced by its summary, and
details.partial_observation_delivery carries the delivery facts. MCP
retains the complete partial Evidence in the session and pages it with
the evidence-json cursor; the CLI publishes it to --evidence_output, or
names the rerun arguments without one.
Fixes#14595
BREAKING CHANGE: When a failure's details.partial_observation does not
fit delivery.agent_result_budget_bytes beside the failure's own facts
and the caller omitted detail, MCP and the CLI deliver its summary
record instead of the complete Evidence, with
details.partial_observation_delivery naming where the complete record
is. Pass detail complete (--detail complete) for it inline.
* fix(delivery): keep a budgeted partial's link and paging call on every path
The compact retry for an oversized error encoded with the whole frame
budget, so the resource link appended after it could exceed the checked
frame; every encoding now reserves the link's bytes. A bundle that
committed before its staging cleanup failed delivered the partial's
summary without partial_observation_delivery; the refusal now carries
the same delivery facts as a successful publication.
* feat(mcp): link retained Evidence from over-budget summaries
An over-budget MCP result now also carries a resource_link to the
complete record its summary replaced. The rea://evidence/{evidence_id}
template reads any record the session retains as its exact JSON, the
same text the evidence-json cursor pages. The cursor stays the recovery
every client can follow.
An ID the session does not retain is not found (-32602). A record too
large for one response gets no link, and a read of it is refused with
the cursor (-32600). The link is named complete-evidence so Claude Code,
which renders it as one line, spends about 67 tokens on it.
Part of #14187
* fix(mcp): offer an Evidence link only when one read can deliver it
The link offer compared the record's unescaped JSON bytes with the frame,
while the read measured the escaped text inside its result, so a linked
record could refuse its own read. The read also never checked REA's
single-string limit, so a frame budget raised above it could let a read
reach the SDK serializer. Both now use retainedEvidenceReadFits, which
bounds the escaped read's UTF-8 bytes and UTF-16 length.
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.