Commit Graph
2339 Commits
Author SHA1 Message Date
Afloat a16669ab2a feat(evidence): paginate retained evidence discovery summaries (#9084)
* feat(evidence): paginate retained evidence discovery summaries

Let callers page summary metadata in canonical Evidence ID order without loading record payloads into the response. Keep filter and link totals global to all matches and preserve the unpaged response for existing clients.

* test(evidence): use the supported compact schema profile

* docs(evidence): explain the summary pagination request default

* test: align verification fixtures with current public contracts

Keep the production changes from upstream and update the verification consumers that still asserted their retired contracts:

- assert unknown workflow identity structurally and retain the bounded provider caveats;
- observe the process capture's partial-error delivery while preserving live cleanup ownership assertions;
- use the package's declared imports in the isolated release controller;
- refresh the replay card digest after the Evidence subject identity migration;
- use the supported compact Kimi profile while testing case-insensitive environment keys;
- assert each public interface's own capture issue path.

These are shared test and verifier compatibility repairs. The evidence summary pagination and config-printer feature changes remain separate.

* test: observe the session close result in Kuna retry coverage

* test: follow the persisted DOL snapshot target identity

* test: align CLI and progress fixtures with shared owners

Reuse the core registrar for decompile-all instead of registering it twice
after upstream #11680. Assert the outer MCP start/completion notifications
separately from provider cleanup progress introduced by #11637, retaining
cleanup, rate, timeout, cancellation, and evidence assertions.

* docs: link CLI paging guidance to its canonical contract
2026-11-22 15:42:02 +08:00
hhang 9ffaca5447 fix(native): preserve bundle provenance in partial reports 2026-11-22 15:41:50 +08:00
hhang e35780d042 fix(native): refresh bundle provenance on reopen 2026-11-22 15:41:50 +08:00
hhang b8995f8148 feat(native): retain Apple bundle executable provenance 2026-11-22 15:41:50 +08:00
hhang c1943f196c fix(javascript): account for active nullish pattern defaults 2026-11-22 13:38:40 +08:00
hhang 8ae636b6ab fix(javascript): preserve uncertainty after nullish patterns 2026-11-22 13:38:40 +08:00
morluto 4b86932527 perf(javascript): index artifact package directory lookups (#13327) 2026-11-22 04:38:43 +00:00
morluto 11a75a5c19 fix(guidance): direct workflow errors to the scoped inventory (#13321)
* fix(guidance): direct workflow errors to the scoped inventory

* fix(mcp): type the progressive catalog registration boundary
2026-11-22 04:26:57 +00:00
morluto ae4e0c83dd test(guidance): consolidate search and locator contracts (#13312) 2026-11-22 04:08:28 +00:00
morluto 27181314cb test(evidence): consolidate input admission and schema examples (#13322) 2026-11-22 04:01:42 +00:00
morluto c34bdabeae fix(setup): keep incomplete Windows roots unresolved (#13298)
* fix(setup): keep incomplete Windows roots unresolved

* fix(setup): qualify Kilo roots before appending directories
2026-11-22 03:20:23 +00:00
morluto e726f89bcb fix(setup): preserve Goose configuration root selection (#13297) 2026-11-22 03:07:46 +00:00
morluto 625bd4b70a fix(setup): refuse Hermes profiles with an unreadable deletion marker (#13296) 2026-11-22 03:03:56 +00:00
morluto 560e2ef267 perf(setup): index YAML alias bindings in document order (#13295) 2026-11-22 03:03:29 +00:00
morluto 825afe019c test(setup): consolidate TOML client preservation checks (#13294) 2026-11-22 02:58:25 +00:00
morluto 2af8248a44 fix(uninstall): report verified removal after staging cleanup failure (#13293) 2026-11-22 02:51:55 +00:00
morluto 3fcf340334 test(cli): consolidate JSON settings source retention checks (#13273) 2026-11-22 02:27:19 +00:00
morluto 27657b7420 fix(cli): register Kilo in linked worktrees of bare repositories (#13285) 2026-11-22 02:26:47 +00:00
morluto 82cd526a81 perf(cli): parse valid strict client settings once (#13271) 2026-11-22 02:16:05 +00:00
morluto c1a1de9bfb fix(cli): report retained MCP registration backups on typed failures (#13268) 2026-11-22 02:00:34 +00:00
morluto d6c4776e65 fix(setup): unify OpenCode layer resolution and alias ownership (#13226) 2026-11-22 01:35:37 +00:00
Harsh Asalkarandmorluto 63c50ecfc0 feat(setup): discover project-scoped MCP registrations in doctor and … (#7283)
* 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>
2026-11-21 22:19:56 +00:00
8d6552e928 feat(config): persist provider settings in a user config file (#3023)
* 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>
2026-11-21 22:02:35 +00:00
morluto 7b3fb897c0 test(browser): consolidate source-map and deadline contracts (#13220) 2026-11-21 16:57:36 -05:00
abba1f43bb fix(setup): register aube's bin shim instead of its versioned store path (#5311)
* 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>
2026-11-21 16:34:38 -05:00
XiaoBinGan d777c3c55f perf(entropy): count bytes through one shared loop
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.
2026-11-21 21:12:12 +01:00
XiaoBinGan a3acfcf003 fix(entropy): keep the whole-file census in a counter that cannot wrap
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.
2026-11-21 21:12:12 +01:00
XiaoBinGan 5d3276d14c perf(entropy): count bytes by index into an integer table
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.
2026-11-21 21:12:12 +01:00
RRFZ 9f74043fa6 test(javascript): verify candidate response provenance in the graph 2026-11-21 21:10:51 +01:00
David Muñoz Rey 6aa3898317 fix(apple): rethrow internal invariant violations while resolving a bundle's program file (#11392)
* fix(apple): rethrow internal invariant violations while resolving a bundle's program file

Bundle target resolution decodes Info.plist with the shared binary plist decoder, which reports a broken internal assumption as InternalInvariantError. The resolver caught every decode failure and reported it as a BinaryTargetError ("Info.plist is malformed, unsupported, or lacks CFBundleExecutable"), and its two outer catches wrapped anything else the same way. A REA defect therefore reached the caller as a fact about the user's bundle.

#11029 made the other plist consumers rethrow the invariant. The resolver's decode site and both outer catches now do the same.

Tests: a boundary test opens a .app and a .bundle through parseBinaryTarget with the decoder replaced by one that reports an invariant violation. Before this change both resolved { ok: false } with a BinaryTargetError; now both reject with the InternalInvariantError. The same bundles open normally with the real decoder.

* test(apple): mock the binary plist decoder at its domain path

Main moved the binary plist materializer from src/artifacts/apple to
src/domain/apple, and AppBundleExecutable now imports it from there. The
invariant test still mocked the old path, which no longer exists, so tsc
failed and the mock would have intercepted nothing.

The test now mocks src/domain/apple/binaryPlistMaterializer.js. With the
rethrow removed from AppBundleExecutable both cases fail; with it they pass.
2026-11-21 20:56:47 +01:00
ShuaixinHuang 0d7112321d fix(reference): render invalid Git config path with native separators 2026-11-21 20:27:50 +01:00
ShuaixinHuang ae8cd50ff7 fix(reference): preserve host spelling for Git metadata paths 2026-11-21 20:27:50 +01:00
Adolanium 89fe8dcf4e test(binary): throw the cause when restoration setup fails
A failed resolveTarget returned after a boolean assertion, so the setup
failure showed as a mismatch instead of the typed error. Format the long
AnalysisOutputError line that static checks rejected.
2026-11-21 20:06:57 +01:00
Adolanium a963184282 fix(binary): keep an imported snapshot when the first open fails
A failed first open whose client cleanup also failed cleared a staged
import even though no target had been retired. Clearing now waits until
this open has retired a previous target. A later open still retries that
cleanup before another profile can start.
2026-11-21 20:06:57 +01:00
Adolanium 667a0054d6 fix(binary): clear snapshot cache when a failed switch cannot restore
A retired target that does not come back kept its snapshot binding.
The next open failed the staged-snapshot check until close_binary.
2026-11-21 20:06:57 +01:00
morluto 1587b46a9f fix(setup): keep MCP launchers usable after session cleanup (#13185) 2026-11-21 18:50:36 +00:00
morluto b0043f1fe4 test(web): consolidate scenario Evidence promotion checks (#13160) 2026-11-21 17:22:41 +00:00
morluto 8322b55552 test(web): consolidate module syntax and capture identity fixtures (#13073) 2026-11-21 06:02:44 -05:00
morluto f63915d6f2 test(web): consolidate interrupted module resolution evidence (#13072) 2026-11-21 05:58:59 -05:00
morluto 56a0617f51 test(web): consolidate module context and resolver evidence checks (#13071)
* test(web): retain capture identity and resolver completeness proofs

* test(web): assert resolver output without matching prose
2026-11-21 05:51:08 -05:00
morluto eca10e848f test(sourcemap): isolate artifact identity and retain rejected reports (#13069)
* test(sourcemap): isolate artifact identity and retain rejected reports

* test(sourcemap): track the consolidated artifact lifecycle witness
2026-11-21 05:41:12 -05:00
morluto a9463bf1a9 test(sourcemap): consolidate retained views and MCP delivery checks (#13070) 2026-11-21 10:40:12 +00:00
morluto bf77776873 test(evidence): consolidate native routing and identity refusals (#13054)
test(evidence): consolidate native routing and identity refusal checks
2026-11-21 09:15:18 +00:00
morluto 0c3e1d69aa test(evidence): verify request admission and retained display ownership (#13053)
* test(evidence): verify frame refusal and pre-parse cancellation

* test(evidence): verify display and digest at their owners
2026-11-21 09:07:28 +00:00
morluto 34da2cce1f test(snapshots): verify live source metadata refresh (#13048) 2026-11-21 08:51:24 +00:00
morluto b6fced40a3 test(snapshots): verify ambiguous provenance through direct replay (#13046) 2026-11-21 08:42:05 +00:00
Kaoru0822 9fd8c8d903 fix(setup): recognize DSH registrations nested in Cordis groups (#13037)
* test(setup): reproduce hidden DSH registrations in Cordis groups

* fix(setup): track DSH registrations inside Cordis insert groups

* test(uninstall): cover aliased DSH group cleanup

* fix(uninstall): preserve comments at edited DSH group aliases
2026-11-21 00:23:18 -08:00
Kaoru0822 76da8fd8ba fix(uninstall): keep emptied DSH inserts from applying overrides (#13036)
* test(uninstall): reproduce DSH inserts becoming active overrides

* fix(uninstall): preserve the mode of emptied DSH insert operations
2026-11-21 00:23:02 -08:00
Kaoru0822 270c3a6b28 fix(setup): preserve caller comments on detached DSH aliases (#13032)
* test(setup): reproduce DSH alias comment loss on registration edits

* fix(setup): retain DSH alias annotations when materializing values
2026-11-21 00:22:38 -08:00
Kaoru0822 e66a27c2f2 fix(electron): resolve exact local IPC channel values (#13005)
* fix(electron): resolve exact local IPC channel values

* test(electron): cover ESM IPC channel overwrites

* fix(electron): reconcile wrapper registrations before resolving channels

* test(electron): require inference evidence for resolved handler channels

* fix(electron): preserve inferred channels on handler evidence
2026-11-20 22:32:13 -08:00