* 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>
* fix(elf): decode a 32-bit prpsinfo whose ABI gives pr_uid 32 bits
`decodeCorePrpsinfo` assumed every ELFCLASS32 core carries the i386/ARM `struct elf_prpsinfo`:
16-bit `pr_uid`/`pr_gid` and a 124-byte descriptor.
`pr_uid` is `__kernel_uid_t`, and its width is an ABI property, not an ELF-class one. Only
`arch/x86/include/uapi/asm/posix_types_32.h` and its ARM/m68k/sparc counterparts narrow it to
`unsigned short`; everything else takes `asm-generic/posix_types.h`'s `unsigned int`, so MIPS o32,
PowerPC-32, s390 and `compat_elf_prpsinfo` (`include/asm-generic/compat.h`:
`typedef u32 __compat_uid_t`) write a 128-byte struct with every member after `pr_flag` four bytes
later.
Reading a 128-byte descriptor with the 124-byte offsets published wrong values rather than null.
Measured through `parseElfNotes`, with `uid 70000, gid 80000, pid 4242, fname mips-proc`:
before: {"pid":80000,"ppid":4242,"pgrp":1,"sid":4242,"uid":4464,"gid":1,
"filename":"\u{10}","psargs":""}
after: {"pid":4242,"ppid":1,"pgrp":4242,"sid":4242,"uid":70000,"gid":80000,
"filename":"mips-proc","psargs":"./mips-proc --serve"}
`pid` came out of the middle of `gid` and the two text fields came from the wrong offsets
entirely.
The kernel writes `sizeof(*psinfo)` as the descriptor — `fs/binfmt_elf.c`:
`fill_note(&info->psinfo, PRPSINFO, sizeof(*psinfo), psinfo)` — so the declared length already
carries the distinction and no machine table is needed. The 32-bit id width is now
`descriptor.length >= 128 ? 4 : 2`, and `pr_pid`/`pr_fname`/`pr_psargs` are derived from it. The
124-byte and 136-byte decodes are unchanged; the second new case pins that.
`src/native/elf` and `src/domain/native` — 535 passing. Forcing the 16-bit layout fails the new case.
* test(elf): produce the 32-bit prpsinfo layout from the shared note builder
Review finding: the regression hand-encoded a second NT_PRPSINFO layout while `corePrpsinfoNote` is
the repository's producer for this format, so nothing else could represent the MIPS/PowerPC/s390
ABI and the two encodings could drift.
`corePrpsinfoNote` takes `idWidth: 2 | 4` now. It allocates 124 or 128 bytes from it, writes
`pr_uid`/`pr_gid` at that width, and derives `pr_pid` through `pr_psargs` from `8 + idWidth * 2`
instead of the fixed 12/28/44 offsets. The option is ignored for a 64-bit image, whose layout is
fixed at 136.
Both new cases build their descriptor through the producer, so the test no longer carries offsets
the fixture does not know about.
* test(elf): drop the duplicate 124-byte prpsinfo case
The previous commit's rewrite left the original hand-built 124-byte block in place, so the same
regression ran twice — once through `corePrpsinfoNote`, once with the offsets written out again.
Keeping both is exactly the drift the shared producer was supposed to end.
* fix(elf): preserve SuperH PRPSINFO decoding
---------
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
Co-authored-by: wunianze666-netizen <wunianze666@gmail.com>
* feat(ghidra): admit ELFv2 PPC64 executables through a Power ISA 3.0 lane
An EM_PPC64 ELF has been classified in the powerpc family since #12089, but
the Ghidra lane still refused every ELF64 file. It now admits ELF64 ET_EXEC
files that declare the ELFv2 ABI, little or big endian, and imports them with
PowerPC:LE:64:A2ALT or PowerPC:BE:64:A2ALT by byte order.
Ghidra's 64-bit "default" languages decode the G2-era instruction set and
stop at the first VSX instruction in POWER8 or POWER9 code; the A2ALT
languages are Power ISA 3.0 and decode it. The ELF loader selects A2ALT
today, and the lane passes it explicitly and records it as provider-pinned.
ELFv1 (.opd function descriptors), an undeclared ABI, other e_flags bits,
ET_DYN and ET_REL are refused with their own reasons. The 32-bit lane is
unchanged.
npm run verify:ghidra:ppc64 builds a source-owned ELFv2 fixture in both byte
orders and checks it against GNU readelf and real Ghidra through MCP and the
CLI: the bound language, fixed instruction bytes including a VSX xxlor, the
global-entry thunk to each function's local entry, direct calls, snapshot
identity, and a shared object refused before Ghidra starts.
Refs #12085
* fix(ghidra): supervise PPC64 verifier compiler and CLI processes
Timeouts on bare execFile stop only the direct child, so a linker can
outlive Clang and disappear from the parent-tree cleanup check. Launch
those commands through the shared command owner, pass that runner into
the PPC64 fixture builder, and close the owner before the lineage check.
A failed close stays registered for retry and the diagnostic workspace
is retained.
* docs(ghidra): record the PPC64 ELFv2 Power ISA 3.0 lane
Add the feature specification, plan, and tasks for the lane, and index
them with the other feature records.
* fix(ghidra): finish shared PowerPC verifier command ownership
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>