Commit Graph
1239 Commits
Author SHA1 Message Date
Vincent Koc 0228e31502 test(mcp): recognize the updated runtime bundle module markers 2026-11-24 17:38:09 +08:00
Vincent Koc 78149eeec9 refactor(tests): consolidate repeated CLI capture and fixture construction (#14311)
* refactor(tests): consolidate repeated CLI capture and fixture construction

* test(cli): keep overlapping schema and help cases in their existing PR
2026-11-24 08:53:50 +00:00
Vincent Koc 89e93e2e9b fix(deps): adapt release tooling and capture metadata to the new npm pins 2026-11-24 16:41:42 +08:00
Vincent Koc d6e602cbfc test(pe): distinguish unsupported DOS input from truncated input (#14302) 2026-11-24 07:16:31 +00:00
morluto 271bad782b fix(tests): damage Deno PE resource framing the loader-equivalent reader reads
#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.
2026-11-24 00:43:46 -05:00
morluto 3cb7ca9eeb test: run repeated CLI formatting capacity pairings in process (#14279)
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.
2026-11-23 23:42:42 -05:00
morluto 78d2593a45 feat(artifacts): report declared DDS, GLB, KTX and KTX2 headers and regions (#14248)
* 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.
2026-11-24 04:28:08 +00:00
morluto f585acc748 fix(pe)!: share one loader-equivalent PE header owner across static readers (#14253)
* 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.
2026-11-23 23:27:22 -05:00
morluto 5c3ed5d028 test: prune redundant and superseded tests (#14271)
* 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.
2026-11-23 23:06:36 -05:00
morluto 187793ba61 fix(macho)!: report a FAT header or table cut off by the file's end as truncated (#14233)
* 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
2026-11-23 22:56:10 -05:00
morluto 5f63d244e9 fix(release-exposure)!: omit checks that cannot apply to the detected formats (#14240)
* 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.
2026-11-24 03:29:27 +00:00
morluto eb6c281fec fix(errors)!: align unsupported-signature status and split invalid-method-token at its producer (#14230)
* 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.
2026-11-23 20:50:18 -05:00
morluto 57f4e3c4bd fix(errors)!: refuse corrupt managed, IL2CPP and universal Mach-O bytes as a malformed target (#14224)
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.
2026-11-23 20:23:19 -05:00
morluto 1a43f56354 fix(errors)!: split reader path refusals from malformed target bytes (#14225)
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.
2026-11-23 20:20:05 -05:00
morluto c68ddbec7c test: assert structured facts instead of incidental wording (#14222)
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.
2026-11-23 20:16:14 -05:00
morluto 89c1dd3c32 fix(errors): refuse malformed target bytes as a target, not invalid input (#14195)
* 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.
2026-11-24 00:44:40 +00:00
morluto c4fa5b475c fix(cli)!: accept only the documented kebab-case option spelling (#14204)
* 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.
2026-11-23 19:36:23 -05:00
morluto 8ed819573b fix(artifacts): route native images to static readers and name their architecture (#14189)
* 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.
2026-11-24 00:27:11 +00:00
morluto 03f68dbcba style(tests): format the SQLite acceptance test (#14209)
#14206 updated an expectation in this file without formatting it, so
format:check fails on main and on every branch built from it.
2026-11-23 18:14:22 -05:00
morluto 7b056d2ff8 fix(sqlite): state the runtime requirement in supported-runtime terms (#14206)
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.
2026-11-23 18:01:23 -05:00
morluto 609b58b109 perf(debugger): stop repeating command results as raw_result (#14146)
* 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.
2026-11-23 17:55:57 -05:00
Anurag SinghandAnurag Singh 604e087c31 fix(adb): report macOS ownership preparation failures as typed host prerequisites (#14140)
Since adb runs under owned supervision, a failed macOS ownership helper
build reached the adb version probe as an unreadable result, so one broken
toolchain failed all of binary_session. adb now reports the shared
ownership_preparation failure that apktool, JADX and Ghidra report, and its
availability probe turns it into runtime_unavailable.

When the host refuses the helper's compiler for capacity (EMFILE), that
retryable constraint now stays primary over the helper root it could not
remove, which remains a retained cleanup dependency.

The four providers build the preparation error through one owner,
ownershipPreparationError, next to the availability check that reads it.

Fixes #13943

Co-authored-by: Anurag Singh <211784907+Anurag-5ingh@users.noreply.github.com>
2026-11-23 19:35:58 +00:00
morluto 4bbaf17512 refactor: centralize owned finalization and configuration failures (#14071)
* refactor(config): propagate typed configuration failures

* refactor(lifecycle): centralize completion and cancellation

* fix(config): preserve Hermes YAML edit refusal guidance
2026-11-23 13:40:10 +00:00
morluto a324181ccc refactor(domain): one ByteSource representation for streaming parsers (#14044)
* refactor(domain): one ByteSource representation for streaming parsers

* refactor(nuget): adopt ByteSource across NuGet and APK parsers (#14047)

refactor(nuget,apk): adopt ByteSource and drop the NuGet in-memory parse branch

* test(elf): remove obsolete byte source fixture declarations
2026-11-23 13:25:13 +00:00
hhangandhhang 5aed462db4 perf(views): page exact Playwright trace index hits directly (#14031)
Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
2026-11-23 08:09:52 -05:00
morluto 71cea564fb fix(v8): preserve verified code cache results and require exact payload reads (#14067) 2026-11-23 12:57:52 +00:00
morluto a5f735c67b fix(devicetree): validate retained report ranges and coverage (#14066) 2026-11-23 12:37:46 +00:00
morluto 2e47bc09f3 fix(erlang): require complete positional BEAM reads (#14045) 2026-11-23 12:13:25 +00:00
morluto 4ff98b84fb fix(python): validate marshal coverage and consolidate pyc tests (#14036) 2026-11-23 06:55:30 -05:00
gensokyo-devandgensokyo-dev a148da56cc feat(analysis-view): filter native exports and ELF dependencies by name prefix
Retained native-exports and elf-dependencies views matched only exact names, so counting the exports or imports in one namespace meant paging every row. Add name_prefixes to the exports collection and to every named elf-dependencies collection. A prefix filter combines with exact names, and coverage.total counts every match, so limit 1 returns a count. ELF export prefixes follow the exact-name identity rules: non-ASCII names compare their UTF-8 bytes, and names that are not valid UTF-8 never match. The tool descriptions now name the filter.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-23 17:41:53 +08:00
morluto d0a9e6b912 refactor(rust): consolidate binary parser checks on positional reads (#14033) 2026-11-23 07:31:43 +00:00
gensokyo-devandgensokyo-dev c01c168336 fix(uefi): attribute a refused output directory to output_directory
An existing output directory was reported as an invalid path issue, which points callers at the firmware image instead of the directory they chose. Route destination refusals through outputDirectoryAdmissionRefusal, as firmware extraction already does.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-23 14:58:56 +08:00
gensokyo-devandgensokyo-dev e617a55385 perf(uefi)!: summarize firmware extraction by default over MCP
A whole-image extraction of a 4 MiB OVMF image lists 560 files in about 553 KB of structured content, which exceeds client result limits. MCP extract_uefi_firmware now retains the complete manifest and returns its summary unless the caller passes detail complete. Targeted extractions fit in the summary's file preview. An optional view returns the first uefi-extraction page in the same call; later pages use inspect_analysis_view. The one-shot CLI command still returns complete Evidence.

BREAKING CHANGE: MCP callers that need every published file inline must pass detail: "complete" to extract_uefi_firmware.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-23 14:58:56 +08:00
morluto 68cc2b9bb0 refactor(go): consolidate native parser checks on positional reads (#14027) 2026-11-23 06:56:52 +00:00
morluto fabe0da74b fix(elf): preserve kernel config framing and location provenance (#14021) 2026-11-23 06:38:04 +00:00
morluto be32625b29 refactor(elf): consolidate kernel module checks on positional reads 2026-11-23 01:18:06 -05:00
RRFZ 4c27f48667 fix(gpu): mark conflicting CUDA shared sections partial and clear register provenance (#13963) 2026-11-23 00:24:21 -05:00
gensokyo-devandgensokyo-dev 11ac37a42f perf(uefi)!: summarize firmware inspection by default over MCP
A complete map of a 4 MiB OVMF image is about 514 KB of structured content, which exceeds client result limits. MCP inspect_uefi_firmware now retains the complete map and returns its summary unless the caller passes detail complete. An optional view returns the first uefi-firmware page in the same call; later pages use inspect_analysis_view. The one-shot CLI command still returns complete Evidence.

BREAKING CHANGE: MCP callers that need every volume, file and section inline must pass detail: "complete" to inspect_uefi_firmware.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-23 13:12:02 +08:00
morluto 6ce7f932bd perf(apk-signature): stream APK signature inspection over FileHandle (#13877)
* perf(apk-signature): stream APK signature inspection over FileHandle

* fix(apk-signature): preserve bounded reads and file identity

* fix(apk-signature): handle deflate EOF and repair verifier bounds

* fix(apk-signature): recognize internal pipeline cancellation at EOF
2026-11-23 03:18:38 +00:00
morluto 99c2104da9 fix(objc): preserve class import reader failures (#13892) 2026-11-23 03:00:10 +00:00
RRFZ a46bc22117 fix(dwarf): reject PE long section names when PointerToSymbolTable is zero (#13889) 2026-11-22 21:50:05 -05:00
morluto 8c16d7d18f fix(javascript): verify Expo context getter ownership (#13803) 2026-11-23 01:21:54 +00:00
wei 6542e81a12 fix(hermes): resolve nested HERMES_HOME selection from the override root (#13792)
The configured override root now owns its sticky selection: setup reads active_profile and resolves the named profile beneath that same root, even when the override sits inside the native Hermes home. The native home's selection no longer determines an override's destinations, so a nested override selecting 'other' plans into its own profiles/other, and an override with no selection plans into the override root itself.

This is a contract change from the native-root rule the docs and tests previously locked in (PR #4145 only documented that rule; it did not change the resolver). The maintainer has not ruled on the change. The override root is still validated with physicalPath before its selection is read, so an unreadable path or dangling alias stays unresolved instead of silently planning into the root.

Refs morluto/rea#3939
2026-11-23 01:18:46 +00:00
RRFZ c1cef729c9 perf(parsers): replace quadratic trailing-quantifier regexes with linear edge scans (#13757)
* perf(parsers): replace quadratic trailing-quantifier regexes with linear edge scans

* test(har): assert response.bodySize in zero negative-exponent lexeme test
2026-11-23 01:11:05 +00:00
morluto 4a62303717 fix(elf): read build IDs without decoding unrelated notes (#13776) 2026-11-23 00:53:05 +00:00
morluto 7c75a5f91b fix(elf): validate core paths before charging mapping output (#13771) 2026-11-23 00:42:23 +00:00
morluto a4f9c2309b fix(elf): respect compressed note storage across inspectors (#13762)
* fix(elf): respect compressed note storage across inspectors

* test(elf): preserve independent hardening note failures
2026-11-23 00:31:02 +00:00
RRFZ b0216a0a7a fix(firmware): report malformed linux,phandle and leave references unresolved (#13734) 2026-11-22 19:11:44 -05:00
RRFZ e6b30f945e fix(native): validate SHT_GNU_HASH bounds and fall back to DT_GNU_HASH (#13713) 2026-11-22 23:47:57 +00:00
morluto f18de40af6 fix(artifacts): preserve DMG verification cancellation at the deadline (#13616) 2026-11-22 21:24:30 +00:00