Commit Graph
6465 Commits
Author SHA1 Message Date
86cf8942de feat(ghidra)!: import recognized DOS COM files with ComLoader (#12086)
* feat(ghidra)!: import recognized DOS COM files with ComLoader

Select Ghidra 12.2 ComLoader for an admitted .com image and do not pass a
base address, so the file stays at 0000:0100. Images ComLoader rejects use
the explicit BinaryLoader import at 1000:0100 and record the typed reason.

BREAKING CHANGE: A DOS COM file that ComLoader accepts now loads at linear
0x100 instead of 0x10100. Read load_address. The BinaryLoader fallback
remains at 1000:0100.

* fix(ghidra): score COM dollar-strings in one pass

ComLoader's printable-run walk restarts at every offset, so a 64 KiB image
of printable bytes blocked profile resolution. The same capped count now
skips a run once an earlier start has seen every later dollar sign.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): align COM import facts with the image Ghidra receives

Mismatch load-image coordinates follow the measured loader and address.
A dotfile named .com keeps that suffix on the snapshot, and selection
uses that snapshot name. The COM fallback verifier owns its MCP
connection before connect.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* style(ghidra): format COM snapshot and verifier files

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): keep measured COM facts and required MZ coordinates

DOS MZ and a verified COM image keep load_segment and entry required.
A COM mismatch emits a known loader or load address on its own, and
omits the segment and entry only when that pair is not a known layout.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): require the verified COM layout and document both entries

A verified COM image is either ComLoader at 0000:0100 or BinaryLoader at
1000:0100 with a fallback reason. The DOS guide queries 0x100 only for
the ComLoader entry and 0x10100 for the fallback.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): attest COM imports against the committed loader

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
2026-11-18 16:40:18 -05:00
David Muñoz Reyandmorluto 1920525900 fix(kuna): stop calling executable-segment data sections definite data (#10686)
* fix(kuna): stop calling executable-segment data sections definite data

An address in a Mach-O section whose attributes declare no instructions
was refused as "data that Kuna lists, not a procedure", even when the
section sits in an executable segment. In #8352 a direct call targets
`_placed_in_const` in `__TEXT,__const` (segment initprot r-x), Ghidra
decodes and decompiles it, and REA's own procedure_callees reports the
call, yet the Kuna refusal asserted it categorically as data.

The Mach-O layout now records, for each data placement, whether its
enclosing segment's initial protection includes VM_PROT_EXECUTE. For such
placements the refusal keeps the section declaration and the
classification, but says REA's Kuna lane does not treat the entry as a
procedure and that the declaration alone does not prove the bytes are
not code; its remediation adds the Ghidra provider as a decoding route.
address_name's limitation is qualified the same way. Non-executable
segments and the Mach-O header keep the existing wording. Procedure
tools still refuse these entries; making them followable is left open.

Validation: kunaMachoInventory and kunaInventoryPlacement boundary tests
cover the executable `__TEXT,__const` entry, its remediation and
address_name limitation, and an unchanged `__DATA` control. The full
Kuna boundary directory shows the same 11 environment-related failures
on unchanged main as on this branch; check:fast passes.

Refs morluto/rea#8352

* fix(kuna): keep the executable-segment caveat when a refused name is shared by data entries

Review follow-up: a name that several data entries share took a grouped refusal that still said "they are data, not procedures" and offered no Ghidra route, even when one entry lies in an executable segment. The grouped message and remediation now come from KunaInventoryPlacement beside the single-entry ones: with an executable placement they keep the caveat and the Ghidra route, and otherwise the wording is unchanged.

Tests: a shared-name case with and without an executable-segment entry fails before this change and passes after; the Mach-O inventory tests pass. Five process-lifecycle Kuna test files fail identically with and without this change in this environment.

* fix(kuna): qualify omitted executable-segment inventory entries

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 16:33:55 -05:00
5c59bdc8a6 feat(ghidra)!: verify the bridge on Ghidra 12.2 (#12081)
* feat(ghidra)!: verify the bridge on Ghidra 12.2

Admit 12.x from minor 2 upward, with 12.2 and JDK 25 as the verified
pair. The bridge now calls the four-argument storage API added in 12.2,
so 12.1.x cannot compile it and is no longer accepted.

BREAKING CHANGE: Ghidra 12.1.x is rejected. Use Ghidra 12.2 or another
12.x build at or above minor 2, and a JDK inside that installation's
declared range (25 or newer for the verified 12.2 build).

* docs(ghidra): point remaining lanes at Ghidra 12.2

The Windows, 6502, and m68k prerequisites still named 12.1.4 and JDK 21,
which the verified-build check now rejects. The bridge compile lane names
the 12.2 jars it actually compiles against.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(ghidra): admit the JDK the verified install declares

The Java home framing probe still reported JDK 21 while the verified
installation fixture now declares a minimum of 25, so doctor admission
failed before the path framing was checked.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(ghidra): derive admitted install fixtures from the verified release

Boundary hosts and assertions still named Ghidra 12.1.4 after admission
moved to 12.2, so list_procedures evidence and completed property reads
disagreed with the install the provider actually reported.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): record the exact 12.2 Clang switch-recovery defect

Ghidra 12.2 stays the verified build. Sessions and decompiler results on
that exact version name upstream issue 9996 and the 12.2.1 fix commit.
Other version strings, including 12.2.1, do not carry the limitation.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(ghidra): check switch-defect facts instead of the warning sentence

The policy test keeps the structured defect record and checks that the
owning formatter delivers its id, commit, release, and scope fields.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(browser): name the Playwright launch boundary the lifecycle catalog checks

Main retitled that case with a platform placeholder. The coverage catalog
still required the old literal, so the merged full suite reported a missing
title.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(browser): point the lifecycle catalog at main's launch title

The merged suite uses main's platform-specific Playwright launch test.
The coverage catalog now names that title, and this branch keeps main's
test body so the merge stays clean.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(browser): cover the platform launch title on this branch

The lifecycle catalog names main's platform launch title. This branch
now has that quoted test too, so the check passes before and after the
merge.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): record the exact 12.2 masked byte-switch defect

