mirror of
https://github.com/morluto/rea.git
synced 2026-11-24 13:18:39 +00:00
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.