Commit Graph
2359 Commits
Author SHA1 Message Date
Akshad JogiandClaude Opus 5.5 c445f56ae3 docs(setup): document Kilo Code registration and its config layers (#13413)
* docs(setup): document Kilo Code registration and its config layers

Add the missing Kilo Code section to the client configuration guide: the
config root, the user-scope layer order Kilo loads, the last-present-layer
write rule, the entry shape, and the legacy extension MCP files Kilo still
merges at its lowest precedence, which REA does not inspect.

Cover the Windows and macOS default file and a kilo.jsonc round trip that
keeps comments, settings and other servers through setup and uninstall.
Plan the default location with the row's platform path functions, as the
other client helpers do, instead of appending file names with the host's.

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

* docs(setup): say only rea mcp add keeps a disabled Kilo entry

Setup's refresh treats enabled as a managed key and writes Kilo's default
enabled: true; only rea mcp add preserves an existing enabled: false.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:01:36 -05:00
morluto 103e1a71f2 fix(java): enforce format-specific metadata reports at the Evidence boundary (#13400) 2026-11-22 11:42:13 +00:00
morluto d0f3a4858e fix(java): preserve Gradle declaration spelling in Evidence (#13397) 2026-11-22 11:26:19 +00:00
morluto c45decb70b test(nuget): consolidate filename provenance and retained Evidence checks (#13396) 2026-11-22 11:25:14 +00:00
morluto 5b2bc6c43d fix(desktop): explain unavailable dconf descriptor paths (#13391) 2026-11-22 11:01:35 +00:00
morluto de0679e2c0 fix(desktop): recover acknowledged checkpoint after screenshot cancellation (#13390) 2026-11-22 11:01:19 +00:00
morluto 359f854477 fix(desktop): publish omissions only from completed checkpoints (#13389) 2026-11-22 10:54:56 +00:00
morluto 0b62db4d63 fix(desktop): keep automatically named checkpoints distinct (#13387) 2026-11-22 10:53:22 +00:00
morluto 62114e940f fix(audit): preserve owner failures after cleanup settles (#13352) 2026-11-22 09:30:41 +00:00
morluto caa2fab476 fix(audit): interpret Go trimpath rewrites at the flag parser (#13349) 2026-11-22 09:23:33 +00:00
morluto 0ecb6dde4b fix(audit): bind Electron fuse reads to the inventoried file (#13348) 2026-11-22 09:10:16 +00:00
morluto 6cc7de3005 perf(native): eliminate quadratic lookups, comparator Zod/stringify churn, and redundant clones across native workflows (#13306)
* perf(native): eliminate quadratic lookups, comparator Zod/stringify churn, and redundant clones across native workflows

* test(native): assert exact compositeKey ordering sequence in objcSwiftMetadata
2026-11-22 08:54:10 +00:00
morluto fde2c87b86 perf(javascript): index feature, semantic, IPC, and source map lookups (#13319)
perf(javascript): eliminate double preload AST pass and index feature/semantic/IPC/sourcemap lookups
2026-11-22 03:43:13 -05:00
b57671cb42 feat(evidence): find direct referrers by linked Evidence ID (#11709)
* feat(evidence): find direct referrers by linked Evidence ID

* docs(evidence): record real APK referrer verification

---------

Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-22 16:30:29 +08:00
morluto 26917581d6 fix(audit): preserve non-ASCII whitespace in Go build paths (#13340) 2026-11-22 08:17:40 +00:00
morluto 9e379c9589 perf(evidence): eliminate redundant bundle re-validation, cloning, and nested generator yields (#13257)
* perf(evidence): eliminate redundant bundle re-validation, cloning, and nested generator yields

* fix(evidence): detach exported snapshots and preserve equalJsonText validation
2026-11-22 03:14:49 -05:00
Jaws 460d77176e fix(evidence): evaluate unchanged artifact members in correlation
correlate_static_and_runtime searched only an artifact comparison's
`changes` rows, which by contract omit unchanged paths, and rejected any
selector without exactly one row. A unique member that compare_artifacts
counted unchanged could therefore never reach the advertised
`runtime_only` or `both_unchanged` patterns.

The artifact comparison owner now classifies a path without a change row
against the exact inventories it compared, after checking their manifests
match the retained result. Only a path observed once on each side of a
fully covered comparison is unchanged, matching `summary.unchanged`. A
path neither inventory observed is still invalid caller input, and a path
without full coverage or without resolvable source inventories stays an
unresolved branch with a limitation. Several rows for one path remain
rejected.

Fixes #13211
2026-11-22 16:05:53 +08:00
morluto 0437d74bd0 perf(javascript): group renderer scripts without repeated copies (#13328) 2026-11-22 03:05:15 -05:00
Xiangfang Chen 3ca89d8272 feat(android): pin jadx-headless-mcp 0.8.0
Move the audited engine release and its submodule gitlink from v0.7.1 to
v0.8.0 (commit 2b2a560e, sha256 4b9a01c2...). Upstream only changed
source-window paging and metadata-only field reads, so the six tools REA
consumes and the bridge identity stay unchanged.

Hand-copied version numbers now derive from JADX_RELEASE: the fixture
download name, the metadata-bridge workflow path and the fake MCP
server's reported engine version. The composition fallback availability
text no longer names a release, because the Android boundary owns the
versioned remediation.

Validation: build:cached, check:fast, docs:check, test:focused over the
16 Android test files (296 tests), and verify:android against the real
0.8.0 JAR and ApiDemos 6.0.18.
2026-11-22 16:01:00 +08:00
Abhishek SharmaandClaude Sonnet 5.5 3c7ea1ce85 feat(browser): count credential-named members in HAR capture inspection (#8708)
* feat(browser): count credential-named members in HAR capture inspection

inspect_web_network_capture now runs the credential-name scan that
environment-build already applies over the selected HAR records and
reports matches as limitations by pointer, never by value, together with
the bodies the scan could not read. Values the decoder already excluded
are not counted, and nothing is excluded on a name.

Refs #8207

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(browser): bound the listed credential-name pointers

The limitation lists the pointers that fit within 1 KiB of text and says
how many counted names are not listed, so one long body member name
cannot inflate the limitation that summaries and record pages repeat.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(environment): bound the credential scan's values before parsing a body

A body under the scan's 4 MiB text limit could still expand into millions
of JSON values or form fields when parsed in the application process, and
the inspection now runs the scan on every HAR capture. The scan counts the
characters that can start a value (`[`, `{`, `,` for JSON, `&` for forms)
before parsing and skips a body that could hold more than 524288, reporting
it like a body over the text limit. Both consumers' messages and docs name
the bound.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(web): charge every body and name/value list to one credential-scan budget

The credential-name scan bounded each body's values on its own, so a
capture of many compact bodies still expanded millions of values in the
application process, and HAR header, query and form-parameter lists were
copied twice without any bound. One 524288-value budget now covers the
whole scan: a body's values are bounded from its text before it is parsed
and a list is charged by its length before it is read in place, so what
would pass the budget is reported as not scanned instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(web): read credential names in place and charge nothing for empty text

The credential-name scan split each member, header and query name with
two regex replacements, a lowercase copy and a split into a segment
array before matching. A near-4 MiB alternating-case member name
(`x-aAaA…`) therefore expanded into about two million segments: more
than 192 MiB of heap in the application process after the decoder's
containment had ended. `credentialNamed` now reads the name once in
place with the same segmentation (case changes, digits, separators, and
`toLowerCase`'s KELVIN SIGN and dotted capital I), keeping at most two
segments no longer than the longest credential word, so a name of any
length allocates no copies.

`valueBound` started every text at one value, so an empty query, a bare
`?`, an empty form and whitespace-only JSON were each charged a value
they do not hold; once earlier content spent the budget, they were
reported as unscanned in `credential-scan-incomplete`. JSON now holds its
first value only after a non-whitespace character, and a form holds one
field per non-empty `&`-separated piece after an optional leading `?`,
as `URLSearchParams` and the query reader split it.

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

* docs(browser): point the environment build link at the physical guide

The guide lives at docs/agent-environments.md, so the relative link from
docs/guides/web must climb two levels. The Documentation job failed on the
dead link; vitepress build now completes.

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

* test: drop the hard-coded timeout from the heap-bound name test

The test finishes in about half a second, so the shared test deadline is
enough, and a literal 60_000 bypasses the CI and coverage deadline scaling.

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

* fix(web-network-capture): name an unavailable response source in the scan limitation

The credential-name scan counts a response body whose retained source is
unavailable as not scanned, and WebNetworkCaptureService reuses that scan. Its
limitation text still listed only a cut body, text over 4 MiB, or past the value
budget, so CLI and MCP reports gave none of those reasons for such a body.

Name the unavailable source in the text, matching the environment-build warning,
and cover it with a test that fails on the old wording.

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

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-22 15:42:13 +08:00
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