Ghidra 12.2 leaves an AArch64 and-0xff byte-offset switch unrecovered.
Exact 12.2 sessions now cite open upstream issue 10154, and the AArch64
lane expects that jump table to stay unrecovered.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(browser): keep one platform launch environment check

The second launch test repeated the selected environment check. The
remaining test is the parameterized title, and the launcher forwards
SYSTEMROOT on win32 so that assertion holds.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): keep the open switch defect on admitted builds

The exact-version check cleared ghidra-10154 on every build except 12.2.
That defect stays on admitted releases until one is known to fix it.
ghidra-9996 still clears after the exact 12.2 build.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* style(docs): format the Ghidra testing-lane table

The AArch64 jump-table row wrapped past the formatter width and failed
static checks.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(ghidra): give the masked switch its full byte range

The unrecovered oracle now uses 256 readable table bytes, and the same
object must still recover its compare-bounded switch.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* docs(website): point Ghidra setup at 12.2 and JDK 25

The public setup pages still told new users to install Ghidra 12.1.4 and
JDK 21, which this release rejects. Changed setup sentences are extracted
and left untranslated so those editions use the English page.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* docs(website): keep catalog edits to the changed setup strings

The catalog check compares active message ids, not a full rewrite.
Restore the previous catalogs and update only the Ghidra 12.2 setup
strings, leaving their translations empty.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): apply the closed switch defect from the parsed patch

