chore: preserve current main archive typing and runtime fixes

This commit is contained in:
64579525
2026-10-13 12:12:03 +08:00
65 changed files with 4164 additions and 151 deletions
@@ -194,8 +194,9 @@ every executable in the bundle. It also lists missing or weak loads and earlier
`architecture`. System paths stay undetermined because the dyld shared cache
provides them.
Use `extract_artifact` when materialized files are needed. It takes no arguments
and materializes all regular files into a fresh temporary directory chosen by
Use `extract_artifact` when materialized files are needed. It extracts the active
target and accepts optional `integrity_policy`; see the [MCP contracts](https://github.com/morluto/rea/blob/main/docs/mcp-contracts.md).
It materializes all regular files into a fresh temporary directory chosen by
REA. Symlinks and encrypted entries are inventory facts, not extractable files.
The result reports the materialized directory; callers do not choose the
destination. No separate permission grant is needed.
+3
View File
@@ -3,3 +3,6 @@
# Windows command fixtures retain their native line endings.
*.cmd text eol=crlf
# Preserve whitespace in original upstream licensing texts.
licenses/npm-runtime-notices.txt whitespace=-blank-at-eol
+6 -3
View File
@@ -24,9 +24,12 @@ provider-dependent behavior to be reproduced safely.
## Security boundary
REA authenticates each local provider bridge session with a random capability
token and a current-user Unix socket. Tokens are transferred through private
session descriptors rather than process arguments or environment variables.
REA authenticates its Hopper and Ghidra bridges with per-session random
capability tokens. POSIX uses current-user Unix sockets; Windows Ghidra uses
authenticated loopback TCP with a private NTFS runtime whose DACL admits only
the current user and SYSTEM. See [Windows Ghidra P0](docs/windows-ghidra-p0.md#private-runtime-transport-and-lifecycle).
Tokens are transferred through private session descriptors rather than process
arguments or environment variables.
This is not a sandbox and does not protect against malicious processes already
running as the same operating-system user. Opening an untrusted binary
delegates parsing and analysis to the selected local provider with that user's
+7
View File
@@ -28,6 +28,13 @@ entries preserve the declared license and author metadata and include a clearly
labeled standard license text. These are documented upstream notice gaps, not
recovered copyright notices or a claim that attribution has been fully verified.
The optional `frida@17.23.2` npm archive and tagged Node binding source also
omit a standalone license/copyright document. Its declared
`LGPL-2.0 WITH WxWindows-exception-3.1` license is recorded with unchanged
[Frida licensing text](licenses/frida-17.23.2-COPYING.txt) and the
[GNU Library GPL v2](licenses/LGPL-2.0.txt). These are licensing supplements,
not recovered Node binding or prebuild-component copyright notices.
## Open-source engine credits and licenses
We thank the maintainers and contributors of the projects below. Their
+2 -2
View File
@@ -136,8 +136,8 @@ existing analysis families directly, for example
## Resource and lifecycle limits
- Caller values reach adb only as positional arguments in fixed vectors;
no tool accepts an arbitrary shell command line, and UI interaction
(`input`, `am`, `monkey`) is deliberately not exposed.
no tool accepts an arbitrary shell command line, `input`, or `monkey`.
The app/activity lifecycle tools use `am start -W` and `am force-stop`.
- Per-invocation budgets: client/devices 10-20 s, shell reads 20-60 s with
64 KiB-8 MiB capture caps (logcat 4 MiB, screen 32 MiB), transfers and
bugreports 600 s. Exceeded budgets report `resource_constraint`; stopped
+5
View File
@@ -101,6 +101,11 @@ Setup and doctor follow Qwen Code's tilde and working-directory-relative home
overrides. Qwen Code also discovers personal skills in `~/.agents/skills`,
where setup installs the bundled workflow.
## Antigravity
Antigravity 2.0 discovers personal skills in `~/.gemini/config/skills`.
Setup installs its selected skill copy there.
## Gemini CLI
Gemini CLI uses `$GEMINI_CLI_HOME/.gemini/settings.json` when that home override
+20
View File
@@ -25,6 +25,26 @@ The equivalent MCP methods are `identify_flutter_build` (with `path`) and
arm64-v8a, then x86_64, then x86, then armeabi-v7a, then the remaining
ABIs alphabetically).
## Optional retained AOT delivery
MCP `inspect_dart_aot` keeps complete output when `detail` is omitted or
`"complete"`. Explicit `detail: "summary"` returns the selected target/ABI/library
identity, all snapshot headers, structural coverage, string-pool coverage and
original lower-bound counts without the string lists. It retains complete source
Evidence and returns a distinct linked `inspect_analysis_view` summary. Analysis
and the caller's ABI choice are unchanged; one-shot CLI output stays complete.
Use `normalized_result.parent_evidence_id` as the retained source for
`inspect_analysis_view`, with `view: {kind: "dart-aot", collection: "package_uris",
offset: 0, limit: 64}`. Collections are `package_uris`, `dart_uris` and
`class_like_tokens`. Pages preserve the original strings and order, selected ABI,
library identity and source coverage. `returned_counts` describe producer-returned
rows; counts ending in `_at_least` remain lower bounds. Exhausting a page sequence
does not make a partial pool complete or turn byte-pattern tokens into typed
classes/functions. Views do not reopen the APK. Original Evidence remains
exportable under its existing session lifetime. Summary requires a retaining
server; older servers keep the complete request after schema discovery.
## What the AOT inspection returns
`inspect_dart_aot` reads one ABI's `libapp.so` in full and reports:
+10 -10
View File
@@ -22,16 +22,16 @@ header declarations, not proof that every instruction conforms to that ISA.
Provider selection returns the specific unsupported constraint rather than
guessing a compatible profile:
| Declaration | Outcome |
| ----------------------------------------------- | --------------------------------------------------------------------------- |
| Little-endian ELF64 `ET_EXEC`, double-float ABI | admitted, `RISCV:LE:64:default` + `gcc` |
| Little-endian ELF32 `ET_EXEC`, double-float ABI | admitted, `RISCV:LE:32:default` + `gcc` |
| Big-endian | refused; Ghidra 12.1.4 ships no big-endian RISC-V language |
| `ET_REL`, `ET_DYN`, other `e_type` | refused with the declared value |
| `EF_RISCV_RVE` | refused; the embedded 15-register ABI needs its own processor specification |
| `EF_RISCV_TSO` | refused; the total-store-order memory model is unverified here |
| Soft, single, or quad float ABI | refused; the pinned generic compiler specification models double-float |
| Reserved or newer `e_flags` bits | refused with the offending bits named |
| Declaration | Outcome |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Little-endian ELF64 `ET_EXEC`, double-float ABI | admitted, `RISCV:LE:64:default` + `gcc` |
| Little-endian ELF32 `ET_EXEC`, double-float ABI | admitted, `RISCV:LE:32:default` + `gcc` |
| Big-endian | refused; Ghidra 12.1.4 ships no big-endian RISC-V language |
| `ET_REL`, `ET_DYN`, other `e_type` | refused with the declared value |
| `EF_RISCV_RVE` | refused; the embedded 16-register profile (x0–x15) needs its own processor specification |
| `EF_RISCV_TSO` | refused; the total-store-order memory model is unverified here |
| Soft, single, or quad float ABI | refused; the pinned generic compiler specification models double-float |
| Reserved or newer `e_flags` bits | refused with the offending bits named |
`e_type` is the only load-shape declaration this lane reads. A fixed-address
`ET_EXEC` declaration does **not** establish static linkage: `PT_INTERP` and
+5 -7
View File
@@ -101,13 +101,11 @@ rea setup --yes --all-detected --install-hopper --json
### Skill destinations
The bundled skill is installed where each selected client discovers personal
skills: Claude Code uses `~/.claude/skills` (or
`$CLAUDE_CONFIG_DIR/skills` when configured). Gemini CLI uses `.agents/skills`
under its selected home; Antigravity 2.0 uses `~/.gemini/config/skills`.
Other integrations, including Qwen Code, use `~/.agents/skills`.
A mixed selection plans each distinct destination. Selecting the skill without a client uses the shared
directory. Setup leaves existing skill copies in other locations untouched.
The bundled skill is installed in each selected client's personal skill directory.
See [client configuration](client-configuration.md) for client-specific roots,
profiles, and environment overrides. A mixed selection plans each distinct
destination. Selecting the skill without a client uses `~/.agents/skills`.
Setup leaves existing skill copies in other locations untouched.
`rea setup --skill-client claude_code --yes --json` refreshes and verifies the
selected skill destination independently of MCP registration selection. The
+11 -8
View File
@@ -1,28 +1,31 @@
# JavaScript static/runtime reconciliation
REA can combine an existing static JavaScript Application Graph with one or
more passive browser, Electron page, or Node/Electron V8 Inspector captures without collapsing their different
authorities. The `reconcile_javascript_runtime` MCP tool and
more browser, Electron, or Node/Electron V8 Inspector observations while
preserving their different authorities. The `reconcile_javascript_runtime` MCP tool and
`rea reconcile-javascript-runtime` CLI command accept Evidence records and
return derived Evidence containing a combined JavaScript Application Graph
and explicit match, ambiguity, mismatch, and unknown classifications.
The operation performs no filesystem, browser, or Electron I/O. It accepts only
semantically verified Evidence produced by `analyze_javascript_application`,
`inspect_web_page`, `inspect_electron_page`, or
`observe_javascript_runtime`; matching operation names alone
`inspect_web_page`, `inspect_electron_page`, `observe_javascript_runtime`, or
`capture_electron_scenario`; matching operation names alone
is insufficient. Provider identity, predicate type, subject digest, target
parameters, and normalized-result schemas are checked before reconciliation.
`capture_electron_scenario` supplies target-only partial observations. It does
not establish loaded-script coverage; see [Electron observation](electron-observation.md).
## Workflow
1. Run `analyze_javascript_application` against exactly one application layer.
Optional cache or assets directories can be analyzed independently and
supplied as additional layers.
2. Run `inspect_web_page`, `inspect_electron_page`, or the attach-only
`observe_javascript_runtime`. Capturing script sources
is optional, but a source capture provides the strongest byte
identity.
`observe_javascript_runtime`, or supply existing `capture_electron_scenario`
Evidence with the partial scope above. Capturing script sources is optional,
but a source capture provides the strongest byte identity.
3. Pass the resulting Evidence records to `reconcile_javascript_runtime`.
Browser URLs normally need an explicit URL-prefix mapping. Extracted
Electron and V8 Inspector file locations are mapped automatically when runtime files remain
@@ -104,7 +107,7 @@ nodes. REA evaluates compatible static candidates conservatively:
Every successful cross-layer `observed_as` edge has
`authority: cross-layer-reconciliation` and `state: inferred`. The underlying
artifact/AST observations and passive-CDP observations remain unchanged and
artifact/AST observations and runtime observations remain unchanged and
retain their own Evidence links.
## Loaded, resident, and not observed
+3 -1
View File
@@ -151,7 +151,7 @@ assembly. Older member Evidence without `selection` remains readable.
Start by identifying the artifact with `inspect_managed_artifact`, then inspect
its types and CIL with `inspect_managed_members`. Use [member comparison](#member-comparison)
for another build, and [managed/native boundary rules](#managednative-boundary-rules)
for another build, and [managed/native boundary rules](#managed-native-boundaries)
when matching declared native calls to supplied native Evidence. Static inspection
does not load or execute the assembly. Reconstructed structure and unresolved
native/runtime questions retain their own authority and coverage.
@@ -220,6 +220,8 @@ to native function addresses requires verified
provider evidence; names or vtable similarity alone do not prove that a native
function implements a specific managed method.
<div id="managed-native-boundaries"></div>
## Managed/native boundary rules
`verify_managed_native_boundaries` compares declared P/Invoke module and entry
+1 -1
View File
@@ -61,7 +61,7 @@ Independent raw verification streams the complete private snapshot digest and
extent with bounded memory and supports cancellation during the read.
Hopper and IDA refuse raw-binary targets. Windows Ghidra P0 continues to admit
PE applications only.
native PE applications and DLLs only; raw-binary targets are unsupported.
## Limitations
+9
View File
@@ -218,6 +218,15 @@ release baseline and can propose an already-published version again.
After publication, open a PR from the release branch back to main. Preserve
main's later implementation changes and regenerate ignored build outputs from
the combined contracts with the released package version.
Before merging, check whether GitHub permits merge commits:
```bash
gh api repos/morluto/rea --jq .allow_merge_commit
```
If disabled, a maintainer must arrange an approved ancestry-preserving merge
path before synchronization can finish. Squash and rebase merges do not put the
released tag in main's ancestry. Do not substitute them for this step.
Review and test this synchronization PR, then use a merge commit so the release
tag remains in main's ancestry. Keep the released tag unchanged.
@@ -7,6 +7,14 @@ JSON measurements belong outside the checkout. This document keeps the measured
findings, verification scope and revision references; the scripts and `corpus.json`
keep the reproduction inputs. Generated `results/` is ignored.
Follow-up: [latest-main capability audit](latest-main-audit.md) records the
Flutter, SQLite, TShark and sigrok priorities and the first shipped Dart AOT
baseline, preserving existing controls before introducing another selector.
Follow-up: [Dart AOT summary and retained string pools](flutter-aot-summary.md)
records real LocalSend delivery pairs and old Evidence continuation, preserving
ABI selection, snapshot identity, original lower bounds and partial coverage.
Follow-up: [native PE/DOS entry views and real model verification](native-entry-views.md)
records the post-merge native continuation, including a small-function case where
four selected replies cost more bytes than the complete dossier.
@@ -235,6 +235,21 @@
},
"immutable_scope": "Published Hardhat artifact does not record an immutable-reference map; absence is unknown, not proof of no immutables. Runtime template bytes remain exact."
}
},
{
"id": "localsend-arm64.apk",
"file": "LocalSend-1.18.2-android-arm64v8.apk",
"bytes": 46558706,
"sha256": "82ec3568fba2aa5295b9aae8b76f701d7a4703d86b9f8bad749472038fbaeab3",
"provenance": {
"project": "LocalSend",
"version": "1.18.2",
"upstreamFile": "LocalSend-1.18.2-android-arm64v8.apk",
"url": "https://github.com/localsend/localsend/releases/download/v1.18.2/LocalSend-1.18.2-android-arm64v8.apk",
"transport_sha256": "82ec3568fba2aa5295b9aae8b76f701d7a4703d86b9f8bad749472038fbaeab3",
"transport_bytes": 46558706,
"derivation": "Official arm64 release APK, compared with GitHub release asset digest; byte-only analysis without execution"
}
}
]
}
@@ -0,0 +1,160 @@
# Dart AOT summary and retained string pools
Continues [#2016](https://github.com/morluto/rea/issues/2016) and
[#2455](https://github.com/morluto/rea/pull/2455). The selected analyst question
asks for shipped LocalSend target/ABI/library identity, every nullable snapshot
observation, string-pool lower bounds and returned counts, and original coverage
and limitations. It does not require individual observed strings.
## Compatibility and ownership
MCP `inspect_dart_aot` accepts explicit `detail: "summary"`. Omitted and complete
requests preserve the complete result and original provider inputs. The CLI
remains complete. ABI omission and explicit ABI selection retain their original
meaning; the provider never receives the delivery field. Missing retention,
invalid detail and pre-cancellation fail before provider work.
The existing application workflow retains the complete original Evidence, then
returns a distinct derived summary linked to its parent ID. It preserves target
and libapp digests, every snapshot section and nullable fact, original pool and
overall coverage, lower-bound counts and limitations. `returned_counts` reports
the lengths of the producer-returned arrays; it does not upgrade lower bounds
to a complete snapshot inventory. The analysis and original source retention
are unchanged. No new engine, persistent cache or plugin SDK is introduced.
Read exact retained strings using `inspect_analysis_view`, the parent ID, and
`view: {kind: "dart-aot", collection: "package_uris", offset: 0, limit: 64}`.
Other collections are `dart_uris` and `class_like_tokens`. Follow the returned
next offset. Pages preserve source order, ABI/library identity and partial pool
coverage without opening the APK again. Page exhaustion describes retained
strings, not the entire snapshot. Strings remain byte-pattern observations,
rather than recovered typed class/function semantics. Missing historical
subjects remain explicitly unknown; conflicting recorded target digests fail.
## Frozen runtime and real SDK pairs
The official LocalSend 1.18.2 arm64 APK acquisition, size and SHA-256 are pinned
in `corpus.json`. No APK installation, target execution or version-dataset
lookup occurred. Source runtime: `811034a7283c9751a3ecbff33e8b2f28bec55793`;
compiled dist/bridge file-table SHA-256:
`dabbb63536c5862be839ecdc0f3eaad05b29c2a3816f57041528d30f754311be`.
The previous runtime is `28c84e78cf2fbfde4aceed345b773c59eb889f68`, digest
`5332dda13981f043e146b3601ebec1f380d9f698280ca53d75786b638a912e11`.
Its production sources were verified byte-equal to main f254 at acquisition.
Subsequent test-only changes and main's SAZ addition do not relabel these pins.
Node is 24.18.0 and the SDK client/server are 2.3.1. Each workflow starts a fresh
server and validates the selected live advertised schema. Artifact bytes,
provider environment/search-path fingerprints, driver and locked dependencies
stay equal. Host page caches are not flushed. Heavy tasks run serially under
the unchanged CPU, memory, task and host guards.
| Trial | AOT reply bytes | SDK workflow seconds | Payload CPU seconds | Kernel peak bytes |
| -------------- | --------------: | -------------------: | ------------------: | ----------------: |
| sdk-complete-1 | 151,341 | 5.139 | 6.819 | 691,441,664 |
| sdk-summary-1 | 12,037 | 5.219 | 6.608 | 639,430,656 |
| sdk-summary-2 | 12,037 | 5.064 | 6.405 | 640,868,352 |
| sdk-complete-2 | 151,341 | 5.128 | 6.468 | 633,614,336 |
Both pairs use one successful public tool call and pass settings/fact comparison,
including all snapshot fields, coverage, original limitations and all counts.
Reply bytes fall 92.05%. Whole SDK time stays approximately 5.1 seconds; these
trials do not establish engine speed, CPU or memory savings. Payload CPU includes
driver/catalog work beyond the SDK workflow timer. Catalog JSON grows from
2,506,213 bytes on the previous runtime to 2,514,896 (about 0.35%).
A fresh old-runtime complete request passes comparison against candidate
complete, including identical 151,341-byte replies. This is scoped compatibility
evidence, not a guarantee for every historical release or third-party client.
## Real old Evidence continuation
Fifteen successful public MCP calls import genuine old-runtime AOT Evidence,
project retained summary, reconstruct all 500 package URIs, 216 Dart URIs and
2,000 class-like tokens, compare inline portable summary, and export the original
record. The APK is absent during all these operations. Original string order,
lower bounds, partial coverage, nullable snapshot facts, subject and parent ID
remain intact; the original exported record is deeply equal to its source.
The first private verification attempt used a nonexistent receipt filename and
failed before import or artifact relocation. That driver error is retained;
the corrected attempt selects the fresh old-runtime record. It is not a REA
defect or a successful migration trial.
## Actual Codex task outcomes
Four serial trials use the same frozen candidate in complete/summary/summary/
complete order. Requested configuration is Codex CLI 0.161.0, `gpt-5.6-terra`
high, one exact enabled tool (`inspect_dart_aot`), and identical optional owned
context capture/discovery guidance. This requested alias does not certify the
server-resolved model. Temporary configuration points to the modified frozen
REA MCP; all copied credential profiles are removed and target bytes remain
unchanged. The source question is fixed; equal treatment instructions choose
detail and explain the summary carrier and parent reference.
| Trial | Input | Cached | Uncached | Output | Seconds | MCP attempts | Failed attempts | Facts |
| ---------------- | -----: | -----: | -------: | -----: | ------: | -----------: | --------------: | ----- |
| model-complete-1 | 74,641 | 50,176 | 24,465 | 2,765 | 116.898 | 3 | 1 | pass |
| model-summary-1 | 38,253 | 22,016 | 16,237 | 1,449 | 88.904 | 1 | 0 | pass |
| model-summary-2 | 38,363 | 22,016 | 16,347 | 1,515 | 55.190 | 1 | 0 | pass |
| model-complete-2 | 66,585 | 38,144 | 28,441 | 2,217 | 79.180 | 2 | 0 | pass |
Both pairs pass checks for every selected producer fact, exact nullable
observations, target digest, observed response Evidence IDs, original limitations,
artifact preservation and profile cleanup. The grader compares the reported
facts with producer observations; it is not an independent Dart deserializer.
Total input falls 48.75% / 42.38%, uncached input 33.63% / 42.52%, reported output
47.59% / 31.66%, and whole-task time 23.95% / 30.30%. Usage is the final aggregate
reported by the actual CLI, one usage record per trial; cached tokens are not
subtracted from total input. Reported output includes reasoning output (1,262,
321, 383 and 709 tokens respectively).
The first complete trial initially supplied `artifact_path` instead of the
advertised `path`, corrected it, then repeated a successful complete call.
The second complete trial made two successful calls. Both summary trials made
one successful call. All attempts, discovery and correction costs remain
included. The paired whole-task improvement therefore includes actual model
decisions and the convenience of explicit returned counts; it does not isolate
serialization as the sole cause or establish engine acceleration. Two pairs on
one app/question/model configuration support this scope, not a universal gain.
Payload CPU seconds / kernel peak bytes are respectively 12.556 / 876,937,216;
9.213 / 785,272,832; 9.108 / 793,939,968; and 13.164 / 803,209,216. Model payload
observations verify owned cleanup and zero phase limit events, with no guard
aborts. Whole-scope final counters remain unknown, so every strict all-selected
resource grade remains false even though the separate factual grade passes.
## Resource and verification scope
SDK and migration payload-exit observations verify owned cleanup and zero
observed memory/pids limit events, with peaks below 692 MB. Missing whole-scope
terminal counters remain unknown; the strict whole-resource grader stays false.
One-CPU quotas are experiment controls rather than CPU-efficiency claims.
Production-provider fixture tests cover explicit ABI, old complete defaults,
actual SDK-converted schemas, exact pages after APK removal, portable records,
nullable/partial facts, malformed inputs, target digest conflicts and early
refusals. CLI/MCP acceptance covers original report equality, duplicate-member
refusals and unsupported snapshot kinds. Fixture successes are distinguished
from the real LocalSend SDK/migration workflows. Other Flutter apps, architectures,
SDK layouts, typed class recovery and runtime behavior remain unverified here.
Raw replies, binaries, model traces and temporary credentials stay outside Git.
## Integration with the newer main
The rebased verification runtime is `63984ce0898bd7997e6d9b138e6d96d0a24f2b09`
on main `a2d8b94dd50dab8d966239dd63ab84718aa8b4b4`, with compiled file-table
SHA-256 `19c8ccdd3e99bb46a5c54f4edd8c6b2d2eb4f3a4870b3c129061d38145382b68`.
Targeted Flutter/SAZ/shared-view integration passes 35 tests; one opposite
runtime-capacity branch is skipped because this host enforces decoder memory.
Documentation checks and two README conformance tests pass.
Fresh real complete/summary SDK checks on this runtime match the earlier selected
facts and settings, with unchanged 151,341 / 12,037-byte AOT replies. Fifteen
old-Evidence migration calls again preserve every original string and record
with the source APK absent. The real one-shot CLI complete result also matches
the previous-runtime normalized report, subject, parameters and original ID.
An initial CLI-only controller check lacked an owned resource receipt; it is
retained and excluded from resource/performance claims, then repeated in the
bounded owned scope. These checks establish integration, rather than relabeling
the earlier paired model/SDK measurements as the rebased runtime.
@@ -0,0 +1,75 @@
# Latest-main efficiency continuation
Continues [#2016](https://github.com/morluto/rea/issues/2016). The 2026-10-13
fetch resolved main to `f254f5ac2b804b353a711264bb178f43fdf07867`, the same
revision as the preceding Android conclusion. Newer capabilities below were
added during that earlier cycle; they are additional measurement scopes, not
new commits after that conclusion.
| Capability | Existing controls | Next evidence needed |
| ----------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| Flutter / Dart AOT (#1582) | Explicit ABI, bounded string observations, partial coverage | Real shipped snapshot/count question; opt-in delivery only if unrelated strings dominate |
| SQLite (#2271) | Compact inventory, selected table/columns, row limit | Real application database and model workflow before adding another selector |
| TShark (#2318) | Fields, filter, decode-as, pass, default 50 matching rows, paging, explicit null for all | Real public capture and repeated task cost; paging repeats dissection |
| sigrok (#2339) | Decoder/channels/annotation selection, default 50 display lines, paging | Real public capture; display-line count is not annotation count and paging repeats decoding |
| Retained unknown head results | Existing retained paging | Reuse the existing view rather than duplicate its implementation |
Attached IDA, Frida and other live runtime workflows involve separate authority
and lifecycle questions and are outside this static parsing continuation.
Plugin SDKs and cross-session engine caches remain deferred until an observed
need and benefit justify them.
## First selected scope: Dart AOT
The official LocalSend 1.18.2 arm64 APK is pinned in `corpus.json`. The initial
real public SDK baseline inspected actual bytes without executing/installing
the APK. Its complete default AOT reply was 151,341 compact client-result JSON
bytes (70,487 normalized bytes), with 500 package URIs, 216 Dart URIs and 2,000
class-like tokens. String-pool and overall coverage were partial. A second
explicit arm64 request returned the same normalized facts.
These are exploratory first/warm calls, not an optimization pair. The frozen
runtime source is `28c84e78cf2fbfde4aceed345b773c59eb889f68`, with production
source bytes verified equal to main f254 at baseline acquisition. Its compiled
file-table digest is
`5332dda13981f043e146b3601ebec1f380d9f698280ca53d75786b638a912e11`;
the receipt is not relabeled as a newer build.
The candidate adds explicit MCP `detail: "summary"` and retained pool pages.
Omitted/complete requests and the CLI preserve the old complete path. Analysis,
ABI selection and original Evidence stay intact. Summary retains target/libapp
identity, exact nullable snapshot observations, lower bounds, returned counts,
coverage and limitations. Pages preserve original string order and source
coverage without rescanning. No engine cache, provider protocol or third-party
plugin API is introduced.
Follow-up measurements must compare identical selected facts, portable old
Evidence and actual model tasks. Reply bytes do not establish token or latency
improvements. Whole-scope final counters remain unknown if their cgroup has
disappeared, even when the narrower payload-exit observation is verified.
Raw records, binaries and model traces stay in the private lab outside Git.
Heavy work remains serial under the unchanged one-CPU, 3 GiB early-stop / 4 GiB
hard memory, no-swap and host-availability guards.
## Main advanced during the experiment
Main subsequently advanced to `a2d8b94dd50dab8d966239dd63ab84718aa8b4b4`,
adding native Fiddler SAZ parsing. Its web-network capture contract already
offers opt-in summary and retained capture pages, archive-member coordinates
and exact exposed encoded bytes. It decodes all records before ordinal
selection and rejects malformed/oversized inputs without partial success.
Measure real public SAZ artifacts using these controls before adding another
API or changing decoding or credential-redaction semantics. SAZ performance
remains unverified in this Flutter continuation.
The Flutter cohorts keep their original frozen runtime; subsequent integration
onto this newer main does not relabel earlier measurement receipts.
Main advanced again to `bb154d106` during CI, adding retained aioquic 1.5.0
qlog 0.3 JSON parsing and qlog views. The existing capture summary/page path
already applies. Qlog's trace-scoped STREAM interval unions and endpoint loss
declarations have separate semantics: they do not recover bodies, prove network
loss or establish PCAP correlation. Measure genuine supported recordings and
existing retained views before adding delivery or caching. Other qlog layouts
and qlog performance remain unverified in the Flutter experiment. Shared-view
integration is checked after rebasing; earlier runtime receipts remain pinned.
@@ -726,6 +726,54 @@ const workflows = {
},
"sharex.dll": inspectManagedTarget,
"sharex.helpers.dll": inspectManagedTarget,
"localsend-arm64.apk": async () => {
const input = {
path: values.path,
...(values.delivery === "summary" ? { detail: "summary" } : {}),
};
const definition = catalogDefinitions.get("inspect_dart_aot");
if (
definition === undefined ||
!new Ajv2020({ strict: false, validateFormats: false }).validate(
definition.inputSchema,
input,
)
)
throw new Error(
"Selected Dart AOT delivery is not advertised by this runtime",
);
const inspected = await call("inspect_dart_aot", input);
const result = normalized(inspected);
if (
values.delivery === "summary" &&
(result.kind !== "summary" ||
result.parent_operation !== "inspect_dart_aot")
)
throw new Error("Runtime returned no retained Dart AOT summary");
const report = values.delivery === "summary" ? result.summary : result;
const { package_uris, dart_uris, class_like_tokens, ...pool } =
report.string_pool;
return {
artifact_sha256: targetSha(inspected),
target: report.target,
abi: report.abi,
libapp: report.libapp,
string_pool:
values.delivery === "summary"
? pool
: {
...pool,
returned_counts: {
package_uris: package_uris.length,
dart_uris: dart_uris.length,
class_like_tokens: class_like_tokens.length,
},
},
coverage: report.coverage,
limitations: inspected.limitations,
evidence_ids: [inspected.evidence_id],
};
},
"openwrt.bin": async () => {
const info = await call("inspect_firmware_regions", { path: values.path });
return {
@@ -0,0 +1 @@
Statically inspect the shipped Flutter APK at {{artifact_path}} using only the registered REA inspect_dart_aot tool. Use its default ABI selection. Report target identity, chosen ABI, every libapp ELF/snapshot field exactly as reported including null, original string-pool coverage, all three counts ending in _at_least, printable_run_count, and returned_counts for package_uris, dart_uris and class_like_tokens. Compute returned_counts from the returned arrays if needed. Preserve original overall coverage and producer limitations exactly, including order. Counts ending in _at_least are lower bounds and class-like tokens are byte-pattern observations, not recovered typed classes. Do not return individual strings or infer Dart SDK versions, class semantics, runtime behavior or complete inventory. Final answer must be JSON with artifact_sha256, target, abi, libapp, string_pool, coverage, limitations, evidence_ids. Use actual response Evidence IDs. Do not execute the APK, use shell or host file tools, access the network, or call other agents. Stop when these facts are supported.
@@ -69,7 +69,7 @@ def scope_with_verified_counts(value, expected_scope, returned_counts):
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--domain', choices=['wasm', 'evm', 'android', 'managed', 'managed-nonempty', 'firmware', 'inventory', 'javascript', 'native', 'browser'], required=True)
parser.add_argument('--domain', choices=['wasm', 'evm', 'android', 'flutter-aot', 'managed', 'managed-nonempty', 'firmware', 'inventory', 'javascript', 'native', 'browser'], required=True)
parser.add_argument('--trial', type=Path, required=True)
parser.add_argument('--reference', type=Path)
parser.add_argument('--resource-log', type=Path, required=True)
@@ -133,6 +133,9 @@ def main():
for key, expected in {'artifact_bytes': n['artifact']['bytes'], 'bytecode_sha256': n['bytecode']['sha256'], 'bytecode_bytes': n['bytecode']['bytes'], 'functions': n['functions'], 'evidence_kind': n['evidence_kind'], 'discovery_completeness': n['discovery_completeness'], 'runtime_execution': n['runtime_execution'], 'bytecode_kind': n['bytecode']['kind'], 'hardfork': n['bytecode']['hardfork'], 'deployment_authenticity': n['bytecode']['deployment_authenticity']}.items():
check(key, answer.get(key), expected)
check('evm_original_limitations', answer.get('limitations'), n['limitations'])
elif domain == 'flutter-aot':
for key in ['target', 'abi', 'libapp', 'string_pool', 'coverage', 'limitations']:
check(key, answer.get(key), reference[key])
elif domain == 'android':
for key in ['package_name', 'version_name', 'version_code', 'matches']:
check(key, answer.get(key), reference[key])
@@ -0,0 +1,107 @@
# Windows runtime admission retry verification
Scope: [#2257](https://github.com/morluto/rea/issues/2257). Related initial
diagnosis: [#2266](https://github.com/morluto/rea/pull/2266).
## Revisions and real input
The baseline is `4f4f6cd7b5d7a400b90772a138d7b9f942c2a556`.
The candidate was developed from
`4773c152bc5f299fa682575bb8d1efea7587c7bc`; relevant runtime, native and
dependency-lock sources are identical between those two revisions.
These measurements precede integration of subsequent main changes.
The host ran Windows 11 10.0.22631.0, official Windows x64 Node 24.18.0,
and locked production dependencies. The real application input was the official
npm 11.16.0 launcher distribution's `bin` directory. REA inspected that source;
it did not execute the application as an analysis target. Runtime copies,
raw replies and test executables remain outside the checkout. No IDA or Ghidra
engine was involved in this native-runtime verification.
## Correctness and recovery
A test-owned directory handle requesting `FILE_ADD_FILE` produced an actual
kernel sharing violation (Win32 32) during native runtime-parent admission.
Releasing that handle restored admission. Before the fix, public CLI analysis
reported a permanent `unsupported_provider` failure with `retryable: false`.
The corrected CLI preserves `capability_unavailable` and the reason, with
`category: unavailable` and `retryable: true`.
Normal CLI analysis and post-conflict recovery produced the same canonical
normalized result before and after the correction: 535,733 compact JSON bytes,
SHA-256 `a24d3c2d9897cccc5ba70e9ee4dce03da88f033a939fe87457136fc5b3a3e2db`.
The complete successful CLI reply remained 537,124 bytes.
A single real SDK 2.3.1 stdio MCP connection first completed analysis, then
encountered the same kernel conflict after native authority caching, then
recovered successfully when the handle was released. Its final receipt passed
and found no residual runtime directories. The native producer supplies
`runtimeAllocation: "not-started"` only when parent admission failed before
directory creation. The adapter requires that fact and exact numeric codes
32/33; permission failures, opaque error text and unknown allocation state
remain nonretryable. Incomplete cleanup also prevents retry.
The native verifier additionally reproduces a real sharing conflict using an
owned runtime's DELETE lease, verifies the original error and allocation fact,
and confirms no child directory was allocated. This case runs unconditionally
in the Windows native verifier, without the optional process-boundary fixture.
The full verifier passed with 20 positive controls. Its optional independently
built process-boundary fixture was not supplied in this run.
The related focused suite passed 99 tests across seven files, including worker
ownership, cancellation, cleanup, error projection, loader behavior and adapter
boundaries. Source-map and WABT acquisition-failure tests use injected failures;
they establish disposition propagation, not real engine execution.
Thirty baseline native self-tests passed with no residual directories.
Win32 5 from #1701/#2196 was not reproduced on this host; these results do not
establish its cause or resolution.
## Delivery and resource measurements
One final same-connection MCP trial used one CPU per Node process, BelowNormal
priority, a 512 MiB client heap setting and a 768 MiB server heap setting.
Heap settings do not bound total process or family memory.
| Stage | Observed wall time | Serialized reply bytes |
| ---------------------------------- | -----------------: | ---------------------: |
| Connect | 11,351 ms | Not recorded |
| Complete tool discovery, 187 tools | 744 ms | 2,498,686 |
| Normal analysis | 12,887 ms | 1,126,797 |
| Sharing failure | 265 ms | 878 |
| Recovery on the same connection | 5,578 ms | 1,126,797 |
The earlier warm failure reply was 1,218 bytes. Successful reply sizes and the
catalogue digest were unchanged within the tested source comparison:
`7bdadddc909f4b2b093f0b3da9f79fafdac879c9d3c147938b8fbce1b52cd726`.
These are delivery bytes, not model tokens. Model-visible discovery handling,
actual model token usage and total model task cost were not measured.
A targeted process-generation sampler collected 343 observations over
35,630 ms. Its aggregate observed CPU time was a **lower bound** of 26,766 ms:
process exits can hide the final CPU tail. Its peak sampled working-set sum was
727,244,800 bytes (about 694 MiB). This is a sampled sum, can double-count shared
pages and is not an exact physical-memory peak. Only the test-owned Node and
directory-holder processes were included; the observer itself was excluded.
This is one controlled functional trial, with no paired CPU/memory baseline.
Cold/warm filesystem caches and host noise were not normalized. No speedup,
CPU reduction, memory reduction or model-token savings are claimed. The change
adds no analysis retry loop or cache and performs no additional engine calls.
Existing successful native authority caching remains intact; failed readiness
is retried by a later caller attempt. Retry becomes useful advice only after
the transient condition clears and cleanup permits another attempt.
## Integration replay
After rebasing onto main `a2d8b94dd`, runtime candidate
`2c7a09eaf3ffe26667b40081f1cf0fd2ce44a146` again passed the 99 related tests,
static and documentation gates, real Windows CLI and same-connection MCP
normal/conflict/recovery sequence. Both workflows found no residual directories;
the CLI normalized-result digest above still matched. The MCP success and error
reply sizes remained 1,126,797 and 878 bytes respectively. Upstream Android/SAZ
contract changes increased complete discovery to 2,517,904 bytes, digest
`d14588eab7404ad129907eb34a45a0db0d43233c4de829f76babd59723bed199`.
This later catalogue is not evidence of a delivery-size change caused by the
runtime-admission fix. Resource sampling above belongs to the earlier pinned
candidate; aggregate resources were not resampled for this integration replay.
+480
View File
@@ -0,0 +1,480 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Moe Ghoul>, 1 April 1990
Moe Ghoul, President of Vice
That's all there is to it!
+27 -13
View File
@@ -4,19 +4,20 @@ Start with [THIRD_PARTY_NOTICES.md](../THIRD_PARTY_NOTICES.md) for the distincti
between distributed material and separately obtained tools. These files retain
upstream texts; they do not change [REA's MIT license](../LICENSE).
| Files | Provenance and scope |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `npm-dependencies.txt` | Every package path in the root lockfile, with its exact version, declared license, scope, download URL, and integrity. Includes development and optional platform entries. |
| `npm-runtime-notices.txt` | Original license, copyright, and NOTICE texts collected from integrity-verified locked runtime npm archives across all platforms; also the license of Rolldown's generated runtime helpers. The archive manifest's name and version are checked. |
| `nativeaot-parser-MIT.txt` | Original Washi notice for derived NativeAOT parser code; source revision is recorded in the parser and the root notices. |
| `dotnet-runtime-MIT.txt` | Original .NET Foundation MIT text from the NativeAOT reference revision `a3b2d40328be0be3f8dd43f0e5cc925b8827b044`. |
| `ghidra-12.1.4-{LICENSE,NOTICE,DISCLAIMER}.txt` | Unchanged top-level documents from `Ghidra_12.1.4_build`. Ghidra is not bundled; these reference copies do not replace its component and GPL support-program notices. The US-government-specific disclaimer applies to Ghidra, not to REA. |
| `cfworker-MIT.txt`, `xterm-MIT.txt` | Original notices missing from their published runtime npm archives, recovered from the releases' upstream Git revisions. They are included in the corresponding runtime entries. |
| `Apache-2.0.txt`, `MIT-template.txt` | Standard license texts for explicitly documented upstream notice gaps. The MIT placeholders are not an attribution to an inferred author or year. |
| `MinGW-w64-runtime.txt` | Upstream's combined runtime copyright and license notices, snapshot from v12.0.0, for the statically linked Windows addon. This is a notice snapshot, not a pin of the compiler used in release CI. |
| `GPL-3.0.txt`, `GCC-Runtime-Library-Exception-3.1.txt` | Unchanged GPLv3 and GCC runtime exception texts from GCC 14.2.0. The exception permits eligible compiled combinations under its conditions; the runtime keeps its own license. This snapshot does not assert that every release uses GCC 14.2.0. |
| `Node-22.19.0-LICENSE.txt` | The original Node 22.19.0 license and third-party notices. The Windows addon uses Node-API headers from that release; the complete Node runtime and all components listed in this reference document are not bundled. |
| `upstream-sources.json` | Source URLs and SHA-256 digests for the new unchanged reference and supplemental texts. These digests identify the preserved local texts. |
| Files | Provenance and scope |
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `npm-dependencies.txt` | Every package path in the root lockfile, with its exact version, declared license, scope, download URL, and integrity. Includes development and optional platform entries. |
| `npm-runtime-notices.txt` | Original license, copyright, and NOTICE texts collected from integrity-verified locked runtime npm archives across all platforms; also the license of Rolldown's generated runtime helpers. The archive manifest's name and version are checked. |
| `nativeaot-parser-MIT.txt` | Original Washi notice for derived NativeAOT parser code; source revision is recorded in the parser and the root notices. |
| `dotnet-runtime-MIT.txt` | Original .NET Foundation MIT text from the NativeAOT reference revision `a3b2d40328be0be3f8dd43f0e5cc925b8827b044`. |
| `ghidra-12.1.4-{LICENSE,NOTICE,DISCLAIMER}.txt` | Unchanged top-level documents from `Ghidra_12.1.4_build`. Ghidra is not bundled; these reference copies do not replace its component and GPL support-program notices. The US-government-specific disclaimer applies to Ghidra, not to REA. |
| `cfworker-MIT.txt`, `xterm-MIT.txt` | Original notices missing from their published runtime npm archives, recovered from the releases' upstream Git revisions. They are included in the corresponding runtime entries. |
| `Apache-2.0.txt`, `MIT-template.txt` | Standard license texts for explicitly documented upstream notice gaps. The MIT placeholders are not an attribution to an inferred author or year. |
| `frida-17.23.2-COPYING.txt`, `LGPL-2.0.txt` | Unchanged licensing supplements for the optional Frida dependency: tagged Frida wxWindows notice and GNU Library GPL v2 text. The npm archive and tagged Node binding omit a standalone license/copyright document; these texts do not recover binding or prebuild-component attribution. |
| `MinGW-w64-runtime.txt` | Upstream's combined runtime copyright and license notices, snapshot from v12.0.0, for the statically linked Windows addon. This is a notice snapshot, not a pin of the compiler used in release CI. |
| `GPL-3.0.txt`, `GCC-Runtime-Library-Exception-3.1.txt` | Unchanged GPLv3 and GCC runtime exception texts from GCC 14.2.0. The exception permits eligible compiled combinations under its conditions; the runtime keeps its own license. This snapshot does not assert that every release uses GCC 14.2.0. |
| `Node-22.19.0-LICENSE.txt` | The original Node 22.19.0 license and third-party notices. The Windows addon uses Node-API headers from that release; the complete Node runtime and all components listed in this reference document are not bundled. |
| `upstream-sources.json` | Source URLs and SHA-256 digests for the new unchanged reference and supplemental texts. These digests identify the preserved local texts. |
Additional preserved originals live at
[evmole/LICENSE](../third_party/evmole/LICENSE),
@@ -40,6 +41,10 @@ only license and author metadata: their missing original copyright documents
remain explicitly identified in the runtime texts. Do not describe those
entries as complete recovered attribution.
`frida@17.23.2` also lacks an original standalone notice in its npm archive and
tagged Node source. Its declared license and the preserved licensing supplements
are recorded explicitly without inferring a copyright holder or year.
These records do not establish the legal accuracy of upstream metadata or
prove that every upstream source-file attribution has been supplied in an
archive. Review and refresh them when dependencies change; compare reference
@@ -52,3 +57,12 @@ runtime/component notices with the retained snapshots and update them if they
differ. Do not assume that a compiler change leaves redistribution requirements
unchanged. Preserve applicable originals with any additionally bundled engine;
top-level reference copies alone may not cover its entire distribution.
Generate the exact locked inventory with `npm run licenses:generate`. After
refreshing verified runtime notices, update their header fingerprint to the
generator's reported `runtime_dependency_fingerprint`, then run
`npm run licenses:check`; `docs:check` also runs this check. It compares the
inventory, runtime package identities,
license declarations, archive URLs/integrity, runtime dependency fingerprint,
and preserved reference digests. It does not verify legal completeness or
replace inspection of original upstream notices.
+50
View File
@@ -0,0 +1,50 @@
wxWindows Library Licence, Version 3.1
======================================
Copyright (c) 1998-2005 Julian Smart, Robert Roebling et al
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
WXWINDOWS LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
Floor, Boston, MA 02110-1301 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of the
library as licenced under the wxWindows Library Licence, applying either
version 3.1 of the Licence, or (at your option) any later version of the
Licence as published by the copyright holders of version 3.1 of the Licence
document.
2. The exception is that you may use, copy, link, modify and distribute
under your own terms, binary object code versions of works based on the
Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not apply
to the code that you add in this way. To avoid misleading anyone as to the
status of such modified files, you must delete this exception notice from
such code and/or adjust the licensing conditions notice accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications. If
you do not wish that, you must delete the exception notice from such code
and/or adjust the licensing conditions notice accordingly.
+127 -2
View File
@@ -2,7 +2,7 @@ REA npm dependency inventory
Prepared from the root package-lock.json; refresh this inventory when locked dependencies change.
License identifiers are upstream lockfile declarations, not a legal assessment.
Runtime includes transitive and optional platform packages; development includes build, test and website tooling.
Locked package entries: 561; runtime: 148.
Locked package entries: 586; runtime: 174.
Full runtime copyright/license/NOTICE texts: npm-runtime-notices.txt.
@algolia/abtesting@1.25.0 | development | MIT
@@ -1375,11 +1375,31 @@ base64-js@1.5.1 | runtime | MIT
Package: https://www.npmjs.com/package/base64-js/v/1.5.1
Archive: https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz
Integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
bindings@1.5.0 | runtime, optional | MIT
Lockfile path: node_modules/bindings
Package: https://www.npmjs.com/package/bindings/v/1.5.0
Archive: https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz
Integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
birpc@2.9.0 | development | MIT
Lockfile path: node_modules/birpc
Package: https://www.npmjs.com/package/birpc/v/2.9.0
Archive: https://registry.npmjs.org/birpc/-/birpc-2.9.0.tgz
Integrity: sha512-KrayHS5pBi69Xi9JmvoqrIgYGDkD6mcSe/i6YKi3w5kekCLzrX4+nawcXqrj2tIp50Kw/mT/s3p+GVK0A0sKxw==
bl@4.1.0 | runtime, optional | MIT
Lockfile path: node_modules/bl
Package: https://www.npmjs.com/package/bl/v/4.1.0
Archive: https://registry.npmjs.org/bl/-/bl-4.1.0.tgz
Integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==
buffer@5.7.1 | runtime, optional | MIT
Lockfile path: node_modules/bl/node_modules/buffer
Package: https://www.npmjs.com/package/buffer/v/5.7.1
Archive: https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz
Integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==
readable-stream@3.6.2 | runtime, optional | MIT
Lockfile path: node_modules/bl/node_modules/readable-stream
Package: https://www.npmjs.com/package/readable-stream/v/3.6.2
Archive: https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz
Integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
brace-expansion@5.0.12 | runtime | MIT
Lockfile path: node_modules/brace-expansion
Package: https://www.npmjs.com/package/brace-expansion/v/5.0.12
@@ -1430,6 +1450,11 @@ character-entities-legacy@3.0.0 | development | MIT
Package: https://www.npmjs.com/package/character-entities-legacy/v/3.0.0
Archive: https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz
Integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==
chownr@1.1.4 | runtime, optional | ISC
Lockfile path: node_modules/chownr
Package: https://www.npmjs.com/package/chownr/v/1.1.4
Archive: https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz
Integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==
clean-git-ref@2.0.1 | runtime | Apache-2.0
Lockfile path: node_modules/clean-git-ref
Package: https://www.npmjs.com/package/clean-git-ref/v/2.0.1
@@ -1485,6 +1510,11 @@ decompress-response@6.0.0 | runtime | MIT
Package: https://www.npmjs.com/package/decompress-response/v/6.0.0
Archive: https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz
Integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==
deep-extend@0.6.0 | runtime, optional | MIT
Lockfile path: node_modules/deep-extend
Package: https://www.npmjs.com/package/deep-extend/v/0.6.0
Archive: https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz
Integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
define-data-property@1.1.4 | runtime | MIT
Lockfile path: node_modules/define-data-property
Package: https://www.npmjs.com/package/define-data-property/v/1.1.4
@@ -1495,7 +1525,7 @@ dequal@2.0.3 | development | MIT
Package: https://www.npmjs.com/package/dequal/v/2.0.3
Archive: https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz
Integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==
detect-libc@2.1.2 | development | Apache-2.0
detect-libc@2.1.2 | runtime | Apache-2.0
Lockfile path: node_modules/detect-libc
Package: https://www.npmjs.com/package/detect-libc/v/2.1.2
Archive: https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz
@@ -1530,6 +1560,11 @@ emoji-regex-xs@1.0.0 | development | MIT
Package: https://www.npmjs.com/package/emoji-regex-xs/v/1.0.0
Archive: https://registry.npmjs.org/emoji-regex-xs/-/emoji-regex-xs-1.0.0.tgz
Integrity: sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==
end-of-stream@1.4.5 | runtime, optional | MIT
Lockfile path: node_modules/end-of-stream
Package: https://www.npmjs.com/package/end-of-stream/v/1.4.5
Archive: https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz
Integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==
entities@7.0.1 | development | BSD-2-Clause
Lockfile path: node_modules/entities
Package: https://www.npmjs.com/package/entities/v/7.0.1
@@ -1595,6 +1630,11 @@ evmole@0.9.3 | runtime | MIT
Package: https://www.npmjs.com/package/evmole/v/0.9.3
Archive: https://registry.npmjs.org/evmole/-/evmole-0.9.3.tgz
Integrity: sha512-UhO5HMAoEPCupSxvBJPlm/L0Qk/KVJ/OJo3r4EyhXADIEHqU5aTkAzsBfzk4lXGjqxVnaYbh1GPSmZtmSHFnQQ==
expand-template@2.0.3 | runtime, optional | (MIT OR WTFPL)
Lockfile path: node_modules/expand-template
Package: https://www.npmjs.com/package/expand-template/v/2.0.3
Archive: https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz
Integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==
expect-type@1.4.0 | development | Apache-2.0
Lockfile path: node_modules/expect-type
Package: https://www.npmjs.com/package/expect-type/v/1.4.0
@@ -1640,6 +1680,11 @@ fdir@6.5.0 | development | MIT
Package: https://www.npmjs.com/package/fdir/v/6.5.0
Archive: https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz
Integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==
file-uri-to-path@1.0.0 | runtime, optional | MIT
Lockfile path: node_modules/file-uri-to-path
Package: https://www.npmjs.com/package/file-uri-to-path/v/1.0.0
Archive: https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz
Integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
focus-trap@7.8.0 | development | MIT
Lockfile path: node_modules/focus-trap
Package: https://www.npmjs.com/package/focus-trap/v/7.8.0
@@ -1655,6 +1700,16 @@ formatly@0.7.1 | development | MIT
Package: https://www.npmjs.com/package/formatly/v/0.7.1
Archive: https://registry.npmjs.org/formatly/-/formatly-0.7.1.tgz
Integrity: sha512-ESuCEJE0SGgabl9q+zABI8LhJDmF+8nhpuqDzuM48HfJ9QTD5o6PqFJDFZY7w6f8xsh5lixuj5nJsQNvYOWvKQ==
frida@17.23.2 | runtime, optional | LGPL-2.0 WITH WxWindows-exception-3.1
Lockfile path: node_modules/frida
Package: https://www.npmjs.com/package/frida/v/17.23.2
Archive: https://registry.npmjs.org/frida/-/frida-17.23.2.tgz
Integrity: sha512-gRCmmTUFdEILyHRN1b66erRoXafwsfWTqXyoBBqkSCFX0Ue7Jhvs/KhA3JO0XrgITNlPd91QAGsFvWzh0mhVgg==
fs-constants@1.0.0 | runtime, optional | MIT
Lockfile path: node_modules/fs-constants
Package: https://www.npmjs.com/package/fs-constants/v/1.0.0
Archive: https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz
Integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
fsevents@2.3.3 | development, optional | MIT
Lockfile path: node_modules/fsevents
Package: https://www.npmjs.com/package/fsevents/v/2.3.3
@@ -1685,6 +1740,11 @@ get-tsconfig@4.14.3 | development | MIT
Package: https://www.npmjs.com/package/get-tsconfig/v/4.14.3
Archive: https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.3.tgz
Integrity: sha512-++QEw4DIY7WGoukz+/+A/8dGYPT9l9yIadnmSgZ8Rjr3YVSVDipQSO9CdnJo9ePqFqUUqh+wk9uIaoiAwsiPkA==
github-from-package@0.0.0 | runtime, optional | MIT
Lockfile path: node_modules/github-from-package
Package: https://www.npmjs.com/package/github-from-package/v/0.0.0
Archive: https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz
Integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==
glob@13.0.6 | runtime | BlueOak-1.0.0
Lockfile path: node_modules/glob
Package: https://www.npmjs.com/package/glob/v/13.0.6
@@ -1775,6 +1835,11 @@ inherits@2.0.4 | runtime | ISC
Package: https://www.npmjs.com/package/inherits/v/2.0.4
Archive: https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz
Integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
ini@1.3.8 | runtime, optional | ISC
Lockfile path: node_modules/ini
Package: https://www.npmjs.com/package/ini/v/1.3.8
Archive: https://registry.npmjs.org/ini/-/ini-1.3.8.tgz
Integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
is-callable@1.2.7 | runtime | MIT
Lockfile path: node_modules/is-callable
Package: https://www.npmjs.com/package/is-callable/v/1.2.7
@@ -2080,11 +2145,26 @@ mitt@3.0.1 | development | MIT
Package: https://www.npmjs.com/package/mitt/v/3.0.1
Archive: https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz
Integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==
mkdirp-classic@0.5.3 | runtime, optional | MIT
Lockfile path: node_modules/mkdirp-classic
Package: https://www.npmjs.com/package/mkdirp-classic/v/0.5.3
Archive: https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz
Integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==
nanoid@3.3.20 | development | MIT
Lockfile path: node_modules/nanoid
Package: https://www.npmjs.com/package/nanoid/v/3.3.20
Archive: https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz
Integrity: sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==
napi-build-utils@2.0.0 | runtime, optional | MIT
Lockfile path: node_modules/napi-build-utils
Package: https://www.npmjs.com/package/napi-build-utils/v/2.0.0
Archive: https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz
Integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==
node-abi@3.98.0 | runtime, optional | MIT
Lockfile path: node_modules/node-abi
Package: https://www.npmjs.com/package/node-abi/v/3.98.0
Archive: https://registry.npmjs.org/node-abi/-/node-abi-3.98.0.tgz
Integrity: sha512-Llh8noNw7s15m+rmIrZnZQbe4gLyasL9loT74rC92PkmwWKeEedKvc7o6pjp8B3MhrYT/Cl846NOYZbz1wmddw==
obug@2.2.1 | development | MIT
Lockfile path: node_modules/obug
Package: https://www.npmjs.com/package/obug/v/2.2.1
@@ -2230,6 +2310,11 @@ preact@10.29.8 | development | MIT
Package: https://www.npmjs.com/package/preact/v/10.29.8
Archive: https://registry.npmjs.org/preact/-/preact-10.29.8.tgz
Integrity: sha512-ej2aVZ+vZ8WO7tvlQWRM9N63A0KzF9q4mWJfDUHgYaIofWY9hu74QdnQrjoPMmZi2/nZ5gN0bJCQF49xQqx09Q==
prebuild-install@7.1.3 | runtime, optional | MIT
Lockfile path: node_modules/prebuild-install
Package: https://www.npmjs.com/package/prebuild-install/v/7.1.3
Archive: https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz
Integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==
process@0.11.10 | runtime | MIT
Lockfile path: node_modules/process
Package: https://www.npmjs.com/package/process/v/0.11.10
@@ -2245,6 +2330,11 @@ property-information@7.2.0 | development | MIT
Package: https://www.npmjs.com/package/property-information/v/7.2.0
Archive: https://registry.npmjs.org/property-information/-/property-information-7.2.0.tgz
Integrity: sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==
pump@3.0.4 | runtime, optional | MIT
Lockfile path: node_modules/pump
Package: https://www.npmjs.com/package/pump/v/3.0.4
Archive: https://registry.npmjs.org/pump/-/pump-3.0.4.tgz
Integrity: sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==
pure-rand@8.4.2 | development | MIT
Lockfile path: node_modules/pure-rand
Package: https://www.npmjs.com/package/pure-rand/v/8.4.2
@@ -2255,6 +2345,16 @@ quick-format-unescaped@4.0.4 | runtime | MIT
Package: https://www.npmjs.com/package/quick-format-unescaped/v/4.0.4
Archive: https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz
Integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==
rc@1.2.8 | runtime, optional | (BSD-2-Clause OR MIT OR Apache-2.0)
Lockfile path: node_modules/rc
Package: https://www.npmjs.com/package/rc/v/1.2.8
Archive: https://registry.npmjs.org/rc/-/rc-1.2.8.tgz
Integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
strip-json-comments@2.0.1 | runtime, optional | MIT
Lockfile path: node_modules/rc/node_modules/strip-json-comments
Package: https://www.npmjs.com/package/strip-json-comments/v/2.0.1
Archive: https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz
Integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==
readable-stream@4.7.0 | runtime | MIT
Lockfile path: node_modules/readable-stream
Package: https://www.npmjs.com/package/readable-stream/v/4.7.0
@@ -2465,6 +2565,21 @@ tabbable@6.5.0 | development | MIT
Package: https://www.npmjs.com/package/tabbable/v/6.5.0
Archive: https://registry.npmjs.org/tabbable/-/tabbable-6.5.0.tgz
Integrity: sha512-wieBHXygIm7OyQOu5hQlkk62/WyCFYGlWg7L6/ZCUZwx0o398Zkn4pVmMyfYhfMG8kGrj/Krt8eIk6UKC6VzwA==
tar-fs@2.1.5 | runtime, optional | MIT
Lockfile path: node_modules/tar-fs
Package: https://www.npmjs.com/package/tar-fs/v/2.1.5
Archive: https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.5.tgz
Integrity: sha512-OboTd8mmMhZDNPV+UjQcK9yKAatXu2aJ+r1w4im1Otd4M4fl2hwvdoXUxIYHFTHWK/3y3FarBP70v3vwmGlOxw==
tar-stream@2.2.0 | runtime, optional | MIT
Lockfile path: node_modules/tar-stream
Package: https://www.npmjs.com/package/tar-stream/v/2.2.0
Archive: https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz
Integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==
readable-stream@3.6.2 | runtime, optional | MIT
Lockfile path: node_modules/tar-stream/node_modules/readable-stream
Package: https://www.npmjs.com/package/readable-stream/v/3.6.2
Archive: https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz
Integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
thread-stream@4.2.0 | runtime | MIT
Lockfile path: node_modules/thread-stream
Package: https://www.npmjs.com/package/thread-stream/v/4.2.0
@@ -2515,6 +2630,11 @@ tslib@2.8.1 | development, optional | 0BSD
Package: https://www.npmjs.com/package/tslib/v/2.8.1
Archive: https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz
Integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
tunnel-agent@0.6.0 | runtime, optional | Apache-2.0
Lockfile path: node_modules/tunnel-agent
Package: https://www.npmjs.com/package/tunnel-agent/v/0.6.0
Archive: https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz
Integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==
turbo@2.11.7 | development | MIT
Lockfile path: node_modules/turbo
Package: https://www.npmjs.com/package/turbo/v/2.11.7
@@ -2570,6 +2690,11 @@ unist-util-visit-parents@6.0.2 | development | MIT
Package: https://www.npmjs.com/package/unist-util-visit-parents/v/6.0.2
Archive: https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz
Integrity: sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==
util-deprecate@1.0.2 | runtime, optional | MIT
Lockfile path: node_modules/util-deprecate
Package: https://www.npmjs.com/package/util-deprecate/v/1.0.2
Archive: https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz
Integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
vfile@6.0.3 | development | MIT
Lockfile path: node_modules/vfile
Package: https://www.npmjs.com/package/vfile/v/6.0.3
File diff suppressed because it is too large Load Diff
+10
View File
@@ -58,5 +58,15 @@
"file": "licenses/Node-22.19.0-LICENSE.txt",
"source": "https://raw.githubusercontent.com/nodejs/node/v22.19.0/LICENSE",
"sha256": "e991d81497a85bb24fc6bffae0a3637a6accd6c6bc5ce1f2c5698bd555cf9d49"
},
{
"file": "licenses/frida-17.23.2-COPYING.txt",
"source": "https://raw.githubusercontent.com/frida/frida/9adf8ed33ab6f1122b17399ee96dcbe101b941c9/COPYING",
"sha256": "5ea1544b51a28bc823b03159190d4108f9fb4f4ef912389f5137c6d295e175b2"
},
{
"file": "licenses/LGPL-2.0.txt",
"source": "https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt",
"sha256": "cc535c21133c895b56b374c8a1dc1eb948d99003ed2b47372069456b62f42b24"
}
]
+11
View File
@@ -85,6 +85,17 @@ Windows failures retain their constraint, requested coordinate, Win32 code,
and system message. Unsupported filesystems and reparse paths are distinct
from OS access denial and missing packaged controls.
A failed runtime-parent admission additionally reports
`runtimeAllocation: "not-started"`: no runtime directory was created. The
Windows adapter uses that fact with numeric sharing/lock codes 32/33 to retain
a retryable private-runtime failure, including after successful native
authority caching. Missing allocation evidence, other codes, and opaque error
text do not establish a safe retry. Analysis errors propagate the producer's
retry disposition through JavaScript, source-map and WABT workflows; transient
failures report `category: unavailable` and retain the original reason.
Incomplete cleanup blocks an operation retry until its owned resources settle.
REA adds no automatic retry loop or new analysis cache for this behavior.
Ordinary drive-absolute paths accept backslashes, forward slashes, or mixed
separators. File identity retains the original requested spelling. Separator
translation does not resolve dot components, repeated separators, or extend
+2
View File
@@ -87,6 +87,8 @@ napi_value failureValue(napi_env env, const Failure& failure) {
set(env, error, "requestedPath", string(env, failure.path));
set(env, error, "win32Code", number(env, failure.win32));
set(env, error, "win32Message", string(env, detail));
if (failure.runtimeDirectoryUnallocated)
set(env, error, "runtimeAllocation", string(env, std::string("not-started")));
return error;
}
+2
View File
@@ -33,6 +33,8 @@ struct Failure : std::runtime_error {
DWORD win32;
std::wstring path;
std::string constraint;
// Affirmative proof for a failed runtime-parent admission; omission is unknown.
bool runtimeDirectoryUnallocated = false;
Failure(std::string constraint, std::wstring path = L"", DWORD code = GetLastError())
: std::runtime_error(constraint), win32(code), path(std::move(path)),
constraint(std::move(constraint)) {}
+6 -1
View File
@@ -212,7 +212,12 @@ static void verifyPrivate(HANDLE handle, const std::wstring& path, bool root) {
}
std::unique_ptr<Runtime> createRuntime(const std::wstring& parentPath, const std::wstring& prefix) {
auto parent = openFile(parentPath, 0, true);
std::unique_ptr<File> parent;
try { parent = openFile(parentPath, 0, true); }
catch (Failure& failure) {
failure.runtimeDirectoryUnallocated = true;
throw;
}
require(!prefix.empty() && prefix.find_first_of(L"\\/:\"<>|?*") == std::wstring::npos,
"Runtime prefix must be one filename component", parentPath, ERROR_INVALID_PARAMETER);
std::array<unsigned char, 16> random;
+4 -2
View File
@@ -236,7 +236,7 @@
"docs:preview": "vitepress preview docs",
"docs:generate": "node scripts/check-dependency-install.mjs && node scripts/run-exclusive.mjs artifacts npm run docs:prepare",
"docs:check": "node scripts/check-dependency-install.mjs && node scripts/run-exclusive.mjs artifacts turbo run docs:check:built && npm run test:local -- tests/conformance/readmeConsistency.test.ts",
"docs:check:built": "node scripts/generate-package-metadata.mjs --check && node scripts/generate-skill-metadata.mjs --check && node scripts/generate-product-catalog.mjs --check && node scripts/generate-completion-ledger.mjs --check && node scripts/check-doc-facts.mjs && node scripts/generate-error-schema.mjs --check",
"docs:check:built": "node scripts/generate-package-metadata.mjs --check && node scripts/generate-skill-metadata.mjs --check && node scripts/generate-product-catalog.mjs --check && node scripts/generate-completion-ledger.mjs --check && node scripts/check-doc-facts.mjs && node scripts/generate-error-schema.mjs --check && npm run licenses:check",
"docs:error-schema": "node scripts/check-dependency-install.mjs && node scripts/run-exclusive.mjs artifacts turbo run artifacts:error-schema",
"prepack": "node scripts/prepack.mjs",
"prepare": "node scripts/prepare.mjs",
@@ -279,7 +279,9 @@
"test:prepare": "node scripts/check-dependency-install.mjs && node scripts/run-exclusive.mjs artifacts turbo run artifacts:mcp-catalog artifacts:product-catalog artifacts:managed-evidence",
"evidence:check:built": "node scripts/generate-completion-ledger.mjs --check",
"docs:prepare": "node scripts/generate-package-metadata.mjs && turbo run artifacts:product-catalog artifacts:managed-evidence artifacts:error-schema",
"verify:web:qlog": "npm run build:cached && node scripts/verify-qlog-captures.mjs"
"verify:web:qlog": "npm run build:cached && node scripts/verify-qlog-captures.mjs",
"licenses:generate": "node scripts/generate-third-party-inventory.mjs",
"licenses:check": "node scripts/generate-third-party-inventory.mjs --check"
},
"lint-staged": {
"*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}": [
+120
View File
@@ -0,0 +1,120 @@
import { createHash } from "node:crypto";
import { readFile } from "node:fs/promises";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { ensureGeneratedFile } from "./lib/generated-file.mjs";
const arguments_ = new Set(process.argv.slice(2));
for (const argument of arguments_)
if (argument !== "--check")
throw new Error(`Unknown inventory option: ${argument}`);
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
const lock = JSON.parse(
await readFile(join(root, "package-lock.json"), "utf8"),
);
const entries = Object.entries(lock.packages)
.filter(([path]) => path !== "")
.map(([path, record]) => ({
path,
name: record.name ?? path.slice(path.lastIndexOf("node_modules/") + 13),
version: record.version,
license: record.license ?? "UNDECLARED",
resolved: record.resolved,
integrity: record.integrity,
dev: record.dev === true,
optional: record.optional === true,
}))
.sort((left, right) =>
left.path < right.path ? -1 : left.path > right.path ? 1 : 0,
);
for (const entry of entries)
for (const field of ["name", "version", "resolved", "integrity"])
if (typeof entry[field] !== "string" || entry[field].length === 0)
throw new Error(`Missing locked ${field}: ${entry.path}`);
const runtime = entries.filter(({ dev }) => !dev);
const runtimeFingerprint = createHash("sha256")
.update(JSON.stringify(runtime))
.digest("hex");
const source = [
"REA npm dependency inventory",
"Prepared from the root package-lock.json; refresh this inventory when locked dependencies change.",
"License identifiers are upstream lockfile declarations, not a legal assessment.",
"Runtime includes transitive and optional platform packages; development includes build, test and website tooling.",
`Locked package entries: ${entries.length}; runtime: ${runtime.length}.`,
"Full runtime copyright/license/NOTICE texts: npm-runtime-notices.txt.",
"",
...entries.flatMap((entry) => [
`${entry.name}@${entry.version} | ${entry.dev ? "development" : "runtime"}${entry.optional ? ", optional" : ""} | ${entry.license}`,
` Lockfile path: ${entry.path}`,
` Package: https://www.npmjs.com/package/${entry.name}/v/${entry.version}`,
` Archive: ${entry.resolved}`,
` Integrity: ${entry.integrity}`,
]),
"",
].join("\n");
await ensureGeneratedFile({
path: join(root, "licenses/npm-dependencies.txt"),
source,
check: arguments_.has("--check"),
generateCommand: "npm run licenses:generate",
});
if (arguments_.has("--check")) {
const notices = await readFile(
join(root, "licenses/npm-runtime-notices.txt"),
"utf8",
);
const headings = [...notices.matchAll(/^===== (.+) =====$/gmu)];
const sections = new Map();
for (const [index, heading] of headings.entries()) {
if (sections.has(heading[1]))
throw new Error(`Duplicate runtime notice: ${heading[1]}`);
sections.set(
heading[1],
notices.slice(
heading.index + heading[0].length + 1,
headings[index + 1]?.index,
),
);
}
for (const entry of runtime) {
const identity = `${entry.name}@${entry.version}`;
const section = sections.get(identity);
if (section === undefined)
throw new Error(`Missing runtime notice: ${identity}`);
const metadata = [
`Declared license: ${entry.license}`,
`Archive: ${entry.resolved}`,
`Integrity: ${entry.integrity}`,
"",
].join("\n");
if (!section.startsWith(metadata))
throw new Error(`Runtime notice metadata differs for ${identity}`);
}
if (
!notices
.slice(0, headings[0]?.index)
.includes(
`Runtime dependency fingerprint (SHA-256): ${runtimeFingerprint}\n`,
)
)
throw new Error(
`Runtime notice fingerprint differs; refresh verified notices for ${runtimeFingerprint}`,
);
const references = JSON.parse(
await readFile(join(root, "licenses/upstream-sources.json"), "utf8"),
);
for (const reference of references) {
const bytes = await readFile(join(root, reference.file));
if (createHash("sha256").update(bytes).digest("hex") !== reference.sha256)
throw new Error(`Preserved notice digest differs: ${reference.file}`);
}
}
console.log(
JSON.stringify({
locked_packages: entries.length,
runtime_packages: runtime.length,
runtime_dependency_fingerprint: runtimeFingerprint,
}),
);
+33
View File
@@ -11,6 +11,7 @@ import {
mkdtemp,
readFile,
rename,
readdir,
rm,
symlink,
writeFile,
@@ -37,6 +38,14 @@ const { WindowsPrivateRuntime, windowsPrivateRuntime } = await import(
const { ghidraSessionRoot } = await import(
pathToFileURL(join(packageRoot, "dist/ghidra/GhidraSessionRoot.js"))
);
const { PrivateRuntimeRoot } = await import(
pathToFileURL(join(packageRoot, "dist/process/PrivateRuntimeRoot.js"))
);
const { PrivateRuntimeRootUnavailableError } = await import(
pathToFileURL(
join(packageRoot, "dist/process/PrivateRuntimeRootUnavailableError.js"),
)
);
const workspace = await mkdtemp(join(tmpdir(), "rea-native-conformance-"));
const environment = Object.entries(process.env)
.filter(([, value]) => value !== undefined)
@@ -140,6 +149,30 @@ process.stdout.write(JSON.stringify({executable:basename(process.execPath),abiVe
])
assert.throws(() => native.call("open", [rejected]));
report.controls.ordinaryDriveSeparatorsAndRequestedIdentity = true;
// An owned runtime's DELETE lease conflicts with a fresh parent admission.
// This produces a genuine sharing failure after successful authority caching,
// without another executable, and proves that no child runtime was created.
const sharingParent = WindowsPrivateRuntime.create(
workspace,
"rea-sharing-parent-",
);
try {
await assert.rejects(
PrivateRuntimeRoot.create({ parent: sharingParent.observation.path }),
(failure) => {
assert.ok(failure instanceof PrivateRuntimeRootUnavailableError);
assert.equal(failure.retryable, true);
assert.ok(failure.cause instanceof Error);
assert.equal(failure.cause.win32Code, 32);
assert.equal(failure.cause.runtimeAllocation, "not-started");
return true;
},
);
assert.deepEqual(await readdir(sharingParent.observation.path), []);
report.controls.transientRuntimeAdmissionBeforeAllocation = true;
} finally {
await sharingParent.close();
}
const driveRoot = parse(workspace).root;
const runtimeParent = ghidraSessionRoot({
base: join(driveRoot, ".Tmp", "scratch"),
+44 -1
View File
@@ -153,10 +153,36 @@ try {
});
try {
await client.connect(transport, { timeout: 30_000 });
await client.listTools();
const opened = await client.callTool(
{ name: "open_binary", arguments: { path } },
{ timeout: 150_000 },
);
assert.notEqual(opened.isError, true, JSON.stringify(opened));
assert.equal(opened.structuredContent?.result?.format, "hap");
assert.equal(opened.structuredContent?.result?.sha256, fixture.sha256);
const status = await client.callTool(
{ name: "binary_session", arguments: {} },
{ timeout: 150_000 },
);
assert.notEqual(status.isError, true, JSON.stringify(status));
assert.equal(status.structuredContent?.result?.open, true);
assert.equal(status.structuredContent?.result?.format, "hap");
const inspected = await client.callTool(
{ name: "inspect_artifact", arguments: {} },
{ timeout: 150_000 },
);
assert.notEqual(inspected.isError, true, JSON.stringify(inspected));
const mcpInspection = parseEvidence(inspected.structuredContent);
assert.deepEqual(
mcpInspection.normalized_result,
inspection.normalized_result,
);
console.log("PASS MCP open/status/inspect_artifact parity");
const response = await client.callTool(
{
name: "project_harmony_application_graph",
arguments: { inventory_evidence: [inspection] },
arguments: { inventory_evidence: [mcpInspection] },
},
{ timeout: 150_000 },
);
@@ -168,6 +194,23 @@ try {
projectionEvidence.normalized_result,
);
console.log("PASS MCP/CLI parity project_harmony_application_graph");
const closed = await client.callTool(
{ name: "close_binary", arguments: {} },
{ timeout: 150_000 },
);
assert.notEqual(closed.isError, true, JSON.stringify(closed));
const empty = await client.callTool(
{ name: "binary_session", arguments: {} },
{ timeout: 150_000 },
);
assert.notEqual(empty.isError, true, JSON.stringify(empty));
assert.equal(empty.structuredContent?.result?.open, false);
assert.equal(
await hashFile(path),
fixture.sha256,
"MCP workflow must preserve source bytes",
);
console.log("PASS MCP close and unchanged source bytes");
} catch (cause) {
process.stderr.write(stderr);
throw cause;
@@ -0,0 +1,40 @@
import type { ExecutionOptions } from "../AnalysisProvider.js";
import type { FlutterBuildAnalysisService } from "./FlutterBuildAnalysisService.js";
import {
requireAnalysisViewRetention,
summarizeRetainedAnalysis,
type AnalysisViewRetention,
} from "../analysisView/AnalysisViewService.js";
import type { AnalysisError } from "../../domain/analysisErrorBase.js";
import { AnalysisCancelledError } from "../../domain/analysisErrorCore.js";
import { dartAotInspectionInputSchema } from "../../domain/flutter/flutterBuildAnalysis.js";
import type { Evidence } from "../../domain/evidence.js";
import { analysisInputErrorFromIssues } from "../../domain/inputIssueProjection.js";
import { err, type Result } from "../../domain/result.js";
/** Keep the caller's ABI choice and complete analysis; select only its delivery. */
export const inspectDartAot = async (
service: FlutterBuildAnalysisService,
rawInput: unknown,
retention: AnalysisViewRetention,
options?: ExecutionOptions,
): Promise<Result<Evidence, AnalysisError>> => {
const operation = "inspect_dart_aot";
if (options?.signal?.aborted === true)
return err(new AnalysisCancelledError(operation));
const parsed = dartAotInspectionInputSchema.safeParse(rawInput);
if (!parsed.success)
return err(
analysisInputErrorFromIssues(operation, parsed.error.issues, rawInput, {
cause: parsed.error,
}),
);
if (parsed.data.detail === "summary") {
const ready = requireAnalysisViewRetention(operation, retention);
if (!ready.ok) return ready;
}
const { detail, ...providerInput } = parsed.data;
const executed = await service.execute(operation, providerInput, options);
if (!executed.ok || detail !== "summary") return executed;
return summarizeRetainedAnalysis(executed.value, retention);
};
+1 -1
View File
@@ -16,7 +16,7 @@ export const ANALYSIS_VIEW_TOOL_CONTRACTS = [
...toolContractMetadata("inspect_analysis_view"),
kind: "application",
description:
'Inspect selected views of completed binary-layout, JavaScript application, native analyze_function, inspect_artifact, inventory_artifact, inspect_wasm_artifact, inspect_evm_interface, inspect_managed_artifact, inspect_android_package or inspect_web_network_capture Evidence without repeating analysis. Historical capture summaries return identity and counts without bodies or archive inventories. Capture views page retained records: view {kind: "capture", detail: "preview" | "complete", offset: 0, limit: 20}; preview selects recorded headline fields and binary descriptors, complete returns exact records with all sidecars. Offsets follow the selected parent record order, preserving original producer ordinals. Paging never reopens the source or reruns the decoder. Qlog summaries keep profile/scope and counts; kind qlog pages traces, streams, loss-declarations, incomplete-records, contributions, ranges or final-sizes. Except traces, select trace_index; stream-specific facets also require exact stream_id and direction. Facts retain all-recorded-events-before-selection scope, and interval overlap or endpoint loss declarations do not prove retransmission or network loss. The api-surface view groups retained HAR requests by method, origin and format-rule path template; templated segments are inferences. It reads no headers or bodies and reports no query values. For a retained record use source: {kind: "retained-evidence", evidence_id: "<parent_evidence_id>"}. Use normalized_result.parent_evidence_id from a summary receipt. Source kind is required. Portable source uses {kind: "inline", evidence: <complete Evidence>}. For layout, JavaScript, native, inventory, WASM, EVM, managed artifact and Android package sources, request a summary with view: {kind: "summary"}; summary is a view kind and has no facet. The WASM summary gives validation, counts, WAT digest/length, tool profile and execution/network states without reading WAT text. Select a layout mitigations/linkage facet, one section/symbol/module, or a stable page. Module pages include assets, bundled and source modules; use node_id for ambiguous or unavailable paths. Inventory uses view: {kind: "inventory", collection: "occurrences", logical_paths: ["package.json"], offset: 0, limit: 64}. Inventory views page nodes, occurrences, edges or integrity contradictions; occurrence logical_paths matches exact recorded strings (omitted means all available, [] means none). source_complete distinguishes complete inventories from partial source records; page exhaustion does not prove absence in a partial source. WASM views use kind wasm and facet sections/imports/exports/candidates/glue/wat/headers/details/tool_profile; text facets use UTF-16 code units and source forms remain exact. EVM summary returns all inferred interface candidates, carrier/decoded identities and explicit unknowns without hex or duplicate stdout. EVM views use kind evm and facet functions/bytecode_hex/stdout/stderr; function pages preserve the original candidate rows, and text offsets/limits count UTF-16 code units (hex has two characters per decoded byte). Exhausting candidate pages does not establish global interface completeness. Managed artifact summaries preserve complete identity/classification, metadata status, module/MVID, frameworks, coverage and limitations without unrelated inventories. Managed pages use kind managed and collection references/resources/attributes, retaining source coverage and build-local token scope; page exhaustion does not establish complete metadata. Android package summaries retain all declarations, engine identity and counts without decoded manifest text. Android manifest pages use kind android, facet manifest, offset and limit in UTF-16 code units; source_status preserves partial decoded coverage even when the retained text page is exhausted. Native views select procedure, pseudocode, assembly, basic blocks, comments, callers/callees, references, unresolved calls, referenced strings/names, native API and high-pcode. Use nonnegative offset and a positive caller-selected limit (defaults 0 and 64); pseudocode uses UTF-16 code units, other native pages use rows. Returns artifact identity, parent Evidence ID, a distinct view digest, coverage, limitations and unknowns. Actual serialized size determines MCP transport admission; choose a smaller page or export the complete retained Evidence if needed.',
'Inspect selected views of completed binary-layout, JavaScript application, native analyze_function, inspect_artifact, inventory_artifact, inspect_wasm_artifact, inspect_evm_interface, inspect_managed_artifact, inspect_android_package, inspect_dart_aot or inspect_web_network_capture Evidence without repeating analysis. Historical capture summaries return identity and counts without bodies or archive inventories. Capture views page retained records: view {kind: "capture", detail: "preview" | "complete", offset: 0, limit: 20}; preview selects recorded headline fields and binary descriptors, complete returns exact records with all sidecars. Offsets follow the selected parent record order, preserving original producer ordinals. Paging never reopens the source or reruns the decoder. Qlog summaries keep profile/scope and counts; kind qlog pages traces, streams, loss-declarations, incomplete-records, contributions, ranges or final-sizes. Except traces, select trace_index; stream-specific facets also require exact stream_id and direction. Facts retain all-recorded-events-before-selection scope, and interval overlap or endpoint loss declarations do not prove retransmission or network loss. The api-surface view groups retained HAR requests by method, origin and format-rule path template; templated segments are inferences. It reads no headers or bodies and reports no query values. For a retained record use source: {kind: "retained-evidence", evidence_id: "<parent_evidence_id>"}. Use normalized_result.parent_evidence_id from a summary receipt. Source kind is required. Portable source uses {kind: "inline", evidence: <complete Evidence>}. For layout, JavaScript, inventory, WASM, EVM, managed artifact, Android package and Dart AOT sources, request a summary with view: {kind: "summary"}; summary is a view kind and has no facet. The WASM summary gives validation, counts, WAT digest/length, tool profile and execution/network states without reading WAT text. Select a layout mitigations/linkage facet, one section/symbol/module, or a stable page. Module pages include assets, bundled and source modules; use node_id for ambiguous or unavailable paths. Inventory uses view: {kind: "inventory", collection: "occurrences", logical_paths: ["package.json"], offset: 0, limit: 64}. Inventory views page nodes, occurrences, edges or integrity contradictions; occurrence logical_paths matches exact recorded strings (omitted means all available, [] means none). source_complete distinguishes complete inventories from partial source records; page exhaustion does not prove absence in a partial source. WASM views use kind wasm and facet sections/imports/exports/candidates/glue/wat/headers/details/tool_profile; text facets use UTF-16 code units and source forms remain exact. EVM summary returns all inferred interface candidates, carrier/decoded identities and explicit unknowns without hex or duplicate stdout. EVM views use kind evm and facet functions/bytecode_hex/stdout/stderr; function pages preserve the original candidate rows, and text offsets/limits count UTF-16 code units (hex has two characters per decoded byte). Exhausting candidate pages does not establish global interface completeness. Managed artifact summaries preserve complete identity/classification, metadata status, module/MVID, frameworks, coverage and limitations without unrelated inventories. Managed pages use kind managed and collection references/resources/attributes, retaining source coverage and build-local token scope; page exhaustion does not establish complete metadata. Android package summaries retain all declarations, engine identity and counts without decoded manifest text. Android manifest pages use kind android, facet manifest, offset and limit in UTF-16 code units; source_status preserves partial decoded coverage even when the retained text page is exhausted. Dart AOT summary preserves target/ABI/library identity, snapshot headers and pool lower bounds. String pages use kind dart-aot, collection package_uris/dart_uris/class_like_tokens; source coverage remains partial when the producer says partial. Native function Evidence requires kind native: view: {kind: "native", facet: "procedure"}. Facets select procedure, pseudocode, assembly, basic blocks, comments, callers/callees, references, unresolved calls, referenced strings/names, native API and high-pcode. Use nonnegative offset and a positive caller-selected limit (defaults 0 and 64); pseudocode uses UTF-16 code units, other native pages use rows. Returns artifact identity, parent Evidence ID, a distinct view digest, coverage, limitations and unknowns. Actual serialized size determines MCP transport admission; choose a smaller page or export the complete retained Evidence if needed.',
inputSchema: inspectAnalysisViewInputSchema,
outputSchema: evidenceResultOf(analysisViewResultSchema),
examples: [
+15 -3
View File
@@ -1,7 +1,10 @@
import { z } from "zod";
import {
flutterInputSchemas,
dartAotInspectionInputSchema,
flutterResultSchemas,
} from "../../domain/flutter/flutterBuildAnalysis.js";
import { dartAotSummaryViewResultSchema } from "../../domain/analysisView/analysisView.js";
import type { ToolContract } from "../toolContractTypes.js";
import { evidenceResultOf } from "../toolOutputSchemaPrimitives.js";
import { toolContractMetadata } from "../toolEffects.js";
@@ -27,10 +30,15 @@ export const FLUTTER_TOOL_CONTRACTS = [
name: "inspect_dart_aot",
...toolContractMetadata("inspect_dart_aot"),
description:
"Inspect one ABI's Dart AOT snapshot inside an APK: the four snapshot symbols located through the ELF dynamic symbol table with their offsets, sizes, and section headers (magic, kind, length), the snapshot hash, and a bounded string-pool projection from the isolate data section (package: source URIs, dart: SDK URIs, identifier-like tokens) exposing the app's dependency structure. String-pool entries are byte-pattern observations, not deserialized cluster semantics; typed class and function recovery needs an SDK-specific parser. No engine, no execution.",
"Inspect one ABI's Dart AOT snapshot inside an APK: the four snapshot symbols located through the ELF dynamic symbol table with their offsets, sizes, and section headers (magic, kind, length), the snapshot hash, and a bounded string-pool projection from the isolate data section (package: source URIs, dart: SDK URIs, identifier-like tokens) exposing the app's dependency structure. String-pool entries are byte-pattern observations, not deserialized cluster semantics; typed class and function recovery needs an SDK-specific parser. Omitted or complete detail returns the full observation. Select detail: \"summary\" for target/ABI/library identity, all snapshot headers, coverage and original lower-bound counts without string lists. The complete source stays retained; read returned strings via inspect_analysis_view with parent_evidence_id and kind dart-aot, collection package_uris/dart_uris/class_like_tokens, offset and limit. Exhausting pages does not imply complete pool coverage. No engine, no execution.",
kind: "flutter-provider",
inputSchema: flutterInputSchemas.inspect_dart_aot,
outputSchema: evidenceResultOf(flutterResultSchemas.inspect_dart_aot),
inputSchema: dartAotInspectionInputSchema,
outputSchema: evidenceResultOf(
z.union([
flutterResultSchemas.inspect_dart_aot,
dartAotSummaryViewResultSchema,
]),
),
examples: [
{
title: "Inspect the preferred ABI's AOT snapshot",
@@ -40,6 +48,10 @@ export const FLUTTER_TOOL_CONTRACTS = [
title: "Inspect one ABI explicitly",
input: { path: "/targets/Example.apk", abi: "arm64-v8a" },
},
{
title: "Inspect snapshot identity with retained string lists",
input: { path: "/targets/Example.apk", detail: "summary" },
},
],
},
] as const satisfies readonly ToolContract[];
+7 -1
View File
@@ -100,18 +100,24 @@ export class AnalysisOutputError extends AnalysisError {
export class AnalysisCapabilityUnavailableError extends AnalysisError {
readonly _tag = "AnalysisCapabilityUnavailableError";
override readonly userMessage: string | undefined;
/** Incomplete cleanup must settle before the operation can be retried. */
readonly retryable: boolean;
constructor(
readonly providerId: string,
readonly operation: string,
readonly reason: string,
options?: AnalysisErrorOptions & { readonly userMessage?: string },
options?: AnalysisErrorOptions & {
readonly userMessage?: string;
readonly retryable?: boolean;
},
) {
super(
`Provider ${providerId} cannot execute ${operation}: ${reason}`,
options,
);
this.userMessage = options?.userMessage;
this.retryable = options?.retryable === true && !this.cleanupIncomplete;
}
}
+7
View File
@@ -1,6 +1,7 @@
import {
AnalysisAccessDeniedError,
AnalysisArtifactChangedError,
AnalysisCapabilityUnavailableError,
AnalysisInputError,
AnalysisUnsupportedTargetError,
AnalysisResourceConstraintError,
@@ -33,6 +34,8 @@ import type { AnalysisErrorProjection } from "./analysisErrorProjection.js";
export const analysisErrorRemediationAction = (
error: AnalysisError,
): string => {
if (error instanceof AnalysisCapabilityUnavailableError && error.retryable)
return "Review details.reason, then retry the same analysis after the condition clears.";
if (error instanceof EvidenceFileError && error.published !== undefined)
return "Use the published file at details.published_path and resolve the reported staging cleanup failure.";
if (error instanceof AnalysisSnapshotMismatchError)
@@ -112,6 +115,8 @@ export const analysisErrorRemediationAction = (
export const analysisErrorCategory = (
error: AnalysisError,
): AnalysisErrorProjection["category"] => {
if (error instanceof AnalysisCapabilityUnavailableError && error.retryable)
return "unavailable";
if (
error instanceof BinaryTargetError &&
error.constraint === "load_selection_rejected"
@@ -220,6 +225,8 @@ export const analysisErrorUserMessage = (error: AnalysisError): string => {
const hopperMessage = hopperErrorUserMessage(error);
if (hopperMessage !== undefined) return hopperMessage;
if (error.userMessage !== undefined) return error.userMessage;
if (error instanceof AnalysisCapabilityUnavailableError && error.retryable)
return "Required runtime controls are unavailable for this attempt.";
const standardMessage = standardErrorMessage(error._tag);
if (standardMessage !== undefined) return standardMessage;
if (error instanceof ArtifactOperationError) return artifactMessage(error);
@@ -25,6 +25,91 @@ import { ProviderSelectionError } from "./providerSelectionError.js";
import { analysisErrorProjectionSchema } from "../contracts/errorSchemas.js";
import { nativeCallPartialObservationSchema } from "./native/nativeCallPartialObservation.js";
describe("capability failure retry disposition", () => {
it.each([
{ options: {}, retryable: false, category: "unsupported_provider" },
{
options: { retryable: false },
retryable: false,
category: "unsupported_provider",
},
{ options: { retryable: true }, retryable: true, category: "unavailable" },
] as const)(
"preserves the producer's $retryable disposition",
({ options, retryable, category }) => {
const reason = "Native self-test failed with a sharing violation";
const projected = projectAnalysisError(
new AnalysisCapabilityUnavailableError(
"fixture-provider",
"inspect",
reason,
options,
),
);
expect(projected).toMatchObject({
code: "capability_unavailable",
category,
retryable,
details: { reason },
});
if (retryable) {
expect(projected.message).toBe(
"Required runtime controls are unavailable for this attempt.",
);
expect(projected.remediation.action).toContain(
"retry the same analysis",
);
}
expect(analysisErrorProjectionSchema.safeParse(projected).success).toBe(
true,
);
},
);
it("preserves a caller-selected message for a retryable failure", () => {
expect(
projectAnalysisError(
new AnalysisCapabilityUnavailableError(
"fixture-provider",
"inspect",
"temporary failure",
{
retryable: true,
userMessage: "Selected runtime diagnostic",
},
),
).message,
).toBe("Selected runtime diagnostic");
});
it("retains cleanup ownership before allowing a transient operation to retry", () => {
expect(
projectAnalysisError(
new AnalysisCapabilityUnavailableError(
"fixture-provider",
"inspect",
"temporary failure",
{
retryable: true,
cleanup: {
reason: "owned handle is still live",
resources: ["native-owner"],
},
},
),
),
).toMatchObject({
code: "cleanup_incomplete",
retryable: false,
details: {
cleanup: "incomplete",
resources: ["native-owner"],
execution_failure: "capability_unavailable",
},
});
});
});
it("projects a published file receipt alongside retained cleanup failure", () => {
const projected = projectAnalysisError(
new EvidenceFileError("write", "io", {
+2
View File
@@ -83,6 +83,8 @@ export const projectAnalysisError = (
message: analysisErrorUserMessage(error),
retryable:
RETRYABLE_CODES.has(code) ||
(error instanceof AnalysisCapabilityUnavailableError &&
error.retryable) ||
(code === "resource_constraint" &&
error instanceof AnalysisResourceConstraintError &&
error.resource === "capacity"),
+30 -1
View File
@@ -73,6 +73,12 @@ import {
androidViewRequestSchema,
androidManifestViewItemSchema,
} from "./androidPackageView.js";
import {
projectDartAotView,
dartAotSummarySchema,
dartAotViewRequestSchema,
dartAotViewContextSchema,
} from "./dartAotView.js";
/** Public name of the selected-view workflow. */
export const INSPECT_ANALYSIS_VIEW_OPERATION = "inspect_analysis_view" as const;
@@ -190,6 +196,7 @@ export const analysisViewRequestSchema = z.discriminatedUnion("kind", [
apiSurfaceViewSchema,
captureViewRequestSchema,
qlogViewRequestSchema,
dartAotViewRequestSchema,
]);
// The application owns admission and authenticated Evidence parsing. SDK and
@@ -305,6 +312,7 @@ const viewResultBase = {
"inspect_managed_artifact",
"inspect_web_network_capture",
"inspect_android_package",
"inspect_dart_aot",
]),
parent_digest: digestSchema,
view_digest: digestSchema,
@@ -376,6 +384,13 @@ export const androidPackageSummaryViewResultSchema = z.strictObject({
summary: androidPackageSummarySchema,
});
/** Exact snapshot and pool-coverage carrier for selected AOT delivery. */
export const dartAotSummaryViewResultSchema = z.strictObject({
...summaryViewResultBase,
parent_operation: z.literal("inspect_dart_aot"),
summary: dartAotSummarySchema,
});
/** Projected facts for one selected view of retained analysis Evidence. */
export const analysisViewResultSchema = z.discriminatedUnion("kind", [
z.strictObject({
@@ -400,6 +415,7 @@ export const analysisViewResultSchema = z.discriminatedUnion("kind", [
managedSummarySchema,
captureSummarySchema,
androidPackageSummarySchema,
dartAotSummarySchema,
]),
}),
z.strictObject({
@@ -470,6 +486,14 @@ export const analysisViewResultSchema = z.discriminatedUnion("kind", [
...viewResultBase,
parent_operation: z.literal("inspect_android_package"),
}),
z.strictObject({
kind: z.literal("dart-aot"),
view: dartAotViewRequestSchema,
items: z.array(z.string()),
...viewResultBase,
...dartAotViewContextSchema.shape,
parent_operation: z.literal("inspect_dart_aot"),
}),
z.strictObject({
kind: z.literal("inventory"),
view: inventoryViewSchema,
@@ -549,6 +573,10 @@ export type UnsignedAnalysisView =
| Omit<
Extract<AnalysisViewResult, { readonly kind: "android" }>,
"view_digest"
>
| Omit<
Extract<AnalysisViewResult, { readonly kind: "dart-aot" }>,
"view_digest"
>;
/** Attach the content digest that must change when projected bytes change. */
@@ -594,7 +622,7 @@ const unsupportedParent = (
new AnalysisUnsupportedTargetError(
INSPECT_ANALYSIS_VIEW_OPERATION,
parentArtifactPath(parent),
`Parent Evidence operation ${JSON.stringify(parent.operation)} does not support analysis views. Use completed binary layout, JavaScript application, native function, artifact inventory/inspection, WASM, EVM, managed artifact, Android package, or web network capture Evidence.`,
`Parent Evidence operation ${JSON.stringify(parent.operation)} does not support analysis views. Use completed binary layout, JavaScript application, native function, artifact inventory/inspection, WASM, EVM, managed artifact, Android package, Dart AOT, or web network capture Evidence.`,
);
const parentArtifactPath = (parent: AnalysisViewParent): string => {
@@ -624,6 +652,7 @@ const retainedViewProjectors = new Map<string, typeof projectWasmArtifactView>([
["inspect_evm_interface", projectEvmInterfaceView],
["inspect_managed_artifact", projectManagedArtifactView],
["inspect_android_package", projectAndroidPackageView],
["inspect_dart_aot", projectDartAotView],
["inspect_artifact", projectArtifactInventoryView],
["inventory_artifact", projectArtifactInventoryView],
]);
+123
View File
@@ -0,0 +1,123 @@
import { z } from "zod";
import type { AnalysisError } from "../analysisErrorBase.js";
import { flutterResultSchemas } from "../flutter/flutterBuildAnalysis.js";
import { analysisInputErrorFromIssues } from "../inputIssueProjection.js";
import { err, ok, type Result } from "../result.js";
import {
analysisViewInputError,
type AnalysisViewParent,
type AnalysisViewRequest,
type UnsignedAnalysisView,
} from "./analysisView.js";
import {
completeWithinViewCoverage,
pageViewCoverage,
} from "./analysisViewCoverage.js";
const aotSchema = flutterResultSchemas.inspect_dart_aot;
/** Snapshot identity and original coverage, without unrelated string inventories. */
export const dartAotSummarySchema = aotSchema.extend({
string_pool: aotSchema.shape.string_pool
.omit({ package_uris: true, dart_uris: true, class_like_tokens: true })
.extend({
returned_counts: z.strictObject({
package_uris: z.number().int().nonnegative(),
dart_uris: z.number().int().nonnegative(),
class_like_tokens: z.number().int().nonnegative(),
}),
}),
});
/** Pages of the producer-returned strings, preserving original order and scope. */
export const dartAotViewRequestSchema = z.strictObject({
kind: z.literal("dart-aot"),
collection: z.enum(["package_uris", "dart_uris", "class_like_tokens"]),
offset: z.number().int().nonnegative().default(0),
limit: z.number().int().positive().default(64),
});
export const dartAotViewContextSchema = z.strictObject({
abi: aotSchema.shape.abi,
libapp: aotSchema.shape.libapp,
source_coverage: aotSchema.shape.coverage,
string_pool: dartAotSummarySchema.shape.string_pool,
});
/** Reuse authenticated AOT Evidence without opening the APK or rescanning its ELF. */
export const projectDartAotView = (
parent: AnalysisViewParent,
view: AnalysisViewRequest,
): Result<UnsignedAnalysisView, AnalysisError> => {
if (view.kind !== "summary" && view.kind !== "dart-aot")
return err(
analysisViewInputError([
{
path: ["view"],
reason: "invalid_value",
message: "Dart AOT Evidence supports summary and string-pool pages.",
},
]),
);
const parsed = aotSchema.safeParse(parent.normalizedResult);
if (!parsed.success)
return err(
analysisInputErrorFromIssues(
"inspect_analysis_view",
parsed.error.issues.map((issue) => ({
...issue,
path: ["source", "normalized_result", ...issue.path],
})),
{ source: { normalized_result: parent.normalizedResult } },
{ cause: parsed.error },
),
);
const report = parsed.data;
const { package_uris, dart_uris, class_like_tokens, ...pool } =
report.string_pool;
const string_pool = {
...pool,
returned_counts: {
package_uris: package_uris.length,
dart_uris: dart_uris.length,
class_like_tokens: class_like_tokens.length,
},
};
const shared = {
parent_evidence_id: parent.evidenceId,
parent_operation: "inspect_dart_aot" as const,
parent_digest: parent.evidenceId.slice(3),
artifact: { path: report.target.path, sha256: report.target.sha256 },
limitations: [...parent.limitations],
unknowns: [
"String-pool entries are byte-pattern observations, not recovered typed classes or functions.",
"Counts ending in _at_least remain lower bounds; exhausting returned strings does not establish a complete snapshot inventory.",
...(parent.subject == null
? [
"The parent has no recorded subject; its normalized target identity cannot be cross-checked against a subject digest.",
]
: []),
],
};
if (view.kind === "summary")
return ok({
kind: "summary",
view,
...shared,
summary: { ...report, string_pool },
coverage: completeWithinViewCoverage(1, 1),
});
const collection = report.string_pool[view.collection];
const items = collection.slice(view.offset, view.offset + view.limit);
return ok({
kind: "dart-aot",
view,
...shared,
items,
abi: report.abi,
libapp: report.libapp,
source_coverage: report.coverage,
string_pool,
coverage: pageViewCoverage(view.offset, items.length, collection.length),
});
};
+3 -13
View File
@@ -1,3 +1,5 @@
import type { ZipPackageFormat } from "./zipPackageFormat.js";
/** Provider-neutral CPU families detected from supported executable headers. */
export const BINARY_ARCHITECTURES = [
"x86",
@@ -167,19 +169,7 @@ export type BinaryTarget =
| (BinaryTargetIdentity &
NonExecutableMetadata & {
readonly kind: "archive";
readonly format:
| "zip"
| "ipa"
| "apk"
| "msix"
| "appx"
| "hap"
| "hsp"
| "app-pack"
| "asar"
| "ines"
| "dmg"
| "pkg";
readonly format: ZipPackageFormat | "asar" | "ines" | "dmg" | "pkg";
})
| (BinaryTargetIdentity &
NonExecutableMetadata & {
@@ -30,6 +30,12 @@ export const flutterInputSchemas = {
}),
} as const;
/** Retained delivery is selected independently of the provider's ABI request. */
export const dartAotInspectionInputSchema =
flutterInputSchemas.inspect_dart_aot.extend({
detail: z.enum(["complete", "summary"]).optional(),
});
/** Supported Flutter-backed operations. */
export type FlutterOperation = keyof typeof flutterInputSchemas;
/** Validated Flutter requests carry their selected operation. */
@@ -27,10 +27,8 @@ import { ProviderAdapterError } from "../../domain/providerAdapterError.js";
import { ProviderCleanupError } from "../../domain/providerCleanupError.js";
import { ok, err, type Result } from "../../domain/result.js";
import { javaScriptRuntime } from "../../domain/runtimeVersion.js";
import {
PrivateRuntimeRoot,
PrivateRuntimeRootUnavailableError,
} from "../../process/PrivateRuntimeRoot.js";
import { PrivateRuntimeRoot } from "../../process/PrivateRuntimeRoot.js";
import { PrivateRuntimeRootUnavailableError } from "../../process/PrivateRuntimeRootUnavailableError.js";
import { javaScriptWorkerMemoryLimitBytes } from "../../process/JavaScriptWorkerMemoryLimit.js";
import {
ProviderProcessSupervisor,
@@ -735,7 +733,7 @@ export class JavaScriptAnalysisWorker {
PROVIDER,
OPERATION,
cause.message,
{ cause },
{ cause, retryable: cause.retryable },
)
: new ProviderAdapterError(PROVIDER, OPERATION, {
cause,
@@ -16,10 +16,8 @@ import { ProviderCleanupError } from "../../domain/providerCleanupError.js";
import type { JsonValue } from "../../domain/jsonValue.js";
import { err, ok, type Result } from "../../domain/result.js";
import { WEB_SOURCE_MAP_LIMITS } from "../../domain/webSourceLocation.js";
import {
PrivateRuntimeRoot,
PrivateRuntimeRootUnavailableError,
} from "../../process/PrivateRuntimeRoot.js";
import { PrivateRuntimeRoot } from "../../process/PrivateRuntimeRoot.js";
import { PrivateRuntimeRootUnavailableError } from "../../process/PrivateRuntimeRootUnavailableError.js";
import { ProviderStartupDeadline } from "../../process/ProviderDeadline.js";
import { javaScriptWorkerMemoryLimitBytes } from "../../process/JavaScriptWorkerMemoryLimit.js";
import { cleanupOwnedProcessGroup } from "../../process/ProcessOwnership.js";
@@ -261,7 +259,7 @@ class OwnedCodec implements SourceMapCleanupOwner {
PROVIDER,
OPERATION,
cause.message,
{ cause },
{ cause, retryable: cause.retryable },
)
: new ProviderAdapterError(PROVIDER, OPERATION, {
cause,
+4 -11
View File
@@ -3,6 +3,7 @@ import { tmpdir } from "node:os";
import { join } from "node:path";
import { WindowsPrivateRuntime } from "../windows/WindowsPrivateRuntime.js";
import { PrivateRuntimeRootUnavailableError } from "./PrivateRuntimeRootUnavailableError.js";
import {
windowsNativeCapabilities,
@@ -34,16 +35,6 @@ export const privateRuntimeRootCapability = (
? windowsNativeCapabilities(platform).private_runtime_dacl
: { available: true, reason: null, proof: "posix-mkdtemp-owner-only" };
/** Expected failure when a runtime root's privacy boundary is unavailable. */
export class PrivateRuntimeRootUnavailableError extends Error {
readonly code = "private-runtime-root-authority-unavailable";
constructor(message: string) {
super(message);
this.name = "PrivateRuntimeRootUnavailableError";
}
}
/**
* Owns a private temporary runtime root and removes it idempotently.
*
@@ -66,7 +57,9 @@ export class PrivateRuntimeRoot {
const platform = options.platform ?? process.platform;
const capability = privateRuntimeRootCapability(platform);
if (!capability.available)
throw new PrivateRuntimeRootUnavailableError(capability.reason);
throw new PrivateRuntimeRootUnavailableError(capability.reason, {
retryable: capability.retryable === true,
});
if (platform === "win32") {
const runtime = WindowsPrivateRuntime.create(
options.parent ?? tmpdir(),
@@ -0,0 +1,14 @@
/** Expected failure when a runtime root's privacy boundary is unavailable. */
export class PrivateRuntimeRootUnavailableError extends Error {
readonly code = "private-runtime-root-authority-unavailable";
readonly retryable: boolean;
constructor(
message: string,
options?: ErrorOptions & { readonly retryable?: boolean },
) {
super(message, options);
this.name = "PrivateRuntimeRootUnavailableError";
this.retryable = options?.retryable ?? false;
}
}
+2
View File
@@ -11,6 +11,7 @@ export type WindowsNativeCapability =
readonly available: false;
readonly reason: string;
readonly proof: "not-proven" | "not-applicable";
readonly retryable?: true;
};
/** Security controls required before REA may claim Windows isolation. */
@@ -52,6 +53,7 @@ export const windowsNativeCapabilities = (
available: false,
reason: loaded.reason,
proof: "not-proven",
...(loaded.retryable === true ? { retryable: true as const } : {}),
} as const);
return {
job_object_process_ownership: capability,
+1
View File
@@ -444,6 +444,7 @@ export const createServer = (
toolLogger,
recordEvidence,
analysisAdmission,
evidenceById,
);
registerApktoolTools(
server,
+26 -11
View File
@@ -1,10 +1,15 @@
import type { EvidenceMcpServer } from "./EvidenceMcpServer.js";
import type { EvidenceWriter } from "../application/investigation/InvestigationRecordPort.js";
import { FlutterBuildAnalysisService } from "../application/flutter/FlutterBuildAnalysisService.js";
import { inspectDartAot } from "../application/flutter/DartAotInspection.js";
import type { EvidenceLookup } from "../application/EvidenceInputResolver.js";
import { toolContract } from "../contracts/toolContracts.js";
import type { WithAdmittedAnalysis } from "./analysisAdmission.js";
import type { Logger } from "pino";
import { createContractToolHandler } from "./contractToolHandler.js";
import {
createContractToolHandler,
type ContractToolService,
} from "./contractToolHandler.js";
import { toolRegistrationOptions } from "./toolRegistrationOptions.js";
/** Bind Flutter handlers to their exact named contracts through admission. */
@@ -14,6 +19,7 @@ export const registerFlutterTools = (
logger: Logger,
recordEvidence?: EvidenceWriter["recordEvidence"],
withAdmittedAnalysis?: WithAdmittedAnalysis,
evidenceById?: EvidenceLookup,
): void => {
const handler = createContractToolHandler(
server,
@@ -22,14 +28,23 @@ export const registerFlutterTools = (
recordEvidence,
withAdmittedAnalysis,
);
for (const contract of [
toolContract("identify_flutter_build"),
toolContract("inspect_dart_aot"),
] as const) {
server.registerTool(
contract.name,
toolRegistrationOptions(contract),
handler(contract),
);
}
const identify = toolContract("identify_flutter_build");
server.registerTool(
identify.name,
toolRegistrationOptions(identify),
handler(identify),
);
const aotService: ContractToolService<"inspect_dart_aot"> = {
execute: (_operation, input, options) =>
inspectDartAot(service, input, { recordEvidence, evidenceById }, options),
};
const aotHandler = createContractToolHandler(
server,
aotService,
logger,
recordEvidence,
withAdmittedAnalysis,
);
const aot = toolContract("inspect_dart_aot");
server.registerTool(aot.name, toolRegistrationOptions(aot), aotHandler(aot));
};
+44 -34
View File
@@ -3,12 +3,11 @@ import { join } from "node:path";
import { expect, it } from "vitest";
import { createTestTempDirectory } from "../../tests/fixtures/temporaryDirectory.js";
import { WabtArtifactProvider } from "./WabtArtifactProvider.js";
import {
PrivateRuntimeRoot,
PrivateRuntimeRootUnavailableError,
} from "../process/PrivateRuntimeRoot.js";
import { PrivateRuntimeRoot } from "../process/PrivateRuntimeRoot.js";
import { PrivateRuntimeRootUnavailableError } from "../process/PrivateRuntimeRootUnavailableError.js";
import { spawnOwnedProviderProcess } from "../process/ProviderProcess.js";
import { OwnedCommandFailure } from "../process/OwnedCommand.js";
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
const failureTags: Readonly<Record<string, string>> = {
invalid: "AnalysisInputError",
@@ -40,40 +39,51 @@ it("returns actionable unavailable without creating a workspace when tools are a
});
});
it("reports an unavailable private runtime root without a misleading WABT remediation", async () => {
const toolRoot = await createTestTempDirectory("rea-wabt-tool-root-");
for (const tool of ["wasm-validate", "wasm-objdump", "wasm2wat"])
await writeFile(
join(toolRoot, tool + (process.platform === "win32" ? ".exe" : "")),
"source-owned executable seam",
{ mode: 0o700 },
);
const provider = new WabtArtifactProvider(
{ REA_WABT_BIN_DIRECTORY: toolRoot },
undefined,
() => {
throw new PrivateRuntimeRootUnavailableError(
"REA Windows native controls are unavailable: probe failure",
it.each([false, true])(
"reports an unavailable private runtime root with retryable=%s without a misleading WABT remediation",
async (retryable) => {
const toolRoot = await createTestTempDirectory("rea-wabt-tool-root-");
for (const tool of ["wasm-validate", "wasm-objdump", "wasm2wat"])
await writeFile(
join(toolRoot, tool + (process.platform === "win32" ? ".exe" : "")),
"source-owned executable seam",
{ mode: 0o700 },
);
},
);
expect(
await provider.inspect({
const provider = new WabtArtifactProvider(
{ REA_WABT_BIN_DIRECTORY: toolRoot },
undefined,
() => {
throw new PrivateRuntimeRootUnavailableError(
"REA Windows native controls are unavailable: probe failure",
{ retryable },
);
},
);
const result = await provider.inspect({
path: "/module.wasm",
glue_paths: [],
candidate_paths: [],
}),
).toMatchObject({
ok: false,
error: {
_tag: "AnalysisCapabilityUnavailableError",
userMessage: undefined,
message: expect.stringContaining(
"REA Windows native controls are unavailable",
),
},
});
});
});
expect(result).toMatchObject({
ok: false,
error: {
_tag: "AnalysisCapabilityUnavailableError",
retryable,
userMessage: undefined,
message: expect.stringContaining(
"REA Windows native controls are unavailable",
),
},
});
if (result.ok)
throw new Error("Unavailable runtime must refuse inspection");
expect(projectAnalysisError(result.error)).toMatchObject({
code: "capability_unavailable",
retryable,
category: retryable ? "unavailable" : "unsupported_provider",
});
},
);
it.each([
"success",
"invalid",
+2 -2
View File
@@ -11,7 +11,7 @@ import {
} from "../domain/analysisErrorCore.js";
import { ProviderCleanupError } from "../domain/providerCleanupError.js";
import { OwnedCommandFailure } from "../process/OwnedCommand.js";
import { PrivateRuntimeRootUnavailableError } from "../process/PrivateRuntimeRoot.js";
import { PrivateRuntimeRootUnavailableError } from "../process/PrivateRuntimeRootUnavailableError.js";
import { WABT_LIMITS, WABT_PROVIDER_IDENTITY } from "./WabtRelease.js";
/** Preserve lifecycle failures and diagnostic bytes instead of returning partial success. */
export const wabtFailure = (
@@ -76,7 +76,7 @@ export const wabtFailure = (
WABT_PROVIDER_IDENTITY.id,
"inspect_wasm_artifact",
reason,
{ cause },
{ cause, retryable: cause.retryable },
);
if (phase === "configuration")
return new AnalysisCapabilityUnavailableError(
+23 -3
View File
@@ -1,6 +1,7 @@
import { win32 } from "node:path";
import { z } from "zod";
import { PrivateRuntimeRootUnavailableError } from "../process/PrivateRuntimeRootUnavailableError.js";
import {
requireWindowsNativeAuthority,
@@ -23,6 +24,13 @@ const fileSchema = windowsFileIdentitySchema.extend({
handle: windowsHandleSchema,
});
const runtimes = new Map<string, WindowsPrivateRuntime>();
// Retry only a proven pre-allocation sharing/lock conflict, never opaque text
// or an operation that may already own an unpublished runtime directory.
const transientRuntimeAdmissionSchema = z.object({
code: z.literal("ERR_REA_WINDOWS_NATIVE"),
win32Code: z.union([z.literal(32), z.literal(33)]),
runtimeAllocation: z.literal("not-started"),
});
/** Retain private DACL and path handles until native recursive cleanup settles. */
export class WindowsPrivateRuntime {
@@ -40,9 +48,21 @@ export class WindowsPrivateRuntime {
/** Create a new directory with its private DACL installed at creation. */
static create(parent: string, prefix: string): WindowsPrivateRuntime {
const authority = requireWindowsNativeAuthority();
const observation = runtimeSchema.parse(
authority.call("runtime_create", [parent, prefix]),
);
let observed: unknown;
try {
observed = authority.call("runtime_create", [parent, prefix]);
} catch (cause: unknown) {
if (
cause instanceof Error &&
transientRuntimeAdmissionSchema.safeParse(cause).success
)
throw new PrivateRuntimeRootUnavailableError(cause.message, {
cause,
retryable: true,
});
throw cause;
}
const observation = runtimeSchema.parse(observed);
const runtime = new WindowsPrivateRuntime(observation, authority);
runtimes.set(windowsRuntimeIdentityKey(observation), runtime);
return runtime;
+9 -2
View File
@@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
import { expect } from "vitest";
import { toolContract } from "../../src/contracts/toolContracts.js";
import { parseEvidence } from "../../src/domain/evidence.js";
import { flutterResultSchemas } from "../../src/domain/flutter/flutterBuildAnalysis.js";
import {
aotFixtureImage,
engineFixtureImage,
@@ -59,6 +60,9 @@ cliTest(
});
expect(result.exitCode, result.stderr).toBe(0);
const evidence = toolContract(name).outputSchema.parse(result.json);
const complete = flutterResultSchemas[name].parse(
evidence.normalized_result,
);
const response = await call(name, {
path,
...(abi === undefined ? {} : { abi }),
@@ -70,7 +74,7 @@ cliTest(
expect(mcp.subject).toMatchObject({
local_path: path,
format: "apk",
digest: { sha256: evidence.normalized_result.target.sha256 },
digest: { sha256: complete.target.sha256 },
});
expect(mcp.evidence_id).toBe(evidence.evidence_id);
if (name === "inspect_dart_aot") {
@@ -134,6 +138,9 @@ cliTest(
const evidence = toolContract("inspect_dart_aot").outputSchema.parse(
result.json,
);
const complete = flutterResultSchemas.inspect_dart_aot.parse(
evidence.normalized_result,
);
const { call } = await connectLocalToolsMcp();
const response = await call("inspect_dart_aot", { path });
expect(response.isError, JSON.stringify(response)).not.toBe(true);
@@ -146,7 +153,7 @@ cliTest(
string_pool: { coverage: "complete" },
});
expect(
evidence.normalized_result.libapp.sections
complete.libapp.sections
.filter((section) => section.name.endsWith("Data"))
.map((section) => section.kind),
).toEqual([4, 4]);
@@ -0,0 +1,135 @@
import { createHash } from "node:crypto";
import { readFile, writeFile } from "node:fs/promises";
import { resolve } from "node:path";
import { Client } from "@modelcontextprotocol/client";
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
import { TextReader, Uint8ArrayWriter, ZipWriter } from "@zip.js/zip.js";
import { expect } from "vitest";
import { artifactInspectionResultSchema } from "../../src/domain/artifactInspection.js";
import { parseEvidence } from "../../src/domain/evidence.js";
import { harmonyApplicationProjectionResultSchema } from "../../src/domain/harmony/harmonyApplication.js";
import { workspaceCliTest as test } from "../support/cli/workspaceCliFixture.js";
test("preserves Harmony archive formats through the public CLI/MCP lifecycle", async ({
cli,
workspace,
}) => {
const writer = new ZipWriter(new Uint8ArrayWriter());
await writer.add(
"module.json",
new TextReader('{"module":{"name":"fixture"}}'),
);
await writer.add(
"ets/modules.abc",
new TextReader("opaque bytecode fixture"),
);
const bytes = await writer.close();
const environment = {
PATH: process.env.PATH ?? "",
HOME: workspace.root,
USERPROFILE: workspace.root,
XDG_CONFIG_HOME: workspace.path("config"),
XDG_CACHE_HOME: workspace.path("cache"),
XDG_STATE_HOME: workspace.path("state"),
NODE_OPTIONS: "--max-old-space-size=512",
REA_LOG_LEVEL: "silent",
};
const client = new Client({ name: "rea-harmony-acceptance", version: "1" });
const transport = new StdioClientTransport({
command: process.execPath,
args: [resolve("scripts/rea.mjs"), "mcp"],
env: environment,
stderr: "pipe",
});
try {
await client.connect(transport);
await client.listTools();
for (const { suffix, format } of [
{ suffix: "hap", format: "hap" },
{ suffix: "hsp", format: "hsp" },
{ suffix: "app", format: "app-pack" },
]) {
const path = workspace.path(`fixture.${suffix}`);
await writeFile(path, bytes);
const sha256 = createHash("sha256").update(bytes).digest("hex");
const cliReply = await cli.run({
arguments: ["inspect-artifact", path, "--format", "json"],
environment,
});
expect(cliReply.exitCode, cliReply.stderr).toBe(0);
const cliEvidence = parseEvidence(cliReply.json);
const cliInventory = artifactInspectionResultSchema.parse(
cliEvidence.normalized_result,
);
expect(cliInventory.subject).toMatchObject({
root_format: format,
root_sha256: sha256,
});
const opened = await client.callTool({
name: "open_binary",
arguments: { path },
});
expect(opened.isError, JSON.stringify(opened)).not.toBe(true);
expect(opened.structuredContent).toMatchObject({
result: { kind: "archive", format, sha256 },
});
const status = await client.callTool({
name: "binary_session",
arguments: {},
});
expect(status.isError, JSON.stringify(status)).not.toBe(true);
expect(status.structuredContent).toMatchObject({
result: { open: true, kind: "archive", format, sha256 },
});
const inspected = await client.callTool({
name: "inspect_artifact",
arguments: {},
});
expect(inspected.isError, JSON.stringify(inspected)).not.toBe(true);
const inventoryEvidence = parseEvidence(inspected.structuredContent);
expect(
artifactInspectionResultSchema.parse(
inventoryEvidence.normalized_result,
),
).toEqual(cliInventory);
const projected = await client.callTool({
name: "project_harmony_application_graph",
arguments: { inventory_evidence: [inventoryEvidence] },
});
expect(projected.isError, JSON.stringify(projected)).not.toBe(true);
const graph = harmonyApplicationProjectionResultSchema.parse(
parseEvidence(projected.structuredContent).normalized_result,
);
expect(graph).toMatchObject({
root_format: format,
root_sha256: sha256,
coverage: { status: "complete-within-inventory" },
});
expect(
graph.components.manifests.map(({ path: member }) => member),
).toEqual(["module.json"]);
expect(
graph.components.bytecode.map(({ path: member }) => member),
).toEqual(["ets/modules.abc"]);
const closed = await client.callTool({
name: "close_binary",
arguments: {},
});
expect(closed.isError, JSON.stringify(closed)).not.toBe(true);
const empty = await client.callTool({
name: "binary_session",
arguments: {},
});
expect(empty.isError, JSON.stringify(empty)).not.toBe(true);
expect(empty.structuredContent).toMatchObject({
result: { open: false },
});
expect(await readFile(path)).toEqual(Buffer.from(bytes));
}
} finally {
await client.close();
}
}, 120_000);
@@ -0,0 +1,117 @@
import { createHash } from "node:crypto";
import { copyFile, mkdir, readFile, writeFile } from "node:fs/promises";
import { resolve } from "node:path";
import { expect } from "vitest";
import { processTest as test } from "../../support/process/processFixture.js";
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
test("generates locked inventory and rejects stale notice metadata or preserved texts", async ({
processes,
}) => {
const root = await createTestTempDirectory("rea-notice-records-");
await mkdir(resolve(root, "scripts/lib"), { recursive: true });
await mkdir(resolve(root, "licenses"));
for (const file of [
"scripts/generate-third-party-inventory.mjs",
"scripts/lib/generated-file.mjs",
])
await copyFile(resolve(file), resolve(root, file));
const script = resolve(root, "scripts/generate-third-party-inventory.mjs");
const runtime = {
version: "1.0.0",
license: "MIT",
resolved:
"https://registry.npmjs.org/fixture-runtime/-/fixture-runtime-1.0.0.tgz",
integrity: "sha512-fixture-integrity",
optional: true,
};
await writeFile(
resolve(root, "package-lock.json"),
JSON.stringify({
packages: {
"": { name: "fixture", version: "1.0.0" },
"node_modules/fixture-runtime": runtime,
"node_modules/fixture-dev": { ...runtime, dev: true, optional: false },
},
}),
);
const generated = await processes.run(process.execPath, [script]);
expect(generated.exitCode, generated.stderr).toBe(0);
const inventory = await readFile(
resolve(root, "licenses/npm-dependencies.txt"),
"utf8",
);
expect(inventory).toContain("Locked package entries: 2; runtime: 1.");
expect(inventory).toContain(
"fixture-runtime@1.0.0 | runtime, optional | MIT",
);
expect(inventory).toContain("fixture-dev@1.0.0 | development | MIT");
const fingerprint = (
JSON.parse(generated.stdout) as { runtime_dependency_fingerprint: string }
).runtime_dependency_fingerprint;
const notice = [
`Runtime dependency fingerprint (SHA-256): ${fingerprint}`,
"",
"===== fixture-runtime@1.0.0 =====",
"Declared license: MIT",
`Archive: ${runtime.resolved}`,
`Integrity: ${runtime.integrity}`,
"",
"Fixture text; this test does not establish real package attribution.",
"",
].join("\n");
const noticePath = resolve(root, "licenses/npm-runtime-notices.txt");
const referencePath = resolve(root, "licenses/reference.txt");
await writeFile(noticePath, notice);
await writeFile(referencePath, "preserved fixture text\n");
await writeFile(
resolve(root, "licenses/upstream-sources.json"),
JSON.stringify([
{
file: "licenses/reference.txt",
sha256: createHash("sha256")
.update("preserved fixture text\n")
.digest("hex"),
},
]),
);
const check = () => processes.run(process.execPath, [script, "--check"]);
const valid = await check();
expect(valid.exitCode, valid.stderr).toBe(0);
for (const [changed, diagnostic] of [
[
notice.replace(
"===== fixture-runtime@1.0.0 =====",
"===== another-package@1.0.0 =====",
),
"Missing runtime notice",
],
[
notice.replace(runtime.integrity, "sha512-different"),
"Runtime notice metadata differs",
],
[
notice.replace(fingerprint, "0".repeat(64)),
"Runtime notice fingerprint differs",
],
[
notice + notice.slice(notice.indexOf("===== ")),
"Duplicate runtime notice",
],
] as const) {
await writeFile(noticePath, changed);
const rejected = await check();
expect(rejected.exitCode).toBe(1);
expect(rejected.stderr).toContain(diagnostic);
}
await writeFile(noticePath, notice);
await writeFile(referencePath, "changed fixture text\n");
const tampered = await check();
expect(tampered.exitCode).toBe(1);
expect(tampered.stderr).toContain("Preserved notice digest differs");
expect(
await readFile(resolve(root, "licenses/npm-dependencies.txt"), "utf8"),
).toBe(inventory);
});
@@ -0,0 +1,35 @@
import { expect, it } from "vitest";
import { projectAnalysisError } from "../../../src/domain/analysisErrorProjection.js";
import { runSourceMapCommand } from "../../../src/javascript/sourceMaps/SourceMapCommand.js";
import { PrivateRuntimeRootUnavailableError } from "../../../src/process/PrivateRuntimeRootUnavailableError.js";
it.each([false, true])(
"preserves private-runtime retryable=%s through the source-map operation",
async (retryable) => {
const reason = "Native runtime self-test failed with a sharing violation";
let launches = 0;
const result = await runSourceMapCommand("{}", "/selected.map", undefined, {
prepareOwnership: async () => {},
createRuntime: async () => {
throw new PrivateRuntimeRootUnavailableError(reason, { retryable });
},
launcher: async () => {
launches += 1;
throw new Error("A refused runtime must not launch a codec");
},
});
expect(launches).toBe(0);
if (result.ok) throw new Error("Unavailable runtime must refuse decoding");
expect(projectAnalysisError(result.error)).toMatchObject({
code: "capability_unavailable",
category: retryable ? "unavailable" : "unsupported_provider",
retryable,
details: {
provider_id: "source-map-decoder",
operation: "trace_web_source_location",
reason,
},
});
expect(result.error.cleanupIncomplete).toBe(false);
},
);
@@ -69,6 +69,12 @@ const connect = async (
it("discovers an oversized native dossier by exact metadata and reads its retained view", async () => {
const { client, session } = await connect();
const advertised = (await client.listTools()).tools.find(
(tool) => tool.name === "inspect_analysis_view",
);
expect(advertised?.description).toContain(
'Native function Evidence requires kind native: view: {kind: "native", facet: "procedure"}',
);
const provider = { id: "ghidra", name: "Ghidra", version: "12.1.4" };
const profile = createAnalysisProfile(provider, { language: "fixture" });
const parent = createEvidence(
@@ -98,6 +104,24 @@ it("discovers an oversized native dossier by exact metadata and reads its retain
const retained = session.recordEvidence(record);
if (!retained.ok) throw retained.error;
}
const unsupportedSummary = await client.callTool({
name: "inspect_analysis_view",
arguments: {
source: { kind: "retained-evidence", evidence_id: parent.evidence_id },
view: { kind: "summary" },
},
});
expect(parseMcpToolError(unsupportedSummary).error).toMatchObject({
code: "invalid_request",
details: {
issues: [
{
path: ["view"],
message: "analyze_function Evidence requires a native view.",
},
],
},
});
const broad = await client.callTool({
name: "get_evidence_bundle",
arguments: {},
@@ -0,0 +1,285 @@
import { unlink } from "node:fs/promises";
import { Ajv2020 } from "ajv/dist/2020.js";
import { expect, it, onTestFinished, vi } from "vitest";
import { FlutterBuildAnalysisService } from "../../../src/application/flutter/FlutterBuildAnalysisService.js";
import { inspectDartAot } from "../../../src/application/flutter/DartAotInspection.js";
import { inspectAnalysisView } from "../../../src/application/analysisView/AnalysisViewService.js";
import { createFlutterBuildAnalysisProvider } from "../../../src/composition/flutter.js";
import {
analysisViewResultSchema,
dartAotSummaryViewResultSchema,
} from "../../../src/domain/analysisView/analysisView.js";
import { createEvidence, parseEvidence } from "../../../src/domain/evidence.js";
import { flutterResultSchemas } from "../../../src/domain/flutter/flutterBuildAnalysis.js";
import type { JsonValue } from "../../../src/domain/jsonValue.js";
import { aotFixtureImage } from "../../../src/flutter/FlutterBuild.fixture.js";
import { createFlutterApk } from "../../fixtures/flutterApk.js";
import { createApplicationMcpHarness } from "../../fixtures/applicationMcpHarness.js";
it("honors explicit ABI and old full requests, validates SDK schemas and reuses complete Evidence after APK removal", async () => {
const path = await createFlutterApk("views.apk", [
{ path: "lib/arm64-v8a/libapp.so", bytes: aotFixtureImage() },
{ path: "lib/x86_64/libapp.so", bytes: aotFixtureImage("b".repeat(32)) },
]);
const provider = createFlutterBuildAnalysisProvider();
const execute = vi.spyOn(provider, "execute");
const harness = await createApplicationMcpHarness({
serverOptions: { flutterAnalysis: provider },
});
onTestFinished(harness.close);
const { client, session } = harness;
const catalog = (await client.listTools()).tools;
const definition = catalog.find((tool) => tool.name === "inspect_dart_aot");
if (definition?.outputSchema === undefined)
throw new Error("Missing AOT output schema");
const outputSchema: Record<string, unknown> = definition.outputSchema;
const ajv = new Ajv2020({ strict: false, validateFormats: false });
expect(ajv.validateSchema(definition.inputSchema)).toBe(true);
expect(ajv.validateSchema(outputSchema)).toBe(true);
expect(
ajv.validate(
catalog.find((tool) => tool.name === "identify_flutter_build")!
.inputSchema,
{ path, detail: "summary" },
),
).toBe(false);
const reply = await client.callTool({
name: "inspect_dart_aot",
arguments: { path, abi: "x86_64", detail: "summary" },
});
expect(reply.isError).not.toBe(true);
expect(
ajv.validate(outputSchema, reply.structuredContent),
JSON.stringify(ajv.errors),
).toBe(true);
const receipt = parseEvidence(reply.structuredContent);
const view = dartAotSummaryViewResultSchema.parse(receipt.normalized_result);
const parent = session.evidenceById(view.parent_evidence_id);
if (parent === undefined)
throw new Error("Complete AOT source was not retained");
const report = flutterResultSchemas.inspect_dart_aot.parse(
parent.normalized_result,
);
expect(report.abi).toBe("x86_64");
expect(report.libapp.snapshot_hash).toBe("b".repeat(32));
expect(parent.parameters).toEqual({ path, abi: "x86_64" });
expect(execute).toHaveBeenLastCalledWith(
{ operation: "inspect_dart_aot", input: { path, abi: "x86_64" } },
expect.anything(),
);
expect(view.summary.libapp).toEqual(report.libapp);
expect(view.summary.target).toEqual(report.target);
expect(view.summary.coverage).toBe(report.coverage);
expect(receipt.evidence_id).not.toBe(parent.evidence_id);
expect(receipt.evidence_links).toEqual([parent.evidence_id]);
for (const detail of [undefined, "complete"]) {
const complete = parseEvidence(
(
await client.callTool({
name: "inspect_dart_aot",
arguments: {
path,
abi: "x86_64",
...(detail === undefined ? {} : { detail }),
},
})
).structuredContent,
);
expect(complete.operation).toBe("inspect_dart_aot");
expect(complete.normalized_result).toEqual(parent.normalized_result);
expect(complete.parameters).toEqual(parent.parameters);
}
const preferred = parseEvidence(
(await client.callTool({ name: "inspect_dart_aot", arguments: { path } }))
.structuredContent,
);
expect(
flutterResultSchemas.inspect_dart_aot.parse(preferred.normalized_result)
.abi,
).toBe("arm64-v8a");
const original = JSON.stringify(parent);
await unlink(path);
const calls = execute.mock.calls.length;
for (const collection of [
"package_uris",
"dart_uris",
"class_like_tokens",
] as const) {
const strings: string[] = [];
let offset = 0;
do {
const reply = await client.callTool({
name: "inspect_analysis_view",
arguments: {
source: {
kind: "retained-evidence",
evidence_id: parent.evidence_id,
},
view: { kind: "dart-aot", collection, offset, limit: 1 },
},
});
expect(reply.isError).not.toBe(true);
const page = analysisViewResultSchema.parse(
parseEvidence(reply.structuredContent).normalized_result,
);
if (page.kind !== "dart-aot") throw new Error("Wrong pool page kind");
strings.push(...page.items);
expect(page.libapp).toEqual(report.libapp);
expect(page.source_coverage).toBe(report.coverage);
expect(page.string_pool.coverage).toBe(report.string_pool.coverage);
offset =
page.coverage.next_offset ?? report.string_pool[collection].length;
} while (offset < report.string_pool[collection].length);
expect(strings).toEqual(report.string_pool[collection]);
}
expect(execute).toHaveBeenCalledTimes(calls);
expect(JSON.stringify(session.evidenceById(parent.evidence_id))).toBe(
original,
);
expect(
session
.exportEvidenceBundle()
.records.find((record) => record.evidence_id === parent.evidence_id),
).toEqual(parent);
const portable = inspectAnalysisView({
source: { kind: "inline", evidence: parent },
view: { kind: "summary" },
});
if (!portable.ok) throw portable.error;
expect(portable.value.normalized_result).toEqual(view);
}, 30000);
it("preserves null snapshot facts and pool lower bounds after exhaustion, rejecting malformed and conflicting identities", () => {
const report = {
target: { path: "/source.apk", bytes: 10, sha256: "a".repeat(64) },
abi: "arm64-v8a",
libapp: {
coverage: "partial",
bytes: 1,
sha256: "b".repeat(64),
snapshot_hash: null,
snapshot_hash_candidates: [],
snapshot_hash_sources: 0,
sections: [],
},
string_pool: {
coverage: "partial",
package_uris: ["package:opaque/a.dart"],
package_uri_count_at_least: 1000,
dart_uris: [],
dart_uri_count_at_least: 0,
class_like_tokens: ["incidental"],
class_like_token_count_at_least: 4000,
printable_run_count: 12,
},
coverage: "partial",
};
const evidence = (
result: JsonValue = report,
sha: string | null = "a".repeat(64),
) =>
createEvidence(
sha === null
? undefined
: { path: "/source.apk", sha256: sha, format: "apk" },
{ id: "flutter", name: "Flutter", version: null },
{
operation: "inspect_dart_aot",
parameters: {},
result,
limitations: ["Original uncertainty"],
},
);
for (const parent of [evidence(), evidence(report, null)]) {
const summary = inspectAnalysisView({
source: { kind: "inline", evidence: parent },
view: { kind: "summary" },
});
if (!summary.ok) throw summary.error;
const result = dartAotSummaryViewResultSchema.parse(
summary.value.normalized_result,
);
expect(result.summary.libapp.snapshot_hash).toBeNull();
expect(result.summary.string_pool.package_uri_count_at_least).toBe(1000);
expect(result.summary.string_pool.returned_counts.package_uris).toBe(1);
expect(result.limitations).toEqual(parent.limitations);
const page = inspectAnalysisView({
source: { kind: "inline", evidence: parent },
view: {
kind: "dart-aot",
collection: "package_uris",
offset: 0,
limit: 10,
},
});
if (!page.ok) throw page.error;
expect(page.value.normalized_result).toMatchObject({
kind: "dart-aot",
items: report.string_pool.package_uris,
source_coverage: "partial",
string_pool: { coverage: "partial", package_uri_count_at_least: 1000 },
coverage: { total: 1, exhausted: true },
});
}
expect(
inspectAnalysisView({
source: { kind: "inline", evidence: evidence(report, "c".repeat(64)) },
view: { kind: "summary" },
}),
).toMatchObject({ ok: false, error: { _tag: "EvidenceIntegrityError" } });
expect(
inspectAnalysisView({
source: {
kind: "inline",
evidence: evidence({
...report,
string_pool: {
...report.string_pool,
package_uri_count_at_least: -1,
},
}),
},
view: { kind: "summary" },
}),
).toMatchObject({ ok: false, error: { _tag: "AnalysisInputError" } });
expect(
inspectAnalysisView({
source: { kind: "inline", evidence: evidence() },
view: { kind: "android", facet: "manifest", offset: 0, limit: 1 },
}),
).toMatchObject({ ok: false, error: { _tag: "AnalysisInputError" } });
});
it("rejects unavailable retention, invalid delivery and cancellation before producer work", async () => {
const provider = createFlutterBuildAnalysisProvider();
onTestFinished(() => provider.close());
const execute = vi.spyOn(provider, "execute");
const service = new FlutterBuildAnalysisService(provider);
const retention = { recordEvidence: undefined, evidenceById: undefined };
expect(
await inspectDartAot(
service,
{ path: "/missing.apk", abi: "x86_64", detail: "summary" },
retention,
),
).toMatchObject({
ok: false,
error: { _tag: "AnalysisCapabilityUnavailableError" },
});
expect(
await inspectDartAot(
service,
{ path: "/missing.apk", detail: "other" },
retention,
),
).toMatchObject({ ok: false, error: { _tag: "AnalysisInputError" } });
expect(
await inspectDartAot(
service,
{ path: "/missing.apk", detail: "summary" },
retention,
{ signal: AbortSignal.abort() },
),
).toMatchObject({ ok: false, error: { _tag: "AnalysisCancelledError" } });
expect(execute).not.toHaveBeenCalled();
});
+11 -4
View File
@@ -122,11 +122,18 @@ it("advertises the complete currently available inventory with a session", async
const listed = await client.listTools();
const names = listed.tools.map((t) => t.name);
const sessionTool = listed.tools.find(
({ name }) => name === "binary_session",
);
if (sessionTool === undefined)
throw new Error("Missing advertised binary_session tool");
// Validate this reply with its current advertised schema. The SDK otherwise
// builds output validators for the entire catalog on the first cached call.
const status = structured(
await client.callTool({
name: "binary_session",
arguments: {},
}),
await client.callTool(
{ name: "binary_session", arguments: {} },
{ toolDefinition: sessionTool },
),
);
const inventory = expandToolAvailability(
toolContract("binary_session").outputSchema.parse(status).result
@@ -0,0 +1,99 @@
import { beforeEach, expect, it, vi } from "vitest";
import { WindowsPrivateRuntime } from "../../src/windows/WindowsPrivateRuntime.js";
import { PrivateRuntimeRootUnavailableError } from "../../src/process/PrivateRuntimeRootUnavailableError.js";
const { nativeCall } = vi.hoisted(() => ({ nativeCall: vi.fn() }));
vi.mock("../../src/windows/WindowsNativeLoader.js", async (original) => ({
...(await original<
typeof import("../../src/windows/WindowsNativeLoader.js")
>()),
requireWindowsNativeAuthority: () => ({ call: nativeCall }),
}));
beforeEach(() => {
nativeCall.mockReset();
});
it.each([
{
label: "sharing conflict before allocation",
win32Code: 32,
runtimeAllocation: "not-started",
retryable: true,
},
{
label: "lock conflict before allocation",
win32Code: 33,
runtimeAllocation: "not-started",
retryable: true,
},
{ label: "unknown allocation", win32Code: 32, retryable: false },
{
label: "possible allocation",
win32Code: 32,
runtimeAllocation: "started",
retryable: false,
},
{
label: "permission failure",
win32Code: 5,
runtimeAllocation: "not-started",
retryable: false,
},
{
label: "string code",
win32Code: "32",
runtimeAllocation: "not-started",
retryable: false,
},
{
label: "inconsistent error code",
win32Code: 32,
code: "EACCES",
runtimeAllocation: "not-started",
retryable: false,
},
])(
"retains $label without guessing runtime ownership",
({ retryable, label: _label, ...facts }) => {
const cause = Object.assign(new Error("Selected native diagnostic"), {
code: "ERR_REA_WINDOWS_NATIVE",
...facts,
});
nativeCall.mockImplementation(() => {
throw cause;
});
let observed: unknown;
try {
WindowsPrivateRuntime.create("D:/selected parent", "selected-prefix-");
} catch (failure: unknown) {
observed = failure;
}
expect(nativeCall).toHaveBeenCalledTimes(1);
expect(nativeCall).toHaveBeenCalledWith("runtime_create", [
"D:/selected parent",
"selected-prefix-",
]);
if (retryable) {
expect(observed).toBeInstanceOf(PrivateRuntimeRootUnavailableError);
expect(observed).toMatchObject({
message: cause.message,
cause,
retryable: true,
});
} else expect(observed).toBe(cause);
},
);
it("does not infer a transient status from a human-readable diagnostic", () => {
const cause = new Error("Open Windows path component failed (Win32 32)");
nativeCall.mockImplementation(() => {
throw cause;
});
let observed: unknown;
try {
WindowsPrivateRuntime.create("D:/selected parent", "selected-prefix-");
} catch (failure: unknown) {
observed = failure;
}
expect(observed).toBe(cause);
});
+1
View File
@@ -151,6 +151,7 @@
"scripts/fixtures/apple/*.mjs",
"src/generated*.ts",
"src/contracts/**/*.ts",
"licenses/**",
"docs/**",
"!docs/public/product-catalog.json",
"!docs/verification/managed-conformance-*.json",