Skip to content

fix(errors)!: split reader path refusals from malformed target bytes - #14225

Merged
morluto merged 1 commit into
mainfrom
fix/artifact-reader-format-split
Nov 24, 2026
Merged

morluto merged 1 commit into
mainfrom
fix/artifact-reader-format-split

Conversation

@morluto

@morluto morluto commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Follow-up to #14195.

Root cause

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 in src/resources/StableArtifactFailure.ts and the file step of classifyProviderFailure) mapped both to invalid_request with an invalid_format path issue. As a result, corrupt BEAM files and PE certificate table bodies were reported as caller argument errors. A second gap: readers that raised "malformed" without the format owner's ParseFailureError (the Android boot image entry planner and the keyed archive reader) reached callers without details.format_failure or details.format.

Structural fix

Split at the producers

  • Path-kind refusals now use the existing path selection reason: artifactFileAdmissionFailure (NonRegularFileReadError), the stable root, directory entries, 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 now raise the owner's ParseFailureError, with malformed or truncated and format beam or pe-certificate-table.
  • Short reads inside an admitted range (kernel module, kernel build config, ELF unwind ranges) are integrity / read-coverage, because the file changed during the read.
  • Internal contract breaks (an invalid stream chunk size, a non-Buffer keyed archive chunk) are InternalInvariantErrors. An impossible descriptor byte count is io.

Project the parsed facts once

  • artifactParseFailure records the owner's malformed/truncated facts as ArtifactReaderFailure.parseFailure, and primaryFacts() keeps them through cleanup wrapping. projectOwnedArtifactInputFailure builds AnalysisMalformedTargetError from that field instead of reading the cause chain, and treats only path as a selection error.
  • translateArtifactFailure passes the facts to ArtifactOperationError.parseFailure. The projection adds format_failure, format, offset and field to inspect_artifact refusals, and both error kinds share one parseFailureDetails helper.
  • The Android boot entry planner raises malformedInput("android-boot-image", …). The redundant format → invalid_format branches in WindowsShortcutProvider and ApiContractRead are removed, and NuGet no longer exempts format from its own translation.

BEAM and certificate-table decisions: #14195 kept BEAM as invalid_request only because its parser raised the ambiguous format reason, and its CLI table carried the case as an exception. Both readers are migrated here. The BEAM exception is removed from stableArtifactParserFailureCli.

Design notes

  1. Unsupported is not malformed. A PKCS#7 name encoding that the decoder does not implement is now unsupported (PeCertificateAsn1Failure.unsupportedForm). A short file that does not start with FOR1 is reported as malformed: it is a different format, not a truncated BEAM.
  2. Transient is not permanent. Changed-file short reads are artifact_changed (integrity_check: read-coverage). Cancellation, I/O and the stable reader's re-verification on ParseFailureError are unchanged. Selection errors keep the inspect_input_contract recovery. Malformed targets have retryable: false and no argument recovery.
  3. Provenance. Selected-file malformed refusals keep partial_observation with path, size and SHA-256. The new CLI and boundary tests assert this.
  4. One system of record. The format owner raises ParseFailureError once. parseFailure is copied from it only by artifactParseFailure, and no projection re-derives the class from message text.
  5. Contract evolution. Marked fix(errors)! with a BREAKING CHANGE: footer. Only additive detail fields are added (format_failure, format, offset, field), and no existing field is renamed. docs/user-visible-errors.csv is unchanged, because no tag or reason classification changed.

Tests

  • Owner level: BeamParser.test.ts and PeCertificateParser.test.ts assert parsed facts, including the new unsupported name form. ArtifactOperationFailure.test.ts checks that inventory refusals carry the format facts through cleanup wrapping, and that only path is a selection error (non-regular admission maps to path, bare format is not a request error). Boundary: erlangBeam (the split, with directory, symlink, missing and child-path controls) and peCertificates (malformed body with file identity).
  • stableArtifactParserFailureCli: BEAM now joins the malformed-target table (18 readers), and a new body-structure table covers truncated BEAM and the malformed certificate table. The Android boot CLI and MCP refusal tables assert format_failure and format.
  • Updated stale expectations: erlangBeamCli, erlangBeamMcp, peCertificatesCli, PeCertificatesProvider, EvmoleFailures (its synthetic format row is dropped), and the ZIP, PyInstaller, kernel and unwind unit tests.
  • Mutation checks: restoring format in the input projection fails the split test, and restoring BEAM's ArtifactReaderFailure("format") fails the BEAM boundary test.

Validation

  • npx vitest run on src/{resources,erlang,native,artifacts,evm,providers,domain} and the BEAM, PE and shortcut filesystem boundaries: 800 files, 17948 passed. Earlier sweeps of the remaining src/ directories also passed.
  • In-process CLI probes from source (createCli with serveInProcessCli) confirmed all 18 table commands, the body cases, directory controls and the Android boot details.
  • Scoped tsc over the changed files, oxfmt --check, oxlint (no new warnings) and architecture-guards: clean.
  • Not run locally: suites that need dist/ (the acceptance files and compiled MCP boundary tests). CI must confirm them.

Real-provider verification scope

None needed. Every affected reader is a local static parser.

Remaining cleanup

  • Container and inventory readers (ASAR, ZIP, Godot, UnityFS, NTFS and others) still raise bare format for corrupt bytes. On those paths it keeps its existing artifact_operation_failed classification. Playwright trace, NTFS journal, release exposure, SQLite, pwntools and EVM worker replies still map format to invalid_request in their own mappers. Each needs its owner migrated to ParseFailureError first.
  • ArtifactOperationError reason=truncated still projects code truncated, while the selected-file path reports unsupported_target. Aligning the two would be a separate code change.
  • The managed metadata, IL2CPP and Mach-O slice mappers are handled on a separate branch.

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.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-24T01:12:31.622046Z
We couldn’t complete this review. Comment @codex review to try again.
61b4ada PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge.

Summary

Separates rejected file selections from malformed target bytes and carries the parser’s facts into public errors.

  • Selected-file errors now distinguish a bad path from bad file contents.
  • BEAM files now report malformed and truncated structures as target errors.
  • PE certificate-table errors now name malformed, truncated, and unsupported data.
  • Android boot-image refusals now include the parser's format details.
  • Short reads and broken reader contracts now keep their own error meanings.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Selection["Non-regular file selection"] --> Path["ArtifactReaderFailure: path"]
  Path --> Request["Selection error"]
  Parser["Format owner: ParseFailureError"] --> Convert["artifactParseFailure"]
  Convert --> Facts["ArtifactReaderFailure.parseFailure"]
  Facts --> Cleanup["Cleanup wrappers preserve primaryFacts"]
  Cleanup --> Selected["Selected-file target error"]
  Cleanup --> Operation["ArtifactOperationError.parseFailure"]
  Selected --> Details["Public format_failure, format, offset and field"]
  Operation --> Details
Loading

Reviews (1) · Last reviewed commit: "fix(errors)!: split reader path refusals..." · Reviewed by Greptile

@morluto
morluto merged commit 1a43f56 into main Nov 24, 2026
39 of 51 checks passed
@morluto
morluto deleted the fix/artifact-reader-format-split branch November 24, 2026 01:20
morluto added a commit that referenced this pull request Nov 24, 2026
#14242)

#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.
morluto added a commit that referenced this pull request Nov 24, 2026
…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.
morluto added a commit that referenced this pull request Nov 24, 2026
#14225 refuses a non-regular dyld input as ArtifactReaderFailure("path");
dylibFileLifetime still expected "format" and fails on main's shard 9.
morluto added a commit that referenced this pull request Nov 24, 2026
stableArtifact expected "format" for an impossible descriptor byte count
(now io) and an invalid chunk size (now InternalInvariantError);
directoryArtifactReaderOpen expected "format" for a non-file entry (now
path, the same change as #14238). All three fail on main.
2SinceJuly added a commit to 2SinceJuly/rea that referenced this pull request Nov 24, 2026
…ror reasons

Upstream morluto#14225 split reader path refusals from malformed target bytes and moved two stable-artifact contract breaks off ArtifactReaderFailure("format"): an invalid chunk size is now an internal invariant violation, and a descriptor returning an impossible byte count is an io failure. The suite still asserted reason "format" for both, so shard 9 and the required CI lane went red on every branch that re-merged main.

Update the assertions to the reasons the producers now raise so the boundary suite matches the intended contract.
morluto added a commit that referenced this pull request Nov 24, 2026
)

* 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.
2SinceJuly added a commit to 2SinceJuly/rea that referenced this pull request Nov 24, 2026
…main

Merging main brought two contract changes these tests still asserted the old shape for: morluto#14225 moved an invalid chunk size to an internal invariant violation and an impossible descriptor byte count to io, and morluto#14189 added contentArchitecture to the classification role. The auditd role test added here predates the new field, so Source tests failed on contentArchitecture: null and shard 9 failed on the two stable-artifact reasons.