12.2, 12.2.0, and 12.2.0 with a suffix all precede 12.2.1, so they keep
ghidra-9996. The masked-switch table lists all 256 byte entries.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): share the AArch64 switch fixture compiler invocation

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
2026-11-18 16:06:51 -05:00
Saim Shafiqueandmorluto 731049ab9c fix(windows): gate transient writes on runtimeWriteTransient capability (#10607)
* fix(windows): gate transient writes on runtimeWriteTransient capability

A source checkout and the published 6.8.0 addon share package version
and native ABI 1, so the loader admits the older addon. JavaScript
staging then fails at source-transfer with Win32 87 because the addon
has no runtime_write_transient operation.

Native inspection now advertises runtimeWriteTransient, the loader
accepts it only as literal true, and writeTransientFile refuses before
dispatch with a typed nonretryable error pointing at an exact-source
rebuild. Older addons stay admitted for the controls they support.
Recovery text no longer presents a same-version tarball as enough for
an unreleased checkout.

Fixes #9286

* test(ghidra): expect the new native-authority remediation wording

The #9286 fix changed the doctor recovery text so a same-version
tarball is no longer presented as enough for an unreleased checkout;
the pinned expectation still asserted the old wording.

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 15:28:36 -05:00
Ahmedandmorluto dc6799d488 fix(android): report method disassembly failure as unavailable body (#12090)
* fix(android): report method disassembly failure as unavailable body

Catch JADX bridge get_method_body failures in inspectMethod and project as an unavailable body with disassembly_failed marker, avoiding generic execution_failure with irrelevant rea doctor remediation.

Fixes #10482

* fix(android): preserve method identity when disassembly is unavailable

* fix(android): retain method identity when smali generation fails

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 15:23:34 -05:00
486470ec9b fix(desktop): preserve cancellation after ELF lookup refusals (#11804)
* fix(desktop): resolve needed origins before library deduplication

* fix(desktop): resolve library paths through filesystem

* fix(desktop): retain package ownership of required library links

* fix(desktop): traverse hard-linked dependencies once

* fix(ci): isolate expensive capacity regressions from parallel workers

(cherry picked from commit a1f762d1139f51d97130f8c20cfb12d567cced72)

* fix(desktop): preserve complete library lookup semantics

* fix(desktop): retain required directory alias owners

* fix(desktop): preserve ownership across complete library link routes

* fix(desktop): share merged-system ownership lookup for link entries

* test(mcp): observe cleanup failures at their current delivery boundary

* fix(mcp): preserve workflow completion progress through delivery

* test(setup): keep the Windows Kimi profile fixture on a supported profile

The Windows-only case at `clientConfigurationEnvironment.test.ts:226` wrote
`rea_mcp_input_schema_profile: "full"`. That profile was retired: the reader
now refuses it ("REA_MCP_INPUT_SCHEMA_PROFILE accepts only \"compact\" …"),
so `configureClientConfiguration` returned `failed/readback` before writing
and the case failed on every Windows run, including main's own
`Windows capability and package lane`.

The case has no Windows dependency — it passes an explicit `configPath` and
the Kimi write dialect is the same everywhere — so it now runs on every
platform, which is what let the stale value rot unnoticed. The fixture keeps
the lowercase explicit key the case is about, with the supported value.

Verified on `main` `d6bcfc10`: the same fixture driven through
`configureClientConfiguration(..., "win32")` on this host reproduced
`{"status":"failed","reason":"readback"}` with the retired value and now
returns `{"status":"configured"}` with `compact`. The file's 75 cases pass
here (66 run, 9 platform-conditioned skips) and `check:fast` passes.

* test(ci): restore verifier and MCP contract regressions

* test(captures): assert adapter-owned input issue field names

* fix(ghidra): avoid Java probes for missing installations

* fix(desktop): retain all selected leaf ownership spellings

* fix(desktop): retain link target ownership contexts

* fix(desktop): retain successful lookup retries and cancellation

* fix(desktop): preserve library probe failures and cancellation

* fix(desktop): preserve cancellation after lookup refusals

* docs(desktop): clarify library lookup error precedence

* fix(desktop): check library budget before absolute path lookup

* fix(desktop): report each unowned library path once

---------

Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
Co-authored-by: g0at <50488370+g1at@users.noreply.github.com>
Co-authored-by: IvenKooLab <276572622@qq.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 15:18:59 -05:00
David Muñoz Rey cc971d6df5 feat(domain): classify 64-bit PowerPC ELF (EM_PPC64) in the powerpc family (#12089)
* feat(domain): classify EM_PPC64 ELF in the powerpc family

An ELF with e_machine 21 was refused as "unsupported ELF architecture" before any provider was consulted, so every entry point answered a 64-bit PowerPC file with the generic file-format refusal.

The header reader now places EM_PPC64 in the powerpc family and keeps its class, byte order, e_type and e_flags as it does for EM_PPC. No provider lane admits these files: the Ghidra PowerPC gate already refuses ELF64 by naming PPC64, and Hopper, IDA and Kuna decline the family. Static ELF readers keep the name ppc64 for the machine.

Refs morluto/rea#12085.

* feat(domain): map the ppc64 reader name to the powerpc Evidence subject

Static readers report a 64-bit PowerPC ELF as ppc64, and the Evidence subject of those reports had no architecture because the name mapped to no family. With EM_PPC64 classified as powerpc, the subject now carries that family, as it does for ppc.

The Go verifier and the Go and Rust guides state the new mapping, and the boundary test keeps an unknown machine (s390) to show that unrecognized names still map to no family.

Refs morluto/rea#12085.

* revert(domain): keep ppc64 reader reports without a subject family

This reverts commit bbd7f7f661.

Evidence saved before the mapping carries no subject architecture for a ppc64 report. Views over those records compare the saved subject with the family the reader name maps to, so the mapping made them refuse records they accepted before. Nothing in this branch produces Evidence that needs the family, so the mapping can wait for a provider lane.

Refs morluto/rea#12085.

* fix(domain): classify EM_PPC64 only for an ELF64 header

Classifying machine 21 by number alone had two effects beyond target resolution. An ELF32 big-endian ET_EXEC header that claims EM_PPC64 became a powerpc target with class 32, which the 32-bit Ghidra lane admits because it sees only class, byte order, type and flags. And every static reader that maps a machine to a family started to put powerpc in its Evidence subject, which changes what views expect from records saved earlier.

elfArchitecture now takes the ELF class and names the family for machine 21 only when the caller commits ELF64. Header admission passes the class. Readers that pass only a machine keep the machine unclassified, so their reports, reader names and Evidence subjects are as they were.

Refs morluto/rea#12085.
2026-11-18 15:13:05 -05:00
吴佳浩Albenandmorluto 1e0f3348a7 fix(process): name the fields a located divergence compared (#11813)
* fix(process): name the fields a located divergence compared

`first_divergence` handed back the whole observation on each side, so a
caller that saw `changed` had to diff two large objects by hand to learn
what the comparison actually judged. Reported in #8204: the same
deterministic CLI captured twice reports `terminal`, `exit`, and
`filesystem` changed, and the report names no field.

A located divergence now carries `fields`, the sorted leaf paths that
differ in the projection the comparison judged, for example
`files[3].path`, `pid`, `process_samples[0].pid`, or `$` when a whole
observation is present on one side only. Positions are bracketed array
indices; the list is bounded to eight names because the report names a
difference rather than copying the observation, and `left` and `right`
still retain both complete observations.

The list is computed from the comparable projection, not the observed
values, so capture-local timing (`at_ms`, `dispatched_at_ms`,
`elapsed_ms`, `sent_at_ms`) is never named unless a `trace_spec`
explicitly selects it. That keeps the names honest about what the
comparison measured.

Naming a volatile value is not a claim of equivalence. A per-run
temporary root or PID still counts as a difference; the exclusion path
remains capture-time normalization (`normalization.paths`,
`normalization.pids`, `normalization.patterns`), which must match on both
sides because comparison refuses captures under different rules.

`fields` is optional in the contract. `readComparisonResult` re-validates
`normalized_result` of authenticated Evidence, so a required field would
reject records written before this change. Producing code always
populates it.

Validation: `tsc --noEmit` clean; `oxlint` reports only the four
pre-existing complexity/length warnings this file already carried;
`scripts/ci/static-check-report.mjs lint` 0 errors; module boundaries and
architecture guards pass; `oxfmt --check` clean on the touched files;
`completeness-enum-guard`, `optional-fact-default-guard`, and
`rea-numeric-limits` pass; `scan:todos` and `verify-test-discovery`
clean; jscpd within budget. 194 focused domain tests passed, including
five new cases covering a temporary-path leaf inside a filesystem
checkpoint, a fully populated process sample, the eight-name bound,
one-sided presence as `$`, and an authenticated payload without
`fields`. No live process capture was exercised on this host.

Refs #8204

* fix(process): honor trace timing policy in divergence fields

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 15:05:59 -05:00
ShuaixinHuangandShuaixinHuang 6d66f3a8ee fix(artifacts): preserve PyInstaller retirement and map identity (#11830)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 14:59:57 -05:00
ShuaixinHuangandShuaixinHuang 0db5f93df6 fix(protobuf): preserve descriptor string identity (#11834)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 14:59:49 -05:00
ShuaixinHuangandShuaixinHuang e7ed93004a fix(apk): preserve ambiguous v1 certificate identity (#11835)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 14:59:41 -05:00
phexussandmorluto fd9989eadb fix(artifacts): keep virtual directory identities distinct from file content (#8574)
A virtual directory node was identified from the SHA-256 of its canonical
listing JSON through the same function as raw file bytes. A regular file
containing exactly that JSON (for example an empty directory's
{"children":[],"kind":"directory"}) received the same artifact ID, the
directory node overwrote the file node, and extraction of the valid
archive failed with an integrity mismatch.

Derive virtual node identities in a separate domain and validate node IDs
by representation. Inventory Evidence retained with the earlier virtual
identity is still accepted.

Fixes #8551

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 14:59:33 -05:00
ShuaixinHuangandmorluto ad02201d0b fix(zip): corroborate member extents before claiming complete coverage (#11855)
* fix(zip): corroborate local member extent claims

* fix(zip): verify descriptors of contained records

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 14:59:28 -05:00
ShuaixinHuangandShuaixinHuang 1290ab401c fix(elf): resolve extended symbol section references (#11924)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 14:58:29 -05:00
ShuaixinHuangandShuaixinHuang e98a767428 fix(desktop): exclude configured APT status from repository sources (#11932)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 14:56:54 -05:00
ShuaixinHuangandShuaixinHuang e39a53d5cd fix(windows): preserve opaque ANSI shortcut path identity (#11923)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 14:56:47 -05:00
ShuaixinHuangandShuaixinHuang 18c6b4490c fix(desktop): retain all matching APT primary-key blocks (#11944)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 14:56:39 -05:00
ShuaixinHuang 75482a9ef9 fix(ota): merge partition info without discarding integrity claims (#11836) 2026-11-18 14:47:46 -05:00
ShuaixinHuang 004c43e32a fix(maven): preserve qualified property keys in metadata (#11860)
fix(maven): preserve qualified property keys
2026-11-18 14:47:42 -05:00
mengzhe ganandmorluto 82e16b4dda fix(setup): write the recommended tool call timeout into dsh registrations (#4043)
* fix(setup): write the recommended tool call timeout into dsh registrations

rea setup --client dsh wrote registrations without toolCallTimeoutMs, so
DeepSeek Harness applied its 60-second default while a native provider
startup alone can exceed it. Setup now derives the deadline from the same
provider allowance plus operation headroom used for Kimi and Codex,
preserves a positive caller-selected value, and doctor reports a
registration without a usable timeout as stale.

ProviderRequestBudgetResolver declares an optional budgetSettings read
set, so the fail-closed budget gate rejects unresolved Cordis expressions
only for settings the derivation may read plus the timeout inputs; an
unrelated expression such as GHIDRA_INSTALL_DIR still refreshes, and an
expression in REA_IDA_MCP_CONFIG fails closed.

* test(setup): record the dsh tool call deadline in the NUL repair fixture

The NUL refusal scenario rewrites a valid dsh registration and expects
doctor to report it healthy. That fixture omitted toolCallTimeoutMs,
which doctor now reports stale, so the repaired registration records the
deadline a current dsh registration carries.

* test(setup): separate dsh timeout repair coverage

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 14:31:34 -05:00
b236bcfe34 fix(browser): match the win32 environment snapshot spelling for SystemRoot (#8387)
Browser scenario launches forward a caller-selected environment through
snapshotEnvironment, which uppercases every name on win32. The launch
allowlist read the mixed-case "SystemRoot" spelling, so the lookup was
always undefined on Windows and the launched browser never received the
variable the allowlist intends to forward; the effective launch
environment was only HOME/LANG/PATH/TEMP/TMP.

Node's Windows spawn path re-adds a small set of system variables from
the parent environment, which has masked the missing entry so far, but
that behavior is outside REA's contract. The Electron active-provider
allowlist already reads "SYSTEMROOT" (uppercase) for the same snapshot,
so match that spelling here and keep the launched browser environment
dependent only on REA's own allowlist.

Co-authored-by: Vinicius Henrique Menezes Moreira <29902685+SwintexD@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 13:36:29 -05:00
David Muñoz ReyandAmmarJamil23 0b95fa7d69 fix(pe): admit Authenticode nesting depth of signed Windows binaries (#12082)
* fix(pe): admit Authenticode nesting depth of signed Windows binaries

inspect_pe_certificates refused genuine Authenticode signatures with "ASN.1 nesting exceeds 32 levels". Windows dual signing embeds whole SignedData values in unsigned attributes: a nested signature (1.3.6.1.4.1.311.2.4.1) holding an RFC 3161 timestamp (1.3.6.1.4.1.311.3.3.1). Each embedding adds eight levels, so signed system binaries pass the shared reader's default of 32.

The PE certificate reader now gives the shared ASN.1 reader its own depth allowance of 64. The node allowance is unchanged, and a payload past the depth allowance is still refused as an exhausted fixed allowance.

Ported onto current main from morluto/rea#7160. The fixture gains signed attributes through its fields argument, and the provider's allowance test moves to the new limit.

* test(pe): pin the Authenticode depth allowance at its boundary

The dual-signed fixture has to be deeper than the shared reader's default, or it would pass without the PE depth allowance. An independent DER walk now asserts its depth, and a boundary case admits nesting at the allowance and refuses one level more as an exhausted allowance.

The certificate guide states the depth allowance next to the value allowance.

---------

Co-authored-by: AmmarJamil23 <ammarjamil7000@gmail.com>
2026-11-18 13:29:11 -05:00
Ali RazaandClaude Opus 5.5 f64433c93e fix(sqlite): refuse one-byte files instead of reporting an empty schema (#8727)
* fix(sqlite): refuse one-byte files instead of reporting an empty schema

* test(sqlite): assert refusal facts instead of the full error sentence

The one-byte and corrupt-input acceptance tests froze the sentence that
SqliteDatabaseWorkerExecution builds from fixed wording, SQLite's
diagnostic and the selected path. Share one helper that keeps the code,
issue path, reason and single-issue shape exact, and checks the
diagnostic and selected path separately, so rewording the sentence no
longer breaks either regression.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 13:11:23 -05:00
ShuaixinHuang 5fd6c0db71 fix(desktop): preserve env option boundaries in launch commands (#12033) 2026-11-18 13:07:56 -05:00
2SinceJuly b99e7737de fix(evidence): derive default authority from subject binding (#10321)
* fix(evidence): derive default authority from subject binding

evidenceEnvelopeForAdmission defaulted a missing authority to shipped-artifact
for every observation, including ones with no artifact subject and ones
produced by a live debugger session. An unbound record therefore claimed
authority over an artifact it cannot name, and live GDB, Rizin and Cutter
observations could never qualify a live-observation contract because that
contract accepts only controlled-replay or external-service Evidence.

Default to analyst-inference when no subject is bound and keep
shipped-artifact when one is, so the default matches what the record can
actually support. Declare controlled-replay at the eight live debugger
observation sites (GDB 6, Rizin 1, Cutter 1) so those records describe the
controlled replay they performed and satisfy the documented contract.

* fix(gdb): label retained process-exit observations as controlled replay

The GDB command process-exit branch was the only unbound retention path that
named no authority, so this branch's new default derived it as
analyst-inference. That label cannot support the live-observation contract,
and every sibling path (timeout, cancellation, protocol failure, startup)
already states controlled-replay.

The authority and the unavailable-subject reason now live beside the
provider identity so the retention paths read them from one place instead
of repeating the literals and drifting apart.

* style(evidence): apply repository formatting

* fix(cutter): classify command observations as external-service

The bridge drives the documented already-running Cutter GUI, whose
document state REA neither owns nor resets, so its command
observations claim no controlled replay. Label them external-service
like the comparable IDA and Frida bridge evidence: live-observation
obligations still accept it, while controlled-replay-only verifier
contracts and bundle replay scenarios no longer include these
observations.

* fix(adb): keep device observations at external-service authority

The admission default now derives authority from the subject, so a subjectless ADB observation fell to analyst-inference. A device is a service REA attaches to rather than drives, so the observation supports external-service and must stay eligible for live-observation contracts.

Carry an explicit authority through AnalysisObservation so a producer that knows its own authority can name it, and set it for every ADB operation.

* fix(adb): keep retained observations at external-service authority

The admission default derives authority from the subject, and a subjectless
observation falls to analyst-inference. createAnalysisExecution never carried
an authority field, so every observation the ADB adapter built through it was
committed at the subject-derived default instead of the service's.

Name the authority once in the domain model, stamp it on every successful
execution at the adapter boundary, and route the cleanup-failure and
cancellation-retention sites through one helper. Open the execution options
field so other providers can name their own authority.

Verified: a push whose device digest does not match now retains its receipt at
external-service; removing the stamp fails that assertion. check:fast passes.

* fix(adb): keep the retained verification receipt at device authority

The verificationFailed branch built its retained receipt with createEvidence
directly, so the admission default derived the authority from a subjectless
target and labelled an observed push as analyst-inference. Pass the device
authority through the same way the neighbouring digest-mismatch partial does,
so the receipt can still support live-observation verification.

* style(adb): apply oxfmt formatting to the authority fix

The previous commit wrapped two expressions that oxfmt keeps on one line, so
npm run format:check failed on Static checks.
2026-11-18 13:06:25 -05:00
RRFZ 204056f21a fix(decompile): repair a torn journal on Windows before resuming (#10527)
* fix(decompile): repair a torn journal on Windows before resuming

Windows opens an O_APPEND handle with FILE_APPEND_DATA only, so ftruncate
through the journal's append handle fails with EPERM and every resume after
an interrupted write was refused. Truncate through a separate write handle
first, then open the append handle.

* docs(decompile): say why the journal opens without following symlinks
2026-11-18 13:05:37 -05:00
ShuaixinHuangandShuaixinHuang 7c25842bae fix(ntfs): reject unaligned USN v4 extents (#11969)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 13:03:34 -05:00
ShuaixinHuangandShuaixinHuang f52229a4a6 fix(ntfs): reject invalid FILE_NAME namespaces (#11986)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 13:03:26 -05:00
ShuaixinHuangandShuaixinHuang 3f1473065a fix(artifacts): bound FIT recognition by the FDT structure block (#12018)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 13:03:18 -05:00
ShuaixinHuang d084b1987f fix(artifacts): verify Android OTA operation data hashes (#12043) 2026-11-18 13:03:10 -05:00
ShuaixinHuang 90550aa223 fix(artifacts): detect AVB footers before boot page padding ends (#12046) 2026-11-18 13:03:06 -05:00
ffae857c20 fix(javascript): keep CommonJS wrapper redeclarations from inventing application owners (#12084)
fix(javascript): keep wrapper redeclarations from inventing application owners

A top-level lexical declaration that reuses a CommonJS wrapper parameter
cannot evaluate, and its recovered syntax is complete. Counting that
diagnostic as dropped syntax marked the entrypoint as an unexamined loader
and erased another package's proven loadFile root.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
2026-11-18 12:59:16 -05:00
morluto 31aaec6b4f fix: restore PE release scanning and CommonJS test coverage (#12083)
* fix(artifacts): preserve unresolved PE debug coverage

* test(javascript): use valid CommonJS loader shadowing
2026-11-18 12:54:53 -05:00
JoshandJosh ad82b61641 fix(inventory): validate PE headers before classification (#11691)
* fix(inventory): validate PE headers before classification

* fix(inventory): retain declared PE record windows

---------

Co-authored-by: Josh <joshuakrishna21@gmail.com>
2026-11-18 12:35:59 -05:00
ShuaixinHuangandmorluto f7849cad3f fix(elf): require sizes for declared Android RELR tables (#12067)
* fix(elf): require sizes for declared Android RELR tables

* test(android): allow JNI relocation cases without RELR aliases

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 11:35:39 -05:00
Oke Iyanuoluwa Enochandmorluto a43a1b6453 fix(setup): name an unresolved client location in the picker (#11699)
* fix(setup): name an unresolved client location in the picker

When a client's configuration location cannot be resolved, such as
Claude Desktop with migrated Claude-Data storage, setup refuses to write
it and the user has to register REA by hand. The client picker still
said "Existing configuration needs repair before setup" (6.9.0, where
the state is invalid) or "Detected · choose to configure" (main, where
#10698 records it as unknown), and neither is true.

Show "Configuration location unresolved · register REA manually" for
any client with a location error, and keep the repair hint for
configurations that are actually malformed.

Fixes #11697

* test(setup): type picker fixtures as SetupClientState

The journey fixtures used array paths and a marker field that setup
never sends, and omitted registrationProfile. They now satisfy the
production contract so the type checker rejects drift.

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 11:21:49 -05:00
IvenKooandmorluto ec17f39e82 fix(process): keep the Darwin helper exit cleanup from crashing the host (#11714)
fix(process): keep the Darwin helper's exit cleanup from crashing the host

When the macOS ownership helper root cannot be removed while the process
exits — descriptor exhaustion is the recorded case — `cleanupAtExit` let
`rmSync` throw from a `process.once("exit")` listener. Node reports that as
an uncaught error, so a successful command exits 1 and prints a stack for a
directory nobody can retry.

Remove the root best-effort at exit and name the retained root once through a
guarded synchronous write: Node cannot drain a queued stderr chunk from an
exit listener, so the warning uses `writeSync(2, ...)` and swallows a failed
report. The root's normal cleanup path, its retained-cleanup error and every
caller's classification are unchanged; only the exit-time failure stops
changing the exit status.

Verified: `src/process/DarwinHelperExitCleanup.test.ts` asserts the root is
gone after a successful removal with no report, and that a root the process
cannot remove is retained, named once, and does not throw (2 tests). The
permission case is skipped for root and Windows, where permissions do not
prevent removal. `check:fast` passes.

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 11:18:57 -05:00
ShuaixinHuangandmorluto 475250ac52 fix(javascript): apply observed loader grammar before analysis (#12066)
* fix(javascript): apply observed loader grammar before analysis

* fix(javascript): retain grammar errors in mixed loader syntax

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 11:15:03 -05:00
ShuaixinHuang c0ad2c1a22 fix(desktop): preserve distinct JSON record selector identities (#12072) 2026-11-18 11:03:20 -05:00
sunfleeting f93a8db72d fix(cli): use canonical option flags in llms manifests (#11928)
The --llms-full manifest and discovery table rendered raw object keys
(--blockSize), which disagreed with command help (--block-size). Reuse
optionFlagName so manifests emit the same canonical flags as help, and
update the two CLI parity goldens. Adds a boundary test asserting both
surfaces agree on canonical flag names.
2026-11-18 10:57:01 -05:00
Jason Chenandmorluto 55fd0ff590 fix(cli): preserve mcp doctor output choices on argument errors (#2693)
fix(cli): preserve doctor output choices on argument errors

Signed-off-by: Jason Chen <jasonhuang404505@gmail.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 10:56:53 -05:00
Arif Aliandmorluto bba3a3f0d9 fix(javascript): recover RPC link URLs declared with template literals (#2963)
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 10:56:30 -05:00
ShuaixinHuang 884fda99f0 fix(native): index only address-bearing Mach-O initializer symbols (#12070) 2026-11-18 10:53:42 -05:00
Paritosh LahreandClaude Opus 5.5 cb8096d522 fix(cutter): explain empty discovery when Cutter 2.5.0 rejects the plugin (#10310)
* fix(cutter): explain empty discovery when Cutter 2.5.0 rejects the plugin

Official Cutter 2.5.0 builds have been observed to reject Python plugins at
startup, including Cutter's own sample plugin and REA's bridge
(rizinorg/cutter#3659). No session is published, and list_cutter_sessions
returns no_live_bridge_found with nothing pointing at the Cutter release.

The list_cutter_sessions contract now says what no_live_bridge_found means
and names the observed 2.5.0 rejection. The Cutter bridge docs describe
installing the plugin, the startup log lines Cutter prints when it rejects
it, and that 2.4.1 loaded the bridge in the reported check. A minimal
independent plugin fails the same way, so the bridge itself is unchanged.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): report empty-discovery causes in the shared result

The guidance lived only in the MCP tool description, which
`rea list-cutter-sessions` never shows. The docs also assumed a known package
folder, which npx installations do not have.

The discovery result now carries limitations, owned by
cutterDiscoveryLimitations in the domain. For no_live_bridge_found they list
the causes discovery cannot tell apart, including the observed Cutter 2.5.0
Python-plugin rejection (rizinorg/cutter#3659). CLI and MCP project the same
text, and the tool description returns to its previous wording. The docs now
take the plugin from the published package of the matching version with
npm pack.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): name failed status probes among no-live causes

no_live_bridge_found also covers a published session whose status probe
fails: a stale descriptor after Cutter exited, an unresponsive bridge, or
an incompatible bridge version. The limitation named only process,
plugin-loading and directory causes. It now lists these too, and the
dead-status-endpoint test asserts that such a discovery carries it.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(cutter): give the finalization discovery fixture its limitations

commandFinalizationCancellation builds a Cutter discovery through the
list_cutter_sessions output schema, which now requires limitations. CI
shard 4 failed all five final-close cases with a ZodError. The fixture
now takes the owner's empty limitations for sessions_found.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): count unanswered sessions beside found ones

When one session answered and another published session failed its status
probe, discovery returned sessions_found with no limitation. The partial
result looked complete. The client already throws for live ceiling
mismatches, so every other descriptor without a session is a failed probe.
It now passes that count to cutterDiscoveryLimitations, which reports the
unlisted sessions for sessions_found. The stale-descriptor case in
cutterBridgeRequestLimit asserts it.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): name unpublished bridge sessions among no-live causes

When Cutter loads the plugin but the bridge cannot write its session
descriptor, for example in an unwritable or full bridge directory,
_BridgeServer.run closes the socket without logging. Cutter's log then shows
the plugin as loaded, yet discovery finds nothing. The no-live limitation now
names that cause and says the bridge does not log it. The Cutter docs say to
check the bridge directory when the plugin is loaded but no session appears.

Refs #10299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): count unreadable descriptors among unlisted sessions

The descriptor loader dropped filename-matching candidates it could not read
before listSessions counted unanswered sessions, so a found session beside a
malformed, oversized, non-private or misnamed descriptor reported no
limitation. The loader now returns its unreadable count, and the discovery
limitation owner reports it beside failed status probes for both
sessions_found and no_live_bridge_found. The no-live text keeps only the
causes that leave nothing published; published sessions are now counted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cutter): leave session existence unknown for unreadable descriptors

A filename-matching candidate the loader could not read does not establish
that any session exists: it may be malformed, misnamed or removed while
reading. The limitation now counts unreadable descriptor candidates and
says whether they describe Cutter sessions is unknown, instead of saying
their sessions are not listed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(mcp): record the list_cutter_sessions limitations in the advertised summary

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 10:49:22 -05:00
RRFZ afd277dabc refactor(zip): read EOCD and trailing archive fields via BinaryReader (#11918)
* refactor(zip): read EOCD and trailing archive fields via BinaryReader

* perf(domain): avoid subarray allocations in BinaryReader and prefilter EOCD scan

Check field bounds via a private helper and read 16-, 32-, and 64-bit
integers directly from BinaryReader.bytes by offset instead of slicing
via range(), and skip non-0x50 bytes before full signature comparison
in zipEndOfCentralDirectoryCandidates.

* perf(zip): scan EOCD signature candidates with Buffer.lastIndexOf

Jump directly between 4-byte EOCD signatures with Buffer.lastIndexOf
instead of probing every byte in JavaScript, preserving reverse
candidate order, earliest-offset bounds, and zero-copy Uint8Array views.

* perf(zip): bound EOCD lastIndexOf scan to the 65557-byte tail window

Slice a zero-copy tail view starting at earliest before calling
Buffer.lastIndexOf so exhausting zipEndOfCentralDirectoryCandidates on
large archives never scans bytes before the maximum comment window.
2026-11-18 10:49:14 -05:00
David Muñoz Rey 090c22720b fix(native): name the unsupported Thumb mode for an odd raw ARM entry (#10683)
A 32-bit ARM raw-binary entry such as 0x4001 was refused as not 4-byte
aligned, and the remediation only said to correct the load argument. An
odd ARM address is how a Thumb function pointer is spelled, so a caller
holding one could not tell that the real limit is the unsupported raw
Thumb mode rather than a typo.

For `arm` entries with bit 0 set, the refusal now adds that the address
can be a Thumb function pointer but raw-binary arm decodes ARM state
only, so a Thumb entry is unsupported and the entry was not adjusted. It
does not assume the caller's mode or change the entry. Even misaligned
ARM entries and all arm64 entries keep the existing text.

Validation: src/domain/rawBinary.test.ts fails on the base (the odd ARM
cases lack the note) and passes 32/32 after; check:fast passes.

Refs morluto/rea#8210
2026-11-18 10:49:04 -05:00
David Muñoz Rey 93bf4df3e4 test(inspector): spell Node discovery targets as Node reports them (#10663)
* test(inspector): spell Node discovery targets as Node reports them

The fake V8 Inspector gave Node-type targets a percent-encoded WHATWG file
URL, while Node's /json/list reports `file://` plus the raw pathname with
quotes and backslashes replaced by underscores. The product reads that
channel literally, so a TMPDIR containing a space or percent sign named a
pathname that did not exist and the target stayed unresolved: the
Inspector cancellation test and "includes targets outside the old caller
root filter" failed on unrelated assertions.

Add nodeDiscoveryTargetUrl to the fake and use it where a resolved Node
target location is asserted. The underscore case stays with
createNodeDiscoveryTempDirectory.

Validation: 69 inspector/browser/MCP/acceptance test files, 1168/1168
passing under TMPDIR spellings with an underscore, a space, a percent sign
and none; check:fast passes.

Refs morluto/rea#9996

* test(inspector): pin special-character Node discovery spellings

Review follow-up for Node discovery target URLs.

Neither caller gave nodeDiscoveryTargetUrl an explicit special-character
path, so spaces and percent signs were exercised only when TMPDIR
happened to contain them. A boundary case now lists two targets in one
discovery root. "with space %41.js" is reported literally and resolves
to its file. 'with "quote".js' is reported with underscores and stays
an unresolved, unverifiable file location.

Tests: tests/boundary/inspector/javascriptRuntimeObservation.test.ts
passes (31).

* test(inspector): spell the consolidated target listing as Node reports it

main folded the test this branch had respelled into "lists all
connectable targets on the selected endpoint across directories", which
still built its two discovery targets with pathToFileURL. Under a
temporary directory with a space or a percent sign those targets came
back unresolved and the file-location assertions failed.

Build them with nodeDiscoveryTargetUrl, as the rest of this branch does.
2026-11-18 10:48:59 -05:00
ShuaixinHuangandShuaixinHuang 932afbeec5 fix(pe): map import hints independently of names (#11817)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 10:47:30 -05:00
ShuaixinHuangandShuaixinHuang a7c4ee8394 fix(desktop): align exported task whitespace interpretation (#11947)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 10:47:22 -05:00
ShuaixinHuangandShuaixinHuang 7d357b8325 fix(desktop): preserve commas in apt source fields (#11926)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-11-18 10:47:14 -05:00