`createPefileReadCompatibility` models pefile's section reads so an import hash is published only
when both readers see the same bytes. Its layout gate rejected any section whose
`PointerToRawData` was not 512-aligned — but pefile 2024.8.26's `get_PointerToRawData_adj()` skips
that rounding when `SectionAlignment < 0x1000` and `PointerToRawData == VirtualAddress`, the
`LdrpWx86FormatVirtualImage` layout ntoskrnl-era drivers use.
The gate already modelled the sub-page case two lines above (`SectionAlignment < 0x1000 ?
FileAlignment : SectionAlignment`), then rejected it against an absolute 512 rule — and
`docs/pe-imports.md` scopes the withhold to an incomplete table or a different row sequence, not to
a file offset.
Measured on a minimal image with `SectionAlignment = FileAlignment = 0x80` and `.idata` at RVA 0x300
== file offset 0x300:
| | before | after |
| --- | --- | --- |
| coverage | `complete` | `complete` |
| issues | `[]` | `[]` |
| `imphash.md5` | `null` | `92cef6cc91a85825f3c8a0516517c66f` |
The withheld hash is the only thing that differed: both readers were already reading the same bytes.
The exception is exact rather than approximate — a section with the same sub-page alignment whose
`PointerToRawData` differs from its `VirtualAddress` still withholds, because pefile does round it
there. That case is the second new test.
pefile's current `master` broadened the condition to every sub-page image; this matches the
2024.8.26 revision the module documents, which is the narrower and safer rule.
`tests/fixtures/binaryDiagnostics/peImports.ts` takes an optional `layout`, so the shared builder
produces the geometry instead of a test hand-encoding a second image. Its default is unchanged —
`SectionAlignment`/`FileAlignment` are written only when supplied, so every existing fixture keeps
its exact bytes.
`src/native/pe` — 265 passing. Restoring the absolute 512 rule fails the sub-page case.
Node Inspector discovery reports a target as `file://` plus the pathname,
with quotes and backslashes replaced by underscores. Whether such a
pathname is identifiable was decided twice: inline in
authorizeRuntimeTargetLocation and again as NODE_DISCOVERY_AMBIGUOUS in
the createNodeDiscoveryTempDirectory fixture. The copies could drift, and
the fixture could not import the product rule without loading
JavaScriptRuntimeScope and its Electron file-scope chain.
Move the rule to src/inspector/nodeDiscoveryPath.ts, a module with no
imports, and use it from both places. Behavior is unchanged. A unit test
covers the Windows branch, which Linux CI cannot reach through the
boundary tests.
Validation: nodeDiscoveryPath and cancellation tests 12/12;
javascriptRuntimeTargetLocations and javascriptRuntimeObservation 42/42
with TMPDIR containing an underscore (exercises the /tmp fallback);
check:fast passes.
Refs morluto/rea#9996
* fix(apple): rethrow internal invariant violations while resolving a bundle's program file
Bundle target resolution decodes Info.plist with the shared binary plist decoder, which reports a broken internal assumption as InternalInvariantError. The resolver caught every decode failure and reported it as a BinaryTargetError ("Info.plist is malformed, unsupported, or lacks CFBundleExecutable"), and its two outer catches wrapped anything else the same way. A REA defect therefore reached the caller as a fact about the user's bundle.
#11029 made the other plist consumers rethrow the invariant. The resolver's decode site and both outer catches now do the same.
Tests: a boundary test opens a .app and a .bundle through parseBinaryTarget with the decoder replaced by one that reports an invariant violation. Before this change both resolved { ok: false } with a BinaryTargetError; now both reject with the InternalInvariantError. The same bundles open normally with the real decoder.
* test(apple): mock the binary plist decoder at its domain path
Main moved the binary plist materializer from src/artifacts/apple to
src/domain/apple, and AppBundleExecutable now imports it from there. The
invariant test still mocked the old path, which no longer exists, so tsc
failed and the mock would have intercepted nothing.
The test now mocks src/domain/apple/binaryPlistMaterializer.js. With the
rethrow removed from AppBundleExecutable both cases fail; with it they pass.
An empty or whitespace-only --client or --skill-client value normalizes to an empty key, which is a prefix of every id, so suggestion ranking named an arbitrary client. Skip the suggestion for an empty key and report the supported list.
Setup and doctor resolve --client and --skill-client values by trimming,
lowercasing and collapsing runs of '-', '_' and whitespace, then matching a
canonical id or an alias the client row already declares for 'rea mcp add'.
An unknown value now reports 'Unknown client' with the closest id from
suggestCommand, or the supported list when nothing is close. The error code
and field path are unchanged.
No V8 8.8 through 11.7 producer runs in the test environment, so the
fixture is synthetic, as it already is for the narrow header: a real
cache without its build-constant word and its alignment word, which is
the container those releases define.
Cover the admitted layout through the parser and the public CLI, the
bit 31 module flag, a truncated six-word container, a container that
fits both layouts, and the word-table rule for a 24-byte header. The
short-header case now also covers the new 24-byte minimum.
The CLI case is the recorded lifecycle coverage of the provider, so its
new title is updated there as well.
`file -b` reports `data` for an XML plist containing a control character
or NUL byte, which CoreFoundation still reads. plistSourceFormat only
probed the source for markup when `file` reported text, so these sources
were labelled `unknown` and skipped REA's XML reader. When that reader
would have refused them, the result also lacked the limitation that says
the value came from plutil's conversion. Two plists shipped with macOS
27.2.1 are affected.
Probe the source prefix for any description that does not name binary,
XML or JSON. Such XML now takes the same route as XML that `file`
recognizes: REA's reader decodes it directly, or #12251's plutil fallback
records REA's refusal reason. OpenStep and other non-markup sources stay
`unknown`.
OpenPGP packet headers read their one-, two- and four-byte lengths with
raw Buffer reads after the header-width checks. Read them through an
openpgp BinaryReader. This was the last counted raw numeric read, so the
raw-buffer-read baseline is removed and the guard now refuses any new
copy outright. The CI change-scope test names another baseline file as
its static-only path.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
A binary plist UID projects as `{ UID: n }` and the XML convention as
`{ CF$UID: n }`, so the structural check accepted a UID-valued $top as the
roots dictionary. A plist naming another archiver with such a $top was then
decoded with an invented root named after the UID key. The kind test now
also requires that $top is not a UID. NSKeyedArchiver archives keep their
existing $top handling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keyed archives may now name another archiver, so the name is source
metadata a caller needs: a SceneKit scene says SCNKeyedArchiver. The
keyed-archive result gains `archiver`, the declared `$archiver` string, and
the inspect_keyed_archive contract describes archives written by
NSKeyedArchiver or a subclass archiver such as SCNKeyedArchiver instead of
NSKeyedArchiver plists only.
The reviewed golden graph adds `"archiver": "NSKeyedArchiver"` for its
capture; only its provenance digest changes, and the captured XML does not.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Foundation's NSKeyedUnarchiver decodes a keyed archive whatever its
$archiver names. SceneKit writes .scn scenes with SCNKeyedArchiver, so
inspect_keyed_archive refused system and third-party scenes such as Audio
MIDI Setup's SpeakerRoom.scn as "not an NSKeyedArchiver archive" and pointed
the caller at inspect_plist.
An archive named NSKeyedArchiver keeps its current handling, including
format failures for a damaged table. Another string archiver name is a keyed
archive when the plist also has an $objects table and $top roots; without
them it stays an ordinary property list with the inspect_plist workflow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(artifacts): keep a ZIP inventory when one member uses an unsupported compression method
zip.js refuses a member whose compression method it has no codec for, such
as bzip2 (12) or LZMA (14), before reading its data. typedZipFailure turned
that refusal into an archive-level unavailable failure, so inventory_artifact,
inspect_artifact and compare_artifacts rejected the whole archive and never
listed or hashed its readable members. unzip and bsdtar list them all.
A refusal raised while reading one member is now ArtifactEntryContentUnavailable,
the per-member failure the inventory scan already records, as UnityFS members
with unsupported compression do. The member keeps its occurrence with an
unavailable hash and a limitation naming the method, siblings are hashed, and
coverage is unknown. Extraction of that member is still refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(artifacts): keep ZIP entry coverage complete for an unreadable member codec
The central directory still lists every entry when one member's compression
method is unsupported; only that member's content is unreadable. Recording an
unknown traversal made inventory coverage, whose scope is container entries,
claim that entries might be missing. Drop the traversal override, as the
encrypted-member path already does, and let the occurrence limitation carry
the content gap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The desktop state-reader close collects up to three failures (artifact
scope, SQLite service, and the export worker retry), but composed only
the first two with analysisErrorWithCleanupFailure and bound the rest by
hand. The third failure's reason never reached the caller. Fold the
failures through analysisErrorWithCleanupDependencies so each keeps its
reason and owner; two failures produce the same composite as before.
Refs #11859
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The completed-abort-reclassification pattern matched any `.ok && …aborted`,
including `!outcome.ok && signal?.aborted`, which attaches a secondary
cancellation to an already failed primary and reclassifies nothing. Move
the pattern to completed-abort-guard.mjs, where the receiver chain
(member, optional, private, element and call segments) must start the
check, and cover positive and negated forms in tests.
DesktopApplicationState and FridaInstrumentationService leave the
baseline.
Fixes#11920
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>