mirror of
https://github.com/morluto/rea.git
synced 2026-11-30 18:39:24 +00:00
0a80c0bee2e63d64c1b35377271380709db853eb
1838
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3e8f6a43a9 |
feat(artifacts): decode Android Verified Boot vbmeta images offline (#13239)
* feat(artifacts): decode Android Verified Boot vbmeta images offline
* fix(artifacts): locate vbmeta tail-length failures at their length fields
* fix(artifacts): make vbmeta admission budgets adjustable per call
* fix(firmware): refuse vbmeta fields too long to hex-encode
With raised descriptor_bytes and auxiliary_block_bytes limits, a valid
KERNEL_CMDLINE longer than half the host string bound passed the byte
limits, and toString("hex") then threw ERR_STRING_TOO_LONG, which
surfaced as an I/O error. Check the field against the host bound before
hex encoding and report a typed capacity failure with its own limit.
* fix(firmware): check vbmeta extents before admission budgets
A header whose declared blocks do not fit the file, or whose descriptor
range does not fit its auxiliary block, now reports truncation or a
malformed range instead of a limit a larger budget cannot repair. The
over-budget fixtures are now fully present so they still prove the limit.
* perf(firmware): count vbmeta descriptor tags in one pass and reuse readers
The summary counts every descriptor tag in a single loop instead of six
filtered arrays, and androidVbmeta reuses one BinaryReader per buffer.
The malformed-header refusal fixtures follow main's unsupported_target
classification for malformed target bytes.
* chore: regenerate advertised schema hash after merging main
* docs(android-vbmeta): name unsupported_target for structural refusals
Malformed vbmeta headers classify as unsupported_target, not
invalid_request, matching analysisErrorClassification and the refusal
fixtures.
* chore: regenerate advertised schema hashes after merging main
* chore: regenerate advertised schema hashes after merging main
* fix: restore Android vbmeta artifact reader after merging main
* test(artifacts): expect partial for the CLI vbmeta descriptor refusal
* feat(artifacts): preserve vbmeta descriptor bytes and partial refusals
Co-authored-by: iamcipherdev <268238676+iamcipherdev@users.noreply.github.com>
* fix(artifacts): use Buffer.equals in vbmeta tests and update advertised schema summaries
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Matt Van Horn <mvanhorn@MacBook-Pro-10.local>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Co-authored-by: iamcipherdev <268238676+iamcipherdev@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
|
||
|
|
6a6e7b0bbf |
feat(artifacts): inventory OCI image layouts offline (#12470)
* feat(artifacts): inventory OCI image layouts offline
OCI image-layout directories (oci-layout, index.json, blobs/) arrive as evidence and previously required walking the JSON by hand.
This adds inspect_oci_image_layout / inspect-oci-image-layout for the directory form only. It reports layout version, nested indexes, image config facts, layers, and streamed SHA-256 (and SHA-512 when declared) verification of present referenced blobs. Env values stay omitted unless include_env_values is selected. Missing blobs, digest and size mismatches, unreferenced blobs, unknown media types, unsupported digest algorithms, and symlink blobs are findings. Layer contents are not decompressed.
* fix(oci): preserve whitespace in image config strings
Keep config facts such as WorkingDir exactly as written instead of
returning their trimmed form. Blank values still count as absent.
* fix(oci): read the platform os.version member
The OCI image index stores a platform version under the literal
"os.version" member, so Windows entries that share OS and architecture
keep the build that tells them apart.
* fix(oci): keep config Env values unless the caller omits them
Env values are bytes from the selected image, and AGENTS.md asks to
preserve local evidence without inferring secrecy from names. The
include_env_values control now defaults to true; false still leaves each
value null and keeps the names.
* fix(oci): report descriptors the parser cannot model
An index, layer or config descriptor without a string mediaType or digest
was dropped with no diagnostic, so an index of only malformed descriptors
read as an empty, fully covered index. Each such descriptor now records a
malformed_blob_json finding naming its position, what it lacks and any
digest it carries.
* fix(oci): walk nested indexes breadth-first
The index walk was depth-first with a visited set that ignored depth, so
an index shared between a nested path and the root was first visited too
deep, and what it reached within max_index_depth was never inventoried.
Indexes now queue breadth-first, so each is first reached at the
shallowest depth any path gives it.
* fix(oci): check every declared size of a shared blob
When several descriptors referenced one blob with different sizes,
remember kept only the first declaration, so a wrong later size was
never checked. Each referenced blob now keeps every distinct declared
size, and the file-size and hashed-byte checks run against each one.
* fix(oci): report partial coverage when referenced JSON is not read
A referenced index, manifest or config that was a symlink, or otherwise
could not be read, left its facts unexamined while coverage still read
complete. Any skipped referenced JSON read now makes coverage partial,
whatever finding explains it.
* fix(oci): report unsupported layer digests without calling them missing
A layer whose digest used an unsupported algorithm got no finding and
was recorded as a missing blob, even when its file existed, and coverage
could read complete. Every referenced digest with an unsupported
algorithm now records unsupported_digest_algorithm, its blob record
reflects the file at blobs/<algorithm>/<encoded>, and such a finding
makes coverage partial.
* fix(oci): keep the parse outcome when reader cleanup fails
The provider's finally replaced the parse result with a cleanup failure
that always claimed the parse completed, so a refusal, cancellation or
integrity failure and its layout snapshot were lost when closing the
reader also failed. The parse outcome is now captured first; a failed
parse stays the primary error, with its partial facts, and the cleanup
failure is attached to it.
* Address review feedback
* fix(oci): keep oci-layout snapshot on missing imageLayoutVersion
Build the oci-layout file snapshot before checking imageLayoutVersion and
attach it to the refusal, so a readable oci-layout without a version still
reports its sha256 and byte count.
* fix(oci): keep directory traversal coverage in layout reports
parseOciImageLayout iterated the directory reader without an onCoverage
sink, so names the reader skipped (for example non-UTF-8 names on Linux)
left the report claiming complete coverage with no limitation. Collect
the traversal coverage, carry its limitations into the report, and let
unknown or partial traversal coverage override the findings-based status.
A reader that reports nothing is treated as unknown.
* fix(oci): keep reader failures on referenced blobs
A referenced index, manifest or config read that failed in the reader,
for example a close failure after the JSON was fully read, was recorded
as malformed_blob_json and the call carried on. Only format failures
become findings now; reader failures reach the caller with their own
facts.
* fix(oci): budget decoded descriptors separately from directory entries
max_entries bounds the directory walk, but index, manifest and layer
descriptors also spent it, so many manifests sharing layers were refused
far inside the advertised directory budget. Decoded descriptors now spend
their own max_descriptors allowance (default 65536, maximum 1048576), and
a refusal names that allowance.
* fix(oci): keep the completed inventory when reader cleanup fails
When parsing finished but closing the directory reader failed, the
provider threw a cleanup failure built against a placeholder outcome and
the completed inventory was dropped. The cleanup failure now carries the
completed report as unretained Evidence in its partial observation, the
same way DesktopApplicationReader keeps its report. A provider test
covers that case and checks that a later close retries the failed
reader cleanup.
* fix(oci): keep reader omissions out of complete layout coverage
parseOciImageLayout took the directory reader's coverage but not its
omission callback, so a FIFO, socket or device node under blobs/ was
dropped from the blob inventory while the report still said complete.
Collect omissions other than the intentional skip of directories
outside blobs/, name the first one in a limitation, and report unknown
coverage when any were seen.
* refactor(oci): classify layout failures through classifyProviderFailure
The provider kept its own raw-error ladder in layoutFailure. Its OCI
decisions (unsupported root or symlink, parse limits with budget
recovery, format failures, reader failures) are now the recognise step
of a ProviderFailureDialect, with the io report as its unclassified
fallback, so typed failures pass through, cancelled reads use the shared
cancellation path, and a failed read's cleanup is bound by the shared
owner.
* fix(oci): match referenced blobs by resolved path
parseOciDigest accepts uppercase SHA-256 hex and resolves it to the
lowercase blob path, but the unreferenced-blob sweep keyed membership by
the descriptor's original spelling. A blob named that way was hashed as
referenced and also reported as unreferenced_blob with a second
referenced: false row. Track the resolved paths of referenced blobs and
skip them in the sweep.
* fix(oci): read shared configs once and budget expanded config facts
Each manifest reread and reparsed its config, and every image carried its
own copy of the facts, so many small manifests sharing a large config
could expand to far more memory than the per-file limits suggest before
the service checked the report.
Each config blob is now read and parsed once per layout and its facts are
reused. The config bytes behind each image spend a new max_config_bytes
allowance (default 64 MiB, maximum 512 MiB) before the image is added, so
a shared config counts once per image and an expansion past the budget
refuses the inspect and names that allowance.
* fix(oci): report blob sizes above 4 GiB
Descriptor, layer and blob sizes used the 32-bit count schema, so a
layout with a blob over 4 GiB produced a report the output schema
rejected, hiding its blob_oversize finding. Sizes now accept any
nonnegative safe integer; depth and coverage counts stay 32-bit.
* fix(oci): report a referenced layer that is not a regular file
A referenced layer whose blob path is a directory was recorded as kind
other with present false, but no finding was emitted. Layer blobs never
go through the referenced JSON reader, so coverage stayed complete even
though the layer was never verified. The layer now gets a missing_blob
finding, matching non-file indexes, manifests and configs, and coverage
is reported as partial.
* fix(oci): keep the oci-layout hash when a later budget refuses
A manifest or config past max_json_bytes, or a layout past
max_descriptors or max_config_bytes, threw a bare ParseFailureError
after oci-layout had been read and hashed. The provider only attaches
partial facts to OciImageLayoutRefusal, so that completed observation
was dropped.
The parser now rewraps any later ParseFailureError as an
OciImageLayoutRefusal carrying the oci-layout snapshot, so every
refusal after that point reports it as the partial observation.
* fix(oci): keep blobs unknown when the reference walk is truncated
When max_index_depth, an unreadable index or manifest, or a descriptor
that cannot be modeled stops the reference walk, blobs outside the
walked part were reported as unreferenced_blob. They may still be
reachable from what was not examined, so the parser now only asserts
unreferenced status after a complete walk and otherwise records a
limitation and leaves those blobs out of the inventory.
* fix(oci): report wrong-typed manifests and layers arrays
A non-array manifests member in index.json now refuses the layout and
keeps the oci-layout observation. A non-array manifests member in a
nested index, or a non-array layers member in a manifest, records a
malformed_blob_json finding and marks the reference graph truncated
instead of reading as an empty collection.
* fix(oci): report image configs whose root is not a JSON object
A config blob holding valid JSON such as [] or null fell back to empty
facts with no finding, so the report claimed complete coverage. Record a
malformed_blob_json finding for the config digest while keeping the
manifest and layer observations.
* fix(oci): decode only image config media types as JSON
A manifest whose config is application/octet-stream or another
non-image type no longer has its config run through the JSON decoder.
Valid binary config bytes produced a false malformed_blob_json finding,
and a config larger than max_json_bytes refused the whole inventory even
when it fit max_blob_bytes. Such configs now stay opaque references that
the blob pass hashes; the unknown_media_type finding is kept.
* fix(oci): bound JSON reads by the descriptor budget
The service checked json_bytes_read against one max_json_bytes document
per returned index and image plus two. A layout reads a manifest and a
config per image, and manifests or nested indexes that fail to parse are
read without appearing in the report, so valid layouts whose every
document fit max_json_bytes could be rejected after parsing.
Every nested index or manifest read is charged one descriptor and each
manifest reads at most one config, so bound the total by oci-layout,
index.json and two documents per allowed descriptor.
* fix(oci): count OCI 1.1 subject blobs as referenced
A manifest or index subject that names a blob present in the layout now
joins the referenced set, so the blob is hashed and is not reported as
unreferenced. A subject absent from the layout is allowed by the spec
and adds no finding. A subject that is not a descriptor is reported as
malformed and keeps unreferenced blobs unknown.
* fix(oci): keep caller selections in cleanup-recovered Evidence
When the reader fails to close after a completed inspection, the provider
keeps the inventory as partial Evidence built from the resolved input, so
its parameters named defaults the caller never chose and its Evidence ID
differed from the success path. Build both from one OCI Evidence helper
and have the service rebuild a recovered inventory from the caller's own
selections.
* fix(oci): keep blob rows when the reference graph walk is incomplete
When a nested index or manifest could not be read or exceeded
max_index_depth, every blob outside the walked part was dropped from the
report, losing its path, size and kind. List those blobs with a null
referenced status instead, and report unreferenced_blob only when the
whole graph was examined.
* fix(oci): report unknown media types on present subjects
A subject blob present in the layout now joins the referenced set, which
removed its unreferenced_blob finding. Index entries, layers and configs
also report an unfamiliar media type, but subjects skipped that check, so
an unknown subject format went unreported. A present subject with an
unknown media type now records unknown_media_type.
* perf(oci): index emitted blob findings instead of rescanning them
The blob inventory loop checked each referenced digest against the whole
findings array before recording missing_blob, symlink_blob, or
unsupported_digest_algorithm, which is quadratic for layouts with many
missing blobs. Index finding kind and digest in a set built once before
the loop so each check is constant time. Output is unchanged.
* fix(oci): report invalid descriptor sizes as malformed
An index entry, config, layer or subject descriptor whose required size
was missing, a string, negative or fractional became a null size, which
dropped it from size validation without any finding, so the report could
claim complete coverage. The descriptor still keeps its other facts, but
the defect is now recorded as malformed_blob_json on the owning blob.
* fix(oci): keep damaged config, subject and descriptor facts in the report
Image config parsing kept any string in rootfs.diff_ids, so a readable
config with diff_ids [""] produced output the schema rejects and the
service discarded the whole inventory as an AnalysisOutputError. Config
parsing now owns that boundary: diff_ids members that are not nonempty
strings, and empty ExposedPorts or Volumes keys, are omitted and reported
once per config blob as malformed_blob_json, and the manifest and layer
observations stay in the report.
Related gaps in the same walk:
- A present subject was hashed but never walked, so blobs it names were
reported as unreferenced. A subject manifest now goes through
walkManifest and a subject index joins the breadth-first index queue one
level below its owner, within max_index_depth.
- A manifest with no config member reported complete coverage. A missing
config is now treated like a malformed one.
- A symlinked referenced blob was not hashed but left coverage complete.
symlink_blob now makes coverage partial.
- An unusable descriptor size was serialized into the finding message.
It is now described by type and length, with short strings quoted.
- A reader failure after oci-layout was hashed dropped that observation.
It is now attached when the reader did not attach its own.
- Annotation and label names allowed by OCI, including the empty key,
failed the output schema. The name is now any string. The advertised
compact output schema summary is unchanged.
* perf(oci): index declared sizes for shared blobs
Recording a distinct declared size scanned every earlier declaration for
the same blob, so many references to one blob with distinct sizes cost
quadratic work inside max_descriptors. ReferencedBlob now keeps a Set
beside declaredSizes for membership, and the array keeps declaration order
for verification.
* fix(oci): walk subject manifests from a queue
Finish each manifest before reading the one its local subject names, so a
long subject chain no longer keeps every parsed document alive at once.
* fix(oci): resolve unsupported-digest layer presence at its layout path
A layer stored at blobs/sha1/<hex> was reported present: false because
the layer lookup only resolved verifiable digests, while the blob
inventory reported the same file present. Use the grammar-based path
fallback for layer presence too.
* fix(oci): keep reference coverage uncertain for opaque index entries
An index entry with an unknown media type is not walked, so the blobs
it references are unknown. Mark the reference graph truncated so no
blob is reported unreferenced, and report coverage as partial whenever
the reference graph was not fully examined.
* fix(oci): walk digest aliases that differ only in hex casing once
Descriptors whose digests differ only in accepted hex casing resolve to
one blob, but the index queue, visited set and config cache were keyed
by the source spelling, so each alias reread and rewalked the whole
index. Key traversal by the resolved blob path while descriptors keep
their source spelling in the report.
* fix(oci): keep unparsed digest spellings out of accepted traversal keys
A descriptor spelled blobs/sha256/<hex> did not parse, so its traversal
key fell back to the raw text, which matched the blob path key of the
accepted sha256:<hex> digest. Listed first, it marked the manifest
visited and the valid descriptor was skipped. Prefix accepted and
unparsed keys separately.
* fix(oci): bound index entry text retained across indexes
Index entries keep their digests, media types, platforms and annotations
in the report, but no allowance covered that text across indexes, so many
nested indexes with large annotations could exhaust memory within every
other limit. Charge each retained entry to a new max_descriptor_bytes
budget (64 MiB default, 512 MiB maximum) before adding it.
* fix(oci): hash each blob file once across digest spellings
Digest spellings that differ only in accepted hex casing resolve to one
blob path, but the blob pass hashed the file once per spelling. Cache the
hash result, or its oversize refusal, by blob path so each file is read
once, while every spelling keeps its own row, size checks and digest
check.
* fix(oci): report non-object config and rootfs subobjects
A present config or rootfs value that is not a JSON object now records a
malformed_blob_json defect instead of being replaced by an empty object, so
coverage reports partial. Other image facts are kept. Regenerate the
inspect_oci_image_layout advertised-schema summary.
* fix(oci): check declared sizes for unsupported-digest blobs
A blob referenced by a valid but unsupported digest (for example sha1)
skipped the declared-size checks and left observed_size null, even
though the directory reader already captured the file size. Record
observed_size and emit size_mismatch for it, still without hashing.
* fix(oci): keep reader integrity failures that wrap a JSON parse failure
readJsonDocument unwrapped any ArtifactReaderFailure whose cause was a
ParseFailureError. When a malformed referenced blob changed during
inspection, DirectoryArtifactReader.inspectFile raised an "integrity"
failure carrying that ParseFailureError, and the unwrap turned it back
into a malformed_blob_json finding. Only unwrap the plain "io" transport
wrapper with no cleanup lease, so integrity, cancelled and limit
failures keep their reader facts.
* fix(oci): report malformed config leaf fields
A config with Env: "A=1" or Cmd: ["/bin/sh", false] used to come back
as env: [] or cmd: null with no finding, indistinguishable from an
image that declared neither. parseConfig now checks each present known
field (the top-level strings, User, Env, Entrypoint, Cmd, WorkingDir,
ExposedPorts, Volumes, Labels, StopSignal) and records
malformed_blob_json for a wrong type, keeping the other facts. Env
members that are not a named string and non-string label values are
omitted and counted. null stays an omitted declaration.
* fix(oci): allow json_bytes_read beyond 32 bits
coverage.json_bytes_read sums bytes across every JSON document read.
OciImageLayoutService bounds it by max_json_bytes * (2 + 2 *
max_descriptors), which at a 16 MiB per-document cap passes 0xffffffff
well within budget, so the uint schema made safeParse reject a completed
report as AnalysisOutputError. Give the counter a nonnegative safe-integer
schema; the other uint counters are unchanged.
* fix(oci): report malformed image history
A non-array history or a history member that is not an object was
silently dropped, so damaged build history looked the same as omitted
history. Report both as malformed_blob_json defects on the config blob
and keep the readable history records and other image facts.
* fix(oci): report damaged descriptor metadata and symlinked blob dirs
Descriptor platform and annotations that were present but malformed
(platform: [], a non-string platform field, annotations that are not an
object or hold non-string values) were normalized to null or [] with no
finding. Report each as a malformed_blob_json defect against the owning
document and keep the readable entries.
A symlink at blobs or blobs/<algorithm> is not followed, but nothing
recorded the skipped tree, so an empty index over a linked blob
directory reported an empty inventory with complete coverage. Record a
symlink_blob finding for the linked directory so coverage is partial.
* Address review feedback
* Address review feedback
* Address review feedback
* Bound repeated JSON member names in OCI findings
A long duplicate member name is now described by its length instead of
being copied into the finding message.
* fix(oci): keep the oci-layout hash when its JSON is malformed
The oci-layout file is now read and hashed first, and its observation is
recorded before decoding. An oci-layout with invalid UTF-8, invalid JSON
or a duplicate member is refused with its completed file identity.
* fix(oci): charge accepted descriptor text to max_descriptor_bytes
Accepted subject, config and layer descriptors keep their digest and
media type in image rows, the reference map, findings and blob rows, but
only index entries and rejected descriptors spent max_descriptor_bytes.
A layout with many manifests carrying long distinct layer digests could
retain unbounded text. Charge accepted descriptor text before retaining
it, once per referencing manifest or index.
* fix(oci): report presence defects for unsupported-digest blobs
A referenced blob with an unsupported digest algorithm whose layout path
is missing, a symlink, or not a regular file now gets the same
missing_blob or symlink_blob finding a supported digest gets, alongside
unsupported_digest_algorithm. Present files still only get the size
check and stay non-missing.
* perf(oci): drain index and manifest queues with a cursor
shift() relocates the remaining queue on every step, which makes draining
layouts with many index references quadratic. Walk both breadth-first
queues with an index cursor instead.
* fix(oci): keep blobs under a symlinked blob directory unexamined
When blobs or blobs/<algorithm> is a symlink, the reader lists the link
but never its children, so a referenced blob under it is absent from the
listing without being absent from the layout. One shared lookup now
tells listed, unexamined and confirmed-missing paths apart for the
reference walk, subjects, and both inventory branches. An unexamined
blob gets a symlink_blob finding naming the directory instead of
missing_blob, and an unexamined subject marks the reference graph
truncated.
* fix(oci): charge serialized config facts to max_config_bytes
The config allowance counted the config document's source bytes, but each
image carries the parsed facts, and a sparse history entry such as {}
expands into a record with four null fields. A small shared config with
thousands of empty history entries could pass the budget while the report
grew past the runtime's string limit. Each distinct config now charges the
exact compact JSON size of its facts, once per image that uses it.
* fix(oci): keep the oci-layout snapshot when its read fails to finalize
When the oci-layout read completes but closing its descriptor fails, or
cancellation arrives during the close, the reader rejects before the
parser records the layout hash. The reader keeps the completed bytes on
that failure, so the failure reached translation without the SHA-256 and
byte count it could have carried, unlike the same failure on index.json.
The parser now records the completed layout observation from that outcome
and rethrows the reader's failure unchanged, keeping its cleanup owner.
* fix(oci): keep reference status unknown under an unwalked present subject
A present subject with an unknown media type, or an index or manifest
subject whose digest algorithm is unsupported, is not read, so the blobs
it names were reported as unreferenced with complete coverage. Mark the
reference graph truncated in both cases so unmatched blobs keep an
unknown referenced status.
* fix(oci): keep a malformed index.json primary when its handle close fails
When index.json is malformed and closing its descriptor also fails, the
directory reader raises ArtifactFileCleanupFailure with reason io and keeps
the ParseFailureError as the physical outcome. The OCI dialect translated
the wrapper directly, so the malformed input surfaced as an I/O failure even
after the resource scope retried the close.
The dialect now supplies readCleanup: the shared classifier classifies the
failed outcome as primary, and the unresolved close is attached beside it
and bound to that read's exact cleanup lease. A cleanup-only read keeps its
previous projection.
* fix(oci): count a malformed blob's bytes in json_bytes_read
A referenced index, manifest or config that was read in full but failed
UTF-8, JSON or duplicate-member decoding became a malformed_blob_json
finding, yet its bytes never reached json_bytes_read, because the count
was added only after decoding succeeded.
The blob read now adds the byte count inside the completed read, before
decoding, so coverage reports every byte the parser examined.
* fix(oci): report a missing or non-directory-ancestor path as invalid input
A selected root that resolves to ENOENT or ENOTDIR is a bad path, not an
I/O failure. Classify it as an AnalysisInputError on `path` before the
generic reader translation; other root I/O keeps its execution failure.
* fix(oci): keep the layout hash when index.json close also fails
When malformed index.json also failed to close, readCleanup composed the
error from the classified parse failure, which carries no observation,
so the completed oci-layout hash was dropped. Carry the read's partial
observation onto the primary before composing.
The close-fault test now selects the index.json handle by file identity
(dev and inode) rather than the second close call, and asserts the
fault landed there and the oci-layout hash survived.
* fix(oci): report malformed subject digests and count examined entries
A subject whose digest is not a valid OCI digest has no layout path, so
the walk returned without a finding and kept claiming it could prove
which blobs nothing references. It now records a malformed_blob_json
finding on the owner and marks the reference graph truncated, the same
as any other subject descriptor it cannot model. An absent subject with
a well-formed digest stays finding-free.
coverage.entries_examined counted only the entries the reader yielded.
It now takes the reader's examinedEntries from onCoverage, which
includes names the reader examined but omitted, and falls back to the
yielded count when the reader does not report one. An omission that
rewrites the traversal coverage keeps that count.
* fix(oci): keep the root index out of the blob traversal namespace
The root index was walked and prequeued under the traversal key of its
SHA-256 digest, which is the key of the blob path blobs/sha256/<hex>.
When a damaged nested index named that digest and the blob file there
held different index JSON, the queue skipped the blob as already walked,
so its manifests, configs and layers were never read and were reported
as unreferenced under complete coverage.
index.json now walks under its own traversal identity. A descriptor that
names its digest reads and walks the blob stored at that path like any
other nested index.
* fix(oci): diagnose conflicting media types inside referenced JSON
A referenced manifest or nested index may repeat its media type in its
own optional mediaType member. The walk ignored that declaration, so a
document admitted as a manifest but declaring the index type, or an
unknown type, produced no finding.
Check a present declaration against the descriptor type the walk
admitted it under. An unknown declared type is reported as
unknown_media_type; a known but conflicting type or a non-string value
is reported as malformed_blob_json. The members are still read, so the
other readable facts are kept, and an omitted mediaType stays valid.
The root index.json is admitted under its own declaration and is not
checked against itself.
* fix(oci): charge unknown declared media types to max_descriptor_bytes
A referenced manifest or nested index whose own mediaType is an unknown
string is quoted in an unknown_media_type finding. That text was retained
without spending the descriptor text budget, so many hash-valid documents
with long declarations could grow findings well past max_descriptor_bytes.
Charge the escaped declaration before the finding is recorded.
* fix(oci): mark the reference graph incomplete on document-type conflicts
A referenced manifest or nested index whose own mediaType names another
document kind, or an unknown type, was diagnosed but its blobs were still
judged with a complete reference graph. The walker reads only the members
of the admitted kind, so members of the declared kind, such as an index's
manifests inside a document admitted as a manifest, were never followed
and the blobs they name were reported as unreferenced_blob.
Mark the reference graph truncated for an unknown declared type or one of
a different document kind, so unreached blobs keep an unknown referenced
status. The readable facts are still reported. A declaration of the same
kind, such as the Docker manifest type on an OCI manifest descriptor,
reads the same members and keeps unreferenced status definite.
* docs(oci): state that unsupported digest algorithms skip hashing
The guide said every present referenced blob gets a SHA-256. Blobs whose
digest uses an algorithm other than sha256 or sha512 are not hashed; their
row reports hashed: false with null sha256 and sha512. Document that and pin
the null hash fields in the sha1 layer test.
* fix(oci): check the root index.json mediaType against the index kind
The root index.json skipped declaration checking because no descriptor
names it, so its own mediaType chose the admitted type. A root that
declared the manifest type or an unknown type was still walked as an
index with a complete reference graph, and blobs named by members the
index walk never reads were reported as unreferenced_blob.
Admit the root as an index: an index declaration of either family
stands, and any other declaration is checked against the OCI index type
like a nested index, which diagnoses it and marks the graph incomplete.
Also document that unknown declared media types quoted in findings
spend max_descriptor_bytes.
* Address review feedback
* Address review feedback
* fix(oci): check each referencing media type against a revisited document
A manifest or nested index reached a second time was skipped before its
mediaType declaration was compared with the new descriptor type, so a
conflict was reported or not depending on descriptor order. Each document
now records its declaration on first decode, and every distinct media type
a later reference admits it under is checked against it.
* fix(oci): detach redacted Env names from their bindings
With include_env_values false, each retained Env name was a slice of the
whole NAME=value string, so a long value stayed alive while the config
fact budget charged only the name. Redacted names are now standalone
copies, and a heap regression test covers eight 0.9 MiB values.
* fix(oci): keep only string mediaType declarations for revisit checks
The revisit cache kept each decoded document's raw mediaType, so a layout
of many manifests with large object declarations held all of them for the
whole walk while no byte budget charged them. A non-string declaration is
rejected whatever it holds, so the cache now keeps null in its place and
still reports it as not a string on each new referencing media type.
* Address review feedback
* Address review feedback
* Address review feedback
* fix(oci): preserve layout evidence on malformed targets
* Address review feedback
* fix(oci): diagnose schema versions and charge annotation records
Indexes and manifests whose schemaVersion is omitted, not a number, or a
number other than 2 now get a malformed_blob_json finding and partial
coverage, while their entries, config and layers stay readable.
Index entry annotations now spend max_descriptor_bytes as each
{name, value} record is built, charged at its serialized size, so many
short or empty annotations can no longer retain far more than their text
was charged for.
* docs(oci): describe annotation record accounting for max_descriptor_bytes
* Address review feedback
* fix(oci): wire summary delivery, parameter budget limits, and single-pass annotation parsing
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Matt Van Horn <mvanhorn@MacBook-Pro-10.local>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
|
||
|
|
68e1ec3e36 |
fix(package): declare the projected manifest scripts without prepare
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
30c87211f3 |
fix(package): leave the source-checkout prepare script out of the published manifest
The published manifest kept every development script, including prepare, which only patches release-please in a source checkout and does nothing in an installed package. npm 11 treats prepare as an install script, so "npm install -g rea-agents" warned that rea-agents has install scripts not covered by allowScripts and suggested allowing them. The staged package manifest now omits prepare. Installing the staged tarball with npm 11.19.1 lists only frida's own installer. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> |
||
|
|
51b3671b08 |
feat(artifacts): inventory Nintendo DS ROM binaries, overlays and file tables offline (#14664)
* feat(artifacts): inventory Nintendo DS ROM binaries, overlays and file tables offline Recognition now claims a Nintendo DS ROM from the cartridge header: stored logo CRC 0xCF56, unit code 0, 2, or 3, an ARM9 offset after the header, and a matching logo-area or header CRC. Inspection records those header facts on the root and lists arm9.bin, arm7.bin, overlays/<cpu>/overlay_<id>.bin, FNT-named data/<path> files, and unnamed fat/<id>.bin files as stored byte ranges. A checksum mismatch, a partial table, or a range past the end of the file leaves coverage unknown. Secure-area encryption, compressed overlays, and NitroARC archives stay undecoded, and the format is registered for inventory, extraction, and the docs. * docs: move the Nintendo DS ROM guide under guides/firmware * Address review feedback * Address review feedback * Address review feedback * fix: Compare NDS entry addresses and overlay facts * fix(artifacts): bound NDS path expansion and enforce expanded_bytes * fix(artifacts): omit NDS format declaration for ordinary filesystem files --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
d97b796076 |
fix(dwarf)!: bound PE COFF section-name decoding with max_structure_bytes (#14787)
BREAKING CHANGE: Oversized individual PE COFF long section names in inspect_dwarf_units now project an adjustable_budget refusal (boundary max_structure_bytes with details.limit) instead of fixed_ceiling (pe-section-name-bytes). |
||
|
|
47875ba073 |
fix(native)!: bound Android packed relocations with max_structure_bytes (#14788)
BREAKING CHANGE: Oversized Android APS2 packed relocation tables in inspect_native_initializers now project a memory/adjustable_budget refusal (boundary max_structure_bytes with details.limit) instead of capacity/fixed_ceiling (native-index-capacity). |
||
|
|
2bb086c87a |
feat(providers): retain native selection provenance in Evidence (#9668)
* feat(providers): retain provider selection provenance with session evidence The registry records how a deep provider became selected and why every other candidate was rejected, and binary_session exposes those facts for the active route. Evidence already carried provider identity, but nothing recorded which candidates the session evaluated, so a retained record could not explain why this engine produced the observation or what the alternatives were. Attach provider_selection to Evidence admitted by the session: the selection source and, for each evaluated candidate, its identity and version, selection state, availability and target-support outcome, and the stable rejection codes. The field is optional and excluded from semantic identity, following caller_input_path, so each admitted record stays attributable to the exact provider instance without changing observation identity, evidence IDs or replay. Copy only stable selection facts. Candidate diagnostics, remediation prose and target content stay in the session status projection instead of being repeated in every record. * style(domain): reformat the provider-selection assertion oxfmt --check rejected the three-line expect() call; the formatter's single-line layout is the canonical one, so Static checks failed only on formatting. * fix(evidence): keep a rejected record inside the Result boundary `recordEvidence` ran `withEvidenceProviderSelection` before handing the record to the ledger. That helper parses to seal the rebound envelope, so a tampered or otherwise invalid record threw a `ZodError` from the attribution step and never reached `EvidenceLedger.record`, which is where the declared `Result` is produced. `tests/boundary/mcp/processEvidenceIdentityMcp.test.ts:454` asserts `session.recordEvidence(tampered).ok === false` and fails on the throw. Authenticate the input first and return the ledger's own rejection for a value it would refuse anyway; attribution then only ever sees a record its reader accepts. * fix(binary): attribute imported records to the recording session Import replaces a same-ID record's presentation metadata, and provider_selection is part of that metadata. When runDirectAnalysis imports the provider's own bundle, the copy it rebuilds carries no selection, so the import erased the attribution the session had stamped and the caller kept an unattributed record instead. Attribute at both merge sites, where the session already authenticates everything it admits. A refreshed route after a failed switch can bind a different selection than the one the earlier binding held, so re-derive it there as the initial open does; spreading the previous binding kept the stale value. * fix(binary): admit record input before sealing it for attribution recordEvidence and the two bundle import paths seal Evidence through withEvidenceProviderSelection before handing it to the ledger. A sealed value skips the ledger's ordinary-JSON and heap-headroom admission, so a session with no authentication allowance accepted a mutable record and a large record was copied and traversed before the guard ran. Hold the caller's own value to that admission first, then attribute. The import paths also refuse with a Result instead of falling through to an unattributed import when admission fails. * fix(binary): re-attribute a sealed record without traversing it again recordEvidence now admits the caller's value before attributing it, but a record returned by evidenceForAnalysis has already been through that admission and is sealed. Running the ordinary-JSON walk and the heap-headroom check over it again repeats the work the ledger itself skips for a sealed value. Ask the ledger first: a value it holds is the admission it made, so the check costs one lookup. Only a value the ledger has not seen pays for the full walk. * fix(providers): return the recorded Evidence after import Import re-stamps session provenance onto the Evidence it records, but callers kept the pre-import copy, so retained selection attribution and cache metadata were dropped from what analysis reported. Read the recorded record back after a successful import, and leave an already-retained record as the ledger attributed it instead of re-deriving attribution from the caller's copy. * fix(providers): keep the caller's copy when re-attributing an imported record The merge with main brought in the unchanged-record path, where an import whose only change is display metadata now replaces the ledger's record. Re-attributing that incoming value put the session's provider selection on the caller's copy, so the import reported a record that differed from what the caller sent. Attribution now applies only to records the ledger does not already hold. The snapshot cache test now asserts the session's attribution explicitly instead of byte equality with the un-attributed source. * fix(providers): keep the caller's record when importing over a retained one The previous change skipped attribution for a record the ledger already held, which left the imported copy's own selection — missing or from another session — in place. Import replaces a same-ID record's presentation metadata, and provider_selection is part of it, so the session's attribution wins over the caller's copy while the caller's other display metadata is kept untouched. * fix(providers): attribute staged snapshot and unknown-mutation Evidence Address the open review findings on session provider provenance: - importAnalysisSnapshot merged the re-attributed bundle into the ledger but staged the snapshot's own bundle, so AnalysisSnapshotCache rebuilt replay bindings from records the merge had replaced. Hand the merged bundle back to the stage so replays bind to the attributed evidence. - recordResult recorded an attributed record and then serialized the caller's copy, so successful MCP responses omitted provider_selection while the ledger and exports carried it. Read the recorded Evidence back before delivery, as the direct analysis path already does. - recordUnknown and updateUnknown synthesized unknown-mutation Evidence without the active session's provider selection, so those exported records were unattributed. Thread the binding's selection through to unknownMutationEvidence, which is where the record is produced. * fix(providers): attribute the atomic Evidence-and-Unknown mutation record recordEvidenceWithUnknown synthesizes its own rea.residual-unknown-mutation record, so the selection the session threads into recordUnknown and updateUnknown never reached it. The atomic comparison workflows therefore exported one record without provider_selection, contradicting the guarantee that every admitted record carries the recording session's selection. Thread the active binding through the atomic method as well; analyst-authored mutation records still keep analyst-inference authority and gain only the session selection. * fix(evidence): require one selected candidate in provider provenance provider_selection carries no separate selected-provider id, so a reader can only name the recording session's provider when exactly one candidate claims the selection. The schema accepted any candidates array, so an imported bundle could re-export zero or several selected candidates under a stable Evidence id and consumers would have no way to resolve the provider. The recording paths always derive the selection from a single bound provider (AnalysisProviderRegistry selects one usable candidate, and SessionProviderRouter marks only the bound id selected), so the refine rejects only foreign input. * fix(evidence): adopt the recording session's selection on a duplicate record Recording an observation the ledger already holds under the same semantic ID returned duplicate and discarded the attributed object, so lookup and export kept the imported record's missing or foreign provider_selection. Replace the retained display metadata with the active selection on that path; semantic identity and the stored payload stay the same record. The provenance schema also accepted a selected candidate that is unavailable or unsupported, which no registry path can bind. Require the selected candidate to be available and supported so an imported bundle cannot re-export a selection that never occurred. * fix(evidence): keep retained display metadata and notify observers on duplicate Attribution replaced the whole stored record with the incoming copy, so a provider-produced duplicate without the caller-selected path, alias set or subject display erased the metadata the recording session retained merely to add provider_selection. Adopt only the display facts the incoming copy actually carries; omission is not deletion. Import keeps its documented replace semantics. The duplicate branch also returned before refreshEvidenceMetadata and #emitSnapshotChanged, so replay caches and snapshot subscribers kept the old metadata after a successful replacement. Treat a non-no-op replacement exactly as the import path does. * fix(artifacts): compare Evidence by identity across a replay session The composed-workflow test opened a second fixture, which writes its own temp artifact, so a replay record's subject path and the session-attributed provider selection no longer matched the snapshot copy. Both are display metadata outside the Evidence id; the provider call is what establishes the binding here, so compare the content the id commits to and assert the ids separately, which the test already does. Also apply the formatter to BinarySessionInvestigation.test.ts, which fails format:check on its own. * fix(server): deliver the retained copy that carries the session selection Recording stamps the active session's provider selection onto the ledger copy of a semantic ID. The tools that build or project their own Evidence value then delivered that unattributed copy, so the MCP response and the snapshot export disagreed for the same evidence_id: Ghidra reference and evidence flows, composed workflow overviews, analysis functions and the process capture tools all failed deep-equality against the retained record. Hand the delivered copy the session's selection when the ID is retained. Other retained display metadata, such as a caller path carried by an imported record, stays as the caller built it. * test(investigation): keep the session test within its lint and format limits Two checks on this branch failed for reasons the branch itself introduced: format:check wants the withEvidenceProviderSelection call in UnknownEvidence.ts wrapped at its argument list, which the branch's edit moved off. lint reports max-lines-per-function (152 lines, limit 150) for the "reobserves resource-scoped ..." case after the branch expanded two assertions in it. The provider-selection expectation is a fixed value, so it moves to a module-level constant and the case drops back under the limit without weakening either assertion. * fix(server): carry the session selection on the workflow copy delivered Commit |
||
|
|
188e2bd684 |
fix(website): honor validators and restore the implicit design system (#14768)
* fix(website): honor validators and restore the implicit design system - Route every worker answer that skips Markdown negotiation through the HTML fallback, so validators and ranges removed for the probe still apply. - Replace undefined classes with existing components and remove 27 CSS classes no page uses. - Express article text color as a token so component colors win in both themes, and use logical properties for text-flow layout in RTL pages. - Give an untranslated English fallback notice English direction. - Start the page navigation closed without JavaScript, dismiss it with Escape or an outside click, and keep later copy clicks, failed key imports and first animation frames from corrupting demo state. - Sync the theme bootstrap into the Notes fixture through a declared region. * fix(website): skip Markdown negotiation for requests with a body Markdown probing takes ownership of the caller request body. Methods other than GET and HEAD have no Markdown representation, so they reach the asset service once with the original body and validators. Co-authored-by: morluto <morluto@users.noreply.github.com> * fix(website): describe the homepage menu's closed start The disclosure has no open attribute, so without JavaScript it starts closed and the summary reveals the fragment links. The guide now matches that, including overlay dismissal. Co-authored-by: morluto <morluto@users.noreply.github.com> * style(website): wrap the worker precondition assertion oxfmt's 80-column width is what Static checks enforce. The If-Match comparison in the non-retrieval test exceeded it. 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> |
||
|
|
e99d0b2d86 |
fix(call-path): bound inline shortest-path enumeration (#4984)
* fix(call-path): bound inline shortest-path enumeration build_call_path could allocate every shortest path before response-budget enforcement. Count the exact total with a capped BigInt pass over the distance graph instead, and bound enumeration itself: max_paths (default 64) is a caller-selected count preference while a 2 MiB serialized paths-field budget is the resource bound, checked before each cited path is formed. The representation accounting measures each string with the rules JSON.stringify applies instead of charging six bytes per code unit, so an ASCII address or Evidence id is no longer billed six times what it writes, and the paths-array brackets the per-path accounting excludes are reserved. A path that serializes to 469,497 bytes is no longer refused as over the budget. Results report total_shortest_paths, total_shortest_paths_capped, paths_truncated and paths_limited_by_bytes so exact counts, representation limits and completeness stay distinguishable, and a found result whose single path cannot fit still reports the known path with byte-budget truncation. * fix(call-path): always return the first shortest path and measure cited paths The byte budget dropped a sole shortest path whose citations exceeded 2 MiB, although that path is linear in the supplied Evidence; only path count grows exponentially, and max_paths bounds it. Always return the first path and let the budget bound the paths after it. Measure each cited path with JSON.stringify instead of a hand-written estimator that duplicated citePath's shape and JSON escaping (it also charged U+007F-U+009F as escaped). The found result again requires at least one path. * refactor(call-path): measure cited paths from cached parts before assembling A candidate path was cited and serialized in full before the byte check, so a rejected path still built its representation. Move citation into CitedPathParts, which builds each node and edge record once per graph position with its exact JSON size. Enumeration sums a candidate from those parts and assembles only an accepted path, which shares the cached records. The path skeleton is measured from the same record constructor, so size and output cannot drift. --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
331808dcd2 |
fix(website): resolve tagged and latest release download links (#9238)
* fix(website): resolve tagged and latest release download links * fix(website): reuse parsed release asset identity --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> |
||
|
|
752f5769e2 | fix(android): allow filtering references by the unnamed package (#14752) | ||
|
|
4edb2c08ee |
fix(artifacts): explain ASAR PE signed-after-packing mismatches (#14702)
* 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. |
||
|
|
d5b4c4bb61 |
fix(verify): bound concurrent file reads in architecture and limit guards (#14720)
* 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`. |
||
|
|
192177f0c9 |
feat(artifacts): inventory and expand Android sparse images offline (#13244)
* 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> |
||
|
|
5257f40ffb |
feat(android)!: count class members in summaries and page them
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> |
||
|
|
32280113a7 |
feat(android)!: budget trace_android_references delivery
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> |
||
|
|
a16facbd9f |
feat(apktool)!: budget decode_android_resources delivery
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> |
||
|
|
0053ad589c |
fix(ghidra): pass inspected JDK to the Windows verifier (#10752)
* 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>
|
||
|
|
a00511e88e |
fix(mcp): paginate tools/list under the FastMCP SSE limit (#9142)
* 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> |
||
|
|
523d44f6d8 |
feat(browser): accept retained capture references in compare_web_captures
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> |
||
|
|
9ca9654500 | refactor(ci): share repository identifier validation (#14678) | ||
|
|
155715942e |
fix(limits)!: budget Rust dependency parser ceilings per call (#14666)
* 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> |
||
|
|
0eb19a395e |
fix(limits)!: let apktool and assetutil take producer_limits.output_bytes and type Android and process capture refusals (#14624)
* 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 |
||
|
|
4c9dca63a0 |
feat(native)!: give the Go and Rust readers max_structure_bytes and Rust max_wasm_sections (#14661)
* 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> |
||
|
|
6ae722a660 |
feat(limits)!: register producer.output_bytes as the session default for bounded producer output (#14648)
* 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 |
||
|
|
42ce0ea231 |
feat(browser)!: budget observe_web_execution delivery
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> |
||
|
|
0aca049128 |
feat(native)!: give the PE readers per-call text, entry and metadata budgets (#14659)
* 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 |
||
|
|
4d3fa5a080 |
feat(native)!: give inspect_native_exports per-call inventory, text and structure budgets (#14658)
* 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 |
||
|
|
1cc655bbc0 |
feat(native)!: give inspect_dwarf_units a per-call max_decompressed_bytes (#14660)
* 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 |
||
|
|
31297470ef |
feat(artifacts): back archive member counts with the artifact.member_count setting (#14650)
* 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. |
||
|
|
1badb6a8ae |
fix(native)!: report details.limit for remaining native reader budgets and make BEAM table rows adjustable (#14631)
* 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 |
||
|
|
43117a8ae0 | perf(ci): omit unused PR associations from timing queries (#14636) | ||
|
|
fb1b4c0fbb | perf(ci): resolve small pinned test batches directly (#14638) | ||
|
|
25c27df316 |
chore(deps): update lossless-json to 4.3.4 (#14634)
* chore(deps): update lossless-json to 4.3.4 * fix(capture): report locked JSON parser versions in evidence * fix(contracts): refresh capture examples from decoded evidence |
||
|
|
50d13f9f08 |
fix(native)!: report details.limit for native reader per-call budgets (#14622)
* 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. |
||
|
|
a5c71e8c88 |
fix(limits)!: let inspect_sqlite_database take producer_limits.input_bytes and type SQLite, Kuna and web-bundle refusals (#14627)
* 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 |
||
|
|
9edc95c512 | refactor(elf): share note reader limit error projection (#14644) | ||
|
|
d9b449d39c | refactor(verify): share canonical output schema assertions (#14640) | ||
|
|
0f358c2c97 | refactor(ci): share completeness guard grouping transitions (#14637) | ||
|
|
98d83d0787 |
feat(trace)!: give Playwright trace import per-call trace_limits (#14628)
* 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. |
||
|
|
e540cbdafd |
feat(native)!: give the native structural decoding allowance a per-call max_structure_bytes (#14626)
* 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 |
||
|
|
4f66985978 |
feat(metadata)!: give NTFS, Maven report and NuGet budgets typed per-call controls (#14629)
* 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. |
||
|
|
49e2eca4f9 |
feat(flutter)!: give Flutter APK admission per-call apk_limits (#14623)
* 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. |
||
|
|
3dae567185 |
feat(artifacts)!: give Deno, wxapkg and tar readers artifact_limits controls (#14620)
* 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. |
||
|
|
33e4e07dd0 |
fix(limits)!: report packet and signal producer budgets as details.limit and page discovery at its record budget (#14621)
* 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 |
||
|
|
2bb554e8b0 |
feat(cli)!: keep over-budget CLI results recoverable by default (#14610)
* 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 |
||
|
|
fdbfd85c23 |
refactor(domain): add CoverageAccumulator and ratchet ad-hoc completeness ternaries (#14589)
* refactor(domain): add CoverageAccumulator and ratchet ad-hoc completeness ternaries * fix(verify): parse ad-hoc completeness ternaries via TypeScript AST * fix(verify): use zero-dependency source-tokens scanner in completeness ternary guard * fix(verify): handle generic conditional types and arrow return-type colons in completeness ternary guard * fix(verify): track generic angle depth separately from comma boundaries and ignore member .extends * fix(verify): preserve generic angle depth across nested infer extends constraints * fix(verify): handle multi-substitution templates and chained parenthesized assertions in completeness ternary guard * fix(verify): stop skipTypeAnnotation at ASI newlines in completeness ternary guard * fix(verify): preserve multiline prefix type operators and disable ASI inside bounded contexts * fix(verify): include logical operators in expression continuations for completeness ternary guard |
||
|
|
f7641050c7 |
feat(views)!: page byte-entropy blocks and runs; budget xrefs and nupkg delivery (#14599)
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.
|
||
|
|
a156d20516 | refactor(verify): share Ghidra installation prerequisites (#14569) |