Files
rea/docs
morluto 62ae33320a fix(views): bound the evidence-json serialization cache (#14588)
* fix(views): bound the evidence-json serialization cache

Paging a retained record with the evidence-json view cached its whole
chunked serialization in a WeakMap for as long as the parent stayed
retained, even for a one-unit page. Nothing counted those copies, so
paging many large retained records could exhaust server memory despite
successful retention admission.

The cache now keeps whole serializations least recently used first,
within 16 Mi code units in total. A record that does not fit, and a
mutable inline parent, is paged by one streaming pass over jsonParts
that keeps only the parts around the requested window, so memory stays
bounded by the page. Both paths return identical text and coverage.

The limit inventory now links to the agent result budget section instead
of repeating its delivery contract.

* fix(views): hold cached evidence-json records weakly and test the cache bounds

Review on #14588: the module-wide Map kept cached Evidence alive after its
ledger released it, and the cache limits were untested.

EvidenceJsonSerializationCache now owns the cache. Records are keys of a
WeakMap, least-recently-used order is a Set of entries that reach their
record only through a WeakRef, and a FinalizationRegistry returns a
collected record's code units. The cache therefore never extends a
record's lifetime, and its total stays within the configured code units.

projectEvidenceJsonView takes the cache, defaulting to the shared one, so
tests can size it. New cases cover a retained record that overflows the
cache during its scan (pages before and after the overflow match, nothing
is cached, and the scan keeps only the window's parts) and LRU eviction
across three records.

* fix(views): use Budget.chargeEvicting and unregister evicted FinalizationRegistry entries
2026-11-25 17:16:02 +00:00
..

Documentation directory

Find an installation step, investigation guide, or contributor reference by task. The REA website has worked examples and product pages.

Getting started

Desktop applications

Agent environments

Native binaries

JavaScript and Electron

Browser and captured websites

Android applications

Apple applications

.NET assemblies

Firmware

HarmonyOS packages

Packages and metadata

WebAssembly

EVM contracts

Databases and recorded packets

Process capture and instrumentation

Provider setup and formats

Contracts and evidence

Development and verification

Release migrations

Signal recordings

Generated files and release records

Path Owner and update command
public/product-catalog.json Ignored contract projection; npm run docs:generate
verification/managed-conformance-*.json Ignored managed conformance projections; npm run evidence:generate
error-contract.schema.json Tracked schema from contracts; npm run docs:error-schema
user-visible-errors.csv Generated error code and category per domain and provider-owned error case; npm run docs:error-schema
releases/<version>.contributions.json Durable release contribution record; follow the release guide

Regenerate catalogs and Evidence projections from their canonical source. Release records preserve the exact commit messages and references for each release. Guides share authored images in assets/.