Assert the reasons and fields the producers now return so both lanes match the intended contract.
morluto added a commit that referenced this pull request Nov 25, 2026
…cated targets (#14265)

* feat(errors)!: add the TargetFailure model, its projection table and conformance registry

Introduce one domain-owned TargetFailure value whose kind alone derives
the public code, category, retryability, recovery and details, for CLI
and MCP alike. Selected-file malformed and truncated refusals are the
first area on it: AnalysisMalformedTargetError is replaced by
AnalysisTargetFailureError, and ParseFailure's byte-structure variants
are TargetFailure variants rather than a parallel type.

The shared stableArtifactParserFailureCli loop is replaced by a
declarative registry (tests/support/targetFailure/readers/*.ts) and one
generated suite that runs every registered case through the CLI and MCP.

BREAKING CHANGE: selected-file malformed and truncated refusals add
details.failure_kind, and a truncated target's remediation now says to
re-acquire the complete file instead of choosing another target. Codes
are unchanged. Affected operations: every operation that refuses a
selected file's malformed or truncated bytes, including the ELF, PE,
Mach-O, DWARF, Go, Rust, BEAM, pyc, devicetree, Apple IPS, kernel
module, binary hardening, managed PE/CLI and IL2CPP readers.

* test(managed): name the target failure error in the merged status test

* docs(reference): name the error CSV instead of linking a non-page file

* fix(tests): expect the path reason for non-regular dyld inputs

#14225 refuses a non-regular dyld input as ArtifactReaderFailure("path");
dylibFileLifetime still expected "format" and fails on main's shard 9.

* fix(tests): expect io, invariant and path where #14225 reclassified

stableArtifact expected "format" for an impossible descriptor byte count
(now io) and an invalid chunk size (now InternalInvariantError);
directoryArtifactReaderOpen expected "format" for a non-file entry (now
path, the same change as #14238). All three fail on main.

* fix(errors)!: raise container reader byte faults as malformed or truncated targets

Delete the ambiguous `format` reason from ArtifactReaderFailure and
ArtifactOperationError. Each container reader now raises its owner's
fact once, through malformedArtifact / truncatedArtifact, with format,
offset, field and measured extents. Short reads inside a measured extent
are read-coverage integrity failures, path-kind refusals are `path`,
foreign or recovery-requiring inputs are `unsupported`, host tool output
is `io`, and REA defects are InternalInvariantError.

The trace, NTFS journal, release exposure, web capture, native macOS and
web artifact adapters project the reader's parsed facts as
AnalysisTargetFailureError instead of invalid_request. Inventory
malformed, truncated, unsupported and cancelled reasons take their code
from the TargetFailure projection table, so a truncated container is
unsupported_target with failure_kind "truncated" on both paths.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact,
analyze_javascript_application, inspect_desktop_application,
inspect_keyed_archive, inspect_asset_catalog, inspect_nuget_nupkg,
trace_dylib_resolution, trace_web_module_imports and
trace_web_source_location report damaged container bytes as
unsupported_target (details.reason "malformed" or "truncated", with
failure_kind and format) instead of artifact_operation_failed with
reason "format", and a truncated container as unsupported_target instead
of truncated. inspect_playwright_trace, inspect_ntfs_journal,
audit_release_exposure, the web capture inspection operations and the
caller-selected import and source maps report damaged selected bytes as
unsupported_target instead of invalid_request. The `format` reason no
longer appears in details.reason.

* test(artifacts): expect target failure codes in compiled CLI and MCP suites

* fix(errors): give the integrity kind a schema-valid code and list the reference page

artifact_integrity_mismatch's projection schema requires declared and
calculated digests, which a TargetFailure of kind integrity does not
carry, so the kind now projects artifact_operation_failed with category
integrity_mismatch. The model test validates every kind's projection
against analysisErrorProjectionSchema. The reference page joins the
documentation sidebar.

* fix(artifacts): report a short carrier read as a changed file and keep unsupported desktop probes local

A Bun or Node SEA short read inside a range already checked against the
measured size meant the file changed, not that it was truncated. The
carrier range reader and Bun's readExact now raise read-coverage
integrity for it, and keep 'outside the file' as the truncated case.
DesktopFileInspection records an unsupported managed-metadata probe as a
row issue again, so later file checks still run.

* test(errors): register PE DOS-signature and truncated IPS refusals and drop their per-command copies

The non-MZ PE imports and load-config cases (PE32/PE32+, ZZ and high-bit
signatures) and the truncated Apple IPS body move into the conformance
registry, which runs them through the CLI and MCP and now also checks
that a refusal leaves the selected file unchanged. The per-command tests
keep only their valid-image controls.

* feat(errors)!: make failure_kind the identifier and derive code and retry from it

Apply the owner review on #14239 to the TargetFailure model:
- remove details.format_failure; failure_kind is the only identifier;
- give integrity, conflict and io their own codes
  (target_integrity_mismatch, input_conflict, host_io_failed) and derive
  inventory malformed, truncated and unsupported codes from the same table;
- add a retry hint (none, backoff, after_change) derived from the kind,
  with io refined by its transient errno fact; retryable stays the
  unchanged-retry flag and is true exactly for backoff;
- rename the limit-cut result code and category truncated to partial;
- drop cancelled and resource from the target kinds and spell
  identifiers in American English (unrecognized);
- return a target failure a tool handler throws as a projected isError
  result instead of letting the SDK flatten it to text.

BREAKING CHANGE: details.format_failure is removed (read
details.failure_kind). The truncated result code and category are now
partial. Target integrity failures report target_integrity_mismatch,
host read failures host_io_failed and disagreeing inputs input_conflict.
Inventory operations (inventory_artifact, inspect_artifact,
extract_artifact and the other inventory callers) report truncated
container bytes as unsupported_target. Every target failure carries a
top-level retry hint.

* fix(artifacts): keep changed-file short reads, invalid offsets and EOF declarations apart

PyInstaller reads inside the measured size, and .NET bundle manifest
refills, now raise read-coverage integrity on a zero-byte read instead of
truncated. A .NET bundle field and a Godot PCK directory entry that extend
past the file are truncated (with offset and extents) instead of
malformed. An absent or invalid ASAR packed offset is malformed; only a
valid range past the archive is truncated. The .NET manifest string
offset is reported in file coordinates.

* fix(artifacts): verify the carrier before blaming a short read on the bytes

The NTFS $MFT decoder, positional members (FIT, uImage, Bun, Deno) and
.NET bundle members now re-verify the source before reporting a short
stream as malformed, so a file that changed during the read reports the
change. The truncation site builds the model's measured extent.

* docs(android): name unsupported_target for truncated boot image structures

* fix(errors)!: report a target that changed during the read as failure_kind changed

Inventory integrity failures whose check means the target moved under the
read (container, member and unpacked-entry identity, read coverage,
traversal coverage) now take the model's changed projection: code
artifact_changed, retry backoff and details.failure_kind changed. A
selected target that no longer matches the one the session admitted gets
its own admitted-identity check and keeps its reopen recovery.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and
the other inventory operations report a target that changed during the
read as artifact_changed (retryable, failure_kind changed) instead of
artifact_operation_failed. Admission-identity refusals report
integrity_check admitted-identity instead of container-identity.

* test(artifacts): expect admitted-identity for selections replaced before admission

A selected source replaced before admission fails the admitted-identity check rather than container-identity since the changed/admitted split.

* test(go): name the fixture and result when an MZ carrier is not refused through MCP

* test(web): expect the partial code for a refused source-map admission

The limit-cut code is partial; this Windows-lane test arrived from main with the old truncated spelling.

* test(errors): check the MCP target failure as the text clients receive

The stdio transport removes the private structured carrier from every isError result, so the conformance suite asserted a field that never reaches clients and failed every case. The projected diagnostic is checked from the JSON text instead.

* test(artifacts): expect artifact_changed when selected bytes change after inventory

Bundle resources replaced after open and unselected JavaScript sources rewritten after inventory now fail a change check, so they report artifact_changed with retry backoff rather than artifact_operation_failed.

* fix(errors): report a session digest mismatch as admitted-identity

The digest the session admitted does not change when the same request is
repeated, so targetDigestChangedFailure was inviting a backoff retry that
fails the same way. It now names admitted-identity, which stays
artifact_operation_failed and not retryable, and tells the caller to reopen.

Co-authored-by: morluto <[email protected]>

* fix(artifacts): classify unused PyInstaller compressed input as layout

zlib stops at the first complete stream, so a declared span that arrives
intact but is not fully consumed is trailing junk or a second stream, not
a file that changed. A source that ends before that span stays read-coverage.
The cached-carrier test replaces the file with a different size so a shared
timestamp cannot hide the rewrite.

Co-authored-by: morluto <[email protected]>

* test(applications): expect unsupported_target for a damaged trace stream

A trace member whose CRC fails is a malformed zip target. The partial
Evidence assertion now checks that code, failure_kind and format.

Co-authored-by: morluto <[email protected]>

* test(dylib): expect admitted-identity when the opened target is replaced

The session keeps the digest it admitted, so replacing the executable and
repeating trace_dylib_resolution is not a retryable container change.

Co-authored-by: morluto <[email protected]>

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: morluto <[email protected]>
morluto added a commit that referenced this pull request Nov 25, 2026
…get failures (#14268)

* feat(errors)!: add the TargetFailure model, its projection table and conformance registry

Introduce one domain-owned TargetFailure value whose kind alone derives
the public code, category, retryability, recovery and details, for CLI
and MCP alike. Selected-file malformed and truncated refusals are the
first area on it: AnalysisMalformedTargetError is replaced by
AnalysisTargetFailureError, and ParseFailure's byte-structure variants
are TargetFailure variants rather than a parallel type.

The shared stableArtifactParserFailureCli loop is replaced by a
declarative registry (tests/support/targetFailure/readers/*.ts) and one
generated suite that runs every registered case through the CLI and MCP.

BREAKING CHANGE: selected-file malformed and truncated refusals add
details.failure_kind, and a truncated target's remediation now says to
re-acquire the complete file instead of choosing another target. Codes
are unchanged. Affected operations: every operation that refuses a
selected file's malformed or truncated bytes, including the ELF, PE,
Mach-O, DWARF, Go, Rust, BEAM, pyc, devicetree, Apple IPS, kernel
module, binary hardening, managed PE/CLI and IL2CPP readers.

* test(managed): name the target failure error in the merged status test

* docs(reference): name the error CSV instead of linking a non-page file

* fix(tests): expect the path reason for non-regular dyld inputs

#14225 refuses a non-regular dyld input as ArtifactReaderFailure("path");
dylibFileLifetime still expected "format" and fails on main's shard 9.

* fix(tests): expect io, invariant and path where #14225 reclassified

stableArtifact expected "format" for an impossible descriptor byte count
(now io) and an invalid chunk size (now InternalInvariantError);
directoryArtifactReaderOpen expected "format" for a non-file entry (now
path, the same change as #14238). All three fail on main.

* fix(errors)!: raise container reader byte faults as malformed or truncated targets

Delete the ambiguous `format` reason from ArtifactReaderFailure and
ArtifactOperationError. Each container reader now raises its owner's
fact once, through malformedArtifact / truncatedArtifact, with format,
offset, field and measured extents. Short reads inside a measured extent
are read-coverage integrity failures, path-kind refusals are `path`,
foreign or recovery-requiring inputs are `unsupported`, host tool output
is `io`, and REA defects are InternalInvariantError.

The trace, NTFS journal, release exposure, web capture, native macOS and
web artifact adapters project the reader's parsed facts as
AnalysisTargetFailureError instead of invalid_request. Inventory
malformed, truncated, unsupported and cancelled reasons take their code
from the TargetFailure projection table, so a truncated container is
unsupported_target with failure_kind "truncated" on both paths.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact,
analyze_javascript_application, inspect_desktop_application,
inspect_keyed_archive, inspect_asset_catalog, inspect_nuget_nupkg,
trace_dylib_resolution, trace_web_module_imports and
trace_web_source_location report damaged container bytes as
unsupported_target (details.reason "malformed" or "truncated", with
failure_kind and format) instead of artifact_operation_failed with
reason "format", and a truncated container as unsupported_target instead
of truncated. inspect_playwright_trace, inspect_ntfs_journal,
audit_release_exposure, the web capture inspection operations and the
caller-selected import and source maps report damaged selected bytes as
unsupported_target instead of invalid_request. The `format` reason no
longer appears in details.reason.

* test(artifacts): expect target failure codes in compiled CLI and MCP suites

* fix(errors)!: refuse malformed SQLite, pwntools and EVM inputs as target failures

The SQLite engine's `format` reason is renamed to `malformed` at its
owner (SQLITE_INSPECTION_REASONS), and its refusal becomes an
AnalysisTargetFailureError at the selected path with format "sqlite".
The pwntools and EVM worker replies keep their wire reason "format",
which their workers define, and the adapters translate it once into a
malformed target failure with the profile's format (elf, elf-core,
evm-bytecode) instead of an invalid_format argument issue. SQLite joins
the target-failure conformance registry.

BREAKING CHANGE: inspect_sqlite_database, inspect_binary_layout,
inspect_recorded_crash and inspect_evm_interface report a selected
file's malformed bytes as unsupported_target with details.failure_kind
"malformed", format_failure, format and path, instead of invalid_request
with an invalid_format issue on path.

* fix(errors): give the integrity kind a schema-valid code and list the reference page

artifact_integrity_mismatch's projection schema requires declared and
calculated digests, which a TargetFailure of kind integrity does not
carry, so the kind now projects artifact_operation_failed with category
integrity_mismatch. The model test validates every kind's projection
against analysisErrorProjectionSchema. The reference page joins the
documentation sidebar.

* fix(artifacts): report a short carrier read as a changed file and keep unsupported desktop probes local

A Bun or Node SEA short read inside a range already checked against the
measured size meant the file changed, not that it was truncated. The
carrier range reader and Bun's readExact now raise read-coverage
integrity for it, and keep 'outside the file' as the truncated case.
DesktopFileInspection records an unsupported managed-metadata probe as a
row issue again, so later file checks still run.

* test(errors): expect target failure facts in the pwntools and EVM reply suites

The literal-replacement scenario now reads the failure's detail instead
of an issues[] message, and a malformed reply wrapped by cleanup failure
reports category unsupported_target.

* test(errors): register PE DOS-signature and truncated IPS refusals and drop their per-command copies

The non-MZ PE imports and load-config cases (PE32/PE32+, ZZ and high-bit
signatures) and the truncated Apple IPS body move into the conformance
registry, which runs them through the CLI and MCP and now also checks
that a refusal leaves the selected file unchanged. The per-command tests
keep only their valid-image controls.

* test(sqlite): drop the malformed-database provider test the conformance registry covers

inspect_sqlite_database/not-a-database in the target-failure registry runs
the same non-SQLite bytes through the CLI and MCP, asserts the malformed
target facts and checks the selected file is unchanged.

* feat(errors)!: make failure_kind the identifier and derive code and retry from it

Apply the owner review on #14239 to the TargetFailure model:
- remove details.format_failure; failure_kind is the only identifier;
- give integrity, conflict and io their own codes
  (target_integrity_mismatch, input_conflict, host_io_failed) and derive
  inventory malformed, truncated and unsupported codes from the same table;
- add a retry hint (none, backoff, after_change) derived from the kind,
  with io refined by its transient errno fact; retryable stays the
  unchanged-retry flag and is true exactly for backoff;
- rename the limit-cut result code and category truncated to partial;
- drop cancelled and resource from the target kinds and spell
  identifiers in American English (unrecognized);
- return a target failure a tool handler throws as a projected isError
  result instead of letting the SDK flatten it to text.

BREAKING CHANGE: details.format_failure is removed (read
details.failure_kind). The truncated result code and category are now
partial. Target integrity failures report target_integrity_mismatch,
host read failures host_io_failed and disagreeing inputs input_conflict.
Inventory operations (inventory_artifact, inspect_artifact,
extract_artifact and the other inventory callers) report truncated
container bytes as unsupported_target. Every target failure carries a
top-level retry hint.

* test(sqlite): expect a malformed target for non-database bytes in the CLI suite

* fix(artifacts): keep changed-file short reads, invalid offsets and EOF declarations apart

PyInstaller reads inside the measured size, and .NET bundle manifest
refills, now raise read-coverage integrity on a zero-byte read instead of
truncated. A .NET bundle field and a Godot PCK directory entry that extend
past the file are truncated (with offset and extents) instead of
malformed. An absent or invalid ASAR packed offset is malformed; only a
valid range past the archive is truncated. The .NET manifest string
offset is reported in file coordinates.

* fix(pwntools): report a short ELF header as a truncated target

The layout and recorded-crash workers raise a distinct truncated reason
when the file ends inside the ELF identification or header, and the
decoder projects it as failure_kind truncated instead of inferring it
from the message.

* fix(artifacts): verify the carrier before blaming a short read on the bytes

The NTFS $MFT decoder, positional members (FIT, uImage, Bun, Deno) and
.NET bundle members now re-verify the source before reporting a short
stream as malformed, so a file that changed during the read reports the
change. The truncation site builds the model's measured extent.

* docs(android): name unsupported_target for truncated boot image structures

* fix(errors)!: report a target that changed during the read as failure_kind changed

Inventory integrity failures whose check means the target moved under the
read (container, member and unpacked-entry identity, read coverage,
traversal coverage) now take the model's changed projection: code
artifact_changed, retry backoff and details.failure_kind changed. A
selected target that no longer matches the one the session admitted gets
its own admitted-identity check and keeps its reopen recovery.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and
the other inventory operations report a target that changed during the
read as artifact_changed (retryable, failure_kind changed) instead of
artifact_operation_failed. Admission-identity refusals report
integrity_check admitted-identity instead of container-identity.

* test(artifacts): expect admitted-identity for selections replaced before admission

A selected source replaced before admission fails the admitted-identity check rather than container-identity since the changed/admitted split.

* test(go): name the fixture and result when an MZ carrier is not refused through MCP

* test(verify): expect target failures for damaged ELF, core and EVM inputs in real-provider verifiers

The binary-layout, recorded-crash and EVM verifiers still expected invalid_input for malformed or truncated selected bytes. The pwntools and EVM adapters now report those as unsupported_target with failure_kind; a missing path remains invalid_input.

* test(web): expect the partial code for a refused source-map admission

The limit-cut code is partial; this Windows-lane test arrived from main with the old truncated spelling.

* test(errors): check the MCP target failure as the text clients receive

The stdio transport removes the private structured carrier from every isError result, so the conformance suite asserted a field that never reaches clients and failed every case. The projected diagnostic is checked from the JSON text instead.

* test(artifacts): expect artifact_changed when selected bytes change after inventory

Bundle resources replaced after open and unselected JavaScript sources rewritten after inventory now fail a change check, so they report artifact_changed with retry backoff rather than artifact_operation_failed.

* fix(errors): report a session digest mismatch as admitted-identity

The digest the session admitted does not change when the same request is
repeated, so targetDigestChangedFailure was inviting a backoff retry that
fails the same way. It now names admitted-identity, which stays
artifact_operation_failed and not retryable, and tells the caller to reopen.

Co-authored-by: morluto <[email protected]>

* fix(artifacts): classify unused PyInstaller compressed input as layout

zlib stops at the first complete stream, so a declared span that arrives
intact but is not fully consumed is trailing junk or a second stream, not
a file that changed. A source that ends before that span stays read-coverage.
The cached-carrier test replaces the file with a different size so a shared
timestamp cannot hide the rewrite.

Co-authored-by: morluto <[email protected]>

* test(applications): expect unsupported_target for a damaged trace stream

A trace member whose CRC fails is a malformed zip target. The partial
Evidence assertion now checks that code, failure_kind and format.

Co-authored-by: morluto <[email protected]>

* test(dylib): expect admitted-identity when the opened target is replaced

The session keeps the digest it admitted, so replacing the executable and
repeating trace_dylib_resolution is not a retryable container change.

Co-authored-by: morluto <[email protected]>

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: morluto <[email protected]>
morluto added a commit that referenced this pull request Nov 25, 2026
…as target failures (#14272)

* feat(errors)!: add the TargetFailure model, its projection table and conformance registry

Introduce one domain-owned TargetFailure value whose kind alone derives
the public code, category, retryability, recovery and details, for CLI
and MCP alike. Selected-file malformed and truncated refusals are the
first area on it: AnalysisMalformedTargetError is replaced by
AnalysisTargetFailureError, and ParseFailure's byte-structure variants
are TargetFailure variants rather than a parallel type.

The shared stableArtifactParserFailureCli loop is replaced by a
declarative registry (tests/support/targetFailure/readers/*.ts) and one
generated suite that runs every registered case through the CLI and MCP.

BREAKING CHANGE: selected-file malformed and truncated refusals add
details.failure_kind, and a truncated target's remediation now says to
re-acquire the complete file instead of choosing another target. Codes
are unchanged. Affected operations: every operation that refuses a
selected file's malformed or truncated bytes, including the ELF, PE,
Mach-O, DWARF, Go, Rust, BEAM, pyc, devicetree, Apple IPS, kernel
module, binary hardening, managed PE/CLI and IL2CPP readers.

* test(managed): name the target failure error in the merged status test

* docs(reference): name the error CSV instead of linking a non-page file

* fix(tests): expect the path reason for non-regular dyld inputs

#14225 refuses a non-regular dyld input as ArtifactReaderFailure("path");
dylibFileLifetime still expected "format" and fails on main's shard 9.

* fix(tests): expect io, invariant and path where #14225 reclassified

stableArtifact expected "format" for an impossible descriptor byte count
(now io) and an invalid chunk size (now InternalInvariantError);
directoryArtifactReaderOpen expected "format" for a non-file entry (now
path, the same change as #14238). All three fail on main.

* fix(errors)!: raise container reader byte faults as malformed or truncated targets

Delete the ambiguous `format` reason from ArtifactReaderFailure and
ArtifactOperationError. Each container reader now raises its owner's
fact once, through malformedArtifact / truncatedArtifact, with format,
offset, field and measured extents. Short reads inside a measured extent
are read-coverage integrity failures, path-kind refusals are `path`,
foreign or recovery-requiring inputs are `unsupported`, host tool output
is `io`, and REA defects are InternalInvariantError.

The trace, NTFS journal, release exposure, web capture, native macOS and
web artifact adapters project the reader's parsed facts as
AnalysisTargetFailureError instead of invalid_request. Inventory
malformed, truncated, unsupported and cancelled reasons take their code
from the TargetFailure projection table, so a truncated container is
unsupported_target with failure_kind "truncated" on both paths.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact,
analyze_javascript_application, inspect_desktop_application,
inspect_keyed_archive, inspect_asset_catalog, inspect_nuget_nupkg,
trace_dylib_resolution, trace_web_module_imports and
trace_web_source_location report damaged container bytes as
unsupported_target (details.reason "malformed" or "truncated", with
failure_kind and format) instead of artifact_operation_failed with
reason "format", and a truncated container as unsupported_target instead
of truncated. inspect_playwright_trace, inspect_ntfs_journal,
audit_release_exposure, the web capture inspection operations and the
caller-selected import and source maps report damaged selected bytes as
unsupported_target instead of invalid_request. The `format` reason no
longer appears in details.reason.

* test(artifacts): expect target failure codes in compiled CLI and MCP suites

* fix(errors)!: refuse malformed SQLite, pwntools and EVM inputs as target failures

The SQLite engine's `format` reason is renamed to `malformed` at its
owner (SQLITE_INSPECTION_REASONS), and its refusal becomes an
AnalysisTargetFailureError at the selected path with format "sqlite".
The pwntools and EVM worker replies keep their wire reason "format",
which their workers define, and the adapters translate it once into a
malformed target failure with the profile's format (elf, elf-core,
evm-bytecode) instead of an invalid_format argument issue. SQLite joins
the target-failure conformance registry.

BREAKING CHANGE: inspect_sqlite_database, inspect_binary_layout,
inspect_recorded_crash and inspect_evm_interface report a selected
file's malformed bytes as unsupported_target with details.failure_kind
"malformed", format_failure, format and path, instead of invalid_request
with an invalid_format issue on path.

* fix(errors): give the integrity kind a schema-valid code and list the reference page

artifact_integrity_mismatch's projection schema requires declared and
calculated digests, which a TargetFailure of kind integrity does not
carry, so the kind now projects artifact_operation_failed with category
integrity_mismatch. The model test validates every kind's projection
against analysisErrorProjectionSchema. The reference page joins the
documentation sidebar.

* fix(artifacts): report a short carrier read as a changed file and keep unsupported desktop probes local

A Bun or Node SEA short read inside a range already checked against the
measured size meant the file changed, not that it was truncated. The
carrier range reader and Bun's readExact now raise read-coverage
integrity for it, and keep 'outside the file' as the truncated case.
DesktopFileInspection records an unsupported managed-metadata probe as a
row issue again, so later file checks still run.

* test(errors): expect target failure facts in the pwntools and EVM reply suites

The literal-replacement scenario now reads the failure's detail instead
of an issues[] message, and a malformed reply wrapped by cleanup failure
reports category unsupported_target.

* test(errors): register PE DOS-signature and truncated IPS refusals and drop their per-command copies

The non-MZ PE imports and load-config cases (PE32/PE32+, ZZ and high-bit
signatures) and the truncated Apple IPS body move into the conformance
registry, which runs them through the CLI and MCP and now also checks
that a refusal leaves the selected file unchanged. The per-command tests
keep only their valid-image controls.

* test(sqlite): drop the malformed-database provider test the conformance registry covers

inspect_sqlite_database/not-a-database in the target-failure registry runs
the same non-SQLite bytes through the CLI and MCP, asserts the malformed
target facts and checks the selected file is unchanged.

* feat(errors)!: make failure_kind the identifier and derive code and retry from it

Apply the owner review on #14239 to the TargetFailure model:
- remove details.format_failure; failure_kind is the only identifier;
- give integrity, conflict and io their own codes
  (target_integrity_mismatch, input_conflict, host_io_failed) and derive
  inventory malformed, truncated and unsupported codes from the same table;
- add a retry hint (none, backoff, after_change) derived from the kind,
  with io refined by its transient errno fact; retryable stays the
  unchanged-retry flag and is true exactly for backoff;
- rename the limit-cut result code and category truncated to partial;
- drop cancelled and resource from the target kinds and spell
  identifiers in American English (unrecognized);
- return a target failure a tool handler throws as a projected isError
  result instead of letting the SDK flatten it to text.

BREAKING CHANGE: details.format_failure is removed (read
details.failure_kind). The truncated result code and category are now
partial. Target integrity failures report target_integrity_mismatch,
host read failures host_io_failed and disagreeing inputs input_conflict.
Inventory operations (inventory_artifact, inspect_artifact,
extract_artifact and the other inventory callers) report truncated
container bytes as unsupported_target. Every target failure carries a
top-level retry hint.

* test(sqlite): expect a malformed target for non-database bytes in the CLI suite

* fix(artifacts): keep changed-file short reads, invalid offsets and EOF declarations apart

PyInstaller reads inside the measured size, and .NET bundle manifest
refills, now raise read-coverage integrity on a zero-byte read instead of
truncated. A .NET bundle field and a Godot PCK directory entry that extend
past the file are truncated (with offset and extents) instead of
malformed. An absent or invalid ASAR packed offset is malformed; only a
valid range past the archive is truncated. The .NET manifest string
offset is reported in file coordinates.

* fix(pwntools): report a short ELF header as a truncated target

The layout and recorded-crash workers raise a distinct truncated reason
when the file ends inside the ELF identification or header, and the
decoder projects it as failure_kind truncated instead of inferring it
from the message.

* fix(errors)!: report managed coverage gaps and IL2CPP pair conflicts as target failures

Managed readers interpret an issue code once, in managedIssueTargetFailure:
a coverage gap is an unsupported target, every other rule violation is a
malformed target, and the inventory metadata status is derived from that
same fact. managedInspectionTargetFailure now returns only
AnalysisTargetFailureError.

An IL2CPP binary that parses but does not link to its metadata is a
conflict target failure that lists both inputs and blames neither, in
place of an invalid_request with two issue entries. Metadata version 108
is an unsupported target. The CLI spells each conflict input's field by
the command's option name.

BREAKING CHANGE: inspect_managed_artifact, inspect_managed_members,
inspect_managed_native_boundaries and the managed comparison operations
report unsupported metadata or signature forms as an
AnalysisTargetFailureError (failure_kind unsupported, format pe-cli,
field, offset) instead of a bare unsupported target. inspect_il2cpp_metadata
reports a binary/metadata pair that does not link as code input_conflict
with failure_kind conflict and details.inputs, instead of invalid_request
with details.issues, and metadata version 108 with failure_kind
unsupported.

* fix(artifacts): verify the carrier before blaming a short read on the bytes

The NTFS $MFT decoder, positional members (FIT, uImage, Bun, Deno) and
.NET bundle members now re-verify the source before reporting a short
stream as malformed, so a file that changed during the read reports the
change. The truncation site builds the model's measured extent.

* docs(il2cpp): describe pair conflicts as input_conflict with both inputs

* docs(android): name unsupported_target for truncated boot image structures

* fix(errors)!: report a target that changed during the read as failure_kind changed

Inventory integrity failures whose check means the target moved under the
read (container, member and unpacked-entry identity, read coverage,
traversal coverage) now take the model's changed projection: code
artifact_changed, retry backoff and details.failure_kind changed. A
selected target that no longer matches the one the session admitted gets
its own admitted-identity check and keeps its reopen recovery.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and
the other inventory operations report a target that changed during the
read as artifact_changed (retryable, failure_kind changed) instead of
artifact_operation_failed. Admission-identity refusals report
integrity_check admitted-identity instead of container-identity.

* test(artifacts): expect admitted-identity for selections replaced before admission

A selected source replaced before admission fails the admitted-identity check rather than container-identity since the changed/admitted split.

* test(go): name the fixture and result when an MZ carrier is not refused through MCP

* test(verify): expect target failures for damaged ELF, core and EVM inputs in real-provider verifiers

The binary-layout, recorded-crash and EVM verifiers still expected invalid_input for malformed or truncated selected bytes. The pwntools and EVM adapters now report those as unsupported_target with failure_kind; a missing path remains invalid_input.

* test(web): expect the partial code for a refused source-map admission

The limit-cut code is partial; this Windows-lane test arrived from main with the old truncated spelling.

* test(errors): check the MCP target failure as the text clients receive

The stdio transport removes the private structured carrier from every isError result, so the conformance suite asserted a field that never reaches clients and failed every case. The projected diagnostic is checked from the JSON text instead.

* test(artifacts): expect artifact_changed when selected bytes change after inventory

Bundle resources replaced after open and unselected JavaScript sources rewritten after inventory now fail a change check, so they report artifact_changed with retry backoff rather than artifact_operation_failed.

* fix(errors): report a session digest mismatch as admitted-identity

The digest the session admitted does not change when the same request is
repeated, so targetDigestChangedFailure was inviting a backoff retry that
fails the same way. It now names admitted-identity, which stays
artifact_operation_failed and not retryable, and tells the caller to reopen.

Co-authored-by: morluto <[email protected]>

* fix(artifacts): classify unused PyInstaller compressed input as layout

zlib stops at the first complete stream, so a declared span that arrives
intact but is not fully consumed is trailing junk or a second stream, not
a file that changed. A source that ends before that span stays read-coverage.
The cached-carrier test replaces the file with a different size so a shared
timestamp cannot hide the rewrite.

Co-authored-by: morluto <[email protected]>

* test(applications): expect unsupported_target for a damaged trace stream

A trace member whose CRC fails is a malformed zip target. The partial
Evidence assertion now checks that code, failure_kind and format.

Co-authored-by: morluto <[email protected]>

* test(dylib): expect admitted-identity when the opened target is replaced

The session keeps the digest it admitted, so replacing the executable and
repeating trace_dylib_resolution is not a retryable container change.

Co-authored-by: morluto <[email protected]>

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: morluto <[email protected]>
morluto added a commit that referenced this pull request Nov 25, 2026
…ected path (#14277)

* feat(errors)!: add the TargetFailure model, its projection table and conformance registry

Introduce one domain-owned TargetFailure value whose kind alone derives
the public code, category, retryability, recovery and details, for CLI
and MCP alike. Selected-file malformed and truncated refusals are the
first area on it: AnalysisMalformedTargetError is replaced by
AnalysisTargetFailureError, and ParseFailure's byte-structure variants
are TargetFailure variants rather than a parallel type.

The shared stableArtifactParserFailureCli loop is replaced by a
declarative registry (tests/support/targetFailure/readers/*.ts) and one
generated suite that runs every registered case through the CLI and MCP.

BREAKING CHANGE: selected-file malformed and truncated refusals add
details.failure_kind, and a truncated target's remediation now says to
re-acquire the complete file instead of choosing another target. Codes
are unchanged. Affected operations: every operation that refuses a
selected file's malformed or truncated bytes, including the ELF, PE,
Mach-O, DWARF, Go, Rust, BEAM, pyc, devicetree, Apple IPS, kernel
module, binary hardening, managed PE/CLI and IL2CPP readers.

* test(managed): name the target failure error in the merged status test

* docs(reference): name the error CSV instead of linking a non-page file

* fix(tests): expect the path reason for non-regular dyld inputs

#14225 refuses a non-regular dyld input as ArtifactReaderFailure("path");
dylibFileLifetime still expected "format" and fails on main's shard 9.

* fix(tests): expect io, invariant and path where #14225 reclassified

stableArtifact expected "format" for an impossible descriptor byte count
(now io) and an invalid chunk size (now InternalInvariantError);
directoryArtifactReaderOpen expected "format" for a non-file entry (now
path, the same change as #14238). All three fail on main.

* fix(errors)!: raise container reader byte faults as malformed or truncated targets

Delete the ambiguous `format` reason from ArtifactReaderFailure and
ArtifactOperationError. Each container reader now raises its owner's
fact once, through malformedArtifact / truncatedArtifact, with format,
offset, field and measured extents. Short reads inside a measured extent
are read-coverage integrity failures, path-kind refusals are `path`,
foreign or recovery-requiring inputs are `unsupported`, host tool output
is `io`, and REA defects are InternalInvariantError.

The trace, NTFS journal, release exposure, web capture, native macOS and
web artifact adapters project the reader's parsed facts as
AnalysisTargetFailureError instead of invalid_request. Inventory
malformed, truncated, unsupported and cancelled reasons take their code
from the TargetFailure projection table, so a truncated container is
unsupported_target with failure_kind "truncated" on both paths.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact,
analyze_javascript_application, inspect_desktop_application,
inspect_keyed_archive, inspect_asset_catalog, inspect_nuget_nupkg,
trace_dylib_resolution, trace_web_module_imports and
trace_web_source_location report damaged container bytes as
unsupported_target (details.reason "malformed" or "truncated", with
failure_kind and format) instead of artifact_operation_failed with
reason "format", and a truncated container as unsupported_target instead
of truncated. inspect_playwright_trace, inspect_ntfs_journal,
audit_release_exposure, the web capture inspection operations and the
caller-selected import and source maps report damaged selected bytes as
unsupported_target instead of invalid_request. The `format` reason no
longer appears in details.reason.

* test(artifacts): expect target failure codes in compiled CLI and MCP suites

* fix(errors)!: refuse malformed SQLite, pwntools and EVM inputs as target failures

The SQLite engine's `format` reason is renamed to `malformed` at its
owner (SQLITE_INSPECTION_REASONS), and its refusal becomes an
AnalysisTargetFailureError at the selected path with format "sqlite".
The pwntools and EVM worker replies keep their wire reason "format",
which their workers define, and the adapters translate it once into a
malformed target failure with the profile's format (elf, elf-core,
evm-bytecode) instead of an invalid_format argument issue. SQLite joins
the target-failure conformance registry.

BREAKING CHANGE: inspect_sqlite_database, inspect_binary_layout,
inspect_recorded_crash and inspect_evm_interface report a selected
file's malformed bytes as unsupported_target with details.failure_kind
"malformed", format_failure, format and path, instead of invalid_request
with an invalid_format issue on path.

* fix(errors): give the integrity kind a schema-valid code and list the reference page

artifact_integrity_mismatch's projection schema requires declared and
calculated digests, which a TargetFailure of kind integrity does not
carry, so the kind now projects artifact_operation_failed with category
integrity_mismatch. The model test validates every kind's projection
against analysisErrorProjectionSchema. The reference page joins the
documentation sidebar.

* fix(artifacts): report a short carrier read as a changed file and keep unsupported desktop probes local

A Bun or Node SEA short read inside a range already checked against the
measured size meant the file changed, not that it was truncated. The
carrier range reader and Bun's readExact now raise read-coverage
integrity for it, and keep 'outside the file' as the truncated case.
DesktopFileInspection records an unsupported managed-metadata probe as a
row issue again, so later file checks still run.

* test(errors): expect target failure facts in the pwntools and EVM reply suites

The literal-replacement scenario now reads the failure's detail instead
of an issues[] message, and a malformed reply wrapped by cleanup failure
reports category unsupported_target.

* test(errors): register PE DOS-signature and truncated IPS refusals and drop their per-command copies

The non-MZ PE imports and load-config cases (PE32/PE32+, ZZ and high-bit
signatures) and the truncated Apple IPS body move into the conformance
registry, which runs them through the CLI and MCP and now also checks
that a refusal leaves the selected file unchanged. The per-command tests
keep only their valid-image controls.

* test(sqlite): drop the malformed-database provider test the conformance registry covers

inspect_sqlite_database/not-a-database in the target-failure registry runs
the same non-SQLite bytes through the CLI and MCP, asserts the malformed
target facts and checks the selected file is unchanged.

* feat(errors)!: make failure_kind the identifier and derive code and retry from it

Apply the owner review on #14239 to the TargetFailure model:
- remove details.format_failure; failure_kind is the only identifier;
- give integrity, conflict and io their own codes
  (target_integrity_mismatch, input_conflict, host_io_failed) and derive
  inventory malformed, truncated and unsupported codes from the same table;
- add a retry hint (none, backoff, after_change) derived from the kind,
  with io refined by its transient errno fact; retryable stays the
  unchanged-retry flag and is true exactly for backoff;
- rename the limit-cut result code and category truncated to partial;
- drop cancelled and resource from the target kinds and spell
  identifiers in American English (unrecognized);
- return a target failure a tool handler throws as a projected isError
  result instead of letting the SDK flatten it to text.

BREAKING CHANGE: details.format_failure is removed (read
details.failure_kind). The truncated result code and category are now
partial. Target integrity failures report target_integrity_mismatch,
host read failures host_io_failed and disagreeing inputs input_conflict.
Inventory operations (inventory_artifact, inspect_artifact,
extract_artifact and the other inventory callers) report truncated
container bytes as unsupported_target. Every target failure carries a
top-level retry hint.

* test(sqlite): expect a malformed target for non-database bytes in the CLI suite

* fix(artifacts): keep changed-file short reads, invalid offsets and EOF declarations apart

PyInstaller reads inside the measured size, and .NET bundle manifest
refills, now raise read-coverage integrity on a zero-byte read instead of
truncated. A .NET bundle field and a Godot PCK directory entry that extend
past the file are truncated (with offset and extents) instead of
malformed. An absent or invalid ASAR packed offset is malformed; only a
valid range past the archive is truncated. The .NET manifest string
offset is reported in file coordinates.

* fix(pwntools): report a short ELF header as a truncated target

The layout and recorded-crash workers raise a distinct truncated reason
when the file ends inside the ELF identification or header, and the
decoder projects it as failure_kind truncated instead of inferring it
from the message.

* fix(errors)!: report managed coverage gaps and IL2CPP pair conflicts as target failures

Managed readers interpret an issue code once, in managedIssueTargetFailure:
a coverage gap is an unsupported target, every other rule violation is a
malformed target, and the inventory metadata status is derived from that
same fact. managedInspectionTargetFailure now returns only
AnalysisTargetFailureError.

An IL2CPP binary that parses but does not link to its metadata is a
conflict target failure that lists both inputs and blames neither, in
place of an invalid_request with two issue entries. Metadata version 108
is an unsupported target. The CLI spells each conflict input's field by
the command's option name.

BREAKING CHANGE: inspect_managed_artifact, inspect_managed_members,
inspect_managed_native_boundaries and the managed comparison operations
report unsupported metadata or signature forms as an
AnalysisTargetFailureError (failure_kind unsupported, format pe-cli,
field, offset) instead of a bare unsupported target. inspect_il2cpp_metadata
reports a binary/metadata pair that does not link as code input_conflict
with failure_kind conflict and details.inputs, instead of invalid_request
with details.issues, and metadata version 108 with failure_kind
unsupported.

* fix(artifacts): verify the carrier before blaming a short read on the bytes

The NTFS $MFT decoder, positional members (FIT, uImage, Bun, Deno) and
.NET bundle members now re-verify the source before reporting a short
stream as malformed, so a file that changed during the read reports the
change. The truncation site builds the model's measured extent.

* fix(errors)!: report inventory refusals as target failures of the selected path

An inventory, inspection or extraction refused damaged or unsupported
container bytes as an ArtifactOperationError whose reason repeated the
format owner's kind. It carried no path or retry hint, so the conformance
registry could not express container cases.

translateArtifactFailure now takes the selected path and returns the
reader's TargetFailure as an AnalysisTargetFailureError. The malformed,
truncated and unsupported reasons, their classification rows and their
presentation branch are deleted from ArtifactOperationError. Readers'
unsupported refusals carry their format facts through unsupportedArtifact.

Container cases move into the conformance registry, which now opens the
target first for session tools such as inspect_artifact.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and
the bundle readers report a refused container as a target failure of
details.path with a top-level retry. details.reason is the owner's
description and details.detail is removed.

* docs(il2cpp): describe pair conflicts as input_conflict with both inputs

* docs(android): name unsupported_target for truncated boot image structures

* fix(errors)!: report a target that changed during the read as failure_kind changed

Inventory integrity failures whose check means the target moved under the
read (container, member and unpacked-entry identity, read coverage,
traversal coverage) now take the model's changed projection: code
artifact_changed, retry backoff and details.failure_kind changed. A
selected target that no longer matches the one the session admitted gets
its own admitted-identity check and keeps its reopen recovery.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and
the other inventory operations report a target that changed during the
read as artifact_changed (retryable, failure_kind changed) instead of
artifact_operation_failed. Admission-identity refusals report
integrity_check admitted-identity instead of container-identity.

* test(artifacts): raise the cleanup fixture's decode refusal with its format facts

* test(artifacts): expect admitted-identity for selections replaced before admission

A selected source replaced before admission fails the admitted-identity check rather than container-identity since the changed/admitted split.

* test(go): name the fixture and result when an MZ carrier is not refused through MCP

* test(verify): expect target failures for damaged ELF, core and EVM inputs in real-provider verifiers

The binary-layout, recorded-crash and EVM verifiers still expected invalid_input for malformed or truncated selected bytes. The pwntools and EVM adapters now report those as unsupported_target with failure_kind; a missing path remains invalid_input.

* test(web): expect the partial code for a refused source-map admission

The limit-cut code is partial; this Windows-lane test arrived from main with the old truncated spelling.

* fix(artifacts): keep refusal facts on DMG verdicts and the selected bundle path

hdiutil's "image not recognized" verdict raised the unsupported reason
without the owner's facts, so the inventory translation treated it as a
reader defect. It now carries an unsupported dmg target failure, and the
reader-failure constructor requires facts for every target reason.

A bundle resource refusal names the caller's selected bundle path rather
than its resolved target.

The real-provider verifiers and the Android, source-location acceptance
tests expect the model's target-failure categories and codes.

* test(errors): check the MCP target failure as the text clients receive

The stdio transport removes the private structured carrier from every isError result, so the conformance suite asserted a field that never reaches clients and failed every case. The projected diagnostic is checked from the JSON text instead.

* test(artifacts): expect artifact_changed when selected bytes change after inventory

Bundle resources replaced after open and unselected JavaScript sources rewritten after inventory now fail a change check, so they report artifact_changed with retry backoff rather than artifact_operation_failed.

* fix(errors): report a session digest mismatch as admitted-identity

The digest the session admitted does not change when the same request is
repeated, so targetDigestChangedFailure was inviting a backoff retry that
fails the same way. It now names admitted-identity, which stays
artifact_operation_failed and not retryable, and tells the caller to reopen.

Co-authored-by: morluto <[email protected]>

* fix(artifacts): classify unused PyInstaller compressed input as layout

zlib stops at the first complete stream, so a declared span that arrives
intact but is not fully consumed is trailing junk or a second stream, not
a file that changed. A source that ends before that span stays read-coverage.
The cached-carrier test replaces the file with a different size so a shared
timestamp cannot hide the rewrite.

Co-authored-by: morluto <[email protected]>

* test(applications): expect unsupported_target for a damaged trace stream

A trace member whose CRC fails is a malformed zip target. The partial
Evidence assertion now checks that code, failure_kind and format.

Co-authored-by: morluto <[email protected]>

* test(artifacts): assert Android refusal kinds and drop the SEA registry case

details.reason is the owner's description, so the boot-image refusals
assert failure_kind and format. A malformed SEA blob inside an ELF stays
an outer-format inventory with a recognition limitation, which the Node
SEA reader tests already cover, so it is not an inspect_artifact refusal.

Co-authored-by: morluto <[email protected]>

* fix(artifacts): pass the selected path into translated target failures

translateArtifactFailure names the caller-selected path on a format
refusal. Directory inspection and a retained artifact scope both know
that path and now supply it.

Co-authored-by: morluto <[email protected]>

* test(dylib): expect admitted-identity when the opened target is replaced

The session keeps the digest it admitted, so replacing the executable and
repeating trace_dylib_resolution is not a retryable container change.

Co-authored-by: morluto <[email protected]>

* style: format the inventory path translation and conformance suite

* test(errors): expect target failures for ZIP inventory refusals and input_conflict for an unlinked IL2CPP pair

* test(web): expect a malformed target failure on the captured source path

* test(artifacts): expect a malformed ZIP target failure for a corrupt Zstandard member

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: morluto <[email protected]>
morluto added a commit that referenced this pull request Nov 25, 2026
…etFailure model (#14281)

* feat(errors)!: add the TargetFailure model, its projection table and conformance registry

Introduce one domain-owned TargetFailure value whose kind alone derives
the public code, category, retryability, recovery and details, for CLI
and MCP alike. Selected-file malformed and truncated refusals are the
first area on it: AnalysisMalformedTargetError is replaced by
AnalysisTargetFailureError, and ParseFailure's byte-structure variants
are TargetFailure variants rather than a parallel type.

The shared stableArtifactParserFailureCli loop is replaced by a
declarative registry (tests/support/targetFailure/readers/*.ts) and one
generated suite that runs every registered case through the CLI and MCP.

BREAKING CHANGE: selected-file malformed and truncated refusals add
details.failure_kind, and a truncated target's remediation now says to
re-acquire the complete file instead of choosing another target. Codes
are unchanged. Affected operations: every operation that refuses a
selected file's malformed or truncated bytes, including the ELF, PE,
Mach-O, DWARF, Go, Rust, BEAM, pyc, devicetree, Apple IPS, kernel
module, binary hardening, managed PE/CLI and IL2CPP readers.

* test(managed): name the target failure error in the merged status test

* docs(reference): name the error CSV instead of linking a non-page file

* fix(tests): expect the path reason for non-regular dyld inputs

#14225 refuses a non-regular dyld input as ArtifactReaderFailure("path");
dylibFileLifetime still expected "format" and fails on main's shard 9.

* fix(tests): expect io, invariant and path where #14225 reclassified

stableArtifact expected "format" for an impossible descriptor byte count
(now io) and an invalid chunk size (now InternalInvariantError);
directoryArtifactReaderOpen expected "format" for a non-file entry (now
path, the same change as #14238). All three fail on main.

* fix(errors)!: raise container reader byte faults as malformed or truncated targets

Delete the ambiguous `format` reason from ArtifactReaderFailure and
ArtifactOperationError. Each container reader now raises its owner's
fact once, through malformedArtifact / truncatedArtifact, with format,
offset, field and measured extents. Short reads inside a measured extent
are read-coverage integrity failures, path-kind refusals are `path`,
foreign or recovery-requiring inputs are `unsupported`, host tool output
is `io`, and REA defects are InternalInvariantError.

The trace, NTFS journal, release exposure, web capture, native macOS and
web artifact adapters project the reader's parsed facts as
AnalysisTargetFailureError instead of invalid_request. Inventory
malformed, truncated, unsupported and cancelled reasons take their code
from the TargetFailure projection table, so a truncated container is
unsupported_target with failure_kind "truncated" on both paths.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact,
analyze_javascript_application, inspect_desktop_application,
inspect_keyed_archive, inspect_asset_catalog, inspect_nuget_nupkg,
trace_dylib_resolution, trace_web_module_imports and
trace_web_source_location report damaged container bytes as
unsupported_target (details.reason "malformed" or "truncated", with
failure_kind and format) instead of artifact_operation_failed with
reason "format", and a truncated container as unsupported_target instead
of truncated. inspect_playwright_trace, inspect_ntfs_journal,
audit_release_exposure, the web capture inspection operations and the
caller-selected import and source maps report damaged selected bytes as
unsupported_target instead of invalid_request. The `format` reason no
longer appears in details.reason.

* test(artifacts): expect target failure codes in compiled CLI and MCP suites

* fix(errors)!: refuse malformed SQLite, pwntools and EVM inputs as target failures

The SQLite engine's `format` reason is renamed to `malformed` at its
owner (SQLITE_INSPECTION_REASONS), and its refusal becomes an
AnalysisTargetFailureError at the selected path with format "sqlite".
The pwntools and EVM worker replies keep their wire reason "format",
which their workers define, and the adapters translate it once into a
malformed target failure with the profile's format (elf, elf-core,
evm-bytecode) instead of an invalid_format argument issue. SQLite joins
the target-failure conformance registry.

BREAKING CHANGE: inspect_sqlite_database, inspect_binary_layout,
inspect_recorded_crash and inspect_evm_interface report a selected
file's malformed bytes as unsupported_target with details.failure_kind
"malformed", format_failure, format and path, instead of invalid_request
with an invalid_format issue on path.

* fix(errors): give the integrity kind a schema-valid code and list the reference page

artifact_integrity_mismatch's projection schema requires declared and
calculated digests, which a TargetFailure of kind integrity does not
carry, so the kind now projects artifact_operation_failed with category
integrity_mismatch. The model test validates every kind's projection
against analysisErrorProjectionSchema. The reference page joins the
documentation sidebar.

* fix(artifacts): report a short carrier read as a changed file and keep unsupported desktop probes local

A Bun or Node SEA short read inside a range already checked against the
measured size meant the file changed, not that it was truncated. The
carrier range reader and Bun's readExact now raise read-coverage
integrity for it, and keep 'outside the file' as the truncated case.
DesktopFileInspection records an unsupported managed-metadata probe as a
row issue again, so later file checks still run.

* test(errors): expect target failure facts in the pwntools and EVM reply suites

The literal-replacement scenario now reads the failure's detail instead
of an issues[] message, and a malformed reply wrapped by cleanup failure
reports category unsupported_target.

* test(errors): register PE DOS-signature and truncated IPS refusals and drop their per-command copies

The non-MZ PE imports and load-config cases (PE32/PE32+, ZZ and high-bit
signatures) and the truncated Apple IPS body move into the conformance
registry, which runs them through the CLI and MCP and now also checks
that a refusal leaves the selected file unchanged. The per-command tests
keep only their valid-image controls.

* test(sqlite): drop the malformed-database provider test the conformance registry covers

inspect_sqlite_database/not-a-database in the target-failure registry runs
the same non-SQLite bytes through the CLI and MCP, asserts the malformed
target facts and checks the selected file is unchanged.

* feat(errors)!: make failure_kind the identifier and derive code and retry from it

Apply the owner review on #14239 to the TargetFailure model:
- remove details.format_failure; failure_kind is the only identifier;
- give integrity, conflict and io their own codes
  (target_integrity_mismatch, input_conflict, host_io_failed) and derive
  inventory malformed, truncated and unsupported codes from the same table;
- add a retry hint (none, backoff, after_change) derived from the kind,
  with io refined by its transient errno fact; retryable stays the
  unchanged-retry flag and is true exactly for backoff;
- rename the limit-cut result code and category truncated to partial;
- drop cancelled and resource from the target kinds and spell
  identifiers in American English (unrecognized);
- return a target failure a tool handler throws as a projected isError
  result instead of letting the SDK flatten it to text.

BREAKING CHANGE: details.format_failure is removed (read
details.failure_kind). The truncated result code and category are now
partial. Target integrity failures report target_integrity_mismatch,
host read failures host_io_failed and disagreeing inputs input_conflict.
Inventory operations (inventory_artifact, inspect_artifact,
extract_artifact and the other inventory callers) report truncated
container bytes as unsupported_target. Every target failure carries a
top-level retry hint.

* test(sqlite): expect a malformed target for non-database bytes in the CLI suite

* fix(artifacts): keep changed-file short reads, invalid offsets and EOF declarations apart

PyInstaller reads inside the measured size, and .NET bundle manifest
refills, now raise read-coverage integrity on a zero-byte read instead of
truncated. A .NET bundle field and a Godot PCK directory entry that extend
past the file are truncated (with offset and extents) instead of
malformed. An absent or invalid ASAR packed offset is malformed; only a
valid range past the archive is truncated. The .NET manifest string
offset is reported in file coordinates.

* fix(pwntools): report a short ELF header as a truncated target

The layout and recorded-crash workers raise a distinct truncated reason
when the file ends inside the ELF identification or header, and the
decoder projects it as failure_kind truncated instead of inferring it
from the message.

* fix(errors)!: report managed coverage gaps and IL2CPP pair conflicts as target failures

Managed readers interpret an issue code once, in managedIssueTargetFailure:
a coverage gap is an unsupported target, every other rule violation is a
malformed target, and the inventory metadata status is derived from that
same fact. managedInspectionTargetFailure now returns only
AnalysisTargetFailureError.

An IL2CPP binary that parses but does not link to its metadata is a
conflict target failure that lists both inputs and blames neither, in
place of an invalid_request with two issue entries. Metadata version 108
is an unsupported target. The CLI spells each conflict input's field by
the command's option name.

BREAKING CHANGE: inspect_managed_artifact, inspect_managed_members,
inspect_managed_native_boundaries and the managed comparison operations
report unsupported metadata or signature forms as an
AnalysisTargetFailureError (failure_kind unsupported, format pe-cli,
field, offset) instead of a bare unsupported target. inspect_il2cpp_metadata
reports a binary/metadata pair that does not link as code input_conflict
with failure_kind conflict and details.inputs, instead of invalid_request
with details.issues, and metadata version 108 with failure_kind
unsupported.

* fix(artifacts): verify the carrier before blaming a short read on the bytes

The NTFS $MFT decoder, positional members (FIT, uImage, Bun, Deno) and
.NET bundle members now re-verify the source before reporting a short
stream as malformed, so a file that changed during the read reports the
change. The truncation site builds the model's measured extent.

* fix(errors)!: report inventory refusals as target failures of the selected path

An inventory, inspection or extraction refused damaged or unsupported
container bytes as an ArtifactOperationError whose reason repeated the
format owner's kind. It carried no path or retry hint, so the conformance
registry could not express container cases.

translateArtifactFailure now takes the selected path and returns the
reader's TargetFailure as an AnalysisTargetFailureError. The malformed,
truncated and unsupported reasons, their classification rows and their
presentation branch are deleted from ArtifactOperationError. Readers'
unsupported refusals carry their format facts through unsupportedArtifact.

Container cases move into the conformance registry, which now opens the
target first for session tools such as inspect_artifact.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and
the bundle readers report a refused container as a target failure of
details.path with a top-level retry. details.reason is the owner's
description and details.detail is removed.

* docs(il2cpp): describe pair conflicts as input_conflict with both inputs

* docs(android): name unsupported_target for truncated boot image structures

* fix(errors)!: report a target that changed during the read as failure_kind changed

Inventory integrity failures whose check means the target moved under the
read (container, member and unpacked-entry identity, read coverage,
traversal coverage) now take the model's changed projection: code
artifact_changed, retry backoff and details.failure_kind changed. A
selected target that no longer matches the one the session admitted gets
its own admitted-identity check and keeps its reopen recovery.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and
the other inventory operations report a target that changed during the
read as artifact_changed (retryable, failure_kind changed) instead of
artifact_operation_failed. Admission-identity refusals report
integrity_check admitted-identity instead of container-identity.

* test(artifacts): raise the cleanup fixture's decode refusal with its format facts

* fix(errors)!: report unsupported and unrecognized targets on the TargetFailure model

AnalysisUnsupportedTargetError carried a free-text reason and remediation
beside the TargetFailure model, so unsupported refusals had no format,
failure_kind or retry hint, and their recovery was prose written at each
producer.

The class is deleted. Producers raise unsupportedTarget or
unrecognizedTarget with the owner's format, and consumers read
targetFailureOfKind. The projection table renders the recovery and names
the operations the owner lists in related.operations. The foreign-bytes
identity loop moves into the conformance registry.

BREAKING CHANGE: unsupported and unrecognized targets report
failure_kind, format and retry. Their remediation comes from the
target-failure table; producer-written remediation sentences are folded
into details.reason or replaced by details.related_operations.

* test(artifacts): expect admitted-identity for selections replaced before admission

A selected source replaced before admission fails the admitted-identity check rather than container-identity since the changed/admitted split.

* test(go): name the fixture and result when an MZ carrier is not refused through MCP

* style: format the migrated target-failure tests

* test(errors): expect the PE readers' native-binary format label for foreign bytes

* test(verify): expect target failures for damaged ELF, core and EVM inputs in real-provider verifiers

The binary-layout, recorded-crash and EVM verifiers still expected invalid_input for malformed or truncated selected bytes. The pwntools and EVM adapters now report those as unsupported_target with failure_kind; a missing path remains invalid_input.

* test(web): expect the partial code for a refused source-map admission

The limit-cut code is partial; this Windows-lane test arrived from main with the old truncated spelling.

* fix(artifacts): keep refusal facts on DMG verdicts and the selected bundle path

hdiutil's "image not recognized" verdict raised the unsupported reason
without the owner's facts, so the inventory translation treated it as a
reader defect. It now carries an unsupported dmg target failure, and the
reader-failure constructor requires facts for every target reason.

A bundle resource refusal names the caller's selected bundle path rather
than its resolved target.

The real-provider verifiers and the Android, source-location acceptance
tests expect the model's target-failure categories and codes.

* test(errors): assert unsupported refusals' kind and format, and align verifiers and the Electron guide

* test(errors): check the MCP target failure as the text clients receive

The stdio transport removes the private structured carrier from every isError result, so the conformance suite asserted a field that never reaches clients and failed every case. The projected diagnostic is checked from the JSON text instead.

* test(errors): raise main's new unsupported-target fixtures through the model

* test(artifacts): expect artifact_changed when selected bytes change after inventory

Bundle resources replaced after open and unselected JavaScript sources rewritten after inventory now fail a change check, so they report artifact_changed with retry backoff rather than artifact_operation_failed.

* fix(errors): report a session digest mismatch as admitted-identity

The digest the session admitted does not change when the same request is
repeated, so targetDigestChangedFailure was inviting a backoff retry that
fails the same way. It now names admitted-identity, which stays
artifact_operation_failed and not retryable, and tells the caller to reopen.

Co-authored-by: morluto <[email protected]>

* fix(artifacts): classify unused PyInstaller compressed input as layout

zlib stops at the first complete stream, so a declared span that arrives
intact but is not fully consumed is trailing junk or a second stream, not
a file that changed. A source that ends before that span stays read-coverage.
The cached-carrier test replaces the file with a different size so a shared
timestamp cannot hide the rewrite.

Co-authored-by: morluto <[email protected]>

* test(applications): expect unsupported_target for a damaged trace stream

A trace member whose CRC fails is a malformed zip target. The partial
Evidence assertion now checks that code, failure_kind and format.

Co-authored-by: morluto <[email protected]>

* test(artifacts): assert Android refusal kinds and drop the SEA registry case

details.reason is the owner's description, so the boot-image refusals
assert failure_kind and format. A malformed SEA blob inside an ELF stays
an outer-format inventory with a recognition limitation, which the Node
SEA reader tests already cover, so it is not an inspect_artifact refusal.

Co-authored-by: morluto <[email protected]>

* fix(artifacts): pass the selected path into translated target failures

translateArtifactFailure names the caller-selected path on a format
refusal. Directory inspection and a retained artifact scope both know
that path and now supply it.

Co-authored-by: morluto <[email protected]>

* fix(artifacts): charge global pax records against the tar metadata budget

Repeated pax global headers were copied into one map without a charge, so
each header could stay inside the extended-header allowance while the map
grew without a bound. The retained metadata budget is charged for the
merged map's keys, values and entries before that map is allocated.

Co-authored-by: morluto <[email protected]>

* test(dylib): expect admitted-identity when the opened target is replaced

The session keeps the digest it admitted, so replacing the executable and
repeating trace_dylib_resolution is not a retryable container change.

Co-authored-by: morluto <[email protected]>

* style: format the inventory path translation and conformance suite

* fix(artifacts): keep the unsupported-target migration in files the inventory merge replaced

* test(errors): expect target failures for ZIP inventory refusals and input_conflict for an unlinked IL2CPP pair

* test(artifacts): expect a malformed target failure for an ISO 9660 directory cycle

* test(web): expect a malformed target failure on the captured source path

* test(artifacts): expect a malformed ZIP target failure for a corrupt Zstandard member

* test(javascript): read the owner's input facts from details.reason and recovery from the projection

* test(iso9660): assert the malformed target failure fields

details.reason is the owner's description. The compiled CLI refusal is
identified by failure_kind and format.

Co-authored-by: morluto <[email protected]>

* test(errors): assert selection and unsupported view fields

A desktop root that is not a directory is a selection failure, so the
CLI reports invalid_request. An analysis view the parent cannot supply
is unsupported evidence; the tests read failure_kind, format, field and
related_operations.

Co-authored-by: morluto <[email protected]>

* fix(errors): keep binary plist UID facts on unsupported targets

Pass the reader's UnsupportedBinaryPlistUidError failure through instead of
rebuilding a bplist refusal that drops field and undecodedContent.

Co-authored-by: morluto <[email protected]>

* test(errors): keep oversized binary plist UID facts on keyed archives

Assert the reader projects format, field, and undecoded content from the
parser failure instead of a rebuilt bplist refusal.

Co-authored-by: morluto <[email protected]>

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: morluto <[email protected]>
cursor Bot pushed a commit that referenced this pull request Nov 25, 2026
…tions (#14289)

* feat(errors)!: add the TargetFailure model, its projection table and conformance registry

Introduce one domain-owned TargetFailure value whose kind alone derives
the public code, category, retryability, recovery and details, for CLI
and MCP alike. Selected-file malformed and truncated refusals are the
first area on it: AnalysisMalformedTargetError is replaced by
AnalysisTargetFailureError, and ParseFailure's byte-structure variants
are TargetFailure variants rather than a parallel type.

The shared stableArtifactParserFailureCli loop is replaced by a
declarative registry (tests/support/targetFailure/readers/*.ts) and one
generated suite that runs every registered case through the CLI and MCP.

BREAKING CHANGE: selected-file malformed and truncated refusals add
details.failure_kind, and a truncated target's remediation now says to
re-acquire the complete file instead of choosing another target. Codes
are unchanged. Affected operations: every operation that refuses a
selected file's malformed or truncated bytes, including the ELF, PE,
Mach-O, DWARF, Go, Rust, BEAM, pyc, devicetree, Apple IPS, kernel
module, binary hardening, managed PE/CLI and IL2CPP readers.

* test(managed): name the target failure error in the merged status test

* docs(reference): name the error CSV instead of linking a non-page file

* fix(tests): expect the path reason for non-regular dyld inputs

#14225 refuses a non-regular dyld input as ArtifactReaderFailure("path");
dylibFileLifetime still expected "format" and fails on main's shard 9.

* fix(tests): expect io, invariant and path where #14225 reclassified

stableArtifact expected "format" for an impossible descriptor byte count
(now io) and an invalid chunk size (now InternalInvariantError);
directoryArtifactReaderOpen expected "format" for a non-file entry (now
path, the same change as #14238). All three fail on main.

* fix(errors)!: raise container reader byte faults as malformed or truncated targets

Delete the ambiguous `format` reason from ArtifactReaderFailure and
ArtifactOperationError. Each container reader now raises its owner's
fact once, through malformedArtifact / truncatedArtifact, with format,
offset, field and measured extents. Short reads inside a measured extent
are read-coverage integrity failures, path-kind refusals are `path`,
foreign or recovery-requiring inputs are `unsupported`, host tool output
is `io`, and REA defects are InternalInvariantError.

The trace, NTFS journal, release exposure, web capture, native macOS and
web artifact adapters project the reader's parsed facts as
AnalysisTargetFailureError instead of invalid_request. Inventory
malformed, truncated, unsupported and cancelled reasons take their code
from the TargetFailure projection table, so a truncated container is
unsupported_target with failure_kind "truncated" on both paths.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact,
analyze_javascript_application, inspect_desktop_application,
inspect_keyed_archive, inspect_asset_catalog, inspect_nuget_nupkg,
trace_dylib_resolution, trace_web_module_imports and
trace_web_source_location report damaged container bytes as
unsupported_target (details.reason "malformed" or "truncated", with
failure_kind and format) instead of artifact_operation_failed with
reason "format", and a truncated container as unsupported_target instead
of truncated. inspect_playwright_trace, inspect_ntfs_journal,
audit_release_exposure, the web capture inspection operations and the
caller-selected import and source maps report damaged selected bytes as
unsupported_target instead of invalid_request. The `format` reason no
longer appears in details.reason.

* test(artifacts): expect target failure codes in compiled CLI and MCP suites

* fix(errors)!: refuse malformed SQLite, pwntools and EVM inputs as target failures

The SQLite engine's `format` reason is renamed to `malformed` at its
owner (SQLITE_INSPECTION_REASONS), and its refusal becomes an
AnalysisTargetFailureError at the selected path with format "sqlite".
The pwntools and EVM worker replies keep their wire reason "format",
which their workers define, and the adapters translate it once into a
malformed target failure with the profile's format (elf, elf-core,
evm-bytecode) instead of an invalid_format argument issue. SQLite joins
the target-failure conformance registry.

BREAKING CHANGE: inspect_sqlite_database, inspect_binary_layout,
inspect_recorded_crash and inspect_evm_interface report a selected
file's malformed bytes as unsupported_target with details.failure_kind
"malformed", format_failure, format and path, instead of invalid_request
with an invalid_format issue on path.

* fix(errors): give the integrity kind a schema-valid code and list the reference page

artifact_integrity_mismatch's projection schema requires declared and
calculated digests, which a TargetFailure of kind integrity does not
carry, so the kind now projects artifact_operation_failed with category
integrity_mismatch. The model test validates every kind's projection
against analysisErrorProjectionSchema. The reference page joins the
documentation sidebar.

* fix(artifacts): report a short carrier read as a changed file and keep unsupported desktop probes local

A Bun or Node SEA short read inside a range already checked against the
measured size meant the file changed, not that it was truncated. The
carrier range reader and Bun's readExact now raise read-coverage
integrity for it, and keep 'outside the file' as the truncated case.
DesktopFileInspection records an unsupported managed-metadata probe as a
row issue again, so later file checks still run.

* test(errors): expect target failure facts in the pwntools and EVM reply suites

The literal-replacement scenario now reads the failure's detail instead
of an issues[] message, and a malformed reply wrapped by cleanup failure
reports category unsupported_target.

* test(errors): register PE DOS-signature and truncated IPS refusals and drop their per-command copies

The non-MZ PE imports and load-config cases (PE32/PE32+, ZZ and high-bit
signatures) and the truncated Apple IPS body move into the conformance
registry, which runs them through the CLI and MCP and now also checks
that a refusal leaves the selected file unchanged. The per-command tests
keep only their valid-image controls.

* test(sqlite): drop the malformed-database provider test the conformance registry covers

inspect_sqlite_database/not-a-database in the target-failure registry runs
the same non-SQLite bytes through the CLI and MCP, asserts the malformed
target facts and checks the selected file is unchanged.

* feat(errors)!: make failure_kind the identifier and derive code and retry from it

Apply the owner review on #14239 to the TargetFailure model:
- remove details.format_failure; failure_kind is the only identifier;
- give integrity, conflict and io their own codes
  (target_integrity_mismatch, input_conflict, host_io_failed) and derive
  inventory malformed, truncated and unsupported codes from the same table;
- add a retry hint (none, backoff, after_change) derived from the kind,
  with io refined by its transient errno fact; retryable stays the
  unchanged-retry flag and is true exactly for backoff;
- rename the limit-cut result code and category truncated to partial;
- drop cancelled and resource from the target kinds and spell
  identifiers in American English (unrecognized);
- return a target failure a tool handler throws as a projected isError
  result instead of letting the SDK flatten it to text.

BREAKING CHANGE: details.format_failure is removed (read
details.failure_kind). The truncated result code and category are now
partial. Target integrity failures report target_integrity_mismatch,
host read failures host_io_failed and disagreeing inputs input_conflict.
Inventory operations (inventory_artifact, inspect_artifact,
extract_artifact and the other inventory callers) report truncated
container bytes as unsupported_target. Every target failure carries a
top-level retry hint.

* test(sqlite): expect a malformed target for non-database bytes in the CLI suite

* fix(artifacts): keep changed-file short reads, invalid offsets and EOF declarations apart

PyInstaller reads inside the measured size, and .NET bundle manifest
refills, now raise read-coverage integrity on a zero-byte read instead of
truncated. A .NET bundle field and a Godot PCK directory entry that extend
past the file are truncated (with offset and extents) instead of
malformed. An absent or invalid ASAR packed offset is malformed; only a
valid range past the archive is truncated. The .NET manifest string
offset is reported in file coordinates.

* fix(pwntools): report a short ELF header as a truncated target

The layout and recorded-crash workers raise a distinct truncated reason
when the file ends inside the ELF identification or header, and the
decoder projects it as failure_kind truncated instead of inferring it
from the message.

* fix(errors)!: report managed coverage gaps and IL2CPP pair conflicts as target failures

Managed readers interpret an issue code once, in managedIssueTargetFailure:
a coverage gap is an unsupported target, every other rule violation is a
malformed target, and the inventory metadata status is derived from that
same fact. managedInspectionTargetFailure now returns only
AnalysisTargetFailureError.

An IL2CPP binary that parses but does not link to its metadata is a
conflict target failure that lists both inputs and blames neither, in
place of an invalid_request with two issue entries. Metadata version 108
is an unsupported target. The CLI spells each conflict input's field by
the command's option name.

BREAKING CHANGE: inspect_managed_artifact, inspect_managed_members,
inspect_managed_native_boundaries and the managed comparison operations
report unsupported metadata or signature forms as an
AnalysisTargetFailureError (failure_kind unsupported, format pe-cli,
field, offset) instead of a bare unsupported target. inspect_il2cpp_metadata
reports a binary/metadata pair that does not link as code input_conflict
with failure_kind conflict and details.inputs, instead of invalid_request
with details.issues, and metadata version 108 with failure_kind
unsupported.

* fix(artifacts): verify the carrier before blaming a short read on the bytes

The NTFS $MFT decoder, positional members (FIT, uImage, Bun, Deno) and
.NET bundle members now re-verify the source before reporting a short
stream as malformed, so a file that changed during the read reports the
change. The truncation site builds the model's measured extent.

* fix(errors)!: report inventory refusals as target failures of the selected path

An inventory, inspection or extraction refused damaged or unsupported
container bytes as an ArtifactOperationError whose reason repeated the
format owner's kind. It carried no path or retry hint, so the conformance
registry could not express container cases.

translateArtifactFailure now takes the selected path and returns the
reader's TargetFailure as an AnalysisTargetFailureError. The malformed,
truncated and unsupported reasons, their classification rows and their
presentation branch are deleted from ArtifactOperationError. Readers'
unsupported refusals carry their format facts through unsupportedArtifact.

Container cases move into the conformance registry, which now opens the
target first for session tools such as inspect_artifact.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and
the bundle readers report a refused container as a target failure of
details.path with a top-level retry. details.reason is the owner's
description and details.detail is removed.

* docs(il2cpp): describe pair conflicts as input_conflict with both inputs

* docs(android): name unsupported_target for truncated boot image structures

* fix(errors)!: report a target that changed during the read as failure_kind changed

Inventory integrity failures whose check means the target moved under the
read (container, member and unpacked-entry identity, read coverage,
traversal coverage) now take the model's changed projection: code
artifact_changed, retry backoff and details.failure_kind changed. A
selected target that no longer matches the one the session admitted gets
its own admitted-identity check and keeps its reopen recovery.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and
the other inventory operations report a target that changed during the
read as artifact_changed (retryable, failure_kind changed) instead of
artifact_operation_failed. Admission-identity refusals report
integrity_check admitted-identity instead of container-identity.

* test(artifacts): raise the cleanup fixture's decode refusal with its format facts

* fix(errors)!: report unsupported and unrecognized targets on the TargetFailure model

AnalysisUnsupportedTargetError carried a free-text reason and remediation
beside the TargetFailure model, so unsupported refusals had no format,
failure_kind or retry hint, and their recovery was prose written at each
producer.

The class is deleted. Producers raise unsupportedTarget or
unrecognizedTarget with the owner's format, and consumers read
targetFailureOfKind. The projection table renders the recovery and names
the operations the owner lists in related.operations. The foreign-bytes
identity loop moves into the conformance registry.

BREAKING CHANGE: unsupported and unrecognized targets report
failure_kind, format and retry. Their remediation comes from the
target-failure table; producer-written remediation sentences are folded
into details.reason or replaced by details.related_operations.

* test(artifacts): expect admitted-identity for selections replaced before admission

A selected source replaced before admission fails the admitted-identity check rather than container-identity since the changed/admitted split.

* test(go): name the fixture and result when an MZ carrier is not refused through MCP

* style: format the migrated target-failure tests

* test(errors): expect the PE readers' native-binary format label for foreign bytes

* fix(cli)!: spell a target failure's recovery with CLI commands and options

The target-failure recovery named MCP tools even when the CLI printed it,
and it could not name another provider. The projection table now renders
the owner's alternative operations and providers through an adapter
spelling: MCP by tool name and open_binary argument, the CLI by command
and --provider. The CLI output layer re-renders only the table's own text,
so appended guidance is kept.

BREAKING CHANGE: CLI target-failure remediation names commands (for
example `rea inspect-plist`) instead of MCP tool names, and errors gain
details.related_providers when the owner names a provider.

* test(verify): expect target failures for damaged ELF, core and EVM inputs in real-provider verifiers

The binary-layout, recorded-crash and EVM verifiers still expected invalid_input for malformed or truncated selected bytes. The pwntools and EVM adapters now report those as unsupported_target with failure_kind; a missing path remains invalid_input.

* test(web): expect the partial code for a refused source-map admission

The limit-cut code is partial; this Windows-lane test arrived from main with the old truncated spelling.

* fix(workers)!: name malformed worker replies by the model's kind (#14292)

* fix(workers)!: name malformed worker replies by the model's kind

The pwntools, EVM, UEFI LZMA, source-map and historical-capture workers
replied with reason "format" for bytes that break their format, a second
vocabulary for the TargetFailure kind. The workers and their reply schemas
now use "malformed" at the source, including the pwntools Python bridge
and its tests. pwndbg never sent "format", so its schema drops it.

The pwntools decoder maps the worker's malformed and truncated replies to
the target failure of the same kind in one branch.

BREAKING CHANGE: worker reply reason "format" is renamed "malformed" in
the pwntools, EVM, UEFI LZMA, source-map and capture decoder protocols.

* test(go): expect loader-equivalent PE header facts in the MZ diagnostics (#14293)

#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.

* 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.

* test(go): check build information in a one-directory PE32 fixture (#14303)

* test(pe): distinguish unsupported DOS input from truncated input (#14302)

* ci: measure portable runner time for recorded selection predictions (#14304)

* ci: validate workflow anchors with actionlint 1.7.12 (#14298)

* ci: wait for static checks before broad PR test shards (#14299)

* ci: validate workflow anchors with actionlint 1.7.12

* ci: wait for static checks before broad PR test shards

* ci: record affected-test predictions above the live cutoff (#14300)

* ci: compare frozen selections with observed test failures (#14301)

* chore(deps): bump markdownify from 1.2.3 to 1.2.4 in /website (#14227)

Bumps [markdownify](https://github.com/matthewwithanm/python-markdownify) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/matthewwithanm/python-markdownify/releases)
- [Commits](https://github.com/matthewwithanm/python-markdownify/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: markdownify
  dependency-version: 1.2.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump rcssmin from 1.2.2 to 1.3.0 in /website (#14229)

Bumps [rcssmin](https://github.com/ndparker/rcssmin) from 1.2.2 to 1.3.0.
- [Changelog](https://github.com/ndparker/rcssmin/blob/master/CHANGES)
- [Commits](https://github.com/ndparker/rcssmin/compare/1.2.2...1.3.0)

---
updated-dependencies:
- dependency-name: rcssmin
  dependency-version: 1.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(ci): retry recorded crash dependency acquisition without stale index cache (#14076)

Co-authored-by: ShuaixinHuang <[email protected]>

* ci: publish the portable build cache only for selected consumers (#14307)

* ci: run the verified actionlint release binary (#14309)

* chore(deps): bump pyyaml from 6.0.3 to 6.0.4 in /website (#14228)

Bumps [pyyaml](https://github.com/yaml/pyyaml) from 6.0.3 to 6.0.4.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/6.0.4/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/6.0.3...6.0.4)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-version: 6.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refactor(views): reuse invalid-view results and row selectors (#14314)

* refactor(domain): share record and graph parsing across input paths (#14321)

* ci: shallow-checkout the classifier for qualification runs (#14312)

* 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

* refactor(application): consolidate configuration and observation helpers (#14322)

* refactor(application): consolidate configuration and observation helpers

* refactor(config): leave optional launch parsers to their existing change

* refactor(tooling): share verifier fixture and lint helpers (#14318)

* refactor(tooling): share verifier fixture and lint helpers

* test(clients): retain tool messages in verifier model substitutes

* build(deps): bump write-file-atomic from 7.0.0 to 8.0.0 (#8134)

* perf(nuget): stream .nupkg ZIP over FileHandle instead of buffering full archive (#13835)

* perf(nuget): stream .nupkg ZIP over FileHandle instead of buffering full archive

Closes #13834

* fix(nuget): check artifact stability after format rejection

* refactor(kuna): extract KunaSingleFunctionCache from KunaSessionClient (#13863)

Closes #13862

* perf(har): reuse normalized Base64 for retained response bodies (#13847)

Co-authored-by: hhang <[email protected]>

* refactor(application): migrate 7 standalone format services onto executeArtifactInspection (#13861)

Closes #13860

* refactor: prune 5 redundant single-call wrapper modules (#13807)

* refactor: prune 5 redundant single-call wrapper modules

* chore(ci): remove deleted providerEnvironment.ts from Stryker and CI scope configs

* fix(ci): retarget provider environment mutation coverage

* refactor(application): migrate 3 remaining artifact services onto executeArtifactInspection (#13867)

* refactor(rizin): extract RizinDebugEvidence from RizinDebugSessionManager (#13823)

* refactor(rizin): extract RizinDebugEvidence from RizinDebugSessionManager

* refactor(rizin): remove unused evidence imports

* fix(ci): follow extracted Rizin evidence in mutation checks

* docs: codify pagination, schema-flatness, DDIA, and flat-ownership guidance in tool-design docs and skills (#13865)

* docs: codify pagination, schema-flatness, DDIA, and flat-ownership guidance in tool-design docs and skills

Closes #13864

* docs: name the current provider operation runner

* feat(frida): add optional limit and offset paging to list_frida_processes (#13854)

* feat(frida): add optional limit and offset paging to list_frida_processes

Closes #13853

* fix(frida): stabilize paged process discovery

* docs(frida): scope paging claims to shipped discovery

* refactor(application): unify 5 pass-through analysis services into ProviderOperationService (#13856)

Closes #13855

* refactor(cli): extract contractCommandRunners from contractCommand (#13869)

* feat(tools): add optional limit and offset paging to find_xrefs_to_name (#13858)

* feat(tools): add optional limit and offset paging to find_xrefs_to_name

Closes #13857

* fix(tools): preserve xref discovery coverage in paged results

* feat(adb): add optional limit and offset paging to list_adb_features and list_adb_services (#13873)

* feat(adb): add optional limit and offset paging to list_adb_features and list_adb_services

* test(adb): verify feature and service paging guidance

* refactor(cli): extract contractCliSchemaProjection and contractCliDocumentDescription (#13871)

* fix(dwarf): reject PE long section names when PointerToSymbolTable is zero (#13889)

* perf(macho): streamline legacy rebase run marking (#13881)

* perf(erlang): stream BEAM IFF inspection over FileHandle (#13886)

* perf(erlang): stream BEAM IFF inspection over FileHandle

* fix(erlang): retain only decoded BEAM code headers

* refactor(kuna): extract KunaSessionEvidence from KunaSessionClient (#13879)

* refactor(kuna): extract KunaSessionEvidence from KunaSessionClient

* refactor(kuna): remove stale session evidence imports

* fix(objc): preserve class import reader failures (#13892)

* refactor(server): extract desktop build tool bindings (#13891)

* refactor(server): collapse inspect bindings and extract desktopBuildToolBindings

* fix(mcp): restore contract-checked inspect bindings

* fix(macho): preserve legacy bind stream bounds and target scope (#13874)

* fix(macho): preserve legacy bind stream bounds and target scope

* fix(macho): report unresolved legacy bind targets in coverage

* test(macho): consolidate legacy bind target coverage

* perf(pe): stream PE certificates over FileHandle (#13884)

* perf(pe): stream PE certificates over FileHandle

* fix(pe): share certificate table admission across readers

* perf(apple-ips): stream Mach-O join headers over FileHandle (#13894)

* perf(apple-ips): stream Mach-O join headers over FileHandle

* fix(apple-ips): retain only verified Mach-O joins

* perf(objc): streamline exact class identity projection (#13897)

* perf(pe): stream PE resource inspection over FileHandle (#13899)

* perf(pe): stream PE resource inspection over FileHandle

* fix(pe): bound streamed icon-group reads and restore lifetime coverage

* perf(swift): streamline symbol inventory classification (#13902)

* 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

* perf(release-exposure): stream PE CodeView/PDB inspection over FileHandle (#13896)

* perf(release-exposure): stream PE CodeView/PDB inspection over FileHandle

* fix(release-exposure): share and bound PE CodeView parsing

* refactor(server): simplify contractToolBindings types and handler dispatch (#13912)

* perf(macho): streamline slice selection diagnostics (#13905)

* fix(macho): preserve retained magic from valid FAT ranges (#13910)

* perf(pe): stream PE load-config inspection over FileHandle (#13901)

* perf(pe): stream PE load-config inspection over FileHandle

* fix(pe): admit empty section tables and batch TLS callback reads

* perf(elf): stream ELF note inspection over FileHandle (#13904)

* perf(elf): stream ELF note inspection over FileHandle

* fix(elf): validate full header extents and reuse aliased note reads

* fix(macho): keep header reads inside declared slices (#13913)

* perf(v8): stream V8 code cache inspection over FileHandle (#13907)

* fix(macho): correct encryption range VM mapping (#13918)

* perf(elf): stream kernel module inspection over FileHandle (#13917)

* perf(elf): stream kernel module inspection over FileHandle

* test(elf): exercise streamed kernel module reads and finalization

* refactor(providers): share offlineArtifactFailureDialect across offline providers (#13921)

* test(macho): consolidate fixed header and extent proofs (#13919)

* perf(macho): bound positional command string probes (#13925)

* refactor(server): replace server.close and onclose monkey-patching with lifecycle hooks (#13882)

* refactor(server): replace server.close and onclose monkey-patching with lifecycle hooks

* fix(mcp): keep deferred runtime cleanup out of protocol close

* test(mcp): verify materialized runtime hooks close once

* fix(cli): defer artifact AnalysisView loading until requested

* test(macho): consolidate native path framing proofs (#13926)

* perf(elf): stream ELF dependency inspection over FileHandle (#13915)

* perf(elf): stream ELF dependency inspection over FileHandle

* fix(elf): share dependency hash parsing and bound string reads

* perf(elf): reuse cached prefixes for short dependency names

* refactor(server): extract debugger and instrumentation tool bindings (#13909)

* refactor(server): extract debugger and instrumentation tool bindings

* test(server): track extracted debugger bindings in reverse tools coverage

* fix(cli): defer artifact AnalysisView loading until requested

(cherry picked from commit e58fda3f2618b35bde5990c9e114f57f9d43f65d)

* refactor(macho): use binary facts for native diagnostic admission (#13929)

* perf(macho): streamline native export inventory merging (#13932)

* perf(elf): stream ELF debug-link inspection over FileHandle (#13928)

* perf(elf): stream ELF debug-link inspection over FileHandle

* perf(elf): reuse section name bytes across debug-link readers

* perf(pe): stream PE import inspection over FileHandle (#13924)

* perf(pe): stream PE import inspection over FileHandle

* perf(pe): reuse import read windows and cover positional boundaries

* fix(elf): preserve load segment range diagnostics

* test(macho): consolidate lipo field and native slice proofs (#13937)

* perf(elf): stream ELF unwind-range inspection over FileHandle (#13931)

* perf(elf): stream ELF unwind-range inspection over FileHandle

* fix(elf): bound unwind name retention and refill frame metadata

* test(macho): make slice cancellation and cleanup ordering deterministic (#13944)

* test(macho): make slice cancellation and cleanup ordering deterministic

* test(macho): join slice reads before restoring test spies

* refactor(providers): adopt offlineArtifactFailureDialect in BEAM, V8, NuGet, and LNK providers (#13936)

* refactor(providers): adopt offlineArtifactFailureDialect in BEAM, V8, NuGet, and LNK providers

* fix(nuget): let integrity and cancellation fall through to classifyProviderFailure

* perf(macho): defer segment geometry until lazy metadata needs it (#13949)

* test(macho): consolidate classic and modern dylib encoding proofs (#13952)

* perf(native): stream binary hardening inspection over FileHandle for ELF, PE, and Mach-O (#13934)

* perf(native): stream binary hardening inspection over FileHandle for ELF, PE, and Mach-O

* fix(native): bound hardening note and symbol reads

* test(native): verify bounded hardening reads through positional readers

* refactor(server): extract browser, Electron, and JavaScript runtime tool bindings (#13939)

* refactor(server): extract browser, Electron, and JavaScript runtime tool bindings

* test(ci): select browser checks for extracted bindings

* refactor(providers): adopt offlineArtifactFailureDialect in PE, ELF, and Apple IPS providers (#13954)

* test(macho): consolidate lazy payload reuse and capacity proofs (#13958)

* refactor(artifacts): extract source-map detection and occurrence path helpers from ReleaseExposureReader (#13961)

* perf(elf): stream kernel build-config inspection over FileHandle (#13942)

* perf(elf): stream kernel build-config inspection over FileHandle

* fix(elf): reuse kernel marker windows and report compressed input limits

* fix: preserve kernel config identity on cleanup failure

* test(macho): consolidate command framing and admission proofs (#13964)

* test(macho): consolidate command framing and admission proofs

* test: assert Mach-O command failure facts

* perf(dwarf): stream DWARF compile-unit inspection over FileHandle for ELF, PE, and Mach-O (#13948)

* perf(dwarf): stream DWARF compile-unit inspection over FileHandle for ELF, PE, and Mach-O

* fix: bound positional DWARF reads and share Mach-O selection

* test: verify positional Mach-O command admission

* refactor(providers): adopt offlineArtifactFailureDialect in NativeInitializers, Go, Rust, and ElfUnwind providers (#13966)

* refactor(providers): adopt offlineArtifactFailureDialect in BinaryHardeningProvider and PeBinaryFailure (#13970)

* refactor(server): extract session, investigation, and workflow tool bindings (#13968)

* perf(ntfs): stream MFT record decoding in O(recordBytes) memory (#13957)

* perf(ntfs): stream MFT record decoding in O(recordBytes) memory

* fix: resolve streamed MFT links through bounded positional reads

* refactor(providers): adopt offlineArtifactFailureDialect in KernelBuildConfigProvider (#13973)

* refactor(adb): extract read-only shell inspection operations from AdbProvider (#13975)

* refactor(elf): remove obsolete debug-link buffer parsers (#13971)

* perf(native): stream PE and ELF export-table inspection over FileHandle (#13951)

* perf(native): stream PE and ELF export-table inspection over FileHandle

* fix: share export interpretation across buffered and positional reads

* refactor(providers): adopt offlineArtifactFailureDialect in DwarfUnitsProvider (#13977)

* perf(elf): read only needed debug-link section bytes (#13980)

* refactor(providers): adopt offlineArtifactFailureDialect in NativeExportsProvider (#13982)

* feat(analysis-view): page retained UEFI firmware maps

Add the uefi-firmware view for inspect_uefi_firmware Evidence. The summary returns volume, file and section counts with FFS type, section type and volume depth tallies. Pages select volumes, files, sections, unknown regions, integrity records and PSP tables or candidates. Files match exact GUIDs, user-interface names, type names and owning volume; sections match their owning file and type. Rows keep the original flattened index plus the offset and source stream that extraction targets.

Co-Authored-By: gensokyo-dev <[email protected]>

* 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 <[email protected]>

* docs(firmware): describe UEFI summaries and views

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(rust): stream Rust binary inspection over FileHandle for ELF, PE, Mach-O, and WebAssembly (#13979)

* perf(rust): stream Rust binary inspection over FileHandle for ELF, PE, Mach-O, and WebAssembly

* fix(rust): bound positional dependency and name reads

* refactor(rust): reuse strict UTF-8 validation

* fix(elf): retain verified debug-link evidence through descriptor finalization (#13986)

* refactor(elf): prune superseded whole-buffer parseKernelBuildConfig wrapper (#13996)

* refactor(dwarf): prune superseded whole-buffer locateDwarfSections wrapper (#13993)

* refactor(elf): retire obsolete note buffer parsers (#13995)

* fix(gpu): mark conflicting CUDA shared sections partial and clear register provenance (#13963)

* refactor(artifacts): extract bounded member I/O helpers from ReleaseExposureReader (#13990)

* refactor(adb): extract package and app lifecycle operations from AdbProvider (#13988)

* refactor(server): extract offline inspection tool bindings from serviceToolBindings (#13984)

* refactor(elf): retire the obsolete unwind buffer parser (#14007)

* refactor(uninstall): extract registration-removal and item-collapse helpers from Uninstall (#14006)

* refactor(rizin): extract NUL-frame reader and wait helpers from RizinDebugSessionManager (#14001)

* refactor(rizin): extract NUL-frame reader and wait helpers from RizinDebugSessionManager

* fix(ci): track extracted Rizin frame helpers

* refactor(native): extract NativeAotPeImage from nativeAotPe (#13998)

* chore(guards): declare desktop build-computer entries and clear the entry baseline (#14011)

* perf(go): stream Go binary inspection over FileHandle for ELF, PE, and Mach-O (#14003)

* perf(go): stream Go binary inspection over FileHandle for ELF, PE, and Mach-O

* fix(go): share parsing and bound positional string reads

* perf(go): reuse target reads under the scan budget

* refactor: remove internal re-export shims and guard against new ones (#14009)

* refactor: remove internal re-export shims and guard against new ones

* fix(ci): catch namespace module re-exports

* perf(elf): reuse proven symbol suffixes in unwind lookup (#14014)

* refactor(cli/server): break remaining module-layer cycles (#14013)

* refactor(cli,server): break remaining module-layer cycles

* fix(ci): follow relocated CLI entry points

* refactor: remove retired internal reader exports

* fix(ci): track configuration inputs across cached checks (#14015)

* fix(ci): close static-check cache gaps and prune stale settings (#14017)

* fix(ci): close static-check cache gaps and prune stale settings

* chore(ci): remove unused Actionlint runner label

* fix(ci): rerun TODO scans against the host interpreter

* fix(elf): retain verified artifact reports through descriptor finalization

* test(elf): assert retained reports during descriptor finalization

* refactor(elf): retire the test-only dependency buffer driver

* test(elf): join the paused dependency parser on failure

* refactor(elf): consolidate kernel module checks on positional reads

* fix(elf): preserve kernel config framing and location provenance (#14021)

* perf(elf): bound kernel module signature digest reads (#14024)

* fix(elf): retain verified kernel reports through descriptor finalization (#14022)

* refactor(go): consolidate native parser checks on positional reads (#14027)

* feat(uefi): record the owning FFS file of extracted payloads

Each published extraction file now names the FFS file whose body or section produced it, with its GUID, user-interface name, type and logical path. Decoded streams resolve through their carrier section. Callers no longer need to match output paths against a separate inspection to find which driver a file belongs to.

Co-Authored-By: gensokyo-dev <[email protected]>

* feat(analysis-view): page retained UEFI extraction manifests

Add the uefi-extraction view for extract_uefi_firmware Evidence. The summary returns file, byte, derivation and gap counts, source, media-type and gap-kind tallies, and a bounded preview of the first published files. Pages select files by exact media type, source and owning FFS GUID, name or type, in publication or size order, plus derivations and gaps by kind. Counts and the size order are built once per retained report.

Co-Authored-By: gensokyo-dev <[email protected]>

* 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 <[email protected]>

* docs(firmware): describe UEFI extraction summaries and owners

Co-Authored-By: gensokyo-dev <[email protected]>

* 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 <[email protected]>

* fix(go): reject contradictory module coverage in retained views (#14029)

* fix(go): retain verified reports through descriptor finalization (#14026)

* perf(analysis-view): page unfiltered Go and Rust metadata directly (#14030)

* refactor(rust): consolidate binary parser checks on positional reads (#14033)

* feat(native): report the stored RVA of PE exports

PE export rows reported only the preferred-base virtual address, which the parser derives from the export-address-table RVA. Callers asking for an RVA had to recover the image base through other tools. Each row now carries the RVA as the slot stores it; a forwarder's RVA locates its forwarder string.

Co-Authored-By: gensokyo-dev <[email protected]>

* 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 <[email protected]>

* docs(native): describe export RVAs and name-prefix views

Co-Authored-By: gensokyo-dev <[email protected]>

* fix(analysis-view): read older UEFI extraction Evidence and drop filter-count ceilings

extract_uefi_firmware rows gained a required ffs_file, so extraction Evidence saved before that field failed to parse in retained views. The field is now optional when reading: the extractor still always records it, and an unrecorded owner matches no owner filter. UEFI view filters also capped each list at 64 values without a format, protocol or resource reason; overlapping filters cannot be split into separate requests without miscounting, so the cap is removed. MCP input-element admission still bounds every request.

Co-Authored-By: gensokyo-dev <[email protected]>

* fix(python): validate marshal coverage and consolidate pyc tests (#14036)

* perf(rust): reuse the Wasm section probe for custom name lengths (#14035)

* refactor(process): share the abortable command-turn wait between GDB and Rizin (#14042)

* fix(erlang): require complete positional BEAM reads (#14045)

* fix(rust): retain verified reports through descriptor finalization (#14034)

* test(process): consolidate symlink snapshot captures (#14051)

* fix(domain): make partial count switches exhaustive for typed lint (#14048)

Deep static checks on main fail typed lint (switch-exhaustiveness-check) in three counting switches introduced by recent single-pass summary refactors. Name the unmatched 'none' basis explicitly and give the graph/AST switches a documented default.

* refactor(server): extract ForwardingTransport base class for MCP Transport wrappers (#14050)

* fix(devicetree): validate retained report ranges and coverage (#14066)

* fix(ci): fall back to Ubuntu Azure archive in recorded-crash container (#14061)

The Ubuntu 24.04 recorded-crash container repeatedly timed out at 150s refreshing APT indexes from archive.ubuntu.com and security.ubuntu.com on main. Split Noble's 150s refresh budget into a 75s initial attempt followed by a 75s retry against http://azure.archive.ubuntu.com/ubuntu (matching ubuntu-archive's Noble Azure fallback while keeping http:// before ca-certificates is installed), and leave Debian unchanged at 150s.

* fix(erlang): retain verified BEAM reports through descriptor finalization (#14062)

* perf(uefi): skip verified erased padding in NVRAM scans (#14069)

* test(uefi): consolidate volume ownership and checksum proofs (#14070)

* fix(ci): run type-aware lint on changed files in fast PRs (#14068)

* fix(v8): preserve verified code cache results and require exact payload reads (#14067)

* refactor(config): return Result for ConfigurationError in IdaConfiguration and KiloClientLocation (#14053)

* refactor(config): return Result for ConfigurationError in IdaConfiguration and KiloClientLocation

* fix(config): return Kilo file-probe failures through Result

kiloGlobalLocation returned inline-configuration failures as Result but kept
throwing the shared probe's ConfigurationError, and kiloLayeredLocation no
longer caught it: an unreadable Kilo folder rejected resolveSupportedClients
for every client instead of staying a Kilo row failure. Convert probe
failures at the same Result boundary and register the counted catch.

Validation: a new boundary test (regular file at Kilo's config root) fails
without the fix and passes with it; kiloClientLocation, clientLifecycle,
mcpAddClientLifecycle and registration catalog suites pass; check:fast
passes.

* fix(ida): preserve the size rejection when descriptor close fails

The 64 KiB rejection became a completed outcome holding a rejected Result,
so the cleanup-failure handler replaced it with generic close guidance.
Read the rejection from the completed outcome when composing the cleanup
error, covering both the admission and growth size checks. Restore the
close spy leaked by the existing denial test, which the new cases exposed.

Validation: a new it.each denies close after each size check, asserts the
64 KiB message plus retained-cleanup release, and fails without the fix;
the IdaConfiguration suite and check:fast pass.

* refactor(uefi): exercise only the framed LZMA worker (#14072)

* fix(uefi): preserve verified source identity through descriptor finalization (#14073)

* refactor(config): return Result from resolveKiloRegistrationWorktree (#14055)

* refactor(config): return Result from resolveKiloRegistrationWorktree

* test(config): cover Kilo worktree resolution results

* perf(views): page exact Playwright trace index hits directly (#14031)

Co-authored-by: hhang <[email protected]>

* refactor(domain): compose cleanup dependencies through analysisErrorCleanup helpers (#14064)

* refactor(domain): compose cleanup dependencies through analysisErrorCleanup helpers

* fix(kuna): honor completed project cleanup when wrapping failures

* 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

* 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

* fix(reference): preserve file cleanup when directory enumeration fails (#14081)

Directory enumeration can list a file and then fail with EIO. If that
file read is cancelled and its close fails, replacing the cancelled
result with success dropped the still-open file. Keep the directory
read failure primary and merge the file's remaining resource into both
cleanup-combination returns.

Co-authored-by: Cursor Agent <[email protected]>

* fix(ci): bind timing evidence to its workflow attempt (#14080)

Co-authored-by: ShuaixinHuang <[email protected]>

* fix(ci): trace test dependencies through static template imports (#14079)

Co-authored-by: ShuaixinHuang <[email protected]>

* fix(ci): retain cache generations per restore version (#14084)

* fix(ci): retain cache generations per restore version

* test(ci): align inherited Mach-O assertion with main

---------

Co-authored-by: ShuaixinHuang <[email protected]>
Co-authored-by: ShuaixinHuang <[email protected]>

* fix(ci): use retry start times in PR health reporting (#14085)

* fix(ci): use retry start times in PR health reporting

* test: cover the reviewed CI boundary cases

---------

Co-authored-by: ShuaixinHuang <[email protected]>
Co-authored-by: ShuaixinHuang <[email protected]>

* perf(javascript): reuse completed CommonJS module-source queries

Static and semantic analysis ask whether the same callee or receiver is a CommonJS module object or require delegate at the same read site several times; a minified 1.9 MB webpack main bundle repeated about half of its 92,374 queries. Once member-mutation facts are complete, an identical query reuses its answer and re-records the resource limits the first walk reached. The answers are cleared with the semantic value caches and require-delegate writes, which every state change that can alter them already invalidates. The same bundle runs 48,447 walks instead of 92,374, and static and semantic results are unchanged on all 43 sources of the measured application.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): skip captured-selection normalization without captures

Most loader sources carry no captured selections, yet normalization allocated a map and sorted an empty array for each one before returning nothing. Return that result directly.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): build loader context keys without JSON serialization

Every module-source work item serialized its read site and capture boundaries to JSON to key its context. Build the same key by concatenation; absent and null positions still share a key, and absent captures still differ from an empty capture list.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): reuse preload-discovery static checkpoints in the normal pass

When any .js source belongs to a module package, preload discovery statically analyzes every source and the normal pass analyzes each one again. The worker now keeps the complete static checkpoint discovery computed, keyed by container, path, text digest, package type, precision and member-mutation allowance, and the normal pass of the same source writes that checkpoint instead of recomputing it. Static analysis is deterministic for those inputs, so the parent reads, validates and charges byte-identical facts. A discovered preload whose package type changes, a source discovery could not checkpoint, and a replaced worker all recompute. Retained checkpoints are consumed once and bounded to one eighth of the worker's V8 heap limit.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): park the worker after preload-discovery allowance refusals

A scoped worker closed instead of parking after any failed analysis, so one member-mutation refusal during preload discovery discarded the process and every static checkpoint it retained. Discovery skips such a source and the normal pass analyzes and reports it again, and the worker reports the refusal while staying healthy. A discovery checkout whose failures are all member-mutation refusals now parks if canReuse still holds. Other failures, and any failure in a normal analysis, still close the worker.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): keep the worker reusable after a final discovery refusal

The worker's reuse state cleared its last failure only on success, so a
member-mutation refusal of the last discovered source still closed the
worker and discarded every retained static checkpoint. The worker now
owns the recoverable-refusal rule, and the scope uses the same predicate.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): skip checkpoint encoding without reuse capacity

Runtimes without a reported heap limit (Bun) retain nothing, yet discovery
still encoded every complete checkpoint before checking capacity. Check the
remaining capacity first.

Co-Authored-By: gensokyo-dev <[email protected]>

* feat(analysis-view): select inventory occurrences by artifact kind

Finding the native addons in an application archive meant paging every
inventory occurrence (about 1 KB each) or reading the complete inspection,
because occurrences could be selected only by exact path, ID or entry kind.
Add artifact_kinds, which matches the recorded artifact kind exactly and
intersects with the other selectors, so one call returns, for example,
every native-addon occurrence with selected fields.

Co-Authored-By: gensokyo-dev <[email protected]>

* feat(analysis-view): select retained JavaScript facts by property value

javascript-facts selected observations only by location and node kind, so
reading one operation of an IPC channel set meant paging every channel
observation of the file. Add where.properties: each listed key must be
retained with one of its JSON scalar values. A missing key or non-scalar
value never matches, and repeated keys must all hold.

Co-Authored-By: gensokyo-dev <[email protected]>

* feat(analysis-view): count distinct retained JavaScript fact values

Counting the distinct IPC channels of one operation meant paging every
observation, each with its full Evidence, and deduplicating by hand; real
clients miscounted send channels on a large Electron app. Add the
javascript-fact-groups view: with the javascript-facts selectors and
group_by property names, it returns each distinct combination with its
observation and node counts, ordered by canonical JSON, and its total. A
missing key stays omitted, distinct from a retained null such as an
unresolved dynamic channel. The analyze_javascript_application description
names the IPC grouping.

Co-Authored-By: gensokyo-dev <[email protected]>

* docs(analysis-view): qualify javascript-fact-groups readback to scalar values

where.properties selects only present JSON scalar values, so a group over
array, object or missing values cannot be read back through it. Say so in
the group_by description and the workflow guide, and assert the exact node
count of a repeated channel in the MCP test.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(ghidra): scan defined data for selective string search instead of materializing inventory (#14101)

search_strings now scans getDefinedData directly when the string inventory has not been built, matching before allocating StringFacts and retaining only matches in STRING_ORDER. Sessions that only search no longer pay full inventory materialization and retention in the bridge JVM heap; list operations still build the cached inventory as before.

Refs #13292, #13355. Verified: ghidraBridgeSources (11 tests), javac against Ghidra jars, check:fast, and a real Ghidra 12.2 + JDK 25 probe asserting search-before-list equals search-after-list for regex and insensitive literal queries. No wire or result-order change.

* perf(ghidra): scan procedures for selective search without retaining inventory (#14103)

search_procedures now builds procedure entries without populating procedureInventory when it has not been built yet (buildProcedures extracted from procedures()), so a search-only session does not retain the full procedure inventory in the bridge JVM. Cached path, name index, order (PROCEDURE_ORDER) and matched_aliases output are unchanged. Companion to the search_strings scan in #14101; together they apply the DDIA rule of materializing inventories only for repeated list access, not for one ad-hoc search.

Refs #13355, #13299. Verified: javac against Ghidra 12.2 jars, ghidraBridgeSources 11 tests, and a real Ghidra 12.2 + JDK 25 probe asserting search-before-list deep-equals search-after-list (7 procedure matches, 12 procedures).

* refactor(frida): make inspectStatus async and load the view service lazily (#14108)

FridaInstrumentationService was the last application service statically importing AnalysisViewService for a conditional summary branch, because inspectStatus was synchronous. It is now async (its only production caller, debuggerToolBindings, already runs it inside an async handler), loads AnalysisViewService dynamically only when detail=summary, and otherwise imports only the retention check. Tests updated to await the six call sites; no behavior change.

Refs #13275. Verified: FridaInstrumentationService tests (37), check:fast. Stacks cleanly with #14102, which moves the retention import to AnalysisViewRetention.ts; resolve by taking that import line if both land.

* fix(ida): extend verifier admission check deadline to 90s

The admission check spawns scripts/verify-real-ida.mjs, which imports the
full dist graph before reaching the early admission errors. Under CI shard
load that exceeded the 10s command deadline and failed Test shard (5/12)
on main, while the same sha passed the scheduled run. The sibling verifier
observations check already uses 90s for the same script.

* perf(search): derive literal candidates from regex alternations (#14106)

* perf(search): derive literal candidates from regex alternations

extractRequiredRegexLiteral previously returned undefined for every alternation, so regex search_strings/search_procedures with alternatives paged full IDA inventories and transferred full Hopper inventories for Node-side matching. It now computes, for top-level and required-group alternations, the longest literal every branch guarantees (longest common substring of each branch's required runs) and returns it as the provider candidate; Node still verifies the full ECMAScript regex on candidates, so the candidate remains a zero-false-negative prefilter. A branch-common segment floats inside each branch and is never joined to neighbouring literals.

Refs #13353. Verified: regexLiteralCandidate tests (including the /u and /iu zero-false-negative corpus with new alternation patterns), IdaOperationRunner tests, HopperRegexSearch tests, check:fast with architecture guards.

* fix(search): require two code points for alternation candidates

A single shared code point (e.g. matched|absent -> a) matches nearly every value, so alternation-derived candidates now require at least two code points to be worth a provider round trip; shorter commons fall back to full inventory as before. Single-branch literals keep existing behavior. HopperRegexSearch routing tests pass unchanged.

* fix(search): bound alternation candidate extraction work and nesting

Long disjoint alternatives could spend hundreds of thousands of substring probes on the calling thread, and nested alternation groups recursed once per nesting level. Cap total probes (falling back to the full inventory past the budget) and cap alternation recursion depth, abandoning only the over-deep branch. Tests cover 2000-deep nesting and 1024-char disjoint alternatives.

* refactor(application): move AnalysisViewRetention to a light module and defer view loading in services (#14102)

* refactor(application): move AnalysisViewRetention to a light module and defer view loading in services

AnalysisViewRetention and requireAnalysisViewRetention moved from AnalysisViewService (which pulls the 1.3 MB analysis-view result graph) into AnalysisViewRetention.ts, which depends only on error and Evidence port types. All type-only consumers now import the light module. ApkSignature, Il2cpp and Reverse services load AnalysisViewService dynamically only on the detail=summary branch, and executeArtifactInspection checks retention readiness through the light module and loads the view service only after a successful inspection. No behavior or wire change.

Refs #13275, #13940. Verified: check:fast (typecheck, lint, architecture guards), 93 source tests (AnalysisViewService, Il2cpp, ApkSignature, Reverse), cliStartupImports 10/10 on pinned Node 24.22.1, knip clean. Remaining static importers (ArtifactComparisonEvidence, environment build/state, Frida sync inspectStatus, server bindings) still block a full chunk split and stay in #13275.

* fix(application): recheck cancellation after lazy view imports and guard static view links

An abort arriving while the dynamic AnalysisViewService import was pending still recorded and returned a successful summary. ArtifactInspectionExecution, ApkSignature, Il2cpp and Reverse now recheck the signal after the import (retaining the complete Evidence as the cancelled partial observation) before projecting. Add a counted architecture guard so static AnalysisViewService imports in application services cannot return silently; the baseline records only the known synchronous helpers and Frida path tracked in #14112.

* perf(tests): supervise direct vitest scripts through run-exclusive on POSIX (#14104)

* perf(tests): supervise direct vitest scripts through run-exclusive on POSIX

test:run, test:with-build, test:boundary, test:mcp, test:acceptance, test:integration, test:coverage and test:verbose invoked vitest directly, so an interrupted run could orphan detached provider children outside the owned process group. They now go through scripts/run-vitest.mjs, which wraps Vitest in run-exclusive --unlocked on non-Windows platforms (mirroring run-development-tests.mjs) and invokes Vitest directly on Windows, where source tests must not require the built Job Object artifact. Watch and CI shard scripts are unchanged.

Refs #13357. Verified: launcher smoke run (4 tests passed), check:fast, knip.

* fix(tests): forward stop signals from the vitest launcher to its child

The launcher ignored SIGINT/SIGTERM when wrapped, so a signal sent only to its PID left Vitest and its descendants running. It now always forwards to the child (run-exclusive can only forward signals it receives itself) and reports the tracked signal's exit code (143/130) deterministically. Verified with a manual probe: SIGTERM to the launcher PID during a 60s fixture test exits 143 with the tree stopped; launcher smoke run passes. A nested-supervisor in-process test proved environmentally unstable (the inner Vitest main is killed under nested run-exclusive supervisors) and was not landed.

* perf(contracts): prune only over-depth schema branches instead of reducing whole schemas (#14107)

* perf(contracts): prune only over-depth schema branches instead of reducing whole schemas

A schema whose inlined form exceeded the depth-10 advertised limit fell back to reduceToShallowProperties for the entire tool, erasing enums and nested validation on all root properties. pruneSchemaBeyondDepth now replaces only sub-schemas past the prune depth with type-preserving placeholders (every replacement widens acceptance, so canonical server-side validation is unchanged), and both input and output compaction keep the pruned form as inline when it fits bytes, depth and dialect checks. Two compactInputSchema tests that pinned depth-forces-reduction now pin the pruned-inline contract with the same Ajv/dialect safety assertions.

Refs #13302. Verified: compactInputSchema, compactOutputSchema, toolSchemaMetadata, advertisedInputExamples (59 tests), check:fast, docs:check.

* docs(contracts): refresh advertised schema summary for pruned-inline compaction

Pruned-inline schemas retain patterns (digest, Evidence id and text patterns) that whole-schema reduction dropped on 13 tools; regenerate the committed catalog summary with npm run verify:advertised-schemas -- --update-summary and re-verify clean.

* fix(contracts): make deep-schema pruning widening-safe

Walk schema positions instead of raw JSON, preserve declared integer types, keep branches that fit, return no pruned schema under not/oneOf where widening can reject valid values, and recheck output byte budgets. Add regression coverage for closed objects, unsafe combinators, fitting enums, and nullable integers; refresh advertised summaries.

* fix(contracts): keep untyped deep schemas unconstrained when pruned

Inferring object from properties or array from items narrows an untyped schema, which accepts every JSON value; the placeholder is now always unconstrained when no type is declared. Add an Ajv regression accepting null and nested values through a pruned untyped branch.

* test(contracts): assert pruned untyped schemas at depth 8

The regression accepted values that never reached the replaced node, so
it stayed green for an object placeholder and did not distinguish
branch pruning from whole-schema reduction. Assert the empty schema at
depth 8 and accept null there.

---------

Co-authored-by: Cursor Agent <[email protected]>

* docs(github): require reported verification and factual docs in PR template (#14130)

* docs(github): require reported verification and factual docs in PR template

Record the maintainer checks for running needed validation, limiting
comments to constraints and decisions, and keeping documentation factual.
Mirror that guidance in AGENTS.md where it was not already stated.

* docs(github): assign the PR checklist to the author

Rename Before merge so the PR author completes it before requesting
review, and point the draft-PR note at that section.

* docs(github): confirm root cause and engineering rules on PRs

Add a few author-checklist items for the root cause, owning-boundary
interpretation, retained cleanup facts, …
morluto added a commit that referenced this pull request Nov 25, 2026
…e MachoReadIssue (#14416)

* feat(errors)!: add the TargetFailure model, its projection table and conformance registry

Introduce one domain-owned TargetFailure value whose kind alone derives
the public code, category, retryability, recovery and details, for CLI
and MCP alike. Selected-file malformed and truncated refusals are the
first area on it: AnalysisMalformedTargetError is replaced by
AnalysisTargetFailureError, and ParseFailure's byte-structure variants
are TargetFailure variants rather than a parallel type.

The shared stableArtifactParserFailureCli loop is replaced by a
declarative registry (tests/support/targetFailure/readers/*.ts) and one
generated suite that runs every registered case through the CLI and MCP.

BREAKING CHANGE: selected-file malformed and truncated refusals add
details.failure_kind, and a truncated target's remediation now says to
re-acquire the complete file instead of choosing another target. Codes
are unchanged. Affected operations: every operation that refuses a
selected file's malformed or truncated bytes, including the ELF, PE,
Mach-O, DWARF, Go, Rust, BEAM, pyc, devicetree, Apple IPS, kernel
module, binary hardening, managed PE/CLI and IL2CPP readers.

* test(managed): name the target failure error in the merged status test

* docs(reference): name the error CSV instead of linking a non-page file

* fix(tests): expect the path reason for non-regular dyld inputs

#14225 refuses a non-regular dyld input as ArtifactReaderFailure("path");
dylibFileLifetime still expected "format" and fails on main's shard 9.

* fix(tests): expect io, invariant and path where #14225 reclassified

stableArtifact expected "format" for an impossible descriptor byte count
(now io) and an invalid chunk size (now InternalInvariantError);
directoryArtifactReaderOpen expected "format" for a non-file entry (now
path, the same change as #14238). All three fail on main.

* fix(errors)!: raise container reader byte faults as malformed or truncated targets

Delete the ambiguous `format` reason from ArtifactReaderFailure and
ArtifactOperationError. Each container reader now raises its owner's
fact once, through malformedArtifact / truncatedArtifact, with format,
offset, field and measured extents. Short reads inside a measured extent
are read-coverage integrity failures, path-kind refusals are `path`,
foreign or recovery-requiring inputs are `unsupported`, host tool output
is `io`, and REA defects are InternalInvariantError.

The trace, NTFS journal, release exposure, web capture, native macOS and
web artifact adapters project the reader's parsed facts as
AnalysisTargetFailureError instead of invalid_request. Inventory
malformed, truncated, unsupported and cancelled reasons take their code
from the TargetFailure projection table, so a truncated container is
unsupported_target with failure_kind "truncated" on both paths.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact,
analyze_javascript_application, inspect_desktop_application,
inspect_keyed_archive, inspect_asset_catalog, inspect_nuget_nupkg,
trace_dylib_resolution, trace_web_module_imports and
trace_web_source_location report damaged container bytes as
unsupported_target (details.reason "malformed" or "truncated", with
failure_kind and format) instead of artifact_operation_failed with
reason "format", and a truncated container as unsupported_target instead
of truncated. inspect_playwright_trace, inspect_ntfs_journal,
audit_release_exposure, the web capture inspection operations and the
caller-selected import and source maps report damaged selected bytes as
unsupported_target instead of invalid_request. The `format` reason no
longer appears in details.reason.

* test(artifacts): expect target failure codes in compiled CLI and MCP suites

* fix(errors)!: refuse malformed SQLite, pwntools and EVM inputs as target failures

The SQLite engine's `format` reason is renamed to `malformed` at its
owner (SQLITE_INSPECTION_REASONS), and its refusal becomes an
AnalysisTargetFailureError at the selected path with format "sqlite".
The pwntools and EVM worker replies keep their wire reason "format",
which their workers define, and the adapters translate it once into a
malformed target failure with the profile's format (elf, elf-core,
evm-bytecode) instead of an invalid_format argument issue. SQLite joins
the target-failure conformance registry.

BREAKING CHANGE: inspect_sqlite_database, inspect_binary_layout,
inspect_recorded_crash and inspect_evm_interface report a selected
file's malformed bytes as unsupported_target with details.failure_kind
"malformed", format_failure, format and path, instead of invalid_request
with an invalid_format issue on path.

* fix(errors): give the integrity kind a schema-valid code and list the reference page

artifact_integrity_mismatch's projection schema requires declared and
calculated digests, which a TargetFailure of kind integrity does not
carry, so the kind now projects artifact_operation_failed with category
integrity_mismatch. The model test validates every kind's projection
against analysisErrorProjectionSchema. The reference page joins the
documentation sidebar.

* fix(artifacts): report a short carrier read as a changed file and keep unsupported desktop probes local

A Bun or Node SEA short read inside a range already checked against the
measured size meant the file changed, not that it was truncated. The
carrier range reader and Bun's readExact now raise read-coverage
integrity for it, and keep 'outside the file' as the truncated case.
DesktopFileInspection records an unsupported managed-metadata probe as a
row issue again, so later file checks still run.

* test(errors): expect target failure facts in the pwntools and EVM reply suites

The literal-replacement scenario now reads the failure's detail instead
of an issues[] message, and a malformed reply wrapped by cleanup failure
reports category unsupported_target.

* test(errors): register PE DOS-signature and truncated IPS refusals and drop their per-command copies

The non-MZ PE imports and load-config cases (PE32/PE32+, ZZ and high-bit
signatures) and the truncated Apple IPS body move into the conformance
registry, which runs them through the CLI and MCP and now also checks
that a refusal leaves the selected file unchanged. The per-command tests
keep only their valid-image controls.

* test(sqlite): drop the malformed-database provider test the conformance registry covers

inspect_sqlite_database/not-a-database in the target-failure registry runs
the same non-SQLite bytes through the CLI and MCP, asserts the malformed
target facts and checks the selected file is unchanged.

* feat(errors)!: make failure_kind the identifier and derive code and retry from it

Apply the owner review on #14239 to the TargetFailure model:
- remove details.format_failure; failure_kind is the only identifier;
- give integrity, conflict and io their own codes
  (target_integrity_mismatch, input_conflict, host_io_failed) and derive
  inventory malformed, truncated and unsupported codes from the same table;
- add a retry hint (none, backoff, after_change) derived from the kind,
  with io refined by its transient errno fact; retryable stays the
  unchanged-retry flag and is true exactly for backoff;
- rename the limit-cut result code and category truncated to partial;
- drop cancelled and resource from the target kinds and spell
  identifiers in American English (unrecognized);
- return a target failure a tool handler throws as a projected isError
  result instead of letting the SDK flatten it to text.

BREAKING CHANGE: details.format_failure is removed (read
details.failure_kind). The truncated result code and category are now
partial. Target integrity failures report target_integrity_mismatch,
host read failures host_io_failed and disagreeing inputs input_conflict.
Inventory operations (inventory_artifact, inspect_artifact,
extract_artifact and the other inventory callers) report truncated
container bytes as unsupported_target. Every target failure carries a
top-level retry hint.

* test(sqlite): expect a malformed target for non-database bytes in the CLI suite

* fix(artifacts): keep changed-file short reads, invalid offsets and EOF declarations apart

PyInstaller reads inside the measured size, and .NET bundle manifest
refills, now raise read-coverage integrity on a zero-byte read instead of
truncated. A .NET bundle field and a Godot PCK directory entry that extend
past the file are truncated (with offset and extents) instead of
malformed. An absent or invalid ASAR packed offset is malformed; only a
valid range past the archive is truncated. The .NET manifest string
offset is reported in file coordinates.

* fix(pwntools): report a short ELF header as a truncated target

The layout and recorded-crash workers raise a distinct truncated reason
when the file ends inside the ELF identification or header, and the
decoder projects it as failure_kind truncated instead of inferring it
from the message.

* fix(errors)!: report managed coverage gaps and IL2CPP pair conflicts as target failures

Managed readers interpret an issue code once, in managedIssueTargetFailure:
a coverage gap is an unsupported target, every other rule violation is a
malformed target, and the inventory metadata status is derived from that
same fact. managedInspectionTargetFailure now returns only
AnalysisTargetFailureError.

An IL2CPP binary that parses but does not link to its metadata is a
conflict target failure that lists both inputs and blames neither, in
place of an invalid_request with two issue entries. Metadata version 108
is an unsupported target. The CLI spells each conflict input's field by
the command's option name.

BREAKING CHANGE: inspect_managed_artifact, inspect_managed_members,
inspect_managed_native_boundaries and the managed comparison operations
report unsupported metadata or signature forms as an
AnalysisTargetFailureError (failure_kind unsupported, format pe-cli,
field, offset) instead of a bare unsupported target. inspect_il2cpp_metadata
reports a binary/metadata pair that does not link as code input_conflict
with failure_kind conflict and details.inputs, instead of invalid_request
with details.issues, and metadata version 108 with failure_kind
unsupported.

* fix(artifacts): verify the carrier before blaming a short read on the bytes

The NTFS $MFT decoder, positional members (FIT, uImage, Bun, Deno) and
.NET bundle members now re-verify the source before reporting a short
stream as malformed, so a file that changed during the read reports the
change. The truncation site builds the model's measured extent.

* fix(errors)!: report inventory refusals as target failures of the selected path

An inventory, inspection or extraction refused damaged or unsupported
container bytes as an ArtifactOperationError whose reason repeated the
format owner's kind. It carried no path or retry hint, so the conformance
registry could not express container cases.

translateArtifactFailure now takes the selected path and returns the
reader's TargetFailure as an AnalysisTargetFailureError. The malformed,
truncated and unsupported reasons, their classification rows and their
presentation branch are deleted from ArtifactOperationError. Readers'
unsupported refusals carry their format facts through unsupportedArtifact.

Container cases move into the conformance registry, which now opens the
target first for session tools such as inspect_artifact.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and
the bundle readers report a refused container as a target failure of
details.path with a top-level retry. details.reason is the owner's
description and details.detail is removed.

* docs(il2cpp): describe pair conflicts as input_conflict with both inputs

* docs(android): name unsupported_target for truncated boot image structures

* fix(errors)!: report a target that changed during the read as failure_kind changed

Inventory integrity failures whose check means the target moved under the
read (container, member and unpacked-entry identity, read coverage,
traversal coverage) now take the model's changed projection: code
artifact_changed, retry backoff and details.failure_kind changed. A
selected target that no longer matches the one the session admitted gets
its own admitted-identity check and keeps its reopen recovery.

BREAKING CHANGE: inventory_artifact, inspect_artifact, extract_artifact and
the other inventory operations report a target that changed during the
read as artifact_changed (retryable, failure_kind changed) instead of
artifact_operation_failed. Admission-identity refusals report
integrity_check admitted-identity instead of container-identity.

* test(artifacts): raise the cleanup fixture's decode refusal with its format facts

* fix(errors)!: report unsupported and unrecognized targets on the TargetFailure model

AnalysisUnsupportedTargetError carried a free-text reason and remediation
beside the TargetFailure model, so unsupported refusals had no format,
failure_kind or retry hint, and their recovery was prose written at each
producer.

The class is deleted. Producers raise unsupportedTarget or
unrecognizedTarget with the owner's format, and consumers read
targetFailureOfKind. The projection table renders the recovery and names
the operations the owner lists in related.operations. The foreign-bytes
identity loop moves into the conformance registry.

BREAKING CHANGE: unsupported and unrecognized targets report
failure_kind, format and retry. Their remediation comes from the
target-failure table; producer-written remediation sentences are folded
into details.reason or replaced by details.related_operations.

* test(artifacts): expect admitted-identity for selections replaced before admission

A selected source replaced before admission fails the admitted-identity check rather than container-identity since the changed/admitted split.

* test(go): name the fixture and result when an MZ carrier is not refused through MCP

* style: format the migrated target-failure tests

* test(errors): expect the PE readers' native-binary format label for foreign bytes

* fix(cli)!: spell a target failure's recovery with CLI commands and options

The target-failure recovery named MCP tools even when the CLI printed it,
and it could not name another provider. The projection table now renders
the owner's alternative operations and providers through an adapter
spelling: MCP by tool name and open_binary argument, the CLI by command
and --provider. The CLI output layer re-renders only the table's own text,
so appended guidance is kept.

BREAKING CHANGE: CLI target-failure remediation names commands (for
example `rea inspect-plist`) instead of MCP tool names, and errors gain
details.related_providers when the owner names a provider.

* test(verify): expect target failures for damaged ELF, core and EVM inputs in real-provider verifiers

The binary-layout, recorded-crash and EVM verifiers still expected invalid_input for malformed or truncated selected bytes. The pwntools and EVM adapters now report those as unsupported_target with failure_kind; a missing path remains invalid_input.

* test(web): expect the partial code for a refused source-map admission

The limit-cut code is partial; this Windows-lane test arrived from main with the old truncated spelling.

* fix(workers)!: name malformed worker replies by the model's kind (#14292)

* fix(workers)!: name malformed worker replies by the model's kind

The pwntools, EVM, UEFI LZMA, source-map and historical-capture workers
replied with reason "format" for bytes that break their format, a second
vocabulary for the TargetFailure kind. The workers and their reply schemas
now use "malformed" at the source, including the pwntools Python bridge
and its tests. pwndbg never sent "format", so its schema drops it.

The pwntools decoder maps the worker's malformed and truncated replies to
the target failure of the same kind in one branch.

BREAKING CHANGE: worker reply reason "format" is renamed "malformed" in
the pwntools, EVM, UEFI LZMA, source-map and capture decoder protocols.

* test(go): expect loader-equivalent PE header facts in the MZ diagnostics (#14293)

#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.

* 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.

* test(go): check build information in a one-directory PE32 fixture (#14303)

* test(pe): distinguish unsupported DOS input from truncated input (#14302)

* ci: measure portable runner time for recorded selection predictions (#14304)

* ci: validate workflow anchors with actionlint 1.7.12 (#14298)

* ci: wait for static checks before broad PR test shards (#14299)

* ci: validate workflow anchors with actionlint 1.7.12

* ci: wait for static checks before broad PR test shards

* ci: record affected-test predictions above the live cutoff (#14300)

* ci: compare frozen selections with observed test failures (#14301)

* chore(deps): bump markdownify from 1.2.3 to 1.2.4 in /website (#14227)

Bumps [markdownify](https://github.com/matthewwithanm/python-markdownify) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/matthewwithanm/python-markdownify/releases)
- [Commits](https://github.com/matthewwithanm/python-markdownify/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: markdownify
  dependency-version: 1.2.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump rcssmin from 1.2.2 to 1.3.0 in /website (#14229)

Bumps [rcssmin](https://github.com/ndparker/rcssmin) from 1.2.2 to 1.3.0.
- [Changelog](https://github.com/ndparker/rcssmin/blob/master/CHANGES)
- [Commits](https://github.com/ndparker/rcssmin/compare/1.2.2...1.3.0)

---
updated-dependencies:
- dependency-name: rcssmin
  dependency-version: 1.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(ci): retry recorded crash dependency acquisition without stale index cache (#14076)

Co-authored-by: ShuaixinHuang <[email protected]>

* ci: publish the portable build cache only for selected consumers (#14307)

* ci: run the verified actionlint release binary (#14309)

* chore(deps): bump pyyaml from 6.0.3 to 6.0.4 in /website (#14228)

Bumps [pyyaml](https://github.com/yaml/pyyaml) from 6.0.3 to 6.0.4.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/6.0.4/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/6.0.3...6.0.4)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-version: 6.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refactor(views): reuse invalid-view results and row selectors (#14314)

* refactor(domain): share record and graph parsing across input paths (#14321)

* ci: shallow-checkout the classifier for qualification runs (#14312)

* 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

* refactor(application): consolidate configuration and observation helpers (#14322)

* refactor(application): consolidate configuration and observation helpers

* refactor(config): leave optional launch parsers to their existing change

* refactor(tooling): share verifier fixture and lint helpers (#14318)

* refactor(tooling): share verifier fixture and lint helpers

* test(clients): retain tool messages in verifier model substitutes

* build(deps): bump write-file-atomic from 7.0.0 to 8.0.0 (#8134)

* perf(nuget): stream .nupkg ZIP over FileHandle instead of buffering full archive (#13835)

* perf(nuget): stream .nupkg ZIP over FileHandle instead of buffering full archive

Closes #13834

* fix(nuget): check artifact stability after format rejection

* refactor(kuna): extract KunaSingleFunctionCache from KunaSessionClient (#13863)

Closes #13862

* perf(har): reuse normalized Base64 for retained response bodies (#13847)

Co-authored-by: hhang <[email protected]>

* refactor(application): migrate 7 standalone format services onto executeArtifactInspection (#13861)

Closes #13860

* refactor: prune 5 redundant single-call wrapper modules (#13807)

* refactor: prune 5 redundant single-call wrapper modules

* chore(ci): remove deleted providerEnvironment.ts from Stryker and CI scope configs

* fix(ci): retarget provider environment mutation coverage

* refactor(application): migrate 3 remaining artifact services onto executeArtifactInspection (#13867)

* refactor(rizin): extract RizinDebugEvidence from RizinDebugSessionManager (#13823)

* refactor(rizin): extract RizinDebugEvidence from RizinDebugSessionManager

* refactor(rizin): remove unused evidence imports

* fix(ci): follow extracted Rizin evidence in mutation checks

* docs: codify pagination, schema-flatness, DDIA, and flat-ownership guidance in tool-design docs and skills (#13865)

* docs: codify pagination, schema-flatness, DDIA, and flat-ownership guidance in tool-design docs and skills

Closes #13864

* docs: name the current provider operation runner

* feat(frida): add optional limit and offset paging to list_frida_processes (#13854)

* feat(frida): add optional limit and offset paging to list_frida_processes

Closes #13853

* fix(frida): stabilize paged process discovery

* docs(frida): scope paging claims to shipped discovery

* refactor(application): unify 5 pass-through analysis services into ProviderOperationService (#13856)

Closes #13855

* refactor(cli): extract contractCommandRunners from contractCommand (#13869)

* feat(tools): add optional limit and offset paging to find_xrefs_to_name (#13858)

* feat(tools): add optional limit and offset paging to find_xrefs_to_name

Closes #13857

* fix(tools): preserve xref discovery coverage in paged results

* feat(adb): add optional limit and offset paging to list_adb_features and list_adb_services (#13873)

* feat(adb): add optional limit and offset paging to list_adb_features and list_adb_services

* test(adb): verify feature and service paging guidance

* refactor(cli): extract contractCliSchemaProjection and contractCliDocumentDescription (#13871)

* fix(dwarf): reject PE long section names when PointerToSymbolTable is zero (#13889)

* perf(macho): streamline legacy rebase run marking (#13881)

* perf(erlang): stream BEAM IFF inspection over FileHandle (#13886)

* perf(erlang): stream BEAM IFF inspection over FileHandle

* fix(erlang): retain only decoded BEAM code headers

* refactor(kuna): extract KunaSessionEvidence from KunaSessionClient (#13879)

* refactor(kuna): extract KunaSessionEvidence from KunaSessionClient

* refactor(kuna): remove stale session evidence imports

* fix(objc): preserve class import reader failures (#13892)

* refactor(server): extract desktop build tool bindings (#13891)

* refactor(server): collapse inspect bindings and extract desktopBuildToolBindings

* fix(mcp): restore contract-checked inspect bindings

* fix(macho): preserve legacy bind stream bounds and target scope (#13874)

* fix(macho): preserve legacy bind stream bounds and target scope

* fix(macho): report unresolved legacy bind targets in coverage

* test(macho): consolidate legacy bind target coverage

* perf(pe): stream PE certificates over FileHandle (#13884)

* perf(pe): stream PE certificates over FileHandle

* fix(pe): share certificate table admission across readers

* perf(apple-ips): stream Mach-O join headers over FileHandle (#13894)

* perf(apple-ips): stream Mach-O join headers over FileHandle

* fix(apple-ips): retain only verified Mach-O joins

* perf(objc): streamline exact class identity projection (#13897)

* perf(pe): stream PE resource inspection over FileHandle (#13899)

* perf(pe): stream PE resource inspection over FileHandle

* fix(pe): bound streamed icon-group reads and restore lifetime coverage

* perf(swift): streamline symbol inventory classification (#13902)

* 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

* perf(release-exposure): stream PE CodeView/PDB inspection over FileHandle (#13896)

* perf(release-exposure): stream PE CodeView/PDB inspection over FileHandle

* fix(release-exposure): share and bound PE CodeView parsing

* refactor(server): simplify contractToolBindings types and handler dispatch (#13912)

* perf(macho): streamline slice selection diagnostics (#13905)

* fix(macho): preserve retained magic from valid FAT ranges (#13910)

* perf(pe): stream PE load-config inspection over FileHandle (#13901)

* perf(pe): stream PE load-config inspection over FileHandle

* fix(pe): admit empty section tables and batch TLS callback reads

* perf(elf): stream ELF note inspection over FileHandle (#13904)

* perf(elf): stream ELF note inspection over FileHandle

* fix(elf): validate full header extents and reuse aliased note reads

* fix(macho): keep header reads inside declared slices (#13913)

* perf(v8): stream V8 code cache inspection over FileHandle (#13907)

* fix(macho): correct encryption range VM mapping (#13918)

* perf(elf): stream kernel module inspection over FileHandle (#13917)

* perf(elf): stream kernel module inspection over FileHandle

* test(elf): exercise streamed kernel module reads and finalization

* refactor(providers): share offlineArtifactFailureDialect across offline providers (#13921)

* test(macho): consolidate fixed header and extent proofs (#13919)

* perf(macho): bound positional command string probes (#13925)

* refactor(server): replace server.close and onclose monkey-patching with lifecycle hooks (#13882)

* refactor(server): replace server.close and onclose monkey-patching with lifecycle hooks

* fix(mcp): keep deferred runtime cleanup out of protocol close

* test(mcp): verify materialized runtime hooks close once

* fix(cli): defer artifact AnalysisView loading until requested

* test(macho): consolidate native path framing proofs (#13926)

* perf(elf): stream ELF dependency inspection over FileHandle (#13915)

* perf(elf): stream ELF dependency inspection over FileHandle

* fix(elf): share dependency hash parsing and bound string reads

* perf(elf): reuse cached prefixes for short dependency names

* refactor(server): extract debugger and instrumentation tool bindings (#13909)

* refactor(server): extract debugger and instrumentation tool bindings

* test(server): track extracted debugger bindings in reverse tools coverage

* fix(cli): defer artifact AnalysisView loading until requested

(cherry picked from commit e58fda3f2618b35bde5990c9e114f57f9d43f65d)

* refactor(macho): use binary facts for native diagnostic admission (#13929)

* perf(macho): streamline native export inventory merging (#13932)

* perf(elf): stream ELF debug-link inspection over FileHandle (#13928)

* perf(elf): stream ELF debug-link inspection over FileHandle

* perf(elf): reuse section name bytes across debug-link readers

* perf(pe): stream PE import inspection over FileHandle (#13924)

* perf(pe): stream PE import inspection over FileHandle

* perf(pe): reuse import read windows and cover positional boundaries

* fix(elf): preserve load segment range diagnostics

* test(macho): consolidate lipo field and native slice proofs (#13937)

* perf(elf): stream ELF unwind-range inspection over FileHandle (#13931)

* perf(elf): stream ELF unwind-range inspection over FileHandle

* fix(elf): bound unwind name retention and refill frame metadata

* test(macho): make slice cancellation and cleanup ordering deterministic (#13944)

* test(macho): make slice cancellation and cleanup ordering deterministic

* test(macho): join slice reads before restoring test spies

* refactor(providers): adopt offlineArtifactFailureDialect in BEAM, V8, NuGet, and LNK providers (#13936)

* refactor(providers): adopt offlineArtifactFailureDialect in BEAM, V8, NuGet, and LNK providers

* fix(nuget): let integrity and cancellation fall through to classifyProviderFailure

* perf(macho): defer segment geometry until lazy metadata needs it (#13949)

* test(macho): consolidate classic and modern dylib encoding proofs (#13952)

* perf(native): stream binary hardening inspection over FileHandle for ELF, PE, and Mach-O (#13934)

* perf(native): stream binary hardening inspection over FileHandle for ELF, PE, and Mach-O

* fix(native): bound hardening note and symbol reads

* test(native): verify bounded hardening reads through positional readers

* refactor(server): extract browser, Electron, and JavaScript runtime tool bindings (#13939)

* refactor(server): extract browser, Electron, and JavaScript runtime tool bindings

* test(ci): select browser checks for extracted bindings

* refactor(providers): adopt offlineArtifactFailureDialect in PE, ELF, and Apple IPS providers (#13954)

* test(macho): consolidate lazy payload reuse and capacity proofs (#13958)

* refactor(artifacts): extract source-map detection and occurrence path helpers from ReleaseExposureReader (#13961)

* perf(elf): stream kernel build-config inspection over FileHandle (#13942)

* perf(elf): stream kernel build-config inspection over FileHandle

* fix(elf): reuse kernel marker windows and report compressed input limits

* fix: preserve kernel config identity on cleanup failure

* test(macho): consolidate command framing and admission proofs (#13964)

* test(macho): consolidate command framing and admission proofs

* test: assert Mach-O command failure facts

* perf(dwarf): stream DWARF compile-unit inspection over FileHandle for ELF, PE, and Mach-O (#13948)

* perf(dwarf): stream DWARF compile-unit inspection over FileHandle for ELF, PE, and Mach-O

* fix: bound positional DWARF reads and share Mach-O selection

* test: verify positional Mach-O command admission

* refactor(providers): adopt offlineArtifactFailureDialect in NativeInitializers, Go, Rust, and ElfUnwind providers (#13966)

* refactor(providers): adopt offlineArtifactFailureDialect in BinaryHardeningProvider and PeBinaryFailure (#13970)

* refactor(server): extract session, investigation, and workflow tool bindings (#13968)

* perf(ntfs): stream MFT record decoding in O(recordBytes) memory (#13957)

* perf(ntfs): stream MFT record decoding in O(recordBytes) memory

* fix: resolve streamed MFT links through bounded positional reads

* refactor(providers): adopt offlineArtifactFailureDialect in KernelBuildConfigProvider (#13973)

* refactor(adb): extract read-only shell inspection operations from AdbProvider (#13975)

* refactor(elf): remove obsolete debug-link buffer parsers (#13971)

* perf(native): stream PE and ELF export-table inspection over FileHandle (#13951)

* perf(native): stream PE and ELF export-table inspection over FileHandle

* fix: share export interpretation across buffered and positional reads

* refactor(providers): adopt offlineArtifactFailureDialect in DwarfUnitsProvider (#13977)

* perf(elf): read only needed debug-link section bytes (#13980)

* refactor(providers): adopt offlineArtifactFailureDialect in NativeExportsProvider (#13982)

* feat(analysis-view): page retained UEFI firmware maps

Add the uefi-firmware view for inspect_uefi_firmware Evidence. The summary returns volume, file and section counts with FFS type, section type and volume depth tallies. Pages select volumes, files, sections, unknown regions, integrity records and PSP tables or candidates. Files match exact GUIDs, user-interface names, type names and owning volume; sections match their owning file and type. Rows keep the original flattened index plus the offset and source stream that extraction targets.

Co-Authored-By: gensokyo-dev <[email protected]>

* 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 <[email protected]>

* docs(firmware): describe UEFI summaries and views

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(rust): stream Rust binary inspection over FileHandle for ELF, PE, Mach-O, and WebAssembly (#13979)

* perf(rust): stream Rust binary inspection over FileHandle for ELF, PE, Mach-O, and WebAssembly

* fix(rust): bound positional dependency and name reads

* refactor(rust): reuse strict UTF-8 validation

* fix(elf): retain verified debug-link evidence through descriptor finalization (#13986)

* refactor(elf): prune superseded whole-buffer parseKernelBuildConfig wrapper (#13996)

* refactor(dwarf): prune superseded whole-buffer locateDwarfSections wrapper (#13993)

* refactor(elf): retire obsolete note buffer parsers (#13995)

* fix(gpu): mark conflicting CUDA shared sections partial and clear register provenance (#13963)

* refactor(artifacts): extract bounded member I/O helpers from ReleaseExposureReader (#13990)

* refactor(adb): extract package and app lifecycle operations from AdbProvider (#13988)

* refactor(server): extract offline inspection tool bindings from serviceToolBindings (#13984)

* refactor(elf): retire the obsolete unwind buffer parser (#14007)

* refactor(uninstall): extract registration-removal and item-collapse helpers from Uninstall (#14006)

* refactor(rizin): extract NUL-frame reader and wait helpers from RizinDebugSessionManager (#14001)

* refactor(rizin): extract NUL-frame reader and wait helpers from RizinDebugSessionManager

* fix(ci): track extracted Rizin frame helpers

* refactor(native): extract NativeAotPeImage from nativeAotPe (#13998)

* chore(guards): declare desktop build-computer entries and clear the entry baseline (#14011)

* perf(go): stream Go binary inspection over FileHandle for ELF, PE, and Mach-O (#14003)

* perf(go): stream Go binary inspection over FileHandle for ELF, PE, and Mach-O

* fix(go): share parsing and bound positional string reads

* perf(go): reuse target reads under the scan budget

* refactor: remove internal re-export shims and guard against new ones (#14009)

* refactor: remove internal re-export shims and guard against new ones

* fix(ci): catch namespace module re-exports

* perf(elf): reuse proven symbol suffixes in unwind lookup (#14014)

* refactor(cli/server): break remaining module-layer cycles (#14013)

* refactor(cli,server): break remaining module-layer cycles

* fix(ci): follow relocated CLI entry points

* refactor: remove retired internal reader exports

* fix(ci): track configuration inputs across cached checks (#14015)

* fix(ci): close static-check cache gaps and prune stale settings (#14017)

* fix(ci): close static-check cache gaps and prune stale settings

* chore(ci): remove unused Actionlint runner label

* fix(ci): rerun TODO scans against the host interpreter

* fix(elf): retain verified artifact reports through descriptor finalization

* test(elf): assert retained reports during descriptor finalization

* refactor(elf): retire the test-only dependency buffer driver

* test(elf): join the paused dependency parser on failure

* refactor(elf): consolidate kernel module checks on positional reads

* fix(elf): preserve kernel config framing and location provenance (#14021)

* perf(elf): bound kernel module signature digest reads (#14024)

* fix(elf): retain verified kernel reports through descriptor finalization (#14022)

* refactor(go): consolidate native parser checks on positional reads (#14027)

* feat(uefi): record the owning FFS file of extracted payloads

Each published extraction file now names the FFS file whose body or section produced it, with its GUID, user-interface name, type and logical path. Decoded streams resolve through their carrier section. Callers no longer need to match output paths against a separate inspection to find which driver a file belongs to.

Co-Authored-By: gensokyo-dev <[email protected]>

* feat(analysis-view): page retained UEFI extraction manifests

Add the uefi-extraction view for extract_uefi_firmware Evidence. The summary returns file, byte, derivation and gap counts, source, media-type and gap-kind tallies, and a bounded preview of the first published files. Pages select files by exact media type, source and owning FFS GUID, name or type, in publication or size order, plus derivations and gaps by kind. Counts and the size order are built once per retained report.

Co-Authored-By: gensokyo-dev <[email protected]>

* 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 <[email protected]>

* docs(firmware): describe UEFI extraction summaries and owners

Co-Authored-By: gensokyo-dev <[email protected]>

* 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 <[email protected]>

* fix(go): reject contradictory module coverage in retained views (#14029)

* fix(go): retain verified reports through descriptor finalization (#14026)

* perf(analysis-view): page unfiltered Go and Rust metadata directly (#14030)

* refactor(rust): consolidate binary parser checks on positional reads (#14033)

* feat(native): report the stored RVA of PE exports

PE export rows reported only the preferred-base virtual address, which the parser derives from the export-address-table RVA. Callers asking for an RVA had to recover the image base through other tools. Each row now carries the RVA as the slot stores it; a forwarder's RVA locates its forwarder string.

Co-Authored-By: gensokyo-dev <[email protected]>

* 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 <[email protected]>

* docs(native): describe export RVAs and name-prefix views

Co-Authored-By: gensokyo-dev <[email protected]>

* fix(analysis-view): read older UEFI extraction Evidence and drop filter-count ceilings

extract_uefi_firmware rows gained a required ffs_file, so extraction Evidence saved before that field failed to parse in retained views. The field is now optional when reading: the extractor still always records it, and an unrecorded owner matches no owner filter. UEFI view filters also capped each list at 64 values without a format, protocol or resource reason; overlapping filters cannot be split into separate requests without miscounting, so the cap is removed. MCP input-element admission still bounds every request.

Co-Authored-By: gensokyo-dev <[email protected]>

* fix(python): validate marshal coverage and consolidate pyc tests (#14036)

* perf(rust): reuse the Wasm section probe for custom name lengths (#14035)

* refactor(process): share the abortable command-turn wait between GDB and Rizin (#14042)

* fix(erlang): require complete positional BEAM reads (#14045)

* fix(rust): retain verified reports through descriptor finalization (#14034)

* test(process): consolidate symlink snapshot captures (#14051)

* fix(domain): make partial count switches exhaustive for typed lint (#14048)

Deep static checks on main fail typed lint (switch-exhaustiveness-check) in three counting switches introduced by recent single-pass summary refactors. Name the unmatched 'none' basis explicitly and give the graph/AST switches a documented default.

* refactor(server): extract ForwardingTransport base class for MCP Transport wrappers (#14050)

* fix(devicetree): validate retained report ranges and coverage (#14066)

* fix(ci): fall back to Ubuntu Azure archive in recorded-crash container (#14061)

The Ubuntu 24.04 recorded-crash container repeatedly timed out at 150s refreshing APT indexes from archive.ubuntu.com and security.ubuntu.com on main. Split Noble's 150s refresh budget into a 75s initial attempt followed by a 75s retry against http://azure.archive.ubuntu.com/ubuntu (matching ubuntu-archive's Noble Azure fallback while keeping http:// before ca-certificates is installed), and leave Debian unchanged at 150s.

* fix(erlang): retain verified BEAM reports through descriptor finalization (#14062)

* perf(uefi): skip verified erased padding in NVRAM scans (#14069)

* test(uefi): consolidate volume ownership and checksum proofs (#14070)

* fix(ci): run type-aware lint on changed files in fast PRs (#14068)

* fix(v8): preserve verified code cache results and require exact payload reads (#14067)

* refactor(config): return Result for ConfigurationError in IdaConfiguration and KiloClientLocation (#14053)

* refactor(config): return Result for ConfigurationError in IdaConfiguration and KiloClientLocation

* fix(config): return Kilo file-probe failures through Result

kiloGlobalLocation returned inline-configuration failures as Result but kept
throwing the shared probe's ConfigurationError, and kiloLayeredLocation no
longer caught it: an unreadable Kilo folder rejected resolveSupportedClients
for every client instead of staying a Kilo row failure. Convert probe
failures at the same Result boundary and register the counted catch.

Validation: a new boundary test (regular file at Kilo's config root) fails
without the fix and passes with it; kiloClientLocation, clientLifecycle,
mcpAddClientLifecycle and registration catalog suites pass; check:fast
passes.

* fix(ida): preserve the size rejection when descriptor close fails

The 64 KiB rejection became a completed outcome holding a rejected Result,
so the cleanup-failure handler replaced it with generic close guidance.
Read the rejection from the completed outcome when composing the cleanup
error, covering both the admission and growth size checks. Restore the
close spy leaked by the existing denial test, which the new cases exposed.

Validation: a new it.each denies close after each size check, asserts the
64 KiB message plus retained-cleanup release, and fails without the fix;
the IdaConfiguration suite and check:fast pass.

* refactor(uefi): exercise only the framed LZMA worker (#14072)

* fix(uefi): preserve verified source identity through descriptor finalization (#14073)

* refactor(config): return Result from resolveKiloRegistrationWorktree (#14055)

* refactor(config): return Result from resolveKiloRegistrationWorktree

* test(config): cover Kilo worktree resolution results

* perf(views): page exact Playwright trace index hits directly (#14031)

Co-authored-by: hhang <[email protected]>

* refactor(domain): compose cleanup dependencies through analysisErrorCleanup helpers (#14064)

* refactor(domain): compose cleanup dependencies through analysisErrorCleanup helpers

* fix(kuna): honor completed project cleanup when wrapping failures

* 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

* 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

* fix(reference): preserve file cleanup when directory enumeration fails (#14081)

Directory enumeration can list a file and then fail with EIO. If that
file read is cancelled and its close fails, replacing the cancelled
result with success dropped the still-open file. Keep the directory
read failure primary and merge the file's remaining resource into both
cleanup-combination returns.

Co-authored-by: Cursor Agent <[email protected]>

* fix(ci): bind timing evidence to its workflow attempt (#14080)

Co-authored-by: ShuaixinHuang <[email protected]>

* fix(ci): trace test dependencies through static template imports (#14079)

Co-authored-by: ShuaixinHuang <[email protected]>

* fix(ci): retain cache generations per restore version (#14084)

* fix(ci): retain cache generations per restore version

* test(ci): align inherited Mach-O assertion with main

---------

Co-authored-by: ShuaixinHuang <[email protected]>
Co-authored-by: ShuaixinHuang <[email protected]>

* fix(ci): use retry start times in PR health reporting (#14085)

* fix(ci): use retry start times in PR health reporting

* test: cover the reviewed CI boundary cases

---------

Co-authored-by: ShuaixinHuang <[email protected]>
Co-authored-by: ShuaixinHuang <[email protected]>

* perf(javascript): reuse completed CommonJS module-source queries

Static and semantic analysis ask whether the same callee or receiver is a CommonJS module object or require delegate at the same read site several times; a minified 1.9 MB webpack main bundle repeated about half of its 92,374 queries. Once member-mutation facts are complete, an identical query reuses its answer and re-records the resource limits the first walk reached. The answers are cleared with the semantic value caches and require-delegate writes, which every state change that can alter them already invalidates. The same bundle runs 48,447 walks instead of 92,374, and static and semantic results are unchanged on all 43 sources of the measured application.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): skip captured-selection normalization without captures

Most loader sources carry no captured selections, yet normalization allocated a map and sorted an empty array for each one before returning nothing. Return that result directly.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): build loader context keys without JSON serialization

Every module-source work item serialized its read site and capture boundaries to JSON to key its context. Build the same key by concatenation; absent and null positions still share a key, and absent captures still differ from an empty capture list.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): reuse preload-discovery static checkpoints in the normal pass

When any .js source belongs to a module package, preload discovery statically analyzes every source and the normal pass analyzes each one again. The worker now keeps the complete static checkpoint discovery computed, keyed by container, path, text digest, package type, precision and member-mutation allowance, and the normal pass of the same source writes that checkpoint instead of recomputing it. Static analysis is deterministic for those inputs, so the parent reads, validates and charges byte-identical facts. A discovered preload whose package type changes, a source discovery could not checkpoint, and a replaced worker all recompute. Retained checkpoints are consumed once and bounded to one eighth of the worker's V8 heap limit.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): park the worker after preload-discovery allowance refusals

A scoped worker closed instead of parking after any failed analysis, so one member-mutation refusal during preload discovery discarded the process and every static checkpoint it retained. Discovery skips such a source and the normal pass analyzes and reports it again, and the worker reports the refusal while staying healthy. A discovery checkout whose failures are all member-mutation refusals now parks if canReuse still holds. Other failures, and any failure in a normal analysis, still close the worker.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): keep the worker reusable after a final discovery refusal

The worker's reuse state cleared its last failure only on success, so a
member-mutation refusal of the last discovered source still closed the
worker and discarded every retained static checkpoint. The worker now
owns the recoverable-refusal rule, and the scope uses the same predicate.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(javascript): skip checkpoint encoding without reuse capacity

Runtimes without a reported heap limit (Bun) retain nothing, yet discovery
still encoded every complete checkpoint before checking capacity. Check the
remaining capacity first.

Co-Authored-By: gensokyo-dev <[email protected]>

* feat(analysis-view): select inventory occurrences by artifact kind

Finding the native addons in an application archive meant paging every
inventory occurrence (about 1 KB each) or reading the complete inspection,
because occurrences could be selected only by exact path, ID or entry kind.
Add artifact_kinds, which matches the recorded artifact kind exactly and
intersects with the other selectors, so one call returns, for example,
every native-addon occurrence with selected fields.

Co-Authored-By: gensokyo-dev <[email protected]>

* feat(analysis-view): select retained JavaScript facts by property value

javascript-facts selected observations only by location and node kind, so
reading one operation of an IPC channel set meant paging every channel
observation of the file. Add where.properties: each listed key must be
retained with one of its JSON scalar values. A missing key or non-scalar
value never matches, and repeated keys must all hold.

Co-Authored-By: gensokyo-dev <[email protected]>

* feat(analysis-view): count distinct retained JavaScript fact values

Counting the distinct IPC channels of one operation meant paging every
observation, each with its full Evidence, and deduplicating by hand; real
clients miscounted send channels on a large Electron app. Add the
javascript-fact-groups view: with the javascript-facts selectors and
group_by property names, it returns each distinct combination with its
observation and node counts, ordered by canonical JSON, and its total. A
missing key stays omitted, distinct from a retained null such as an
unresolved dynamic channel. The analyze_javascript_application description
names the IPC grouping.

Co-Authored-By: gensokyo-dev <[email protected]>

* docs(analysis-view): qualify javascript-fact-groups readback to scalar values

where.properties selects only present JSON scalar values, so a group over
array, object or missing values cannot be read back through it. Say so in
the group_by description and the workflow guide, and assert the exact node
count of a repeated channel in the MCP test.

Co-Authored-By: gensokyo-dev <[email protected]>

* perf(ghidra): scan defined data for selective string search instead of materializing inventory (#14101)

search_strings now scans getDefinedData directly when the string inventory has not been built, matching before allocating StringFacts and retaining only matches in STRING_ORDER. Sessions that only search no longer pay full inventory materialization and retention in the bridge JVM heap; list operations still build the cached inventory as before.

Refs #13292, #13355. Verified: ghidraBridgeSources (11 tests), javac against Ghidra jars, check:fast, and a real Ghidra 12.2 + JDK 25 probe asserting search-before-list equals search-after-list for regex and insensitive literal queries. No wire or result-order change.

* perf(ghidra): scan procedures for selective search without retaining inventory (#14103)

search_procedures now builds procedure entries without populating procedureInventory when it has not been built yet (buildProcedures extracted from procedures()), so a search-only session does not retain the full procedure inventory in the bridge JVM. Cached path, name index, order (PROCEDURE_ORDER) and matched_aliases output are unchanged. Companion to the search_strings scan in #14101; together they apply the DDIA rule of materializing inventories only for repeated list access, not for one ad-hoc search.

Refs #13355, #13299. Verified: javac against Ghidra 12.2 jars, ghidraBridgeSources 11 tests, and a real Ghidra 12.2 + JDK 25 probe asserting search-before-list deep-equals search-after-list (7 procedure matches, 12 procedures).

* refactor(frida): make inspectStatus async and load the view service lazily (#14108)

FridaInstrumentationService was the last application service statically importing AnalysisViewService for a conditional summary branch, because inspectStatus was synchronous. It is now async (its only production caller, debuggerToolBindings, already runs it inside an async handler), loads AnalysisViewService dynamically only when detail=summary, and otherwise imports only the retention check. Tests updated to await the six call sites; no behavior change.

Refs #13275. Verified: FridaInstrumentationService tests (37), check:fast. Stacks cleanly with #14102, which moves the retention import to AnalysisViewRetention.ts; resolve by taking that import line if both land.

* fix(ida): extend verifier admission check deadline to 90s

The admission check spawns scripts/verify-real-ida.mjs, which imports the
full dist graph before reaching the early admission errors. Under CI shard
load that exceeded the 10s command deadline and failed Test shard (5/12)
on main, while the same sha passed the scheduled run. The sibling verifier
observations check already uses 90s for the same script.

* perf(search): derive literal candidates from regex alternations (#14106)

* perf(search): derive literal candidates from regex alternations

extractRequiredRegexLiteral previously returned undefined for every alternation, so regex search_strings/search_procedures with alternatives paged full IDA inventories and transferred full Hopper inventories for Node-side matching. It now computes, for top-level and required-group alternations, the longest literal every branch guarantees (longest common substring of each branch's required runs) and returns it as the provider candidate; Node still verifies the full ECMAScript regex on candidates, so the candidate remains a zero-false-negative prefilter. A branch-common segment floats inside each branch and is never joined to neighbouring literals.

Refs #13353. Verified: regexLiteralCandidate tests (including the /u and /iu zero-false-negative corpus with new alternation patterns), IdaOperationRunner tests, HopperRegexSearch tests, check:fast with architecture guards.

* fix(search): require two code points for alternation candidates

A single shared code point (e.g. matched|absent -> a) matches nearly every value, so alternation-derived candidates now require at least two code points to be worth a provider round trip; shorter commons fall back to full inventory as before. Single-branch literals keep existing behavior. HopperRegexSearch routing tests pass unchanged.

* fix(search): bound alternation candidate extraction work and nesting

Long disjoint alternatives could spend hundreds of thousands of substring probes on the calling thread, and nested alternation groups recursed once per nesting level. Cap total probes (falling back to the full inventory past the budget) and cap alternation recursion depth, abandoning only the over-deep branch. Tests cover 2000-deep nesting and 1024-char disjoint alternatives.

* refactor(application): move AnalysisViewRetention to a light module and defer view loading in services (#14102)

* refactor(application): move AnalysisViewRetention to a light module and defer view loading in services

AnalysisViewRetention and requireAnalysisViewRetention moved from AnalysisViewService (which pulls the 1.3 MB analysis-view result graph) into AnalysisViewRetention.ts, which depends only on error and Evidence port types. All type-only consumers now import the light module. ApkSignature, Il2cpp and Reverse services load AnalysisViewService dynamically only on the detail=summary branch, and executeArtifactInspection checks retention readiness through the light module and loads the view service only after a successful inspection. No behavior or wire change.

Refs #13275, #13940. Verified: check:fast (typecheck, lint, architecture guards), 93 source tests (AnalysisViewService, Il2cpp, ApkSignature, Reverse), cliStartupImports 10/10 on pinned Node 24.22.1, knip clean. Remaining static importers (ArtifactComparisonEvidence, environment build/state, Frida sync inspectStatus, server bindings) still block a full chunk split and stay in #13275.

* fix(application): recheck cancellation after lazy view imports and guard static view links

An abort arriving while the dynamic AnalysisViewService import was pending still recorded and returned a successful summary. ArtifactInspectionExecution, ApkSignature, Il2cpp and Reverse now recheck the signal after the import (retaining the complete Evidence as the cancelled partial observation) before projecting. Add a counted architecture guard so static AnalysisViewService imports in application services cannot return silently; the baseline records only the known synchronous helpers and Frida path tracked in #14112.

* perf(tests): supervise direct vitest scripts through run-exclusive on POSIX (#14104)

* perf(tests): supervise direct vitest scripts through run-exclusive on POSIX

test:run, test:with-build, test:boundary, test:mcp, test:acceptance, test:integration, test:coverage and test:verbose invoked vitest directly, so an interrupted run could orphan detached provider children outside the owned process group. They now go through scripts/run-vitest.mjs, which wraps Vitest in run-exclusive --unlocked on non-Windows platforms (mirroring run-development-tests.mjs) and invokes Vitest directly on Windows, where source tests must not require the built Job Object artifact. Watch and CI shard scripts are unchanged.

Refs #13357. Verified: launcher smoke run (4 tests passed), check:fast, knip.

* fix(tests): forward stop signals from the vitest launcher to its child

The launcher ignored SIGINT/SIGTERM when wrapped, so a signal sent only to its PID left Vitest and its descendants running. It now always forwards to the child (run-exclusive can only forward signals it receives itself) and reports the tracked signal's exit code (143/130) deterministically. Verified with a manual probe: SIGTERM to the launcher PID during a 60s fixture test exits 143 with the tree stopped; launcher smoke run passes. A nested-supervisor in-process test proved environmentally unstable (the inner Vitest main is killed under nested run-exclusive supervisors) and was not landed.

* perf(contracts): prune only over-depth schema branches instead of reducing whole schemas (#14107)

* perf(contracts): prune only over-depth schema branches instead of reducing whole schemas

A schema whose inlined form exceeded the depth-10 advertised limit fell back to reduceToShallowProperties for the entire tool, erasing enums and nested validation on all root properties. pruneSchemaBeyondDepth now replaces only sub-schemas past the prune depth with type-preserving placeholders (every replacement widens acceptance, so canonical server-side validation is unchanged), and both input and output compaction keep the pruned form as inline when it fits bytes, depth and dialect checks. Two compactInputSchema tests that pinned depth-forces-reduction now pin the pruned-inline contract with the same Ajv/dialect safety assertions.

Refs #13302. Verified: compactInputSchema, compactOutputSchema, toolSchemaMetadata, advertisedInputExamples (59 tests), check:fast, docs:check.

* docs(contracts): refresh advertised schema summary for pruned-inline compaction

Pruned-inline schemas retain patterns (digest, Evidence id and text patterns) that whole-schema reduction dropped on 13 tools; regenerate the committed catalog summary with npm run verify:advertised-schemas -- --update-summary and re-verify clean.

* fix(contracts): make deep-schema pruning widening-safe

Walk schema positions instead of raw JSON, preserve declared integer types, keep branches that fit, return no pruned schema under not/oneOf where widening can reject valid values, and recheck output byte budgets. Add regression coverage for closed objects, unsafe combinators, fitting enums, and nullable integers; refresh advertised summaries.

* fix(contracts): keep untyped deep schemas unconstrained when pruned

Inferring object from properties or array from items narrows an untyped schema, which accepts every JSON value; the placeholder is now always unconstrained when no type is declared. Add an Ajv regression accepting null and nested values through a pruned untyped branch.

* test(contracts): assert pruned untyped schemas at depth 8

The regression accepted values that never reached the replaced node, so
it stayed green for an object placeholder and did not distinguish
branch pruning from whole-schema reduction. Assert the empty schema at
depth 8 and accept null there.

---------

Co-authored-by: Cursor Agent <[email protected]>

* docs(github): require reported verification and factual docs in PR template (#14130)

* docs(github): require reported verification and factual docs in PR template

Record the maintainer checks for running needed validation, limiting
comments to constraints and decisions, and keeping documentation factual.
Mirror that guidance in AGENTS.md where it was not already stated.

* docs(github): assign the PR checklist to the author

Rename Before merge so the PR author completes it before requesting
review, and point the draft-PR note at that section.

* docs(github): confirm root cause and engineering rules on PRs

Add a few author-checklist items for the root cause, owning-boundary
interpretation, retained clea…
@morluto morluto added area: domain Domain logic, errors, and pure functions bug Something isn't working labels Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant