BMPString and UniversalString decoding read code units with raw Buffer
reads after their length-multiple checks. Read them through the
pe-certificate-table BinaryReader instead.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The fixed-string custom-attribute prolog and the embedded resource length
were raw Buffer reads after their length and directory checks. Read them
with the managed BinaryReader formats the other metadata readers use.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The Objective-C method and Swift relative-pointer decoders read 32-bit
displacements straight from the image bytes, beside the checked u32 and
pointer readers. The shared dispatch readers now provide i32 through the
image BinaryReader and both facets use it, so they no longer take the raw
image bytes.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The build-version platform and tool count were read through a local
DataView after the command-size check. Read them with machoWordReader,
as the other load-command decoders do, and drop the now-unused viewOf.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
readGnuPropertyWords decoded property type, size and feature words with
endian-selected raw Buffer reads. Every read already sits behind the
record length checks, so the shared reader returns the same values.
Refs #11865
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The image and publisher cleanup retry built its composite and bound the
parts by hand; providerCleanupErrorFromFailures builds the same composite.
It names close_binary, the ProviderCleanupError default that the parts
and the previous composite used.
Refs #11859
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
ArtifactAnalysisResources built its multi-failure cleanup composite and
bound the parts by hand; providerCleanupErrorFromFailures builds the same
composite with the existing per-part diagnostics.
Refs #11859
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The resolver retry built a multi-marker ProviderCleanupError and bound
the markers by hand; providerCleanupErrorFromFailures builds the same
composite, including the distinct resource list.
Refs #11859
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
V8InspectorProvider built its multi-failure cleanup composite by hand and
bound the parts with bindCleanupDependencies. providerCleanupErrorFromFailures
builds the same composite: resources, reason, operation, aggregate cause
and release tracking.
Refs #11859
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.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>
* perf(mcp): trim deferrable result schema storage
* test(mcp): guard the deferred catalog output projection
* test(mcp): validate hardening against the canonical output schema
* fix(electron): preserve scenario waits through renderer crashes
* fix(electron): retain action cancellation across final Inspector failure
* fix(electron): collect active state in a single Inspector call
* feat(ida): support the official Hex-Rays IDA MCP headlessly
Hex-Rays IDA MCP serves database reads only through execute_python, so
REA rejected it as an upstream. A `hexrays` headless stdio registration
now leases a private idalib worker through open_database, answers the
existing database-supervisor reads with a fixed, packaged, read-only
query module, and releases the lease with close_database, verified by
list_databases.
Observations record execute_python, the query and the module digest.
Tool errors are typed so a completed rejection is distinguished from an
unknown outcome; an unconfirmed release is retried and a late lease on
the private input is adopted.
Validated IDA source and bridge tests, static checks, docs, and npm run
verify:ida on Linux x64 against x86-64 and AArch64 ELF fixtures.
* feat(ida): name the Hex-Rays registration for its catalog
A registration without `protocol` that reaches the official Hex-Rays
server failed with only the missing database-supervisor tools. Startup
profile failures now report the advertised catalog, and when it is the
Hex-Rays one the message and recovery name the `hexrays` registration.
Refs #1416
* docs(ida): state Hex-Rays prerequisites and upstream session traces
Upstream needs IDA 9.4 or later with idalib, Python 3.11 or later, uv
and Git. The profile does not analyze databases open in the IDA GUI, and
the server keeps its own session traces outside REA's workspace.
Refs #1416
* fix(ida): skip inline data when scanning Hex-Rays calls
The call scan decoded every head that FuncItems yields. Inline data such
as a jump table can decode as a call and refer to a function or import,
which reported false callees and call-graph edges. Skip non-code heads
before decoding, as disassembly already does.
Refs #1416
* fix(ida): retain Hex-Rays health reads in evidence
The identity and readiness reads around each operation kept only their
parsed result, dropping the bridge digest and any engine output. Keep
them whole as health_observations beside the parsed metadata, in both
successful and partial-failure Evidence.
Refs #1416
* test(ida): list the Hex-Rays bridge in package fixtures
The packed-bridge verifier has required bridge/ida/hexrays_queries.py
since the Hex-Rays profile landed, but three package tests still built
their member lists without it. The verifier stopped at that file, so 21
cases failed or asserted on the wrong omission.
Refs #1416
* feat(ida): open existing IDA databases through the Hex-Rays profile
A headless open re-ran auto-analysis from the input binary, discarding
the names, types and comments of an existing database and taking far
longer on large targets. Target admission now identifies IDA databases
by their IDA1/IDA2 signature, and the hexrays profile opens a private
copy of one; Hopper and the other IDA profiles reject them.
The copy is required, not incidental: idalib repacks a database when
its last lease is released, even without a save. A database reports
the input it was created from, so the session is bound to the opened
copy's idb_path, and health now reports the input SHA-256 it records.
Validated with resolver, provider and session tests, check:fast,
docs:check and test:changed, plus a real Hex-Rays MCP run against a
1.4 GB SC2 .i64 whose original file was left byte-identical.
Refs #1416
* fix(ida): verify the private workspace of a database target by idb_path
* test(ida): fix Hex-Rays health stand-ins and Windows path and runtime teardown
* refactor(ida): resolve the registration once for target support
* docs(ida): record the real Hex-Rays run on an existing .i64
* docs(ida): make the Hex-Rays registration example install-neutral
* chore: keep merge-hook formatting outside the IDA change
* fix(ida): retain live Hex-Rays databases this server does not lease
A list_databases row with instance_id null is a live owner, not a stopped
database. Mapping it to the supervisor's released-worker shape made cleanup
delete files another client still held. Unleased rows stay active, so the
private path must leave inventory before the workspace is removed.
Accept idat inventory rows, hash the query bridge with sha256Hex, and
complete databaseEngine on Hopper fixtures added on main.
* fix(ida): report uncapped Hex-Rays call graphs
* docs(ida): link to the Hex-Rays bridge on GitHub
* fix(ida): verify Hex-Rays worker identity and cleanup
* feat(ida): support Hex-Rays idat headless workers
Refs #12921
* fix(ida): retain workspace after ambiguous Hex-Rays startup
* fix(ida): preserve typed Hex-Rays call edges and deadlines
* test(ida): verify Hex-Rays cleanup with a peer lease
* test(ci): use project deadlines for the Cutter verifier
* test(ida): keep verifier cleanup fixtures scoped to mocked modules
* fix(ida): retain the worker backend in partial evidence
---------
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
* ci(release): require full qualification before tagging
* ci(release): preserve unpublished versions and verify npm before tagging
* test(release): exercise publication gates on both release routes
* fix(release): fetch the live main checkpoint before verifying it
* fix(release): constrain GitHub requests and workflow output
* fix(release): honor GitHub label and recovery API contracts
* refactor(verify): run Hopper and Kuna verifier commands through the supervised owner
Replace bare execFile in the Hopper and Kuna real-provider verifiers with
createVerifierCommands, and run pre-workspace toolchain probes through
runOwnedCommand. Close the owner before lineage verification and keep the
diagnostic workspace when cleanup, lineage, or the run fails.
Replace isError-only and FAT64 prose refusals with the projected error code
and structured issue or target details.
* fix(verify): release a clean Kuna workspace after a verification failure
A failed check whose provider, command, and lineage cleanup all completed
still removes the root. The workspace stays only when that cleanup is
unconfirmed, which is the contract the Kuna verifier failure-path tests
already require.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(verify): keep the Kuna report when workspace release fails
release() closes cleanup registration before it removes the root, so
retain() after a failed release throws and skips the JSON report. Register
retention only when release has not started; a failed release already
keeps the workspace.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(verify): keep both Hopper verification and lineage failures
When verification has already failed and lineage observation then fails,
the retained-workspace error carried only the earlier cause. Aggregate
both failures in the Hopper, FAT, and caller verifiers so the cleanup
reason stays with the workspace.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(verify): keep Hopper manifests inside the repository
realpath() accepted REA_HOPPER_CONFORMANCE_MANIFEST_PATH as any filesystem
path. Resolve the manifest against the repository and reject a lexical or
symlink escape before it is read.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(verify): acquire command owners before verifier workspaces
* fix(verify): create the command owner before the verifier workspace
If command-owner setup fails after a workspace is allocated, the temporary
root is never released. Create the owner first and close it when workspace
allocation fails.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(verify): supervise Hopper helper CLI processes
* fix(verify): run Hopper helper CLIs through the command owner
Boundary and Linux owner-exit checks still launched the REA CLI with
execFile, so a timeout could not stop those processes. Both helpers now
require the verifier command owner and run those CLIs through it.
Co-authored-by: morluto <morluto@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
* refactor(verify): run Ghidra verifier commands through the supervised owner (2 of 2)
Route the remaining Ghidra verifier compiler and CLI launches through
createVerifierCommands, close that owner before lineage observation, and
assert the raw arm64 alignment refusal from its structured error.
* fix(verify): stop detached Ghidra verifier commands on interrupt
SIGINT and SIGTERM abort the command owner and the scripts wait for its
cleanup, so a compiler started in its own process group cannot outlive
the verifier.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(verify): stop Ghidra verifier analysis when interrupted
Pass the verifier interruption signal into MCP and Ghidra waits, and stop
waiting for calls that cannot observe it, so SIGINT does not continue the
analysis before cleanup.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(verify): stop the switch evidence probe when the verifier is interrupted
Pass the verifier interruption signal into the detached Ghidra control
probe and end its wait so supervisor.stop() runs before a later SIGKILL.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(verify): observe work already started when a verifier interrupt wins
untilInterrupted now settles the caller's promise after the signal has
already aborted, so a connection started just before the check cannot
reject with nobody listening.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* refactor(verify): share verifier interrupt handling and keep it through release
Move the SIGINT/SIGTERM abort wiring into bindVerifierCommandInterruption.
Handlers stay installed until after fixture release, and untilInterrupted
still observes a promise that was already started.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(verify): keep diagnostic workspaces and stop fixture builds on interrupt
Check the interruption signal after finalization and before the fixture
root is removed. MIPS and RISC-V fixture compilers and readers now run
through the verifier command owner, so SIGTERM aborts them instead of
waiting out their execFile deadline.
Co-authored-by: morluto <morluto@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
* test(limits): check documented limit defaults against code instead of per-file pins
The numeric-limit script now reads every default, floor, and maximum in
docs/design/rea-limit-inventory.md and compares it with ANALYSIS_SETTINGS
or the owner constant the parser enforces. A mismatch names the limit and
both values. Pins that only restated a covered value are removed.
Pwntools input bytes and the Kuna timeouts now use the shared exports, so
the registry value is the one the parser applies.
* fix(limits): reject a fractional documented limit cell
The cell parser treated a dot as the end of the integer, so 5000.5
compared equal to 5000. A documented number is now one complete integer,
with prose only after whitespace.
Co-authored-by: morluto <morluto@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
* refactor(verify): run Ghidra verifier commands through the supervised owner
Route the first Ghidra verifier batch's compilers, linkers, and CLI through
createVerifierCommands, and close that owner before the lineage check.
Replace MCP isError prose checks with the structured refusal each tool builds.
* fix(verify): resolve Windows 6502 toolchain names through the command owner
runOwnedCommand passes a bare ca65 or ld65 name to the Windows process
owner, which accepts only a drive-absolute path. The verifier command
owner resolves those PATH names before launch.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(verify): release the Ghidra fixture when a toolchain probe fails
retain() only registered a cleanup that nothing ran, so a failed compiler
probe left the empty fixture directory behind. Release it after the command
owner closes, and name the retained path when that close does not confirm.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(verify): close the m68k command owner when session shutdown fails
Client, transport, and command cleanup are independent. A failed client or
transport close, or a failed runtime read, no longer skips the command owner.
Co-authored-by: morluto <morluto@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
REQUIRED_RUNTIME_LIMITS still named three limits whose PRs never merged.
The checker skipped a required name absent from source, so the stale
entries passed. Remove them and fail that case with a typed result that
names the limit.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* fix(v8): read the code cache header size from the container
V8 sizes the header with `kHeaderSize = POINTER_SIZE_ALIGN(kUnalignedHeaderSize)` and
`kUnalignedHeaderSize` is 28, so the header is padded *after* its words: a 64-bit producer writes
32 header bytes and a 32-bit one writes 28. The reader pinned 32 and required the declared payload
to equal `bytes.length - 32`, so every container from a 32-bit producer failed as "truncated or
corrupt".
Measured here on Node 24.22.1 (V8 in x64): take a real cache and drop the four alignment bytes at
offset 28. V8 loads it unchanged — `cachedDataRejected === false` — while the reader refused it:
before: Header declares a 392-byte payload but 388 bytes follow the 32-byte header
after: ACCEPT header_bytes=28 words=7 payload.offset=28
The payload-length word sits at byte 20 in both layouts, so the declared length already states how
much trailing padding the container carries. The header size is derived from it now: `28` and `32`
are admitted, the reported word table covers exactly the header the container holds (7 or 8 words),
and the schema requires that table to agree with `header_bytes`.
Nothing is loosened. A header that is neither 28 nor 32 bytes is still `malformed`, and the
16 existing cases pass unchanged — dropping only the derivation back to the constant fails exactly
the new narrow-header case.
`src/v8` — 26 passing. `npm run lint` and `tsc --noEmit` clean.
* fix(v8): refuse a wide cache that is only four bytes short
A review finding on the previous commit, and a real one: deriving the header size from the declared
payload length makes a 32-byte-header container truncated by four bytes resolve to 28, because
`bytes.length - declaredPayload` loses exactly those four bytes. The reader then accepted a
truncated cache and read its payload one word long.
The wide header's last word is `POINTER_SIZE_ALIGN` padding that V8 leaves zero, and a narrow
container has payload where that word sits. Measured on Node 24.22.1 across six different sources:
the padding word is always `0x00000000` and the first payload word is always non-zero. So the zero
word is the only evidence that separates the two, and it is now required to be non-zero for the
28-byte layout:
| container | before this commit | after |
| --- | --- | --- |
| real 32-byte header | accept | accept, `header_bytes=32` |
| real 28-byte header | accept | accept, `header_bytes=28` |
| 32-byte header truncated by 4 | **accept** | refused as `malformed` |
The guide also described one pinned 32-byte header; it now describes both layouts, how the size is
resolved, and why an ambiguous container is refused.
`src/v8` — 27 passing. Removing the guard accepts the truncated container again.
* fix(v8): read the padding word through the header accessor
A Static checks finding: `verify/architecture-guards.mjs` counts raw Buffer reads in parser folders
and allows only a shrinking baseline, and the previous commit added one:
```
raw Buffer or DataView numeric read (use BinaryReader ...); new copies are not allowed:
src/v8/V8CodeCacheParser.ts: 2 (baseline 1)
```
The read is the narrow-header discriminator — the alignment word a 64-bit producer leaves zero at
offset 28. It now goes through the file's existing `field(index)` accessor instead of calling
`bytes.readUInt32LE` directly, so the count returns to the baseline while the check itself is
unchanged: `field(7)` is byte 28, and `V8_CODE_CACHE_NARROW_HEADER_BYTES / 4` spells that index.
`node scripts/verify/architecture-guards.mjs` — passed across 2 843 source files.
`src/v8` + `tests/boundary/rust` — 68 passing. `tsc --noEmit` 0 errors.
Setting the condition to `false` fails "refuses a wide container that is only four bytes short",
so the check is still load-bearing.
* fix(v8): ground the narrow-header rule in the producer, and test the word table
Two review findings.
**The rule was stated as measurement, not as format.** The previous comment justified the zero-word
discriminator with "measured on Node 24.22.1 every real payload begins with a non-zero word", which
makes support for other producers depend on one host. The producer zeroes that padding rather than
copying payload over it: `SerializedData::AllocateWithPayload` in `src/snapshot/snapshot-data.cc`
runs `std::fill_n(data_, header_size, 0)` before writing any header word, and
`kHeaderSize = POINTER_SIZE_ALIGN(kUnalignedHeaderSize)` in `src/snapshot/code-serializer.h` puts the
four padding bytes inside `header_size`. So a zero word at byte 28 is a fact about the producer, not
about one Node build.
The refusal is now worded as the reservation it is: a narrow container whose payload happened to
begin with four zero bytes would match the same test, and no reading of the header alone separates
the two cases. The message says both readings instead of asserting corruption.
**The word-table rule had no test that could fail.** `header.fields.length * 4 === header.header_bytes`
cannot disagree on a parsed container — the parser derives both from `payloadOffset` — so it is only
reachable through the schema, which is what a stored or projected report also goes through. The new
case builds four reports directly: seven words with 32 bytes and eight words with 28 are refused on
`header.fields`, while the two consistent pairs are accepted. Setting the rule to `false` fails it
with `7 words / 32 bytes: expected true to be false`.
`node scripts/verify/architecture-guards.mjs` — passed across 2 843 source files.
`src/v8` + `tests/boundary/rust` — 69 passing. `tsc --noEmit` 0 errors, `npm run lint` 0 errors.
* refactor(v8): share decoded code cache header words
* fix(v8): validate narrow header evidence without assuming runtime compatibility
---------
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>