#14253 walks resource trees at their RVA whatever the directory Size
declares, so shrinking Size no longer made the 65,535-language table
malformed and the case reported the entry allowance instead. Point the
type directory's entry at a language directory outside the file-backed
resource bytes: its header cannot be read, which the reader reports as
malformed before counting rows against the allowance.
#14253 made the static PE readers read the optional header at its fixed
offsets and admit a declared directory count below 16, as the Windows
loader does. The Go MZ diagnostic fixtures still expected the older
refusals, so inspect_go_binary MCP and CLI diagnostics failed on main.
A short SizeOfOptionalHeader with an unknown magic at the fixed offset
is now an unsupported optional header, and a PE declaring one data
directory is admitted and keeps its build information, which the MCP
test now asserts.
The classification probe already scans every stream for an XML plist
prolog while it retains the prefix. Content classification discarded that
verdict and scanned the retained prefix again with a fresh probe, so each
entry paid for two decodes of its first chunk.
Classification evidence now carries the probe's verdict, and the
single-buffer `hasXmlPlistSignature` wrapper, which only that second scan
used, is removed. The probe also stops once the prolog scanner rejects:
fatal-decoder validation and byte accounting cannot change a rejection.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The classification probe decided the FAT header for the finished stream
size but kept it only when it parsed. Content classification then decided
it again from the same prefix and size, so every stream starting with
0xCAFEBABE, including each JVM class file, ran the class-file check twice.
Classification evidence now carries the finished header for every outcome,
with the slice headers beside it, and the classifier and root slice reader
use that decision.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The acceptance matrix started 22 CLI processes for 11 presentations and two
outcomes, most of which repeat the same recovery. Keep one real process per
encoder boundary (encodeLines, encode, YAML stringify, Markdown), presentation
owner (terminal, full envelope, token count and window) and outcome, plus the
SIGPIPE case. Check every presentation and outcome pairing in process through
createCliResultOutput, including the full-envelope, YAML and Markdown facts.
* fix(limits): make the IL2CPP pointer index adjustable and name ELF note budgets in details.limit
inspect_il2cpp_metadata accepts max_native_index_bytes (default 1 GiB,
needs binary_path) for the estimated ELF virtual pointer index. The index
refusal now carries its own limit name (virtual-pointer-index-bytes) and a
details.limit naming the parameter, its effective value, default and range,
instead of a fixed ceiling with no override. The binary file allowance and
the loader's fixed capacities are unchanged.
inspect_elf_notes and inspect_elf_debug_link refusals for max_file_bytes,
the decoded section-name budget and max_entries now set details.limit. One
domain-owned bounds object per operation feeds both the schema and the limit.
Two guards keep new in-code refusal limits owned:
- scripts/verify/fixed-ceilings.mjs (run by npm run lint) requires every
fixedAllowanceOptions, fixedProducerInputAllowance,
artifactFixedLimitFailure or inline fixedAllowance declaration to be
listed in fixed-ceiling-registry.json with its class (format, protocol,
representation, derived, forwarding, or pending with an issue) and reason,
and fails on stale entries.
- The untyped-budget-refusal architecture guard counts refusals whose only
recovery is an authored remediationAction, with a shrink-only baseline.
Fixes#14175
Part of #14234
BREAKING CHANGE: an inspect_il2cpp_metadata refusal at the ELF pointer index
reports reported_limits.boundary "virtual-pointer-index-bytes" and
details.limit for max_native_index_bytes, and no longer carries a
details.refusal fixed_ceiling.
* fix(limits): track IL2CPP's remaining fixed allowances with the native readers
* fix(limits): run the authored-only refusal count from lint, where TypeScript is installed
The architecture guards run before npm ci in CI and must stay
dependency-free, so the AST-based count moves into fixed-ceilings.mjs with
its own shrink-only baseline and --shrink-baselines.
* fix(limits): register producer and native wrapper ceilings by the allowance they name
fixedProducerInputAllowance names its allowance in its second argument, and
fixedNativeAllowance forwards its first, so the guard now reads each helper's
allowance argument and checks the callers of both.
* fix(limits): delete the authored-only baseline when its last count is removed
reconcileBaselineFile returns delete once no count remains, but the
verifier ignored it and the next run read the file unconditionally, so
--shrink-baselines could not finish. An absent baseline now reads as empty
and shrinking removes the file.
* fix(limits): record the advertised IL2CPP input schema with max_native_index_bytes
* feat(artifacts): report declared DDS, GLB, KTX and KTX2 headers and regions
Recognize DDS (including the DX10 extension), GLB, KTX 1.1 and KTX 2.0
by their header signatures and inventory them as containers. The root
format metadata carries the declared header facts. Each declared byte
region is a member that is hashed, classified and extractable: the DDS
payload; GLB JSON and BIN chunks and BIN-stored images; KTX key/value
data and mip levels; and KTX2 DFD, KVD, SGD and levels.
Nothing is decoded. A DDS payload is checked against the size derived
from its dimensions, mips, faces, layers and block size. Disagreeing
extents are reported in extent_check with unknown coverage rather than
refused, and regions past the end of the file are dropped, not clipped.
Structural header faults refuse as malformed input with the format and
offset.
Part of #14155
* fix(gpu-assets): bound GLB chunks and keep unexamined regions unknown
- Stop the GLB chunk walk at 1,024 chunks with unknown coverage.
- Refuse a GLB chunk that crosses the declared length, or a chunk table
that stops short of a physically present declared end, as malformed.
- Report coverage unknown when GLB images were not all listed: past the
image allowance, an unparsed JSON chunk, or an unresolved bufferView.
- Leave the DDS payload size unknown when rows are padded to a declared
pitch or more than 32 mip levels are declared, instead of deriving it
from different dimensions.
* fix(gpu-assets): report GLB images in URI-backed buffers as external
Only buffers[0] without a uri is the GLB BIN chunk. An image whose
bufferView sits in a buffer with a uri, or an image named by uri, is
stored outside the file; it was counted as an unresolved image and made
coverage unknown. Such images are now counted in external_images and
leave coverage complete; only views that resolve to no buffer stay
unknown.
* fix(gpu-assets): report KTX2 level-index failures at file offsets
The 64-bit level-index fields were read from a buffer that starts at file
offset 80, but an unsafe value reported its index-relative position.
The reader now takes the buffer's file base and reports base plus
position, so every failure offset is a file offset.
* fix(gpu-assets): count a GLB image as external only for a URI string
An image or buffer whose uri is present but not a string, and an image
with neither a uri nor a bufferView, were counted in external_images and
left coverage complete without an established source. Only a URI string
now marks a source external; other sources stay unresolved and keep
coverage unknown.
* fix(pe)!: share one loader-equivalent PE header owner across static readers
Resources and certificates now admit headers through readPeImage, and
resources map RVAs through the shared file-backed mapping. The owner reads
the optional header at fixed offsets, caps data directories at 16, and lets
a PE signature at e_lfanew override a DOS relocation table. Export, import,
TLS and resource directories are read at their RVA whatever Size declares.
Disregarded declarations are reported in header_anomalies.
BREAKING CHANGE: import and delay-import walks continue to the null
descriptor past a short directory Size instead of stopping with a
malformed_entry issue, and inspect-pe-resources reports an unsupported
optional-header magic as unsupported_target.
* fix(pe): keep valid DOS relocation tables owning e_lfanew
Only a relocation table that describes no DOS load module yields e_lfanew
to a PE signature; update MZ/PE conformance to the shared owner.
* fix(pe): walk resource trees within file-backed bytes and cite TLS reads
The resource walk is bounded by the file-backed run from the directory RVA
rather than its Size, and a Size that ends before the bytes walked is a
directory_size_below_structure anomaly. The TLS result carries
structure_location for the structure read past a short Size, and Evidence
cites it.
* test(pe): use a resource cycle as damage now that a short Size is read
* fix(pe): read resource trees past an oversized Size and keep damaged MZ headers malformed
An oversized resource Size is reported without requiring its unused bytes
to map. A Windows-header candidate is malformed when the DOS module is also
invalid, and the guide states that a valid DOS relocation table owns
e_lfanew.
* feat(cli): add list-procedures to produce function-matching inventories
match-native-functions accepts only list_procedures Evidence, and no CLI
command produced it. Expose the list_procedures contract as
rea list-procedures, with complete or summary-plus-bundle delivery, and
name that producer when the matcher refuses another record such as a
filtered search_procedures result.
Fixes#14185
* test(cli): assert the bundled inventory keeps its fixture rows
* feat(desktop)!: recognise native releases and rank application probes first
inspect-desktop-application returned nothing for native Qt or SDL
releases, gave Godot candidates no probe, and listed every BCL facade of
a self-contained .NET release as an equal inspect_managed_artifact probe.
- A native candidate names the shallowest main executables when no
other runtime is recognised. Its PE probes are inspect_pe_imports and
inspect_pe_resources.
- Component markers name Qt, SDL, wxWidgets, GTK and the MSVC runtime
from the files a release ships.
- Each Godot pack carrier gets an inspect_artifact probe.
- Probes carry a priority. Assemblies with a matching runtimeconfig,
deps.json or pdb come first, and runtime facades are counted once in
deferred_probes instead of probed one by one.
BREAKING CHANGE: the desktop application result adds the native family,
the ui-framework and runtime-library component categories, new probe
operations, a required probe priority and deferred_probes.
Fixes#14173
Refs #14179
* fix(desktop): select Godot packs with open_binary, summarize deferred probes and match Unix wxWidgets names
inspect_artifact reads the active target and takes no path, so a Godot
pack probe now selects its carrier with open_binary and names
inspect_artifact as the follow-up, as the ASAR probe does. The default
summary carries deferred_probes, the release-audit fixtures include the
field, and the wxWidgets marker accepts libwx_*.so and .dylib names.
* fix(desktop): read Unix mains without host executable marking and describe resource probes accurately
Windows cannot mark ELF or Mach-O files executable, so the reader also
reads headers of Contents/MacOS entries and extensionless root files.
The inspect_pe_resources probe now describes the resource-tree inventory
it returns.
* fix(snapshot): replay every one-shot Ghidra read and say when a live result cannot replay
One-shot CLI --snapshot replayed only Ghidra decompile: the documentless
exception was limited to procedure_pseudo_code, and DirectAnalysis passed
the one-shot context only for that operation. Every read-only Ghidra
query of the call's own Program now records its replay entry, keyed as
before by target identity, provider profile, operation and parameters.
Providers that declare their results live (Hopper, IDA, Kuna) still run
every call. With --snapshot, their result now carries a limitation that
says it was saved but cannot replay, and why.
Fixes#14182
* fix(snapshot): disclose unsaved function, workflow and skipped replay entries
The not-saved notice covered only direct observations, and only by
policy. rea function and composed workflows now report it too, and the
notice also follows what recording will actually keep: a result with
reference truncation or classifications, a full cache without this
query, or a session whose metadata write invalidated its snapshot. The
cache answers that question from the same predicate its record uses.
* fix(snapshot): word composed-command notices for recomposition and unwritten snapshots
decompile-all and trace-native-ui-action never write the snapshot, so
their notice now says nothing was recorded. Other composed commands say
the answer is composed again on repeat, starting the provider only for
source reads the snapshot lacks. The snapshot write and the notice share
one set of unwritten commands.
* test: prune redundant and superseded tests
Remove two boundary copies of the zstd.max_frames section-name refusal for
binary hardening and ELF unwind ranges. The public MCP frame-allowance test
already checks both operations; it now also asserts the setting's minimum
and maximum, which the copies carried.
Drop the trailing inspect-managed-members malformed-bytes check from the
managed comparison CLI test. The shared parser-failure CLI table covers that
projection for every managed reader.
Index the GPU ELF fixture's section-name offsets once instead of searching
the string table per section. The SHN_XINDEX fixture has 65,539 sections, so
the per-row search was quadratic. The generated bytes are identical.
* test: bound the GPU fixture's section-name suffix index
Indexing every suffix of every section name made a 65,536-byte name cost
quadratic work. Index only suffixes up to 256 bytes and search the table
directly for longer names; both give the first occurrence the per-row
search used, so the generated bytes are unchanged.
* fix(macho)!: report a FAT header or table cut off by the file's end as truncated
The universal Mach-O container reader measured the file's size but
reported a FAT header shorter than 8 bytes as malformed, and a FAT table
that runs past the file's end as not FAT at all. Callers could not tell a
cut-off download from corrupt bytes.
readFatContainerHeader now returns a typed truncated state carrying the
measured file size and the length the header or table needs. A CAFEBABE
count that reads as a JVM class version stays not FAT, because a short
class file is not evidence of a universal file. Universal image
selection, the native container reader and the lipo-selected slice
resolver raise that fact as a truncated ParseFailure with an extent, and
the malformed-target projection reports it as details.available_bytes and
details.required_bytes. Complete but corrupt FAT data (zero count,
overlapping slices, slices inside the table) stays malformed.
BREAKING CHANGE: inspect_go_binary, inspect_rust_binary,
inspect_dwarf_units, inspect_native_initializers,
inspect_native_dispatch_metadata, the IL2CPP binary readers and the
macOS provider's lipo-selected slice reads now report a FAT header or
table cut off by the file's end with details.format_failure "truncated"
(previously "malformed", or an unsupported or not-universal result for a
table past the end), plus details.available_bytes and
details.required_bytes.
* test(macho): type every format-owner row with its asserted format failure
* fix(doctor)!: emit each check once and classify passing checks healthy
Audit-wide doctor reports copied every check into both scope_checks and
checks. The audit-wide report now has no scope_checks, since every check
in checks is in scope. Explicit scopes keep scope_checks.
The CLI treated an unhealthy report like an error payload, so
--filter-output and the token count for a filtered selection were ignored
when healthy was false. An unhealthy report is now a completed result
for output controls. The exit status stays 1, and the JSONL and
full-output envelopes still mark it failed.
The provider check port typed classification as a failure class for every
check, so Ghidra, IDA, JADX and Kuna attached unsupported_host,
config_drift or runtime_failure to passing rows in providerInspections.
DoctorProviderCheck is now a union: a passing check is healthy with no
code, and only a failing check carries a failure class.
JADX and Kuna reported their not-configured state with the remediation
text as the reason, so detail repeated remediation. The reason now states
the observation (REA_JADX_MCP_JAR or REA_KUNA_COMMAND is not set).
BREAKING CHANGE: audit-wide doctor reports omit scope_checks; read
checks. Passing providerInspections checks report classification
"healthy".
Fixes#14166Fixes#14200
* fix(doctor): filter unhealthy reports in full output and keep repairs
--filter-output still skipped an unhealthy report under --full-output,
because the envelope's failure payload was chosen before the filter. The
completed-report decision now has one owner in writeResult: it selects
from the report first and uses the selection as the envelope's error, so
the envelope keeps ok: false. JSON Lines keeps its documented framing of
a classified failure as one whole error record.
Shortening the JADX and Kuna not-configured reasons left their analysis
errors without a repair step, because those errors copied only the
reason. They now pass the configuration owner's existing remediation
(jadxFailureRemediation and the Kuna configuration remediation) as the
remediation action.
The installation guide now limits the healthy-classification statement
to provider checks and names the registration_environment exception.
* fix(kuna): accept a remediation action on capability gaps
* fix(cli): keep an unhealthy report failed when its selection drops the verdict
Under --full-output, the selected value doubled as the failure marker, so a selection that was missing (an audit-wide report has no scope_checks) made the envelope report ok: true. writeResult now decides failureReported before selection and uses the selection only as the payload. A missing or verdict-free selection keeps ok: false, and an invalid filter is still reported as a filter error.
* fix(release-exposure)!: omit checks that cannot apply to the detected formats
audit-release-exposure always returned all 15 checks. On a single PE it
reported Mach-O hardened runtime and the Android manifest as not_assessed,
and the four Electron fuse checks as not_applicable, each with a next probe
for another format. Agents following those probes would run Mach-O,
Android, or Electron tools on a Windows image.
The report now omits a check that cannot apply and names it in
coverage.inapplicable_checks. Applicability comes from the reader's format
facts: native image formats, the target kind, embedded package formats,
and whether a native image may have gone unread. A check stays whenever a
member it could apply to may be unread. checks and inapplicable_checks
always split the fixed table, in order, and the report schema enforces it.
On a public x64 SDL2.dll the JSON report drops from 10,451 to 6,256 bytes.
BREAKING CHANGE: release-exposure checks no longer use the not_applicable
status, and summary.by_status has no not_applicable count. A check that
cannot apply is absent from checks and listed in
coverage.inapplicable_checks.
Fixes#14163
* fix(release-exposure): keep format checks when a package may hold them
A selected executable that embeds a package, such as a .NET bundle or
PyInstaller archive, may store native images and other members that the
audit does not read. Applicability ignored those for executables, so a PE
bundle with a packaged Mach-O helper lost macho.hardened_runtime and its
inspect_signature probe.
Unread or packaged native images and embedded packages now keep the
Mach-O, native hardening and Android checks for every target kind. Direct
schema cases cover duplicate, overlapping, missing and reordered splits.
* fix(release-exposure): decide native applicability from unread members, not package presence
A fully read ASAR or other package with no native member regained native.hardening, macho.hardened_runtime and android.manifest, because any embedded package format counted as an unread member. Applicability now follows nativeImagesMayBeUnread, which already covers native images stored inside a package that went unread. Android stays limited to directory and file selections.
* fix(tests): expect the path reason for non-file directory entries
#14225 changed DirectoryArtifactReader to refuse a non-file entry with the
path reason instead of format, but this boundary test still expected
format, so it fails on main's Windows lanes.
* fix(tests): expect #14225's reader reasons in the remaining boundary tests
#14225 moved non-regular inputs (a FIFO inventory root, a symlinked ZIP,
a non-regular or substituted dylib) to the path reason, impossible
descriptor byte counts to io, and invalid chunk sizes to an internal
invariant violation, but these tests still expected format, so main's
shards 6, 8, 10, 11 and 12 and the portable and Windows lanes fail.
* fix(gpu)!: dispatch AMDGPU note metadata on the declared ELF ABI
inspect_gpu_code_objects read every AMDGPU ELF note under the HSA schema,
so a well-formed PAL-ABI code object was reported malformed ("no valid
kernel array") while the same object without metadata was unsupported.
The AMD ELF metadata owner now reads EI_OSABI once and selects the note
schema from it. HSA (64) keeps the existing kernel path. PAL (65) decodes
amdpal.pipelines into a new amd_pal_metadata object field during kernel
analysis: the version, and per pipeline its name, type, API, API shader
stages with their hardware mapping, and each hardware stage's entry point,
entry point symbol, SGPR/VGPR/AGPR counts, wavefront size, LDS and scratch
sizes. PAL register maps use unsigned integer keys, which the MessagePack
reader now admits for that schema only. Mesa3D (66) and unrecognized ABIs
are unsupported with their e_flags target and unexamined notes. Corrupt PAL
MessagePack or container shapes remain malformed.
BREAKING CHANGE: amd_target_metadata gains required os_abi and abi fields,
GPU objects gain a nullable amd_pal_metadata field, and PAL-ABI objects
report complete, partial or unsupported instead of malformed.
Fixes#14154
* chore(gpu): regenerate the inspect_gpu_code_objects advertised schema summary
The objects view fields selector derives from the GPU object schema, so the new amd_pal_metadata field changes the advertised input compact schema.
* fix(gpu): bound AMDGPU note expansion per code object and refuse binary maps
The decoded-value allowance is now shared across all of a code object's notes, so PAL pipeline facts expanded during discovery stay bounded. MessagePack binary values are no longer accepted as maps for PAL pipelines, stages or HSA kernel and argument rows.
* fix(managed)!: report an unsupported signature as partial metadata, not malformed
The refusal path already treats `unsupported-signature` as a valid form
outside decoder coverage, but `managedMetadataFailureStatus` still called
it malformed. One predicate, `isManagedCoverageGap`, now owns that split
for both the refusal and the inventory status.
Value retention no longer reads the inventory status: one value's
unsupported signature is still retained locally, while a budget or an
unsupported metadata layout still stops the whole read.
BREAKING CHANGE: when a managed reader stops on `unsupported-signature`,
`metadata.status` is `partial` (was `malformed`) in managed artifact,
member and native-boundary inspection, and the artifact
`classification.status` is `managed` (was `malformed`). The field names
and enum members are unchanged.
* fix(il2cpp)!: refuse a reused or non-MethodDef token as malformed metadata
`invalid-method-token` covered two facts. A MethodDef row reused within
one image, or a token that is not a nonzero MethodDef row, is in the
metadata's own records; a row past the module's method pointers is a
disagreement between two files that both parse.
The metadata reader now checks each image's tokens while reading link
facts and raises `invalid-method-definition-token`, which the provider
already refuses as a malformed target at the metadata's path. The linker
keeps `invalid-method-token` for the cross-file range check only and drops
its own duplicate scan.
BREAKING CHANGE: a duplicate or non-MethodDef method token found while
linking is `unsupported_target` with `details.path` the metadata file,
`details.format` `il2cpp-metadata`, `details.format_failure` `malformed`
and `details.reason` starting `invalid-method-definition-token:` (was an
`invalid_request` link conflict naming `path` and `binary_path` with
reason `invalid-method-token`). A token past the module's method
pointers keeps the conflict and the `invalid-method-token` reason.
#14225 moved both refusals to ArtifactReaderFailure("path") at their
producers (StableRootArtifact and the ZIP source admission). The two tests
still expected "format" and fail on main.
Three formats had their own error mappers that still reported a selected
file's corrupt bytes as an invalid_format path issue (invalid_request):
managedInspectionInputFailure, Il2cppMetadataProvider and the Mach-O slice
selection mappers. Each now projects its format owner's own failure through
AnalysisMalformedTargetError at the path of the file whose bytes are at fault.
- Managed PE/CLI: a broken rule is a malformed pe-cli target with the
reader's scope and offset; unsupported-metadata and unsupported-signature
are unsupported targets; resource limits stay with their producer.
- Universal Mach-O: the container reader raises a ParseFailure once
(malformed, truncated where it measured the end, unsupported from the
container's own category), and requireSelectedNativeImage(FromReader)
project it at the universal file's path. An unknown or ambiguous
architecture stays invalid_request on the architecture field.
SliceSelectionInput.pathField is removed.
- IL2CPP: metadata and binary format failures each name their own file. A
binary that parses but does not link to the metadata is a link conflict:
invalid_request with invalid_value issues on both path and binary_path,
no input-contract recovery, and the partial observation keeps both file
identities. Neither file is called malformed.
BREAKING CHANGE: inspect_managed_artifact, inspect_managed_members,
inspect_managed_native_boundaries, compare_managed_members,
inspect_il2cpp_metadata, inspect_go_binary, inspect_rust_binary,
inspect_dwarf_units and inspect_native_initializers report corrupt or
truncated target bytes as code unsupported_target with details.path,
format, format_failure and reason instead of invalid_request with an
invalid_format issue. IL2CPP link conflicts list both path and binary_path
with reason invalid_value instead of one invalid_format binary_path issue.
ArtifactReaderFailure("format") covered two different facts: target
bytes that violate their format, and a selected path that is not a
regular file. The shared selected-file projections
(projectOwnedArtifactInputFailure and classifyProviderFailure's file
step) mapped both to invalid_request with an invalid_format path
issue, so corrupt BEAM files and PE certificate table bodies were
reported as caller argument errors.
Split the reason at its producers:
- Path-kind refusals now use the existing "path" selection reason:
regular-file admission, the stable root, directory, ZIP, ASAR and
PyInstaller entries, dyld inputs, the UEFI flash source and extract
occurrence selection. They stay invalid_request.
- The BEAM parser and the PE certificate table parser raise the format
owner's ParseFailureError (malformed or truncated, format "beam" or
"pe-certificate-table"). A short file that does not start with FOR1
is malformed, not truncated. A PKCS#7 name encoding the decoder does
not implement is unsupported, not malformed.
- Short reads inside an admitted range (kernel module, kernel build
config, ELF unwind ranges) are integrity read-coverage failures,
because the file changed during the read.
- Internal contract breaks (stream chunk size, a non-Buffer keyed
archive chunk) are invariant violations; an impossible descriptor
byte count is an I/O failure.
The shared projections now treat only "path" as a selection error.
They take the malformed-target facts from the reader failure's own
parseFailure, which artifactParseFailure sets once from the owner's
ParseFailureError and rebuilt failures keep through primaryFacts.
ArtifactOperationError carries the same facts, so inspect_artifact
refusals (for example Android boot images) now include
details.format_failure, format, offset and field. Android boot entry
planning raises the format owner's malformed failure, and the
redundant shortcut and API-contract format branches are removed.
BREAKING CHANGE: callers that parse `code` see unsupported_target
instead of invalid_request for malformed or truncated bytes from
inspect_erlang_beam and from the inspect_pe_certificates certificate
table body. Truncated reads of a file that changed during
inspect_kernel_module, inspect_kernel_build_config and
inspect_elf_unwind_ranges now report artifact_changed. inspect_artifact
malformed and truncated refusals gain details.format_failure and
details.format. Existing fields are unchanged.
Replace recovery and message substring checks with the limit, reported_limits, recovery, diagnostics and issue-path facts that drive the behaviour. Derive WABT banners, pwntools, WASM, Go, model and PE section-name allowances from their owning constants, and drop obsolete-phrase bans that a structured assertion now covers.
* fix(artifacts): route native images to static readers and name their architecture
inspect_artifact sent every PE, ELF and Mach-O root straight to
open_binary (PE first to inspect_managed_artifact, whatever its CLI
header) and left architecture null on every inventory node and on the
inspection subject, although the header parsers already know the CPU.
Inventory classification now returns the header's CPU family with the
format, from the same ELF, Mach-O and PE record parsers target admission
uses, so each thin image node (including universal slices and archive
members) names its architecture; an undecoded machine stays null, and a
universal container node names none. When the inventory root is the
open target's own bytes, its Evidence subject carries the architecture
target admission parsed, as it already carried the selection.
Native next probes now list the provider-free readers for the format
before open_binary: PE imports, exports, load config, resources,
hardening and release exposure; ELF dependencies, exports, hardening and
release exposure; Mach-O inspect_macho, inspect_signature, hardening and
release exposure. inspect_managed_artifact leads only when the PE
declares a CLI header, is omitted when it declares none, and stays a
conditional probe for directory members whose declaration is unknown.
The PE hypothesis that inventory cannot tell managed from native is kept
only for that unknown case.
Fixes#14157
* fix(artifacts): recognize standalone formats and route them to their readers
inspect_artifact refused SQLite databases, Windows shortcuts, CPython
pyc files, flattened devicetrees and UEFI NVRAM variable-store volumes
as unsupported binary formats with no next probe, although dedicated
REA tools read each of them. The shared recognizer table, which target
admission and inventory classification both walk, had no entry for
them, and the UEFI admission probe required an FFS2/FFS3 volume even
though the UEFI inventory reader already retains other volumes.
Add sqlite, windows-shortcut, python-pyc and devicetree as artifact
formats recognized by their owners' detectors:
- The SQLite header moves to src/domain/sqliteFormat.ts. Desktop state
detection now uses it too.
- The ShellLinkHeader size, LinkCLSID and GUID formatting move from
the shortcut parser to src/domain/windows/windowsShortcutHeader.ts.
- A pyc must carry a pinned CPython magic. CR LF framing alone is not
enough.
- A devicetree's header must pass the devicetree header parser after
FIT has declined it. A malformed header is refused with its reason.
UEFI admission now accepts any aligned, checksum-valid firmware volume.
Inspection routes each format to its reader as an artifact-bytes next
probe: inspect_sqlite_database, inspect_windows_shortcut,
inspect_python_pyc, inspect_devicetree and inspect_uefi_firmware. The
reader is named once, in the domain inspection projection. Formats no
recognizer claims still refuse as before; their raw inventory is #14151.
Fixes#14174
* fix(artifacts): keep native readers for executables that carry a package
An executable whose contents inventory as an embedded package (Godot
PCK, PyInstaller, Node SEA, Deno, Bun or a .NET single-file bundle) is
also a native image. Previously inspection proposed only the package
reader and hid the native side.
The inspection now takes the native image facts that target admission
parsed for the root's own bytes, not only the PE CLI-header flag. When
inventory reads those bytes as a package, the package reader comes
first, then the carrier's static readers, then open_binary.
A probe names exactly one operation, so the static readers cannot be
grouped into one entry without changing the advertised schema. They
stay separate rows and share one short rationale, because each tool's
description already says what it reads. Each format's reader list is
now a table.
* test(targets): add vocabulary fixtures for the standalone artifact formats
The sqlite, windows-shortcut, python-pyc and devicetree target formats
had no TargetFixtures entry, so the exhaustive fixture map failed to
typecheck and the persistence and projection cases never covered them.
* fix(artifacts): bind a deep provider for managed PEs only at a native boundary
A PE declaring a CLI header recommended open_binary with generic
function-level advice, so pure managed assemblies were steered to a
deep native provider. Its rationale again requires managed inspection
to report a native or mixed boundary, and a PE whose header is unknown
states the same condition.
* test(artifacts): narrow the subject to a file before reading its format
* test(artifacts): assert universal slice inventory per host and prune probe snapshots
The universal Mach-O test assumed slice inventory on every host, but the
slice reader runs native lipo and is skipped off macOS, so it failed on the
Linux test shards and portable tests. The test now selects the host platform
through a HostPlatform mock: the slice inventory case runs only on a macOS
host, and the other-host case asserts unknown container coverage with only
the file occurrence on every host. Both keep the selected-slice subject
architecture and static reader order.
Pruning in the probe tests:
- Merge the ARM64 PE, ELF and Mach-O single-image probe tests into one
parameterised case that asserts subject and root-node architecture, the
complete static reader list, and that open_binary is the only probe beyond
artifact bytes.
- Remove the Deno carrier ordering case from the native image probe test;
the Deno CLI acceptance test covers the same three carriers through the
public workflow and now asserts the same ordering and authority facts.
- Replace full next-probe arrays in the Bun, Deno, dotnet-bundle and
PyInstaller CLI/MCP tests with a shared carrier assertion: package readers
lead, the carrier's format reader is present, and open_binary is last and
the only non-artifact-bytes probe. The per-format reader list stays owned
by the native image probe test.
Malformed-header (undecoded machine), unknown architecture and package
subject identity coverage are unchanged.
* test(artifacts): fold the SQLite routing case into the standalone format table
The SQLite case asserted the same format, subject and single artifact-bytes
probe as the table above it and differed only in how the file is created.
Each table row now creates its own input, so the SQLite database joins the
table. The resembling-pyc refusal case is unchanged.
* fix(desktop): generate the exported reader's SQLite header from its owner
The exported Python reader kept its own SQLite header literal after
SQLITE_HEADER gained a shared owner. Generate it from that owner, as the
template already does for ZIP_SIGNATURES. Desktop fixtures that only need
a SQLite file now build it from the same constant; format-detection tests
and the tests that run the generated Python keep the literal header as an
independent check of the owner and the generated code.
* fix(errors): refuse malformed target bytes as a target, not invalid input
parseFailureAnalysisError is the shared owner that turns a byte-format
parser's ParseFailure into a public refusal. It mapped malformed and
truncated bytes to an AnalysisInputError on the path field. The envelope
then reported invalid_request, with inspect_input_contract recovery and
"correct the listed fields". The arguments were valid; the target bytes
were the problem. Readers that wrap the ParseFailureError in an
ArtifactReaderFailure, and ArtifactOperationError reason=malformed, were
classified the same way.
Add AnalysisMalformedTargetError. It keeps the parser's kind, format,
detail, offset and field, and projects as unsupported_target with
details.format_failure. Its recovery is to choose another operation or a
well-formed copy of the target. Route both parser entry points through it
and reclassify ArtifactOperationError reason=malformed. Argument and
selection errors (missing files, directories, symlinks, JSON arguments)
stay invalid_request.
Fixes#14170
* docs(maven): describe duplicate variant names as malformed metadata
Duplicate Gradle variant names go through malformedInput, which now
reports unsupported_target with details.format_failure: malformed.
Point the earlier statement at that section instead of the old
invalid_format code.
* test(errors): expect malformed-target refusals from CLI byte-format readers
Truncated IPS, ELF, PE and shortcut bytes now project as unsupported_target with format_failure=malformed. Update the CLI acceptance cases that still expected invalid_request.
* fix(errors): keep a cancelled read a cancellation whatever its abort reason
projectOwnedArtifactInputFailure read the reader failure's cause without
checking the reader's own reason. A cancelled read carries the caller's
opaque abort reason as that cause, so aborting with a ParseFailureError
turned the cancellation into a non-retryable malformed-target refusal
before the shared cancellation projection ran. Only a reader whose own
reason is malformed or truncated now yields a malformed target.
The ELF dependency checkpoint cancellation test now also aborts with a
parser failure as the reason, through the public provider read.
* test(pe): expect malformed-target refusals from the PE filesystem boundaries
Short non-PE bytes now refuse the target rather than the request field.
The missing-file, directory, symlink and child-path controls keep their
caller-input expectations.
* fix(elf): refuse malformed ELF note bytes as a target, not invalid input
inspect_elf_notes shared this PR's root cause: its parser reported
structural violations as a reader "format" failure, which the shared
stable-artifact projection treats as a request-field error, so truncated
or non-ELF bytes still returned invalid_request. The parser now raises
malformed or truncated ParseFailureErrors, which the shared projection
reports as a malformed target with format_failure and format facts.
Consumers that interpreted the old reader reason now use the parser's
facts: debug-link build-id observation keys on ParseFailureError kinds,
and binary hardening drops its rewrap of note-parser format failures
into BinaryFormatFailure, which the parser's own failure supersedes.
* test(errors): own the byte readers' malformed-target projection in one CLI table
The PR repeated the same malformed -> unsupported_target mapping in a
dedicated CLI test per command and again in each provider's filesystem
boundary test. The stable-artifact parser-failure CLI table now owns it:
every byte reader it covers (now including ELF dependencies, debug link,
unwind ranges and native initializers) refuses a truncated ELF header as
a malformed target with operation, path, format_failure, retained file
identity and no argument recovery.
Removed as redundant with that table: the truncated or non-ELF/non-PE
CLI tests for ELF debug link, dependencies, unwind ranges and notes,
native initializers, and PE imports and certificates; and the
malformed-file blocks in thirteen filesystem boundary tests, which keep
their directory, symlink, missing-file and child-path controls. Format
specific refusals (a truncated IPS body, a wrong shortcut CLSID, DWARF
units) keep their own tests, as do the owner tests in
parseFailureAnalysisError and ArtifactOperationFailure.
* test(errors): expect malformed target bytes as unsupported_target in acceptance tests
The first full acceptance run of this PR found five expectations still
asserting invalid_request for target-byte failures: the timing test's
truncated ELF, a truncated DTB, duplicate Rust dependency JSON, and PE32
and PE64 load-config images without an MZ header. Assert the
unsupported_target code, with format_failure malformed where the
non-MZ PE path matches the already-updated PE imports test.
* fix(cli)!: accept only the documented kebab-case option spelling
REA's argv parser kept incur's second spelling of every option: the
camelCase schema key (`--maxRows`) bound like the documented
`--max-rows`, although help, completion and manifests list only the
kebab-case form. That hidden alias let wrong spellings survive in the
guides.
The parser now binds only the documented flag. A schema key spelling,
including its `--no-` negation, fails as a typed `flag_spelling`
failure rendered as PARSE_ERROR that names the documented flag:
"Unknown flag: --maxRows. Did you mean --max-rows?". Completion no
longer resolves camelCase option names. The sensitive-value scan still
treats `--sensitiveValue` as a declaration so its value stays redacted
from the refusal.
Guides, the inspect-api-contract option description and tests now use
the kebab-case flags.
BREAKING CHANGE: camelCase option spellings such as `--maxRows` or
`--dryRun` are refused; use the kebab-case flag that `--help` lists.
* test(cli): exercise invalid dry-run values with the documented flag spelling
The invalid dry-run cases in strictPositionals and cliSetup appended
--dryRun=false as a later valid override. The parser now refuses that
schema key spelling before it validates the dry-run value, so each case
failed on flag spelling and never checked that a later override cannot
hide an earlier invalid value. The override is now --dry-run=false, and
each case asserts the dry-run failure message, so a spelling refusal can
no longer satisfy it.
The --dryRun=abc case in cliSetup's malformed-value list is removed: it
was the --dry-run=abc case under a spelling the parser now refuses
before reading the value, and argvParser.test.ts owns that refusal.
* test(cli): keep one public case for the flag spelling refusal
cliOptionAliases repeated argvParser's three token shapes (bare, inline
value, negation) through the full CLI. The parser test owns those shapes
and asserts the structured flag_spelling failure with its flag and
documented spelling; the CLI keeps one case for the documented
PARSE_ERROR projection, whose message is part of the CLI contract.
The camel-case sensitive-value case also dropped its trailing
--no-<literal> token: the spelling refusal stops parsing before it, so
the token no longer exercised anything.
* docs: correct, re-verify and prune getting-started, provider and reference pages
Re-verify the macOS arm64 native decompiler build, the m68k lane and the
RISC-V lane on Ghidra 12.2, check RISC-V language facts against the 12.2
SLEIGH sources, document the verify:ghidra demangler prerequisite, remove
duplicated IDA and mcp add paragraphs, prune release-history narratives and
the stale 6.4.0 registry checkpoint, clarify Godot carrier classification,
correct the packet-summary and SQLite host rows, and say in the
inspect-binary-layout CLI description that it is ELF-only on Linux x64.
* docs(reference): add a canonical producer_limits section
Derive the accepted fields and defaults per operation from the producer
limit schemas and describe how an exhausted budget reports its per-call
control.
* docs(reference): split producer_limits defaults by operation and document the pwntools exceptions
Field and decoder discovery reject input_bytes, and packet field search
defaults output_bytes to 32 MiB. For pwntools, diagnostic_bytes bounds
combined stdout and stderr while output_bytes bounds the reply file, and
an oversized input reports the pwntools.max_input_bytes setting limit
rather than the producer_limits parameter shape.
* fix(pwntools)!: report a per-call input ceiling as its producer_limits parameter
When producer_limits.input_bytes set the pwntools admission ceiling for a
call, an oversized input reported the registered pwntools.max_input_bytes
setting limit with update_mode "parameter" attached. Every other
producer budget reports the parameter shape, and AGENTS.md asks for the
limit of the control that stopped the work. Report producer_limits.input_bytes
with applies_at "next_call" and, as its default, the ceiling that applies
when the field is omitted. Setting, launch and built-in ceilings keep the
setting shape. Remove the reference exception this made obsolete.
BREAKING CHANGE: for a request-sourced pwntools input ceiling,
details.limit is now a control_kind "parameter" limit instead of a
setting limit carrying setting, source, update_mode and scope fields.
* fix(wasm): state the accepted WABT release range from its owning constant
`WabtRelease.ts` admits caller-supplied WABT `>=1.0.42 <1.1.0`, but the
`inspect_wasm_artifact` description, the capability inventory
remediation and the WASM static-inspection guidance said "WABT 1.0.42",
and a source comment and the WASM guide claimed managed downloads stay
pinned, although REA downloads no WABT.
The accepted range and the caller-facing release line now live in the
domain beside `WABT_VERSION`, so the contract description, inventory
remediation, error guidance and adapter messages all render the same
"WABT >=1.0.42 <1.1.0 (verified with 1.0.42)". The download claim is
removed, and the guides and skill source state the range.
* docs(wasm): state the accepted WABT release range in one owning guide section
The bundled WABT README still required an exact 1.0.42 banner while the
guide and supported-targets table stated the admitted range. Keep the range
in the WASM guide's Configure WABT section and link to it from the README
and the supported-targets table; the README keeps the verified release,
source commit and archive digest.
* test(wasm): derive WABT version assertions from the owning constants
Assert the verified release and caller-facing release line through
WABT_VERSION and WABT_RELEASE_LINE, and drop the literal range pin that the
owner-level admission boundary checks already cover.
* test(wasm): type the WABT version probe fixture by its owning type
Deriving expected_version from WABT_VERSION in an untyped literal widened
it to string; annotate the fixture as WabtVersionProbe instead.
* fix(artifacts): route native images to static readers and name their architecture
inspect_artifact sent every PE, ELF and Mach-O root straight to
open_binary (PE first to inspect_managed_artifact, whatever its CLI
header) and left architecture null on every inventory node and on the
inspection subject, although the header parsers already know the CPU.
Inventory classification now returns the header's CPU family with the
format, from the same ELF, Mach-O and PE record parsers target admission
uses, so each thin image node (including universal slices and archive
members) names its architecture; an undecoded machine stays null, and a
universal container node names none. When the inventory root is the
open target's own bytes, its Evidence subject carries the architecture
target admission parsed, as it already carried the selection.
Native next probes now list the provider-free readers for the format
before open_binary: PE imports, exports, load config, resources,
hardening and release exposure; ELF dependencies, exports, hardening and
release exposure; Mach-O inspect_macho, inspect_signature, hardening and
release exposure. inspect_managed_artifact leads only when the PE
declares a CLI header, is omitted when it declares none, and stays a
conditional probe for directory members whose declaration is unknown.
The PE hypothesis that inventory cannot tell managed from native is kept
only for that unknown case.
Fixes#14157
* fix(artifacts): keep native readers for executables that carry a package
An executable whose contents inventory as an embedded package (Godot
PCK, PyInstaller, Node SEA, Deno, Bun or a .NET single-file bundle) is
also a native image. Previously inspection proposed only the package
reader and hid the native side.
The inspection now takes the native image facts that target admission
parsed for the root's own bytes, not only the PE CLI-header flag. When
inventory reads those bytes as a package, the package reader comes
first, then the carrier's static readers, then open_binary.
A probe names exactly one operation, so the static readers cannot be
grouped into one entry without changing the advertised schema. They
stay separate rows and share one short rationale, because each tool's
description already says what it reads. Each format's reader list is
now a table.
* fix(artifacts): bind a deep provider for managed PEs only at a native boundary
A PE declaring a CLI header recommended open_binary with generic
function-level advice, so pure managed assemblies were steered to a
deep native provider. Its rationale again requires managed inspection
to report a native or mixed boundary, and a PE whose header is unknown
states the same condition.
* test(artifacts): assert universal slice inventory per host and prune probe snapshots
The universal Mach-O test assumed slice inventory on every host, but the
slice reader runs native lipo and is skipped off macOS, so it failed on the
Linux test shards and portable tests. The test now selects the host platform
through a HostPlatform mock: the slice inventory case runs only on a macOS
host, and the other-host case asserts unknown container coverage with only
the file occurrence on every host. Both keep the selected-slice subject
architecture and static reader order.
Pruning in the probe tests:
- Merge the ARM64 PE, ELF and Mach-O single-image probe tests into one
parameterised case that asserts subject and root-node architecture, the
complete static reader list, and that open_binary is the only probe beyond
artifact bytes.
- Remove the Deno carrier ordering case from the native image probe test;
the Deno CLI acceptance test covers the same three carriers through the
public workflow and now asserts the same ordering and authority facts.
- Replace full next-probe arrays in the Bun, Deno, dotnet-bundle and
PyInstaller CLI/MCP tests with a shared carrier assertion: package readers
lead, the carrier's format reader is present, and open_binary is last and
the only non-artifact-bytes probe. The per-format reader list stays owned
by the native image probe test.
Malformed-header (undecoded machine), unknown architecture and package
subject identity coverage are unchanged.
Token.attrGet returns string | number | null, so the link checks added in
#14207 failed typecheck on main. Keep only string href values before
matching them.
* fix(hopper): name xrefs when a selector resolves outside every procedure
The bridge collapsed every procedure-selector miss into "No procedure
exists at the requested address", even when the caller passed a name
that Hopper resolved to an import slot or data label. The TypeScript
error then attached one fixed remediation that mixed CLI and MCP
spellings and recommended list_names, which has no CLI command.
The bridge now reports how the selector resolved (symbol, address,
cursor, or unresolved name) with the resolved address. HopperRemoteError
derives its remediation and related operations from those facts: a
resolved non-procedure symbol names xrefs on its address, and the
remediation names contract operations only so each adapter renders its
own spelling through related_operations.
Fixes#14165
* test(hopper): parse selector diagnostics through the bridge wire contract
The procedure-selection regression cast the bridge diagnostic to never
and projected it directly, so the selector-resolution schema never ran.
It now frames each diagnostic as an NDJSON reply and parses it with the
Hopper reply envelope, covers a cursor outside every procedure, and
requires malformed selector resolutions to fail as protocol errors.
* perf(ghidra): retain literal search candidates only when filtering narrows them
The Ghidra bridge folds ASCII exactly, so a case-insensitive literal
search with an ASCII-foldable pattern already returns its matches.
Attaching the unnarrowed reply as rawResult repeated the full match list
in every default search_strings/search_procedures response and Evidence
record. Retain it, with the candidate limitation, only when Unicode
filtering removed a row or secondary name.
Closes#14142
* docs(ghidra): state when a literal search retains raw candidates
The native investigation guide still said every case-insensitive literal
search puts bridge candidates in raw_result. It now states the
condition. A test covers the case where filtering removes only a matched
secondary name, which keeps every procedure but must still retain the
candidates.
Derive the CI example's Node pin from .nvmrc, match the workflow link by its parsed destination instead of its link text, and replace hard-coded Persian and Malayalam headings with a check that every in-page README fragment resolves to a rendered heading or HTML anchor. Drop skill-install prose assertions already covered by byte equality with the generated skill.
The capability reason, worker failure, tool description and skill
reference told users to run Node.js 24.15 or newer, below the 24.22.1
and 26.12.1 floors REA itself requires. Keep the gate on the native
DatabaseSync.limits API floor, and say instead that every supported
Node.js 24.x and 26.x runtime provides it and Node.js 22.x does not.
* fix(javascript): refuse directories without JavaScript inputs and name directory-capable operations
`analyze <dir>` routed every non-bundle directory to the static JavaScript
lane, which reported an all-zero Electron summary as success for native
build output. The JavaScript lane now owns that applicability decision from
its complete inventory: when coverage is complete and no JavaScript, HTML,
package.json, source map, or nested ASAR input exists, it returns a typed
unsupported_target refusal naming inspect_desktop_application,
audit_release_exposure, inspect_artifact, and open_binary. Incomplete
coverage or unavailable files of unknown kind stay unknown and proceed.
The directory_requires_file refusal no longer claims to come from
open_binary when another operation (inspect, inspect-artifact) admitted the
target, and it names the directory-capable operations instead of only the
JavaScript lane.
* fix(javascript): keep empty directories analyzable and report routing facts for non-JavaScript ones
Owner decision on #14186: an empty directory is "nothing to analyze", not
"unsupported". The JavaScript lane now classifies application-input
presence once, in the domain owner of its file facts
(javaScriptApplicationInputPresence): present, empty, absent, or unknown.
- empty (complete traversal, no non-directory entries): analysis succeeds
as before and the graph carries an explicit "No JavaScript inputs were
found" limitation naming the next operations.
- absent (complete traversal, entries but no JavaScript, HTML,
package.json, source map, or nested ASAR): the typed unsupported_target
refusal now carries bounded diagnostics from the inventory the lane
already read: inventoried_entries, entries_by_format, json_files and
native_addon_files. No paths are retained.
- unknown (incomplete traversal or unavailable file of unknown kind) and
present: unchanged analysis.
Reverts the fixture edits that added package.json to empty directories.
The GitHub Actions example pinned rea-agents 6.7.0 and its test
hard-coded the same string, so the pin went stale silently across
three releases. Pin 6.10.1 and derive the test's expected version from
package.json, so a release bump fails the test until the example is
updated. Stop naming a fixed version in the CI analysis guide.
* perf(debugger): stop repeating command results as raw_result
GDB console/startup, Rizin debug, Cutter and reverse-engineering command
Evidence set rawResult to a copy of result, contrary to the raw_result
contract. Every interactive debugger reply therefore carried its records
and output twice. Omit rawResult where no distinct provider
representation exists; tests assert the same facts on normalized_result.
Closes#14145
* test(debugger): assert command results on normalized_result in remaining suites
The composition, CLI delivery, acceptance and MCP suites still read
command output through raw_result, and one fixture built a parent
Evidence record that repeated its result as raw_result. They now assert
the same fields on normalized_result and that raw_result is null.