* 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>
third_party/README.md names scripts/fixtures/android-apidemos.json as the
record of the ApiDemos fixture's provenance. #873 moved that file to
scripts/fixtures/android/apidemos.json, so the cited path no longer
exists. Point the sentence at the moved file.
* 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.
* 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
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>
* fix(inventory): validate PE headers before classification
* fix(inventory): retain declared PE record windows
---------
Co-authored-by: Josh <joshuakrishna21@gmail.com>
* 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>
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>
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.
* 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>
* 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.
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
* 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.
* 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
---------
Co-authored-by: g0at <50488370+g1at@users.noreply.github.com>
Co-authored-by: IvenKooLab <276572622@qq.com>
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
* fix(pcap): resolve tshark and capinfos on the Windows PATH
On Windows, resolvePcapTools kept the bare names "tshark" and "capinfos"
for the launcher to search PATH/PATHEXT. The owned Windows launcher
starts only absolute paths, so it refused the bare name (Win32 87) and
every pcap operation reported "Selected tool tshark could not be
launched (ERR_REA_WINDOWS_NATIVE)", even with tshark on PATH.
Resolve a PATH selection on Windows through the shared PATH/PATHEXT
search, from absolute entries only as on POSIX, and report the same
<tool>_missing failure when no image is found.
* test(pcap): assert typed missing-tool failures
* test(pcap): clarify PATH fixture platform
---------
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
* fix(process): resolve Windows root-relative commands on the selected drive
* test(process): pin drive-less PATH entries and UNC root-relative commands
A Windows PATH entry rooted without a drive now counts as relative, so
programOnPath skips it. Pin that with a Windows case, test a
root-relative command under a UNC working directory, and say in the
relativeEntry and windowsPathCandidates docs that drive-less entries
count as relative.
---------
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
* fix(process): require a drive or UNC root for selected Windows tools
REA_ADB_PATH, REA_APKTOOL_COMMAND, REA_TSHARK_COMMAND and
REA_CAPINFOS_COMMAND must be absolute. On Windows the check used
win32.isAbsolute, which also accepts \tools\adb.exe: a path rooted on
the current drive. Such a setting names a different file depending on
REA's working drive, and the owned Windows launcher refuses it.
Add isQualifiedCallerPath to the caller-path owner, which on Windows
requires a drive root or a UNC or device root, and use it for all four
settings. POSIX keeps posix.isAbsolute.
* fix(filesystem): require a complete UNC root for a qualified Windows path
Two leading separators were treated as a UNC root, so ///tools/adb.exe,
\\\tools\adb.exe and a bare \\server passed, though win32 parses them
with a single-separator root on the current drive. Use win32's own root:
qualified only when the path is absolute and its root is longer than one
separator.
* test(process): use qualified paths for simulated Windows tools
The JADX bridge emits or removes direct_invokes and direct_invokes_exhaustive together. A protocol item carrying only the coverage flag reached trace_android_references as a reference that claimed true or false coverage over a null site list, while the coverage summary counted it as unknown. The protocol schema now rejects that combination.
Rebased onto current main from morluto/rea#2850. The companion change that removed the null default from the result schema already landed on main.
Co-authored-by: LcokHcak <268763621+LcokHcak@users.noreply.github.com>
* fix(artifacts): classify Gradle version selectors by their grammar
* fix(artifacts): match Gradle ASCII range whitespace
---------
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
A tool selection that points at a file Windows cannot start (a DLL, a
script, any non-PE file) was reported as "could not be launched
(ERR_REA_WINDOWS_NATIVE)" by the owned launcher, and as an unrecognised
EFTYPE failure by Node's spawn. POSIX reports the same mistake as
ENOEXEC: "exists but could not be executed".
Treat EFTYPE as not executable, and read the native launcher's
ERROR_BAD_EXE_FORMAT (Win32 193) as EFTYPE, the code Node's own spawn
reports for the same file. Other native codes stay unclassified.
The Windows-only Fx case still read mcp.rea, but a new Fx profile is written
under mcpServers. Two Fx cases assert POSIX modes or a private-directory
close that Windows never performs; they now run off Windows, beside the
existing Windows case. Two release-exposure assertions spelled paths with a
POSIX separator; one now accepts either separator and one uses the reader's
host-file/member spelling.