Files
reverse-engineering-anything/docs/reference/target-failures.md
T
morluto bd353e7e5c fix(errors)!: producers declare retry class, refusal recovery and real error codes (#15372)
* fix(errors)!: derive retryable from the producer's declared retry class

`retryable` means the unchanged request may succeed, but it was computed
downstream as an OR of a code table and five class rules. Every error
classification now declares a retry class (same_call, change_first, never,
unknown_outcome); `retryable` is `same_call` after one incomplete-cleanup
check, and the RETRYABLE_CODES table is deleted.

Producer corrections:
- update_unknown revision conflicts are change_first and report
  details.current_revision; duplicate record_unknown reports
  details.existing_unknown_id.
- close_gdb_session's explicit-disposition refusal is change_first.
- Per-call artifact reader limits are change_first (never when the limit
  cannot rise).
- An exited or unreachable Hopper bridge, and a Hopper start that another
  REA session owns, are change_first.
- File-descriptor exhaustion (EMFILE/ENFILE) outside process launch is
  occupied host capacity (same_call) for private workspaces, model and GPU
  readers and JavaScript application reads.
- apktool JVM native-thread exhaustion follows the shared capacity default.

BREAKING CHANGE: these refusals now report `retryable: false` (descriptor
pressure now reports `retryable: true` as `resource_constraint`). Callers
that repeated them unchanged should follow the remediation first: re-read
the unknown and retry with details.current_revision, dispose GDB inferiors,
raise the reported reader limit, or restart the Hopper provider.

* fix(errors): require producers to name recovery for conforming refusals

A refusal whose arguments match the input schema was presented as a schema
error whenever its producer left out remediation, and many producers did.
AnalysisInputError's options are now a union: a conforming refusal must
supply both its outcome (userMessage) and next step (remediationAction),
so the compiler lists every producer; only contract violations may fall
back to the schema guidance.

Producers fixed: unknown Frida session and script, decompile_all
output-directory state, the duplicate unknown build computer factory
(collapsed), stale Cutter sessions, Mach-O architecture selection, output
roots that already exist, selected files the host refuses, Ghidra lookups
the bridge could not resolve, YARA path refusals, unresolved native symbol
names, apt key files and withheld sign-in state. A missing selected APK is
now target_unavailable like every other selected-file reader.

The capability fallback "Choose another analysis or target" is deleted; a
capability refusal without its own recovery names details.reason and
binary_session.

Refs #15312

* fix(errors): classify caller selections and target bytes by their real failure

Several refusals reported a code that reads as corruption or a crash:
- a missing unknown_id and a missing Evidence reference now report
  invalid_request instead of execution_failure and
  evidence_integrity_mismatch;
- close_binary with snapshot_path in a resource-only session reports
  invalid_request instead of evidence_integrity_mismatch;
- ADB push onto an existing device path and pulls into an occupied output
  directory are conforming invalid_request refusals naming overwrite or
  output_directory, not unreadable_output;
- damaged APK ZIP, signing-block, signer and central-directory structures
  are malformed targets, not invalid input;
- NuGet and VSIX bytes without a ZIP signature are unrecognized, not
  malformed;
- a historical source graph file whose entries contradict its root
  commitment is an integrity failure, not invalid input;
- a CDP protocol failure states what happened instead of the unclassified
  fallback message.

Refs #15319

* feat(errors): expose the producer's retry class as retry_class

Every error projection now carries retry_class (same_call, change_first, never or unknown_outcome) beside retryable, which stays true exactly for same_call. The field is additive: the error schema accepts errors retained by earlier releases without it.

Refs #15323

* fix(errors): address review of the folded error-contract PRs

Keep a provider's own capability message as its remediation; the binary_session fallback applies only to a bare declared reason. Delete the unused conformingInputRefusal helper. Compose both retry fields for a refused publication whose cleanup is incomplete. Report descriptor exhaustion from a JavaScript directory opendir as occupied capacity. Let an exited Hopper startup attempt without a setup failure code retry unchanged. Declare retry for the Ghidra superseded checkpoint and unknown IDA readiness. Redact ambiguous selector candidates. Give a Ghidra document miss its own recovery. Drop an unchanged-files claim the journal repair cannot make. Name each withheld sign-in refusal's step. Hash the source graph commitment before the cancellation yield. Keep the browser protocol_error message neutral. Add tests for mutation-audit survivors C3, C5, P2, P4, P8, H1, H4 and H5.

* fix(errors): keep a missing Evidence reference an integrity failure and state only the observed commitment mismatch

* test(desktop): assert the unknown build computer refusal's remediation, not its message

The refusal now carries its next step in remediation.action instead of the message, so the closed-computer checks assert the exact code, message and remediation facts.

* fix(errors): keep producer retry choices apart from cleanup and fixed ceilings

A capture's retryable flag no longer folds in pending cleanup, so the projection applies the cleanup rule once and a transient capture with pending cleanup reports change_first instead of never. A release-fixed artifact allowance reports never, and a stale admitted session identity reports change_first (reopen, then retry); both have catalogue rows. The bare capability-unavailable remediation names binary_session only for a binary-analysis session, so standalone bridges such as Cutter are pointed at their own reason.

* test(vsix): expect a non-ZIP selection to be refused as unrecognized

This PR reports bytes without a ZIP signature as another format (unrecognized), not a damaged package; the exact-reason assertion added on main still expected malformed.

* test(delivery): expect the capacity refusal's retry class in delivered failure facts

The exact failure facts asserted on main predate the projection's retry_class; occupied capacity reports same_call.

* fix(errors): mark a sent Hopper cancellation unknown and missing Evidence recoverable

A cancellation Hopper already received may still apply, so its retry class is unknown_outcome instead of same_call; an unsent cancellation keeps same_call. A missing EvidenceReferenceError is change_first, since importing the referenced records lets the same request succeed; other reference failures stay never. Both have catalogue rows.

* fix(hopper): ask for changed launch arguments before retrying an unencodable launch

A launcher path or argument that cannot be encoded as an AppleScript literal meets the same pre-launch guard on every attempt, so the start refusal is change_first and its retry_action is unknown; a start failure without a declared reason stays same_call.

* fix(errors): keep a one-shot cleanup failure's retry class with its cleanup state

A one-shot reply that reports cleanup_incomplete spread the primary or cleanup projection and overrode only retryable, so a timed-out read whose close also failed carried retry_class same_call. The reply now reads its retry class from the typed composed failure, and never offers the same call before cleanup settles.

* test(evtx): expect an unreadable selected log to be refused with its own recovery

This PR treats a well-formed path the host refused as a regular file as conforming input with its own remediation; the evtx boundary test still expected a schema-recovery refusal.

* test(javascript): expect a broken source-graph commitment as an integrity failure

This PR reports a well-formed historical source graph whose entries disagree with its root_sha256 as evidence_integrity_mismatch, not an input issue; the exact refusal assertion added on main still expected invalid_request.
2026-12-01 05:32:33 +00:00

10 KiB

Target failures

When REA cannot read a target, details.failure_kind identifies why. It is the primary machine identifier, in the sense of an RFC 9457 problem type. code is a coarse class derived from it, and retry says whether repeating the request can help. Clients should branch on failure_kind and must not parse message, remediation.action or details.reason.

Kinds

failure_kind Meaning code category retry What to do
selection The request names something that is not a valid target for this operation. invalid_request invalid_input after_change Fix the request.
unrecognized No reader for this operation recognizes the bytes. unsupported_target unsupported_target none Choose another operation or provider.
unsupported A recognized format, but in a version or variant this reader does not implement. unsupported_target unsupported_target none Choose another operation or provider.
malformed The bytes break the format's own rules. unsupported_target unsupported_target none Choose another target, or a well-formed copy.
truncated The bytes end before a structure they declare. unsupported_target unsupported_target none Re-acquire the complete file.
integrity The bytes contradict a digest or checksum they declare. target_integrity_mismatch integrity_mismatch none Get a fresh copy, or keep the observed bytes with integrity_policy=record-and-continue where it is offered.
conflict Two or more inputs each parse, but disagree. None is blamed. input_conflict invalid_input after_change Select inputs that belong together.
changed The file changed while it was read. artifact_changed integrity_mismatch backoff Retry once it is stable.
access Host permissions denied the read. access_denied unavailable after_change Grant read access.
io The host could not read the file. host_io_failed execution_failure backoff (transient errno) or none Retry with backoff for a transient error. Otherwise check the device and file.

The four target refusals share unsupported_target because the caller cannot use the target as it stands, and each needs a different target or tool. failure_kind says which. No other code covers more than one kind.

The list of kinds can grow. Handle the kinds you know, and treat any other kind by its code.

Inventory operations report a container, member or read range that changed during the read as changed, with details.integrity_check naming the check (container-identity, member-identity, unpacked-entry-identity, read-coverage or traversal-coverage). Every operation that reads a selected artifact follows the same rule. A selected target that no longer matches the one the session opened (integrity_check: admitted-identity) is not changed: it reports artifact_operation_failed with retryable: false, and you reopen the target instead of repeating the request. Any other failed integrity check is likewise not retryable unchanged.

A caller's cancellation (cancelled) and an admission limit (resource_constraint) describe the operation, not the target, so they keep their own error shapes. A result cut short by a delivery or decode limit reports code partial. truncated names only a target whose bytes end early.

Retry

retry Meaning
none Repeating the request cannot help. The target itself must change.
backoff The unchanged request may succeed later. Retry with backoff.
after_change Only a changed request, input or host permission can succeed.

retryable keeps the meaning it has across all REA errors: the unchanged request may succeed. For a target failure, it is true exactly when retry is backoff, and retry_class maps backoff, after_change and none to same_call, change_first and never.

Details

Every target failure reports:

  • operation: the operation that refused the target.
  • path: the exact file at fault. For a composite request, this is the input whose bytes failed. For a conflict, it is the primary input, and inputs lists all of them.
  • failure_kind: the kind.
  • format: the format whose owner established the failure, such as elf, macho or pe-cli.
  • reason: the owner's description, for people.
  • offset and field: where the failure is, when the owner knows.
  • partial_observation: the file's size and SHA-256, when the operation hashed the file before it refused it.

Some kinds add facts:

  • truncated reports available_bytes and required_bytes when the owner measured them.
  • conflict reports inputs, a list of { field, path } entries, one for each input that disagrees. The CLI spells each field the way the command spells its option.

MCP delivery

A target failure is always a tools/call result with isError: true, and its projection is the JSON text block. It is never a JSON-RPC error. A provider that throws a target failure inside a tool handler still produces this result.

Migration

This model replaces details.format_failure with failure_kind. It also changes these codes:

  • the truncated code to partial;
  • artifact_operation_failed to target_integrity_mismatch or host_io_failed;
  • invalid_request to input_conflict, for a pair of inputs that disagree.

The remaining operations move to this vocabulary area by area, and each release note lists the operations whose code changes. The plan is tracked in #14239.

Container and inventory readers (ZIP, ASAR, PyInstaller, .NET bundles, Node SEA, Deno and Bun standalones, Godot PCK, UnityFS, wxapkg, FIT, uImage, iNES, Android OTA payloads, ESP images, NTFS $MFT streams, firmware record files and others) now report damaged bytes as malformed or truncated, with the reader's format. Before, they reported artifact_operation_failed with details.reason: "format". Two other things changed:

  • The Playwright trace, NTFS journal, release exposure and web capture operations report a damaged selected file as unsupported_target, not invalid_request.
  • inspect_sqlite_database, inspect_binary_layout, inspect_recorded_crash and inspect_evm_interface also report a damaged selected file as unsupported_target (failure_kind: "malformed", with format sqlite, elf, elf-core or evm-bytecode), not invalid_request.
  • A short read after REA measured the file is now an integrity failure with details.integrity_check: "read-coverage" (the file changed during the read), not a format error.
  • An inventory, inspection or extraction of a container (inventory_artifact, inspect_artifact, extract_artifact and the bundle readers such as inspect_keyed_archive) reports damaged or unsupported bytes as a target failure of the selected path, with top-level retry, like every other operation. details.reason is now the owner's description, and details.detail is gone. Before, these refusals reported details.reason: "malformed", "truncated" or "unsupported" with the description in details.detail, and no path.
  • A file that is not a native image at all is now unrecognized, not malformed or unsupported. inspect_native_initializers reports a file with neither ELF nor Mach-O magic, such as a PE file, as unrecognized (format: "native-binary"). Thin Mach-O readers, such as inspect_macho_function_starts, report bytes without Mach-O magic as unrecognized (format: "macho"). The Go and Rust binary readers report bytes that are not ELF, PE or Mach-O as unrecognized too. A recognized header that is cut off or broken stays truncated or malformed.
  • Every unsupported or unrecognized target is now a target failure too: failure_kind is unsupported or unrecognized, with the owner's format, top-level retry, and a recovery from the table. Where the owner knows which operations read the target, the recovery names them and details.related_operations lists them. Producer-written remediation sentences are gone; their guidance is in details.reason.

Related: settings, limits and recovery for limit failures, and docs/user-visible-errors.csv for every error case and its code.