* feat(setup): discover project-scoped MCP registrations in doctor and uninstall
* fix(setup): preserve OpenCode layer fields, user launcher provenance, and user fallback
* fix(setup): restore working directory in tests and refine replacement and launcher provenance
* fix(setup): bound OpenCode discovery to worktree and enforce Pi project trust
* fix(setup): preserve Pi project trust failures in doctor and prevent skipping project registrations in uninstall
* fix(setup): defer cross-setting environment validation and decouple OpenCode launcher ownership
* fix(setup): separate OpenCode readiness schema from launcher ownership and fix cross-setting test
* fix(doctor): include project remediation when disabled project registration inherits outdated user launcher
* fix(setup): scope status properties to project-scoped registrations
Omit scope and launcher_scope when no project-level configuration was discovered or evaluated, ensuring user-level registrations retain their exact unextended status contract in isolated environments without project files.
* fix(setup): prevent activating unowned launchers during uninstall and align array normalization
Prevent activating unowned or foreign launchers hidden in lower-precedence configurations during project-scoped uninstall, normalize array command arguments uniformly in OpenCode ownership parsing without appending separate args, and clarify field inheritance in client configuration documentation.
* fix(setup): check effective remaining launcher on uninstall and preserve cleanup failure
* fix(uninstall): preserve user configuration path in project client to check fallback ownership
* fix(uninstall): scope fallback configuration paths only to project-scoped clients
* fix(doctor): validate effective merged Pi flags and preserve MSIX selection during uninstall
* fix(uninstall): preserve surviving OpenCode project registrations across complete configuration layers
* fix(uninstall): require surviving OpenCode server to carry a launcher when checking layered activation
* fix(uninstall): rely on full layered check for OpenCode instead of lower-only fallback
* fix(doctor): preserve source paths for inherited environment failures
When a trusted Pi project partial override or an OpenCode project registration inherits an invalid REA environment value from user configuration (or an ancestor configuration), attribute the resulting doctor invalid registration error to the contributing configuration source rather than the winning project file. Preserves source evidence provenance across merged configuration layers so doctor remediation points the user to the file that actually requires repair.
* test(doctor): exercise effective cross-setting merge failure in inherited environment tests
Replace scalar validation errors with cross-setting constraints (REA_GHIDRA_PROGRAM_NAME without REA_GHIDRA_PROJECT_PATH) in inherited environment regression tests so individual fragments pass and the failure is only triggered during effective layer merge, directly protecting contributingEnvironmentSource provenance lookup.
* fix(uninstall): allow cleaning up owned entries in untrusted Pi projects
Evaluate Pi project trust in unownedLowerLayerFallback so owned entries in untrusted Pi projects can be cleanly removed without falsely claiming that removal would activate an unowned user launcher.
* fix(uninstall): require confirmed untrusted decision to skip Pi fallback check
Only skip the unowned lower-layer fallback check when Pi project trust is confirmed untrusted (trust.ok && !trust.value). When Pi trust reading or parsing fails (!trust.ok), preserve the unresolved state and conservatively inspect the lower layer so that an unowned user launcher is not inadvertently exposed if the project was trusted.
* fix(doctor): track activation provenance across layers and normalize platform path identity
- Track activation source provenance (activationScope, activationConfigPath) across Pi and OpenCode configuration layers so activation drift remediation points to the exact file contributing the disable/enable flag rather than nearest fragment.
- Normalize path identity case-insensitively on Windows and macOS when deduplicating user configuration from OpenCode hierarchy and Pi project candidates.
- Qualify Pi project registration docs with trusted projects prerequisite and fallback semantics.
* fix(doctor): isolate platform casing tests and restore cwd mocks
* fix(doctor): use filesystem identity for path normalization and verify present files in case tests
* fix(doctor): preserve inherited schema provenance and include activation in project package remediation
* fix(doctor): report the contributing registration and activation sources
* test(doctor): exercise combined Pi activation and launcher repairs
* fix(doctor): honor OpenCode activation by config dialect
* fix(doctor): share project registration activation and provenance
* fix(setup): plan project removals before writes and isolate provider probes
* fix(doctor): preserve OpenCode registration and launcher provenance
* fix(doctor): use shared registration error and path provenance
* fix(doctor): gate desktop probes on registration authority
* fix(uninstall): skip absent project configuration candidates
* fix(uninstall): compare effective project registration before removal
* fix(doctor): guide project package launcher migration
* test(doctor): verify OpenCode project launcher migration advice
* fix(uninstall): separate project load order from write targets
* fix(doctor): preserve OpenCode directory alias precedence
* fix(uninstall): preserve unchanged remote project registrations
---------
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
* feat(config): persist provider settings in a user config file
Providers currently rediscover install paths from scratch in every
process, so a path set once (for example GHIDRA_INSTALL_DIR) silently
reverts on the next run. Introduce ~/.config/rea/rea.json as the
user-owned persistence layer and merge it into the environment
snapshot before configuration parsing, keeping env > config file >
auto-detect precedence on both the CLI and MCP entry points.
Add a rea config command (list/get/set/unset) as the write surface,
reporting the effective value and where it came from.
* fix(config): address review findings on persistence safety and CLI surface
- stage config writes beside the file and rename into place so an
interrupted write cannot leave partial JSON (greptile #4, codex #11)
- convert unreadable config files into configuration errors on the CLI
seam instead of escaping raw filesystem errors (greptile #5, codex #15)
- keep injected runtimes without a config root isolated from the host
account's rea.json (codex #18)
- surface the config file error on stderr when doctor falls back to the
raw environment (greptile #3, codex #16)
- route the config command through logCliCommand and return documents so
--json stays parseable and failures exit non-zero (greptile #2,
codex #10)
- reject empty --set values, unknown --set/--unset/--get names, and --get
combined with mutations (greptile #1/#7, codex #9/#12/#13/#17)
- cover the new behavior in the boundary tests and stop leaking one
temporary home per run (greptile #8)
* fix(config): validate and back up persisted provider settings
* fix(config): keep saved provider defaults out of client registrations
* fix(config): preserve provider discovery and budgets for saved settings
* fix(config): check only settings needed by the IDA deadline lookup
* fix(config): share effective provider settings and verify config file reads
* fix(doctor): share selected settings with Hopper and ILSpy probes
* fix(config): resolve the destination of first-time saves
* fix(doctor): preserve unresolved provider location inputs
* fix(doctor): honor inherited IDA deadline overrides
* fix(config): show empty environment overrides
* fix(setup): preserve client-selected saved configuration roots
---------
Co-authored-by: Jackzigen <zigenhan@gmail.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
* fix(setup): register aube's bin shim instead of its versioned store path
mise's npm backend installs with aube, whose bin is a shell shim that runs
the script inside one version's store directory. Setup registered that
versioned script, which the next upgrade removes from under the agents.
Setup now registers the shim when it proves, from the shim's own header,
that it runs this exact entrypoint, and registration identity accepts that
shim as REA's own.
Refs #4847
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(setup): move aube store registrations to the shim and follow links to it
Status now reports a direct registration as stale when the running
entrypoint has an aube bin shim and the registration is not that shim, so
doctor and setup move registrations written before this fix. A link to a
shim resolves the target from the shim's real directory, as the shim does.
The shim check runs only when the exact-path check does not already own the
command, applies on every platform (the header alone decides), and a failed
close no longer escapes classification. The test now lays out versions the
way mise does, with `latest` as a symlink.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(setup): launch managed shims without client PATH dependencies
* fix(setup): bind Node for installed Aube shims without a sidecar
* fix(setup): keep an independent Node fallback for Aube shims
* fix(setup): preserve independent Node aliases across upgrades
* fix(setup): reuse verified Node for host-bound Aube shims
* fix(setup): keep Aube registrations across shim format changes
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
An unsettled finalization signal delivery reported a bare millisecond
figure, without saying whether that grace is adjustable. An agent could
infer that raising the caller-selected finalization_ms would extend it.
PROCESS_FINALIZATION_DELIVERY_GRACE_MS is module-private with no runtime
control, and is independent of finalization_ms (the SIGTERM-to-SIGKILL
interval). State both in the reason, keeping the lowercase fragment
register used by the sibling reasons on this field.
Relates to #5910.
endpointArgument takes the first literal of a get/post/put/patch/delete/request
call as its endpoint candidate. Method-first clients (superagent's
request(method, url), needle.request, Angular HttpClient.request) put the HTTP
method there, so Api.request("get", "/api/v1/profile") reported the candidate
"get" in both analyze_javascript_application and analyze_web_bundle, and the
path was lost.
For a request callee whose first literal is a standard HTTP method (the
XHR_METHODS set that xhrOpenUrl uses, compared after toUpperCase), an exact
second string is now the candidate. A computed target keeps the method token,
so request("POST", target) is unchanged, as are RPC names, Octokit route
strings and URL-first calls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new inline-scripts CLI case asserted the external <script src> survived
by matching a "loads" edge on resolved_path alone. The fixture's package.json
also declares "main":"main.js", which produces its own "loads" edge with the
same resolved_path, so the assertion could pass through the package entrypoint
even if the HTML script edge regressed. Also require script_path === "main.js"
to pin the assertion to the HTML-derived edge, matching the reference-html case
in the same file. Tests-only.
The analyzer already reports valid HTML containing inline <script> bodies
through an explicit "parse-html-inline-scripts" unavailable scope, so an
application whose endpoints, storage, or imports live in inline scripts is
surfaced as not-analyzed rather than silently empty. That contract was asserted
only at the filesystem boundary (javascriptHtmlEntrypoints.test.ts); the public
CLI acceptance surface had no scenario proving it survives transport.
Add one acceptance case to the existing unavailable-HTML CLI suite. No source change.
An ARM STT_FUNC or STT_GNU_IFUNC value for Thumb code is the code
address with bit 0 set (AAELF32 symbol values), while an FDE initial
location is the even code address. inspect_elf_unwind_ranges matched
symbol values to FDE starts exactly, so a Thumb function described by an
.eh_frame FDE lost its name: the range was named by a local label or
mapping symbol from .symtab, or had no name when only .dynsym was left.
On ARM EABI such FDEs come mostly from hand-written assembly with .cfi
directives; compiled code unwinds through .ARM.exidx.
Clear bit 0 of ARM function and IFUNC symbol values before the lookup, as
the ELF initializer and Android JNI readers already do. Mapping symbols
and other machines keep their values.
On SPARC, symbol type 13 is STT_SPARC_REGISTER. An undefined entry of
that type declares use of the global register named by st_value and
may have an empty name (SPARC V9 ABI); it is not an import.
inspect-elf-dependencies listed each one as an unnamed import, recorded
a name_unreadable issue for its empty name, and marked coverage
partial. JNA's sunos-sparcv9 libjnidispatch.so (shipped in Eclipse
Installer) declares %g2 and %g3 this way and reported 47 imports, two
of them unnamed, with partial coverage.
parseImports now skips undefined type-13 entries when e_machine is
EM_SPARC, EM_SPARC32PLUS or EM_SPARCV9. Elsewhere type 13 is a
different processor-specific type and keeps today's row.
Validation (macOS arm64, Node 24.22.1):
- New parser regressions for machines 2, 18 and 43 (big-endian, 32-
and 64-bit) fail before this change; a non-SPARC control keeps the
unnamed row and partial coverage.
- ElfDependencyParser, ElfDependenciesProvider and ElfDependenciesView:
79 passed. Format, typecheck, lint and architecture guards pass.
- Real file: libjnidispatch.so now reports 45 imports, complete
coverage and no issues, matching the 45 named undefined dynamic
symbols llvm-nm lists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ENOTCONN classifier and direct-error regression landed in #11490.
Keep that implementation and add coverage for an HTTP listener error whose
parsed system code is ENOTCONN after its native cause is made opaque.
Group the direct and wrapped cases outside the runtime test function to
keep the existing function-size limit while retaining both assertions.
Related: #11362
Signed-off-by: Deepak Jain <deepujain@gmail.com>
The remediation for a refused ptrace seize said injection was unavailable
whatever the target. Frida's reason carries no errno, so REA cannot tell a
host that lacks PTRACE_SEIZE, such as PRoot-Distro, from a ptrace permission
policy that refused only the selected process. Sending the second case to
another host would be wrong.
Word the remediation as two possibilities. If other targets fail the same
way, run REA on a host with native ptrace support or use a remote Frida
server. Otherwise check the ptrace permissions that apply to this target. The
regression test now asserts the conditional wording and that the host-wide
claim is gone.
Refs #9103
Signed-off-by: Deepak Jain <deepujain@gmail.com>
When Frida cannot start tracing a target because its ptrace seize request
was refused, REA reported the generic "Choose another analysis or target"
remediation. On PRoot-Distro, which does not implement PTRACE_SEIZE, no
target can work, so that advice sent operators in the wrong direction while
device and process discovery kept succeeding.
Recognize Frida's "Unable to perform ptrace seize" reason in the Frida
provider's failure conversion and return a message and remediation that name
the refused request, say injection is unavailable whatever the target, and
point at a host with native ptrace support or a remote Frida server. The
remote-connect remediation moves into the same helper. Other Frida startup
failures keep the generic remediation, and incomplete cleanup still takes
precedence over both.
Refs #9103
Signed-off-by: Deepak Jain <deepujain@gmail.com>
A reviewer read the test and said it would still pass with `Uint32Array` back at
`ByteEntropyService.ts:258`. That was correct, and I verified it: reverting the counter to
`Uint32Array` left all four cases green. The test pinned the counter type but not the loop that
fills it, so nothing tied the service's census to the exact counter.
The two counting loops were copies of each other — `computeBlockEntropy` and the service each had
their own. They are one function now, `countByteValues(bytes, counts)`, whose `counts` parameter is
`Float64Array`. That makes the counter type part of the signature rather than a local decision: a
narrower bin is a compile error at the call site, which is the guarantee the test was pretending to
give.
With `const counts = new Uint32Array(256);` at that line:
src/application/binaryDiagnostics/ByteEntropyService.ts(282,36): error TS2345:
Argument of type 'Uint32Array<ArrayBuffer>' is not assignable to parameter of type
'Float64Array<ArrayBufferLike>'.
The tests changed to match what they can actually prove:
- a census that lands just under 2^32 and then crosses it in one more chunk, asserting the total
does not wrap;
- two chunks accumulating into one counter, matching how the service counts a stream, compared
against the same bytes counted as one run.
I did not attempt a 4 GiB fixture: the loop is called per chunk, so crossing the boundary with a
counter set near it exercises the same arithmetic without a quarter-hour of I/O.
`src/domain/native/byteEntropy.test.ts` — 5 cases. `tsc` 0 errors.
The previous commit moved the whole-file census into a `Uint32Array`. That bin wraps
at 2^32 occurrences of one byte, and the service admits files up to
`Number.MAX_SAFE_INTEGER`, so a 6 GiB zero-filled file reported
`entropyFromCounts(counts, size)` = 0.5283 instead of 0.
Measured on 8 MiB, three interleaved runs against the compiled counter:
| form | time |
| --- | --- |
| `for...of` + `Float64Array` | 79.59ms |
| indexed + `Float64Array` | 9.26ms |
| indexed + `Uint32Array` | 9.28ms |
The 8x comes from the indexed reads, not from the integer bin, so exactness costs
nothing here. The bounded block counter stays bounded by `block_size` (max 65536) and
also uses a `Float64Array` so the two counters read the same.
`wholeFileByteCounts` names the counter the service uses, so the test can assert the
property that matters: a count above 2^32 survives. It fails on the previous commit.
`src/domain/native` + `src/application/binaryDiagnostics`: 443 passing. One test fails
on this Windows host before and after this diff — `reports a changed artifact when its
parent directory moves during streaming` fails with `ENOENT` on a directory rename.
`tsc` 0; `npm run lint` 0 errors; `knip` 0.
Both entropy counters walked the payload with `for (const byte of bytes)` and
accumulated into a `Float64Array` through `counts[byte] ?? 0`. Iterating a typed
array that way costs far more than an indexed read, and the nullish fallback is dead
work because a typed-array element is never `undefined`.
Measured on the compiled function with a 4 MiB block, alternating the two bodies so
both run in the same process:
| body | time |
| --- | --- |
| `for...of` + `Float64Array` | 37.15ms |
| indexed + `Uint32Array` | 4.64ms |
That is **8.01x** on the counter. Entropy values are unchanged: 300 randomised and
boundary inputs produce identical results to the previous implementation, and the
4 MiB fixture reports the same entropy from both bodies.
`ByteEntropyService` streams the same accounting over each read buffer, so it gets
the same change; `filled` bounds that loop because the buffer is reused between
reads.
`src/domain/native` and `src/application/binaryDiagnostics`: 442 passing. One test
fails on this Windows host in both the base and this diff — `reports a changed
artifact when its parent directory moves during streaming` fails with `ENOENT` on a
directory rename, so it is environmental, not caused by this change. `tsc` 0;
`npm run lint` 0 errors; `knip` 0.