Compare commits

...
Author SHA1 Message Date
Kaoru0822 98b87e7fd9 Merge remote-tracking branch 'origin/main' into sweep/2644
# Conflicts:
#	tests/process-global/cleanLinuxHopperRuntime.test.ts
2026-10-15 07:30:06 +00:00
Kaoru0822andClaude Opus 5.5 6fcfc5b5e0 fix(browser): keep malformed Electron CDP inventories incomplete (#3901)
inspect-electron-page read missing or non-array DOMSnapshot documents and
node arrays, frame-tree resource lists, and Target.getTargets target lists
as empty inventories while reporting complete_within_window.

The web capture path already validated these replies. Its parsing now has
one shared owner in CdpCaptureDocuments: snapshotDocuments,
snapshotDocumentNodes and frameTreeResources report unreadable parts
through a callback, and both the web and Electron inspections consume
them. Worker discovery records a missing target list or non-record entry as
an invalid_protocol_value exclusion. The Electron copies of this parsing are
removed.

Fixes #3379

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 00:09:38 -07:00
pablodiazjorge 35e17a7172 fix(captures): admit schema-valid HAR numbers that evidence cannot publish exactly (#3159)
* fix(captures): admit schema-valid HAR numbers that evidence cannot publish exactly

* fix(captures): judge overflowing HAR integers by their lexeme
2026-10-15 16:09:07 +09:00
pablodiazjorge f8f3593a8c test: resolve script paths from file URLs with fileURLToPath on Windows (#3266)
* test: resolve worker and CI script paths with fileURLToPath on Windows

* test: skip the fake gh lookup failure on Windows

* test: resolve the release helper and Hopper probe paths with fileURLToPath
2026-10-15 16:07:57 +09:00
Aaditya ed4a1c7d95 docs(installation): list every client that first shipped in 6.5.0 (#3465)
docs(installation): list every client missing from npm 6.4.0

The installation guide named only dsh, or dsh, kimi and workbuddy, as
needing a newer release. The rea-agents-6.4.0 tag also lacks droid,
qoder, trae and zcode, so setup against @latest rejects all seven as an
unsupported agent integration.

List all seven client IDs in both the registry-check note and the
supported-agents table note.
2026-10-15 16:07:42 +09:00
Wade 7a83af3cba fix(process): keep observed symlink targets in filesystem snapshots (#3418)
Snapshots stored resolve(dirname(link), readlink(link)), a lexical
absolute path. Two different targets such as aaa/../target and
bbb/../target collapse to the same value, and with equal lengths the
before/after comparison reported a retargeted link as unchanged even
when the new link is broken. Store the target exactly as readlink
returns it.

Fixes #3303
2026-10-15 16:07:28 +09:00
Ysopwnable f5b1dce881 docs: celebrate 250,000 GitHub stars 🎉 (#3971) 2026-10-15 15:07:07 +08:00
Rudy Mizrahi CelekliandClaude Sonnet 5.5 73c72d5745 fix(mcp): keep a snapshot open ahead of later calls on the same connection (#3661)
open_binary read snapshot_path before it entered the session's lifecycle
order, so a current_document or close_binary dispatched after it could
run first: the read returned Evidence for the previous target and the
close left the snapshot target open. The session now loads the snapshot
inside the open's own turn.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 16:05:44 +09:00
ShuaixinHuang ce89706145 fix(javascript): preserve exact static property keys (#3480)
* fix(javascript): preserve Electron options with static empty keys

* fix(javascript): retain exact computed member keys
2026-10-15 15:59:06 +09:00
Harsh Asalkar 3e88e21705 fix(electron): reject active scenario capture when inspect fuse is disabled (#3453) (#3605)
* feat(electron): add EnableNodeCliInspectArguments fuse pre-flight helper

* fix(electron): reject active scenario capture when inspect fuse is disabled (#3453)

* docs(electron): document inspect fuse pre-flight refusal for scenario capture (#3453)

* test(electron): add PE, ELF, and abort-signal coverage for fuse pre-flight (#3453)

* fix(electron): resolve macOS framework binary and enforce startup deadline on fuse preflight (#3453)
2026-10-15 15:57:42 +09:00
Wade d94ef22d70 fix(cli): route app bundles with trailing separators to native analysis (#3511) 2026-10-15 15:55:44 +09:00
Lucien c61a24b8c5 fix(browser): bound CDP handshakes and command responses (#3555)
* fix(browser): bound CDP handshakes and command responses

* test(browser): expire stalled deadlines after fixture readiness

* docs(browser): explain handshake deadline ownership
2026-10-15 15:55:29 +09:00
Kaoru0822andClaude Opus 5.5 fc712b3750 fix(javascript): keep releases through a replaced handle as candidates (#3897)
A release call was linked to its acquisition through the receiver's lexical
binding alone, so `stream = { destroy() {} }; stream.destroy()` still
produced a resolved `releases` edge to the original stream and entered the
default ownership trace.

A release is now complete only when every value written to the handle
binding is the linked acquisition itself (through parentheses, TypeScript
wrappers or `await`) or a nullish placeholder such as `let h = null`, which
cannot be released. Any other write, conditional replacement, or
destructuring keeps the linked release as a candidate (partial).

Fixes #3313

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 23:40:14 -07:00
Kaoru0822andClaude Opus 5.5 ab45bf641e fix(ghidra): refuse PSP targets with unexamined ABI declarations (#3904)
The generic Ghidra MIPS lane refuses a target whose ABI declaration
inspection is incomplete, such as a section-header table beyond the
captured file, because unexamined headers may hold declarations that
would refuse it. The PSP Allegrex lane skipped that check. It admitted
the target and resolved a supported profile while target inspection
said those declarations remained unknown.

The incomplete-declaration rule is now one shared helper,
ghidraMipsIncompleteDeclarationsReason, used by both the generic MIPS
and the PSP lanes.

Fixes #3329

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 23:30:12 -07:00
Kaoru0822andClaude Opus 5.5 57f30029b1 fix(javascript): reject Webpack getters replaced through any identity write (#3860)
The canonical `n.n` getter proof scanned for direct `loader.n =` assignments
and four Object methods on its own. `Reflect.set`, `Reflect.defineProperty`,
`delete`, destructuring and unknown-key writes left the proof intact, so a
replaced or deleted getter still attributed BrowserWindow calls to Electron.
Any Object method call on the loader also rejected the proof, even for an
unrelated key.

The proof now uses the shared identity-write owner
(`collectJavaScriptIdentityWritesSteps` with the module interop's intrinsic
resolution), as ambient writes already do. A write whose path may select `n`
(the key itself, an unknown key, or the whole loader) counts; exactly one
canonical assignment installed before entry dispatch remains required.

Fixes #3315

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 23:25:18 -07:00
morluto 22ec8bdb2f Merge remote-tracking branch 'origin/main' into codex/ci-followups-20261015 2026-10-15 14:11:13 +08:00
morluto a715fb9e6d test(browser): bound atomic environment polling across navigation 2026-10-15 14:11:13 +08:00
morluto 85788452dd test(cli): batch redundant client lifecycle dry runs 2026-10-15 14:11:13 +08:00
Kaoru0822andClaude Opus 5.5 1b036ecbff fix(flutter): check section-backed symbol tables against PT_LOAD (#3859)
* fix(flutter): check section-backed symbol tables against PT_LOAD

The section-backed ELF path read .dynsym and .dynstr only through their
section file offsets. The stripped PT_DYNAMIC path and snapshot symbols
resolve through the PT_LOAD map. A second PT_LOAD interpretation over an
allocated symbol or string table was therefore ignored, and
inspect-dart-aot reported complete coverage from metadata the loader may
read differently.

An allocated (SHF_ALLOC) dynamic symbol table and its string table now
need a single file-backed PT_LOAD interpretation that matches the section
offset, the same check the dynamic path applies to its tables. Otherwise
the symbol inventory is refused with the mapping reason, and
inspect-dart-aot reports that no recognizable snapshot selection remains.
Non-allocated tables keep their section-offset reading.

Fixes #3346

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

* test(flutter): cover allocated ELF32 symbol-table mapping checks

Add an ELF32 (ARM) counterpart of the synthetic ELF64 image and run the
allocated-table cases for both classes, so the ELF32 section-header reads
in the mapping check are exercised: matching mappings, conflicting symbol
and string mappings, and a disagreeing section offset.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 23:02:49 -07:00
933f216698 feat(kuna): add Kuna readiness, doctor and owned project cache (#3832)
Add caller-supplied Kuna readiness, scoped doctor support and a verified whole-program export cache. Index function byte ranges without introducing analysis-tool responses, and retain unresolved process ownership through cleanup failures. Separate retryable file cleanup from unproven process cleanup.

Verified real Kuna 1.833 on Debian 12 x86-64 with coreutils, SQLite and zlib; 5,207 exported function spans, cold/warm performance, raw-export parity and lifecycle failures. Refs #1957.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 05:56:56 +00:00
Kaoru0822andClaude Opus 5.5 cf0a38ad97 fix(managed): project metadata with empty names without a display label (#3853)
The managed application graph copied metadata names into observation
labels. The graph schema requires a non-empty label or null, so Evidence
whose Module name was the string heap's empty entry made
project-managed-application-graph fail with invalid_request at
observations.0.label. The inspector accepts that Evidence as complete,
and no graph was returned.

Labels derived from metadata names (assembly, module, type, member,
P/Invoke import and native implementation) now become null when the name
is empty. The node's properties keep the source value, so display
formatting no longer rejects identity facts.

Fixes #3352

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:22:59 -07:00
a1ca8c76af fix(website): give navigation room and refresh contributors (#3851)
Give the header its own 1320px container while preserving body/article widths, move the complete navigation below the controls on smaller screens, and refresh the dated public contributor snapshot from 214 to 216 accounts.

Validated shared HTML/translations/links/assets and 16 maintenance tests; local Chromium acceptance covered 20 languages, 15 viewport widths and both root/project paths. CI and Greptile review passed.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-15 05:18:54 +00:00
Kaoru0822andClaude Opus 5.5 034342ba28 fix(reference): select a package main before its directory index (#3844)
* fix(reference): select a package main before its directory index

import-reference-source resolved a relative directory import such as
require("./dep") from path candidates alone, so it reported dep/index.js
as the internal, parsed dependency even when dep/package.json declared
"main": "actual.js". Node loads actual.js.

parseReferenceSourceEntries now reads each inventoried package.json once.
When an internal specifier resolves through a directory index, a
non-empty string main is loaded first, as a file and then as a directory
index, as Node does. A main whose target is absent falls back to the
index, matching Node's legacy fallback. An unreadable or invalid
manifest leaves the relationship unresolved instead of asserting the
index.

Fixes #3383

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

* fix(reference): resolve package main the way path.resolve does

A trailing separator in main ("lib/") kept directory intent, so the
declared entry selected lib/index.js where Node loads lib.js. An absolute
main was joined under the package directory instead of leaving the
imported root. Strip trailing separators after joining, and report an
absolute main as unresolved. Both cases join the Node-oracle CLI test.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:02:45 -07:00
Kaoru0822andClaude Opus 5.5 788964d52c perf(javascript): index object literal members for exact-key reference lookup (#3836)
semanticObjectPropertyReferences scanned every property of an object
literal on each call, and member-mutation tracking calls it once per
write, so N writes to an N-property literal cost O(N^2).

For an exact string or number key, a property with another static name
only updates override bookkeeping for that other name, which the key
never reads. Index each literal once by static name, keeping spreads,
computed keys and __proto__ data entries for every key, and walk only
the relevant members in reverse source order. Wildcard and selection
keys keep the full scan.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:44:14 -07:00
Kaoru0822andClaude Opus 5.5 acca91d22b fix(javascript): keep members unknown after a write through a local setter (#3831)
* fix(javascript): keep members unknown after a write through a local setter

Assigning to a key that a setter of the binding's own object literal
defines runs that setter, which may replace any member of its receiver.
The member-mutation collector recorded it as an ordinary write to that
one key, so sibling literals such as value: 1 stayed known and
export-shape comparisons reported complete, unchanged shapes.

Record such a write with an unknown key, which invalidates the object's
known members. A computed setter key may match any written key.

Fixes #3312

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

* fix(javascript): follow nested setters, skip deletes and cache setter keys

Resolve the written receiver along nested object-literal members so a
write through a nested setter widens that receiver's members. A delete
never calls a setter, so it keeps its exact path. Setter keys are
computed once per object literal, including the no-setter result.

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

* fix(javascript): ignore setters replaced by a later data property

Build cached setter keys from the effective definitions: a later data
property or method with the same static name replaces the accessor, so
assigning that key no longer runs a setter.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:39:39 -07:00
Kaoru0822andClaude Opus 5.5 0323ce0a28 fix(javascript): keep the request endpoint on a uniquely consumed response (#3822)
* fix(javascript): keep the request endpoint on a uniquely consumed response

collectResponseConsumers always produced response-consumer operations
with endpoint null, so a json()/text() consumer that resolved to exactly
one request lost the request's literal endpoint in the semantic graph.

When the consumer resolves to one request through that request's own
result binding, the same condition that already makes it complete, it
now carries that request's endpoint. Ambiguous consumers stay null.

Fixes #3328

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

* fix(javascript): drop the endpoint when another write can replace the response

Copy the request's endpoint only when the request is the binding's sole
write; any other assignment, update, loop or destructuring target can
replace the response before the consumer reads it.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:39:26 -07:00
Kaoru0822andClaude Opus 5.5 089ef732e8 fix(apktool): own the version probe's process group and keep its timeout typed (#3808)
* fix(apktool): own the version probe's process group and keep its timeout typed

The version probe ran its launcher through execFileOutput, which waits
for every inherited output pipe to close. A shell launcher's child that
holds those pipes outlived the stop request, so the probe stayed pending
past its deadline and its grace period, and cancellation hung the same
way. An expired probe also surfaced as a non-retryable unusable-version
refusal.

Run the probe through runOwnedCommand like the decode run, so the owned
process group is stopped with its children. Report its deadline as
AnalysisTimeoutError with timeout_ms and retain an unresolved cleanup
owner for close. Apktool launchers are interpreter scripts, so both the
probe and the decode run prove ownership by run token instead of the
launcher's argv prefix. A close with unresolved process cleanup reports
a typed ProviderCleanupError instead of an untyped AggregateError.

Fixes #3342
Fixes #3347
Fixes #3337

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

* fix(apktool): carry unresolved probe cleanup through both provider entry points

A probe failure other than cancellation or timeout, such as an output
overflow whose launcher child survives, now keeps its cleanup reason and
resources on ApktoolConfigurationFailure. inspectAvailability and execute
report it as ProviderCleanupError instead of ordinary unavailability or
capability_unavailable.

Add a real-process lifecycle test: an interpreter launcher starts a child
that holds the inherited output pipes, the probe is cancelled after
launch, and both processes must be stopped within the bound.

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

* test(apktool): ignore zombies and always clean up the probe lifecycle fixture

Treat a zombie as exited when checking the launcher and child, bound the
cancellation wait so a regressed probe still reaches cleanup, and stop
any remaining fixture processes in a finally block.

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

* test(apktool): treat a failed process inspection as unknown, not stopped

Only ESRCH, a zombie state or ps reporting no match counts as exited; a
ps launch failure leaves the process presumed live so the assertion
fails and the finally block still stops it.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:37:52 -07:00
Kaoru0822andClaude Opus 5.5 f09f454f45 fix(native): retain valid Objective-C properties beside a malformed record (#3833)
* fix(native): retain valid Objective-C properties beside a malformed record

readObjcPropertyList decoded a whole property_list_t in one operation.
When a later entry's name pointer was unmapped, the list-level catch
discarded the properties already decoded. An empty property name passed
decoding and then failed schema validation of the whole result, so
inspect-native-dispatch-metadata exited 1 with no metadata.

Each property_t entry is now decoded on its own. A failing entry, or an
empty name, becomes a property_decode_failed issue at the entry address,
and sibling properties are retained. Incomplete-attribute issues also
report their entry address. List-header failures still fail only that
list.

Fixes #3336

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

* test(native): cover property record isolation on every platform

Move the synthetic Objective-C property Mach-O into a shared fixture and
decode it through decodeAppleDispatchMetadata in a portable test, so
Linux and Windows runs also catch a regression that drops valid sibling
properties. The macOS CLI cases keep exercising the built command.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:22:40 -07:00
70cd4cbfb8 fix(hopper)!: verify current Linux releases with the publisher key
Replace fixed Linux Hopper release pins with current vendor feed metadata,
complete detached-PGP package verification under the stable publisher primary
key, and authenticated package evidence for offline admission. Share parsed
publisher facts across approved setup, doctor and the pre-execution guard.
Preserve existing ownership, cancellation, private-display and cleanup rules.

Fixes #3577

Normalize empty XDG settings, preserve backups during approved cache repair,
and retain publisher cleanup through cancellation and shutdown. Exercise cold
offline verification without reusing process-local proof state. Serialize
approved cache publication across processes, restore old evidence on failure,
and share the existing lease owner from process without changing its identities.

Validation: 438 focused tests (six platform-related skips), full static/documentation checks, real Ubuntu
24.04 official Hopper 6.6.0 setup/CLI/MCP, offline ordinary-user admission,
launcher mutation rejection, and cold/warm verification measurements. Official
RPM metadata mismatch is tracked separately in #3578 and fails closed.

BREAKING CHANGE: Older Linux Hopper builds admitted by the fixed allowlist
now require retained publisher-signed package evidence or an approved update
to the current public demo. Update explicit HOPPER_LAUNCHER_PATH values when
migrating; the live feed exposes only its current release.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-15 12:15:55 +08:00
Kaoru0822andClaude Opus 5.5 b7dcf782aa fix(native): keep property flags unknown for unfinished quoted types (#3825)
An Objective-C property attribute string whose quoted class name never
closes, such as T@"NSString, was treated as complete. The missing N and
R were then read as the Objective-C defaults, so the property was reported
atomic and read-write, and objc_properties_categories coverage stayed
complete. The documented semantics require null flags for incomplete
attribute metadata.

The attribute splitter now reports whether every quote closed. An
incomplete string leaves atomicity and any unestablished read-only value
null, while explicit N or R tokens remain established and the raw type is
preserved. Each affected property adds a property_attributes_incomplete
issue, which marks the facet partial.

Fixes #3345

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 20:42:44 -07:00
Kaoru0822andClaude Opus 5.5 4135c911d3 fix(javascript): keep recovered invalid templates dynamic in semantic effects (#3815)
dataEffectLiteralString asked the literal owner for an exact value, and
when a template recovered with an invalid escape had no cooked value it
fell back to the raw spelling. Child-process commands, request endpoints
and event names then became resolved values that are not JavaScript
strings.

Use only the owner's cooked value; a template without one stays dynamic.

Fixes #3361

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 20:22:16 -07:00
Kaoru0822andClaude Opus 5.5 0781716788 fix(cli): accept --flag=value for global output flags (#3811)
* fix(cli): accept --flag=value for global output flags

`rea <command> --format=json` failed with "Unknown flag: --format".
`--filter-output=...`, `--token-limit=...` and `--token-offset=...`
failed the same way. Incur reads these global flags only in spaced form,
so the equals form fell through to the command parser. Command options
already accept both forms, and `rea mcp doctor` parses `--format=` itself.

A valued output flag with no value (`--format` last, or `--format=`)
also reported the flag as unknown with code UNKNOWN.

normalizeCliOutputArguments, in the module that owns output-argument
interpretation, now splits the equals forms of the four valued output
flags. The entry point passes the normalized argv to rea's output
validation and to Incur, so both read the same effective values. A
missing value now fails with MISSING_OUTPUT_VALUE and names the flag.

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

* fix(cli): detect missing output values while parsing output flags

The missing-value check scanned argv again after parsing, so it also
checked tokens the parser had already consumed as values. For example,
`--filter-output --format` selects the field `--format`, yet the second
scan reported `--format` as missing a value. parseCliOutputArguments
now records the first valued flag it skips for lack of a value, in the
same pass that consumes values.

Cover normalizeCliOutputArguments directly: values containing `=`, empty
values, and command options that only share a prefix. Export it in the
dispatcher test's runtime stub as well.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 20:22:02 -07:00
Kaoru0822andClaude Opus 5.5 847b7328cf fix(comparison): keep unnamed reference endpoints distinct or unknown (#3809)
* fix(comparison): keep unnamed reference endpoints distinct or unknown

compare_functions projected reference endpoints to procedure names only,
so two edges whose targets had no named procedure both became null and
compared equal, even when their recorded addresses differed.

Identify an unnamed endpoint by its address when both dossiers describe
the same artifact, where that address names one location. Across
artifacts the endpoint has no stable identity, so equal-looking
projections that contain one leave the references dimension unknown
with an explicit limitation. Named endpoints still survive relocation.

Fixes #3388

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

* fix(comparison): report known reference-kind changes before unnamed-endpoint uncertainty

Compare known reference kinds first and keep a differing kind as a
change; the unnamed-endpoint limitation now applies only when equality
remains unproven. The kind projection uses the same endpoint identity
as the endpoint projection.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 20:21:49 -07:00
Kaoru0822andClaude Opus 5.5 baad9eebe4 fix(javascript): reject FIFO recovery inputs without blocking (#3788)
* fix(javascript): reject FIFO recovery inputs without blocking

scanRecoveryFile opened the selected path with a blocking O_RDONLY open
before checking that it is a regular file. A FIFO with no writer blocks
that open in the libuv threadpool, so cancellation and the recovery
deadline could not settle the read, and the process could not exit.

Admit the input through the shared openRegularFile owner, which opens
with O_NONBLOCK and verifies a regular file before any read. A FIFO,
directory or socket now fails admission immediately with the existing
regular-file error; symlink rejection and cancellation are unchanged.

Fixes #3332

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

* fix(javascript): keep a failed admission close owned on cancellation

Rethrow RegularFileAdmissionFailure before mapping cancellation, so a
descriptor whose close failed stays owned by its error.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 20:21:34 -07:00
Kaoru0822andClaude Opus 5.5 4692bb3330 fix(reference): stop attributing overwritten require members to Node (#3801)
* fix(reference): stop attributing overwritten require members to Node

import-reference-source treated require.resolve(...) and require.main(...)
as Node's resolver even after the file replaced that member, so a literal
argument became a parsed internal dependency that the source never loads.

Attribute member calls only while the loader's resolve and main members
keep Node's identity: no write to either member or a computed member
(assignment, update, delete, destructuring) and no use of require as a
value where a mutator or alias could replace them. Bare require(...) calls
are unaffected.

Fixes #3393

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

* fix(reference): keep optional and wrapped loader uses intact

An optional call require?.(...) or a TypeScript or parenthesis wrapper
around require was read as require escaping as a value, which disabled
every member-call link in the file. Look through inert wrappers and
accept optional calls before deciding the loader escaped, and add
controls for bare calls after a member overwrite, a local loader's
member write, and optional calls.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 19:23:06 -07:00
Kaoru0822andClaude Opus 5.5 af6a998066 fix(javascript): keep string Worker paths unresolved without a document base (#3797)
A plain new Worker("./w.js") or navigator.serviceWorker.register("./sw.js")
resolves against the document base URL in a browser, and a Node
worker_threads string resolves against the working directory. Static
analysis was resolving browser strings against the calling script, which
recorded a resolved mapping to the wrong file.

Only new Worker(new URL(path, import.meta.url)) now produces a specifier.
Other worker and service-worker strings keep their expression and stay
unresolved, matching the existing worker_threads string handling.

Fixes #3309

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 19:13:17 -07:00
Kaoru0822andClaude Opus 5.5 7a66470385 fix(apple): report plist dates the decoder cannot represent as unknown (#3793)
plutil writes years past 9999 and negative years in a form the pinned
XML decoder cannot parse, and binary plists can hold dates outside the
JavaScript Date range. The decoder returns an Invalid Date. Its
projection's toISOString() call then threw, so inspect_plist failed the
whole plist as "unreadable_output" with a `rea doctor` remediation.
Keyed archive inspection and Interface Builder decoding rejected the
archive in the same way.

projectPlistValue, the shared projection, now reports such a date as
{ "$plist_type": "date", "iso8601": null } and counts it. inspect_plist,
keyed archive inspection and Interface Builder decoding each add a
counted limitation, as they already do for non-finite reals.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 19:13:01 -07:00
Kaoru0822andClaude Opus 5.5 90c6922905 fix(javascript): keep empty URL path segments significant (#3792)
* fix(javascript): keep empty URL path segments significant

ESM imports and HTML script references were joined with POSIX path
rules, which collapse '//' before applying '..'. URL resolution removes
the empty segment instead, so './assets//../app.js' names assets/app.js,
not app.js, and the graph linked the importer and renderer to the wrong
file. URL references refused every '//' even when dot segments cancel it.

Resolve ESM, HTML (including document base) and URL references through
one URL dot-segment helper. A remaining empty segment stays unavailable,
references above the artifact root are still rejected, and CommonJS keeps
filesystem path semantics.

Fixes #3307

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

* fix(javascript): resolve HTML base and reference as one URL path

The base href was turned into a canonical path before the script
reference was applied. A base empty segment that the reference's '..'
would remove was rejected early, and an above-root '..' from the base
became a removable segment that the reference's '..' could cancel.

Keep one URL path state through base and reference resolution, with
above-root escapes held apart from removable segments, and reject empty
segments only in the final path. Remove the superseded htmlBaseDirectory.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 19:12:49 -07:00
Kaoru0822andClaude Opus 5.5 3ded799bc7 fix(reference): never resolve a directory to an extensionless index (#3789)
resolveInternalSpecifier offered posix.join(dir, "index") as the
second candidate, ahead of every extension. With both dep.js and an
extensionless dep/index present, require("./dep") therefore resolved to
dep/index, a file that neither Node nor TypeScript ever selects.

Directory candidates now carry an extension. File and index ordering is
otherwise unchanged, so Node-validated cases such as dep/index.js
winning over dep.cjs keep their meaning.

Fixes #3381

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 19:12:36 -07:00
morluto d69acc3455 fix(windows): retain runtime ownership and clear readonly attributes 2026-10-15 09:29:04 +08:00
Ysopwnable 7d1e4d0e2b fix(browser): release attached emulation overrides (#3778)
* fix(browser): release attached emulation overrides

* fix(browser): preserve unowned environment state

* fix(browser): coordinate attached environment cleanup
2026-10-15 09:21:56 +08:00
Kaoru0822andClaude Opus 5.5 949228b606 perf(javascript): check wrapper IPC duplicates by invocation set (#3783)
The endpoint index from #3779 still scanned every earlier finding at the
same endpoint and serialized each invocation location. One wrapper called
N times for one channel shares an endpoint, so duplicate checks stayed
quadratic in N.

Record per endpoint whether a directly observed send/invoke exists and the
set of serialized invocation locations. The duplicate rule is unchanged and
each check is constant time.

Refs #3670

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 18:20:34 -07:00
Kaoru0822andClaude Opus 5.5 5e8f7c536e fix(cli): stop quietly when the stdout reader closes early (#3781)
* fix(cli): stop quietly when the stdout reader closes early

`rea ... | head` crashed once head closed the pipe. TOON and YAML output
raised an unhandled EPIPE 'error' event with a Node stack trace. JSON
output reported {"code":"UNKNOWN","message":"write EPIPE"} on stderr.
Both exited 1, as if the analysis had failed.

The CLI entry point owns process.stdout, so it now treats EPIPE as the
reader declining the rest of the output. It stops writing, suppresses
the failure report and exits 141 like a SIGPIPE-terminated writer, also
when Incur exits through its own failure path. Other stdout errors are
handled as before.

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

* fix(cli): guard mcp doctor output and cover midstream reader closure

The closed-reader guard was only installed for ordinary CLI commands. As a
result `rea mcp doctor | head` still crashed on EPIPE. The guard now lives
in one entry-point function shared by both CLI branches; MCP stdio keeps
its own lifecycle.

The tests now also close the reader after the first chunk of a 4 MiB
streamed JSON result, so later writes in writeJsonOutput are covered.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 18:20:19 -07:00
morluto 18591f78ae Merge remote-tracking branch 'origin/main' into codex/bug-sweep-20261015-final 2026-10-15 09:14:14 +08:00
Kaoru0822andClaude Opus 5.5 44b197f924 fix(javascript): parse JavaScript sources with JavaScript grammar (#3782)
parserPluginsForPath enabled Babel's typescript plugin for .js, .jsx,
.mjs and .cjs sources. TypeScript reads some valid JavaScript
differently: a conditional whose consequent is an arrow with a
parenthesized body (c?x=>(a):y=>(b)) throws as a return-type
annotation, and a<b>(c) becomes a generic call. VS Code's 20 MB
workbench bundles therefore returned no AST at all.

Select JavaScript grammar (JSX plus legacy decorators) for explicit
JavaScript extensions. TypeScript dialects and unnamed sources keep the
existing TypeScript-capable contract.

Fixes #3780
Refs #3670

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 18:12:30 -07:00
morluto 610f873e91 Merge remote-tracking branch 'origin/main' into codex/bug-sweep-20261015-final 2026-10-15 09:01:38 +08:00
Kaoru0822andClaude Opus 5.5 59f528f0e5 perf(javascript): share one definitions pass and index wrapper IPC dedupe (#3779)
Static analysis rebuilt the full lexical definitions index three times per
file (open receivers, RPC client roots, binding lookup) and the Electron
wrapper pass checked each substituted IPC registration against every prior
finding with JSON.stringify, which is quadratic in registrations.

Classify open receivers and RPC client roots in one traversal over a single
definitions-only index, then extend that same state with ambient writes for
binding lookup. Index IPC findings by side, operation, channel and location
so duplicate checks only consult same-endpoint candidates.

Static facts are byte-identical on the measured corpora.

Refs #3670

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:59:44 -07:00
morluto c553d1138e fix(windows): clear readonly when no other file attributes remain 2026-10-15 08:49:11 +08:00
morluto 930dd5357f Merge remote-tracking branch 'origin/main' into codex/bug-sweep-20261015-final 2026-10-15 08:44:08 +08:00
Kaoru0822andClaude Opus 5.5 084e540414 fix(native): resolve inspect_plist defaults from the selected target's bundle (#3774)
inspect_plist rooted every file target at the file's own directory, so a
program file under App.app/Contents/MacOS defaulted to
Contents/MacOS/Contents/Info.plist and --relative-path resolved from MacOS/
instead of the app root the CLI documents. A selected plist file likewise
looked for <dir>/Contents/Info.plist instead of reading itself.

A program file directly under a bundle's Contents/MacOS now roots at that
bundle, and a plist artifact target is its own default plist. The missing
default message names the default plist rather than Contents/Info.plist.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:40:24 -07:00
morluto db689f3c3c fix(windows): relax owned parent sharing before admission validation 2026-10-15 08:35:11 +08:00
morluto f15ddbea7a Merge remote-tracking branch 'origin/main' into codex/bug-sweep-20261015-final 2026-10-15 08:31:24 +08:00
morluto 68081ac414 fix(windows): grant retained roots the rights required for cleanup 2026-10-15 08:31:22 +08:00
Kaoru0822andClaude Opus 5.5 bddeae5108 fix(managed): charge admitted member facts once in the final projection (#3487)
* fix(managed): charge admitted member facts once in the final projection

inspect_managed_members admits method bodies, signatures, call edges,
field accesses and user strings as they are produced, then admits the
whole result again before returning it. The final pass re-counted every
already-admitted record, so the 64 MiB representation budget was spent
at roughly twice the result's JSON size. Ordinary assemblies such as
MathNet.Numerics, MongoDB.Driver, Npgsql, ClosedXML, System.Reactive and
Azure.Storage.Blobs returned resource-limit with no members.

The budget now remembers each admitted projection. A containing
projection spends that charge once instead of counting the subtree
again; a value that serializes more than once still pays for every
further occurrence. Results that already fit are byte-identical.

Refs #3449

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

* test(managed): check a repeated occurrence pays with fresh credit

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:19:33 -07:00
morluto f78d137b42 fix(windows): retain unpublished runtimes after cleanup failure 2026-10-15 08:16:22 +08:00
morluto 1a3a96d36b fix(windows): honor directory readonly semantics during cleanup 2026-10-15 08:16:22 +08:00
Kaoru0822andClaude Opus 5.5 c9764084b8 fix(reconstruction): withhold readiness for manifest references to absent Evidence (#3526)
build_reconstruction_obligation_ledger accepted a manifest original case or
fixture whose Evidence ID was absent from the bundle whenever another entry
of the same case kind was valid. The obligation was reported verified, the
ledger ready, and the dangling ID appeared in evidence_links with no
diagnostic, although the documented contract requires every referenced
Evidence ID to exist in the bundle.

Report each absent original-case or fixture reference as missing-original-case
or missing-case, naming the ID. Any such diagnostic withholds verification and
readiness.

Fixes #3363

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:11:40 -07:00
Kaoru0822andClaude Opus 5.5 0f966e2b44 fix(reconstruction): merge repeated observations into one generated obligation (#3524)
Two capture-process records of the same executable and scenario generate
the same obligation ID. addCandidate added their definition counts, so the
ledger reported duplicate-definition, a closure blocker meant for competing
definitions, merely because the claim was observed twice. The merge also
kept only the first record's unavailable_authority and
required_next_evidence.

Generated IDs digest their derivation key, so merging two generated
candidates keeps one definition. A reviewed definition that reuses an ID is
still a duplicate. The merge now unions unavailable_authority and
required_next_evidence from every observation.

Fixes #3375

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:11:28 -07:00
Kaoru0822andClaude Opus 5.5 1851f1fcfd fix(managed): report ILONLY-clear assemblies as mixed in boundary summaries (#3516)
inspect_managed_native_boundaries derived summary.mixed_mode_or_native_header
only from the managed native header and the native entry-point flag. A C++/CLI
assembly with ILONLY clear and no ReadyToRun signature was classified as
mixed-clr-native by inspect_managed_artifact but summarized as not mixed.

Give the rule one owner, managedCliIsMixedClrNative in ManagedPeReader, and
use it for both the artifact runtime family and the boundary summary. The
summary now reads the CLI header directly instead of the cli_native projection.

Fixes #3366

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:11:12 -07:00
Kaoru0822andClaude Opus 5.5 2b2a5d0f26 fix(native): inspect arm64e.x1 slices by their exact name (#3500)
inspect_macho passed the CPU-family spelling (`arm64e`) for every dotted lipo
slice name to otool, nm, dwarfdump and vtool. That is right for the
pointer-auth ABI version suffix (`arm64e.v1`), but `arm64e.x1` is a distinct
subtype: on a universal x86_64 + arm64e.x1 executable otool failed with
"does not contain architecture: arm64e" and the whole inspection failed.

Strip only the `.v<N>` ABI version suffix and pass other variant names
exactly. vtool has no spelling for a variant subtype, so skip it for such
slices and report that build metadata comes from otool only.

Fixes #3389

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:10:58 -07:00
Kaoru0822andClaude Opus 5.5 2a9252e4e6 fix(managed): report metadata range failures at artifact file offsets (#3508)
ManagedMetadataLayout's range check reported offsets relative to the buffer
it was given: the metadata root for version and stream headers, and the
table stream for the tables header, row counts and table data. Other
diagnostics in the same reader already use artifact file offsets, so a
truncated table stream at file offset 888 was reported at offset 24, inside
the DOS header.

Pass each buffer's artifact file offset to the range check so every
invalid-metadata-root issue carries a file offset.

Fixes #3364

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:06:06 -07:00
Kaoru0822andClaude Opus 5.5 7666a482b6 fix(adb)!: keep the exact Android long version code (#3485)
inspect_adb_package converted the dumpsys versionCode, a signed 64-bit long
(versionCodeMajor << 32 | versionCode), to a JavaScript number. Values above
2^53 were rounded, so 9007199254740993 was reported as 9007199254740992 with
the same Evidence ID, and negative values became null.

Return version_code as the exact decimal string dumpsys prints, matching the
apktool and JADX version_code contracts.

BREAKING CHANGE: inspect_adb_package version_code is now a decimal string
("45") instead of a JSON number (45). Read it as a string, or parse it with
BigInt when numeric comparison is needed.

Fixes #3368

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:01:25 -07:00
morluto fa318995f5 fix(setup): include registered IDA budgets in client deadlines 2026-10-15 07:36:34 +08:00
morluto 9a44fea347 test(mcp): avoid unrelated validator compilation in availability checks 2026-10-15 07:12:53 +08:00
morluto 2819defeea test(cli): verify attributed caveats in composed analysis 2026-10-15 06:56:09 +08:00
morluto 937b4e69c8 fix(cache): invalidate snapshots that lack source caveat semantics 2026-10-15 06:45:53 +08:00
morluto 1b668a527d chore: integrate current main before bug qualification 2026-10-15 06:42:51 +08:00
morluto 1e377e6965 perf(evidence): group repeated caveats with their source operations 2026-10-15 06:39:48 +08:00
morluto fb6e2b07e0 fix(ida): bound readiness requests by the remaining deadline 2026-10-15 06:34:32 +08:00
morluto c4608a2962 fix(evidence): preserve source attribution across composed workflows 2026-10-15 06:33:48 +08:00
morluto 225f26a5f8 refactor(ghidra): give function boundary scans one owner 2026-10-15 06:25:02 +08:00
morluto a004061abc fix(native): preserve provider limitations through call traces 2026-10-15 06:20:20 +08:00
morluto 01a1b3fda6 fix(ghidra): retain function boundary limitations on references 2026-10-15 06:20:20 +08:00
Ysopwnable 3d2846f237 fix(ghidra): invalidate synthetic entry reference snapshots (#3728)
fix(ghidra): exclude synthetic entry references
2026-10-15 06:14:29 +08:00
morluto 709e99d781 fix(windows): admit volume roots with existing write handles 2026-10-15 06:12:23 +08:00
morluto bb49252523 test(ida): verify typed timeout and retained cleanup through the CLI 2026-10-15 05:38:36 +08:00
morluto 4946688c33 refactor(setup): distinguish provider configuration from registration settings 2026-10-15 05:23:04 +08:00
morluto 333e0ab0df fix(setup): propagate selected provider deadlines through CLI registrations 2026-10-15 05:16:08 +08:00
morluto c0cfccb45f fix(ida): preserve SDK request timeout identity and captured output 2026-10-15 05:14:57 +08:00
morluto fbdd040324 docs(mcp): explain absolute SDK deadlines and client timeout configuration 2026-10-15 05:05:30 +08:00
morluto dadf909dce fix(setup): derive MCP tool deadlines and preserve caller timeout choices 2026-10-15 05:05:24 +08:00
morluto 097a4bce6f fix(jeb): make upstream request deadlines configurable and preserve cancellation 2026-10-15 05:05:18 +08:00
morluto c831c23633 docs(mcp): clarify gateway schema recovery without inferring backend constraints 2026-10-15 04:49:27 +08:00
morluto 5a46fbacd5 fix(mcp): advertise explicit target cleanup when investigations finish 2026-10-15 04:49:27 +08:00
morluto fffb074193 chore: integrate current main verification fixes 2026-10-15 04:06:41 +08:00
morluto 09e7f07108 fix(setup): select compact input schemas for Kimi registrations 2026-10-15 04:06:41 +08:00
morluto 1bbf4bd16c fix(process): preserve caller overrides during Windows environment normalization 2026-10-15 04:06:41 +08:00
morluto 07a501e82c fix(mcp): share inspection admission for prompt completion 2026-10-15 04:06:41 +08:00
morluto ebecf06f6e fix(setup): integrate Windows runner and ConPTY corrections 2026-10-15 04:04:17 +08:00
morluto 7e0c7b1244 fix(cutter): resolve bridge paths from the selected caller home 2026-10-15 04:01:36 +08:00
Ysopwnable d9cd239c5e fix(test): honor Ghidra startup budgets in Windows verification (#3417)
* fix(test): honor Ghidra startup budgets in file-offset verification

* fix(test): preserve selected startup budgets in direct Ghidra verification

* test(ghidra): cover verifier timeout budgets

* fix(test): preserve Ghidra MCP request budgets
2026-10-15 03:50:50 +08:00
morluto 11f64f653e test(browser): verify typed worker refusals across navigations 2026-10-15 03:43:29 +08:00
morluto 9b7ec809e6 test(process): use owned host-aware settlement fixtures 2026-10-15 03:43:29 +08:00
morluto 170bfc7b3f fix(mcp): authenticate inventory facts before prompt completion 2026-10-15 03:43:29 +08:00
morluto 591c87c4b6 refactor(artifacts): share inspection validation and prune legacy fixtures 2026-10-15 03:43:29 +08:00
morluto bfd76c5d16 test: isolate host discovery and update current capture fixtures 2026-10-15 03:43:29 +08:00
morluto 9ac91e0c1e fix(artifacts): bind inspection provenance to every retained inventory 2026-10-15 03:43:29 +08:00
morluto 30a9139b87 fix(javascript): keep source-module semantics independent of sibling bytes 2026-10-15 03:43:29 +08:00
morluto a9588be4eb fix(evidence)!: reject missing recorded inventory and capture facts
BREAKING CHANGE: Inventory Evidence must explicitly report integrity_contradictions, and browser capture Evidence must report every resolved budget. Caller input defaults remain supported; stored observations are never filled with inferred defaults.
2026-10-15 03:43:29 +08:00
morluto fc789d19ff style(apple): normalize class parser module formatting 2026-10-15 03:43:29 +08:00
morluto 4ff2dadf66 refactor(apple): remove unused class identity re-export 2026-10-15 03:43:29 +08:00
morluto 1a06c82772 style(test): format coverage regression fixtures 2026-10-15 03:43:29 +08:00
morluto 7d885d632c docs: align workflow recovery and current Evidence contracts 2026-10-15 03:43:29 +08:00
morluto 57a23f0a2d fix(browser)!: expose capture budgets and queue admitted content reads
BREAKING CHANGE: Browser capture results require resolved limits, event families, and omission facts. Caller-selected budgets replace hidden retention ceilings; admitted content reads queue behind bounded concurrency.
2026-10-15 03:43:29 +08:00
morluto d2a53beb3d test(hopper): verify external exit recovery and retained ownership 2026-10-15 03:43:29 +08:00
morluto a8887a9a85 fix(jeb): probe live operations with owned discovery deadlines 2026-10-15 03:43:29 +08:00
morluto 45d5e80144 fix(cli): preserve Cutter choices and reject invalid runtime arguments 2026-10-15 03:43:29 +08:00
morluto 50dd9fcad1 fix(ghidra): preserve MIPS overrides and filter entry metadata 2026-10-15 03:43:29 +08:00
morluto 6add17a317 fix(windows): explain missing native artifacts and verify output drain 2026-10-15 03:43:29 +08:00
morluto 8c0e431895 fix(setup): own Hopper replacement staging and committed outcomes 2026-10-15 03:43:29 +08:00
morluto ceb77f6697 fix(apple): distinguish JVM resources and UIKit event connections 2026-10-15 03:43:29 +08:00
morluto fc7e41ff3b fix(process): attribute finite trace omissions and cleanup states 2026-10-15 03:43:29 +08:00
morluto cb4ff50202 fix(functions): preserve coverage diagnostics separately from blockers 2026-10-15 03:43:28 +08:00
morluto b47055edbe fix(javascript): preserve module identity and boundary fields 2026-10-15 03:43:28 +08:00
morluto 0405c9d361 fix(artifacts)!: authenticate complete inspection and summary inputs
BREAKING CHANGE: Artifact inventories require scoped coverage. Obsolete coverage_status and prose-based coverage inference are removed. Inspection carriers authenticate every retained inventory substep.
2026-10-15 03:43:28 +08:00
morluto db8128dc0d refactor(evidence)!: require current coverage commitments
BREAKING CHANGE: Evidence and analysis snapshots require explicit nullable relationship coverage and include it in their identity commitments. Historical records without the field are rejected; saved files are not migrated.
2026-10-15 03:43:28 +08:00
Swatantra Yadav 2abfe53dbd fix(setup): preserve overridden runner variables and test isolation on Windows
Support case-insensitive environment value lookup in ClientRegistrationIdentity while preserving JavaScript property order precedence with findLast(). Add unit regression coverage for ambient uppercase npm variables on Windows. Isolate USERPROFILE in cliSetup tests so child processes do not touch the host profile directory. Harden JSON decision extraction in runJourney against ConPTY trailing ANSI escape codes. Deterministically sequence multiselect prompt navigation before confirmation. Filter ambient runner variables case-insensitively before launching interactive setup completion tests.
2026-10-15 00:56:31 +05:30
qorvrandqorvr efbc486b9b fix(contracts): reject NUL bytes in keyed archive and extraction paths (#3606)
Co-authored-by: qorvr <330186599+qorvr@users.noreply.github.com>
2026-10-15 03:14:31 +08:00
11b747f29d fix(analysis-view): unify inert inline Evidence admission
Share inline Evidence admission before authentication across analysis views.
Reject executable object behavior before reflection, inspect arrays
incrementally, preserve inert JSON-omitted metadata and existing budgets.
Keep precise error locations with one bounded path stack.

Validated base failures, 48 source tests, 71 related public-boundary tests,
27 final CLI/MCP tests and eleven calls against a genuine Chromium HAR;
source identity, selected output and capacity accounting remain preserved.

Co-authored-by: Zhong-fan <205188959+Zhong-fan@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-15 03:13:28 +08:00
鸡哥 75104040df fix(javascript): track public CommonJS export receiver lifetimes (#3567)
* fix(javascript): track public CommonJS export receiver lifetimes

* fix(javascript): retain exports across uncertain identity effects
2026-10-15 02:46:14 +08:00
357996cc89 test(perf): measure genuine SAZ selection and retained recovery (#3584)
* test(perf): pin genuine Fiddler captures and raw HTTP oracles

Pin two public Microsoft SAZ captures with 13 and 1311 sessions, immutable source/digest/member coverage and predeclared caller-ordered transaction questions. Independently preserve stored HTTP headers, binary/empty bodies and archive coordinates; admit only known corpus bytes before ZIP allocation. Five reader regressions and both genuine selected-record checks pass. No production or performance-gain claim.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>

* test(perf): measure SAZ selection and retained recovery workflows

Add authenticated complete/ordinal/retained-page SDK experiments, fixed real-Codex prompts and independent cited-byte grading. Preserve actual failed RPCs and exact retained-reference recovery when complete MCP delivery exceeds its receive buffer. Verify selected CLI/MCP facts, parameters and semantic Evidence identity. Keep a genuine partial-message admission-negative probe. Focused 12 tests and 10 actual-Evidence grading cases pass; no formal model or gain claim yet.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* test(perf): verify resolved SAZ Evidence selection parameters

Distinguish omitted request ordinals from the complete resolved ordinal scope recorded by WebNetworkCaptureService. Share the expected sanitized Evidence representation between SDK checks and model grading; preserve original caller arguments. A focused regression and both saved genuine baseline RPCs confirm the correction. Keep original collector failures and costs unchanged; freeze a new driver before repeated measurements.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

* docs(perf): retain mixed SAZ whole-task costs and failure boundaries

Record both SDK batches, twelve corrected workflows, all four actual Codex attempts, independent byte equivalence and verified payload-phase CPU/memory. Distinguish successful-analysis MCP transport limits from real provider timeouts and negative partial-message admission. Three model questions complete; the only completed pair saves 1.6 percent input but takes 2 percent longer, with no consistent benefit. Keep production APIs/defaults/cache unchanged and preserve all deviations, failed attempts and unknowns.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

---------

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-15 02:45:44 +08:00
e79e014f23 fix(browser): preserve passive network inventory uncertainty
Preserve uncertainty in offline passive network comparisons when request
identity, metadata, or per-kind inventory coverage is incomplete. Retain
proven HTTP/WebSocket changes without using missing information to infer
membership, duplicate counts, or equality.

Compare redirect resource types only where both observations retain them.
Keep metadata completeness with its owner, stream HTTP content digests,
and require full coverage for multiplicity and WebSocket stream inventories.
Preserve independently known metadata changes and full-inventory counts.

Keep the original JavaScript configuration-escape, JSON, cancellation,
SAZ and schema-documentation fixes compatible with current main. Split
public CLI comparisons into isolated test cases without loosening timeouts.
Validate actual Chromium/HTTP captures through CLI and real stdio SDK,
with explicit limits and unchanged source bytes.

Co-authored-by: To3akaRin <131595336+To3akaRin@users.noreply.github.com>
Co-authored-by: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-15 02:28:46 +08:00
morluto b8510ee00b test(mcp): remove cache and event order dependence from fault probes
Inject IDA diagnostic capacity faults per connection so prior module imports cannot bypass them. Use the CDP fixture event barrier before asserting complete body shapes, and document profile and renderer verification.
2026-10-15 01:41:31 +08:00
morluto 36615d9165 fix(mcp): honor Frida partial evidence retention acknowledgments
Use shared recorded-partial delivery on start, load and instrument errors. Return a retained reference only after a successful write; preserve the original inline partial when retention fails or is unavailable.
2026-10-15 01:41:31 +08:00
morluto c5fb86d194 fix(mcp): bind catalog identity to output schema profiles
Include the selected output advertisement profile while retaining canonical output validation in the identity. Reuse the SDK output projection and select doctor expectations from both profiles. Correct the compact input error documentation.
2026-10-15 01:41:31 +08:00
morluto 0df0e4f53e fix(contracts): honor options outside the schema projection cache
Bypass target-only memoization when Standard JSON Schema library options are supplied. Verify shared and inline projections remain independent in either call order.
2026-10-15 01:41:31 +08:00
morluto 204b9f3ac1 fix(contracts): preserve array guidance across MCP schema profiles
Keep item schemas when compact inputs reduce nested structure, expose literal tuple elements to items-first renderers, and preserve SQLite table-selection guidance across compaction. Verify catalog-wide client constraints and canonical rejection before dispatch. Document the stock Pi renderer size limit and caller-selected recovery.
2026-10-15 01:41:31 +08:00
Dery Ferdika a732c859dd fix(contracts): reject NUL bytes in Frida, Rizin, and GDB local path inputs (#3575)
Route the caller-selected local path fields in load_frida_script,
instrument_with_frida, start_frida_session, start_rizin_debug_session,
and start_gdb_session through the shared localPathStringSchema so a NUL
byte is refused at the advertised contract boundary instead of reaching
the filesystem or a provider subprocess and surfacing as a raw error.

Extend the OS-invalid-local-input acceptance harness to the tools that
were missing from it.
2026-10-15 01:17:54 +08:00
morluto 10aa74dfed fix(mcp): preserve tuple constraints in advertised schemas
Declare fixed tuple tails and lengths at the canonical boundary so client array validation accepts every tool. Preserve nonempty candidate constraints in managed and application comparisons. Add catalog-wide client checks and parser/schema parity coverage for both dialects and projection directions.

Fixes #3576
2026-10-15 01:12:46 +08:00
93e75bc8fe fix(setup): retain Hermes YAML scalar source during updates
Retain source nodes for unchanged scalar values and string keys when
replacing a Hermes registration. Discarding quoted YAML 1.2 keys could
make Hermes' C reader reject duplicate boolean keys and switch to the
pure reader, changing the interpretation of unrelated settings.

Use linear mapping lookup, quote newly created YAML 1.2 strings for
YAML 1.1 compatibility, and preserve direct numeric edit formatting.
Extend actual CLI coverage for both existing reader-selection directions;
verify strings, exact unrelated numeric/timestamp values, backups and
idempotence with the actual Hermes Python loader.

Follow-up to #3102 and main's independent Hermes scalar fix.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-15 00:57:57 +08:00
1579b6865e test(electron): isolate active-hook fixture resolution (#3565)
Stage the real active hook and boundary helper next to a fixture-owned CommonJS Electron package so preload and exercise resolve the same module. Remove NODE_PATH reliance, retain capacity/preload/fatal-exit coverage, and prove isolation against a conflicting ancestor package.

Fixes #3473

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-15 00:44:48 +08:00
569ef4159d feat(website): add contributors and complete the Greek edition (#3520)
Add an equal, searchable directory of 214 contributors and translate its shared
navigation and copy. Complete the Greek website edition (1728/1728 messages),
preserving source examples, protected commands and evidence.

Publish refreshed contributor snapshots atomically and cover partial writes,
denied replacement and staging cleanup with failure regressions.

Validation: complete website checks and 16 maintenance tests, strict Greek
coverage, desktop/mobile and no-JavaScript journeys, selected PR CI and Greptile
follow-up. Codex automated review was unavailable because its quota was exhausted.
No analysis-provider behavior or production website publication is included.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-14 16:21:24 +00:00
0f623732bd fix(ci): require portable inventory reports on selected runs (#3549)
Run complete portable-inventory validation whenever code tests are selected and the job is not cancelled. Missing timing reports now fail rather than bypassing the existing validator. Preserve partial diagnostics and successful-history ownership.

Verified the baseline regression, missing/present report and cancellation/selection controls, actual Vitest blob/report failure paths, static checks, actionlint and test discovery.

Fixes #3542

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-15 00:16:09 +08:00
044fb9127a fix(hopper): skip non-file launcher candidates
Require automatically discovered Hopper launchers to be executable regular
files so POSIX directory search permission cannot hide a later valid
application bundle. Preserve file symlinks, explicit caller configuration,
and the shared candidate ordering.

Cover canonical and renamed user bundles through the production filesystem
predicate; respect existing canonical or renamed system installations in
the isolated fixtures. Clarify launcher eligibility in the installation guide.

Follow-up to #3085 and #3054 after their shared path discovery landed on main.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-15 00:09:42 +08:00
1438422dfe fix(managed): preserve enclosing identity in member comparisons (#3079)
Keep same-named nested members paired by their source-owned enclosing identity, including selected inventories that omit the parent TypeDefs. Share the cached, bounded nominal type-name digest owner with signature resolution; preserve current unknown identity through matching, remapping and absence instead of repairing it with display names or historical compatibility.

Verification: 457 related tests passed after preserving TypeDef visibility/parent applicability and coherent fixtures; the complete static/architecture gate and real pinned-SDK MCP nested/official .NET DLL workflows passed after a sigrok-experiment-only main refresh. Documentation checks passed after the compatibility fix. Full CoreLib inspection retains the pre-existing explicit representation limit. No target assembly execution; local verification used two CPUs and an 8 GiB RSS guard.

Co-authored-by: 8rulerstar <190670431+8rulerstar@users.noreply.github.com>
Co-authored-by: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-14 23:20:07 +08:00
YsopwnableandKaoru0822 eb44921c4c fix(ci): invalidate GitHub entrypoint and package-scope caches (#3522)
Track GitHub package scopes and Knip workflow/action entrypoints in static-check cache keys. Preserve the upstream action-code ownership fix and restrict TypeScript to its actual typed inventory.

Real cold/warm regression tests retain cache reuse for unrelated inputs while rejecting changed source, declarations, package scopes, manifests and reachable module dependencies. Existing lint inventory and report transport coverage remain unchanged.

Fixes #3510

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-14 23:15:04 +08:00
ca1b2f8608 test(perf): measure real sigrok annotation selection workflows
Pin two public sigrok recordings and independently verify raw waveform bytes/sample locations through real CLI/MCP selection workflows. Record all eight actual Codex task costs, including a fixed-plan deviation and mixed whole-task token/time outcomes. Existing annotation controls reduce reply bytes; the cohort does not justify a new production cache/default/API change.

Harden corpus identity, UART data-bit coverage, I2C interval ownership and preallocation ZIP/metadata admission. Focused tests and original Evidence/transcript replays retain observed facts, outcomes, provenance and resource limitations.

Fixes #3131.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-14 22:56:25 +08:00
Ysopwnable 0f55f247cd fix(ghidra): preserve PE PDB coverage facts (#2933)
Preserve reported Program PDB identity, explicit omissions and nullable load state, retaining declared CodeView facts when equivalence is unknown. Bound JSON locator expansion and advance PE/workflow replay revisions without discarding historical Evidence.

Main already contains the shared canonical workflow collector. Integrate its unknown-PDB repair and fix the CLI fixture for the new artifact-session dependency. No unrelated pcap repair is included.

Validation: 309 focused tests across 15 files pass (2 Windows-only skips), runtime build and check:fast/pre-push pass. Real Windows Ghidra 12.1.4 PUBLIC/JDK 21.0.12.1 uses the public where.exe/PDB pair; 17 relevant production files match verified ca24903f. MCP cold/warm normalized results match and the backward graph has 3 successful nodes. Inputs are unchanged and no owned Java/Node processes remain. CLI inspection keeps its earlier exact-source scope. NB10 omission uses regression fixtures, without a real NB10 provider claim.

Tests keep 2-core affinity and 512 MiB Node/Java heaps. Retain the 600s analysis and 30s initialization timeout observations alongside the successful test-only extended-budget run; no product-default or cross-revision speedup claim.

Fixes #2259
2026-10-14 22:25:05 +08:00
morluto 6060de329d fix(release): rehearse qualified packages before publication 2026-10-14 21:51:19 +08:00
morluto c0aa2e32b3 fix(ci): include GitHub action code in static cache inputs
Invalidate typecheck, lint, built lint and Knip when action implementations or declarations change. This closes the real checker inventory gap detected by staticCheckReports on main.
2026-10-14 21:42:54 +08:00
eab789aed7 fix(managed): compare nominal signatures across metadata builds (#3059)
Compare managed member signatures using bounded, framed nominal type identities rather than build-local metadata row numbers. Preserve unresolved and historical evidence semantics, and share TypeRef, nesting and member-list facts at their producing boundaries.

Validation: current-head CI and Greptile pass; all 435 related managed tests pass. Genuine Microsoft .NET DLL CLI comparison and bounded SDK MCP paging pass without modifying targets. A local CLI filter deadline also fails on clean main; no unrelated timeout or product change is included.

Co-authored-by: JayOfTheKeyboard <140487034+JayOfTheKeyboard@users.noreply.github.com>
Co-authored-by: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-14 21:16:48 +08:00
morluto 790657dc0d fix(release): recover verified partial registry publications
Validate original exact-source qualification, release tag, retained package provenance and npm integrity before the corrected public-package canary. Publish only the existing release's MCP metadata through a shared idempotent publisher; never recreate tags or npm versions.
2026-10-14 21:15:34 +08:00
morluto 0b4fd11c8c fix(release): install the npm canary before its MCP handshake
Complete the isolated published installation before starting the protocol deadline, disable dependency lifecycle scripts consistently with package verification, and reuse that installation and cache for update validation.
2026-10-14 21:12:22 +08:00
morluto c99c6a89d6 fix(release): restore qualified runtime before the npm canary
The published-package verifier imports contracts from dist in the release checkout. Restore the exact qualification run's runtime artifact before publication so those dependencies are available without rebuilding the package.
2026-10-14 21:05:20 +08:00
3b79af28e8 chore(main): release rea-agents 6.5.0 (#1693)
* chore(main): release rea-agents 6.5.0

* docs(release): finalize contributor-aware 6.5.0 notes

* docs(release): retain verifier maintenance only in provenance

* style(release): format the contribution inventory

* docs(release): credit Windows fixes

* fix(comparison): recheck historical calls-only changes (#2223)

* fix(comparison): preserve incomplete function call evidence

Keep missing, unknown, partial and unresolved call relationships unknown in function comparisons and reconstruction claims. Aggregate IDA caller and callee coverage without overwriting uncertainty.

Validate with 144 focused tests, typecheck/lint, docs checks and test discovery. Real providers were not verified; the full headless IDA session suite requires unavailable Windows native controls.

* fix(comparison): recheck historical calls-only changes

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>

* fix(ci): isolate Linux Hopper process fixture inventory

* docs(release): credit selected-null and client setup changes

* fix(release): refresh 6.5.0 notes and align installation examples

* docs(release): clarify 6.5.0 migrations and recent fixes

* docs(release): cover omitted capabilities and refresh 6.5.0 provenance

* docs(release): pin final CI corrections in 6.5.0 inventory

* docs(release): include mutation scheduling in 6.5.0 provenance

* docs(release): include cache policy correction in 6.5.0 provenance

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
Co-authored-by: Codex <codex@users.noreply.github.com>
Co-authored-by: Lucien <164857476+dakjdakd@users.noreply.github.com>
2026-10-14 20:31:45 +08:00
morluto cbc0e97c29 test(ci): bind npm cache IDs to output consumers
Remove the blanket caller ID requirement that rejected the standalone mutation workflow. Keep producer bindings where static cache authorization and package verification consume action outputs.
2026-10-14 20:10:17 +08:00
morluto 92a0edf187 perf(ci): move full mutation sweeps off the release path
Keep fresh coverage and both real mutation preflights required in every CI tier. Run complete canonical sweeps daily or manually in isolated jobs with distinct reports, retained failure diagnostics, and explicit report-presence checks.

Preserve regression inventories, release qualification and mutation settings; remove the superseded duplicate gate test. Related: #3281.
2026-10-14 19:49:08 +08:00
N0zoM1z0andKaoru0822 1b46398795 perf(ci): preflight mutation configurations during fast feedback
Keep full qualification and standalone mutation execution intact, retain distinct reports, and preserve fail-closed quality gates.

Related: #3281

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-14 19:48:30 +08:00
morluto f75b1a416b test(browser): retain bounded diagnostics for scenario policy failures 2026-10-14 19:24:14 +08:00
morluto 0686b07546 test(doctor): retain discovered Hopper paths despite version failures 2026-10-14 19:23:11 +08:00
morluto c2b79aa462 test(doctor): separate Hopper availability and version assertions 2026-10-14 19:10:22 +08:00
morluto efe0923914 fix(release): exclude Codex automation from contributor thanks 2026-10-14 19:06:36 +08:00
YsopwnableandKaoru0822 a32b4b6ac5 test(ci): correct Rizin readiness and Hopper launcher fixtures (#3299)
Correct two independently reproduced CI fixture preconditions: close the real Rizin child's stdin before its readiness frame, and provide scoped Linux loader evidence for the Hopper doctor shell fixture. Preserve original timeouts, rejection checks, path spelling, launch prevention and cleanup.

Current-head CI passed, including both complete reverse-tools mutation passes and 1,273 unique portable test files (14,521 passed, 126 skipped, zero failures). Each issue retains its own branch/commit; the validated integration tree includes the Hopper fix from #3410. That duplicate PR can close after the same code is verified on main.

Fixes #3295
Fixes #3406

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-14 18:42:33 +08:00
morluto 60c08802a7 test(native): validate demangling through owned contracts 2026-10-14 18:14:01 +08:00
morluto 7435e79d65 test(doctor): assert platform-specific Hopper readiness and exit status 2026-10-14 18:14:01 +08:00
morluto 44d98de236 test: align malformed XML and route seed assertions with owning contracts 2026-10-14 17:55:22 +08:00
morlutoandmsaimshafique ba33c706d2 fix(setup): inspect installed skill identity for unqualified doctor
Select installed skill destinations in the existing inspection pass, retaining malformed or foreign identity facts while ignoring empty marker-only roots.

Refs: #3208, #3296

Co-authored-by: msaimshafique <msaimshafique4664@gmail.com>
2026-10-14 17:49:20 +08:00
morlutoandhaoran20100322 aade9bbcb7 fix(setup): evaluate Gemini workspace trust before settings content
Treat only ENOENT as absence. Preserve unreadable metadata errors and ignore untrusted workspace content before parsing it.

Refs: #3206, #3319

Co-authored-by: haoran20100322 <haoran20100322@outlook.com>
2026-10-14 17:49:19 +08:00
morlutoandPaoloValletta 0930e94e07 fix(setup): validate registered MCP output schema profiles
Reuse the shared profile schema before setup writes and preserve supported values through registration and startup.

Refs: #3205, #3277

Co-authored-by: PaoloValletta <paovalletta@hotmail.it>
2026-10-14 17:49:19 +08:00
morluto 3f6b5755b3 fix(managed)!: share member list facts and retain verification uncertainty
Parse TypeDef member lists once at their owning boundary, retain malformed ranges as unknown, and admit representation storage before allocation. Reuse parsed facts across member ownership, inventory, attributes, and native boundaries. Preserve constant operands in structural matching.

Refs: #3202, #3201, #3199

BREAKING CHANGE: unresolved managed/native verification results may retain a non-null matched_native and candidate facts when module identity is unknown. Consumers must use status and reason rather than assume unresolved observations are empty.
2026-10-14 17:49:18 +08:00
morluto 45b6a7fe8f fix(native): distinguish proven pre-launch failure from unknown target ownership
Emit explicit target-creation facts only when known. Invalid post-launch process handles remain unknown and retain cleanup ownership.

Refs: #3185

Validation uses bridge fakes and provider-boundary tests; no real LLDB target launch was performed.
2026-10-14 17:49:18 +08:00
morlutoandSII-YDD 2daeff4b24 fix(application): normalize owned target admission cancellation
Normalize only the exact aborted signal reason, retaining unrelated failures and descriptor ownership after cleanup failures.

Refs: #3197, #3265

Co-authored-by: SII-YDD <38822679+SII-YDD@users.noreply.github.com>
2026-10-14 17:49:18 +08:00
morlutoandhhang e67c3642c8 fix(process): retain deletions after observed roots become obstructed
Carry initial root observations into final capture. Treat ENOTDIR as absence only for a previously observed root, preserving initial obstruction and cancellation failures.

Refs: #3238, #3263

Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
2026-10-14 17:49:17 +08:00
morluto 030c477328 fix(evidence): derive bundle comparison status from classified changes
Keep digests as provenance while status follows examined deltas and unresolved coverage.

Refs: #3216
2026-10-14 17:49:17 +08:00
morluto 3a34ad37bd fix(evidence): classify noncanonical bundles at the input boundary
Use a dedicated canonical-projection error so unrelated TypeErrors retain their protocol failure meaning.

Refs: #3219
2026-10-14 17:49:16 +08:00
morluto 1250aaedd8 fix(browser): decode SAZ XML through typed encoding validation
Reuse the format-aware XML text owner, preserve decoder causes, and reject contradictory declarations even in unselected records.

Refs: #3273
2026-10-14 17:49:16 +08:00
morluto 2b60e097f2 fix(browser): preserve uncertainty and compare redirect observations
Retain scenario selection limitations independently of known changes. Compare known status, MIME and byte observations for each redirect hop without inventing missing facts.

Refs: #3172, #3173
2026-10-14 17:49:15 +08:00
morluto 5e79d468e5 fix(javascript): retain runtime candidate ambiguity
Keep referenced ambiguous candidates unknown instead of classifying them as absent.

Refs: #3192
2026-10-14 17:49:15 +08:00
morlutoandJoão Pedro de Faria 44c9d2924d fix(javascript): match feature seeds against their owning source values
Apply exact, contains, and case options to node IDs. Route seeds consume retained route values rather than generated display labels.

Refs: #3189, #3190, #3298

Co-authored-by: João Pedro de Faria <jpdefo7@hotmail.com>
2026-10-14 17:49:14 +08:00
morluto 503109995f fix(javascript): retain early-return conditions in wrapped call paths
Share sequential fallthrough interpretation between block traversal and isolated seed context.

Refs: #3196
2026-10-14 17:49:14 +08:00
morluto 28f5761973 test(mcp): isolate target-free sessions from host provider discovery
Inject explicit unavailable provider ports into the fake-session harness, forbid accidental execution, and retain public availability coverage. This removes host-dependent timeouts without increasing deadlines.
2026-10-14 17:49:13 +08:00
morlutoandhhang dae1e55381 fix(javascript): preserve lexical binding and default export capture semantics
Resolve CommonJS wrapper bindings from the parser-owned source type. Capture default identifier export values at the export statement while preserving live named bindings.

Refs: #3261, #3297

Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
2026-10-14 17:49:13 +08:00
morluto 4c99912e8d chore(main): merge pinned CI checkpoint 2895a18 2026-10-14 03:12:47 +08:00
morluto b3a60b6b03 test(ci): provide proc metadata for Linux hopper fixtures 2026-10-14 03:02:01 +08:00
morluto d5b5441a3a fix(hopper): refresh runtime cleanup against main 2026-10-14 02:27:23 +08:00
morluto 4f83c64da8 fix(hopper): merge current main into runtime cleanup 2026-10-14 02:12:58 +08:00
Morluto 780191226c test(hopper): run Python-named fixture through Node eval 2026-10-14 02:03:25 +08:00
morluto 1738989590 test: isolate hopper scanner process fixtures 2026-10-14 01:26:30 +08:00
morluto 3f18439acd fix(types): declare hopper inventory proc root 2026-10-14 01:24:48 +08:00
morluto dd401a2804 test(process): isolate hopper inventory proc root 2026-10-14 01:06:02 +08:00
morluto 2bc898fae2 chore: merge captured main into Hopper runtime cleanup 2026-10-13 21:45:06 +08:00
N0zoM1z0andKaoru0822 b2e743ef24 test(hopper): reap orphan fixtures independently of container init
Keep a test-owned Linux subreaper until token-verified process-group cleanup completes, then wait for each adopted child. Observe from a separate verifier so the orphan remains outside its lineage. Assert disappearance from procfs after reaping.

Reproduced two failures and eight retained zombies without an init reaper. The corrected fourteen process cases pass with no residual children; typecheck and lint pass.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-13 12:25:38 +00:00
morluto 51b3418f2b chore: merge upstream CI baseline fixes 2026-10-13 20:13:27 +08:00
N0zoM1z0andKaoru0822 3bb09b8d2d fix(verification): retain command-less runtime observations
Use the kernel command name for processes without argv or an executable link. Preserve uncertainty for command-less Python interpreters and detect Hopper/Xvfb zombies without signaling. Real unreaped-child regressions keep cleanup with their waiting parent.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-13 10:26:57 +00:00
N0zoM1z0andKaoru0822 3deda4781d fix(hopper): parse Python helper interpreter options
Resolve the script operand using CPython option boundaries, including combined flags, separate or attached option values, and --. Keep command/module arguments distinct and defer unknown invocation failures rather than declaring them clean.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-13 10:26:57 +00:00
N0zoM1z0andKaoru0822 2ac4795df5 test(hopper): cover a reparented Python helper command
Launch a real Python child with the helper filename, wait for readiness before the Node parent exits, bind its procfs arguments, require non-signaling detection, and clean it through the existing run-token/group identity primitive.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-13 10:26:57 +00:00
N0zoM1z0andKaoru0822 a588dc6376 fix(hopper): distinguish runtime processes from argument text
Parse procfs argument boundaries rather than searching rendered ps command text. Keep executable identity checks and deferred permission failures, eliminate the extra ps process, and put shared process observations in the serial process-boundary lane.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-13 10:26:57 +00:00
687 changed files with 112658 additions and 41619 deletions

No files matched your search

+3 -3
View File
@@ -68,9 +68,9 @@ closing-issue reporters. Grouping preserves all those credits in one line.
When Highlights, detailed entries or migrations reference the same work,
put its thanks in one of those entries, not all of them. Include issue links.
Direct-commit bullets carry the commit link and known human credit.
Exclude GitHub bots and known agent accounts. REA's observed Anthropic and
Cursor co-author trailers resolve to `@claude` and `@cursoragent` with GitHub
type `User`; the credit policy excludes them while retaining their metadata.
Exclude GitHub bots and known agent accounts. REA's observed Anthropic, Cursor
and Codex co-author trailers resolve to `@claude`, `@cursoragent` and `@codex`
with GitHub type `User`; the credit policy excludes them while retaining their metadata.
At the REA maintainer's request, omit `@morluto` self-thanks while preserving
authorship in the inventory. Other human contributors remain eligible.
Use explicit GitHub links for cross-repository references to avoid ambiguous
@@ -0,0 +1,26 @@
name: Prepare qualified release inputs
description: Restore and validate the exact qualified tarball and its verifier runtime
outputs:
version:
description: Package version validated against the source and qualified manifest
value: ${{ steps.package.outputs.version }}
tarball:
description: Absolute path to the validated qualified npm tarball
value: ${{ steps.package.outputs.tarball }}
runs:
using: composite
steps:
- name: Download the exact qualified package
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: verified-release-package
path: .cache/verified-package/
- name: Verify qualified package provenance and digest
id: package
shell: bash
run: node scripts/ci/verified-package.mjs validate .cache/verified-package
- name: Restore qualified verifier runtime
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: rea-test-runtime
path: .
+41
View File
@@ -0,0 +1,41 @@
name: Publish MCP Registry metadata
description: Validate and publish one released server.json, preserving an identical existing version
inputs:
directory:
description: Directory containing the released server.json
default: .
runs:
using: composite
steps:
- name: Install MCP Registry publisher
shell: bash
working-directory: ${{ inputs.directory }}
env:
MCP_PUBLISHER_VERSION: v1.8.0
MCP_PUBLISHER_SHA256_LINUX_AMD64: 1370446bbe74d562608e8005a6ccce02d146a661fbd78674e11cc70b9618d6cf
run: |
archive="mcp-publisher_linux_amd64.tar.gz"
curl -fsSLo "${archive}" \
"https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}/${archive}"
echo "${MCP_PUBLISHER_SHA256_LINUX_AMD64} ${archive}" | sha256sum --check --strict
tar xzf "${archive}" mcp-publisher
chmod +x mcp-publisher
- name: Validate MCP Registry metadata
shell: bash
working-directory: ${{ inputs.directory }}
run: ./mcp-publisher validate
- name: Check existing registry version
id: registry
shell: bash
working-directory: ${{ inputs.directory }}
run: node "${GITHUB_ACTION_PATH}/registry-state.mjs"
- name: Authenticate to MCP Registry
if: steps.registry.outputs.exists != 'true'
shell: bash
working-directory: ${{ inputs.directory }}
run: ./mcp-publisher login github-oidc
- name: Publish MCP Registry metadata
if: steps.registry.outputs.exists != 'true'
shell: bash
working-directory: ${{ inputs.directory }}
run: ./mcp-publisher publish
@@ -0,0 +1,4 @@
export function registryPublicationState(
server: Readonly<{ name: string; version: string } & Record<string, unknown>>,
request?: (url: URL, init: RequestInit) => Promise<Response>,
): Promise<"present" | "absent">;
@@ -0,0 +1,89 @@
import assert from "node:assert/strict";
import { appendFile, readFile } from "node:fs/promises";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
/** Exact-version routes currently return false 404s; enumerate the filtered listing. */
export async function registryPublicationState(server, request = fetch) {
assert.equal(typeof server?.name, "string");
assert.equal(typeof server?.version, "string");
const cursors = new Set();
let cursor;
const matches = [];
do {
const url = new URL(
"https://registry.modelcontextprotocol.io/v0.1/servers",
);
url.search = new URLSearchParams({
search: server.name,
version: server.version,
include_deleted: "true",
limit: "100",
}).toString();
if (cursor !== undefined) url.searchParams.set("cursor", cursor);
const response = await request(url, {
signal: AbortSignal.timeout(30_000),
});
if (!response.ok)
throw new Error(`Registry lookup failed: HTTP ${response.status}`);
const page = await response.json();
assert(Array.isArray(page?.servers), "Registry response omitted servers");
assert(
page.metadata && typeof page.metadata === "object",
"Registry response omitted metadata",
);
for (const entry of page.servers) {
assert(
typeof entry?.server?.name === "string" &&
typeof entry.server.version === "string",
"Malformed registry server record",
);
if (
entry.server.name === server.name &&
entry.server.version === server.version
)
matches.push(entry);
}
cursor = page.metadata.nextCursor;
if (cursor !== undefined) {
assert(
typeof cursor === "string" && cursor.length > 0 && !cursors.has(cursor),
"Registry returned a non-advancing cursor",
);
cursors.add(cursor);
}
} while (cursor !== undefined);
assert(
matches.length <= 1,
"Registry returned ambiguous exact-version records",
);
if (matches.length === 0) return "absent";
assert.equal(
matches[0]._meta?.["io.modelcontextprotocol.registry/official"]?.status,
"active",
"Existing registry version is not active",
);
assert.deepEqual(
matches[0].server,
server,
"Existing registry version differs from released metadata",
);
return "present";
}
if (
process.argv[1] !== undefined &&
resolve(process.argv[1]) === fileURLToPath(import.meta.url)
) {
const state = await registryPublicationState(
JSON.parse(await readFile("server.json", "utf8")),
);
assert(process.env.GITHUB_OUTPUT, "GITHUB_OUTPUT is required");
await appendFile(
process.env.GITHUB_OUTPUT,
`exists=${state === "present"}\n`,
);
process.stdout.write(
`Registry version is ${state}; ${state === "present" ? "preserving identical published metadata" : "publication may proceed"}.\n`,
);
}
+18 -4
View File
@@ -250,7 +250,7 @@ jobs:
retention-days: 7
reverse-tools-quality:
name: Reverse tools coverage and mutation
name: Reverse tools quality
needs: [changes, static]
if: needs.changes.outputs.reverse_tools == 'true'
runs-on: ubuntu-latest
@@ -266,8 +266,21 @@ jobs:
- run: npm ci
- name: Run reverse tools tests with coverage
run: npm run test:coverage:reverse-tools
- name: Report reverse tools mutation results
run: npm run test:mutation:reverse-tools
- name: Preflight both reverse tools mutation configurations
run: |
node scripts/prepare-reverse-tools-mutation.mjs
npx --no-install stryker run stryker.config.mjs --dryRunOnly
npx --no-install stryker run stryker.semantics.config.mjs --dryRunOnly
- name: Retain available reverse tools diagnostics
if: ${{ !cancelled() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: reverse-tools-quality-${{ needs.changes.outputs.tier }}-${{ github.run_attempt }}
path: |
coverage/reverse-tools/
reports/mutation/
if-no-files-found: warn
retention-days: 7
build:
name: Build package
@@ -420,7 +433,7 @@ jobs:
--outputFile.junit=test-results.xml
--outputFile.json=test-results.json
- name: Summarize slowest test files
if: needs.changes.outputs.code == 'true' && !cancelled() && hashFiles('test-timings.json') != ''
if: needs.changes.outputs.code == 'true' && !cancelled()
env:
SHARD_RESULT: ${{ needs.test-shard.result }}
SOURCE_REQUIRED: ${{ needs.changes.outputs.tier == 'fast' }}
@@ -728,6 +741,7 @@ jobs:
tests/boundary/filesystem/javascriptApplicationWorkflows.test.ts
tests/boundary/filesystem/webScriptManifestPaths.test.ts
tests/boundary/process/ProcessEvidence.host.test.ts
tests/boundary/process/windowsOutputCapture.test.ts
tests/acceptance/webModuleCli.test.ts
tests/acceptance/webSourceLocationCli.test.ts
tests/boundary/cli/referenceSourceImportStatus.test.ts
+62
View File
@@ -0,0 +1,62 @@
name: Mutation sweep
on:
schedule:
- cron: "47 4 * * *"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: mutation-${{ github.ref }}
cancel-in-progress: false
env:
HUSKY: "0"
jobs:
mutation:
name: Mutation sweep (${{ matrix.suite }})
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- suite: reverse-tools
config: stryker.config.mjs
- suite: reverse-tools-semantics
config: stryker.semantics.config.mjs
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: .nvmrc
- name: Cache npm package downloads
uses: ./.github/actions/npm-cache
- run: npm ci
- run: npm run test:prepare
- name: Run the complete configuration
env:
MUTATION_CONFIG: ${{ matrix.config }}
run: |
node scripts/prepare-reverse-tools-mutation.mjs
npx --no-install stryker run "${MUTATION_CONFIG}"
- name: Require both reports from the completed sweep
env:
REPORT_BASE: reports/mutation/${{ matrix.suite }}
run: |
test -s "${REPORT_BASE}.json"
test -s "${REPORT_BASE}.html"
- name: Retain available mutation diagnostics
if: ${{ !cancelled() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: mutation-${{ matrix.suite }}-${{ github.run_attempt }}
path: |
reports/mutation/${{ matrix.suite }}.json
reports/mutation/${{ matrix.suite }}.html
if-no-files-found: warn
retention-days: 7
+109
View File
@@ -0,0 +1,109 @@
name: Recover published release
on:
workflow_dispatch:
inputs:
version:
description: Existing npm and GitHub release version
required: true
type: string
release_run_id:
description: Original Release run with successful exact-source qualification and npm publication
required: true
type: string
concurrency:
group: release-recovery-${{ inputs.version }}
cancel-in-progress: false
jobs:
verify:
name: Verify existing published package
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
actions: read
outputs:
source_sha: ${{ steps.release.outputs.source_sha }}
version: ${{ steps.release.outputs.version }}
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version-file: .nvmrc
package-manager-cache: false
- run: npm ci
- name: Validate original release authority
id: release
env:
GH_TOKEN: ${{ github.token }}
RECOVERY_VERSION: ${{ inputs.version }}
RECOVERY_RUN_ID: ${{ inputs.release_run_id }}
run: node scripts/ci/release-recovery.mjs resolve
- name: Check out released metadata
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
ref: ${{ steps.release.outputs.source_sha }}
path: .cache/release-source
persist-credentials: false
- name: Download original qualified package
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: verified-release-package
run-id: ${{ steps.release.outputs.run_id }}
github-token: ${{ github.token }}
path: .cache/verified-package
- name: Restore original verifier runtime
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: rea-test-runtime
run-id: ${{ steps.release.outputs.run_id }}
github-token: ${{ github.token }}
path: .
- name: Match published npm bytes to the qualified package
env:
RECOVERY_VERSION: ${{ steps.release.outputs.version }}
RECOVERY_RUN_ID: ${{ steps.release.outputs.run_id }}
RECOVERY_RUN_ATTEMPT: ${{ steps.release.outputs.run_attempt }}
RECOVERY_SOURCE_SHA: ${{ steps.release.outputs.source_sha }}
RECOVERY_SOURCE_DIRECTORY: .cache/release-source
RECOVERY_ARTIFACT_DIRECTORY: .cache/verified-package
run: node scripts/ci/release-recovery.mjs verify
- name: Rehearse the original qualified tarball
env:
RECOVERY_VERSION: ${{ steps.release.outputs.version }}
run: node scripts/verify-release-artifact.mjs .cache/verified-package/package.tgz "$RECOVERY_VERSION"
- name: Verify published CLI, MCP and update
env:
RECOVERY_VERSION: ${{ steps.release.outputs.version }}
run: node scripts/verify-published-package.mjs "$RECOVERY_VERSION"
- name: Validate released registry metadata
working-directory: .cache/release-source
run: npm run mcp-registry:check
publish-mcp:
name: Finish MCP Registry publication
needs: verify
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Check out verified released metadata
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
ref: ${{ needs.verify.outputs.source_sha }}
path: .cache/release-source
persist-credentials: false
- uses: ./.github/actions/publish-mcp
with:
directory: .cache/release-source
+53 -65
View File
@@ -304,12 +304,41 @@ jobs:
with:
source_sha: ${{ needs.merged-release.outputs.sha || needs.release-please.outputs.sha }}
publish:
name: Publish to npm
rehearsal:
name: Rehearse qualified release on a clean runner
needs: [merged-release, release-please, qualification]
if: >-
always() && !cancelled() && needs.qualification.result == 'success'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
actions: read
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
ref: ${{ needs.merged-release.outputs.sha || needs.release-please.outputs.sha }}
persist-credentials: false
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version-file: .nvmrc
package-manager-cache: false
- run: npm ci
- uses: ./.github/actions/prepare-release-package
id: package
- name: Exercise the exact qualified tarball
env:
VERIFIED_PACKAGE_TARBALL: ${{ steps.package.outputs.tarball }}
VERIFIED_PACKAGE_VERSION: ${{ steps.package.outputs.version }}
run: node scripts/verify-release-artifact.mjs "$VERIFIED_PACKAGE_TARBALL" "$VERIFIED_PACKAGE_VERSION"
publish:
name: Publish to npm
needs: [merged-release, release-please, qualification, rehearsal]
if: >-
always() && !cancelled() &&
needs.qualification.result == 'success' && needs.rehearsal.result == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
@@ -327,58 +356,36 @@ jobs:
- run: npm ci
- name: Download the exact qualified package
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: verified-release-package
path: .cache/verified-package/
- name: Verify qualified package provenance and digest
- uses: ./.github/actions/prepare-release-package
id: package
run: node scripts/ci/verified-package.mjs validate .cache/verified-package
- name: Inspect existing npm version
id: registry
env:
VERIFIED_PACKAGE_TARBALL: ${{ steps.package.outputs.tarball }}
VERIFIED_PACKAGE_VERSION: ${{ steps.package.outputs.version }}
run: node scripts/ci/npm-release.mjs inspect "$VERIFIED_PACKAGE_TARBALL" "$VERIFIED_PACKAGE_VERSION"
- name: Publish
if: steps.registry.outputs.published == 'false'
shell: bash
env:
VERIFIED_PACKAGE_TARBALL: ${{ steps.package.outputs.tarball }}
VERIFIED_PACKAGE_VERSION: ${{ steps.package.outputs.version }}
run: |
version="$(node --input-type=module -e 'import packageJson from "./package.json" with { type: "json" }; process.stdout.write(packageJson.version)')"
published_version="$(npm view "rea-agents@${version}" version --json 2>/dev/null || true)"
if [ "${published_version}" = "\"${version}\"" ]; then
echo "rea-agents@${version} is already published; verifying the existing package."
else
tag="$(node scripts/release-npm-tag.mjs "${version}")"
npm publish "${VERIFIED_PACKAGE_TARBALL}" --access public --tag "${tag}"
fi
tag="$(node scripts/release-npm-tag.mjs "$VERIFIED_PACKAGE_VERSION")"
npm publish "${VERIFIED_PACKAGE_TARBALL}" --access public --tag "${tag}"
- name: Verify published npm bytes and dist-tag
env:
VERIFIED_PACKAGE_TARBALL: ${{ steps.package.outputs.tarball }}
VERIFIED_PACKAGE_VERSION: ${{ steps.package.outputs.version }}
run: node scripts/ci/npm-release.mjs verify "$VERIFIED_PACKAGE_TARBALL" "$VERIFIED_PACKAGE_VERSION"
- name: Verify published CLI from npm
shell: bash
run: |
version="$(node --input-type=module -e 'import packageJson from "./package.json" with { type: "json" }; process.stdout.write(packageJson.version)')"
verification_root="$(mktemp -d)"
trap 'rm -rf -- "${verification_root}"' EXIT
cd "${verification_root}"
max_attempts=120
sleep_seconds=15
total_window_minutes=$((max_attempts * sleep_seconds / 60))
for attempt in $(seq 1 "${max_attempts}"); do
published_version="$(npm view --prefer-online "rea-agents@${version}" version --json 2>/dev/null || true)"
if [ "${published_version}" = "\"${version}\"" ]; then
echo "rea-agents@${version} is visible on npm after attempt ${attempt}/${max_attempts}; verifying the published CLI."
npm exec --yes --package="rea-agents@${version}" -- rea --help
npm exec --yes --package="rea-agents@${version}" -- rea --llms
node "${GITHUB_WORKSPACE}/scripts/verify-published-package.mjs" "${version}"
exit 0
else
echo "rea-agents@${version} is not visible on npm yet (attempt ${attempt}/${max_attempts}; up to ${total_window_minutes} minutes)" >&2
fi
if [ "${attempt}" -lt "${max_attempts}" ]; then
sleep "${sleep_seconds}"
fi
done
echo "rea-agents@${version} did not become visible on npm within ${total_window_minutes} minutes (${max_attempts} attempts × ${sleep_seconds}s)" >&2
echo "This indicates npm registry propagation delay, not a CLI verification failure." >&2
exit 1
env:
VERIFIED_PACKAGE_VERSION: ${{ steps.package.outputs.version }}
run: node scripts/verify-published-package.mjs "$VERIFIED_PACKAGE_VERSION"
publish-mcp:
name: Publish to MCP Registry
@@ -400,23 +407,4 @@ jobs:
- name: Verify package and registry metadata versions
run: npm run mcp-registry:check
- name: Install MCP Registry publisher
env:
MCP_PUBLISHER_VERSION: v1.8.0
MCP_PUBLISHER_SHA256_LINUX_AMD64: 1370446bbe74d562608e8005a6ccce02d146a661fbd78674e11cc70b9618d6cf
run: |
archive="mcp-publisher_linux_amd64.tar.gz"
curl -fsSLo "${archive}" \
"https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}/${archive}"
echo "${MCP_PUBLISHER_SHA256_LINUX_AMD64} ${archive}" | sha256sum --check --strict
tar xzf "${archive}" mcp-publisher
chmod +x mcp-publisher
- name: Validate MCP Registry metadata
run: ./mcp-publisher validate
- name: Authenticate to MCP Registry
run: ./mcp-publisher login github-oidc
- name: Publish MCP Registry metadata
run: ./mcp-publisher publish
- uses: ./.github/actions/publish-mcp
+1 -1
View File
@@ -1,3 +1,3 @@
{
".": "6.4.0"
".": "6.5.0"
}
+113
View File
@@ -1,5 +1,118 @@
# Changelog
## [6.5.0](https://github.com/morluto/rea/compare/rea-agents-6.4.0...rea-agents-6.5.0) (2026-10-13)
Provider prerequisites and recorded verification scope are listed in [the testing guide](docs/testing.md).
### Highlights
- Analyze selected JavaScript files and recover cross-bundle relationships without expanding the selected source scope.
- Read compact summaries and page retained Evidence across binary, managed, Android, Dart, WASM and network workflows.
- Inspect SQLite snapshots, packet and signal recordings, WebAssembly, Rust dependency metadata and Electron fuses offline.
- Keep completed Evidence and partial observations available when analysis or cleanup fails.
### Changes
- **JavaScript source selection:** analyze exact application paths without expanding imports into the selected scope. Unselected files retain identity and explicit unknown coverage; summary delivery remains separate from source selection. ([#1944](https://github.com/morluto/rea/pull/1944), [issue morluto/rea#1848](https://github.com/morluto/rea/issues/1848)). Thanks @kaoru0822-kitauji, @N0zoM1z0.
- **Code-split recovery:** recover related bundles from multiple selected inputs, retaining per-file provenance and downstream cross-chunk imports. Recorded CLI/MCP coverage is Linux x64 with Wakaru 1.14.0 and source-owned esbuild/webpack fixtures; other hosts, releases and arbitrary application equivalence remain unverified. ([#1686](https://github.com/morluto/rea/pull/1686), [issue morluto/rea#1605](https://github.com/morluto/rea/issues/1605)). Thanks @JingHao-Leon, @pionxzh.
- **Package imports:** resolve exact package import aliases using the selected loader and package ancestry, rather than guessing sibling files. ([#1862](https://github.com/morluto/rea/pull/1862), [issue morluto/rea#1838](https://github.com/morluto/rea/issues/1838)). Thanks @AWUQAQ, @mvanhorn.
- **Retained analysis views:** opt into compact inventory/WASM, managed metadata, Android manifest, Dart AOT, Mach-O and EVM summaries, then page retained Evidence without rerunning analysis. Summary delivery preserves the complete recorded result and its original coverage. ([#2122](https://github.com/morluto/rea/pull/2122), [#2193](https://github.com/morluto/rea/pull/2193), [#2413](https://github.com/morluto/rea/pull/2413), [#2438](https://github.com/morluto/rea/pull/2438), [#2455](https://github.com/morluto/rea/pull/2455), [#2634](https://github.com/morluto/rea/pull/2634), [#2308](https://github.com/morluto/rea/pull/2308), [9a18251](https://github.com/morluto/rea/commit/9a18251426f891e6a24856b715ef8002ab8b9610)). Thanks @kaoru0822-kitauji, @N0zoM1z0.
- **Managed assemblies:** Select declaring types when inspecting members, decode inspected `ldstr` literals with independent coverage, and page retained member summaries. Call and field targets expose `target_declaring_type` and `field_declaring_type`, including supported generic method targets; unresolved metadata remains unknown. ([#1706](https://github.com/morluto/rea/pull/1706), [#2125](https://github.com/morluto/rea/pull/2125), [issue morluto/rea#2121](https://github.com/morluto/rea/issues/2121), [#2162](https://github.com/morluto/rea/pull/2162), [issue morluto/rea#2158](https://github.com/morluto/rea/issues/2158), [#3061](https://github.com/morluto/rea/pull/3061), [issue morluto/rea#3010](https://github.com/morluto/rea/issues/3010), [#2163](https://github.com/morluto/rea/pull/2163), [issue morluto/rea#2160](https://github.com/morluto/rea/issues/2160)). Thanks @kaoru0822-kitauji, @N0zoM1z0, @Nelglor, @skoodster.
- **Packet captures:** inspect saved packets with bounded TShark output, compact capture summaries and retained pages; discover installed protocol/field definitions. Recorded real-engine coverage uses Linux and Wireshark 4.6.6; native Windows/macOS and Bun behavior remain unverified. ([#2318](https://github.com/morluto/rea/pull/2318), [#2340](https://github.com/morluto/rea/pull/2340), [#2496](https://github.com/morluto/rea/pull/2496)). Thanks @3QL, @N0zoM1z0, @Olorinm.
- **Recorded signals:** decode existing recordings and discover installed decoders/options through caller-supplied sigrok-cli 0.7.2. This is Linux-only and requires util-linux `prlimit`; it acquires no hardware samples. ([#2339](https://github.com/morluto/rea/pull/2339), [#2487](https://github.com/morluto/rea/pull/2487)). Thanks @N0zoM1z0, @Olorinm.
- **Web captures:** derive an inferred method/origin/path-template API surface from retained HAR data including observed query-parameter names while retaining unknowns; query values, headers and bodies remain excluded. ([#1891](https://github.com/morluto/rea/pull/1891), [#2982](https://github.com/morluto/rea/pull/2982), [issue morluto/rea#2913](https://github.com/morluto/rea/issues/2913)). Thanks @mvanhorn, @wunianze666-netizen, @zhangguiping-xydt.
- **QUIC captures:** inspect retained aioquic 1.5.0 JSON qlog 0.3 objects and page traces/streams/observations. Other qlog layouts remain unsupported; overlap and loss declarations do not prove retransmission or network loss. ([#2277](https://github.com/morluto/rea/pull/2277)). Thanks @LuisTaffelli, @N0zoM1z0.
- **Fiddler captures:** inspect native SAZ archives with retained HTTP provenance and bounded decoding. Recorded producer coverage is the pinned public encoding corpus; current Fiddler Everywhere variants and Bun-native execution remain unverified. ([#2409](https://github.com/morluto/rea/pull/2409)). Thanks @N0zoM1z0, @zahhak.
- **SQLite snapshots:** inspect an explicitly selected offline database with table/column selection and bounded Evidence. This operation requires Node 24.x >=24.15 or 26+ with `DatabaseSync.limits`; supported Node 22 and earlier 24 runtimes cannot use it. A live database/WAL copy does not establish an atomic snapshot. ([#2271](https://github.com/morluto/rea/pull/2271)). Thanks @N0zoM1z0, @Y0UW1SH.
- **WASM artifacts:** Inspect local modules with bring-your-own WABT 1.0.42 without executing them. Compare imports/exports from two complete core-module inspection Evidence records without requiring an active WABT installation; unsupported signatures and duplicate identities remain unknown, and comparisons do not establish runtime compatibility. Recorded real-tool inspection coverage is macOS arm64. ([#1533](https://github.com/morluto/rea/pull/1533), [issue morluto/rea#884](https://github.com/morluto/rea/issues/884), [#2464](https://github.com/morluto/rea/pull/2464), [issue morluto/rea#2356](https://github.com/morluto/rea/issues/2356)). Thanks @matbrgz, @N0zoM1z0, @thangldw.
- **Go binaries:** inspect embedded build metadata, including file-backed unmapped Mach-O debug segments. ([#1363](https://github.com/morluto/rea/pull/1363), [7fb097d](https://github.com/morluto/rea/commit/7fb097d72c9931dd5dfae481ad2b9d3bb6029f15)). Thanks @Y0UW1SH.
- **Flutter APKs:** identify snapshot/engine builds and inspect AOT structure without an external engine. Recorded real APK coverage uses the documented Flutter Gallery fixture; macOS/Windows and complete pool semantics remain unverified, and pool coverage stays partial. ([#1582](https://github.com/morluto/rea/pull/1582)). Thanks @3QL.
- **HarmonyOS packages:** inventory HAP/HSP/App Pack structures without executing code. The recorded real workflow covers one pinned HAP through repository-built CLI/MCP; installed-package and real HSP/App Pack coverage remain unverified. ([#1447](https://github.com/morluto/rea/pull/1447)). Thanks @BaaRai.
- **Ghidra raw inputs and references:** compatible Linux/macOS Ghidra profiles accept caller-selected raw architecture/entry information and expose typed incoming references at exact addresses. Windows Ghidra P0 admits the raw NMOS 6502 profile described below; other raw targets and the incoming-reference facet remain outside Windows P0. ([#1868](https://github.com/morluto/rea/pull/1868), [issue morluto/rea#1836](https://github.com/morluto/rea/issues/1836), [#1715](https://github.com/morluto/rea/pull/1715), [issue morluto/rea#1245](https://github.com/morluto/rea/issues/1245)). Thanks @bugstan, @casesolved-co-uk, @mvanhorn, @N0zoM1z0.
- **Ghidra MIPS:** Add bounded MIPS32r2/o32 relocatable objects, soft-float integer-register storage, admitted MIPS16 shared ELF, and a narrowly admitted recordless legacy MIPS32 executable profile. The latter pins an endian-matched 32-bit language and records inferred o32 as an analysis assumption. Admission follows each documented ABI/flag/relocation boundary. ([#1949](https://github.com/morluto/rea/pull/1949), [issue morluto/rea#1937](https://github.com/morluto/rea/issues/1937), [#1950](https://github.com/morluto/rea/pull/1950), [issue morluto/rea#1938](https://github.com/morluto/rea/issues/1938), [#1991](https://github.com/morluto/rea/pull/1991), [issue morluto/rea#1851](https://github.com/morluto/rea/issues/1851), [#1898](https://github.com/morluto/rea/pull/1898), [issue morluto/rea#1620](https://github.com/morluto/rea/issues/1620)). Thanks @AurelioB, @BaaRai, @bqw371, @kaoru0822-kitauji, @N0zoM1z0.
- **Ghidra RISC-V:** admit little-endian RV32/RV64 `ET_EXEC` ELF declaring the supported double-float ABI. Relocatable/shared, big-endian and other ABI profiles remain refused; see [the profile and recorded lane](docs/ghidra-riscv.md). ([#2151](https://github.com/morluto/rea/pull/2151)). Thanks @NIU-123370.
- **PSP static ELF profile:** the Ghidra profile is Linux x64, bounded little-endian ELF32 `ET_EXEC` with the documented PSP/ABI declarations and a compatible caller-installed Allegrex extension. PRX, shared/relocatable images, PBP/ISO/CSO and runtime emulation are outside scope. Historical extension experiments are separate from public-provider verification; real public Ghidra PSP coverage remains unverified. ([#1599](https://github.com/morluto/rea/pull/1599)). Thanks @jaelliot.
- **Ghidra analysis settings:** apply validated analyzer overrides before analysis while retaining the selected analysis profile. ([#1913](https://github.com/morluto/rea/pull/1913)). Thanks @akushonkamen, @kaoru0822-kitauji, @N0zoM1z0.
- **Attached native IDA MCP:** add an optional native bridge alongside existing legacy/headless profiles. Recorded native runs use Linux IDA Free 9.4 with a navigation correction and Windows IDA Pro 9.3 with a loopback-listener change; stock native switching, native macOS and Windows IDA Free remain unverified. Attached databases remain read-only and are never saved or closed. ([#1544](https://github.com/morluto/rea/pull/1544)). Thanks @imissapixel, @N0zoM1z0.
- **Frida instrumentation:** add explicit local/remote target selection, caller-supplied scripts and retained messages, with script-read/input diagnostics and bounded message eviction. Recorded real coverage is the Linux local Node marker workflow; macOS, Windows and remote devices/servers remain unverified. Instrumentation executes foreign code and is destructive, not read-only. ([#1359](https://github.com/morluto/rea/pull/1359), [#2211](https://github.com/morluto/rea/pull/2211), [issue morluto/rea#2209](https://github.com/morluto/rea/issues/2209), [#2217](https://github.com/morluto/rea/pull/2217), [issue morluto/rea#2213](https://github.com/morluto/rea/issues/2213), [#2628](https://github.com/morluto/rea/pull/2628)). Thanks @dandgabr, @kaoru0822-kitauji, @N0zoM1z0.
- **Client setup:** register Qoder, Trae, ZCode, DeepSeek Harness, Kimi Code, Factory Droid and WorkBuddy through the existing scoped setup flow. DeepSeek is included from 6.5.0; the historical npm 6.4 check did not cover it. Live Trae and DeepSeek API integration remain unverified. ([#1564](https://github.com/morluto/rea/pull/1564), [#1572](https://github.com/morluto/rea/pull/1572), [#1573](https://github.com/morluto/rea/pull/1573), [#1929](https://github.com/morluto/rea/pull/1929), [issue morluto/rea#1839](https://github.com/morluto/rea/issues/1839), [#2744](https://github.com/morluto/rea/pull/2744), [#2309](https://github.com/morluto/rea/pull/2309), [#3041](https://github.com/morluto/rea/pull/3041), [issue morluto/rea#3040](https://github.com/morluto/rea/issues/3040)). Thanks @0xRafie, @BaaRai, @cainiao1992, @IvenKooLab, @whoishaha, @ysntony.
- **Website:** Add maintained language editions, persistent/system-aware themes, keyboard styling and nested Evidence indentation, plus the reverse-engineering models essay. A simpler home page and beginner journey connect platform prerequisites, client/provider setup and a supplied first investigation. ([#1779](https://github.com/morluto/rea/pull/1779), [issue morluto/rea#1022](https://github.com/morluto/rea/issues/1022), [#1699](https://github.com/morluto/rea/pull/1699), [#1714](https://github.com/morluto/rea/pull/1714), [#1894](https://github.com/morluto/rea/pull/1894), [#2250](https://github.com/morluto/rea/pull/2250), [#2432](https://github.com/morluto/rea/pull/2432), [#2732](https://github.com/morluto/rea/pull/2732), [#3274](https://github.com/morluto/rea/pull/3274)). Thanks @CassieFox23, @kaoru0822-kitauji, @N0zoM1z0.
- **Rust dependency metadata:** Inspect embedded cargo-auditable package/dependency records in ELF, PE and thin Mach-O without executing the file. Missing metadata and inferred compiler hashes retain explicit limitations; universal Mach-O requires a selected thin slice. ([#2456](https://github.com/morluto/rea/pull/2456)). Thanks @mvanhorn.
- **Electron fuses:** Read packaged fuse bytes and per-slice runtime implications without launching or modifying the app. Missing, truncated and unknown wires remain explicit; fuse observations do not prove other Inspector-enablement paths. ([#2399](https://github.com/morluto/rea/pull/2399)). Thanks @kaoru0822-kitauji, @mvanhorn, @N0zoM1z0.
- **Ghidra PowerPC:** Admit bounded ELF32 big-endian `ET_EXEC` PowerPC with an explicit language profile on supported Linux/macOS hosts. PPC64, DOL and other variants remain outside this lane; see [the profile and verification prerequisites](docs/ghidra-ppc.md). ([#1747](https://github.com/morluto/rea/pull/1747)). Thanks @arielfikru.
- **Reference-source summaries:** Use CLI `import-reference-source --detail summary` for compact manifest, count, state and path-outline output. The complete graph remains available and is still the default; hidden outline entries retain separate coverage counts. ([#2768](https://github.com/morluto/rea/pull/2768), [issue morluto/rea#2442](https://github.com/morluto/rea/issues/2442)). Thanks @matbrgz, @To3akaRin.
- **Recorded AArch64 crashes:** Decode 34 ABI register values per thread from supported Linux ELF64 little-endian core notes using the documented caller-provided Python dependencies. These are recorded facts, not proof of current process or library identity. ([#2505](https://github.com/morluto/rea/pull/2505), [issue morluto/rea#2353](https://github.com/morluto/rea/issues/2353)). Thanks @matbrgz, @NIU-123370.
- **Ghidra byte search:** Search initialized analyzed memory using wildcards, bit masks, address bounds and paged results. Unloaded, overlay and uninitialized blocks retain skipped coverage; this is not a raw-file search. ([#2341](https://github.com/morluto/rea/pull/2341)). Thanks @mvanhorn.
- **Raw NMOS 6502 images:** Analyze explicitly selected headerless images with Ghidra, including Windows P0, using a caller-selected entry and source mapping within the 16-bit address space. Cartridge parsing, reset-vector inference and 65C02/65816 are outside this profile. ([#2079](https://github.com/morluto/rea/pull/2079)). Thanks @Zhong-fan.
- **Swift String observations:** Ghidra function dossiers derive supported AArch64 Swift String literals from constant-register pairs at recognized use sites, retaining instruction/register provenance and explicit omissions. This is a bounded derivation, not a complete string inventory. ([#2049](https://github.com/morluto/rea/pull/2049), [issue morluto/rea#2030](https://github.com/morluto/rea/issues/2030)). Thanks @thefolahan.
- **Headless IDA procedure lookup:** Resolve addresses to canonical containing-procedure entries and identify the session’s admitted program document in the modern headless profile. Incomplete surveys remain errors; attached profiles do not advertise this containment capability. ([#2374](https://github.com/morluto/rea/pull/2374), [issue morluto/rea#2335](https://github.com/morluto/rea/issues/2335)). Thanks @nikolay-dementiev.
- **Passive browser attachment:** Six existing passive browser tools accept an explicit-port loopback browser WebSocket endpoint when HTTP target discovery is unavailable. Existing consent and target/origin checks remain required; this does not launch a browser or enable runtime instrumentation. ([#2346](https://github.com/morluto/rea/pull/2346)). Thanks @all-black-493.
- **Android DEX references:** Retain exact method descriptors and individual direct-invoke observations with source method, DEX entry, opcode and code-unit offset. These are static references; unavailable instruction facts remain separate from method-level usage totals. ([#2439](https://github.com/morluto/rea/pull/2439)). Thanks @LcokHcak.
- **Offline EVM metadata:** Retain bounded, lossless facts from plausible terminal Solidity CBOR root-map candidates. Candidates do not prove Solidity origin or source/compiler identity, and linked metadata is not fetched. ([#2790](https://github.com/morluto/rea/pull/2790)). Thanks @matbrgz.
### Fixes
- **JavaScript loader and export identity:** Respect import/require conditions and unavailable package metadata, keep export links separate from writes, and resolve default identifier exports to the value captured at the export statement. ([7e5cffa](https://github.com/morluto/rea/commit/7e5cffa2ae9dfc9afaeca0715110d4dd41c0dcdd), [322506d](https://github.com/morluto/rea/commit/322506d0c0d39d3cd1e2e1c285c2cc23cfa73ee7), [81f7638](https://github.com/morluto/rea/commit/81f763820319a762f003cf95651ed14ce9326a4c), [dae1e55](https://github.com/morluto/rea/commit/dae1e55381f0d6cfee7f2082d5d27b938e55704c)). Thanks @paoValle, @VarunGore36, @xu91102.
- **JavaScript traces:** Retain nested bridge calls and surviving early-return predicates. Honor node-ID match options, match route seeds against source values, and keep ambiguous runtime candidates unknown. ([0351328](https://github.com/morluto/rea/commit/0351328e54ce70ea3f2814482e76b132774aff48), [5031099](https://github.com/morluto/rea/commit/503109995f9dcf8a955585d39a344fc846d2f59e), [44c9d29](https://github.com/morluto/rea/commit/44c9d2924d5b95d7a86595e8d7b7cf4fd4f0f6ac), [5e79d46](https://github.com/morluto/rea/commit/5e79d468e5864204cbe79a7ca2898541cee5e012)). Thanks @jpdefo.
- **Browser comparison coverage:** Compare only known redirect response fields and retain network-selection recovery guidance alongside independent event changes. Missing response facts do not prove equality or a change. ([2b60e09](https://github.com/morluto/rea/commit/2b60e097f281f7708c69f1f7ba9263694547bcc0)).
- **Evidence comparison and ledger input:** Report display-only bundle differences as unchanged while retaining digests, and classify noncanonical bundle records as invalid caller input. ([030c477](https://github.com/morluto/rea/commit/030c47732833c9cedcc31db1309eb3a1ca2c62e8), [3a34ad3](https://github.com/morluto/rea/commit/3a34ad37bdb7b8debba0f6515ba85b80141f2716)).
- **Capture and admission cleanup:** Keep deleted-file observations and original bytes when a parent becomes a file, preserve unrelated I/O failures during cancellation, and require explicit pre-launch proof before releasing an unknown LLDB target owner. LLDB failure controls used simulated boundaries. ([e67c364](https://github.com/morluto/rea/commit/e67c3642c8920a2a9c0e231ee2f16f50b245df31), [2daeff4](https://github.com/morluto/rea/commit/2daeff4b243e1cd137c591ca394e18a1c05c8bbc), [45b6a7f](https://github.com/morluto/rea/commit/45b6a7fe8f51a89951aaa823ffa627f6f5453a33)). Thanks @SII-YDD, @xu91102.
- **Client configuration:** Validate MCP output-schema profiles before setup writes, ignore untrusted Gemini workspace settings before parsing them, and identify installed skills independently of marker-only client roots. ([0930e94](https://github.com/morluto/rea/commit/0930e94e077ab7fb4d695f62785919a8a25c2e21), [aade9bb](https://github.com/morluto/rea/commit/aade9bbcb79aa8504ab6921b25f8ab082aba78e7), [ba33c70](https://github.com/morluto/rea/commit/ba33c706d26b63e43308be50c0249c72cff62cc6)). Thanks @CmsChase, @paoValle, @sx4im.
- **Host tool discovery:** Share macOS Hopper launcher discovery across setup and runtime, preserve explicit paths, and report validated ADB and Apktool availability. ([7582f0d](https://github.com/morluto/rea/commit/7582f0dff29ae0e80c97b885ddd386ac61a92570), [e5deb83](https://github.com/morluto/rea/commit/e5deb832cb09bb524877d0df40f49d5b5bb7dea4)). Thanks @Chessing234, @kaoru0822-kitauji, @viniciusdsandrade.
- **SAZ encoding validation:** Reject invalid XML bytes, unsupported encodings and declarations that contradict the archive bytes, including records outside the selected request. ([1250aae](https://github.com/morluto/rea/commit/1250aaedd8b4d1e471d8a382f76418bde65c05d2)).
- **Managed member matching:** Keep malformed TypeDef list ownership unknown, distinguish constants during structural method matching, and accept legacy small exception-section sizes. ([3f6b575](https://github.com/morluto/rea/commit/3f6b5755b3e699bd9373641acffe0f2c5d2ab094), [ee5cfbe](https://github.com/morluto/rea/commit/ee5cfbe05cd309a88003c711721e67a3bee36554)).
- **Bounded diagnostics:** Bound SDK validation messages and terminal normalization before allocation while retaining diagnostics and explicit unknown final output sizes. ([7fb0a0c](https://github.com/morluto/rea/commit/7fb0a0cc577f7c9033a2674d877d8242b5864556), [1d826f3](https://github.com/morluto/rea/commit/1d826f304f032acfe69dad3ff824b300aacaeb43)). Thanks @CRYPTONIKAV.
- **Windows artifact classification:** identify `.exe`, `.com`, `.bat` and `.cmd` artifacts as launchable host executables. ([#1823](https://github.com/morluto/rea/pull/1823), [#1824](https://github.com/morluto/rea/pull/1824), [issue morluto/rea#1819](https://github.com/morluto/rea/issues/1819)). Thanks @dollarsmoney, @JasonBuildAI, @kaoru0822-kitauji.
- **CLI/MCP delivery:** defer command-specific startup work, bundle runtime entries, retain field/input correction details across output formats and preserve shared optional-provider lifetime. MCP selectors, paging continuation and retained partial-error references remain explicit; session liveness/provider-attribution corrections retain their controlled-provider verification limits. ([#1691](https://github.com/morluto/rea/pull/1691), [issue morluto/rea#1685](https://github.com/morluto/rea/issues/1685), [#1705](https://github.com/morluto/rea/pull/1705), [issue morluto/rea#1695](https://github.com/morluto/rea/issues/1695), [#1755](https://github.com/morluto/rea/pull/1755), [issue morluto/rea#1746](https://github.com/morluto/rea/issues/1746), [#1773](https://github.com/morluto/rea/pull/1773), [issue morluto/rea#1771](https://github.com/morluto/rea/issues/1771), [#1780](https://github.com/morluto/rea/pull/1780), [#1814](https://github.com/morluto/rea/pull/1814), [#1910](https://github.com/morluto/rea/pull/1910), [issue morluto/rea#1849](https://github.com/morluto/rea/issues/1849), [#1996](https://github.com/morluto/rea/pull/1996), [#2140](https://github.com/morluto/rea/pull/2140), [issue morluto/rea#2135](https://github.com/morluto/rea/issues/2135), [#2205](https://github.com/morluto/rea/pull/2205), [issue morluto/rea#2195](https://github.com/morluto/rea/issues/2195), [#2230](https://github.com/morluto/rea/pull/2230), [issue morluto/rea#2180](https://github.com/morluto/rea/issues/2180), [#2294](https://github.com/morluto/rea/pull/2294), [#2482](https://github.com/morluto/rea/pull/2482), [a82d14e](https://github.com/morluto/rea/commit/a82d14e4db4dca989ffa2e7dbe78fd43551da256), [a4dd4e8](https://github.com/morluto/rea/commit/a4dd4e8e8700ce350e1a0c612ebd61b91ca5e585), [48c352b](https://github.com/morluto/rea/commit/48c352b6bfa34c820a530272cd36600158c37b1e), [07b36c1](https://github.com/morluto/rea/commit/07b36c148946f46b99a4ce04e55726e97d0ee03a), [570c40c](https://github.com/morluto/rea/commit/570c40cde55d31e455ef9bc484b7b908658ded58), [8fc2043](https://github.com/morluto/rea/commit/8fc2043eb8bcedbf34dce064f977e455438635d6), [7fc0b5e](https://github.com/morluto/rea/commit/7fc0b5ec9c2532bbf789d7783b7a0cab6fc054d8)). Thanks @369Apps, @chqcjq, @cold-atom, @coygeek, @JackOdegard, @kaoru0822-kitauji, @N0zoM1z0, @sx4im.
- **Evidence import/replay:** import bundles across session transitions while authenticating selected target and file identities, preserve literal keys, metadata/mutation intent and relationship coverage, and honor cancellation before session mutation. Reuse authenticated snapshots and comparisons within their owned lifetime; reject malformed/non-object snapshots and unsupported metadata without disguising uncertainty. ([#1694](https://github.com/morluto/rea/pull/1694), [#1716](https://github.com/morluto/rea/pull/1716), [issue morluto/rea#1680](https://github.com/morluto/rea/issues/1680), [#1721](https://github.com/morluto/rea/pull/1721), [issue morluto/rea#1718](https://github.com/morluto/rea/issues/1718), [#1733](https://github.com/morluto/rea/pull/1733), [issue morluto/rea#1723](https://github.com/morluto/rea/issues/1723), [issue morluto/rea#1724](https://github.com/morluto/rea/issues/1724), [#1776](https://github.com/morluto/rea/pull/1776), [#1873](https://github.com/morluto/rea/pull/1873), [#2001](https://github.com/morluto/rea/pull/2001), [#2013](https://github.com/morluto/rea/pull/2013), [issue morluto/rea#2009](https://github.com/morluto/rea/issues/2009), [#2083](https://github.com/morluto/rea/pull/2083), [#2303](https://github.com/morluto/rea/pull/2303), [#2685](https://github.com/morluto/rea/pull/2685), [issue morluto/rea#2675](https://github.com/morluto/rea/issues/2675), [c002b89](https://github.com/morluto/rea/commit/c002b89e2d8130a3c07e25e5fd604876be18c703), [9c85114](https://github.com/morluto/rea/commit/9c8511409c0706f9979c2b68dd56aaaf9f21e191), [aada0ca](https://github.com/morluto/rea/commit/aada0ca8126bf14c60750a4ccd4a79667770a1e4), [4a4d36f](https://github.com/morluto/rea/commit/4a4d36f881861bbab3c734b0dd459f805766caec), [1c64fe3](https://github.com/morluto/rea/commit/1c64fe3eff48679c6880f42d2f0a4af46686ade7), [6fb3a34](https://github.com/morluto/rea/commit/6fb3a345fe952b8e8f59221aec993acc37ccbf31), [3bcc68c](https://github.com/morluto/rea/commit/3bcc68c037e9415c78093cb286069c1fcca6a2f8), [6bae774](https://github.com/morluto/rea/commit/6bae774328724403255590aa2ddad4d7a2aa727f), [e997085](https://github.com/morluto/rea/commit/e9970855ba16ba711816ac30212c5ca17ae085cd), [d1dcebc](https://github.com/morluto/rea/commit/d1dcebce2c0820469ed63e33497a14258971b710), [b123b2e](https://github.com/morluto/rea/commit/b123b2e51cc7d6d2157525664be2df88fb1ba3bd), [049132a](https://github.com/morluto/rea/commit/049132ab43fa962d31774f2b258c15a71217148b), [042dcaa](https://github.com/morluto/rea/commit/042dcaa1ee66f1b8668f08b193f38ab01bceaacb), [acf75e6](https://github.com/morluto/rea/commit/acf75e6700ace28bb1db25e54e56673ac15e0ed3), [1f7f808](https://github.com/morluto/rea/commit/1f7f808c4f3bb5eca6b13bcc71d5cceb2ace6614), [26bffb9](https://github.com/morluto/rea/commit/26bffb94bf80355c35e22a98a8fc629c6210307e)). Thanks @coygeek, @DeryFerd, @jiangjiang248, @kaoru0822-kitauji, @khanukov, @N0zoM1z0, @NIU-123370, @rohitg00, @sx4im.
- **Ghidra setup and analysis:** preserve launcher/JVM diagnostics, Java-property and extension identity, stale-client recovery, UTF-8 bridge output and pending-startup progress. File-offset decompilation is Ghidra-specific; recorded coverage is Linux x64 with Ghidra 12.1.4. Startup/progress/compiler failure paths that use simulations remain unverified with a real engine. ([#1698](https://github.com/morluto/rea/pull/1698), [#1877](https://github.com/morluto/rea/pull/1877), [#1931](https://github.com/morluto/rea/pull/1931), [#2011](https://github.com/morluto/rea/pull/2011), [issue morluto/rea#1992](https://github.com/morluto/rea/issues/1992), [#2014](https://github.com/morluto/rea/pull/2014), [#2101](https://github.com/morluto/rea/pull/2101), [issue morluto/rea#2078](https://github.com/morluto/rea/issues/2078), [#2206](https://github.com/morluto/rea/pull/2206), [issue morluto/rea#2204](https://github.com/morluto/rea/issues/2204), [2187e16](https://github.com/morluto/rea/commit/2187e16f149a7a7b512a4cb45d5f468cc04091fe), [b953f96](https://github.com/morluto/rea/commit/b953f96c0aae27e1876c317a8f7db1d6f292b8ff)). Thanks @EDMND-SRC, @Ha1baraA11, @kaoru0822-kitauji, @lovecontroing, @lyly-bonbon, @N0zoM1z0, @nosmile99, @Petru101, @sx4im, @Zhong-fan.
- **Process and cleanup ownership:** retain private runtime/file owners and detailed incomplete-cleanup observations, bound trace cycles/order state, preserve caller paths, and use monotonic time for budgets while retaining wall dates. Windows affinity/admission ([#2202](https://github.com/morluto/rea/pull/2202), [issue morluto/rea#2181](https://github.com/morluto/rea/issues/2181)) and Bun memory-enforcement paths retain their recorded native-versus-controlled-fixture limits; these fixes are not a general process-ownership guarantee. ([#1700](https://github.com/morluto/rea/pull/1700), [issue morluto/rea#1697](https://github.com/morluto/rea/issues/1697), [#1730](https://github.com/morluto/rea/pull/1730), [#1756](https://github.com/morluto/rea/pull/1756), [issue morluto/rea#1753](https://github.com/morluto/rea/issues/1753), [#1760](https://github.com/morluto/rea/pull/1760), [issue morluto/rea#1757](https://github.com/morluto/rea/issues/1757), [#1826](https://github.com/morluto/rea/pull/1826), [#1907](https://github.com/morluto/rea/pull/1907), [issue morluto/rea#1856](https://github.com/morluto/rea/issues/1856), [#1999](https://github.com/morluto/rea/pull/1999), [issue morluto/rea#1993](https://github.com/morluto/rea/issues/1993), [#2232](https://github.com/morluto/rea/pull/2232), [issue morluto/rea#2170](https://github.com/morluto/rea/issues/2170), [#2252](https://github.com/morluto/rea/pull/2252), [issue morluto/rea#2218](https://github.com/morluto/rea/issues/2218), [#2467](https://github.com/morluto/rea/pull/2467), [issue morluto/rea#2257](https://github.com/morluto/rea/issues/2257), [#2468](https://github.com/morluto/rea/pull/2468), [#2488](https://github.com/morluto/rea/pull/2488), [09b6828](https://github.com/morluto/rea/commit/09b68285166bef2b7633402c8adf7eb25823b47e), [7285e15](https://github.com/morluto/rea/commit/7285e15839a4fecf9940683699b781a60ccc4775), [b5ededd](https://github.com/morluto/rea/commit/b5ededd0f9c28d0f696a205103066928117368ee), [d8c76b6](https://github.com/morluto/rea/commit/d8c76b629639bda4405afa9ae2f7676b694f2f10), [98d8470](https://github.com/morluto/rea/commit/98d8470d36cfbf7cd25820a4ed430aebae20c0c5), [c22111e](https://github.com/morluto/rea/commit/c22111eca2c4bc84a084f12711f405b3e7422a40), [cecc6ec](https://github.com/morluto/rea/commit/cecc6ecbffe84689a173d1634f342e046b0c8ceb), [10935b7](https://github.com/morluto/rea/commit/10935b7b1136accab2a43b308ab380749da0f7ae), [63e796d](https://github.com/morluto/rea/commit/63e796d50ea323ae8dcfef80f86c8154bb106790), [d9e9fb2](https://github.com/morluto/rea/commit/d9e9fb2273543caab4eb21d896c33d462ada6971), [9049dba](https://github.com/morluto/rea/commit/9049dbaf0c3df32357419f9899965df2b611f493), [ed881c6](https://github.com/morluto/rea/commit/ed881c6d2ef6a8adba0c2a241ebc9ab4603b7868)). Thanks @Ashen00001, @charan-rathore, @coygeek, @EDMND-SRC, @JasonBuildAI, @jimpablo, @kaoru0822-kitauji, @N0zoM1z0, @NIU-123370, @Rinkia, @rudycelekli, @sx4im, @xeropresence, @XiaoBinGan, @xthunder0, @hzh666kevin-hue.
- **Native image identity:** preserve universal Mach-O containers and selected slice/subtype identity, chained fixup locations and library ordinals, exact signing text, PE resource capacity and ELF/header framing. Mach-O summary selection and independent slice commands avoid unnecessary delivery/work. Controlled routing/parser fixtures do not establish every installed-provider path. ([#1703](https://github.com/morluto/rea/pull/1703), [issue morluto/rea#1702](https://github.com/morluto/rea/issues/1702), [#1708](https://github.com/morluto/rea/pull/1708), [#1709](https://github.com/morluto/rea/pull/1709), [#1713](https://github.com/morluto/rea/pull/1713), [#1772](https://github.com/morluto/rea/pull/1772), [issue morluto/rea#1765](https://github.com/morluto/rea/issues/1765), [#1784](https://github.com/morluto/rea/pull/1784), [issue morluto/rea#1775](https://github.com/morluto/rea/issues/1775), [#1982](https://github.com/morluto/rea/pull/1982), [#1995](https://github.com/morluto/rea/pull/1995), [issue morluto/rea#1990](https://github.com/morluto/rea/issues/1990), [#2040](https://github.com/morluto/rea/pull/2040), [#2107](https://github.com/morluto/rea/pull/2107), [#2161](https://github.com/morluto/rea/pull/2161), [issue morluto/rea#2105](https://github.com/morluto/rea/issues/2105), [#2248](https://github.com/morluto/rea/pull/2248), [issue morluto/rea#2176](https://github.com/morluto/rea/issues/2176), [#2281](https://github.com/morluto/rea/pull/2281), [issue morluto/rea#2274](https://github.com/morluto/rea/issues/2274), [#2292](https://github.com/morluto/rea/pull/2292), [#2466](https://github.com/morluto/rea/pull/2466), [#2506](https://github.com/morluto/rea/pull/2506), [#2733](https://github.com/morluto/rea/pull/2733), [issue morluto/rea#2661](https://github.com/morluto/rea/issues/2661), [f598bab](https://github.com/morluto/rea/commit/f598bab488e38c378d69346fa3c106f9e18529ed), [108b5f9](https://github.com/morluto/rea/commit/108b5f94254281639badd25b1f448cca35dc89a2), [f1924cf](https://github.com/morluto/rea/commit/f1924cf9c1910d5d29d11e7bf634b51af8d738cf), [8bd5ba2](https://github.com/morluto/rea/commit/8bd5ba2d234cbd9a5bb9dd5daeaa191c3a1cad24), [b38429c](https://github.com/morluto/rea/commit/b38429cb6a0de8f4bb5ae01633e24abe2d7cde46), [8d4d631](https://github.com/morluto/rea/commit/8d4d631606c701aac150cf009d3b80ae4a7ae7d5), [ac57c88](https://github.com/morluto/rea/commit/ac57c88efe64c3125850b54d3d833227e6b8ec51), [dc038d1](https://github.com/morluto/rea/commit/dc038d16bba9046afd28970de9c47f6259a43524), [34a4bb6](https://github.com/morluto/rea/commit/34a4bb6508006fa113463ef20ed799a2994e9ee8), [ebc22d9](https://github.com/morluto/rea/commit/ebc22d99d62225505c0a84f6e39823ba4ef2f829), [c02fb0e](https://github.com/morluto/rea/commit/c02fb0ea8055f98def2b12ad557aed0faefd3639)). Thanks @1NormalGuy, @Aliciawque, @baron, @coygeek, @dhl84, @hemanthrayuduu, @JasonBuildAI, @kaoru0822-kitauji, @N0zoM1z0, @thangldw, @viniciusdsandrade, @XiaoBinGan, @Zburgers.
- **Archive and artifact provenance:** keep physical ZIP occurrence identity, exact signatures/names and partial inventory coverage; bound decompression and reject malformed keys/integers. Directory/ASAR/DMG reads retain ownership through cleanup and publication cancellation. Duplicate ZIP names remain explicitly ambiguous where the public projection cannot represent them; synthetic archive/cleanup cases do not prove every real Unblob or DMG failure path. ([#1726](https://github.com/morluto/rea/pull/1726), [issue morluto/rea#1725](https://github.com/morluto/rea/issues/1725), [#1854](https://github.com/morluto/rea/pull/1854), [issue morluto/rea#1844](https://github.com/morluto/rea/issues/1844), [#1865](https://github.com/morluto/rea/pull/1865), [issue morluto/rea#1860](https://github.com/morluto/rea/issues/1860), [#2069](https://github.com/morluto/rea/pull/2069), [#2106](https://github.com/morluto/rea/pull/2106), [#2144](https://github.com/morluto/rea/pull/2144), [#2365](https://github.com/morluto/rea/pull/2365), [#2493](https://github.com/morluto/rea/pull/2493), [918713a](https://github.com/morluto/rea/commit/918713af376e307ecf24d75e6a0dd9d1b544545b), [eb97da3](https://github.com/morluto/rea/commit/eb97da33881e3d1472d97a7d788ee35944fb6b07), [2260887](https://github.com/morluto/rea/commit/2260887f2092be6a3d9c79509e4ae4a3e52fce7f), [74d7da6](https://github.com/morluto/rea/commit/74d7da6ced0f869936ee0316b00616931b088066), [ed485a3](https://github.com/morluto/rea/commit/ed485a3dc8cc3a4baf8cabe01acb7aa0490b73b3), [921bb95](https://github.com/morluto/rea/commit/921bb9575505065f6cfd57b14d97d80d0f238546), [d8ceb3f](https://github.com/morluto/rea/commit/d8ceb3f276a65c181b146f68c0729ff4b6f9fa61), [9435c7a](https://github.com/morluto/rea/commit/9435c7aae279ba184937c0dfeb713fd574ba3f29), [bb54082](https://github.com/morluto/rea/commit/bb540826d65316c164d2de8ba4ef10f81a8ad073), [a73a55f](https://github.com/morluto/rea/commit/a73a55f53cc2b2e5b7618effe6ecb5cee6e0cee2), [3c57e1a](https://github.com/morluto/rea/commit/3c57e1a8b21b379fca55032d177078e1d8426e64), [ec0b081](https://github.com/morluto/rea/commit/ec0b081371f118e6e5e042fbef3479359c672ddb), [e7882b3](https://github.com/morluto/rea/commit/e7882b34f4ac4a26f903c5f49264acc2c19bb562), [b955b82](https://github.com/morluto/rea/commit/b955b825fc002a4bb408f2910b78768c566c2cd1)). Thanks @1052326311, @1NormalGuy, @baron, @Bortlesboat, @Chaoqi31, @DeryFerd, @kaoru0822-kitauji, @N0zoM1z0, @XiaoBinGan.
- **Setup/uninstall recovery:** preserve unrelated YAML text, caller-selected roots, symlinked data and existing recovery snapshots; explain malformed configuration shapes and retain failed rollback/cleanup owners. Show terminal dry-run plans and each selected skill location. Bunx registration and fault-injected recovery cases remain simulated rather than live-client verification. ([#1731](https://github.com/morluto/rea/pull/1731), [#1754](https://github.com/morluto/rea/pull/1754), [#1821](https://github.com/morluto/rea/pull/1821), [issue morluto/rea#1816](https://github.com/morluto/rea/issues/1816), [#1983](https://github.com/morluto/rea/pull/1983), [#2118](https://github.com/morluto/rea/pull/2118), [issue morluto/rea#2111](https://github.com/morluto/rea/issues/2111), [#2154](https://github.com/morluto/rea/pull/2154), [issue morluto/rea#2152](https://github.com/morluto/rea/issues/2152), [#2157](https://github.com/morluto/rea/pull/2157), [#2182](https://github.com/morluto/rea/pull/2182), [issue morluto/rea#2159](https://github.com/morluto/rea/issues/2159), [#2481](https://github.com/morluto/rea/pull/2481), [bb50813](https://github.com/morluto/rea/commit/bb508134efbba392a404b651d6ec05be8b7eac1e), [c240768](https://github.com/morluto/rea/commit/c2407689cb04df082e8db0b6afa8f8d022f6bcd1), [dcfc5d4](https://github.com/morluto/rea/commit/dcfc5d403ac997c2b08bee4753e57a1a4a8a8538), [21eff3b](https://github.com/morluto/rea/commit/21eff3bae10f58711a35ad44f86e9f96f9bb4790), [94153f1](https://github.com/morluto/rea/commit/94153f1c757e07a6d092e00903aa8b125d4a0afa), [2397137](https://github.com/morluto/rea/commit/23971376158e7815edcbe6c04a8df7c9504650dc), [c339f9e](https://github.com/morluto/rea/commit/c339f9ebe7bd1f30608d6ccb7175da523dd3c485), [f6775a3](https://github.com/morluto/rea/commit/f6775a36694a6a9c620f4248638e8056a6cbcb66)). Thanks @BeqaKs, @Jax367, @kaoru0822-kitauji, @NIU-123370, @shoyann, @viniciusdsandrade, @xeropresence, @zaydiscold.
- **Bun updates:** locate global installations before changing directories and reuse parsed client activation during maintenance. The update flow is covered with package-manager/filesystem simulations; a real Bun global installation update remains unverified. ([#1735](https://github.com/morluto/rea/pull/1735), [e90acae](https://github.com/morluto/rea/commit/e90acaea674f5f7f9f17ea472104afdc1422ada6), [b045df1](https://github.com/morluto/rea/commit/b045df100e1489e08a36d6ff04cea7feecf1332c)). Thanks @xeropresence.
- **JavaScript relationships:** preserve loader-specific package/TypeScript/CommonJS boundaries, exact file-URL and source-map identity, Electron intrinsic receivers/IPC guards and chunk metadata. Index repeated lookups and retain completed facts through resource limits and cancellation. Real Electron integration, Bun worker integration and failure-path cleanup remain unverified where the recorded lanes use fixtures. ([#1740](https://github.com/morluto/rea/pull/1740), [#1759](https://github.com/morluto/rea/pull/1759), [issue morluto/rea#1748](https://github.com/morluto/rea/issues/1748), [#1762](https://github.com/morluto/rea/pull/1762), [issue morluto/rea#1761](https://github.com/morluto/rea/issues/1761), [#1767](https://github.com/morluto/rea/pull/1767), [#1788](https://github.com/morluto/rea/pull/1788), [issue morluto/rea#1781](https://github.com/morluto/rea/issues/1781), [issue morluto/rea#1782](https://github.com/morluto/rea/issues/1782), [#1789](https://github.com/morluto/rea/pull/1789), [#1799](https://github.com/morluto/rea/pull/1799), [issue morluto/rea#1793](https://github.com/morluto/rea/issues/1793), [#1827](https://github.com/morluto/rea/pull/1827), [issue morluto/rea#1802](https://github.com/morluto/rea/issues/1802), [#1833](https://github.com/morluto/rea/pull/1833), [issue morluto/rea#1831](https://github.com/morluto/rea/issues/1831), [#1857](https://github.com/morluto/rea/pull/1857), [issue morluto/rea#1842](https://github.com/morluto/rea/issues/1842), [#1871](https://github.com/morluto/rea/pull/1871), [#1874](https://github.com/morluto/rea/pull/1874), [#1905](https://github.com/morluto/rea/pull/1905), [#1912](https://github.com/morluto/rea/pull/1912), [issue morluto/rea#1909](https://github.com/morluto/rea/issues/1909), [#1915](https://github.com/morluto/rea/pull/1915), [issue morluto/rea#1911](https://github.com/morluto/rea/issues/1911), [#1916](https://github.com/morluto/rea/pull/1916), [#1921](https://github.com/morluto/rea/pull/1921), [#1934](https://github.com/morluto/rea/pull/1934), [#1939](https://github.com/morluto/rea/pull/1939), [issue morluto/rea#1881](https://github.com/morluto/rea/issues/1881), [issue morluto/rea#1882](https://github.com/morluto/rea/issues/1882), [issue morluto/rea#1883](https://github.com/morluto/rea/issues/1883), [#1941](https://github.com/morluto/rea/pull/1941), [#2062](https://github.com/morluto/rea/pull/2062), [issue morluto/rea#2058](https://github.com/morluto/rea/issues/2058), [#2104](https://github.com/morluto/rea/pull/2104), [#2422](https://github.com/morluto/rea/pull/2422), [#2475](https://github.com/morluto/rea/pull/2475), [#2737](https://github.com/morluto/rea/pull/2737), [issue morluto/rea#2663](https://github.com/morluto/rea/issues/2663), [d3088c3](https://github.com/morluto/rea/commit/d3088c3795f6c37cb3b6aec0bb0c371dd0640ee8), [1dfb933](https://github.com/morluto/rea/commit/1dfb933e47db0156cf1cb61f28715b81e740c57b), [f8513a4](https://github.com/morluto/rea/commit/f8513a42dc44451a621127f06edde5d38bc93f69), [b8fab74](https://github.com/morluto/rea/commit/b8fab7429771bb17a7ca0297661de3c9935212af), [42b0ed1](https://github.com/morluto/rea/commit/42b0ed126df7d5b908ac369715378d5e519051b7), [c0904b4](https://github.com/morluto/rea/commit/c0904b4c1aabfccf2f0ab12f44960a0a1fbbbfae), [9f67e44](https://github.com/morluto/rea/commit/9f67e44e5d451d705bae9a579ad9802d5c9f097c), [e4532b5](https://github.com/morluto/rea/commit/e4532b537663026c3e5b784380eecd009c959a36), [1c37914](https://github.com/morluto/rea/commit/1c37914306b3ff257d7a0360f11c9bf2a3f2cac7), [5ab0cbb](https://github.com/morluto/rea/commit/5ab0cbb48ea5a4f11542eac44479b9af48f1dabd), [b7169c8](https://github.com/morluto/rea/commit/b7169c8b747cbc032913b31f008a3b81c77b6219), [f43fc02](https://github.com/morluto/rea/commit/f43fc0247527aebb8efc7d9db04276fe2d489323), [3ae826c](https://github.com/morluto/rea/commit/3ae826ceba6f25b08bce50bcb51001209bc16b57), [1b95302](https://github.com/morluto/rea/commit/1b953021eadf4cac09e20be388d79536903633b3), [eaa9616](https://github.com/morluto/rea/commit/eaa961658578522cecfbba7c7be1acf1c64da65a), [c923fb0](https://github.com/morluto/rea/commit/c923fb0dc9462e302b84a15770131ff899f89455), [c7a890d](https://github.com/morluto/rea/commit/c7a890d12987d9b2d496119c1fbf1a88c0fc298e)). Thanks @Aurantium-47, @baron, @chqcjq, @coygeek, @cyanseek, @fengdwx, @flitzrrr, @immanuwell, @kaoru0822-kitauji, @N0zoM1z0, @Nelglor, @ranmori, @rudycelekli, @shoyann, @xu91102.
- **Browser observations:** preserve effective source-map URLs, empty query/fragment identity, response-body provenance, service-worker policies and explicit uncertainty for malformed events. Bound discovery lifetimes and retain cleanup ownership. Interrupt/retry/failure cases validated with controlled CDP/session fixtures do not establish those paths in real Chromium. ([#1742](https://github.com/morluto/rea/pull/1742), [issue morluto/rea#1729](https://github.com/morluto/rea/issues/1729), [#1829](https://github.com/morluto/rea/pull/1829), [#2074](https://github.com/morluto/rea/pull/2074), [#2099](https://github.com/morluto/rea/pull/2099), [#2239](https://github.com/morluto/rea/pull/2239), [issue morluto/rea#2169](https://github.com/morluto/rea/issues/2169), [#2477](https://github.com/morluto/rea/pull/2477), [486b567](https://github.com/morluto/rea/commit/486b56724c4eaba50719177bcb9eae84d6907297), [a82e37c](https://github.com/morluto/rea/commit/a82e37c8065cc200a0ca3e14e7c4f85e4e468580), [a8d4984](https://github.com/morluto/rea/commit/a8d4984404b611e60b88bc42289c0ba07eee4578), [966f7cc](https://github.com/morluto/rea/commit/966f7cc84b4a8bb0043641cb64d7a7aaf8715e05), [221c856](https://github.com/morluto/rea/commit/221c85648108e9846d9920b0964dafa7f108d581), [951b095](https://github.com/morluto/rea/commit/951b095e11adf9faa9c4a27e212260060aa6b095), [f09bb8a](https://github.com/morluto/rea/commit/f09bb8a99773f79c7306b8799c86f856fe2c0d4b), [6bd2b28](https://github.com/morluto/rea/commit/6bd2b28161411f70ed5dc72e42c2736a1aab758b)). Thanks @1052326311, @chAng-L19, @chqcjq, @coygeek, @evenafterallisaid, @fisforfaheem, @itsF4LCON, @N0zoM1z0, @shayanxcyber.
- **Managed metadata/CIL:** preserve ExportedType and pointer-table ownership, generic/array/function-pointer/modifier signatures, ReadyToRun host identity, metadata ExtraData and signed zero. Charge retained facts and decoded instruction counts instead of broad decoding bounds; malformed layouts remain caller input errors. ([#1743](https://github.com/morluto/rea/pull/1743), [issue morluto/rea#1736](https://github.com/morluto/rea/issues/1736), [#1768](https://github.com/morluto/rea/pull/1768), [#1822](https://github.com/morluto/rea/pull/1822), [issue morluto/rea#1801](https://github.com/morluto/rea/issues/1801), [#1828](https://github.com/morluto/rea/pull/1828), [issue morluto/rea#1812](https://github.com/morluto/rea/issues/1812), [#1835](https://github.com/morluto/rea/pull/1835), [issue morluto/rea#1832](https://github.com/morluto/rea/issues/1832), [#1886](https://github.com/morluto/rea/pull/1886), [#1893](https://github.com/morluto/rea/pull/1893), [#1897](https://github.com/morluto/rea/pull/1897), [issue morluto/rea#1878](https://github.com/morluto/rea/issues/1878), [#1943](https://github.com/morluto/rea/pull/1943), [issue morluto/rea#1940](https://github.com/morluto/rea/issues/1940), [#1985](https://github.com/morluto/rea/pull/1985), [#2194](https://github.com/morluto/rea/pull/2194), [issue morluto/rea#2191](https://github.com/morluto/rea/issues/2191), [#2437](https://github.com/morluto/rea/pull/2437), [52e76c5](https://github.com/morluto/rea/commit/52e76c5d39b58d1685bb5e22bd40d19524dfa2cb)). Thanks @ac1982, @chqcjq, @fisHarly0, @flitzrrr, @JasonBuildAI, @JayOfTheKeyboard, @jhuang-tw, @kaoru0822-kitauji, @N0zoM1z0, @Nelglor.
- **Hopper failure ownership:** preserve startup/process outcomes, retain cleanup leases across one-shot failures, wait for late bridges, and stop owned Linux demo children when their REA owner exits. Denied/crashed/late-bridge/queued-request failure paths use simulated process or bridge fixtures; they are not fresh installed-Hopper verification. ([#1763](https://github.com/morluto/rea/pull/1763), [issue morluto/rea#1751](https://github.com/morluto/rea/issues/1751), [#1817](https://github.com/morluto/rea/pull/1817), [#1866](https://github.com/morluto/rea/pull/1866), [#1927](https://github.com/morluto/rea/pull/1927), [#2474](https://github.com/morluto/rea/pull/2474), [#2499](https://github.com/morluto/rea/pull/2499), [issue morluto/rea#2459](https://github.com/morluto/rea/issues/2459)). Thanks @coygeek, @Joshwong1908, @kaoru0822-kitauji, @N0zoM1z0, @rudycelekli.
- **IDA session boundaries:** retain non-x86 call coverage and unresolved-procedure uncertainty, and bound private universal-Mach-O inputs to the exact selected slice. Transient headless busy recovery was exercised on macOS arm64 IDA Pro 9.1; Linux headless, attached GUI navigation and worker-reaped cleanup paths retain their documented verification gaps. ([#1764](https://github.com/morluto/rea/pull/1764), [issue morluto/rea#1712](https://github.com/morluto/rea/issues/1712), [#1778](https://github.com/morluto/rea/pull/1778), [issue morluto/rea#1766](https://github.com/morluto/rea/issues/1766), [#1785](https://github.com/morluto/rea/pull/1785), [issue morluto/rea#1769](https://github.com/morluto/rea/issues/1769), [#1906](https://github.com/morluto/rea/pull/1906), [issue morluto/rea#1794](https://github.com/morluto/rea/issues/1794), [#2201](https://github.com/morluto/rea/pull/2201), [issue morluto/rea#2139](https://github.com/morluto/rea/issues/2139), [#2291](https://github.com/morluto/rea/pull/2291), [issue morluto/rea#2285](https://github.com/morluto/rea/issues/2285), [#2324](https://github.com/morluto/rea/pull/2324), [12fa8fd](https://github.com/morluto/rea/commit/12fa8fd9f986dbd4ff58165c3ec71a46dc8a8a3b)). Thanks @akushonkamen, @coygeek, @kaoru0822-kitauji, @N0zoM1z0, @nikolay-dementiev, @zecaro.
- **Input and capability diagnostics:** identify invalid paths, format refusals, missing host tools and non-retryable errors without losing caller selections or retryable capability facts. Foreign execution/device mutation annotations remain destructive, analysis-target text is untrusted, and output ordering follows code points rather than host locale. ([#1770](https://github.com/morluto/rea/pull/1770), [#1867](https://github.com/morluto/rea/pull/1867), [#1869](https://github.com/morluto/rea/pull/1869), [issue morluto/rea#1855](https://github.com/morluto/rea/issues/1855), [#1872](https://github.com/morluto/rea/pull/1872), [#1879](https://github.com/morluto/rea/pull/1879), [issue morluto/rea#1853](https://github.com/morluto/rea/issues/1853), [#1899](https://github.com/morluto/rea/pull/1899), [#1902](https://github.com/morluto/rea/pull/1902), [#1904](https://github.com/morluto/rea/pull/1904), [#1908](https://github.com/morluto/rea/pull/1908), [#1925](https://github.com/morluto/rea/pull/1925), [#1987](https://github.com/morluto/rea/pull/1987), [issue morluto/rea#1979](https://github.com/morluto/rea/issues/1979), [#2004](https://github.com/morluto/rea/pull/2004), [issue morluto/rea#2002](https://github.com/morluto/rea/issues/2002), [#2026](https://github.com/morluto/rea/pull/2026), [#2091](https://github.com/morluto/rea/pull/2091), [#2133](https://github.com/morluto/rea/pull/2133), [issue morluto/rea#2129](https://github.com/morluto/rea/issues/2129), [#2145](https://github.com/morluto/rea/pull/2145), [issue morluto/rea#2143](https://github.com/morluto/rea/issues/2143), [#2472](https://github.com/morluto/rea/pull/2472), [#2478](https://github.com/morluto/rea/pull/2478), [issue morluto/rea#2454](https://github.com/morluto/rea/issues/2454), [#2494](https://github.com/morluto/rea/pull/2494), [#2507](https://github.com/morluto/rea/pull/2507), [#2509](https://github.com/morluto/rea/pull/2509), [#2708](https://github.com/morluto/rea/pull/2708), [3d83135](https://github.com/morluto/rea/commit/3d8313598785359c424d7305f503cb69fc8639a6), [c9fed50](https://github.com/morluto/rea/commit/c9fed50691ae014890e91a72534773d2fb58ce44), [8b18171](https://github.com/morluto/rea/commit/8b181716aca2cb467be499cba226abfb5ae19141), [7a2cd1e](https://github.com/morluto/rea/commit/7a2cd1ea0a63e8c44166860b7ee9c7a1aa43492b)). Thanks @astralyx0129, @CassieFox23, @DeryFerd, @dollarsmoney, @fisforfaheem, @flitzrrr, @Ha1baraA11, @jimpablo, @kaoru0822-kitauji, @larinyo, @N0zoM1z0, @rudycelekli, @SII-YDD, @viniciusdsandrade, @XiaoBinGan.
- **Android analysis:** retain decoded values, duplicate-class inventories and executable static initializers, reject malformed JADX UTF-8, and keep inline search provenance. Apktool accepts `--no-strings` and explains host requirements. Windows batch-launcher selection also resolves PATH/PATHEXT before choosing its launch mode. Recorded Apktool coverage is Linux/OpenJDK, and changed JADX/batch failure paths do not establish native Windows behavior. ([#1777](https://github.com/morluto/rea/pull/1777), [issue morluto/rea#1774](https://github.com/morluto/rea/issues/1774), [#1876](https://github.com/morluto/rea/pull/1876), [issue morluto/rea#1846](https://github.com/morluto/rea/issues/1846), [#1890](https://github.com/morluto/rea/pull/1890), [issue morluto/rea#1850](https://github.com/morluto/rea/issues/1850), [#1946](https://github.com/morluto/rea/pull/1946), [issue morluto/rea#1945](https://github.com/morluto/rea/issues/1945), [#2707](https://github.com/morluto/rea/pull/2707), [issue morluto/rea#2672](https://github.com/morluto/rea/issues/2672), [0677468](https://github.com/morluto/rea/commit/0677468877465c8dfbe25c72f142a7b5bc8a3212), [fe8d0bd](https://github.com/morluto/rea/commit/fe8d0bdd36fe12bc0836468d1a702a34fbdc219b), [#2802](https://github.com/morluto/rea/pull/2802)). Thanks @akushonkamen, @coygeek, @HeadmasterEggy, @kaoru0822-kitauji, @N0zoM1z0, @psipher.
- **ADB acquisition:** preserve device paths and directory identity, prevent host destination collisions/overwrites, count UTF-8 logcat bytes and restricted permissions, and evaluate the complete Activity Manager start report. Launch attempts, status, activity and raw failure output remain observations; real-device timeout/mixed-report and Android 8 directory-read paths remain unverified beyond the documented fixtures. ([#1962](https://github.com/morluto/rea/pull/1962), [#2212](https://github.com/morluto/rea/pull/2212), [issue morluto/rea#2175](https://github.com/morluto/rea/issues/2175), [#2221](https://github.com/morluto/rea/pull/2221), [issue morluto/rea#2220](https://github.com/morluto/rea/issues/2220), [#2359](https://github.com/morluto/rea/pull/2359), [c42232f](https://github.com/morluto/rea/commit/c42232f566d55fe7191763649755148c768eef9f), [55b6148](https://github.com/morluto/rea/commit/55b61485e9f7568b69597eef8696ff6abfe53cfd), [3bdc873](https://github.com/morluto/rea/commit/3bdc8730bd98e073522bcb8ba86527be402c0cbe), [c89972c](https://github.com/morluto/rea/commit/c89972c8777d0114566fe76a060849a18bdd2659), [e1cd292](https://github.com/morluto/rea/commit/e1cd292aa6e8f5f13441d408c66126782c8dbb0d)). Thanks @coygeek, @dakjdakd, @DeryFerd, @huiq777, @sx4im.
- **WASM names and diagnostics:** preserve debug/custom-section names including NUL and leading BOM, accept unpadded WABT section rows, and avoid irrelevant tool-remediation advice on unrelated runtime-root failures. ([#1963](https://github.com/morluto/rea/pull/1963), [issue morluto/rea#1956](https://github.com/morluto/rea/issues/1956), [#1967](https://github.com/morluto/rea/pull/1967), [#1981](https://github.com/morluto/rea/pull/1981), [#2084](https://github.com/morluto/rea/pull/2084), [#2102](https://github.com/morluto/rea/pull/2102)). Thanks @1052326311, @bugstan, @N0zoM1z0, @sathariels, @STiFLeR7, @viniciusdsandrade.
- **Source-map and path handling:** retain source-map entries when embedded-content counts differ or an optional `sourceMappingURL` is used, and keep `file:` URLs out of operator-relative path resolution. ([#2873](https://github.com/morluto/rea/pull/2873), [#2886](https://github.com/morluto/rea/pull/2886), [#2882](https://github.com/morluto/rea/pull/2882), [issue morluto/rea#2821](https://github.com/morluto/rea/issues/2821), [issue morluto/rea#2883](https://github.com/morluto/rea/issues/2883), [issue morluto/rea#2577](https://github.com/morluto/rea/issues/2577)). Thanks @JFSAS, @rileygramlich, @shoyann, @shubhamahuja9999, @coygeek.
- **Native metadata:** accept declared facts in native dispatch inventories and share native verification input diagnostics. ([#2906](https://github.com/morluto/rea/pull/2906), [#2901](https://github.com/morluto/rea/pull/2901), [issue morluto/rea#2564](https://github.com/morluto/rea/issues/2564), [issue morluto/rea#2621](https://github.com/morluto/rea/issues/2621)). Thanks @ShitK, @coygeek.
### ⚠ BREAKING CHANGES
- **Runtime attachment state:** `attached` may be `null` in JavaScript, browser and Electron discovery/inspection results. Treat null as unknown; do not coerce it to false. ([e55ef72](https://github.com/morluto/rea/commit/e55ef7213515ba204c3d88a4487b4ee6a2773b06)).
- **Source maps:** original-source and mapping rows preserve a null source name when unavailable. Handle null explicitly instead of expecting an invented unknown-source string; new index fields remain optional when reading older Evidence. ([ee50ed1](https://github.com/morluto/rea/commit/ee50ed121e38cc6e1a2ff0dc8b789f15f71c5402)).
- **Streamed filtered JSON:** `--filter-output` now emits JSON `null` instead of `{}` when the selected value is null; consumers must distinguish a present null from a missing selection. Use `--full-output` when an object envelope is required. ([#2333](https://github.com/morluto/rea/pull/2333)). Thanks @Jackmeson1.
- **Call graphs:** `get_call_graph.normalized_result` is now `{ graph, limitations }`; read traversal-depth groups under `graph` and retain relationship-specific caveats. Contract/fixture validation does not establish new Ghidra or IDA engine coverage. ([5dfb9d0](https://github.com/morluto/rea/commit/5dfb9d050c2cc44a61b183dae765bef4d22a53b7)).
- **MCP discovery:** `binary_session` no longer repeats `server_identity.catalog.tools`. Use the connected server tool list, grouped `tool_availability` and provider capabilities; see [MCP contracts](docs/mcp-contracts.md). Origin: [6395e8d](https://github.com/morluto/rea/commit/6395e8d3007d5ee453477460e7ee1c51cff76be0). ([#1988](https://github.com/morluto/rea/pull/1988)). Thanks @kaoru0822-kitauji, @N0zoM1z0.
- **Provider admission:** MIPS targets with unresolved GNU ABI attributes are refused. Supply supported ABI declarations. Saved Hopper databases on macOS are unavailable because the launcher cannot run the analysis bridge when opening a database; select an executable target instead. Database support requires a script-capable database launch route. ([d4bd65c](https://github.com/morluto/rea/commit/d4bd65c53c0254d0195cc7ab8da163dcadfd3b9b)).
- **Segment extents:** `binary_overview` segment length may be null when Hopper coordinates cannot establish a finite extent in one address space. Preserve unknown rather than converting it to zero or a saturated value. ([36db19c](https://github.com/morluto/rea/commit/36db19c59)).
- **Invocation identity:** `server.command_path` may be null, and registration/setup statuses or doctor classifications may be unknown. Preserve these states and establish the actual invocation before treating a registration as aligned. ([187f113](https://github.com/morluto/rea/commit/187f113f7)). Thanks @hemv-857, @qorvr.
- **ADB installation:** the optional `replace` input is unchanged. Results now require `replace_requested` to record the requested `adb install -r` mode; `replaced` is nullable because prior device package state was not observed. Update result readers to accept null instead of treating reinstall intent as proof of replacement. ([864314a](https://github.com/morluto/rea/commit/864314ac857924a7e6e65bfb37e8dc720fcc21e7)).
- **Managed/native verification:** unresolved P/Invoke results may retain `matched_native` and candidate facts when module identity is unknown. Interpret `status`, `basis` and `limitations`; `module-identity-unknown` does not verify correspondence, and unresolved no longer implies empty observations. ([3f6b575](https://github.com/morluto/rea/commit/3f6b5755b3e699bd9373641acffe0f2c5d2ab094)).
Full contribution record: [893 commits and 529 merged PRs](https://github.com/morluto/rea/blob/rea-agents-6.5.0/docs/releases/6.5.0.contributions.json).
## [6.4.0](https://github.com/morluto/rea/compare/rea-agents-6.3.0...rea-agents-6.4.0) (2026-10-11)
### Highlights
+1 -1
View File
@@ -344,7 +344,7 @@ Report vulnerabilities through [SECURITY.md](SECURITY.md).
## Star history
🎉 **200,000 GitHub stars — thank you!**
🎉 **250,000 GitHub stars — thank you!**
Thanks to everyone using REA, reporting bugs, requesting features, testing builds, and contributing fixes.
+80 -66
View File
@@ -934,7 +934,7 @@ public final class ReaGhidraBridge extends HeadlessScript {
String value = decompiledText(decompile(function));
JsonObject result = functionObservation(
value == null ? JsonNull.INSTANCE : GSON.toJsonTree(value),
noReturnCallLimitations(
functionBoundaryLimitations(
function,
currentProgram.getListing().getInstructions(function.getBody(), true)
)
@@ -1027,7 +1027,7 @@ public final class ReaGhidraBridge extends HeadlessScript {
InstructionScan scan = scanInstructions(function, Integer.MAX_VALUE);
return functionObservation(
GSON.toJsonTree(renderAssembly(scan.instructions)),
noReturnCallLimitations(function, scan.instructions)
functionBoundaryLimitations(function, scan.instructions)
);
}
@@ -1046,7 +1046,7 @@ public final class ReaGhidraBridge extends HeadlessScript {
limitations.add(
"The fast path does not invoke the decompiler or scan whole-program names and strings."
);
List<String> boundaryLimitations = noReturnCallLimitations(function, scan.instructions);
List<String> boundaryLimitations = functionBoundaryLimitations(function, scan.instructions);
for (String limitation : boundaryLimitations) limitations.add(limitation);
JsonObject result = new JsonObject();
result.add("procedure", procedureIdentity(function));
@@ -1069,7 +1069,7 @@ public final class ReaGhidraBridge extends HeadlessScript {
result.add(canonicalAddress(item.getEntryPoint()));
}
if (callers) {
JsonObject observation = functionObservation(result, noReturnCallLimitations(function,
JsonObject observation = functionObservation(result, functionBoundaryLimitations(function,
currentProgram.getListing().getInstructions(function.getBody(), true)
));
observation.add("relationship_coverage", callRelationshipCoverage(null,
@@ -1099,7 +1099,7 @@ public final class ReaGhidraBridge extends HeadlessScript {
result.add("classification", functionClassification(function));
return functionObservation(
result,
noReturnCallLimitations(
functionBoundaryLimitations(
function,
currentProgram.getListing().getInstructions(function.getBody(), true)
)
@@ -1131,12 +1131,22 @@ public final class ReaGhidraBridge extends HeadlessScript {
result.addProperty("direction", direction);
result.add("references", edges);
result.addProperty("reference_kinds_available", true);
JsonArray unresolvedCalls = direction.equals("outgoing")
? callBoundaryObservation(
List<String> limitations;
JsonArray unresolvedCalls = new JsonArray();
if (direction.equals("outgoing")) {
CallBoundaryObservation calls = callBoundaryObservation(
function, currentProgram.getListing().getInstructions(function.getBody(), true), null, true, references
).unresolvedCalls() : new JsonArray();
);
unresolvedCalls = calls.unresolvedCalls();
limitations = calls.limitations();
} else {
limitations = functionBoundaryLimitations(
function,
currentProgram.getListing().getInstructions(function.getBody(), true)
);
}
result.add("unresolved_calls", unresolvedCalls);
return result;
return functionObservation(result, limitations);
}
private JsonObject inspectNativeDataType(JsonObject params) throws Exception {
@@ -1337,11 +1347,7 @@ public final class ReaGhidraBridge extends HeadlessScript {
result.add("references", references);
if (includeIncoming) {
TreeMap<String, Reference> incoming = new TreeMap<>();
ReferenceIterator incomingIterator = currentProgram.getReferenceManager().getReferencesTo(address);
while (incomingIterator.hasNext()) {
monitor.checkCancelled();
addReference(incoming, incomingIterator.next());
}
visitObservedReferencesTo(address, reference -> addReference(incoming, reference));
List<Reference> orderedIncoming = new ArrayList<>(incoming.values());
orderedIncoming.sort(REFERENCE_ORDER);
JsonArray incomingReferences = new JsonArray();
@@ -1393,16 +1399,8 @@ public final class ReaGhidraBridge extends HeadlessScript {
requireKeys(params, Set.of("document", "address"));
requireDocument(params);
Address address = requireAddress(params, "address");
ReferenceIterator references = currentProgram.getReferenceManager().getReferencesTo(address);
Set<Address> sources = new HashSet<>();
while (references.hasNext()) {
monitor.checkCancelled();
Reference reference = references.next();
if (reference.isEntryPointReference()) {
continue;
}
sources.add(reference.getFromAddress());
}
visitObservedReferencesTo(address, reference -> sources.add(reference.getFromAddress()));
List<Address> ordered = new ArrayList<>(sources);
ordered.sort(Address::compareTo);
JsonArray result = new JsonArray();
@@ -3430,51 +3428,27 @@ public final class ReaGhidraBridge extends HeadlessScript {
return omitted[0];
}
private List<String> noReturnCallLimitations(
private List<String> functionBoundaryLimitations(
Function function, Iterable<Instruction> instructions)
throws Exception {
List<String> limitations = new ArrayList<>();
Instruction beforePrevious = null;
Instruction previous = null;
for (Instruction instruction : instructions) {
monitor.checkCancelled();
String limitation = terminalCallLimitation(instruction);
if (limitation != null) limitations.add(limitation);
if (beforePrevious != null && previous != null) {
String seh = borlandSehHandlerLimitation(
function, beforePrevious, previous, instruction);
if (seh != null) limitations.add(seh);
}
beforePrevious = previous;
previous = instruction;
}
return limitations;
FunctionBoundaryLimitations boundary = new FunctionBoundaryLimitations(function);
for (Instruction instruction : instructions) boundary.observe(instruction);
return boundary.values();
}
private CallBoundaryObservation callBoundaryObservation(
Function function, Iterable<Instruction> instructions, Set<Function> returnedCallees,
boolean includeUnresolvedSites, List<Reference> observedReferences)
throws Exception {
List<String> limitations = new ArrayList<>();
FunctionBoundaryLimitations boundary = new FunctionBoundaryLimitations(function);
CallBoundaryReferences calls = new CallBoundaryReferences(returnedCallees, includeUnresolvedSites);
Instruction beforePrevious = null;
Instruction previous = null;
if (observedReferences == null) visitReferences(function, "outgoing", calls::observe);
else for (Reference reference : observedReferences) {
monitor.checkCancelled();
calls.observe(reference);
}
for (Instruction instruction : instructions) {
monitor.checkCancelled();
String limitation = terminalCallLimitation(instruction);
if (limitation != null) limitations.add(limitation);
if (beforePrevious != null && previous != null) {
String seh = borlandSehHandlerLimitation(
function, beforePrevious, previous, instruction);
if (seh != null) limitations.add(seh);
}
beforePrevious = previous;
previous = instruction;
boundary.observe(instruction);
if (!instruction.getFlowType().isCall()) continue;
boolean destination = false;
for (Reference reference : instruction.getReferencesFrom()) {
@@ -3488,10 +3462,38 @@ public final class ReaGhidraBridge extends HeadlessScript {
"Instruction decoder identifies a call but ReferenceManager supplies no call destination");
}
}
return new CallBoundaryObservation(List.copyOf(limitations),
return new CallBoundaryObservation(boundary.values(),
returnedCallees == null ? null : calls.unrepresented, calls.unresolvedCalls());
}
private final class FunctionBoundaryLimitations {
private final Function function;
private final List<String> limitations = new ArrayList<>();
private Instruction beforePrevious;
private Instruction previous;
private FunctionBoundaryLimitations(Function function) {
this.function = function;
}
private void observe(Instruction instruction) throws Exception {
monitor.checkCancelled();
String limitation = terminalCallLimitation(instruction);
if (limitation != null) limitations.add(limitation);
if (beforePrevious != null && previous != null) {
String seh = borlandSehHandlerLimitation(
function, beforePrevious, previous, instruction);
if (seh != null) limitations.add(seh);
}
beforePrevious = previous;
previous = instruction;
}
private List<String> values() {
return List.copyOf(limitations);
}
}
private String borlandSehHandlerLimitation(
Function function, Instruction handlerPush, Instruction framePush,
Instruction frameLink) {
@@ -3673,24 +3675,36 @@ public final class ReaGhidraBridge extends HeadlessScript {
monitor.checkCancelled();
Address address = addresses.next();
if (outgoing) {
for (Reference reference : currentProgram.getReferenceManager()
.getReferencesFrom(address)) {
monitor.checkCancelled();
if (!reference.isEntryPointReference()) visitor.accept(reference);
}
visitObservedReferencesFrom(address, visitor);
}
else {
ReferenceIterator iterator = currentProgram.getReferenceManager()
.getReferencesTo(address);
while (iterator.hasNext()) {
monitor.checkCancelled();
Reference reference = iterator.next();
if (!reference.isEntryPointReference()) visitor.accept(reference);
}
visitObservedReferencesTo(address, visitor);
}
}
}
private void visitObservedReferencesFrom(Address address, ReferenceVisitor visitor)
throws Exception {
for (Reference reference : currentProgram.getReferenceManager().getReferencesFrom(address)) {
monitor.checkCancelled();
visitObservedReference(reference, visitor);
}
}
private void visitObservedReferencesTo(Address address, ReferenceVisitor visitor)
throws Exception {
ReferenceIterator references = currentProgram.getReferenceManager().getReferencesTo(address);
while (references.hasNext()) {
monitor.checkCancelled();
visitObservedReference(references.next(), visitor);
}
}
private static void visitObservedReference(Reference reference, ReferenceVisitor visitor)
throws Exception {
if (!reference.isEntryPointReference()) visitor.accept(reference);
}
private static void addReference(TreeMap<String, Reference> observed, Reference reference) {
String key = canonicalAddress(reference.getFromAddress()) + "\u0000" +
canonicalAddress(reference.getToAddress()) + "\u0000" +
+40 -6
View File
@@ -567,18 +567,27 @@ def trace(debugger, config):
before_digest = _hash_file(config["executable"])
before_identity = _file_identity(config["executable"])
except OSError as error:
return {"status": "target-integrity-error", "error": str(error)}
return {
"status": "target-integrity-error",
"error": str(error),
"target_process_created": False,
}
if before_digest != config["expected_sha256"]:
return {
"status": "target-integrity-error",
"error": "selected executable digest changed before LLDB target creation",
"target_process_created": False,
}
error = lldb.SBError()
target = debugger.CreateTarget(
config["executable"], config["architecture"], None, False, error
)
if not target.IsValid():
return {"status": "target-error", "error": error.GetCString()}
return {
"status": "target-error",
"error": error.GetCString(),
"target_process_created": False,
}
module_path_before, module_file_identity_before, module_uuid_before = (
_module_identity(target)
)
@@ -589,6 +598,7 @@ def trace(debugger, config):
return {
"status": "target-integrity-error",
"error": "LLDB executable module resolved to a different pre-launch file identity",
"target_process_created": False,
}
created = [_create_breakpoints(target, spec) for spec in config["breakpoints"]]
breakpoint_index = {}
@@ -622,12 +632,24 @@ def trace(debugger, config):
if not error.Success() or not process.IsValid():
stdout.close()
stderr.close()
return {"status": "launch-error", "error": error.GetCString()}
return {
"status": "launch-error",
"error": error.GetCString(),
**(
{"target_process_created": True}
if process.IsValid()
else {}
),
}
launch_failure = _failed_launch_description(process)
if launch_failure is not None:
stdout.close(expected_exit=True)
stderr.close(expected_exit=True)
return {"status": "launch-error", "error": launch_failure}
return {
"status": "launch-error",
"error": launch_failure,
"target_process_created": True,
}
stdout.mark_launched()
stderr.mark_launched()
# Publish the PID before any post-launch file or module inspection. The
@@ -644,6 +666,7 @@ def trace(debugger, config):
return {
"status": "target-identity-unavailable",
"error": "host could not establish the launched process identity; target was stopped",
"target_process_created": True,
}
try:
after_digest = _hash_file(config["executable"])
@@ -652,7 +675,11 @@ def trace(debugger, config):
process.Kill()
stdout.close(expected_exit=process.GetState() == lldb.eStateExited)
stderr.close(expected_exit=process.GetState() == lldb.eStateExited)
return {"status": "target-integrity-error", "error": str(identity_error)}
return {
"status": "target-integrity-error",
"error": str(identity_error),
"target_process_created": True,
}
if after_digest != config["expected_sha256"] or after_identity != before_identity:
process.Kill()
_wait_for_exit(listener, process, 5)
@@ -661,6 +688,7 @@ def trace(debugger, config):
return {
"status": "target-integrity-error",
"error": "selected executable digest or file identity changed during LLDB launch",
"target_process_created": True,
}
module_path_after, module_file_identity_after, module_uuid_after = (
_module_identity(target)
@@ -676,6 +704,7 @@ def trace(debugger, config):
return {
"status": "target-integrity-error",
"error": "LLDB executable module resolved to a different file identity",
"target_process_created": True,
}
if (
module_uuid_before is not None
@@ -689,6 +718,7 @@ def trace(debugger, config):
return {
"status": "target-integrity-error",
"error": "LLDB executable module identity changed during launch",
"target_process_created": True,
}
context = {
"target": target,
@@ -748,7 +778,11 @@ def trace(debugger, config):
# exit code; preserve the debugger's concrete launch denial.
launch_failure = _failed_launch_description(process)
if launch_failure is not None:
return {"status": "launch-error", "error": launch_failure}
return {
"status": "launch-error",
"error": launch_failure,
"target_process_created": True,
}
launch_identity_stable = (
module_path_before is not None
and module_path_after == module_path_before
+37
View File
@@ -8,6 +8,7 @@ import sys
import tempfile
import types
import unittest
from unittest.mock import patch
fake_lldb = sys.modules.setdefault("lldb", types.ModuleType("lldb"))
@@ -22,6 +23,42 @@ spec.loader.exec_module(tracer)
class NativeTraceBudgetTests(unittest.TestCase):
def test_pre_target_integrity_failure_reports_no_process_created(self):
original_debugger = getattr(tracer.lldb, "SBDebugger", None)
class DebuggerApi:
@staticmethod
def SetInternalVariable(*_arguments):
return None
class Debugger:
def SetAsync(self, _enabled):
return None
def GetInstanceName(self):
return "fixture"
def CreateTarget(self, *_arguments):
raise AssertionError("integrity failure precedes target creation")
tracer.lldb.SBDebugger = DebuggerApi
try:
with patch.object(tracer, "_hash_file", return_value="changed"), patch.object(
tracer, "_file_identity", return_value=(1, 2)
):
result = tracer.trace(
Debugger(),
{"executable": "fixture", "expected_sha256": "expected"},
)
finally:
if original_debugger is None:
del tracer.lldb.SBDebugger
else:
tracer.lldb.SBDebugger = original_debugger
self.assertEqual(result["status"], "target-integrity-error")
self.assertIs(result["target_process_created"], False)
def test_journal_checks_exact_byte_budget_before_writing(self):
record = {"kind": "other-stop", "reason": "signal"}
encoded_size = len((tracer.json.dumps(record) + "\n").encode("utf-8"))
+30 -2
View File
@@ -281,6 +281,32 @@ REA retains local observation data and removes only URL userinfo credentials, ex
- Accessibility structure and roles are retained by default, while names and descriptions require `include_accessibility_text: true`.
- Network observations retain method, status, MIME type, size, type, initiator stack location, and complete URLs with userinfo credentials removed. Redirects reported by CDP are attached as ordered `redirects` on the one request ID, with the prior request URL, CDP response URL, method/type, response status/MIME/encoded length, request timestamp, and the next `requestWillBeSent` event timestamp. CDP delivers `redirectResponse` with that next request event, so the latter is an event boundary rather than an exact response timestamp. Redirect response headers and bodies are discarded; hops outside the selected origins are discarded with the request chain. Headers are discarded after an allowlisted projection of length/encoding, structured CSP/Link/policy fields, and untrusted agent hints. Cookies and authorization headers are never retained.
- Request/response bodies are not requested or parsed by default. When selected, only allowed-origin JSON media types are read, converted immediately to complete value-free typed paths, types and observation counts, and discarded. Each path segment is either `{ "kind": "property", "name": "raw property name" }` or `{ "kind": "array-element" }`; array-element types include primitives and nested arrays. Literal `*` properties remain distinct from array elements. `Network.getResponseBody` is never sent unless JSON body shape capture is selected. Comparison uses body shapes only when both captures selected them, and compares request/response shapes only where both observations provide those facts. Unavailable or truncated selected coverage makes equivalence unknown; observed differences still report changed.
For normalized passive inputs with complete request inventories on both sides,
request additions and removals remain observable even when selected body shapes,
response metadata, or WebSocket coverage are unavailable. HTTP request and
WebSocket inventory coverage are evaluated separately; complete HTTP coverage
cannot prove a missing WebSocket connection. Limited request inventory still
prevents request-absence claims. This comparison rule does not make live CDP's
attach-limited inventory complete or establish body-shape equality.
An unavailable HTTP resource type also leaves request identity incomplete:
observations with the same method and URL remain possible matches across types,
and identical unknown types cannot establish complete equality. Ambiguous type
groups cannot prove membership or content changes either: a missing type may
redistribute repeated requests between buckets without changing the requests.
Their comparison remains unknown, while independently identified groups retain
proven changes. Different methods/URLs and complete empty peer inventories still
support absence claims.
Relevant dropped-event counts also limit inventory completeness even when no
section is listed as truncated: HTTP uses `network_requests`, while WebSocket
uses `websocket_connections` and `websocket_frames`. Drops in other event kinds
and the aggregate total do not by themselves limit HTTP inventory. Proven
modifications remain reportable despite incomplete inventory.
Repeated identical HTTP content samples establish multiplicity changes only
with complete request inventories; limited inventories retain known content
comparisons without interpreting duplicate sample counts as changes.
WebSocket stream inventories and connection counts likewise require complete
WebSocket coverage. Redirect resource types use only shared known metadata:
an omitted type leaves equality unknown rather than proving a modification.
- Console observations with a stack source retain call type, argument types, timestamp, and source location. When console text capture is selected, already-delivered primitive values are retained verbatim; objects, getters, and remote properties are never expanded.
- WebSocket observations retain direction, opcode, and payload byte length. When shape capture is selected, text frames are classified as text or complete value-free JSON shape; binary bytes, hashes, prefixes, and raw frames are never retained.
- Storage observations always redact values. Key names, IndexedDB names, and cache names require `include_storage_keys`; stable content fingerprints require the additional `include_storage_fingerprints` selection. Cookie fingerprints cover cookies applicable to the current main-frame URL, including its path, rather than every cookie path on that origin. Other storage remains scoped to the origin. Cache bodies above 64 KiB and partial IndexedDB remote objects make fingerprint coverage incomplete, so identical observations remain `unknown`.
@@ -317,8 +343,10 @@ an invalid supplied size remains unknown with incomplete resource coverage while
the resource's other facts are retained. Zero and nonnegative fractional sizes
are preserved.
CDP discovery, connection, and commands wait for the peer or caller cancellation;
a stalled peer can leave an operation waiting. WebSocket messages remain subject
CDP discovery has a 10-second deadline. Each WebSocket handshake and command
response has its own 20-second deadline, separate from the caller-selected
observation window. A stalled handshake or command reports `provider_timeout`;
caller cancellation still reports cancellation. WebSocket messages remain subject
to the [64 MiB limit](#request-boundary). REA does not impose a message-count or
pending-command quota. On cancellation, it closes only its own WebSocket,
waiting up to one second before terminating it. Malformed unsolicited events
+56 -19
View File
@@ -23,9 +23,9 @@ that rejection does not roll back browser effects. REA removes its owned
future-document scripts, restores live frame methods, then disconnects.
Add secret declarations, storage seeds, and additional artifact or event
capture only when needed. Action, secret, and storage counts are not capped.
Duration, action, and navigation
timeouts remain fixed provider-owned liveness limits; the request does not
accept a caller-controlled `limits` object.
Duration, action, and navigation timeouts remain fixed provider-owned liveness
limits. `capture.limits` controls retained event and network-content budgets;
it does not change those liveness deadlines.
## Minimal launch example
@@ -179,12 +179,44 @@ declared action. Each step reports action status, elapsed time, sanitized URLs,
event bounds, and independently typed capture states for screenshot, DOM,
accessibility, URL, history, and storage. Console, page-error, network,
WebSocket, frame, worker, popup, and cancelled-download events are attributed to
steps and all observed events and requested artifacts are returned inline.
There are no event, frame, worker, popup, WebSocket, DOM-node,
accessibility-node, storage-entry, screenshot-count, or cumulative
metadata-byte caps. Requested artifacts and observed events are returned
inline without application-defined size ceilings. Other missing sections
remain explicit and make the capture ineligible for equality claims.
steps. Retained events and requested artifacts are returned inline; omitted
events are counted by kind and identify affected network transactions.
Event and selected network-content retention have caller-selected limits under
`capture.limits`. Omitted values use the defaults below; every supplied value
must be a positive safe integer, and callers can raise or lower a default.
Byte limits are conservative allocation-cost estimates for retained event
values, including UTF-16 storage and JSON expansion, rather than serialized
bytes or a promise about exact process memory. `events.omissions.by_kind`
reports counts and reasons for omitted event kinds. Its
`network_transactions` rows identify affected transaction IDs and omitted
event kinds; `network_transaction_range` identifies the contiguous IDs beyond
the transaction limit. Omission metadata is bounded by the selected
transaction limit. Other missing sections remain explicit and make the capture
ineligible for equality claims.
The default limits are 10,000 events, 4 MiB estimated allocation for one
event, 16 MiB estimated allocation across retained events, 1,024 network
transactions, 64 KiB of body bytes per transaction phase, 1 MiB estimated
allocation for body redaction/base64, 1 MiB for retained header values, and
1 MiB for network metadata. The same limits are included in the capture
Evidence. Playwright materializes response bodies before REA can inspect their
byte length; `max_network_body_bytes` bounds subsequent retained copies and
does not bound the browser API read itself. A body that exceeds its selected
limit has an explicit `body-size-limit` or `body-allocation-limit` unavailable
state with the observed and allowed values.
Additional implementation bounds are 16 simultaneous network-content reads,
a 5-second deadline for each provider API read, and 2,048 live event-listener
owners. These are not caller-selectable. The concurrency bound queues admitted
content jobs and does not itself omit observations; a provider read timeout
produces a typed unavailable state, while exceeding listener capacity produces
event-kind omission counts. A preflight avoids body redaction and base64 copies
when the currently available event budget already rejects the body.
Concurrent reads may each pass that check before their events are retained;
their retained-copy work is bounded by 16 times the selected per-body
allocation limit. The Playwright response Buffer itself is materialized before
REA can apply that limit. Requested artifacts and retained events are returned
inline within the declared limits.
Attach-mode captures also declare the unavoidable pre-attach event gap.
Selected event families are observed on the root page and discovered descendant
@@ -288,16 +320,21 @@ retained representation after redaction.
Only completed responses are read. At the end of the final step, observation
stops; requests still in flight emit `request-unfinished`, and their observed
responses have explicitly unavailable bodies. This cutoff does not wait for
long-lived streaming connections. Already-started content reads settle before
browser cleanup, with a provider-owned five-second timeout per read and
cancellation support. Failed or unexposed reads retain per-content states and make selected
event coverage incomplete. Body events can arrive during later steps or final
drain; event bounds describe receipt during the step, while the source event
reference establishes the transaction phase. Comparison attributes content, like
every other event of its transaction, to the step that sent the request (the
receipt step when that request was not observed) and excludes the sequence
reference from normalization.
responses have explicitly unavailable bodies. Already-admitted content reads
drain before browser cleanup. At most 16 reads run at once; queued work is
bounded by the selected network-transaction limit and by successful admission
of its request or response event. Each provider API read has its own five-second
timeout once it starts, so queue wait adds to total drain and cleanup time; this
is not a five-second total capture cutoff. Cancellation interrupts active reads
and queued jobs produce cancelled states without calling their provider APIs.
This drain does not wait for long-lived unfinished streaming connections and
does not refetch unfinished response bodies. Failed or unexposed reads retain
per-content states and make selected event coverage incomplete. Body events can
arrive during later steps or final drain; event bounds describe receipt during
the step, while the source event reference establishes the transaction phase.
Comparison attributes content, like every other event of its transaction, to
the step that sent the request (the receipt step when that request was not
observed) and excludes the sequence reference from normalization.
Playwright scenario capture does not supply initiator stacks; passive CDP
observation retains its own initiator evidence.
+46 -6
View File
@@ -314,16 +314,56 @@ diagnostics appear inside the report when `--full-output` is selected. Log
truncation alone does not change the diagnostic health or exit status.
The default terminal format is TOON. Use `--json` when saving results for a
JSON consumer. `--json` is indented on a terminal and compact when piped or
JSON consumer. Valued output flags (`--format`, `--filter-output`,
`--token-limit`, `--token-offset`) accept `--flag value` or `--flag=value`; a
missing value fails with `MISSING_OUTPUT_VALUE` before the command runs. `--json` is indented on a terminal and compact when piped or
redirected, which keeps large results smaller for agents and scripts; pipe
through `jq .` for indented files. Output selection and formatting do not change
operation status.
| Status | Meaning |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `0` | The operation completed. Its result may include partial evidence, warnings or unresolved questions. |
| `1` | The operation could not complete. Structured output identifies invalid input, permissions, cancellation, timeouts or another failure when available. |
| `128 + N` | Signal `N` ended the process, where the shell or runtime preserves the conventional signal-derived status. |
For `cutter-command`, `--json-output` requests command-specific JSON from
Cutter when available. This is separate from `--format json`, which selects the
CLI result representation; the global `--json` flag selects that same CLI
representation.
Cutter still accepts deprecated `--json=true` and `--json=false` compatibility
values. When both forms are present, `--json-output` takes precedence in either
argument order. Bare `--json` retains its global meaning of selecting JSON CLI
output formatting.
| Status | Meaning |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `0` | The operation completed. Its result may include partial evidence, warnings or unresolved questions. |
| `1` | The operation could not complete. Structured output identifies invalid input, permissions, cancellation, timeouts or another failure when available. |
| `128 + N` | Signal-derived status. An unhandled signal may have ended the process, with the shell or runtime preserving the conventional status; a command may instead have handled the signal, waited for its operation and cleanup to settle, and assigned the same status (`130` for SIGINT, `143` for SIGTERM). In the handled case, it may also have printed a structured `cancelled` result. |
A `cancelled` result does not by itself determine the exit status; it depends on
the command's signal handling. Commands routed through the shared
`withCommandCancellation` handler in the CLI set status `130` for SIGINT or
`143` for SIGTERM after their operation settles. Current source registrations
use that handler for process capture and comparison (`capture-process`,
`compare-process-captures`), JavaScript application analysis (`analyze` when it
selects the JavaScript lane, and `analyze-javascript-application`), selected
browser, web and Electron commands (including `analyze-web-bundle`,
`observe-web-execution`, `capture-browser-scenario` and
`capture-electron-scenario`), and the platform and provider command families
for Android/ADB, Apktool/JEB/Flutter, firmware, PCAP and signal analysis,
WASM/EVM, Go/Rust and binary diagnostics, Frida instrumentation, the Cutter
command, objdump, Rizin and GDB. In these paths, a returned structured
`cancelled` result can be printed before the wrapper assigns the
signal-derived status. This describes the current source routing; it is not a
claim that every command or provider runtime has been independently exercised.
When the reader of piped output closes early, as `rea ... | head` does, the
CLI stops writing, prints no error and exits `141` (`128 + 13`, the status of a
SIGPIPE-terminated writer). The operation itself may have completed; only its
output was declined.
`inspect-artifact` also returns a structured cancelled result, but its direct
analysis cancellation path does not set a signal-derived exit status, so it
exits `1`. Setup has its own contract: cancellation exits `0`. Treat the
structured result and process status as separate signals when scripting
cancellation.
`setup --dry-run` returns `planned` and exits `0`; a cancelled setup also exits
`0`. Setup returns `1` for `needs_confirmation` or `needs_human`.
+43 -4
View File
@@ -140,8 +140,35 @@ profiles](mcp-contracts.md#output-schemas).
Setup registers `rea` in `~/.kimi-code/mcp.json`, or
`$KIMI_CODE_HOME/mcp.json` when set, while preserving unrelated settings and
creating a `.rea.backup` before updating an existing file. Kimi Code infers
stdio from the `command` entry, so setup does not add a `type` field. The
registration includes `startupTimeoutMs = 30000` and `toolTimeoutMs = 120000`.
stdio from the `command` entry, so setup does not add a `type` field. New
registrations include `startupTimeoutMs = 30000` and a `toolTimeoutMs` derived
from REA's known provider allowance plus 120 seconds of operation
headroom. The default is 450000 ms, covering the default 330-second Ghidra
startup; an explicit Ghidra startup timeout of 2700000 ms produces a 2820000 ms
tool timeout. The startup allowance follows an explicitly selected Ghidra or
Hopper provider, and otherwise uses the larger known Ghidra/Hopper deadline.
An explicit `REA_JEB_MCP_TIMEOUT_MS` request budget also contributes to that
maximum. For `ida` or `auto` selection, a valid IDA registration's parsed
`timeoutMs` also contributes to that maximum; its default is 300000 ms.
Setup forwards these explicitly selected REA deadlines and the input schema
profile into the registration; unrelated process values are omitted.
This headroom is a practical default, not a guarantee for every analysis
duration. Setup preserves positive timeout values already in the `rea` entry.
You can edit `startupTimeoutMs` and `toolTimeoutMs` there; doctor keeps positive
caller-selected values aligned and reports a non-blocking advisory when a tool
timeout is shorter than the known provider allowance.
Setup selects the compact input-schema advertisement for new or refreshed Kimi
registrations unless their stored configuration or setup environment explicitly
selects `REA_MCP_INPUT_SCHEMA_PROFILE=full` or `compact`. This keeps REA's
canonical tool validation unchanged while avoiding a Moonshot Kimi Code 2.2.0
failure observed with the full catalog: its request was rejected because a
single tool schema exceeded the provider's size limit. The limit is
provider-specific and not an MCP protocol limit. `rea doctor --client kimi`
reports an older registration with no explicit profile as stale. To restore the
compact profile, run `rea setup --client kimi` or add
`REA_MCP_INPUT_SCHEMA_PROFILE=compact` to the registration's `env`, then restart
Kimi Code. An explicit `full` profile remains respected and can still exceed
Moonshot's limit.
Kimi Code also discovers personal skills in `~/.agents/skills` and project-local
`.agents/skills`, so no separate skill root is required; setup still installs
and verifies the matching skill files through the normal shared-skill flow.
@@ -207,8 +234,20 @@ standalone CLI check.
## Codex and Devin
Codex treats an unset or empty `CODEX_HOME` as `~/.codex`. Devin honors
`XDG_CONFIG_HOME` for its `devin/mcp_config.json` on non-Windows systems.
Codex treats an unset or empty `CODEX_HOME` as `~/.codex`. Its MCP server
registration supports `startup_timeout_sec` for connection initialization and
`tool_timeout_sec` for each tool call. New REA registrations use a 30-second
startup timeout and a tool timeout derived from the known provider
allowance plus 120 seconds of operation headroom. This yields 450 seconds for
the default Ghidra allowance; an explicit Ghidra startup timeout of 2700
seconds yields 2820 seconds. Setup preserves positive caller-selected timeout
values in the REA entry, and doctor reports a non-blocking advisory when a tool
timeout is shorter than the known provider allowance. An explicitly selected
JEB request budget also contributes to the allowance. A configured IDA
registration's parsed `timeoutMs` contributes for `ida` or `auto` selection.
These values are client-side deadlines, so increase them in `~/.codex/config.toml` if a
workload needs more time. Devin honors `XDG_CONFIG_HOME` for its
`devin/mcp_config.json` on non-Windows systems.
## OMP
+22
View File
@@ -6,6 +6,28 @@ and provider lanes. Each record below states its host, client version, model
fixture, and remaining coverage; a native-client run with a loopback model does
not establish live model-service acceptance.
## Published Pi code-mode renderer limit
A separate probe of the published `@earendil-works/pi-codemode` 1.1.0 and 1.2.0
declaration renderers rendered the full `compare_web_captures` input as
`args: unknown`: its generated TypeScript type exceeds Pi's 16,000-character
default. REA keeps the full advertisement's fields by inlining references when
the shared form would exceed Pi's 32-reference expansion limit; retaining that
shared form would leave later fields unknown instead. The existing
`REA_MCP_INPUT_SCHEMA_PROFILE=compact` profile lets callers stay below
its character limit by advertising reduced nested validation structure, while
REA continues to validate calls against the complete canonical input schema.
Compact applies to the server's advertised inputs and is not an automatic
full-profile fallback; see the [compact input schema profile](mcp-contracts.md#compact-input-schema-profile)
for details of its reduced forms.
Custom renderer hosts can raise `inputMaxChars` through `renderToolSignature` or
`renderToolSample`; `renderDeclarations` does not expose that override. The
probe exercised the published renderer code, not a native Pi host or model, and
does not establish broader Pi compatibility. See the pinned upstream
[`declarations.ts`](https://github.com/earendil-works/pi/blob/b45e0ebcc5ae2fc42a6f2f23104d10e656e6bedb/packages/codemode/src/declarations.ts)
and [renderer usage notes](https://github.com/earendil-works/pi/blob/b45e0ebcc5ae2fc42a6f2f23104d10e656e6bedb/packages/codemode/README.md#declarations-for-the-model).
## End-to-end, integration and golden evidence
The optional `verify:qwen-client`, `verify:pi-client`, and `verify:hermes-client`
+6
View File
@@ -116,6 +116,12 @@ If cleanup cannot be verified, the error retains collected observations in
`details.partial_observation` and marks their application cleanup `unverified`.
Cleanup uncertainty does not authorize signaling unrelated processes.
### Target fuse prerequisites
Active scenario capture requires that the target Electron executable honors Node CLI inspector flags (`--inspect` or `--remote-debugging-port`) so that Playwright can establish its DevTools protocol session.
When an Electron executable explicitly disables the `EnableNodeCliInspectArguments` fuse (or removes the capability), `capture-electron-scenario` fails immediately before process launch with an `AnalysisUnsupportedTargetError` ("unsupported_target") rather than waiting for the startup deadline. For targets with disabled inspector fuses, use passive CDP inspection via `inspect_electron_page` or run against an unrestricted development binary with the extracted `app.asar`.
The real verifier exercises compiled CLI and stdio MCP discovery, page/script
inspection, static/runtime reconciliation, active observation, and CLI SIGTERM
cleanup before checking the IPC, renderer crash/reload, utility/child-process,
+2 -2
View File
@@ -153,8 +153,8 @@ overview merely because its source artifact is unchanged.
Function extents and instruction completeness refer to Ghidra's analyzed body.
An inferred no-return call can terminate that body before subsequent bytes.
Pseudocode, assembly, procedure info, instruction windows, callee and caller
reads, and dossiers report observed terminal call sites in Evidence limitations,
Pseudocode, assembly, procedure info, instruction windows, incoming and outgoing
references, callee and caller reads, and dossiers report observed terminal call sites in Evidence limitations,
including resolved callee names, addresses, and FunctionManager flags when
available. On x86-32, the same views also report the exact Borland/Delphi-style
FS exception-registration pattern when its handler address falls outside the
+2 -2
View File
@@ -131,9 +131,9 @@ Use a package version that actually includes this adapter; repository main can b
{"name":"close_binary","arguments":{}}
```
Opening an MCP target starts its selected provider session; headless opening waits for auto-analysis. Set the agent's MCP request deadline long enough for the target. The registration's optional `timeoutMs` defaults to 300000 for upstream requests. A freshly opened headless worker can briefly report `status: "busy"` from `server_health`; REA re-reads the health every 100 ms until the worker answers, the caller cancels, or `timeoutMs` has elapsed since the first read. Only expiry while the worker is still busy produces a retryable `provider_timeout`; no further read is started once the deadline has passed. That error names the busy tool of the last observation, or `unknown` when the worker reported none or a value that is not tool-name-shaped. Cancellation during the wait produces `cancelled`. Any other unexpected health payload, including a busy payload with an invalid shape, remains `unreadable_output`. Cancellation drains the current upstream request before cleanup; it does not force-stop GUI analysis. An open request that times out without a completed response retains the private workspace because worker inventory alone cannot prove the request has stopped. `binary_session` reports actual tool availability. Repeated doctor/setup calls are unnecessary when the registration already works.
Opening an MCP target starts its selected provider session; headless opening waits for auto-analysis. Set the agent's MCP request deadline long enough for the target. The registration's optional `timeoutMs` defaults to 300000 for upstream requests. An upstream SDK request that reaches this limit returns `provider_timeout` with its operation and actual request budget. A freshly opened headless worker can briefly report `status: "busy"` from `server_health`; REA re-reads health every 100 ms until the worker answers, the caller cancels, or `timeoutMs` has elapsed since the first read. Each health request is capped by the time remaining in that overall wait, so a stalled read cannot extend the readiness deadline by another full request timeout. Expiry while the worker is still busy produces a retryable `provider_timeout`; no further read is started after the deadline. That error names the busy tool from the last observation, or `unknown` when the worker reported none or a value that is not tool-name-shaped. If a health request itself consumes the remaining wait budget, the same last-busy timeout is returned with the stalled request's captured output. Cancellation during the wait produces `cancelled`. Any other unexpected health payload, including a busy payload with an invalid shape, remains `unreadable_output`. Cancellation drains the current upstream request before cleanup; it does not force-stop GUI analysis. An open request that times out without a completed response retains the private workspace because worker inventory alone cannot prove the request has stopped. `binary_session` reports actual tool availability. Repeated doctor/setup calls are unnecessary when the registration already works.
For guided registration, set `REA_IDA_MCP_CONFIG` before `rea setup --client <client>`. Setup includes that file reference in its reviewed plan and preserves it after approval; it does not copy upstream credentials into the agent configuration. `rea doctor --provider ida --json` validates the registration without starting IDA and explicitly leaves runtime compatibility and target binding for analysis.
For guided registration, set `REA_IDA_MCP_CONFIG` before `rea setup --client <client>`. Setup includes that file reference in its reviewed plan and preserves it after approval; it does not copy upstream credentials into the agent configuration. For `ida` or `auto` selection, Codex/Kimi setup and doctor use the effective client registration's parsed `timeoutMs` (default 300000 ms) when recommending the agent's per-tool deadline. Existing positive client deadlines remain caller choices. `rea doctor --provider ida --json` validates the registration without starting IDA and explicitly leaves runtime compatibility and target binding for analysis.
## Coverage and evidence
+59 -9
View File
@@ -147,7 +147,8 @@ identity remains available at `identity.catalog`.
Setup pins package-runner MCP registrations to the exact installed REA version,
installs the matching skill and on-demand references in the same plan, and adds
`startup_timeout_sec = 30` for Codex and Grok Build.
`startup_timeout_sec = 30` for Codex and Grok Build. Codex also receives a
`tool_timeout_sec` derived from known provider startup plus operation headroom.
## Limit REA to one project or agent profile
@@ -259,14 +260,14 @@ Register with the variable unset:
<!-- x-release-please-start-version -->
```bash
claude mcp add --scope local rea -- npx -y rea-agents@6.4.0 mcp
claude mcp add --scope local rea -- npx -y rea-agents@6.5.0 mcp
```
On native Windows, use the same project directory and wrap the package-runner
shim so the stdio client can launch it:
```powershell
claude mcp add --scope local rea -- cmd.exe /d /c npx -y rea-agents@6.4.0 mcp
claude mcp add --scope local rea -- cmd.exe /d /c npx -y rea-agents@6.5.0 mcp
```
<!-- x-release-please-end -->
@@ -397,9 +398,11 @@ running server or its registration.
The npm release checked on **2026-10-11** was **6.4.0**, published from
[`a56f7bb6`](https://github.com/morluto/rea/commit/a56f7bb668ab23fec8d33f7af353ac7ed2fe1895).
The actual registry package accepted dry-run setup plans for the 17 client IDs
in that release, including Qwen Code, Pi and Hermes. DeepSeek Harness (`dsh`)
is on main and is not in npm 6.4.0; `rea setup --client dsh` against `@latest`
reports an unsupported client until a release containing it is published.
in that release, including Qwen Code, Pi and Hermes. Seven client IDs are
included from 6.5.0 and were absent from the checked npm 6.4.0 package: `droid`,
`dsh`, `kimi`, `qoder`, `trae`, `workbuddy` and `zcode`.
The 6.4.0 registry check does not establish 6.5.0 publication or live DeepSeek
API integration.
OpenCode's plan selected
`OPENCODE_CONFIG_DIR` even when that directory did not yet exist. These checks
used an isolated home on macOS with Node 24; they verify planning and argument
@@ -480,8 +483,8 @@ hosted connector; see [its configuration](client-configuration.md#other-client-s
| ZCode | `zcode` |
| DeepSeek Harness | `dsh` |
`dsh`, `kimi`, and `workbuddy` require a release containing them. The registry
check above does not cover them.
`droid`, `dsh`, `kimi`, `qoder`, `trae`, `workbuddy`, and `zcode` require
`rea-agents@6.5.0` or later. The 6.4.0 registry check above does not cover them.
See [client configuration and troubleshooting](client-configuration.md) for
configuration paths, profiles, trust policies, and schema-limit workarounds.
@@ -539,6 +542,37 @@ search permissions (`0700`) on a directory you own before retrying.
On supported Linux distributions, approved setup verifies Hopper's official
`.deb`, `.rpm`, or Arch package before invoking the native package manager.
The official release feed selects the current public demo without a version
pin. REA verifies the package's detached PGP signature against Hopper's stable
primary fingerprint `7C2D73BAFAF5B9A710A69DA1A26DF815099B1BCD`, then checks
that the signed package and installed launcher agree with `main_exe_hash`.
Rotating signing subkeys remain bound to that primary identity.
The feed row itself is not PGP-signed; doctor labels its display version as
`reported_release_version`, separately from the authenticated launcher identity.
The approval plan includes the caller-selected cache location. Approved setup
retains the signed archive, public key and release metadata under
`${XDG_CACHE_HOME:-$HOME/.cache}/rea/hopper-releases/<launcher-sha256>`.
An empty `XDG_CACHE_HOME` uses `$HOME/.cache`. Approved setup can repair a
damaged caller-owned entry after authenticating a fresh package; the previous
entry is preserved beside it as `<launcher-sha256>.backup-<id>`. Ordinary doctor
and launches reject damaged evidence and never repair it implicitly.
Approved publications of the same canonical cache entry share a process-backed
lease. Concurrent setup waits without moving another writer's evidence; a
failed replacement restores the previous directory when possible and reports
any retained backup path. Unavailable reads or native inspection tools do not
authorize replacing existing evidence.
Doctor and launches authenticate this evidence for offline use; an editable
digest receipt alone cannot authorize a launcher. Verification reuses at most
eight immutable package proofs per process, keyed by the complete package,
key, signature, package format and expected launcher digest. Cached file reads
still check identity and content. Without retained evidence, inspecting an
existing install requires the matching current official package and network
access. Successful live inspection can be reused within that process after
rehashing the launcher; it does not write a persistent cache or claim that a
previously observed release is still the latest. Older uncached builds require
an approved update while the feed exposes only its current release.
REA runs the supported demo build on a private Xvfb display and selects Hopper's
offered demo mode for each analysis session; it does not require the user's
desktop display. Unattended package-manager access requires
@@ -584,6 +618,8 @@ system application, the canonical application installed by `rea setup` under
diagnostic; to use a Homebrew-installed launcher for CLI/MCP startup, set
`HOPPER_LAUNCHER_PATH` to the path reported by doctor. REA does not run Homebrew
while loading runtime configuration.
Automatic discovery accepts executable regular files, including file symlinks,
and skips directories.
On Linux, it prefers executable `/opt/hopper/bin/Hopper`, then executable
`~/.local/share/rea/hopper/bin/Hopper`, followed by `/opt/hopper-v4/bin/hopper`
and `/usr/bin/hopper`; if none exists, the former remains the diagnostic
@@ -631,6 +667,20 @@ If startup reports `Cannot launch Hopper! Connection is invalid.` or waits for
bridge readiness, check Hopper for a pending demo, license, or loader dialog.
Complete the dialog and retry. If REA reports `cleanup_incomplete`, follow the
retained-resource guidance below before reopening the target.
On macOS, Hopper can show an `Executing Python Script...` overlay while the REA
bridge serves an active MCP connection. Long-lived MCP clients can keep that
connection open across agent turns, so the overlay may remain visible after the
analysis calls finish; by itself, it does not establish a stalled startup. REA
does not automatically idle-close a still-connected target. When the
investigation is finished, export an Evidence bundle first if you need to keep
the session ledger, then call `close_binary`; set `snapshot_path` to save a
provider-neutral analysis snapshot as part of closing. A successful close
shuts down the REA bridge and clears its overlay; REA does not control the
macOS Hopper application lifetime.
The Hopper GUI Cancel button's behavior for this bridge has not been verified;
`close_binary` is the supported cleanup path.
Hopper serializes analysis requests. Cancelling a wait can leave provider work
running, which the session reports. Successful decompilation is cached until
a relevant rename or comment changes it.
@@ -1054,7 +1104,7 @@ For a client that requires manual configuration, use:
"mcpServers": {
"rea": {
"command": "npx",
"args": ["-y", "rea-agents@6.4.0", "mcp"]
"args": ["-y", "rea-agents@6.5.0", "mcp"]
}
}
}
+7
View File
@@ -60,6 +60,8 @@ provider implicitly.
`trace_javascript_semantics` queries the authenticated companion graph without
rereading mutable files. A seed may identify a semantic or application node,
literal, function fingerprint, property, endpoint, event, or boundary field.
For a recovered parse, coercion, or validation boundary, its field value is the
static operation's method name (for example, `Number`).
The query declares backward provenance, forward influence, callers, or
ownership and can restrict admitted relation kinds. REA returns every matching
seed and the complete reachable subgraph; callers do not choose node, relation,
@@ -83,6 +85,11 @@ callee bodies and built-ins such as `Object.assign`, `Reflect.set`, and
values. This uncertainty does not prove that a call actually mutated a value.
Interprocedural aliasing beyond the supported call-site references remains
outside this mutation pass.
For process configuration, only known environment value slots and canonical
argument indexes are treated as primitive when passed to calls. Unknown or
inherited selections can expose a mutable prototype, so later reads of that
configuration container retain uncertainty; earlier top-level reads and unrelated
configuration containers remain independent.
Function fingerprints commit normalized syntax, control-flow shape, relation
shape, literal sets, arity, and detected effects without using local names or
+11 -1
View File
@@ -206,6 +206,9 @@ code unit, matching the original bytes identified by the artifact digest.
Plain `.ts` artifact sources use TypeScript syntax without JSX, including
angle-bracket type assertions. `.tsx` and `.jsx` retain JSX parsing.
JavaScript sources use JavaScript grammar with JSX, never TypeScript syntax,
so valid JavaScript that TypeScript reads differently keeps its JavaScript
meaning.
Relative TypeScript imports can name their emitted `.js`, `.mjs`, or `.cjs`
counterparts while resolving to inventoried source files. This substitution
@@ -220,7 +223,10 @@ Selected bounded text is then parsed as inert data to recover:
- Webpack and Rspack chunk registrations and module factories represented as
AST literals;
- static imports, dynamic imports, CommonJS `require` calls, workers, and
service workers;
service workers (only `new Worker(new URL(path, import.meta.url))` resolves
relative to the calling module; string worker and service-worker paths use
the document base URL or Node's working directory, which static analysis
does not establish, so they keep their expression and stay unresolved);
- route, network endpoint, storage, and vendor-marker observations;
- local source-map declarations and original
source names and content digests;
@@ -626,6 +632,10 @@ href are read without surrounding whitespace or embedded tabs and newlines, and
their percent-encoded path bytes are decoded; encoded dot and separator bytes
are still rejected. CommonJS module lookups retain extension and directory
resolution.
ESM, HTML, and URL references apply URL dot segments to empty path segments:
`./assets//../app.js` selects `assets/app.js`, while a remaining empty segment
such as `./assets//app.js` stays unavailable. CommonJS keeps filesystem path
semantics and selects `app.js` for the same text.
Unresolved HTML references retain their declaration, source range, and resolution
reason in the renderer observations.
HTML script source ranges follow the HTML parser across LF, CRLF, and bare CR
+5
View File
@@ -95,6 +95,11 @@ pauses or resumes execution, calls `Runtime.runIfWaitingForDebugger`, launches
the target, instruments JavaScript, or invokes Electron APIs. Closing a call
closes only REA's WebSocket.
Each WebSocket handshake and command response has its own 20-second deadline,
separate from the caller-selected observation window. A stalled handshake or
command reports `provider_timeout` and retains observations already received;
caller cancellation still reports cancellation.
The direct observations are:
- `Debugger.scriptParsed`, establishing that a bounded script location was
+15
View File
@@ -16,6 +16,21 @@ URL after validating its syntax. That validation does not establish that the
JEB service is reachable or that a project is open; use the existing
`inspect-jeb-client` command for a read-only service query.
MCP `binary_session` probes the live JEB service and its advertised tool catalog.
Availability is reported per operation: a reachable headless client can support
inspection and decompilation while refusing `open_jeb_project`. Catalog discovery
uses one 60-second deadline across connection and pagination; a responsive server
cannot keep discovery running indefinitely by returning more pages.
Each upstream tool call has an absolute 60-second request deadline by default.
Set `REA_JEB_MCP_TIMEOUT_MS` to a positive decimal number of milliseconds to
select a different per-request budget, for example `REA_JEB_MCP_TIMEOUT_MS=300000`
for a five-minute decompilation. This budget starts after discovery and applies
to each individual `tools/call`; it does not extend the separate catalog deadline
or establish one end-to-end deadline across a whole CLI or MCP operation. A
request that reaches its budget returns a typed timeout, while caller
cancellation remains a cancellation.
Verified against JEB 5.48.0 (Linux x64, licensed build) serving `jeb-mcp-server` 1.3.0 over streamable HTTP.
## Operations
+64 -13
View File
@@ -167,7 +167,14 @@ MCP uses `inspect_managed_members` with
Repeat `--type` or supply multiple unique `type_names` for several types.
Names match the reported `full_name` exactly. Top-level names are namespace
qualified; nested types currently report bare names, which can select several
types with that name.
types with that name. Each type's `enclosing_type_token` records its enclosing
TypeDef. `nesting_read` distinguishes complete source rows (true), incomplete
current rows (false), and historical Evidence (null). A null enclosing token
alone does not establish that a type is top-level.
Each selected type also retains `name_sha256`, a framed digest of its namespace,
name and enclosing names. It uses the same bounded, cached owner as signature
type operands and remains available when selection omits the enclosing types.
It adds one fixed-size digest per returned type rather than repeated name paths.
The result preserves the requested names in `selection.type_names` and reports
unmatched names separately. If metadata names are unreadable, limitations retain
@@ -243,9 +250,16 @@ native/runtime questions retain their own authority and coverage.
Names and semantic labels do not establish durable member identity. Comparison
preserves observed differences, structural inferences, and unknowns separately.
Cross-version matching first pairs members of the same declared type and name:
methods by exact CIL/signature identity, then by raw signature, then by
structural body shape; fields by raw signature. Exact CIL/signature identity
Cross-version matching first pairs members of the same declared type and name.
A current declared type uses its observed `name_sha256`, so same-named nested
types in different enclosing types stay distinct even in selected inventories.
Malformed, missing, contradictory, cyclic or over-deep enclosing identity remains unknown;
the comparison preserves display names without using them to repair that gap.
Historical observations retain an explicitly limited bare-name mode when either
side predates the identity facts. A known current identity gap still remains
unknown beside a historical observation. Matching then pairs
methods by exact CIL/signature identity, then by signature, then by
structural body shape; fields by signature. Exact CIL/signature identity
requires equal raw CIL digests and decoded fingerprints. Equal decoded
fingerprints alone cannot establish an exact match: they omit switch targets
and collapse distinct NaN encodings. Only then may a remap pair a
@@ -253,23 +267,56 @@ renamed or moved member across declared types or names: a method by exact
CIL/signature identity or structural body shape, a field by exact decoded
signature. A remap never takes a member whose own declared type and name remain
unpaired on the other side, so a member is never taken from its own changed
counterpart. A member whose declaring type is unresolved could belong to any
type, so it pairs by name only when no other member shares its exact
CIL/signature key, never by structural shape alone, and any remap group it
joins stays ambiguous. The exact-signature key uses names only as part of that
counterpart. A member whose declared identity is unresolved could belong to any type. It
never makes a declared-identity pair, and any remap group it joins stays
ambiguous. Unresolved same-named counterparts prevent definitive added/removed
claims, while observed names and tokens remain available in the result.
The exact-signature key uses names only as part of that
full tuple; names alone never select a pair. Duplicate tuples remain ambiguous
rather than being paired by token order. The raw signature is exact whether or
rather than being paired by token order. Every round compares signatures by
`resolved_sha256`: the raw signature with each TypeDef or TypeRef operand
replaced by a digest of that type's namespace and name, hashed as separate
values so `A` + `B.C` differs from `A.B` + `C`, after its enclosing types for a
nested type (`Outer/Inner`). The defining assembly is not part of the name:
a TypeDef and a TypeRef with the same namespace and name compare as the
same nominal name, and a TypeRef's ResolutionScope assembly is ignored, so a type
forwarded from one assembly to another still pairs. Two different types with
the same full name in different assemblies therefore have equal name digests.
Comparison reports this scope limitation inline; it does not establish CLR
type identity or runtime binding equivalence.
Nesting deeper than 64 levels is not named, and such a signature compares by
its raw digest. Comparison keys keep resolved and raw digests apart, so a raw
digest never pairs with an equal resolved one.
Raw signature bytes name types by metadata row, and rows are build-local, so
the same signature usually has different raw bytes in two builds. A signature
that names no types resolves to its raw digest. When an operand cannot be
resolved, such as a TypeSpec, or when REA could not parse the signature, the
raw digest stands in. Missing or unreadable TypeDef and TypeRef operands are
reported as coverage issues. Invalid NestedClass rows retain their failure
reasons and withhold TypeDef signature identities; type names and nesting are
parsed once by their shared owner. Each current inspection records
`signature_resolution: "type-names-v1"`, even when none of its operands can be
resolved. Historical Evidence defaults this attestation to `null`. When either
observation predates resolution, both sides compare raw digests, which pair only where type rows agree,
and the comparison reports that limitation. The signature is exact whether or
not REA decoded it, so undecoded signatures pair by that tuple too, but they
never enter structural rounds. An unmatched member is therefore reported as
`unknown`, not added or removed, when its own signature was not decoded or when
the other side has an unpaired member, one-sided or ambiguous, with the same
declared type and name whose signature was not decoded.
declared type and name whose signature was not decoded. When both observations
attest type-name resolution, a decoded signature that still compares by its raw
digest is treated the same way: an unmatched member with one, or beside an
unpaired same-named member with one, is `unknown`, because its raw bytes name
types by build-local row. A matched unresolved signature also remains unknown
unless another observed dimension establishes a change; identical row bytes
can reference different TypeSpec contents. Its resolution limitation is retained
even when another dimension changes.
For a matched method, an unavailable or partial body makes body-shape facets
unknown while preserving observed signature differences. For complete bodies,
a difference in either the raw CIL digest or the decoded fingerprint is reported
in the `cil` dimension, including reordered switch targets with equal decoded
fingerprints. Structural identity compares normalized signatures, the limited
fingerprints. Structural identity compares resolved signatures, the limited
decoded-CIL tuple fingerprint,
constants, and bounded shape context. It reports all candidates at the winning
score and remains ambiguous when the evidence does not distinguish them. The
@@ -323,6 +370,9 @@ function implements a specific managed method.
`verify_managed_native_boundaries` compares declared P/Invoke module and entry
point identities with supplied native export or function evidence. Name/module
matches establish declaration links; they do not establish that a call executed.
When either side lacks a usable module identity, a matching name remains
unresolved and retains the candidate evidence; REA reports a module mismatch
only when both identities are available and differ.
Metadata tokens are not native addresses. Native body mapping for C++/CLI,
ReadyToRun, NativeAOT, and IL2CPP requires separately verified format and provider
@@ -360,8 +410,9 @@ these indirections for member ownership and local attribute-constructor types;
field and method tokens still identify the original definition rows.
`field_list` and `method_list` retain the metadata's list coordinates, which
refer to the pointer table when present rather than necessarily contiguous
definition rows. Malformed or ambiguous pointers leave the owner unknown with
partial coverage while preserving readable member and attribute facts.
definition rows. Invalid or nonmonotonic list coordinates and malformed or
ambiguous pointers leave affected owners unknown with partial coverage while
preserving readable member and attribute facts.
The retained inverse indexes are admitted against the existing representation
budget before allocation.
+50 -22
View File
@@ -38,13 +38,10 @@ socket and device entries are not opened. Case-distinct archive members remain
separate observations. Their case-insensitive materialization diagnostic does
not reduce traversal coverage when both spellings were read.
Current output also retains `coverage_status` (`complete` or `partial`) for existing clients, derived from the scoped traversal status. The owning parser normalizes retained `coverage_status` records to scoped coverage and rejects conflicting declarations.
The coverage field is optional when reading older retained Evidence. The owning
inventory parser recognizes historical REA scope notices for compatibility;
unfamiliar legacy limitations remain conservative. Typed records do not derive
coverage from limitation text. Pages from one inventory must carry the same
coverage declaration.
Current inventory Evidence requires scoped `coverage` with a `complete` or
`unknown` status. Consumers use this producer-owned fact and reject records
without it; limitations are explanatory and do not supply or infer coverage.
Pages from one inventory must carry the same coverage declaration.
Function dossiers can declare per-facet coverage in the optional
`normalized_result.facet_availability` map. Each supplied facet is either
@@ -520,6 +517,14 @@ These deadlines have different owners:
| Darwin swiftc helper | REA allows 120,000 ms by default for ownership-helper compilation; `REA_SWIFTC_COMPILE_TIMEOUT_MS` accepts decimal integers from 1–2,147,483,647 ms. Invalid values fail configuration validation. |
| Individual tool call | The client bounds its wait, including cold engine startup. The pinned client SDK 2.3.1 defaults to 60,000 ms and can cancel earlier than REA's startup deadline. |
For [Codex and Kimi registrations](client-configuration.md), setup supplies
missing tool deadlines from the known provider allowance plus 120 seconds of
operation headroom: 450 seconds with the default Ghidra allowance, or 2820
seconds with `REA_GHIDRA_STARTUP_TIMEOUT_MS=2700000`. Positive caller-selected
deadlines remain unchanged. Doctor reports an informational recommendation
when a configured deadline is shorter than the known provider allowance. An
explicit JEB upstream request budget also contributes to that allowance.
For an already connected client using the pinned SDK, request options are the
**second** argument of `callTool`:
@@ -549,10 +554,20 @@ Waiting notifications stop when startup settles or the caller cancels. They do
not measure engine work completed.
The pinned SDK can reset the request's inactivity timeout on progress with
`resetTimeoutOnProgress: true`. Also set `maxTotalTimeout` to bound the complete
request; the provider's startup deadline still applies. These options belong in
the same second argument of `callTool`. Without that explicit client policy, the
default 60-second request deadline still expires despite waiting notifications.
`resetTimeoutOnProgress: true`. These options belong in the same second
argument of `callTool`. Without that explicit client policy, the default
60-second request deadline still expires despite waiting notifications.
SDK 2.3.1 checks `maxTotalTimeout` when progress resets the timer; it does not
schedule a separate absolute timer for that setting. A silent interval can
therefore run beyond the declared total. For an absolute caller deadline,
also pass `signal: AbortSignal.timeout(totalBudgetMs)`. If the caller already
has a cancellation signal, preserve both with
`AbortSignal.any([callerSignal, AbortSignal.timeout(totalBudgetMs)])`.
`maxTotalTimeout` can still bound progress resets, and REA's provider startup
deadline still applies. Choose the total budget for the expected workload;
neither server configuration nor progress can override a remote caller's
deadline.
The 240-second setting is a measured example, not a universal timeout: a
controlled Linux x64/WSL2 fixture took about 64 seconds for its first overview
@@ -664,10 +679,14 @@ advertised. Every advertised example is a distinct valid canonical input.
Root object unions are presented as
one object without root `anyOf`, `oneOf`, or `allOf` for model API compatibility.
The projection merges properties, retains shared required fields and
group-specific field dependencies, and describes the accepted input groups.
Canonical runtime validation enforces the exact union, including exclusions
that the advertised projection does not express. Tests validate the schemas
The projection merges properties, retains shared required fields, and
describes the accepted input groups. Which fields belong together is guidance
in that description rather than a `dependentRequired` or `dependencies`
keyword, because Gemini function declarations reject both and one unknown
keyword fails the client's whole tool catalog. Canonical runtime validation
enforces the exact union, including partner fields and exclusions that the
advertised projection does not express, so a client must not rely on the
advertised schema to reject an incomplete group. Tests validate the schemas
after SDK conversion and check advertised validation and actual calls.
Individual model APIs can impose additional nesting limits; complete producer
captures can exceed ten structural levels.
@@ -689,7 +708,10 @@ reported by strict-depth MCP clients in [#2813](https://github.com/morluto/rea/i
WorkBuddy/CodeBuddy gateways have also rejected full REA catalogs with an
opaque `11133` error while accepting the compact profile
([#2999](https://github.com/morluto/rea/issues/2999)); compatibility depends on
the selected gateway and model.
the selected gateway and model. That report used ZCode through a gateway to a
Kimi-K3 backend, not the WorkBuddy MCP client. Set the profile on REA's
registration in the actual MCP host; the host's name alone does not identify
the downstream model or its schema constraints.
The compact profile renders the same tool set, output schemas, annotations,
and canonical server-side validation. It changes only the advertised input
@@ -711,9 +733,9 @@ JSON Schema:
in a reduced form: property names, reference-resolved types (including union
alternatives), first-level guidance, and the root's required-field constraints,
with nested validation detail elided. The
canonical schema still rejects malformed calls server-side, so callers
following the reduced advertisement receive the canonical typed error
instead of silent acceptance.
registered canonical schema still rejects malformed calls before invoking a
handler. That rejection can use the MCP SDK's input-validation diagnostic;
it does not guarantee the application's typed input error.
- Schemas deeper than ten nodes use the same reduced projection, with
root-property names, types, guidance, and required fields retained. The
server continues to enforce the full canonical input contract.
@@ -732,6 +754,11 @@ identity. Explicit schema IDs and relative external reference bases are
preserved. This keeps every tool and validation rule in discovery and does not
change the SDK's catalog invalidation or availability checks.
The server identity's tool-schema digest includes both the canonical output
contracts and the selected output-schema profile. `full` and `off` therefore
have distinct identities even though `off` keeps the same canonical output
validation on the server.
Some stdio hosts reject a complete `tools/list` frame before they load any
tools. The opt-in `REA_MCP_OUTPUT_SCHEMA_PROFILE=off` setting omits `outputSchema`
from the advertised catalog for hosts with a small frame limit (the measured
@@ -768,9 +795,10 @@ identities remains unknown.
`normalization` defaults to `{ "rules": [] }`.
The advertised schema includes complete nested capture fields and rejects
incomplete pairs and structurally malformed captures. Mixed comparison families
can pass advertised validation; the SDK rejects them against the canonical
input schema before invoking the handler. Domain validation additionally checks
incomplete pairs and structurally malformed captures. Mixed comparison families,
and `normalization` without both scenario captures, can pass advertised
validation; the SDK rejects them against the canonical input schema before
invoking the handler. Domain validation additionally checks
relationships such as event sequence references and retained counts; JSON
Schema does not express those cross-field invariants.
+15 -3
View File
@@ -378,7 +378,12 @@ complete observation.
property: `N` means `nonatomic`; a complete typed attribute string without
`N` means the Objective-C default `atomic`;
missing or incomplete attribute metadata leaves `atomicity` and any
unestablished read-only value null. `is_meta_class`, `is_root_class`, and
unestablished read-only value null. A type attribute whose quoted class name
never closes is incomplete and marks `objc_properties_categories` partial
with `property_attributes_incomplete`. A property record that cannot be
decoded, such as one with an empty or unmapped name, is reported as
`property_decode_failed` at its entry address while sibling properties are
retained. `is_meta_class`, `is_root_class`, and
`ivar_count` are also nullable when the selected provider exposes only symbol
names. Class implementation methods have null `is_required` and `is_optional`
fields because those facts apply to protocol declarations; decoded protocol
@@ -481,8 +486,9 @@ user's permissions and may change files, show UI or use the network.
Debugging must be allowed for the user (Developer Tools access). A
hardened-runtime target without `com.apple.security.get-task-allow` cannot be
debugged; `inspect_signature` reports this as the debugger-attach facet, and
the tool fails with a `debugger-attach-denied` reason.
debugged; `inspect_signature` reports the signature's `hardened_runtime` value
and its `entitlements`, including `com.apple.security.get-task-allow` when it
is present. A denied trace reports the `debugger-attach-denied` reason.
## Provider and verification boundaries
@@ -569,6 +575,12 @@ Exact and ambiguous value counts describe emitted root/object value instances;
a root and an object may contain the same value. Archive digests identify the
original bytes.
Dates are reported as `{ "$plist_type": "date", "iso8601": "<timestamp>" }`. A
date the decoder cannot represent, such as an XML date with a year beyond 9999
or a negative year, is reported as `{ "$plist_type": "date", "iso8601": null }`
with a counted limitation; the rest of the plist or archive is still decoded.
`inspect_plist` and Interface Builder decoding use the same projection.
## Locate a byte signature
Use `search_bytes` after opening a target with Ghidra to locate a known constant
+1 -1
View File
@@ -274,7 +274,7 @@ npx rea-agents@latest setup
## سجل النجوم
🎉 **200,000 نجمة على GitHub — شكرًا لكم!**
🎉 **250,000 نجمة على GitHub — شكرًا لكم!**
شكرًا لكل من يستخدم REA، ويبلّغ عن الأخطاء، ويقترح ميزات، ويختبر إصدارات البناء، ويساهم بالإصلاحات.
+1 -1
View File
@@ -272,7 +272,7 @@ Melde Sicherheitslücken gemäß [SECURITY.md](../../SECURITY.md).
## Sternverlauf
🎉 **200.000 GitHub-Sterne – vielen Dank!**
🎉 **250.000 GitHub-Sterne – vielen Dank!**
Danke an alle, die REA nutzen, Fehler melden, Funktionswünsche äußern, Builds testen und Fehlerbehebungen beitragen.
+1 -1
View File
@@ -285,7 +285,7 @@ npx rea-agents@latest setup
## Ιστορικό αστεριών
🎉 **200.000 αστέρια στο GitHub — σας ευχαριστούμε!**
🎉 **250.000 αστέρια στο GitHub — σας ευχαριστούμε!**
Ευχαριστούμε όλους όσοι χρησιμοποιούν το REA, αναφέρουν σφάλματα, ζητούν νέες λειτουργίες, δοκιμάζουν builds και συνεισφέρουν διορθώσεις.
+1 -1
View File
@@ -272,7 +272,7 @@ Informa de vulnerabilidades siguiendo [SECURITY.md](../../SECURITY.md).
## Historial de estrellas
🎉 **200.000 estrellas en GitHub: ¡gracias!**
🎉 **250.000 estrellas en GitHub: ¡gracias!**
Gracias a quienes usan REA, informan de errores, solicitan funciones, prueban compilaciones y contribuyen con correcciones.
+1 -1
View File
@@ -257,7 +257,7 @@ npx rea-agents@latest setup
## تاریخچهٔ ستاره‌ها
🎉 **۲۰۰٬۰۰۰ ستارهٔ GitHub — سپاسگزاریم!**
🎉 **۲۵۰٬۰۰۰ ستارهٔ GitHub — سپاسگزاریم!**
از همهٔ کسانی که از REA استفاده می‌کنند، خطاها را گزارش می‌دهند، قابلیت‌های جدید پیشنهاد می‌کنند، buildها را آزمایش می‌کنند و در بهبود پروژه مشارکت دارند سپاسگزاریم.
+1 -1
View File
@@ -276,7 +276,7 @@ Signalez les vulnérabilités via [SECURITY.md](../../SECURITY.md).
## Historique des étoiles
🎉 **200 000 étoiles GitHub — merci !**
🎉 **250 000 étoiles GitHub — merci !**
Merci à toutes les personnes qui utilisent REA, signalent des bugs, proposent des fonctionnalités, testent les builds et contribuent des correctifs.
+1 -1
View File
@@ -297,7 +297,7 @@ Laporkan kerentanan melalui [SECURITY.md](../../SECURITY.md).
## Riwayat Bintang
🎉 **200.000 bintang GitHub, terima kasih!**
🎉 **250.000 bintang GitHub, terima kasih!**
Terima kasih kepada semua orang yang menggunakan REA, melaporkan bug, meminta fitur, menguji build, dan berkontribusi dalam perbaikan.
+1 -1
View File
@@ -276,7 +276,7 @@ Segnala vulnerabilità tramite [SECURITY.md](../../SECURITY.md).
## Cronologia delle stelle
🎉 **200.000 stelle su GitHub — grazie!**
🎉 **250.000 stelle su GitHub — grazie!**
Grazie a tutti coloro che usano REA, segnalano bug, propongono funzionalità, testano le build e contribuiscono con correzioni.
+1 -1
View File
@@ -274,7 +274,7 @@ npx rea-agents@latest setup
## スター履歴
🎉 **GitHub スター 200,000 件、ありがとうございます!**
🎉 **GitHub スター 250,000 件、ありがとうございます!**
REA の利用、バグ報告、機能の要望、ビルドのテスト、修正への貢献に感謝します。
+1 -1
View File
@@ -283,7 +283,7 @@ npx rea-agents@latest setup
## 스타 기록
🎉 **GitHub 스타 200,000개, 감사합니다!**
🎉 **GitHub 스타 250,000개, 감사합니다!**
REA를 사용하고, 버그를 보고하고, 기능을 요청하고, 빌드를 테스트하고, 수정에 기여해 주신 모든 분께 감사드립니다.
+1 -1
View File
@@ -272,7 +272,7 @@ Zgłaszaj podatności zgodnie z [SECURITY.md](../../SECURITY.md).
## Historia gwiazdek
🎉 **200 000 gwiazdek na GitHubie — dziękujemy!**
🎉 **250 000 gwiazdek na GitHubie — dziękujemy!**
Dziękujemy wszystkim, którzy używają REA, zgłaszają błędy, proponują nowe funkcje, testują kompilacje i przesyłają poprawki.
+1 -1
View File
@@ -272,7 +272,7 @@ Relate vulnerabilidades conforme [SECURITY.md](../../SECURITY.md).
## Histórico de estrelas
🎉 **200.000 estrelas no GitHub — muito obrigado!**
🎉 **250.000 estrelas no GitHub — muito obrigado!**
Obrigado a todos que usam o REA, relatam bugs, sugerem funcionalidades, testam builds e contribuem com correções.
+1 -1
View File
@@ -272,7 +272,7 @@ npx rea-agents@latest setup
## История звёзд
🎉 **200 000 звёзд на GitHub — спасибо!**
🎉 **250 000 звёзд на GitHub — спасибо!**
Спасибо всем, кто использует REA, сообщает об ошибках, предлагает новые функции, тестирует сборки и помогает с исправлениями.
+1 -1
View File
@@ -272,7 +272,7 @@ npx rea-agents@latest setup
## ประวัติดาว
🎉 **200,000 ดาวบน GitHub — ขอบคุณทุกคน!**
🎉 **250,000 ดาวบน GitHub — ขอบคุณทุกคน!**
ขอบคุณทุกคนที่ใช้ REA รายงานบั๊ก เสนอฟีเจอร์ ทดสอบบิลด์ และช่วยแก้ไข
+1 -1
View File
@@ -277,7 +277,7 @@ Güvenlik açıklarını [SECURITY.md](../../SECURITY.md) üzerinden bildirin.
## Yıldız geçmişi
🎉 **GitHub'da 200.000 yıldız — teşekkürler!**
🎉 **GitHub'da 250.000 yıldız — teşekkürler!**
REA'yı kullanan, hata bildiren, özellik talep eden, derlemeleri test eden ve düzeltmelere katkıda bulunan herkese teşekkürler.
+1 -1
View File
@@ -272,7 +272,7 @@ npx rea-agents@latest setup
## Історія зірок
🎉 **200 000 зірок на GitHub — дякуємо!**
🎉 **250 000 зірок на GitHub — дякуємо!**
Дякуємо всім, хто використовує REA, повідомляє про помилки, пропонує нові функції, тестує збірки й допомагає з виправленнями.
+1 -1
View File
@@ -272,7 +272,7 @@ Báo cáo lỗ hổng theo [SECURITY.md](../../SECURITY.md).
## Lịch sử sao
🎉 **200.000 sao trên GitHub — xin cảm ơn!**
🎉 **250.000 sao trên GitHub — xin cảm ơn!**
Cảm ơn mọi người đã sử dụng REA, báo lỗi, đề xuất tính năng, kiểm thử bản dựng và đóng góp bản sửa lỗi.
+1 -1
View File
@@ -278,7 +278,7 @@ npx rea-agents@latest setup
## Star 歷史
🎉 **GitHub Star 達到 200,000 個,感謝大家!**
🎉 **GitHub Star 達到 250,000 個,感謝大家!**
感謝每一位使用 REA、報告錯誤、提出功能需求、測試建置和貢獻修復的朋友。
+1 -1
View File
@@ -278,7 +278,7 @@ npx rea-agents@latest setup
## Star 历史
🎉 **GitHub Star 达到 200,000 个,感谢大家!**
🎉 **GitHub Star 达到 250,000 个,感谢大家!**
感谢每一位使用 REA、报告错误、提出功能需求、测试构建和贡献修复的朋友。
File diff suppressed because it is too large. Load diff
+53
View File
@@ -10,11 +10,64 @@ SHA returned by Release Please. Before either registry is published, the release
run calls full CI qualification at that exact revision, including coverage,
portable providers, and every native package host. Later main commits cannot
change or cancel that proof.
After qualification, a separate runner with read-only repository/actions
permissions restores the retained tarball and verifier runtime. It installs
that exact archive into an empty prefix, then exercises CLI help/discovery and
the real stdio MCP catalog/session contract. Installation finishes before the
protocol deadline begins, with dependency lifecycle scripts disabled. Only a
successful rehearsal enables the job with npm publishing authority. Both jobs
use the same release-input action; neither rebuilds or repacks the archive.
This rehearsal checks package consumption on the Linux release runner;
qualification retains its broader native-host and real-provider checks.
Before publishing, npm lookup failures and malformed metadata stop the job.
An existing version must match the qualified tarball's SHA-512 and intended
`latest`/`next` dist-tag before it can be reused. Publication never overwrites
an existing version or silently changes a dist-tag. After publication, only
confirmed registry absence is retried within the propagation window. Content
or tag mismatches fail immediately. The post-publication verifier installs
from npm and repeats the same CLI/MCP checks; it also exercises a real update
from an older stable release. For a prerelease on `next`, that updater still
targets stable `latest`, as the public update command does.
The required reverse-tools lane runs fresh coverage and both mutation
preflights. Complete mutation sweeps run separately on a schedule or manual
dispatch and do not block publication; see [the testing guide](testing.md).
Ordinary main pushes and closed, unmerged PRs cannot publish packages. Check
both publication jobs and the published-package canary; a merged PR or GitHub
tag alone does not establish that publication finished. Retry failed jobs in
the original run after a partial publication.
### Recover an already published npm release
Rerunning a job uses its original workflow and source revision. When a verifier
or publishing workflow needs a code fix, land that fix on main first, then use
the separate recovery workflow instead of repeating release creation:
```bash
gh workflow run release-recovery.yml --ref main \
-f version=6.5.0 -f release_run_id=38564502044
```
Select the existing version and its original automatic Release run. Recovery
requires that run's successful exact-source CI gate and npm publish step. It
uses the existing release tag, original qualified tarball and verifier runtime;
expired or missing artifacts stop recovery. The archive's source, version,
original run/attempt and Node version must match, and its SHA-512 must equal
npm's published integrity. The corrected controller runs the public CLI, MCP
catalog/session and previous-version update canary against that released runtime.
The installation completes before MCP's handshake begins; dependency lifecycle
scripts are disabled as in the installed-package verifier.
Only after verification succeeds does recovery publish the released
`server.json` to MCP Registry. It does not create tags or GitHub releases,
publish npm bytes, or change dist-tags. Both publication paths share the same
MCP publisher: a paginated registry lookup preserves an identical active
version, refuses conflicting/inactive metadata, and fails on lookup errors.
The original failed run remains a historical failure; the recovery run records
the new verification and remaining registry publication. Manual frozen-branch
releases are outside this recovery path.
For a release that needs an independently frozen application checkpoint, use
the optional manual path below. It retains explicit prepare and publish phases.
+39
View File
@@ -98,6 +98,18 @@ isolated filesystem boundary tests because it loads both source and compiled
module graphs. Adapter, other boundary, acceptance, and process-global projects
retain per-file isolation. See `vitest.config.ts` for current settings.
Inject producer faults through scoped dependencies in shared workers: a module
mock cannot replace a consumer that was imported earlier. Check these tests
with the consumer preloaded as well as alone. For simulated protocol traces,
use an acknowledged event barrier before asserting complete observations;
a zero-duration capture does not guarantee queued events have arrived.
Check advertised schemas after SDK conversion for every supported schema
profile. Meta-schema validity does not establish client acceptance or useful
rendered declarations. Keep canonical rejection checks separate from the
intentionally reduced compact advertisement, and probe actual client renderers
when changing schema representations.
The reused CLI boundary workers cap V8 old space at 384 MiB, based on their
profiled allocation and cleanup behavior. This encourages collection between
files; spawned REA processes retain their own heap settings.
@@ -280,6 +292,33 @@ focused suite also exercises affected MCP routes and the Python Cutter bridge.
Contract, integration, and real-provider lanes complement these focused tests;
simulated providers do not establish real-provider behavior.
Required CI retains fresh reverse-tools coverage and preflights both canonical
Stryker configurations with `--dryRunOnly`. These preflights resolve the owned
targets, instrument the source, and execute the real initial tests. Invalid
configuration, target resolution, and initial test failures still fail the job.
Preflights execute no mutants and produce no mutation-outcome report. Both fast
feedback and full qualification, including exact-revision release qualification,
require coverage and both preflights. A failed, canceled, skipped or missing
selected quality job still fails the required gate.
The separate **Mutation sweep** workflow runs both complete configurations daily
and on manual dispatch, in two isolated jobs. It is a maintenance check outside
the PR and release publication gates. `ci:full` requests full regression,
coverage and provider qualification; it does not request a complete mutation
sweep. Use the Mutation sweep workflow to request that result. Targets,
checkers, concurrency, deadlines and the existing non-blocking mutation-score
threshold are unchanged. `npm run test:mutation:reverse-tools` also retains both
complete passes for local callers.
The two passes write separate JSON and HTML reports under `reports/mutation/`:
`reverse-tools` and `reverse-tools-semantics`. Required CI retains focused
coverage; the sweep retains each configuration's JSON/HTML reports separately.
Both retain available diagnostics for seven days after failure and skip uploads
on cancellation. Artifact names identify the tier or configuration and run
attempt. A successful sweep requires both jobs and their nonempty reports;
partial diagnostics and preflights do not establish complete mutation outcomes
or qualify the release revision for mutation coverage.
Fast CI starts the source-only projects after classification, independently of
build and static checks, and runs five built-dependent shards after the build.
The six test jobs still select every portable test. Full qualification keeps six
+6
View File
@@ -87,6 +87,12 @@ malformed, unavailable, cancellation, and partial outcomes through affected
consumers. Real-engine claims require the matching provider lane; see
[testing.md](testing.md).
For fixed tuples in public contracts, use `src/domain/fixedTupleSchema.ts`:
Zod's tuple projection omits implicit length bounds and Draft 2020-12 `items`,
which some clients require even alongside `prefixItems`. Tuples with a rest
schema also need explicit minimum lengths. Check parser/schema parity for empty,
short, overlong, and malformed values in both input and output projections.
When discoverability changes, evaluate representative broad, direct, and negative
tasks on the intended host. Record host/model/catalog, selected tools, arguments,
errors, retries, and task outcomes. Schema validity and keyword heuristics do not
+5 -1
View File
@@ -117,7 +117,11 @@ gRPC message bytes. Missing members remain null, distinct from empty bodies.
See Telerik's [SAZ format reference](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/knowledge-base/fiddler-archives).
The existing ZIP reader verifies read members; expanded archive contents are
limited to 32 MiB in addition to the input/output budgets below. Encrypted
limited to 32 MiB in addition to the input/output budgets below. Exceeding this
expanded-byte budget returns `invalid_request` / `invalid_input` through both
CLI and MCP, with an `out_of_range` issue at
`capture_path` and `maximum_expanded_capture_bytes`. Selecting records does not
bypass the complete-archive admission check or return partial Evidence. Encrypted
archives and unrecognized raw session members are unsupported. SAZ requires an
enforced decoder memory bound: Node's fixed heap, or the Windows Job Object
commit limit. Bun on hosts without that Job Object limit returns capability
+12
View File
@@ -1,5 +1,11 @@
# Analysis efficiency measurements
For genuine Fiddler captures, see the [SAZ selection checkpoint](saz-selection-workflows.md).
`measure.mjs --saz-selection baseline|focused|retained` compares default complete
delivery (including retained-reference recovery), caller-selected ordinals, and
summary/preview/complete/repeated pages. Each failed RPC remains in task costs.
The body question uses stored bytes, not decoded HTTP application payloads.
Tracks the experiments for [#2016](https://github.com/morluto/rea/issues/2016).
The production CLI/MCP contracts and defaults remain the compatibility baseline.
Downloaded artifacts, runtime copies, exported Evidence, transcripts and detailed
@@ -78,6 +84,12 @@ field/filter selection, discovery and output windows. Lower delivered JSON did
not establish stable total-token or speed gains; failed plans and negative
controls remain visible.
The [sigrok selection checkpoint](signal-selection-workflows.md) records two
real hardware recordings, independently verified bytes, repeated decoder/pages,
and an eight-task Codex cohort with mixed token/time results. Existing annotation
controls reduce replies; these measurements introduce no production cache,
default or API changes.
Agent token consumption and end-to-end task time are the primary objectives.
Memory and CPU consumption are also measured and controlled. Correctness,
Evidence provenance, caller choices and existing-user compatibility are
@@ -181,7 +181,9 @@ def main():
'inspect_android_class', 'inspect_android_method',
'inspect_firmware_regions', 'inspect_managed_artifact',
'inspect_sqlite_database', 'inspect_pcap_capture',
'inspect_web_network_capture',
'inspect_packet_capture', 'inspect_packet_fields',
'decode_signal_recording', 'inspect_signal_decoders',
'inspect_managed_members', 'inspect_managed_native_boundaries',
'inspect_artifact', 'inspect_wasm_artifact',
'inspect_evm_interface', 'get_evidence_bundle', 'export_evidence_bundle',
+9 -3
View File
@@ -3,6 +3,7 @@ import { readFile, writeFile } from "node:fs/promises";
import { resolve } from "node:path";
import { parseArgs } from "node:util";
import { PACKET_ARTIFACTS } from "./packet-entry.mjs";
import { SIGNAL_ARTIFACTS } from "./signal-entry.mjs";
const { values } = parseArgs({
options: {
@@ -36,6 +37,8 @@ const sameSettings = [
"native_workflow_source_sha256",
"packet_workflow_source_sha256",
"packet_oracle_source_sha256",
"signal_workflow_source_sha256",
"signal_oracle_source_sha256",
"package_lock_sha256",
"node_version",
"sdk_client_version",
@@ -73,13 +76,14 @@ for (const [side, answer] of [
value: answer.evidence_ids,
});
}
// PCAP delivery observations preserve each actual receipt's identity, limitations
// Recording delivery observations preserve each actual receipt's identity, limitations
// and view coverage. Summary/page scopes differ from complete source scope;
// retain them separately rather than equating page exhaustion with capture
// coverage. Repeated equivalent deliveries must also match every observation
// field except the receipt and parent IDs, which identify their own invocations.
if (
Object.hasOwn(PACKET_ARTIFACTS, left.artifact) ||
Object.hasOwn(SIGNAL_ARTIFACTS, left.artifact) ||
["wireshark-http.cap", "wireshark-http_redirects.pcapng"].includes(
left.artifact,
)
@@ -92,7 +96,7 @@ if (
!Array.isArray(answer.delivery_observations) ||
!answer.delivery_observations.length
)
throw new Error("Missing original PCAP delivery observations");
throw new Error("Missing original recording delivery observations");
runSpecific.push({
side,
path: ["delivery_observations"],
@@ -101,7 +105,9 @@ if (
if (
left.delivery === right.delivery &&
(!Object.hasOwn(PACKET_ARTIFACTS, left.artifact) ||
left.packet_selection === right.packet_selection)
left.packet_selection === right.packet_selection) &&
(!Object.hasOwn(SIGNAL_ARTIFACTS, left.artifact) ||
left.signal_selection === right.signal_selection)
) {
answer.delivery_observations = answer.delivery_observations.map(
(observation) =>
@@ -343,6 +343,96 @@
"derivation": "Unmodified official saved sample; decompressed gzip where indicated. Local digest pins acquired bytes, not an upstream-published digest.",
"compressed_source": null
}
},
{
"id": "sigrok-uart-max3232e.sr",
"file": "uart-max3232e.sr",
"bytes": 12742,
"sha256": "f797d60d6b8e12d2a1549b9a5a499ef389f44cb9e870e8610af26b57c3b2be76",
"provenance": {
"project": "sigrok-dumps",
"version": "0ad13477abc959d37fc9a5acbd23901c371c9c76",
"upstreamFile": "uart/maxim_max3232e/max3232e_hello_world_57600_8n1.sr",
"url": "https://raw.githubusercontent.com/sigrokproject/sigrok-dumps/0ad13477abc959d37fc9a5acbd23901c371c9c76/uart/maxim_max3232e/max3232e_hello_world_57600_8n1.sr",
"git_blob_sha1": "52e47b3014819471a2f348a0d8c7694fe304e052",
"reference": "https://raw.githubusercontent.com/sigrokproject/sigrok-dumps/0ad13477abc959d37fc9a5acbd23901c371c9c76/uart/maxim_max3232e/README",
"license_scope": "Repository README declares dumps public domain unless otherwise noted; selected READMEs state no exception; decoder software licensing is separate."
}
},
{
"id": "sigrok-i2c-nunchuk.sr",
"file": "i2c-nunchuk.sr",
"bytes": 20373,
"sha256": "0fa6adb8297d7f3fe5ba19c94ee655c9b0f952a8b5e48a17aaa499a2f6d10d70",
"provenance": {
"project": "sigrok-dumps",
"version": "0ad13477abc959d37fc9a5acbd23901c371c9c76",
"upstreamFile": "i2c/wii_nunchuk/wii_nunchuk_init_reg_3xdata.sr",
"url": "https://raw.githubusercontent.com/sigrokproject/sigrok-dumps/0ad13477abc959d37fc9a5acbd23901c371c9c76/i2c/wii_nunchuk/wii_nunchuk_init_reg_3xdata.sr",
"git_blob_sha1": "a7232fce7b54e68e2be44e15946c90a3c756e8e9",
"reference": "https://raw.githubusercontent.com/sigrokproject/sigrok-dumps/0ad13477abc959d37fc9a5acbd23901c371c9c76/i2c/wii_nunchuk/README",
"license_scope": "Repository README declares dumps public domain unless otherwise noted; selected READMEs state no exception; decoder software licensing is separate."
}
},
{
"id": "xbox-clear_nomp.saz",
"file": "clear_nomp.saz",
"bytes": 43515,
"sha256": "3e808663a99cbb9160186f7419633248200fbc6863d2c897f5d4d9972dde0375",
"provenance": {
"project": "Microsoft Xbox Live Trace Analyzer",
"version": "ad880ff00b26c4cae5e3c8864d3df438a03890ba",
"url": "https://raw.githubusercontent.com/microsoft/xbox-live-trace-analyzer/ad880ff00b26c4cae5e3c8864d3df438a03890ba/Source/TestData/CertWarnings/clear_nomp.saz",
"git_blob": "2f1ba66dacb8f8bac290cab59dff8fe750a46ce7",
"license": "MIT; upstream LICENSE.md",
"producer_archive_comment": "Fiddler (v4.5.1.2) Session Archive. See http://fiddler2.com"
},
"saz_question": {
"record_ordinals": [12, 0, 6],
"total_records": 13,
"members": 42,
"expanded_bytes": 62609
}
},
{
"id": "xbox-clear_mp_cs10.saz",
"file": "clear_mp_cs10.saz",
"bytes": 5223519,
"sha256": "4021b201848e4feea3402c380fda5d2df43fd0bf1c72ea550e60f2da3b3d5b44",
"provenance": {
"project": "Microsoft Xbox Live Trace Analyzer",
"version": "ad880ff00b26c4cae5e3c8864d3df438a03890ba",
"url": "https://raw.githubusercontent.com/microsoft/xbox-live-trace-analyzer/ad880ff00b26c4cae5e3c8864d3df438a03890ba/Source/TestData/CertWarnings/clear_mp_cs10.saz",
"git_blob": "dac534d625594c7a1d57b0b12ed12ea9c6cb6a5b",
"license": "MIT; upstream LICENSE.md",
"producer_archive_comment": "Fiddler (v4.6.2.0) Session Archive. See https://fiddler2.com"
},
"saz_question": {
"record_ordinals": [1310, 0, 655],
"total_records": 1311,
"members": 3939,
"expanded_bytes": 9223820
}
},
{
"id": "xbox-x49_mp_cs21.saz",
"file": "x49_mp_cs21.saz",
"bytes": 572224,
"sha256": "97cdca8b0608e3f11995fd64b64390b9fd8d8e3efcac89f517f24b44968047f6",
"provenance": {
"project": "Microsoft Xbox Live Trace Analyzer",
"version": "ad880ff00b26c4cae5e3c8864d3df438a03890ba",
"url": "https://raw.githubusercontent.com/microsoft/xbox-live-trace-analyzer/ad880ff00b26c4cae5e3c8864d3df438a03890ba/Source/TestData/CertWarnings/x49_mp_cs21.saz",
"git_blob": "e7794c44892ca4fa1729fa012e698e8284337f15",
"license": "MIT; upstream LICENSE.md",
"producer_archive_comment": "Fiddler (v4.6.2.26757) Session Archive. See https://fiddler2.com"
},
"saz_question": {
"record_ordinals": [102, 0, 51],
"total_records": 103,
"members": 315,
"expanded_bytes": 1301927
}
}
]
}
@@ -13,6 +13,8 @@ import { Client } from "@modelcontextprotocol/client";
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
import { Ajv2020 } from "ajv/dist/2020.js";
import { PACKET_ARTIFACTS, measurePacketEntry } from "./packet-entry.mjs";
import { SIGNAL_ARTIFACTS, measureSignalEntry } from "./signal-entry.mjs";
import { SAZ_ARTIFACTS, measureSazEntry } from "./saz-entry.mjs";
const root = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
const { values } = parseArgs({
@@ -31,6 +33,8 @@ const { values } = parseArgs({
schemas: { type: "string", default: "default" },
"sqlite-selection": { type: "string", default: "all" },
"packet-selection": { type: "string", default: "baseline" },
"signal-selection": { type: "string", default: "baseline" },
"saz-selection": { type: "string", default: "baseline" },
},
});
if (
@@ -41,6 +45,18 @@ if (
!isAbsolute(values.path) ||
!isAbsolute(values.output) ||
!["complete", "summary"].includes(values.delivery) ||
!["baseline", "focused", "retained"].includes(values["saz-selection"]) ||
(!Object.hasOwn(SAZ_ARTIFACTS, values.artifact) &&
values["saz-selection"] !== "baseline") ||
(Object.hasOwn(SAZ_ARTIFACTS, values.artifact) &&
values.delivery !== "complete") ||
!["baseline", "focused", "discovery", "pages"].includes(
values["signal-selection"],
) ||
(!Object.hasOwn(SIGNAL_ARTIFACTS, values.artifact) &&
values["signal-selection"] !== "baseline") ||
(Object.hasOwn(SIGNAL_ARTIFACTS, values.artifact) &&
values.delivery !== "complete") ||
!["entry", "entry-and-main", "entry-views"].includes(
values["native-question"],
) ||
@@ -159,6 +175,18 @@ const fingerprints = {
packet_oracle_source_sha256: await fileSha(
fileURLToPath(new URL("./packet-oracle.py", import.meta.url)),
),
signal_workflow_source_sha256: await fileSha(
fileURLToPath(new URL("./signal-entry.mjs", import.meta.url)),
),
signal_oracle_source_sha256: await fileSha(
fileURLToPath(new URL("./signal-oracle.py", import.meta.url)),
),
saz_workflow_source_sha256: await fileSha(
fileURLToPath(new URL("./saz-entry.mjs", import.meta.url)),
),
saz_oracle_source_sha256: await fileSha(
fileURLToPath(new URL("./saz-oracle.py", import.meta.url)),
),
runtime_files_sha256: sha(JSON.stringify(runtimeFiles)),
runtime_dispatcher_sha256: await fileSha(
resolve(values["runtime-root"], "scripts/rea.mjs"),
@@ -739,6 +767,18 @@ const inspectPcapTarget = async () => {
};
const workflows = {
...Object.fromEntries(
Object.keys(SAZ_ARTIFACTS).map((artifact) => [
artifact,
() => measureSazEntry({ values, call, inputSha }),
]),
),
...Object.fromEntries(
Object.keys(SIGNAL_ARTIFACTS).map((artifact) => [
artifact,
() => measureSignalEntry({ values, call, inputSha, catalogDefinitions }),
]),
),
...Object.fromEntries(
Object.keys(PACKET_ARTIFACTS).map((artifact) => [
artifact,
@@ -1167,6 +1207,9 @@ const report = {
artifact_sha256: inputSha,
artifact_sha256_after: finalInputSha,
delivery: values.delivery,
saz_selection: Object.hasOwn(SAZ_ARTIFACTS, values.artifact)
? values["saz-selection"]
: null,
sdk_schema_mode: values.schemas,
retained_verification: values["verify-retained"],
native_question: NATIVE_ARTIFACTS.includes(values.artifact)
@@ -1186,6 +1229,9 @@ const report = {
packet_selection: Object.hasOwn(PACKET_ARTIFACTS, values.artifact)
? values["packet-selection"]
: null,
signal_selection: Object.hasOwn(SIGNAL_ARTIFACTS, values.artifact)
? values["signal-selection"]
: null,
provider_settings_sha256: sha(JSON.stringify(selectedProviders)),
provider_search_path_sha256: sha(
selectedProviders.PATH ?? process.env.PATH ?? "",
@@ -0,0 +1,266 @@
import assert from "node:assert/strict";
import { readFile, writeFile } from "node:fs/promises";
import { resolve } from "node:path";
import { pathToFileURL } from "node:url";
import { isDeepStrictEqual, parseArgs } from "node:util";
import {
sazRequest,
verifySazRecords,
verifySazOracleIdentity,
sazEvidenceParameters,
} from "./saz-entry.mjs";
const { values } = parseArgs({
options: {
trial: { type: "string" },
oracle: { type: "string" },
"runtime-root": { type: "string" },
artifact: { type: "string" },
selection: { type: "string" },
},
});
if (
!values.trial ||
!values.oracle ||
!values["runtime-root"] ||
!["baseline", "focused"].includes(values.selection)
)
throw new Error(
"Use --trial DIR --oracle JSON --runtime-root DIR --artifact ID --selection baseline|focused",
);
const load = async (file) =>
JSON.parse(await readFile(resolve(values.trial, file), "utf8"));
const settings = await load("trial-settings.json"),
summary = await load("summary.json");
const oracle = JSON.parse(await readFile(values.oracle, "utf8"));
verifySazOracleIdentity(values.artifact, oracle);
const runtime = (file) =>
pathToFileURL(resolve(values["runtime-root"], file)).href;
const { parseEvidence } = await import(runtime("dist/domain/evidence.js"));
const { inspectWebNetworkCaptureInputSchema, webNetworkCaptureSchema } =
await import(runtime("dist/domain/webNetworkCapture.js"));
const { inspectAnalysisViewInputSchema, analysisViewResultSchema } =
await import(runtime("dist/domain/analysisView/analysisView.js"));
const calls = (await readFile(resolve(values.trial, "events.jsonl"), "utf8"))
.split("\n")
.filter(Boolean)
.map(JSON.parse)
.filter(
(event) =>
event.type === "item.completed" && event.item?.type === "mcp_tool_call",
)
.map((event) => event.item);
const planned = inspectWebNetworkCaptureInputSchema.parse(
sazRequest(
values.artifact,
settings.selected_artifact_path,
values.selection,
),
);
const reasons = [],
workflowReasons = [],
authenticated = new Map(),
parents = new Set(),
conflicts = new Set();
let transportRecovery = false;
for (const call of calls) {
try {
assert.equal(call.server, "rea");
assert.equal(call.status, "completed");
assert.ok(!call.error, "RPC did not provide observations");
const text = call.result.content.filter((item) => item.type === "text");
assert.equal(text.length, 1, "Ambiguous Evidence text carrier");
let evidence = JSON.parse(text[0].text);
if (call.result.isError) {
const limits = evidence.error?.details?.reported_limits;
assert.equal(call.tool, "inspect_web_network_capture");
assert.equal(evidence.error?.code, "resource_constraint");
assert.equal(
evidence.error.details.operation,
"inspect_web_network_capture",
);
assert.equal(limits?.boundary, "mcp-response");
const input = inspectWebNetworkCaptureInputSchema.parse(call.arguments);
assert.deepEqual(input, planned);
const source = inspectAnalysisViewInputSchema.parse({
source: limits.evidence_reference,
view: { kind: "summary" },
}).source;
assert.equal(source.kind, "retained-evidence");
parents.add(source.evidence_id);
transportRecovery = true;
continue;
}
if (call.result.structuredContent !== undefined)
assert.deepEqual(evidence, call.result.structuredContent);
evidence = parseEvidence(evidence);
assert.equal(evidence.subject.local_path, settings.selected_artifact_path);
assert.equal(evidence.subject.digest.sha256, oracle.sha256);
let records;
if (call.tool === "inspect_web_network_capture") {
const { detail, ...arguments_ } = call.arguments;
const input = inspectWebNetworkCaptureInputSchema.parse(arguments_);
assert.equal(input.capture_path, settings.selected_artifact_path);
assert.equal(input.format, "saz");
if (!isDeepStrictEqual(input, planned))
workflowReasons.push(
"Inspection selection differs from planned arguments",
);
if (detail === "summary") {
workflowReasons.push(
"Summary delivery differs from the fixed complete-delivery plan",
);
assert.equal(evidence.operation, "inspect_analysis_view");
const report = analysisViewResultSchema.parse(
evidence.normalized_result,
);
assert.equal(report.kind, "summary");
assert.equal(report.parent_operation, "inspect_web_network_capture");
assert.equal(report.summary.format, "saz");
assert.equal(report.summary.total_records, oracle.total_records);
assert.deepEqual(evidence.parameters, {
parent_evidence_id: report.parent_evidence_id,
view: { kind: "summary" },
});
parents.add(report.parent_evidence_id);
authenticated.set(evidence.evidence_id, []);
continue;
}
assert.ok(detail === undefined || detail === "complete");
assert.equal(evidence.operation, "inspect_web_network_capture");
assert.deepEqual(
evidence.parameters,
sazEvidenceParameters(input, oracle.total_records),
);
const report = webNetworkCaptureSchema.parse(evidence.normalized_result);
assert.equal(report.total_records, oracle.total_records);
assert.equal(report.format, "saz");
records = report.records;
parents.add(evidence.evidence_id);
} else {
assert.equal(call.tool, "inspect_analysis_view");
const input = inspectAnalysisViewInputSchema.parse(call.arguments);
assert.equal(input.source.kind, "retained-evidence");
assert.ok(
parents.has(input.source.evidence_id),
"Unknown retained parent",
);
assert.equal(evidence.operation, "inspect_analysis_view");
assert.deepEqual(evidence.parameters, {
parent_evidence_id: input.source.evidence_id,
view: input.view,
});
const page = analysisViewResultSchema.parse(evidence.normalized_result);
assert.deepEqual(page.view, input.view);
assert.equal(page.parent_evidence_id, input.source.evidence_id);
assert.equal(page.parent_operation, "inspect_web_network_capture");
if (page.kind === "summary") {
assert.equal(page.summary.total_records, oracle.total_records);
assert.equal(page.summary.format, "saz");
records = [];
} else {
assert.equal(page.kind, "capture");
records = page.view.detail === "complete" ? page.items : [];
}
}
const prior = authenticated.get(evidence.evidence_id);
if (prior && !isDeepStrictEqual(prior, records)) {
conflicts.add(evidence.evidence_id);
authenticated.delete(evidence.evidence_id);
parents.delete(evidence.evidence_id);
throw new Error("Conflicting observations share an Evidence ID");
}
if (!conflicts.has(evidence.evidence_id))
authenticated.set(evidence.evidence_id, records);
} catch (cause) {
workflowReasons.push(String(cause));
}
}
if (
calls[0]?.tool !== "inspect_web_network_capture" ||
calls.filter((call) => call.tool === "inspect_web_network_capture").length !==
1 ||
(!transportRecovery && calls.length !== 1)
)
workflowReasons.push(
"Completed call sequence differs from the fixed initial call/recovery plan",
);
try {
const raw = (await readFile(resolve(values.trial, "answer.txt"), "utf8"))
.trim()
.replace(/^```(?:json)?\s*|\s*```$/g, "");
const answer = JSON.parse(raw);
assert.ok(
Array.isArray(answer.evidence_ids) && answer.evidence_ids.length > 0,
"Missing Evidence citations",
);
const observed = new Map();
for (const id of answer.evidence_ids) {
assert.ok(authenticated.has(id), "Unknown/failed cited Evidence");
for (const row of authenticated.get(id)) {
const prior = observed.get(row.ordinal);
assert.ok(
!prior || isDeepStrictEqual(prior, row),
"Conflicting cited record identities",
);
observed.set(row.ordinal, row);
}
}
const facts = verifySazRecords(
oracle.record_ordinals.map((ordinal) => observed.get(ordinal)),
oracle,
);
assert.equal(answer.records.length, facts.length, "Answer coverage differs");
assert.deepEqual(
[...answer.records].sort((a, b) => a.ordinal - b.ordinal),
[...facts].sort((a, b) => a.ordinal - b.ordinal),
"Answer facts differ from cited stored bytes",
);
if (
!isDeepStrictEqual(
answer.records.map((row) => row.ordinal),
oracle.record_ordinals,
)
)
workflowReasons.push("Final answer changes caller-selected order");
if (
!Array.isArray(answer.limitations) ||
answer.limitations.length === 0 ||
answer.limitations.some(
(value) => typeof value !== "string" || !value.trim(),
)
)
workflowReasons.push("Final answer omits limitations");
assert.equal(settings.selected_artifact_sha256_before, oracle.sha256);
assert.equal(summary.selected_artifact_sha256_after, oracle.sha256);
if (
summary.exit_code !== 0 ||
summary.timeout ||
summary.selected_artifact_bytes_unchanged !== true
)
workflowReasons.push(
"Trial did not complete with original bytes unchanged",
);
} catch (cause) {
reasons.push(String(cause));
}
const report = {
factual_correctness: reasons.length ? "failed" : "passed",
workflow_correctness:
reasons.length || workflowReasons.length ? "failed" : "passed",
reasons,
workflow_reasons: workflowReasons,
completed_calls: calls.length,
wall_seconds: summary.wall_seconds,
usage: summary.usage,
selected_artifact_sha256: oracle.sha256,
scope:
"Authenticated cited stored HTTP records and independent raw-byte checks; no live attribution, body decompression or certificate interpretation",
limitation_prose: "Presence checked; wording requires transcript review",
};
await writeFile(
resolve(values.trial, "saz-review.json"),
JSON.stringify(report, null, 2) + "\n",
);
console.log(JSON.stringify(report));
if (report.workflow_correctness !== "passed") process.exitCode = 1;
@@ -0,0 +1,237 @@
import { readFile, writeFile } from "node:fs/promises";
import { resolve } from "node:path";
import { pathToFileURL } from "node:url";
import { isDeepStrictEqual, parseArgs } from "node:util";
import {
SIGNAL_ARTIFACTS,
signalRequest,
signalDataRows,
signalFacts,
verifySignalRows,
verifySignalOracleIdentity,
} from "./signal-entry.mjs";
const { values } = parseArgs({
options: {
trial: { type: "string" },
oracle: { type: "string" },
"runtime-root": { type: "string" },
artifact: { type: "string" },
selection: { type: "string" },
},
});
if (
!values.trial ||
!values.oracle ||
!values["runtime-root"] ||
!Object.hasOwn(SIGNAL_ARTIFACTS, values.artifact ?? "") ||
!["baseline", "focused"].includes(values.selection)
)
throw new Error(
"Use --trial DIR --oracle JSON --runtime-root DIR --artifact ID --selection baseline|focused",
);
const json = async (name) =>
JSON.parse(await readFile(resolve(values.trial, name), "utf8"));
const settings = await json("trial-settings.json"),
summary = await json("summary.json");
const oracle = JSON.parse(await readFile(values.oracle, "utf8"));
const kind = SIGNAL_ARTIFACTS[values.artifact].kind;
const expectedRows =
kind === "uart"
? oracle.rows
: oracle.reads.flatMap((read) => read.bytes.slice(1));
const expected = signalFacts(kind, expectedRows);
const runtime = (file) =>
pathToFileURL(resolve(values["runtime-root"], file)).href;
const { parseEvidence } = await import(runtime("dist/domain/evidence.js"));
const { decodeSignalRecordingInputSchema, signalRecordingSchema } =
await import(runtime("dist/domain/signals/signalRecording.js"));
const { inspectSignalDecodersInputSchema, signalDecodersSchema } = await import(
runtime("dist/domain/signals/signalDecoders.js")
);
const calls = (await readFile(resolve(values.trial, "events.jsonl"), "utf8"))
.split("\n")
.filter(Boolean)
.map(JSON.parse)
.filter(
(event) =>
event.type === "item.completed" && event.item?.type === "mcp_tool_call",
)
.map((event) => event.item);
const reasons = [],
workflowReasons = [],
authenticated = new Map(),
conflicting = new Set();
try {
verifySignalOracleIdentity(values.artifact, oracle);
if (oracle.kind !== kind)
throw new Error("Wrong independent signal question oracle");
if (calls.length !== 1 || calls[0]?.tool !== "decode_signal_recording")
workflowReasons.push(
"Completed public call sequence differs from the fixed single-call plan",
);
const planned = decodeSignalRecordingInputSchema.parse(
signalRequest(
values.artifact,
settings.selected_artifact_path,
values.selection,
),
);
for (const call of calls) {
try {
if (
call.server !== "rea" ||
call.status !== "completed" ||
call.error ||
call.result?.isError
)
throw new Error("Call did not return successful REA observations");
const text =
call.result?.content?.filter((item) => item.type === "text") ?? [];
if (!call.result?.structuredContent && text.length !== 1)
throw new Error("No unambiguous Evidence envelope");
const evidence =
call.result.structuredContent ?? JSON.parse(text[0].text);
parseEvidence(evidence);
const capture = call.tool === "decode_signal_recording";
if (!capture && call.tool !== "inspect_signal_decoders")
throw new Error("Not a signal observation tool");
const input = (
capture
? decodeSignalRecordingInputSchema
: inspectSignalDecodersInputSchema
).parse(call.arguments);
const report = (
capture ? signalRecordingSchema : signalDecodersSchema
).parse(evidence.normalized_result);
if (
evidence.operation !== call.tool ||
!isDeepStrictEqual(evidence.parameters, input) ||
!isDeepStrictEqual(report.selection, input)
)
throw new Error(
"Evidence differs from actual operation or caller choices",
);
if (
capture
? evidence.subject?.local_path !== input.path ||
evidence.subject?.digest?.sha256 !== oracle.sha256 ||
report.artifact.path !== input.path ||
report.artifact.sha256 !== oracle.sha256
: evidence.subject?.local_path !== report.tool.path ||
evidence.subject?.digest?.sha256 !== report.tool.sha256
)
throw new Error("Evidence identifies different recording/tool bytes");
if (capture && !isDeepStrictEqual(input, planned))
workflowReasons.push("Capture selection differs from the fixed plan");
const observation = {
operation: call.tool,
input,
report,
rows: capture ? signalDataRows(kind, report.annotations_text) : null,
};
const id = evidence.evidence_id;
if (conflicting.has(id))
throw new Error("Previously conflicting Evidence identity");
if (
authenticated.has(id) &&
!isDeepStrictEqual(authenticated.get(id), observation)
) {
authenticated.delete(id);
conflicting.add(id);
throw new Error(
"Repeated Evidence identity has inconsistent observations",
);
}
authenticated.set(id, observation);
} catch (error) {
workflowReasons.push(
`Call ${call.tool} did not provide authenticated observations: ${String(error)}`,
);
}
}
const answer = JSON.parse(
(await readFile(resolve(values.trial, "answer.txt"), "utf8")).trim(),
);
if (
!isDeepStrictEqual(
Object.keys(answer).sort(),
[...Object.keys(expected), "evidence_ids", "limitations"].sort(),
)
)
workflowReasons.push("Final answer shape differs from the fixed plan");
if (
!isDeepStrictEqual(
Object.fromEntries(
Object.keys(expected).map((key) => [key, answer[key]]),
),
expected,
)
)
throw new Error("Final answer differs from independent sample facts");
if (
!Array.isArray(answer.evidence_ids) ||
new Set(answer.evidence_ids).size !== answer.evidence_ids.length ||
answer.evidence_ids.some((id) => !authenticated.has(id))
)
throw new Error(
"Final citations are not authenticated signal observations",
);
const rows = new Map();
for (const id of answer.evidence_ids) {
for (const row of authenticated.get(id).rows ?? []) {
const old = rows.get(row.start);
if (old && !isDeepStrictEqual(old, row))
throw new Error("Cited sample ranges have conflicting decoded data");
rows.set(row.start, row);
}
}
verifySignalRows(
kind,
[...rows.values()].sort((a, b) => a.start - b.start),
oracle,
oracle.sha256,
);
const limitations =
typeof answer.limitations === "string"
? [answer.limitations]
: answer.limitations;
if (
!Array.isArray(limitations) ||
limitations.length === 0 ||
limitations.some((value) => typeof value !== "string" || !value.trim())
)
workflowReasons.push("Final answer omits investigation limitations");
if (
summary.exit_code !== 0 ||
summary.timeout ||
summary.selected_artifact_bytes_unchanged !== true ||
settings.selected_artifact_sha256_before !== oracle.sha256 ||
summary.selected_artifact_sha256_after !== oracle.sha256
)
workflowReasons.push(
"Trial did not complete with original selected bytes unchanged",
);
} catch (error) {
reasons.push(String(error));
}
const report = {
factual_correctness: reasons.length ? "failed" : "passed",
workflow_correctness:
reasons.length || workflowReasons.length ? "failed" : "passed",
reasons,
workflow_reasons: workflowReasons,
completed_calls: calls.length,
wall_seconds: summary.wall_seconds,
usage: summary.usage,
selected_artifact_sha256: oracle.sha256,
scope:
"Two pinned single-device recordings; independently sampled bytes and authenticated cited decoder observations; hardware behavior is not inferred",
limitation_prose: "Presence checked; wording requires transcript review",
};
await writeFile(
resolve(values.trial, "signal-review.json"),
JSON.stringify(report, null, 2) + "\n",
);
console.log(JSON.stringify(report));
if (reasons.length || workflowReasons.length) process.exitCode = 1;
@@ -0,0 +1,326 @@
import assert from "node:assert/strict";
import { execFile } from "node:child_process";
import { readFile } from "node:fs/promises";
import { resolve } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import { promisify } from "node:util";
const corpus = JSON.parse(
await readFile(new URL("./corpus.json", import.meta.url), "utf8"),
);
export const SAZ_ARTIFACTS = Object.fromEntries(
corpus.artifacts
.filter((entry) => entry.saz_question)
.map((entry) => [entry.id, entry]),
);
export function sazRequest(artifact, path, selection) {
const question = Object.hasOwn(SAZ_ARTIFACTS, artifact)
? SAZ_ARTIFACTS[artifact].saz_question
: undefined;
if (!question) throw new Error("Select a pinned SAZ question");
return {
capture_path: path,
format: "saz",
...(selection === "baseline"
? {}
: { record_ordinals: question.record_ordinals }),
sensitive_values: [],
};
}
export function verifySazOracleIdentity(artifact, oracle) {
assert.ok(
Object.hasOwn(SAZ_ARTIFACTS, artifact),
"Unknown pinned SAZ question",
);
const entry = SAZ_ARTIFACTS[artifact];
assert.equal(oracle.kind, "saz");
assert.equal(oracle.artifact, artifact);
assert.equal(oracle.sha256, entry.sha256, "Wrong immutable corpus");
assert.equal(oracle.total_records, entry.saz_question.total_records);
assert.deepEqual(oracle.record_ordinals, entry.saz_question.record_ordinals);
}
export function sazEvidenceParameters(input, totalRecords) {
return {
capture_path: input.capture_path,
format: input.format,
record_ordinals:
input.record_ordinals ??
Array.from({ length: totalRecords }, (_, index) => index),
sensitive_value_count: input.sensitive_values.length,
};
}
export function verifySazRecords(records, oracle) {
assert.equal(oracle.kind, "saz", "Wrong independent question");
assert.equal(
records.length,
oracle.records.length,
"Selected coverage differs",
);
return records.map((record, index) => {
const raw = oracle.records[index];
assert.equal(record.ordinal, raw.ordinal, "Caller order/ordinal differs");
assert.equal(
record.reported.session_id,
raw.session_id,
"Padded source identity differs",
);
assert.deepEqual(
record.location,
{ kind: "archive-members", members: raw.members },
"Original member coordinates differ",
);
for (const side of ["request", "response"]) {
const expected = raw[side],
reported = record.reported[side];
if (expected === null) {
assert.equal(reported, null, "Absent message invented");
assert.ok(
!record.binary_fields.some(
(field) => field.pointer === `/${side}/body`,
),
"Absent body invented",
);
continue;
}
assert.equal(reported.member, expected.member);
for (const field of side === "request"
? ["method", "url", "http_version"]
: ["status", "reason", "http_version"])
assert.equal(
reported[field],
expected[field],
"Stored HTTP start line differs",
);
const contentTypes = (headers) =>
headers.filter(
(header) => header.name.toLowerCase() === "content-type",
);
assert.deepEqual(
contentTypes(reported.headers),
contentTypes(expected.headers),
"Content-Type order/spelling/values differ",
);
const bodies = record.binary_fields.filter(
(field) => field.pointer === `/${side}/body`,
);
assert.equal(bodies.length, 1, "Stored body representation differs");
const body = bodies[0];
assert.equal(body.state, "retained", "Stored body unexpectedly unknown");
assert.equal(
body.representation,
"producer-bytes",
"Encoded source representation differs",
);
for (const field of ["bytes", "sha256", "content_base64"])
assert.equal(
body[field],
expected.body[field],
"Stored encoded body bytes differ",
);
assert.equal(
reported.body,
expected.body.text,
"UTF-8 projection or empty body differs",
);
}
const response = raw.response;
return {
ordinal: record.ordinal,
session_id: raw.session_id,
members: raw.members,
request:
raw.request === null
? null
: { method: raw.request.method, url: raw.request.url },
response:
response === null
? null
: {
status: response.status,
http_version: response.http_version,
content_types: response.headers.filter(
(header) => header.name.toLowerCase() === "content-type",
),
body: {
bytes: response.body.bytes,
sha256: response.body.sha256,
},
},
};
});
}
export async function measureSazEntry({ values, call, inputSha }) {
const runtime = (file) =>
pathToFileURL(resolve(values["runtime-root"], file)).href;
const { parseEvidence } = await import(runtime("dist/domain/evidence.js"));
const { inspectWebNetworkCaptureInputSchema, webNetworkCaptureSchema } =
await import(runtime("dist/domain/webNetworkCapture.js"));
const { inspectAnalysisViewInputSchema, analysisViewResultSchema } =
await import(runtime("dist/domain/analysisView/analysisView.js"));
const read = await promisify(execFile)(
"python3",
[
fileURLToPath(new URL("./saz-oracle.py", import.meta.url)),
values.artifact,
values.path,
],
{ maxBuffer: 2 * 1024 * 1024, timeout: 30_000 },
);
const oracle = JSON.parse(read.stdout);
verifySazOracleIdentity(values.artifact, oracle);
assert.equal(oracle.sha256, inputSha);
const input = inspectWebNetworkCaptureInputSchema.parse(
sazRequest(values.artifact, values.path, values["saz-selection"]),
);
const observations = [];
const checked = (evidence, schema) => {
evidence = parseEvidence(evidence);
assert.equal(evidence.subject.local_path, values.path);
assert.equal(evidence.subject.digest.sha256, inputSha);
const report = schema.parse(evidence.normalized_result);
observations.push({
evidence_id: evidence.evidence_id,
operation: evidence.operation,
parameters: evidence.parameters,
limitations: evidence.limitations,
coverage: report.coverage ?? {
total_records: report.total_records,
retained_records: report.records.length,
},
});
return report;
};
const readView = async (source, view) => {
const request = inspectAnalysisViewInputSchema.parse({ source, view });
const evidence = await call("inspect_analysis_view", request);
assert.equal(evidence.operation, "inspect_analysis_view");
assert.deepEqual(evidence.parameters, {
parent_evidence_id: source.evidence_id,
view: request.view,
});
const result = checked(evidence, analysisViewResultSchema);
assert.equal(result.kind, request.view.kind);
assert.equal(result.parent_evidence_id, source.evidence_id);
assert.equal(result.parent_operation, "inspect_web_network_capture");
assert.deepEqual(result.view, request.view);
return result;
};
let records, decoder;
if (values["saz-selection"] !== "retained") {
let evidence;
try {
evidence = await call("inspect_web_network_capture", input);
} catch (failure) {
const error = failure.value?.error;
const limits = error?.details?.reported_limits;
if (
values["saz-selection"] !== "baseline" ||
error?.code !== "resource_constraint" ||
error.details.operation !== "inspect_web_network_capture" ||
limits?.boundary !== "mcp-response" ||
!limits.evidence_reference
)
throw failure;
// Recover only the exact retained reference returned by this failed call.
// The failed RPC remains in the shared measurement log and task costs.
const source = limits.evidence_reference;
assert.equal(source.kind, "retained-evidence");
const summary = await readView(source, { kind: "summary" });
assert.equal(summary.summary.format, "saz");
assert.equal(summary.summary.total_records, oracle.total_records);
assert.equal(summary.summary.retained_records, oracle.total_records);
decoder = summary.summary.decoder;
records = [];
for (const ordinal of oracle.record_ordinals) {
const page = await readView(source, {
kind: "capture",
detail: "complete",
offset: ordinal,
limit: 1,
});
assert.equal(page.coverage.total, oracle.total_records);
assert.equal(page.items.length, 1);
records.push(page.items[0]);
}
}
if (evidence !== undefined) {
assert.equal(evidence.operation, "inspect_web_network_capture");
assert.deepEqual(
evidence.parameters,
sazEvidenceParameters(input, oracle.total_records),
);
const report = checked(evidence, webNetworkCaptureSchema);
assert.equal(report.format, "saz");
assert.equal(report.total_records, oracle.total_records);
assert.equal(
report.records.length,
values["saz-selection"] === "baseline"
? oracle.total_records
: oracle.records.length,
);
if (values["saz-selection"] === "baseline")
assert.deepEqual(
report.records.map((record) => record.ordinal),
Array.from({ length: oracle.total_records }, (_, index) => index),
);
records =
values["saz-selection"] === "baseline"
? oracle.record_ordinals.map((ordinal) =>
report.records.find((record) => record.ordinal === ordinal),
)
: report.records;
decoder = report.decoder;
}
} else {
const initial = await call("inspect_web_network_capture", {
...input,
detail: "summary",
});
const summary = checked(initial, analysisViewResultSchema);
assert.equal(summary.kind, "summary");
assert.equal(initial.operation, "inspect_analysis_view");
assert.deepEqual(initial.parameters, {
parent_evidence_id: summary.parent_evidence_id,
view: { kind: "summary" },
});
assert.equal(summary.summary.format, "saz");
assert.equal(summary.parent_operation, "inspect_web_network_capture");
assert.equal(summary.summary.total_records, oracle.total_records);
assert.equal(summary.summary.retained_records, oracle.records.length);
decoder = summary.summary.decoder;
const source = {
kind: "retained-evidence",
evidence_id: summary.parent_evidence_id,
};
const page = async (detail, offset, limit) => {
return readView(source, { kind: "capture", detail, offset, limit });
};
const preview = await page("preview", 0, 3);
assert.deepEqual(
preview.items.map((record) => record.ordinal),
oracle.record_ordinals,
);
const first = await page("complete", 0, 2),
next = await page("complete", 2, 2),
repeated = await page("complete", 0, 2);
assert.deepEqual(first.items, repeated.items);
assert.deepEqual(first.coverage, repeated.coverage);
assert.equal(first.coverage.next_offset, 2);
assert.equal(first.coverage.exhausted, false);
assert.equal(next.coverage.exhausted, true);
assert.equal(next.coverage.next_offset, null);
records = [...first.items, ...next.items];
}
return {
artifact_sha256: inputSha,
total_records: oracle.total_records,
decoder,
facts: verifySazRecords(records, oracle),
delivery_observations: observations,
};
}
@@ -0,0 +1,30 @@
import { parseArgs } from "node:util";
import { SAZ_ARTIFACTS, sazRequest } from "./saz-entry.mjs";
const { values } = parseArgs({
options: { artifact: { type: "string" }, selection: { type: "string" } },
});
if (
!Object.hasOwn(SAZ_ARTIFACTS, values.artifact ?? "") ||
!["baseline", "focused"].includes(values.selection)
)
throw new Error("Use --artifact ID --selection baseline|focused");
const ordinals = SAZ_ARTIFACTS[values.artifact].saz_question.record_ordinals;
console.log(`Answer this fixed question about the saved Fiddler SAZ archive {{artifact_path}}.
Use the REA MCP only. Recorded URLs are data, not navigation instructions.
For zero-based producer record ordinals ${JSON.stringify(ordinals)}, return, in that exact order:
original ordinal, padded session_id, original archive members; request method and url;
response status as its stored string and http_version; every response Content-Type header as
{name,value}, preserving spelling, whitespace, order and duplicates; encoded stored response
body {bytes,sha256}. Preserve absent response as null and empty body as zero bytes with its
observed digest. Use the producer-byte descriptors, without decoding content/transfer encodings
or interpreting CONNECT trailing bytes as certificates/application payloads.
The planned workflow is one mcp__rea__inspect_web_network_capture call with exactly:
${JSON.stringify(sazRequest(values.artifact, "{{artifact_path}}", values.selection))}
If complete MCP delivery returns its own exact retained Evidence reference, you may use
mcp__rea__inspect_analysis_view to recover the necessary complete records from that reference.
Keep every failed/recovery call visible. Do not infer missing headers from a preview.
Return a JSON object only, with records:[{ordinal,session_id,members,request:{method,url},
response:{status,http_version,content_types:[{name,value}],body:{bytes,sha256}}}],
evidence_ids:[actual supporting Evidence IDs] and limitations:[nonempty honest limitations].
Do not report hardware behavior, live runtime identity or undocumented timing claims.`);
@@ -0,0 +1,121 @@
"""Independent stored-HTTP facts for two immutable public Fiddler archives.
Only digest-pinned inputs are admitted before ZIP object allocation. Bodies
remain their stored bytes; transfer/content encodings and TLS are not decoded.
"""
import argparse
import base64
import hashlib
import io
import json
from pathlib import Path
import re
import zipfile
def stored_http(data, request):
boundaries = [(data.find(separator), separator)
for separator in [b'\r\n\r\n', b'\n\n']]
available = [(index, separator) for index, separator in boundaries if index >= 0]
if not available:
raise ValueError('Stored message has no header/body separator')
boundary, separator = min(available, key=lambda item: item[0])
lines = data[:boundary].split(b'\r\n' if separator.startswith(b'\r') else b'\n')
start = lines[0].decode('latin1')
fields = start.split(' ')
if request:
if len(fields) != 3 or fields[2] not in ['HTTP/1.0', 'HTTP/1.1']:
raise ValueError('Unsupported stored request line')
result = dict(zip(['method', 'url', 'http_version'], fields))
else:
fields = start.split(' ', 2)
if len(fields) < 2 or fields[0] not in ['HTTP/1.0', 'HTTP/1.1'] or not re.fullmatch(r'[0-9]{3}', fields[1]):
raise ValueError('Unsupported stored response line')
result = {'http_version': fields[0], 'status': fields[1],
'reason': fields[2] if len(fields) == 3 else ''}
headers = []
newline = '\r\n' if separator.startswith(b'\r') else '\n'
for raw in lines[1:]:
line = raw.decode('latin1')
if line.startswith((' ', '\t')):
if not headers:
raise ValueError('Header continuation has no owning field')
headers[-1]['value'] += newline + line
continue
name, delimiter, value = line.partition(':')
if not delimiter or not name:
raise ValueError('Stored header has no field delimiter')
headers.append({'name': name, 'value': value})
body = data[boundary + len(separator):]
try:
body_text = body.decode('utf8', errors='strict')
except UnicodeDecodeError:
body_text = None
return result | {'headers': headers, 'body': {
'content_base64': base64.b64encode(body).decode('ascii'),
'bytes': len(body), 'sha256': hashlib.sha256(body).hexdigest(),
'text': body_text,
}}
def read_saz(artifact, path):
corpus = json.loads(Path(__file__).with_name('corpus.json').read_text())
entry = next((item for item in corpus['artifacts']
if item['id'] == artifact and 'saz_question' in item), None)
if entry is None:
raise ValueError('Select a pinned SAZ artifact')
# Real source sizes bound the snapshot; size/digest gate ZIP allocation.
if path.stat().st_size != entry['bytes']:
raise ValueError('Selected file size differs from pinned SAZ corpus')
with path.open('rb') as source:
data = source.read(entry['bytes'] + 1)
digest = hashlib.sha256(data).hexdigest()
if len(data) != entry['bytes'] or digest != entry['sha256']:
raise ValueError('Selected bytes differ from pinned SAZ corpus')
question = entry['saz_question']
with zipfile.ZipFile(io.BytesIO(data)) as archive:
inventory = archive.infolist()
if (len(inventory) != question['members'] or
sum(item.file_size for item in inventory) != question['expanded_bytes']):
raise ValueError('Pinned directory coverage differs')
groups = {}
for item in inventory:
match = re.fullmatch(r'raw/(\d+)_(c\.txt|s\.txt|m\.xml|w\.txt|g\.txt)', item.filename)
if match:
groups.setdefault(match[1], []).append(item)
if len(groups) != question['total_records']:
raise ValueError('Pinned session coverage differs')
ordered = list(groups.items())
records = []
for ordinal in question['record_ordinals']:
session_id, members = ordered[ordinal]
result = {'ordinal': ordinal, 'session_id': session_id,
'members': [item.filename for item in members],
'request': None, 'response': None}
for item in members:
side = 'request' if item.filename.endswith('_c.txt') else 'response' if item.filename.endswith('_s.txt') else None
if side is None:
continue
with archive.open(item) as source:
content = source.read(item.file_size + 1)
if len(content) != item.file_size:
raise ValueError('Stored member size differs')
result[side] = {'member': item.filename, **stored_http(content, side == 'request')}
records.append(result)
with path.open('rb') as source:
after = source.read(entry['bytes'] + 1)
if hashlib.sha256(after).hexdigest() != digest:
raise ValueError('Selected archive changed during independent read')
return {'kind': 'saz', 'artifact': artifact, 'sha256': digest,
'total_records': len(groups), 'record_ordinals': question['record_ordinals'],
'records': records,
'scope': 'Stored HTTP bytes and ZIP member coordinates; no body decompression, live attribution or certificate interpretation'}
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('artifact')
parser.add_argument('path', type=Path)
args = parser.parse_args()
print(json.dumps(read_saz(args.artifact, args.path)))
@@ -0,0 +1,214 @@
# Fiddler SAZ selection checkpoint
This experiment addresses [#3132](https://github.com/morluto/rea/issues/3132).
Its runtime baseline is `ca1b2f8608c52ed721d3576ba5eeb1d66717b08c`.
Production APIs and defaults are unchanged. The measured cohort establishes no
stable whole-task token/time benefit; no new production preset, cache or API is
justified by this checkpoint.
## Genuine public corpus
Both archives come from Microsoft's
[Xbox Live Trace Analyzer](https://github.com/microsoft/xbox-live-trace-analyzer/tree/ad880ff00b26c4cae5e3c8864d3df438a03890ba/Source/TestData/CertWarnings)
at immutable revision `ad880ff00b26c4cae5e3c8864d3df438a03890ba`.
The repository's [MIT license](https://github.com/microsoft/xbox-live-trace-analyzer/blob/ad880ff00b26c4cae5e3c8864d3df438a03890ba/LICENSE.md)
and original source files remain upstream. No sample binaries, raw HTTP material,
authentication values, configs or detailed results are committed.
| Artifact | Archive bytes | Expanded member bytes | Sessions | Members | Producer archive comment |
| ------------------------ | ------------: | --------------------: | -------: | ------: | ------------------------ |
| `xbox-clear_nomp.saz` | 43,515 | 62,609 | 13 | 42 | Fiddler v4.5.1.2 |
| `xbox-clear_mp_cs10.saz` | 5,223,519 | 9,223,820 | 1,311 | 3,939 | Fiddler v4.6.2.0 |
`corpus.json` pins download URLs, file sizes, SHA-256, Git blob IDs, directory
coverage and question ordinals. Downloaded bytes match their Git blob and
SHA-256. A third public 103-session archive is pinned as an admission-negative
probe, outside completed-question comparisons. Archive comments report their producer
versions; no local Fiddler installation or independent producer-version proof
is claimed.
## Fixed analyst question
Before examining transaction facts, select ordinals `[12, 0, 6]` in the control
and `[1310, 0, 655]` in the larger archive. Return that caller-selected order,
original padded session IDs and archive-member coordinates, request method/URL,
response status/version, all recorded Content-Type pairs in their original
spelling/order, and stored response-body byte length/SHA-256.
Bodies retain their archived encoding. CONNECT trailing bytes are stored data,
not an inferred HTTP application body or certificate interpretation. Empty bodies
have zero bytes and the empty digest; an absent response remains absent. Header
duplication/folding, Latin-1 spelling and binary body bytes are independently
read without REA imports. Synthetic reader tests cover those semantics and
malformed input; they establish no provider coverage.
The oracle admits only immutable corpus size/digest matches before constructing
ZIP objects, preserves central-directory session/member order, reads selected
members with size sentinels and CRC validation, and checks the source digest
again. Necessary facts are independently checked for all six selected records.
```sh
python3 experiments/analysis-efficiency/test_saz_oracle.py
python3 experiments/analysis-efficiency/saz-oracle.py xbox-clear_nomp.saz /absolute/clear_nomp.saz
python3 experiments/analysis-efficiency/saz-oracle.py xbox-clear_mp_cs10.saz /absolute/clear_mp_cs10.saz
```
The baseline build, five oracle regressions and the SDK checker semantics passed
on Linux. Real MCP preflight checks verify control retained pages/repeated reads,
the large ordinal-selected result, and large complete-workflow recovery. The
default large MCP return completes analysis but exceeds the existing 10 MiB stdio
receive-buffer budget; its exact returned retained Evidence reference supports
summary and complete pages. Recovery preserves the failed RPC and every follow-up
call, and matches the independently checked necessary facts from direct selection.
This transport limit is not a decoding timeout. Formal repetitions and actual
model tasks are reported below; preflight observations are not eligible cost pairs.
The 103-session `xbox-x49_mp_cs21.saz` candidate contains an empty stored response
member `raw/099_s.txt`, lacking an HTTP header/body separator. On this baseline,
whole-capture admission fails with `invalid_request` / `invalid_format`. Its
ordinals `[102, 0, 51]` were fixed before inspecting its transaction facts. The
failed attempt/source member is preserved as a negative probe; no parser repair
or successful-task comparison is claimed for that archive.
Other platform behavior remains unverified.
Detailed outputs stay private; missing resource counters remain unknown.
The large selected CLI workflow also matches independent bytes and MCP facts,
parameters and Evidence ID. A separate default complete CLI attempt hit the
provider's 30-second timeout under the one-CPU guard; that failed attempt is
preserved separately from the successful-analysis MCP receive-buffer failure.
It does not prove a general CLI failure or identify an engine-stage cause.
Ten grading preflight cases cover valid actual Evidence, wrong final digests,
unknown citations, missing limitations, answer order, failed calls before/after
valid data, semantic-ID corruption and actual large retained recovery. Their
answers/events are injected checker tests, not actual model trials. An invalid
later duplicate is rejected by the domain's semantic-ID owner and does not erase
earlier authenticated observations.
## SDK and model reproduction
```sh
node experiments/analysis-efficiency/measure.mjs \
--runtime-root /absolute/frozen-runtime --revision ca1b2f8608c52ed721d3576ba5eeb1d66717b08c \
--artifact xbox-clear_nomp.saz --path /absolute/clear_nomp.saz \
--output /absolute/new-result-dir --schemas selected --saz-selection focused
node experiments/analysis-efficiency/saz-model-prompt.mjs \
--artifact xbox-clear_nomp.saz --selection focused > /absolute/prompt.txt
```
Use the same runtime, inputs, explicit provider settings and resource profile
within a cost cohort; retain runtime/workflow/oracle/settings fingerprints. Repeat
both core archives with baseline/focused/focused/baseline order and retain all
failures/recovery RPCs. The `retained` diagnostic workflow also measures preview,
two complete pages and a repeated first page. Preview omits headers, so preview
alone is not equivalent to the complete header/body question.
Run real Codex tasks through `agent-trial.py` with an isolated temporary profile,
the two exact `inspect_web_network_capture` / `inspect_analysis_view` tools,
the same requested model/reasoning and at least two baseline/focused pairs for
the control. Grade cited observations with `review-saz.mjs`, an independently
produced oracle and the tested runtime. Count whole-task input/output tokens,
cached input, elapsed time and all calls; parsed JSON bytes are not model tokens.
The executed scope and all failed/deviating trials follow below.
## Executed SDK cohort
Runtime is frozen at `ca1b2f8608c52ed721d3576ba5eeb1d66717b08c`; corrected
experiment source is `286c3e48ad50d9e84baa3af00ca522a8cef36e95`. All corrected
SDK runtime/workflow/oracle/provider-setting fingerprints match. Node is 24.18.0
and MCP SDK is 2.3.1. SDK processes have a 1 GiB Node heap ceiling; model MCP
profiles separately record 512 MiB. Compare within each cohort.
The initial batch preserves 12 workflows / 36 RPCs. Two control baseline collectors
incorrectly expected omitted request ordinals to remain omitted in Evidence;
the owning application records the resolved full scope. Original RPC arguments
preserve omission. Both saved replies independently validate correct typed
Evidence/facts after the checker correction. Original failures, hashes and costs
remain unchanged and are not pooled into the corrected batch.
The corrected batch executes 12 workflows / 32 RPCs: **11 workflows pass** all necessary
byte/header/member checks with equal facts across successful arms. One large
default complete query hits `provider_timeout` at the 30-second provider budget.
Failed complete-return RPCs in successful retained recovery also stay in cost.
| Archive / workflow | Repetition outcomes | All parsed reply bytes | RPC ms | Whole runner ms |
| ------------------ | ------------------- | ---------------------: | --------------------- | --------------------- |
| control / baseline | passed / passed | 249272 / 249272 | 817.904 / 817.032 | 5393.982 / 4922.524 |
| control / focused | passed / passed | 65390 / 65390 | 805.492 / 835.598 | 4897.670 / 4924.772 |
| control / retained | passed / passed | 146981 / 146981 | 1846.344 / 8258.135 | 5861.567 / 18108.568 |
| large / baseline | failed / passed | 520 / 114294 | 32303.203 / 13623.033 | 52432.342 / 18064.360 |
| large / focused | passed / passed | 535767 / 535767 | 32917.417 / 23536.051 | 52933.865 / 37045.394 |
| large / retained | passed / passed | 174477 / 174477 | 10970.973 / 11550.158 | 15140.224 / 15669.775 |
Control direct selection reduces parsed replies **73.8%**. Large complete-result
recovery delivers 114,294 bytes, while direct ordinal selection retains the original
container inventory and delivers 535,767 bytes. The five-call retained diagnostic
delivers 174,477 bytes, including preview and repeated-page verification. A smaller
record set alone does not guarantee less delivery; bytes are not wire bytes or
model tokens.
Initial RPCs combine decoding, validation, canonicalization and delivery; no
decode-only/format-only attribution is claimed. First-use and repeated retained
reads remain separate RPC observations. Fresh client/server processes do not
establish cold OS/provider caches. Substantial time variation precludes a stable
general speedup claim.
## Actual Codex outcomes
Four actual Codex CLI 0.161.0 trials request `gpt-5.6-terra`/`high` with the same
two enabled/preapproved passive tools in baseline/focused/focused/baseline order.
The requested alias is pinned; resolved backend identity is unknown. Temporary
profiles preserve original bytes. The requested mode is `direct`, but owned
tool-context logs show actual `exec` discovery/dispatch; neither guaranteed direct
presentation nor exact submitted model requests are established.
| Trial | Facts / fixed plan | MCP calls | Total input | Cached input | Uncached input, derived | Output | Seconds |
| ---------- | ------------------ | --------: | ----------: | -----------: | ----------------------: | -----: | ------: |
| baseline-1 | passed / failed | 4 | 97,988 | 53,504 | 44,484 | 1,556 | 51.266 |
| focused-1 | passed / failed | 2 | 96,433 | 51,456 | 44,977 | 1,400 | 52.288 |
| focused-2 | failed / failed | 0 | 21,379 | 9,984 | 11,395 | 317 | 16.301 |
| baseline-2 | passed / failed | 4 | 172,043 | 125,696 | 46,347 | 1,943 | 62.570 |
**Three of four tasks answer correctly.** All three add compatible retained-view
calls and differ from the initially prescribed single MCP-call plan. These
successful completed-task costs stay visible separately from plan conformance.
Baselines read three exact record views; the successful focus reads one complete
selected-parent page.
The second focus makes zero MCP calls and reports unavailable tools. Its owned
exact-name discovery returns an empty list, while the same names work in other
trials; stderr is empty. The cause is unknown, not proof of a REA outage. Keep
its 21,379 input tokens / 16.301 seconds as a failed task, without a replacement retry
or an apparent speed win.
Only the first pair completes both questions: total input decreases **1.6%**,
time increases **2.0%**, and derived uncached input increases **1.1%**. The second
pair has no completed focused question; no paired speed/token claim is valid.
Limitation prose was inspected: successful answers qualify stored bytes,
ZIP-directory order and absent transfer/content decoding. This small mixed cohort
justifies **no production optimization**.
## Resource and compatibility scope
Heavy work is serial with one CPU, 3 GiB early stop / 4 GiB hard family memory, no swap,
task ceilings and host-availability/ownership checks. Corrected SDK payload-exit
peak is 906,825,728 bytes (**865 MiB**); model peak is 873,148,416 bytes (**833 MiB**).
All 16 corrected SDK/model payload phases verify cleanup, no observed OOM/abort
and captured CPU counters. Terminal whole-scope counters remain unknown. Failed
tool/model tasks do not become correct because their process exits cleanly.
Family CPU seconds at payload exit span 5.898–44.331 for corrected SDK workflows
(median 15.808), including failed/recovered attempts. Model baseline/focus/focus/
baseline observations are 7.573 / 7.303 / 5.810 / 7.618 CPU seconds; the third
model task failed and cannot establish an efficiency gain. These counters include
the owned runner/client/server/observer family, not decoder-only CPU.
Verification covers Linux, two immutable positive archives plus one genuine
partial-message negative source, one installed parser stack and one requested
model alias. Other platforms, Fiddler acquisition/import, live deployment or
certificate semantics, arbitrary layouts, direct presentation guarantees and
unmeasured engine stages remain unknown. Complete defaults, caller choices,
encoded bytes, redactions, semantic Evidence identity and session-owned views
remain the compatibility baseline. Reuse existing selectors/views; expand
SDK/cache/default behavior only after completed tasks show a benefit.
@@ -0,0 +1,264 @@
import { execFile } from "node:child_process";
import { readFile } from "node:fs/promises";
import { resolve } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import { isDeepStrictEqual, promisify } from "node:util";
const corpus = JSON.parse(
await readFile(new URL("./corpus.json", import.meta.url), "utf8"),
);
export const SIGNAL_ARTIFACTS = {
"sigrok-uart-max3232e.sr": {
kind: "uart",
decoders: "uart:rx=MAX3232E DOUT1:baudrate=57600:format=hex:invert_rx=yes",
annotations: "uart=rx-data",
query: "rx-data",
firstPage: 32,
},
"sigrok-i2c-nunchuk.sr": {
kind: "i2c",
decoders: "i2c:scl=SCL:sda=SDA",
annotations: "i2c=data-read",
query: "data-read",
firstPage: 9,
},
};
export function signalRequest(artifact, path, selection) {
const descriptor = SIGNAL_ARTIFACTS[artifact];
if (!descriptor) throw new Error("Unknown fixed signal question");
return {
path,
decoders: descriptor.decoders,
input_format: null,
annotations: selection === "baseline" ? null : descriptor.annotations,
line_offset: 0,
line_limit: selection === "pages" ? descriptor.firstPage : null,
};
}
export function signalDataRows(kind, text) {
const pattern =
kind === "uart"
? /^(\d+)-(\d+) uart-1: ([0-9A-F]{2})$/
: /^(\d+)-(\d+) i2c-1: Data read: ([0-9A-F]{2})$/;
const rows = [];
for (const line of text.split("\n")) {
const match = pattern.exec(line);
if (!match) continue;
const start = Number(match[1]),
end = Number(match[2]);
if (
!Number.isSafeInteger(start) ||
!Number.isSafeInteger(end) ||
start > end
)
throw new Error("Unsupported decoded sample interval");
rows.push({ start, end, byte: Number.parseInt(match[3], 16) });
}
return rows;
}
export function signalFacts(kind, rows) {
if (kind === "uart") return { kind, bytes: rows.map((row) => row.byte) };
if (kind !== "i2c" || rows.length !== 18)
throw new Error(
"The fixed I2C question requires three complete six-byte reads",
);
return {
kind,
reads: [0, 6, 12].map((offset) =>
rows.slice(offset, offset + 6).map((row) => row.byte),
),
};
}
export function verifySignalOracleIdentity(artifact, oracle) {
const pinned = corpus.artifacts.find((entry) => entry.id === artifact);
if (
!pinned ||
oracle.kind !== SIGNAL_ARTIFACTS[artifact]?.kind ||
oracle.sha256 !== pinned.sha256
)
throw new Error(
"Independent oracle does not identify the pinned signal corpus",
);
}
export function verifySignalRows(kind, rows, oracle, digest) {
const expected =
kind === "uart"
? oracle.rows
: oracle.reads.flatMap((read) =>
read.bytes.slice(1).map((byte, index) => ({
...byte,
after_previous: read.bytes[index].last_clock,
before_next: read.bytes[index + 2]?.first_clock ?? read.stop,
})),
);
if (
oracle.kind !== kind ||
oracle.sha256 !== digest ||
rows.length !== expected.length
)
throw new Error(
"Signal observations differ from independent sample identity/coverage",
);
for (let index = 0; index < rows.length; index++) {
const observed = rows[index],
raw = expected[index];
if (
observed.byte !== raw.byte ||
observed.start < 0 ||
observed.end >= oracle.total_samples
)
throw new Error("Decoded data differs from independent sample bits");
if (
kind === "uart"
? !Number.isSafeInteger(raw.first_data_sample) ||
!Number.isSafeInteger(raw.last_data_sample) ||
observed.start < raw.start ||
observed.end >= raw.end_exclusive ||
observed.start > raw.first_data_sample ||
observed.end < raw.last_data_sample
: !Number.isSafeInteger(raw.after_previous) ||
!Number.isSafeInteger(raw.before_next) ||
observed.start <= raw.after_previous ||
observed.end >= raw.before_next ||
observed.start > raw.first_clock ||
observed.end < raw.last_clock
)
throw new Error(
"Decoded interval does not identify the independently read byte",
);
}
}
export async function measureSignalEntry({
values,
call,
inputSha,
catalogDefinitions,
}) {
const descriptor = SIGNAL_ARTIFACTS[values.artifact];
const runtime = (file) =>
pathToFileURL(resolve(values["runtime-root"], file)).href;
const { parseEvidence } = await import(runtime("dist/domain/evidence.js"));
const { decodeSignalRecordingInputSchema, signalRecordingSchema } =
await import(runtime("dist/domain/signals/signalRecording.js"));
const { inspectSignalDecodersInputSchema, signalDecodersSchema } =
await import(runtime("dist/domain/signals/signalDecoders.js"));
const observations = [];
const checked = (evidence, operation, input, schema) => {
parseEvidence(evidence);
const report = schema.parse(evidence.normalized_result);
if (
evidence.operation !== operation ||
!isDeepStrictEqual(evidence.parameters, input) ||
!isDeepStrictEqual(report.selection, input)
)
throw new Error(
"Signal Evidence differs from the actual requested operation or choices",
);
if (
operation === "decode_signal_recording"
? evidence.subject?.local_path !== values.path ||
evidence.subject?.digest?.sha256 !== inputSha ||
report.artifact.path !== values.path ||
report.artifact.sha256 !== inputSha
: evidence.subject?.local_path !== report.tool.path ||
evidence.subject?.digest?.sha256 !== report.tool.sha256
)
throw new Error(
"Signal Evidence identifies different recording/tool bytes",
);
observations.push({
evidence_id: evidence.evidence_id,
operation,
selection: report.selection,
output_window: report.output_window,
limitations: evidence.limitations,
});
return report;
};
const selection = values["signal-selection"];
for (const name of [
"decode_signal_recording",
...(selection === "discovery" ? ["inspect_signal_decoders"] : []),
])
if (!catalogDefinitions.has(name))
throw new Error(`Missing live signal contract ${name}`);
if (selection === "discovery") {
const input = inspectSignalDecodersInputSchema.parse({
decoder: descriptor.kind,
query: descriptor.query,
limit: 5,
});
const report = checked(
await call("inspect_signal_decoders", input),
"inspect_signal_decoders",
input,
signalDecodersSchema,
);
if (!report.help_lines.some((line) => line.text.includes(descriptor.query)))
throw new Error(
"Installed decoder help does not establish the selected annotation class",
);
}
const input = decodeSignalRecordingInputSchema.parse(
signalRequest(values.artifact, values.path, selection),
);
const first = checked(
await call("decode_signal_recording", input),
"decode_signal_recording",
input,
signalRecordingSchema,
);
let rows = signalDataRows(descriptor.kind, first.annotations_text);
if (selection === "pages") {
const nextInput = decodeSignalRecordingInputSchema.parse({
...input,
line_offset: descriptor.firstPage,
line_limit: null,
});
const next = checked(
await call("decode_signal_recording", nextInput),
"decode_signal_recording",
nextInput,
signalRecordingSchema,
);
const repeated = checked(
await call("decode_signal_recording", input),
"decode_signal_recording",
input,
signalRecordingSchema,
);
if (
first.annotations_text !== repeated.annotations_text ||
!isDeepStrictEqual(first.output_window, repeated.output_window) ||
first.output_window.total_lines !== next.output_window.total_lines
)
throw new Error("Repeated/next display pages changed observation scope");
rows = [...rows, ...signalDataRows(descriptor.kind, next.annotations_text)];
}
const { stdout } = await promisify(execFile)(
"python3",
[
fileURLToPath(new URL("./signal-oracle.py", import.meta.url)),
descriptor.kind,
values.path,
...(descriptor.kind === "uart" ? ["--invert"] : []),
],
{ timeout: 30_000, maxBuffer: 256 * 1024 },
);
const oracle = JSON.parse(stdout);
verifySignalOracleIdentity(values.artifact, oracle);
verifySignalRows(descriptor.kind, rows, oracle, inputSha);
return {
artifact_sha256: inputSha,
facts: signalFacts(descriptor.kind, rows),
delivery_observations: observations,
evidence_ids: [...new Set(observations.map((item) => item.evidence_id))],
};
}
@@ -0,0 +1,22 @@
import { parseArgs } from "node:util";
import { signalRequest, SIGNAL_ARTIFACTS } from "./signal-entry.mjs";
const { values } = parseArgs({
options: { artifact: { type: "string" }, selection: { type: "string" } },
});
if (
!Object.hasOwn(SIGNAL_ARTIFACTS, values.artifact ?? "") ||
!["baseline", "focused"].includes(values.selection)
)
throw new Error(
"Use --artifact fixed-signal-ID --selection baseline|focused",
);
const kind = SIGNAL_ARTIFACTS[values.artifact].kind;
const question =
kind === "uart"
? "Report every decoded RX data octet on the specified DOUT1 channel, in recording order, as decimal integer bytes. Include all repetitions; do not deduplicate data."
: "Report every I2C READ data payload in recording order, grouped into consecutive six-byte payloads. Exclude address bytes and write data. Do not infer button or hardware behavior.";
console.log(`${question}
Use the configured REA MCP and make exactly one decode_signal_recording call with this selection:
${JSON.stringify(signalRequest(values.artifact, "{{artifact_path}}", values.selection))}
Return one JSON object with exactly these keys: kind (${JSON.stringify(kind)}), ${kind === "uart" ? "bytes (an array of decimal octets)" : "reads (an array of six-octet decimal arrays)"}, evidence_ids (unique actual returned Evidence IDs), limitations (nonempty investigation limitations). Preserve source identity and recorded order. Output lines are not sample or annotation counts; selected decoder observations do not prove complete hardware traffic or original application behavior. Do not run shell commands, browse, acquire hardware samples, invent missing data, or fabricate citations.`);
@@ -0,0 +1,211 @@
"""Independent readers for the two pinned, single-device digital SR recordings."""
import argparse
from bisect import bisect_right
import configparser
import hashlib
import io
import json
from pathlib import Path
import re
import struct
import zipfile
def read_edges(path, channels):
size = path.stat().st_size
if size > 32 * 1024 * 1024:
raise ValueError('Compressed SR input exceeds the experiment budget')
with path.open('rb') as source:
admitted = source.read(size + 1)
if len(admitted) != size:
raise ValueError('SR input size changed during admission')
marker = admitted.rfind(b'PK\x05\x06', max(0, len(admitted) - 65557))
if marker < 0 or len(admitted) - marker < 22:
raise ValueError('Missing classic ZIP directory receipt')
header = struct.unpack_from('<4s4H2IH', admitted, marker)
if (marker >= 20 and admitted[marker-20:marker-16] == b'PK\x06\x07'):
raise ValueError('ZIP64 directory is unsupported')
if header[1] or header[2] or header[3] != header[4] or not 1 <= header[4] <= 64 or header[5] > 65536 or marker + 22 + header[7] != len(admitted) or header[6] + header[5] != marker:
raise ValueError('Unsupported or excessive ZIP directory representation')
directory = memoryview(admitted)[header[6]:marker]
position = count = 0
while position < len(directory):
if count >= 64 or len(directory) - position < 46 or directory[position:position+4] != b'PK\x01\x02':
raise ValueError('Unsupported or excessive actual ZIP directory records')
name_size, extra_size, comment_size = struct.unpack_from('<3H', directory, position + 28)
end = position + 46 + name_size + extra_size + comment_size
if end > len(directory):
raise ValueError('Incomplete actual ZIP directory record')
extra = position + 46 + name_size
extra_end = extra + extra_size
while extra < extra_end:
if extra_end - extra < 4:
raise ValueError('Incomplete ZIP extra field')
tag, length = struct.unpack_from('<2H', directory, extra)
if tag == 1:
raise ValueError('ZIP64 member is unsupported')
extra += 4 + length
if extra > extra_end:
raise ValueError('Incomplete ZIP extra field')
count += 1
position = end
if count != header[4]:
raise ValueError('Declared and actual ZIP directory counts differ')
before = hashlib.sha256(admitted).hexdigest()
# Admission and ZipFile parse the same bounded snapshot, not a reopened path.
with zipfile.ZipFile(io.BytesIO(admitted), allowZip64=False) as archive:
entries = archive.infolist()
names = [item.filename for item in entries]
if len(names) != len(set(names)) or len(names) > 64:
raise ValueError("Ambiguous or excessive SR members")
if sum(item.file_size for item in entries) > 32 * 1024 * 1024:
raise ValueError("Expanded SR input exceeds the experiment budget")
if archive.getinfo('metadata').file_size > 8192:
raise ValueError("Excessive SR metadata")
# Declared sizes are untrusted. A bounded read also caps each inflater
# step; logic members below likewise use bounded block reads.
with archive.open('metadata') as source:
metadata_bytes = source.read(8193)
if len(metadata_bytes) > 8192:
raise ValueError("Expanded SR metadata exceeds the experiment budget")
metadata = metadata_bytes.decode('utf-8')
config = configparser.ConfigParser(interpolation=None)
config.read_string(metadata)
if set(config.sections()) != {'global', 'device 1'}:
raise ValueError("Only the pinned single-device profile is supported")
device = config['device 1']
unit = int(device['unitsize'])
probes = int(device['total probes'])
if unit not in [1, 2] or not 1 <= probes <= unit * 8:
raise ValueError("Unsupported digital sample geometry")
rate = re.fullmatch(r'(\d+)\s+(Hz|kHz|MHz)', device['samplerate'])
if rate is None or int(rate[1]) <= 0:
raise ValueError("Unsupported sample-rate representation")
samplerate = int(rate[1]) * {'Hz': 1, 'kHz': 1000, 'MHz': 1000000}[rate[2]]
bits = []
for channel in channels:
matches = [index - 1 for index in range(1, probes + 1)
if device.get(f'probe{index}') == channel]
if len(matches) != 1:
raise ValueError("Channel identity is missing or ambiguous")
bits.append(matches[0])
prefix = device['capturefile']
chunks = [name for name in names if re.fullmatch(re.escape(prefix) + r'-\d+', name)]
if prefix in names and chunks:
raise ValueError("Ambiguous direct and chunked logic data")
if prefix in names:
chunks = [prefix]
else:
chunks.sort(key=lambda name: int(name.rsplit('-', 1)[1]))
if [int(name.rsplit('-', 1)[1]) for name in chunks] != list(range(1, len(chunks) + 1)):
raise ValueError("Missing or ambiguous logic chunk order")
if not chunks or any(archive.getinfo(name).file_size % unit for name in chunks):
raise ValueError("Missing or incomplete digital samples")
edges = [[] for _ in channels]
previous = None
sample = 0
mask = sum(1 << bit for bit in bits)
for name in chunks:
with archive.open(name) as source:
while block := source.read(65536):
values = block if unit == 1 else (item[0] for item in struct.iter_unpack('<H', block))
for value in values:
selected = value & mask
if selected != previous:
for index, bit in enumerate(bits):
level = (selected >> bit) & 1
if not edges[index] or edges[index][-1][1] != level:
if sum(map(len, edges)) >= 65536:
raise ValueError('Selected transitions exceed the experiment representation budget')
edges[index].append((sample, level))
previous = selected
sample += 1
with path.open('rb') as source:
after = source.read(size + 1)
if len(after) != size or hashlib.sha256(after).hexdigest() != before:
raise ValueError("Recording bytes changed during the independent read")
return {'sha256': before, 'metadata': metadata, 'sample_rate_hz': samplerate,
'total_samples': sample, 'channels': dict(zip(channels, bits))}, edges
def uart(path, invert):
metadata, traces = read_edges(path, ['MAX3232E DOUT1'])
edges = [(sample, level ^ invert) for sample, level in traces[0]]
positions = [sample for sample, _ in edges]
rate, baud = metadata['sample_rate_hz'], 57600
def level(sample):
return edges[bisect_right(positions, sample) - 1][1]
rows = []
busy_until = 0
for index, (start, value) in enumerate(edges):
if index == 0 or value != 0 or start < busy_until:
continue
center = lambda halfbits: start + (halfbits * rate) // (2 * baud)
if center(19) >= metadata['total_samples']:
raise ValueError("Incomplete UART frame at the capture boundary")
if level(center(1)) != 0 or level(center(19)) != 1:
raise ValueError(f"UART framing differs from selected polarity at sample {start}")
byte = sum(level(center(3 + 2 * bit)) << bit for bit in range(8))
# A UART receiver becomes ready after sampling the stop bit. Waiting
# a full nominal ten bits would miss a valid slightly faster sender.
rows.append({'start': start, 'end_exclusive': center(19) + 1, 'byte': byte,
'first_data_sample': center(3), 'last_data_sample': center(17)})
busy_until = center(19) + 1
return metadata | {'kind': 'uart', 'baud_rate': baud, 'invert': bool(invert),
'complete_frames': len(rows), 'rows': rows}
def i2c(path):
metadata, traces = read_edges(path, ['SCL', 'SDA'])
transitions = {}
for channel, edges in enumerate(traces):
for sample, value in edges:
transitions.setdefault(sample, {})[channel] = value
clock = data = None
active = None
bits = []
transactions = []
for sample, changes in sorted(transitions.items()):
next_clock, next_data = changes.get(0, clock), changes.get(1, data)
if clock is not None and data is not None:
if clock == next_clock == 1 and next_data != data:
if next_data == 0:
if active is not None:
raise ValueError("The pinned profile does not contain repeated START")
active = {'start': sample, 'bytes': []}
bits = []
elif active is not None:
# SCL may rise with SDA low to prepare STOP; that final
# rise is not the first bit of a new data byte.
if len(bits) == 1 and bits[0][1] == 0:
bits = []
if bits:
raise ValueError("Incomplete I2C byte before STOP")
active['stop'] = sample
transactions.append(active)
active = None
elif active is not None and clock == 0 and next_clock == 1:
if next_data != data:
raise ValueError("Ambiguous simultaneous clock/data transition")
bits.append((sample, next_data))
if len(bits) == 9:
byte = sum(bit << (7-index) for index, (_, bit) in enumerate(bits[:8]))
active['bytes'].append({'byte': byte, 'first_clock': bits[0][0],
'last_clock': bits[7][0], 'ack': bits[8][1] == 0})
bits = []
clock, data = next_clock, next_data
if active is not None or bits:
raise ValueError("Incomplete I2C transaction at capture end")
reads = [transaction for transaction in transactions
if transaction['bytes'] and transaction['bytes'][0]['byte'] & 1]
return metadata | {'kind': 'i2c', 'transactions': transactions, 'reads': reads}
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('kind', choices=['uart', 'i2c'])
parser.add_argument('path', type=Path)
parser.add_argument('--invert', action='store_true')
args = parser.parse_args()
print(json.dumps(uart(args.path, args.invert) if args.kind == 'uart' else i2c(args.path)))
@@ -0,0 +1,188 @@
# Sigrok selection and repeated-page checkpoint (#3131)
This experiment preserves production APIs, defaults, caller selections and Evidence
semantics. Existing annotation selectors substantially reduce replies, but this
small real-model cohort does **not** establish a consistent reduction in total
input tokens or elapsed task time. No decoder cache or new production preset is
introduced. Complete necessary output stays available through existing explicit
null limits; original defaults remain 50 display lines.
## Immutable corpus and independent questions
The runtime is pinned to `ca7450beffff59325ce3bddc78e181693ce77177`, with Node
24.18.0, SDK 2.3.1 and Linux x86-64. Experiment driver code for model trials is
`23317a58d`; each SDK result separately records workflow/oracle source hashes,
runtime-file and lockfile digests, explicit provider settings and original bytes.
Later integration checks must remain separate from this cohort.
Two official sigrok-dumps recordings are pinned to upstream commit
`0ad13477abc959d37fc9a5acbd23901c371c9c76` in [corpus.json](corpus.json).
Original Git blob IDs, SHA-256, sizes and immutable reference/download URLs are
recorded there. No sample binaries or raw output are committed. The upstream
repository declares dumps public domain unless otherwise noted; the inspected
sample READMEs state no exception. Decoder software licensing is separate.
- MAX3232E UART: 12,742 compressed bytes, 10,000,000 logic bytes, 5,000,000 samples
at the recorded nominal 100 MHz. Stored DOUT1 is bit 1; DIN1 is bit 2. The exact
question requests all RX octets in order, including repetitions. Independent
57,600-baud 8N1 stop-bit sampling with DOUT1 inversion yields 65 bytes: five
copies of `Hello world\r\n`. The source metadata and physical probe numbers
remain distinct from stored bit positions.
- Wii Nunchuk I2C: 20,373 compressed bytes, 20,000,000 samples at nominal 1 MHz.
The source README's physical probes 3/7 are repacked as stored named channels
SCL/SDA at bits 0/1. The question asks every read payload as consecutive
six-byte arrays, excluding address/write bytes and hardware/button inference.
Independent START/STOP, rising-clock, byte and ACK/NACK reading identifies seven
transactions and three read payloads, matching the upstream reference:
`75 7F 77 4F 82 3B`, `75 7F 75 44 82 34`, `75 7F 77 43 83 5D`.
The independent reader accepts the scoped single-device classic-ZIP profile,
checks directory representation before object allocation, bounds compressed and
expanded input to 32 MiB, and limits selected transitions to 65,536. It preserves
source metadata/digest, chunk ordering and channel identity; incomplete samples,
ambiguous names, partial bytes and unsupported transactions fail explicitly.
Receiver rearming follows the verified UART stop sample, accommodating the
recording's slightly faster sender. I2C STOP preparation is distinct from data.
These checks do not establish other formats, decoders, OSes or physical acquisition.
An initial DOUT1 decode without inversion exited successfully but produced wrong
bytes. Its cost/output is retained privately as configuration exploration, outside
eligible measurements. An independent sample oracle prevents equal-but-wrong
producer results from passing. Correct inversion was established before the cohort.
## Actual CLI and SDK evidence
sigrok-cli 0.7.2 reports libsigrok 0.5.2 and libsigrokdecode 0.5.3. Its executable
SHA-256 is `e1b1eb2f25edc17d24a78acbab16ff7e1dfdee74bb2cccb7ad00497ccc7a0c44`.
Selected installed UART/I2C decoder module bytes are fingerprinted privately.
The banner and executable digest do not fingerprint the complete installation;
modules and libraries remain trusted. Both actual CLI and MCP results match raw
sample bytes; data intervals correlate with the independently examined samples.
Fourteen actual SDK workflows comprise two interleaved repetitions per recording
and arm (baseline/focused/discovery), plus first/next/repeated pages. All 22 calls
preserve source bytes and necessary decoded facts. Baseline returns all necessary
annotation output. Focused selects `uart=rx-data` or `i2c=data-read`, with explicit
null line limits because the task needs the entire selected payload. Discovery
first queries the installed decoder help for the already specified class; it does
not establish discovery benefits for unknown protocols.
| Recording | Baseline bytes | Focused bytes | Discovery + focused bytes | First + next + repeat bytes |
| --------- | -------------: | ------------: | ------------------------: | --------------------------: |
| UART | 49,417 | 12,441 | 18,839 | 31,779 |
| I2C | 26,829 | 9,928 | 16,274 | 27,623 |
Focused reply reductions are 74.8% and 63.0%. These are parsed SDK JSON bytes,
not wire bytes or model tokens. Baseline/focused RPC times (ms, repetitions 1/2)
are UART 2010/582 versus 1459/911, and I2C 2851/676 versus 2330/685; n=2,
with order/cold/warm variation, does not establish a general speedup. Pages retain
input/class/window coverage separately, rather than equating display exhaustion
with a complete protocol decode. Repeated first pages match their original text
and scope; reused content-based Evidence identities are valid.
## Complete real-model task costs
Eight actual Codex CLI 0.161.0 tasks requested `gpt-5.6-terra` / `high`, in isolated
profiles using this runtime's REA MCP. Both tools were enabled and preapproved
identically in all arms; shell, browser and extra agents were disabled. The model
alias is a requested identifier, not independently resolved backend identity.
Questions contain no expected payloads. Trial order is baseline 1, focused 1,
focused 2, baseline 2, with UART then I2C in each step.
| Trial | Total input | Cached input | Uncached input (derived) | Output | Seconds | Completed tool calls | Facts / fixed plan |
| --------------- | ----------: | -----------: | -----------------------: | -----: | ------: | -------------------: | ------------------ |
| uart baseline 1 | 92,399 | 49,408 | 42,991 | 1,295 | 86.411 | 1 | passed / passed |
| uart focused 1 | 130,029 | 98,048 | 31,981 | 780 | 49.623 | 1 | passed / passed |
| uart focused 2 | 98,894 | 78,592 | 20,302 | 878 | 73.861 | 1 | passed / passed |
| uart baseline 2 | 90,395 | 48,384 | 42,011 | 926 | 43.974 | 1 | passed / passed |
| i2c baseline 1 | 172,162 | 121,344 | 50,818 | 1,194 | 36.330 | 2 | passed / failed |
| i2c focused 1 | 74,815 | 49,408 | 25,407 | 937 | 114.515 | 1 | passed / passed |
| i2c focused 2 | 74,684 | 48,384 | 26,300 | 668 | 73.877 | 1 | passed / passed |
| i2c baseline 2 | 86,241 | 49,408 | 36,833 | 778 | 41.084 | 1 | passed / passed |
All eight answers match independent raw samples and cite authenticated decoder
observations. I2C baseline 1 also queried generic MCP resources before its single
required decode. The predeclared strict single-call grader marks its plan failed;
its actual 172,162 input tokens and 36.330 seconds remain recorded, separately
from the eligible fixed-plan pairs. It is not retried into a better result.
UART eligible pairs increase total input by 40.7% and 9.4%; elapsed changes are
-42.6% and +68.0%. The one eligible I2C pair reduces total input by 13.4% but
increases elapsed time by 79.8%. Reduced uncached input does not replace total
input as the primary token measure. No reliable whole-task token/time benefit is
established across these two questions; reply projection alone is insufficient.
## Producer, window and resource scope
Eight separately bounded direct producer runs preserve source bytes and render
correct stdout: UART baseline 159/131 ms versus focused 163/130 ms; I2C baseline
355/298 ms versus focused 317/290 ms. This isolates the producer process from REA
RPC, version probing and snapshot work, but startup/decoding/annotation formatting
remain combined. Decoding-only versus formatting-only time is unmeasured.
REA literal-window extraction and JSON encoding were measured separately from
retained producer text (one cold observation and 200 warm iterations per arm).
Warm mean extraction ranges from 0.0040 to 0.1794 ms; JSON encoding from 0.0021 to 0.0121 ms. These exclude file reads, RPC and decoding.
Every page still invokes decoding. Retained output might help repeated inspection,
but this fixed cohort does not demonstrate a completed-task improvement warranting
a new cache. Any future work should own bounded output explicitly by original
Evidence identity and lifetime, with cancellation/cleanup, rather than use a
CLI-digest-only generic cache of an incompletely fingerprinted installation.
Heavy work ran serially under one CPU, 3 GiB early stop / 4 GiB hard memory,
no swap and host-availability checks. Verified payload-exit peak bytes were
SDK 587,513,856; model 889,323,520; direct producer 26,288,128. No OOM/OOM-kill or resource abort occurred in that verified phase; task descendants
were cleaned. Terminal whole-scope counters are unavailable and remain unknown.
## Verification and replay
Eleven independent-oracle regressions and 12 comparator/sample-interval tests pass.
Twenty-four private replays using actual SDK Evidence cover valid answers, failed
calls before/after recovery, wrong bytes, unknown citations and missing limitations.
These are grading checks with injected state, not additional model/provider trials.
The grader retains authenticated observations by identity, rejects conflicts,
combines cited pages in sample order and keeps failed calls/plan deviations separate
from supported facts. Relevant typecheck/lint and pre-push checks pass.
Review hardening ties the oracle to the named corpus digest, bounds each I2C
interval against neighboring byte clocks/transaction STOP, and counts actual
classic-ZIP directory records on the same bounded snapshot before allocating
`ZipFile` objects; ZIP64 is rejected. Forged-count and ZIP64 admission regressions
fail on the original implementation. Replaying all eight original model trials
and 24 injected grading cases with these checks preserves their factual/plan
grades and recorded usage/time; these replays are not new model measurements.
Metadata reads cap inflater output even when ZIP sizes are forged. A streamed
8 MiB malformed metadata member declaring 8 KiB is rejected with traced Python
allocation below 1 MiB; the same regression fails on the preceding implementation.
Compressed snapshots use actual file size plus one growth-detection byte rather
than preallocating the entire admission budget. Both genuine waveform oracles
retain identical bytes, metadata, sample intervals and source digests.
UART interval checks also require coverage of the first and last independently
sampled data-bit centers within the owning frame. Shortened, shifted and
single-sample intervals are rejected even when the decoded byte is correct.
The added oracle coordinates retain the original byte/frame facts; replaying
saved real Evidence and all eight model transcripts preserves the original
grades and costs. This is stronger retrospective verification, not a new cohort.
After rebasing onto main `44d98de2367b99808d78db732ec7d72533266233`,
`npm run build:cached` and the 16 focused comparator/sample-interval/MCP-boundary
tests passed. Two additional real focused MCP workflows independently verified
UART/I2C bytes and intervals on that base. These integration checks are separate
from the original cost cohort and do not replace or extend its measurements.
A subsequent rebase onto main `3b79af28e80785afce9f5998d8f03289402a1847`
passed the 17 focused tests, including the upstream-fixed Hopper doctor case,
and two additional real UART/I2C MCP workflows. Original cohort costs and grades
remain unchanged; these checks verify integration on the updated main only.
Use `measure.mjs --signal-selection baseline|focused|discovery|pages`, preserving
runtime/source fingerprints and explicit provider JSON. Generate the exact task
with `signal-model-prompt.mjs --artifact ID --selection baseline|focused`, run the
isolated `agent-trial.py --mode direct --capture-tool-context`, and grade with
`review-signal.mjs` and the independently produced oracle. Keep original failures,
resources and raw observations private. For migration, existing optional annotation
selection is sufficient for scoped reply reduction; no default/API change follows
from this mixed whole-task result.
@@ -0,0 +1,48 @@
"""Stored-byte semantics and fail-before-allocation admission, not providers."""
import base64
import importlib.util
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
spec = importlib.util.spec_from_file_location('saz_oracle', Path(__file__).with_name('saz-oracle.py'))
oracle = importlib.util.module_from_spec(spec)
spec.loader.exec_module(oracle)
class SazOracleTests(unittest.TestCase):
def test_duplicate_spelling_and_folding_are_source_facts(self):
result = oracle.stored_http(b'HTTP/1.1 200 OK\r\nX-Case: first\r\nx-case:second\r\n continuation\r\n\r\n', False)
self.assertEqual(result['headers'], [{'name': 'X-Case', 'value': ' first'},
{'name': 'x-case', 'value': 'second\r\n continuation'}])
self.assertEqual(result['body']['bytes'], 0)
self.assertEqual(result['body']['text'], '')
def test_body_keeps_encoded_bytes_and_internal_separators(self):
body = b'\x1f\x8b\xff\n\n\r\n\r\n'
result = oracle.stored_http(b'HTTP/1.1 200 OK\r\nContent-Encoding: gzip\r\n\r\n' + body, False)
self.assertEqual(base64.b64decode(result['body']['content_base64']), body)
self.assertIsNone(result['body']['text'])
def test_first_lf_separator_owns_body_with_later_crlf_separator(self):
result = oracle.stored_http(b'GET / HTTP/1.1\nHost: example.com\n\nbody\r\n\r\n', True)
self.assertEqual(result['body']['text'], 'body\r\n\r\n')
def test_malformed_start_and_unowned_continuation_fail(self):
for data in [b'garbage\r\n\r\n', b'HTTP/1.1 200 OK\r\n orphan\r\n\r\n']:
with self.assertRaises(ValueError):
oracle.stored_http(data, False)
def test_wrong_digest_cannot_allocate_zip_objects(self):
with tempfile.TemporaryDirectory() as root:
path = Path(root)/'wrong.saz'
path.write_bytes(b'X'*43515)
with patch.object(oracle.zipfile, 'ZipFile', side_effect=AssertionError('Too late')):
with self.assertRaisesRegex(ValueError, 'pinned SAZ corpus'):
oracle.read_saz('xbox-clear_nomp.saz', path)
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,149 @@
"""Distinct framing, identity and admission failures in the sample-bit oracle."""
import importlib.util
from pathlib import Path
import struct
import tempfile
import tracemalloc
import unittest
from unittest.mock import patch
import zipfile
spec = importlib.util.spec_from_file_location(
'signal_oracle', Path(__file__).with_name('signal-oracle.py'))
oracle = importlib.util.module_from_spec(spec)
spec.loader.exec_module(oracle)
class SignalOracleTests(unittest.TestCase):
def setUp(self):
self.root = tempfile.TemporaryDirectory()
self.addCleanup(self.root.cleanup)
self.path = Path(self.root.name) / 'sample.sr'
def recording(self, data, unit, channels, chunk='logic-1', extra=0):
metadata = '[global]\nsigrok version=0.3.0\n[device 1]\ncapturefile=logic-1\n'
metadata += f'total probes={len(channels)}\nsamplerate=1 MHz\nunitsize={unit}\n'
metadata += ''.join(f'probe{index+1}={name}\n' for index, name in enumerate(channels))
with zipfile.ZipFile(self.path, 'w') as archive:
archive.writestr('version', '2')
archive.writestr('metadata', metadata)
archive.writestr(chunk, data)
for index in range(extra):
archive.writestr(f'extra-{index}', '')
def test_uart_rearms_after_stop_sample_for_a_slightly_faster_sender(self):
levels = [1] * 100
for byte in [0x48, 0x65]:
for bit in [0, *[(byte >> index) & 1 for index in range(8)], 1]:
levels.extend([bit] * 17)
levels.extend([1] * 100)
data = b''.join(struct.pack('<H', (1-level) << 1) for level in levels)
self.recording(data, 2, ['unused', 'MAX3232E DOUT1'])
result = oracle.uart(self.path, True)
self.assertEqual([row['byte'] for row in result['rows']], [0x48, 0x65])
self.assertEqual(result['channels']['MAX3232E DOUT1'], 1)
for row, start in zip(result['rows'], [100, 270]):
self.assertEqual(row['first_data_sample'], start + 26)
self.assertEqual(row['last_data_sample'], start + 147)
def i2c_levels(self, incomplete=False):
states = [(1, 1), (1, 0)]
for byte, ack in [(0xA5, 0), (0x75, 1)]:
values = [(byte >> index) & 1 for index in reversed(range(8))] + [ack]
if incomplete and byte == 0x75:
values = values[:4]
for bit in values:
states.extend([(0, bit), (1, bit)])
states.extend([(0, 0), (1, 0), (1, 1)])
return bytes(clock | data << 1 for clock, data in states)
def test_i2c_stop_setup_is_distinct_from_another_data_byte(self):
self.recording(self.i2c_levels(), 1, ['SCL', 'SDA'])
result = oracle.i2c(self.path)
self.assertEqual(len(result['reads']), 1)
self.assertEqual([row['byte'] for row in result['reads'][0]['bytes']], [0xA5, 0x75])
self.assertFalse(result['reads'][0]['bytes'][-1]['ack'])
def test_incomplete_i2c_byte_is_not_invented_at_stop(self):
self.recording(self.i2c_levels(incomplete=True), 1, ['SCL', 'SDA'])
with self.assertRaisesRegex(ValueError, 'Incomplete I2C byte'):
oracle.i2c(self.path)
def test_channel_names_must_identify_one_stored_bit(self):
self.recording(b'\x00', 1, ['SCL', 'SCL'])
with self.assertRaisesRegex(ValueError, 'ambiguous'):
oracle.read_edges(self.path, ['SCL'])
def test_missing_chunk_is_not_renumbered(self):
self.recording(b'\x00', 1, ['SCL', 'SDA'], chunk='logic-1-2')
with self.assertRaisesRegex(ValueError, 'chunk order'):
oracle.read_edges(self.path, ['SCL', 'SDA'])
def test_partial_sample_word_is_rejected(self):
self.recording(b'\x00', 2, ['unused', 'MAX3232E DOUT1'])
with self.assertRaisesRegex(ValueError, 'incomplete digital samples'):
oracle.read_edges(self.path, ['MAX3232E DOUT1'])
def test_directory_budget_precedes_zip_object_allocation(self):
self.recording(b'\x00', 1, ['SCL', 'SDA'], extra=62)
with patch.object(oracle.zipfile, 'ZipFile', side_effect=AssertionError('Too late')):
with self.assertRaisesRegex(ValueError, 'excessive ZIP directory'):
oracle.read_edges(self.path, ['SCL', 'SDA'])
def test_declared_expansion_is_rejected_before_decompression(self):
self.recording(b'\x00', 1, ['SCL', 'SDA'])
data = bytearray(self.path.read_bytes())
directory = data.index(b'PK\x01\x02')
struct.pack_into('<I', data, directory + 24, 32 * 1024 * 1024 + 1)
self.path.write_bytes(data)
with self.assertRaisesRegex(ValueError, 'Expanded SR input'):
oracle.read_edges(self.path, ['SCL', 'SDA'])
def test_forged_member_count_cannot_allocate_extra_zip_objects(self):
self.recording(b'\x00', 1, ['SCL', 'SDA'], extra=62)
data = bytearray(self.path.read_bytes())
end = data.rfind(b'PK\x05\x06')
struct.pack_into('<2H', data, end + 8, 1, 1)
self.path.write_bytes(data)
with patch.object(oracle.zipfile, 'ZipFile', side_effect=AssertionError('Too late')):
with self.assertRaisesRegex(ValueError, 'actual ZIP directory'):
oracle.read_edges(self.path, ['SCL', 'SDA'])
def test_zip64_locator_cannot_override_the_classic_budget(self):
self.recording(b'\x00', 1, ['SCL', 'SDA'])
data = bytearray(self.path.read_bytes())
end = data.rfind(b'PK\x05\x06')
# Syntactically complete ZIP64 directory/locator before a classic EOCD.
header = struct.unpack_from('<4s4H2IH', data, end)
record = struct.pack('<4sQ2H2I4Q', b'PK\x06\x06', 44, 45, 45, 0, 0,
header[4], header[4], 100000000, header[6])
locator = struct.pack('<4sIQI', b'PK\x06\x07', 0, end, 1)
data[end:end] = record + locator
self.path.write_bytes(data)
with patch.object(oracle.zipfile, 'ZipFile', side_effect=AssertionError('Too late')):
with self.assertRaisesRegex(ValueError, 'ZIP64 directory'):
oracle.read_edges(self.path, ['SCL', 'SDA'])
def test_forged_metadata_size_cannot_expand_past_its_output_budget(self):
# Stream the malformed member so constructing the fixture is bounded.
with zipfile.ZipFile(self.path, 'w', compression=zipfile.ZIP_DEFLATED) as archive:
with archive.open('metadata', 'w') as member:
for _ in range(128):
member.write(b'X' * 65536)
data = bytearray(self.path.read_bytes())
directory = data.index(b'PK\x01\x02')
struct.pack_into('<I', data, directory + 24, 8192)
self.path.write_bytes(data)
tracemalloc.start()
try:
with self.assertRaises(zipfile.BadZipFile):
oracle.read_edges(self.path, ['SCL', 'SDA'])
_, peak = tracemalloc.get_traced_memory()
finally:
tracemalloc.stop()
self.assertLess(peak, 1024 * 1024, 'Metadata allocation followed forged ZIP expansion')
if __name__ == '__main__':
unittest.main()
+6 -1
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: 721; runtime: 177.
Locked package entries: 722; runtime: 178.
Full runtime copyright/license/NOTICE texts: npm-runtime-notices.txt.
@algolia/abtesting@1.25.0 | development | MIT
@@ -2740,6 +2740,11 @@ oniguruma-to-es@3.1.1 | development | MIT
Package: https://www.npmjs.com/package/oniguruma-to-es/v/3.1.1
Archive: https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-3.1.1.tgz
Integrity: sha512-bUH8SDvPkH3ho3dvwJwfonjlQ4R80vjyvrU8YpxuROddv55vAEJrTuCuCVUhhsHbtlD9tGGbaNApGQckXhS8iQ==
openpgp@6.3.2 | runtime | LGPL-3.0+
Lockfile path: node_modules/openpgp
Package: https://www.npmjs.com/package/openpgp/v/6.3.2
Archive: https://registry.npmjs.org/openpgp/-/openpgp-6.3.2.tgz
Integrity: sha512-wcZTzHz41LV8Y48zH/JlD1JT8YdNmpWOuMAjQ/podvvCwsjBEU37K3znJh4UQcj3hksE5z9TzvhbUbwzsGvlLQ==
oxc-parser@0.150.0 | development | MIT
Lockfile path: node_modules/oxc-parser
Package: https://www.npmjs.com/package/oxc-parser/v/0.150.0
+175 -1
View File
@@ -1,7 +1,7 @@
REA third-party npm runtime copyright, license and NOTICE texts
Collected from integrity-verified locked npm archives. Release-specific supplements and upstream notice gaps are identified in their entries.
External engines are separately obtained; see THIRD_PARTY_NOTICES.md.
Runtime dependency fingerprint (SHA-256): 49b181923ab240c68c64d35ecdd8f93cb5cd516c765f2282d0e0eca0bcadd13e
Runtime dependency fingerprint (SHA-256): 131100b2e1e6ad5e55b10a0baf4be2d7a0838fd724fb307b9bafd73446b0d3ec
===== @babel/helper-string-parser@8.0.6 =====
Declared license: MIT
@@ -5171,6 +5171,180 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
===== openpgp@6.3.2 =====
Declared license: LGPL-3.0+
Archive: https://registry.npmjs.org/openpgp/-/openpgp-6.3.2.tgz
Integrity: sha512-wcZTzHz41LV8Y48zH/JlD1JT8YdNmpWOuMAjQ/podvvCwsjBEU37K3znJh4UQcj3hksE5z9TzvhbUbwzsGvlLQ==
Scope: npm runtime dependency. GPLv3 terms incorporated by this LGPL text are preserved in licenses/GPL-3.0.txt.
--- package/LICENSE ---
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 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 version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
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 that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser 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 as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
===== pako@1.0.11 =====
Declared license: (MIT AND Zlib)
Archive: https://registry.npmjs.org/pako/-/pako-1.0.11.tgz
+36 -6
View File
@@ -26,6 +26,29 @@ its manifest. Release CI builds both, and `prepublishOnly` rejects a missing,
stale, mismatched, or wrong-architecture artifact. A development tarball built
without this lane reports Windows native controls as unavailable.
## Restore the artifact in a source checkout
The source tree omits `native/windows/build/` from Git. To run Windows
provider-backed workflows from a checkout without the MinGW build lane, extract
the two files from the published `rea-agents` tarball whose version exactly
matches the checkout's `package.json` version. Do not use `latest` or copy files
from another REA version; the loader verifies the manifest version, ABI,
architecture, and addon digest before it grants authority.
From the checkout root, replace `<matching-version>` with the `version` in
`package.json`:
```sh
npm pack rea-agents@<matching-version>
tar -xzf rea-agents-<matching-version>.tgz
mkdir -p native/windows/build
cp package/native/windows/build/manifest.json native/windows/build/
cp package/native/windows/build/rea-windows-x64.node native/windows/build/
```
This is a manual recovery step. REA does not fetch or install the artifact
automatically. Alternatively, build it using the Linux/MinGW lane above.
## Boundaries
- Opaque Node objects carry a native type tag, resource kind, and closed state.
@@ -88,7 +111,9 @@ without this lane reports Windows native controls as unavailable.
- Cleanup walks locked directory objects, removes files by handle, and unlinks
reparse entries without traversing their targets. Failed removal retains the
root and ancestor leases for retry; a partially removed runtime accepts only
cleanup, and its registry entry remains until removal succeeds. Normal close, cancellation,
cleanup, and its registry entry remains until removal succeeds. The owned root
handle includes attribute-write access so cleanup can clear a read-only marker,
matching the child cleanup handles. Normal close, cancellation,
startup failure, and timeout release provider resources. Abrupt owner death
kills the owned job. The Android provider additionally uses a detached helper
that owns its private runtime directory and cleans it when the owner pipe
@@ -133,8 +158,11 @@ npm run verify:windows-native
npm run verify:ghidra:windows
```
The native inspection probe retains its directory owner if deletion fails. A
later availability query retries that cleanup before creating another probe;
An unpublished runtime retains its directory and parent handles if validation,
result publication, or rollback fails. Errors retain the original failure and
any rollback failure. Later runtime creation or native inspection retries that
exact owner before allocating another directory. The same owner covers the
native inspection probe. A later availability query retries failed probe cleanup;
successful admission and static artifact failures remain cached. Environment
teardown makes one final cleanup attempt and reports a persistent failure to
stderr rather than claiming the directory was removed.
@@ -151,9 +179,11 @@ On Windows, after compiling the runtime:
node scripts/verify-windows-native-inspection.mjs
```
This artifact injects one access-denied disposition result while using a real
NTFS directory. The verifier checks retained ownership, recovery on a later
query, cached successful admission, and cleanup on environment teardown. It
This artifact injects an access-denied disposition result while using real
NTFS directories, and separately denies post-create validation and rollback.
The verifier checks retained ownership after inspection and direct runtime
creation failures, recovery on later admission, cached successful inspection,
and cleanup on environment teardown. It
renames the retained probe and recreates its old path, checking that cleanup
removes the owned inode while preserving the replacement directory.
It does not reproduce or identify the host-dependent cause reported in #1701.
+35 -15
View File
@@ -60,6 +60,15 @@ napi_value wrap(napi_env env, std::unique_ptr<Resource> value) {
value.release();
return result;
}
void publishRuntimeHandle(napi_env env, napi_value observation, std::unique_ptr<Runtime>& value) {
auto handle = object(env);
check(napi_type_tag_object(env, handle, &RESOURCE_TAG));
// Complete the result before transferring cleanup ownership. Any earlier
// N-API failure leaves the unpublished runtime in its environment owner.
set(env, observation, "handle", handle);
check(napi_wrap(env, handle, value.get(), finalize, nullptr, nullptr));
value.release();
}
Resource& resource(napi_env env, napi_value value, Kind kind) {
bool tagged = false;
check(napi_check_object_type_tag(env, value, &RESOURCE_TAG, &tagged));
@@ -77,8 +86,15 @@ napi_value failureValue(napi_env env, const Failure& failure) {
std::wstring detail = message == nullptr ? L"" : message;
if (message != nullptr) LocalFree(message);
const std::wstring constraint(failure.constraint.begin(), failure.constraint.end());
auto text = string(env, constraint + (failure.path.empty() ? L"" : L" [" + failure.path + L"]") +
L" (Win32 " + std::to_wstring(failure.win32) + L"): " + detail);
std::wstring renderedMessage = constraint + (failure.path.empty() ? L"" : L" [" + failure.path + L"]") +
L" (Win32 " + std::to_wstring(failure.win32) + L"): " + detail;
if (!failure.cleanupConstraint.empty()) {
const std::wstring cleanup(failure.cleanupConstraint.begin(), failure.cleanupConstraint.end());
renderedMessage += L"; cleanup also failed: " + cleanup +
(failure.cleanupPath.empty() ? L"" : L" [" + failure.cleanupPath + L"]") +
L" (Win32 " + std::to_wstring(failure.cleanupWin32) + L")";
}
auto text = string(env, renderedMessage);
napi_value error; napi_create_error(env, nullptr, text, &error);
const char* code = failure.win32 == ERROR_FILE_NOT_FOUND || failure.win32 == ERROR_PATH_NOT_FOUND ? "ENOENT"
: failure.win32 == ERROR_ACCESS_DENIED ? "EACCES" : "ERR_REA_WINDOWS_NATIVE";
@@ -87,21 +103,24 @@ 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.cleanupConstraint.empty()) {
set(env, error, "cleanupConstraint", string(env, failure.cleanupConstraint));
set(env, error, "cleanupRequestedPath", string(env, failure.cleanupPath));
set(env, error, "cleanupWin32Code", number(env, failure.cleanupWin32));
}
if (failure.runtimeDirectoryUnallocated)
set(env, error, "runtimeAllocation", string(env, std::string("not-started")));
return error;
}
struct InspectionContext { std::unique_ptr<Runtime> probe; };
static void cleanupInspection(void* data) noexcept {
std::unique_ptr<InspectionContext> context(static_cast<InspectionContext*>(data));
if (!context->probe) return;
try { closeRuntime(*context->probe); }
static void cleanupRuntimeContext(void* data) noexcept {
std::unique_ptr<RuntimeContext> context(static_cast<RuntimeContext*>(data));
if (!context->pending) return;
try { closeRuntime(*context->pending); }
catch (const Failure& failure) {
// Environment teardown cannot retain an owner or return an error. Report
// terminal cleanup failure instead of claiming the directory was removed.
std::fprintf(stderr, "REA Windows probe cleanup failed (Win32 %lu) path=\"",
std::fprintf(stderr, "REA Windows runtime cleanup failed (Win32 %lu) path=\"",
static_cast<unsigned long>(failure.win32));
// Emit reversible UTF-16 escapes without allocation or CRT locale conversion.
for (wchar_t unit : failure.path) {
@@ -112,10 +131,10 @@ static void cleanupInspection(void* data) noexcept {
std::fprintf(stderr, "\"\n");
}
catch (const std::exception& failure) {
std::fprintf(stderr, "REA Windows probe cleanup failed: %s\n", failure.what());
std::fprintf(stderr, "REA Windows runtime cleanup failed: %s\n", failure.what());
}
catch (...) {
std::fprintf(stderr, "REA Windows probe cleanup failed: unknown native exception\n");
std::fprintf(stderr, "REA Windows runtime cleanup failed: unknown native exception\n");
}
}
@@ -128,12 +147,13 @@ static napi_value call(napi_env env, napi_callback_info info) {
require(count == 2, "Native call requires operation and arguments", L"", ERROR_INVALID_PARAMETER);
const auto operation = wide(env, args[0]);
const auto values = array(env, args[1]);
auto& context = *static_cast<RuntimeContext*>(data);
if (operation == L"inspect") {
require(values.empty(), "Inspect takes no arguments", L"", ERROR_INVALID_PARAMETER);
return inspect(env, static_cast<InspectionContext*>(data)->probe);
return inspect(env, context.pending);
}
if (operation.rfind(L"process_", 0) == 0) return processCall(env, operation, values);
return filesystemCall(env, operation, values);
return filesystemCall(env, operation, values, context);
} catch (const Failure& failure) {
auto error = failureValue(env, failure);
napi_throw(env, error);
@@ -145,8 +165,8 @@ static napi_value call(napi_env env, napi_callback_info info) {
}
static napi_value initialize(napi_env env, napi_value exports) {
auto context = std::make_unique<InspectionContext>();
if (napi_add_env_cleanup_hook(env, cleanupInspection, context.get()) != napi_ok) return nullptr;
auto context = std::make_unique<RuntimeContext>();
if (napi_add_env_cleanup_hook(env, cleanupRuntimeContext, context.get()) != napi_ok) return nullptr;
// The environment owns callback data before a function can expose it. Failed
// initialization still leaves a valid context for the registered cleanup hook.
auto* data = context.release();
+12 -3
View File
@@ -33,6 +33,9 @@ struct Failure : std::runtime_error {
DWORD win32;
std::wstring path;
std::string constraint;
std::string cleanupConstraint;
DWORD cleanupWin32 = ERROR_SUCCESS;
std::wstring cleanupPath;
// 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())
@@ -96,6 +99,9 @@ struct Runtime : Resource {
std::atomic_bool snapshotCancelled{false};
Runtime() : Resource(Kind::Runtime) {}
};
// A failed, not-yet-published runtime remains owned by its N-API environment
// until a later admission or environment teardown can retry cleanup by handle.
struct RuntimeContext { std::unique_ptr<Runtime> pending; };
struct Process : Resource {
Handle job, process, stdoutRead, stderrRead, stdinWrite;
// Present only for a job with a commit limit; receives the job's notifications.
@@ -120,21 +126,24 @@ std::wstring wide(napi_env env, napi_value value);
double numeric(napi_env env, napi_value value);
std::vector<napi_value> array(napi_env env, napi_value value);
napi_value wrap(napi_env env, std::unique_ptr<Resource> resource);
void publishRuntimeHandle(napi_env env, napi_value observation, std::unique_ptr<Runtime>& runtime);
Resource& resource(napi_env env, napi_value value, Kind kind);
std::unique_ptr<File> openFile(const std::wstring& path, DWORD access = GENERIC_READ,
bool directory = false,
DWORD finalSharing = FILE_SHARE_READ);
napi_value identity(napi_env env, HANDLE handle, const std::wstring& path);
std::unique_ptr<Runtime> createRuntime(const std::wstring& parent, const std::wstring& prefix);
void createRuntime(const std::wstring& parent, const std::wstring& prefix,
std::unique_ptr<Runtime>& owner);
void cleanupFailedRuntime(std::unique_ptr<Runtime>& owner, Failure& primary);
void closeRuntime(Runtime& runtime);
napi_value filesystemCall(napi_env env, const std::wstring& operation,
const std::vector<napi_value>& args);
const std::vector<napi_value>& args, RuntimeContext& context);
std::unique_ptr<Process> spawnProcess(const std::wstring& command, const std::wstring& commandLine,
const std::wstring& cwd, const std::vector<std::wstring>& environment,
bool protocolStdin = false, ULONGLONG memoryLimit = 0);
napi_value processCall(napi_env env, const std::wstring& operation,
const std::vector<napi_value>& args);
napi_value inspect(napi_env env, std::unique_ptr<Runtime>& probe);
napi_value inspect(napi_env env, std::unique_ptr<Runtime>& pending);
} // namespace rea
+69 -21
View File
@@ -67,7 +67,10 @@ std::unique_ptr<File> openFile(const std::wstring& requested, DWORD access, bool
result->requestedPath = requested;
const auto& path = result->path;
require(directory || path.size() > 3, "Target is not a regular file", requested, ERROR_DIRECTORY);
result->handles.push_back(openComponent(path.substr(0, 3), 0, true));
// The volume root cannot be replaced or deleted. Match the later root
// reopen's write sharing here so a root writer cannot block admission.
result->handles.push_back(openComponent(path.substr(0, 3), 0, true,
FILE_SHARE_READ | FILE_SHARE_WRITE));
wchar_t filesystem[64]{};
DWORD flags = 0;
require(GetVolumeInformationByHandleW(result->handles.front().get(), nullptr, 0, nullptr, nullptr,
@@ -181,6 +184,29 @@ static Handle createRelative(HANDLE parent, const std::wstring& name, DWORD acce
return result;
}
void cleanupFailedRuntime(std::unique_ptr<Runtime>& owner, Failure& primary) {
if (!owner || !owner->directory.valid()) {
owner.reset();
return;
}
try {
closeRuntime(*owner);
owner.reset();
} catch (const Failure& cleanup) {
primary.cleanupConstraint = cleanup.constraint;
primary.cleanupWin32 = cleanup.win32;
primary.cleanupPath = cleanup.path;
} catch (const std::exception& cleanup) {
primary.cleanupConstraint = cleanup.what();
primary.cleanupWin32 = ERROR_GEN_FAILURE;
primary.cleanupPath = owner->path;
} catch (...) {
primary.cleanupConstraint = "Unknown runtime cleanup failure";
primary.cleanupWin32 = ERROR_GEN_FAILURE;
primary.cleanupPath = owner->path;
}
}
// Lookup relative to an already-owned directory; path is diagnostic only.
static Handle openRelative(HANDLE parent, const std::wstring& name, DWORD access,
DWORD sharing, ULONG kind, const std::wstring& path) {
@@ -334,7 +360,11 @@ static napi_value readCutterBridgeDescriptor(napi_env env, const std::vector<nap
return result;
}
std::unique_ptr<Runtime> createRuntime(const std::wstring& parentPath, const std::wstring& prefix) {
void createRuntime(const std::wstring& parentPath, const std::wstring& prefix,
std::unique_ptr<Runtime>& owner) {
// A previous failed admission retains the original root handle. Retry that
// owner before allowing this environment to allocate another runtime.
if (owner) { closeRuntime(*owner); owner.reset(); }
std::unique_ptr<File> parent;
try { parent = openFile(parentPath, 0, true); }
catch (Failure& failure) {
@@ -346,24 +376,29 @@ std::unique_ptr<Runtime> createRuntime(const std::wstring& parentPath, const std
std::array<unsigned char, 16> random;
require(BCryptGenRandom(nullptr, random.data(), random.size(), BCRYPT_USE_SYSTEM_PREFERRED_RNG) == 0,
"Generate runtime identity failed", parentPath, ERROR_GEN_FAILURE);
Security security;
auto result = std::make_unique<Runtime>();
const auto name = prefix + hex(random.data(), random.size());
result->path = parent->path + (parent->path.back() == L'\\' ? L"" : L"\\") + name;
Security security;
result->directory = createRelative(parent->get(), name,
DELETE | FILE_LIST_DIRECTORY | FILE_READ_ATTRIBUTES | READ_CONTROL,
true, security, result->path);
result->parents = std::move(parent->handles);
owner = std::move(result);
try {
verifyPrivate(result->directory.get(), result->path, true);
// The owned child pins the parent nonempty before write sharing is relaxed.
parent->handles.back() = openComponent(parent->path, 0, true, FILE_SHARE_READ | FILE_SHARE_WRITE);
result->parents = std::move(parent->handles);
} catch (...) {
FILE_DISPOSITION_INFO deletion{TRUE};
SetFileInformationByHandle(result->directory.get(), FileDispositionInfo, &deletion, sizeof(deletion));
owner->directory = createRelative(owner->parents.back().get(), name,
DELETE | FILE_LIST_DIRECTORY | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | READ_CONTROL,
true, security, owner->path);
// FILE_CREATE proves ownership and pins the parent nonempty independently
// of admission validation. A failed validation must not retain a strict
// parent lease that prevents renaming the still-owned child before retry.
owner->parents.back() = openComponent(parent->path, 0, true, FILE_SHARE_READ | FILE_SHARE_WRITE);
verifyPrivate(owner->directory.get(), owner->path, true);
} catch (Failure& primary) {
cleanupFailedRuntime(owner, primary);
throw;
} catch (const std::exception& error) {
Failure primary(error.what(), owner->path, ERROR_GEN_FAILURE);
cleanupFailedRuntime(owner, primary);
throw primary;
}
return result;
}
static std::wstring relativePath(Runtime& root, const std::wstring& relative) {
@@ -438,6 +473,9 @@ static void dispose(HANDLE handle, const std::wstring& path) {
require(GetFileInformationByHandleEx(handle, FileBasicInfo, &info, sizeof(info)), "Read cleanup attributes failed", path);
if ((info.FileAttributes & FILE_ATTRIBUTE_READONLY) != 0) {
info.FileAttributes &= ~FILE_ATTRIBUTE_READONLY;
// Zero means "leave attributes unchanged" to FileBasicInfo. A file whose
// sole attribute was READONLY needs NORMAL to actually clear that marker.
if (info.FileAttributes == 0) info.FileAttributes = FILE_ATTRIBUTE_NORMAL;
require(SetFileInformationByHandle(handle, FileBasicInfo, &info, sizeof(info)), "Clear owned readonly attribute failed", path);
}
FILE_DISPOSITION_INFO deletion{TRUE};
@@ -654,7 +692,8 @@ static napi_value snapshot(napi_env env, napi_value rootValue, Runtime& root,
return promise;
}
napi_value filesystemCall(napi_env env, const std::wstring& operation, const std::vector<napi_value>& args) {
napi_value filesystemCall(napi_env env, const std::wstring& operation,
const std::vector<napi_value>& args, RuntimeContext& context) {
if (operation == L"cutter_bridge_verify_directory") return verifyCutterBridgeDirectory(env, args);
if (operation == L"cutter_bridge_read_descriptor") return readCutterBridgeDescriptor(env, args);
const auto expected = operation == L"open" || operation == L"close" || operation == L"runtime_close" || operation == L"runtime_snapshot_cancel" ? 1
@@ -688,12 +727,21 @@ napi_value filesystemCall(napi_env env, const std::wstring& operation, const std
return result;
}
if (operation == L"runtime_create") {
auto root = createRuntime(wide(env, args[0]), wide(env, args[1]));
auto result = identity(env, root->directory.get(), root->path);
set(env, result, "path", string(env, root->path));
set(env, result, "privateDacl", boolean(env, true));
set(env, result, "handle", wrap(env, std::move(root)));
return result;
createRuntime(wide(env, args[0]), wide(env, args[1]), context.pending);
try {
auto result = identity(env, context.pending->directory.get(), context.pending->path);
set(env, result, "path", string(env, context.pending->path));
set(env, result, "privateDacl", boolean(env, true));
publishRuntimeHandle(env, result, context.pending);
return result;
} catch (Failure& primary) {
cleanupFailedRuntime(context.pending, primary);
throw;
} catch (const std::exception& error) {
Failure primary(error.what(), context.pending ? context.pending->path : L"", ERROR_GEN_FAILURE);
cleanupFailedRuntime(context.pending, primary);
throw primary;
}
}
auto& root = static_cast<Runtime&>(resource(env, args[0], Kind::Runtime));
require(!root.closing || operation == L"runtime_close", "Runtime cleanup is pending", root.path, ERROR_BUSY);
+16 -6
View File
@@ -454,17 +454,27 @@ napi_value processCall(napi_env env, const std::wstring& operation, const std::v
throw Failure("Unknown native process operation", L"", ERROR_INVALID_PARAMETER);
}
napi_value inspect(napi_env env, std::unique_ptr<Runtime>& probe) {
napi_value inspect(napi_env env, std::unique_ptr<Runtime>& pending) {
// Settle the previous owner before admitting another probe. Failed cleanup
// retains its handles, including when identity construction itself failed.
if (probe) { closeRuntime(*probe); probe.reset(); }
if (pending) { closeRuntime(*pending); pending.reset(); }
wchar_t temp[32768];
const auto length = GetTempPathW(32768, temp);
require(length > 0 && length < 32768, "Read temporary directory coordinate failed");
probe = createRuntime(std::wstring(temp, length), L"rea-native-probe-");
auto filesystem = identity(env, probe->directory.get(), probe->path);
closeRuntime(*probe);
probe.reset();
createRuntime(std::wstring(temp, length), L"rea-native-probe-", pending);
napi_value filesystem;
try {
filesystem = identity(env, pending->directory.get(), pending->path);
} catch (Failure& primary) {
cleanupFailedRuntime(pending, primary);
throw;
} catch (const std::exception& error) {
Failure primary(error.what(), pending ? pending->path : L"", ERROR_GEN_FAILURE);
cleanupFailedRuntime(pending, primary);
throw primary;
}
closeRuntime(*pending);
pending.reset();
auto job = createJob();
Attributes attributes(1);
HANDLE raw = job.get();
+21 -2
View File
@@ -1,12 +1,12 @@
{
"name": "rea-agents",
"version": "6.4.0",
"version": "6.5.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "rea-agents",
"version": "6.4.0",
"version": "6.5.0",
"license": "MIT",
"dependencies": {
"@babel/parser": "8.0.4",
@@ -34,6 +34,7 @@
"isomorphic-git": "1.38.7",
"jsonc-parser": "3.3.1",
"lossless-json": "4.3.1",
"openpgp": "6.3.2",
"parse5": "8.0.1",
"pino": "10.4.0",
"playwright-core": "1.58.2",
@@ -7871,6 +7872,24 @@
"regex-recursion": "^6.0.2"
}
},
"node_modules/openpgp": {
"version": "6.3.2",
"resolved": "https://registry.npmjs.org/openpgp/-/openpgp-6.3.2.tgz",
"integrity": "sha512-wcZTzHz41LV8Y48zH/JlD1JT8YdNmpWOuMAjQ/podvvCwsjBEU37K3znJh4UQcj3hksE5z9TzvhbUbwzsGvlLQ==",
"license": "LGPL-3.0+",
"engines": {
"node": ">= 18.0.0",
"typescript": ">= 5.0.0"
},
"peerDependencies": {
"@openpgp/web-stream-tools": "~0.3.0"
},
"peerDependenciesMeta": {
"@openpgp/web-stream-tools": {
"optional": true
}
}
},
"node_modules/oxc-parser": {
"version": "0.150.0",
"resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.150.0.tgz",
+2 -1
View File
@@ -1,7 +1,7 @@
{
"name": "rea-agents",
"mcpName": "io.github.morluto/rea",
"version": "6.4.0",
"version": "6.5.0",
"description": "Reverse engineer anything from your terminal or agent with one CLI and MCP server.",
"license": "MIT",
"repository": {
@@ -337,6 +337,7 @@
"isomorphic-git": "1.38.7",
"jsonc-parser": "3.3.1",
"lossless-json": "4.3.1",
"openpgp": "6.3.2",
"parse5": "8.0.1",
"pino": "10.4.0",
"playwright-core": "1.58.2",
+27
View File
@@ -0,0 +1,27 @@
export type NpmReleaseState =
| { status: "absent" }
| {
status: "published";
integrity: string;
tag: "latest" | "next";
taggedVersion: string | null;
stableVersion: string | null;
};
export function readNpmRelease(
version: string,
request?: (url: string, init: RequestInit) => Promise<Response>,
): Promise<NpmReleaseState>;
export function requireMatchingNpmRelease(
tarball: string,
version: string,
published: NpmReleaseState,
): Promise<void>;
export function stableUpdateVersion(
version: string,
published: NpmReleaseState,
): string;
export function waitForNpmRelease(
version: string,
lookup?: (version: string) => Promise<NpmReleaseState>,
pause?: (milliseconds: number) => Promise<unknown>,
): Promise<Extract<NpmReleaseState, { status: "published" }>>;
+126
View File
@@ -0,0 +1,126 @@
import { appendFile } from "node:fs/promises";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { setTimeout } from "node:timers/promises";
import { z } from "zod";
import { prerelease, valid } from "semver";
import { releaseNpmTag } from "../release-npm-tag.mjs";
import { verifyPublishedPackageIntegrity } from "./verified-package.mjs";
/** Parse one npm metadata snapshot; errors and malformed records are never absence. */
export async function readNpmRelease(version, request = fetch) {
const tag = releaseNpmTag(version);
const response = await request("https://registry.npmjs.org/rea-agents", {
headers: {
Accept: "application/vnd.npm.install-v1+json",
"Cache-Control": "no-cache",
},
signal: AbortSignal.timeout(30_000),
});
if (response.status === 404) return { status: "absent" };
if (!response.ok)
throw new Error(`npm registry lookup failed: HTTP ${response.status}`);
const metadata = z
.object({
name: z.literal("rea-agents"),
versions: z.record(z.string(), z.unknown()),
"dist-tags": z.record(z.string(), z.string()),
})
.parse(await response.json());
if (!Object.hasOwn(metadata.versions, version)) return { status: "absent" };
const published = z
.object({
name: z.literal("rea-agents"),
version: z.literal(version),
dist: z.object({ integrity: z.string().min(1) }),
})
.parse(metadata.versions[version]);
return {
status: "published",
integrity: published.dist.integrity,
tag,
taggedVersion: metadata["dist-tags"][tag] ?? null,
stableVersion: metadata["dist-tags"].latest ?? null,
};
}
/** REA update follows stable latest even when the candidate is published on next. */
export function stableUpdateVersion(version, published) {
if (published.status !== "published" || published.taggedVersion !== version)
throw new Error(`npm does not select ${version} on its release channel`);
const stable = published.stableVersion;
if (
typeof stable !== "string" ||
valid(stable) !== stable ||
prerelease(stable) !== null
)
throw new Error(
"npm latest does not select a stable release for the update canary",
);
return stable;
}
/** Validate content before accepting a previously published or newly visible version. */
export async function requireMatchingNpmRelease(tarball, version, published) {
if (published.status !== "published")
throw new Error(`rea-agents@${version} is not published`);
await verifyPublishedPackageIntegrity(tarball, published.integrity);
if (published.taggedVersion !== version)
throw new Error(
`Expected npm ${published.tag} to select ${version}, observed ${published.taggedVersion ?? "missing"}; refusing to change an existing dist-tag`,
);
}
/** Retry only confirmed absence during the existing registry propagation window. */
export async function waitForNpmRelease(
version,
lookup = readNpmRelease,
pause = setTimeout,
) {
const attempts = 120;
for (let attempt = 1; attempt <= attempts; attempt++) {
const published = await lookup(version);
if (published.status === "published") return published;
if (attempt < attempts) await pause(15_000);
}
throw new Error(
`rea-agents@${version} was not visible on npm after 120 attempts over 30 minutes`,
);
}
async function main() {
const [operation, tarball, version, ...extra] = process.argv.slice(2);
if (
!["inspect", "verify"].includes(operation) ||
tarball === undefined ||
version === undefined ||
extra.length
)
throw new Error(
"Usage: node scripts/ci/npm-release.mjs inspect|verify <qualified-tarball> <version>",
);
const published =
operation === "inspect"
? await readNpmRelease(version)
: await waitForNpmRelease(version);
if (published.status === "published")
await requireMatchingNpmRelease(tarball, version, published);
if (operation === "inspect") {
await appendFile(
z.string().min(1).parse(process.env.GITHUB_OUTPUT),
`published=${published.status === "published"}\n`,
);
} else if (process.env.GITHUB_STEP_SUMMARY !== undefined) {
await appendFile(
process.env.GITHUB_STEP_SUMMARY,
`npm: rea-agents@${version} is published, matches the qualified tarball, and is selected by ${published.tag}.\n`,
);
}
process.stdout.write(`${JSON.stringify({ version, ...published })}\n`);
}
if (
process.argv[1] !== undefined &&
resolve(process.argv[1]) === fileURLToPath(import.meta.url)
)
await main();
+2
View File
@@ -13,9 +13,11 @@ const GUARDED_WORKFLOWS = new Set([
".github/workflows/pr-readiness.yml",
".github/workflows/ci-full-pr.yml",
".github/workflows/release.yml",
".github/workflows/release-recovery.yml",
".github/workflows/real-ghidra-windows.yml",
".github/workflows/sqlite-runtime.yml",
".github/workflows/ci-timings.yml",
".github/workflows/mutation.yml",
]);
// Sources compiled by build-conformance-fixtures.mjs. The readiness journey
// analyzes the built C fixture as well as its own applications.
+28
View File
@@ -0,0 +1,28 @@
export function selectRecoveryRelease(input: {
repository: string;
version: string;
run: unknown;
jobs: unknown;
release: unknown;
tagSha: string;
}): {
version: string;
source_sha: string;
run_id: number;
run_attempt: number;
};
export function verifyRecoveryPackage(input: {
directory: string;
sourceSha: string;
runId: number;
runAttempt: number;
version: string;
integrity: string;
}): Promise<{
version: string;
sourceSha: string;
runId: number;
runAttempt: number;
integrity: string;
}>;
+222
View File
@@ -0,0 +1,222 @@
import { execFile } from "node:child_process";
import { appendFile, readFile } from "node:fs/promises";
import { join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { promisify } from "node:util";
import { valid } from "semver";
import { z } from "zod";
import {
validateVerifiedPackage,
verifyPublishedPackageIntegrity,
} from "./verified-package.mjs";
const execute = promisify(execFile);
const sha = z.string().regex(/^[a-f0-9]{40}$/u);
const positive = z.coerce
.number()
.int()
.positive()
.max(Number.MAX_SAFE_INTEGER);
const versionSchema = z
.string()
.refine(
(value) => valid(value) === value && !value.includes("+"),
"Expected an exact release version without build metadata",
);
const repositorySchema = z.string().regex(/^[\w.-]+\/[\w.-]+$/u);
/** Require the original release's successful qualification and npm write. */
export function selectRecoveryRelease({
repository,
version,
run,
jobs,
release,
tagSha,
}) {
repositorySchema.parse(repository);
versionSchema.parse(version);
sha.parse(tagSha);
const original = z
.object({
id: positive,
run_attempt: positive,
path: z.literal(".github/workflows/release.yml"),
event: z.literal("pull_request"),
status: z.literal("completed"),
repository: z.object({ full_name: z.literal(repository) }),
head_repository: z.object({ full_name: z.literal(repository) }),
})
.parse(run);
z.object({
tag_name: z.literal(`rea-agents-${version}`),
draft: z.literal(false),
published_at: z.string().min(1),
}).parse(release);
const parsedJobs = z
.array(
z.object({
name: z.string(),
status: z.string(),
conclusion: z.string().nullable(),
steps: z
.array(
z.object({ name: z.string(), conclusion: z.string().nullable() }),
)
.default([]),
}),
)
.parse(jobs);
const requireJob = (name) => {
const matches = parsedJobs.filter((job) => job.name === name);
if (matches.length !== 1 || matches[0].status !== "completed")
throw new Error(`Expected one completed original job: ${name}`);
return matches[0];
};
for (const name of [
"Release reviewed main merge",
"Qualify exact release revision / CI required",
])
if (requireJob(name).conclusion !== "success")
throw new Error(`Original release did not pass ${name}`);
const publish = requireJob("Publish to npm");
const writes = publish.steps.filter((step) => step.name === "Publish");
const verified = publish.steps.filter(
(step) => step.name === "Verify published npm bytes and dist-tag",
);
if (
!(
(writes.length === 1 && writes[0].conclusion === "success") ||
(verified.length === 1 && verified[0].conclusion === "success")
)
)
throw new Error(
"Original npm publication did not succeed or verify existing bytes",
);
return {
version,
source_sha: tagSha,
run_id: original.id,
run_attempt: original.run_attempt,
};
}
/** Bind existing npm bytes to the original qualified archive, without rebuilding it. */
export async function verifyRecoveryPackage({
directory,
sourceSha,
runId,
runAttempt,
version,
integrity,
}) {
const tarball = await validateVerifiedPackage({
directory,
sourceSha,
runId,
runAttempt,
packageVersion: version,
nodeVersion: process.version,
});
await verifyPublishedPackageIntegrity(tarball, integrity);
return { version, sourceSha, runId, runAttempt, integrity };
}
async function command(program, args, cwd) {
return (
await execute(program, args, { cwd, maxBuffer: 16 * 1024 * 1024 })
).stdout.trim();
}
async function main() {
const [operation, ...extra] = process.argv.slice(2);
if (extra.length || !["resolve", "verify"].includes(operation))
throw new Error(
"Usage: node scripts/ci/release-recovery.mjs resolve|verify",
);
const version = versionSchema.parse(process.env.RECOVERY_VERSION);
const runId = positive.parse(process.env.RECOVERY_RUN_ID);
if (operation === "resolve") {
if (process.env.GITHUB_REF !== "refs/heads/main")
throw new Error("Run release recovery from main");
const repository = repositorySchema.parse(process.env.GITHUB_REPOSITORY);
const api = async (path) =>
JSON.parse(await command("gh", ["api", `repos/${repository}/${path}`]));
const run = await api(`actions/runs/${runId}`);
const pages = z
.array(z.object({ jobs: z.array(z.unknown()) }))
.parse(
JSON.parse(
await command("gh", [
"api",
"--paginate",
"--slurp",
`repos/${repository}/actions/runs/${runId}/attempts/${positive.parse(run.run_attempt)}/jobs?per_page=100`,
]),
),
);
const release = await api(`releases/tags/rea-agents-${version}`);
const tagSha = await command("git", [
"rev-parse",
"--verify",
`refs/tags/rea-agents-${version}^{commit}`,
]);
const selection = selectRecoveryRelease({
repository,
version,
run,
jobs: pages.flatMap((page) => page.jobs),
release,
tagSha,
});
await appendFile(
z.string().min(1).parse(process.env.GITHUB_OUTPUT),
Object.entries(selection)
.map(([key, value]) => `${key}=${value}\n`)
.join(""),
);
process.stdout.write(`${JSON.stringify(selection)}\n`);
return;
}
const sourceDirectory = z
.string()
.min(1)
.parse(process.env.RECOVERY_SOURCE_DIRECTORY);
const sourceSha = sha.parse(process.env.RECOVERY_SOURCE_SHA);
if (
(await command("git", ["rev-parse", "HEAD"], sourceDirectory)) !== sourceSha
)
throw new Error("Recovery checkout differs from the released source");
z.object({ version: z.literal(version) }).parse(
JSON.parse(await readFile(join(sourceDirectory, "package.json"), "utf8")),
);
const integrity = z
.string()
.parse(
JSON.parse(
await command("npm", [
"view",
`rea-agents@${version}`,
"dist.integrity",
"--json",
"--registry=https://registry.npmjs.org",
]),
),
);
const result = await verifyRecoveryPackage({
directory: z.string().min(1).parse(process.env.RECOVERY_ARTIFACT_DIRECTORY),
sourceSha,
runId,
runAttempt: positive.parse(process.env.RECOVERY_RUN_ATTEMPT),
version,
integrity,
});
process.stdout.write(`${JSON.stringify(result)}\n`);
}
if (
process.argv[1] !== undefined &&
resolve(process.argv[1]) === fileURLToPath(import.meta.url)
)
await main();
+16
View File
@@ -3,6 +3,7 @@
// every workflow.
export const SCOPES = {
reverse_tools: [
".github/workflows/mutation.yml",
"src/application/reverse/**",
"src/application/binary/BinarySession.ts",
"src/cutter/**",
@@ -23,6 +24,7 @@ export const SCOPES = {
"tests/composition/analysis-sessions/binarySession.test.ts",
"tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts",
"tests/boundary/filesystem/reverseToolsMutationConfig.test.ts",
"tests/boundary/filesystem/mutationWorkflow.test.ts",
"src/server/registerRizinDebugTools.ts",
"tests/boundary/providers/CutterBridge*.test.ts",
"tests/boundary/providers/cutterBridgeProducer.test.ts",
@@ -88,6 +90,19 @@ export const SCOPES = {
],
// Four-host installed-package matrix and the Windows curated lane.
package: [
".github/actions/publish-mcp/**",
".github/actions/prepare-release-package/**",
".github/workflows/release-recovery.yml",
"scripts/ci/release-recovery.mjs",
"scripts/ci/verified-package.mjs",
"scripts/ci/npm-release.*",
"scripts/verify-release-artifact.mjs",
"scripts/lib/release-package-canary.mjs",
"scripts/verify-published-package.mjs",
"tests/boundary/filesystem/releaseRecovery.test.ts",
"tests/boundary/filesystem/mcpRegistryPublication.test.ts",
"tests/boundary/filesystem/npmRelease.test.ts",
"tests/boundary/process/releaseArtifactCanary.test.ts",
"src/windows/**",
"native/windows/**",
"src/process/capture/FilesystemSnapshot.ts",
@@ -123,6 +138,7 @@ export const SCOPES = {
"src/domain/javascript/javascriptRuntimeStaticCandidates.ts",
"tests/boundary/filesystem/webScriptManifestPaths.test.ts",
"tests/boundary/process/ProcessEvidence.host.test.ts",
"tests/boundary/process/windowsOutputCapture.test.ts",
"tests/acceptance/webModuleCli.test.ts",
"tests/acceptance/webSourceLocationCli.test.ts",
"tests/boundary/cli/referenceSourceImportStatus.test.ts",
+22 -5
View File
@@ -5,6 +5,7 @@ import { copyFile, readFile, writeFile } from "node:fs/promises";
import { join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { promisify } from "node:util";
import { valid } from "semver";
const MANIFEST_NAME = "manifest.json";
const TARBALL_NAME = "package.tgz";
@@ -78,7 +79,7 @@ export async function retainVerifiedPackage({
}
/** Validate a retained package against the current checkout and workflow attempt. */
async function validateVerifiedPackage({
export async function validateVerifiedPackage({
directory,
sourceSha,
runId,
@@ -155,6 +156,8 @@ function validateManifestShape(manifest) {
])
if (typeof manifest[key] !== "string" || manifest[key].length === 0)
throw new Error(`Verified package manifest has an invalid ${key}`);
if (valid(manifest.packageVersion) !== manifest.packageVersion)
throw new Error("Verified package manifest has an invalid package version");
if (
typeof manifest.sha256 !== "string" ||
!/^[a-f0-9]{64}$/u.test(manifest.sha256)
@@ -173,6 +176,16 @@ async function sha256File(path) {
return hash.digest("hex");
}
/** Require the registry to serve the exact archive selected for publication. */
export async function verifyPublishedPackageIntegrity(tarball, integrity) {
const hash = createHash("sha512");
for await (const chunk of createReadStream(tarball)) hash.update(chunk);
if (integrity !== `sha512-${hash.digest("base64")}`)
throw new Error(
"Published npm integrity differs from the original qualified package",
);
}
async function validateFromCli(directory) {
const sourceSha = process.env.GITHUB_SHA;
const runId = parsePositiveInteger(
@@ -202,10 +215,14 @@ async function validateFromCli(directory) {
throw new Error(
"GITHUB_OUTPUT is required to publish the validated tarball path",
);
await writeFile(process.env.GITHUB_OUTPUT, `tarball=${tarball}\n`, {
encoding: "utf8",
flag: "a",
});
await writeFile(
process.env.GITHUB_OUTPUT,
`tarball=${tarball}\nversion=${packageJson.version}\n`,
{
encoding: "utf8",
flag: "a",
},
);
process.stdout.write(`${tarball}\n`);
}
+51 -1
View File
@@ -75,7 +75,57 @@ for (const architecture of ["x86_64", "x86"]) {
: [0xe8, 0x0b, 0, 0, 0, 0xe8, 0x16, 0, 0, 0, 0x31, 0xc0, 0xc3],
0x200,
);
bytes.set([0xb8, 0x2a, 0, 0, 0, 0xc3], 0x210);
bytes.set(
x86 && !dll
? [0xb8, 0x2a, 0, 0, 0, 0xe8, 0x66, 0, 0, 0, 0xc3]
: [0xb8, 0x2a, 0, 0, 0, 0xc3],
0x210,
);
if (x86 && !dll) {
// A statically analyzed Borland-style SEH registration whose handler
// entry is referenced but is not part of the registering function body.
bytes.set(
[
0x55, // PUSH EBP
0x89,
0xe5, // MOV EBP, ESP
0x68,
0xc0,
0x10,
0x40,
0x00, // PUSH 0x4010c0
0x64,
0xff,
0x35,
0,
0,
0,
0, // PUSH DWORD PTR FS:[0]
0x64,
0x89,
0x25,
0,
0,
0,
0, // MOV DWORD PTR FS:[0], ESP
0x64,
0x8f,
0x05,
0,
0,
0,
0, // POP DWORD PTR FS:[0]
0x83,
0xc4,
0x04, // ADD ESP, 4
0x5d, // POP EBP
0xc3, // RET
],
0x280,
);
bytes.set([0xc3], 0x2c0);
}
if (!dll) {
const dataSection = sectionTable + 40;
+12 -10
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Inspect or activate Hopper's version-pinned demo dialog on a private X display."""
"""Inspect or activate Hopper's authenticated demo dialog on a private X display."""
from __future__ import annotations
@@ -8,6 +8,7 @@ import ctypes
import hashlib
import json
import os
import re
from pathlib import Path
import secrets
import select
@@ -18,12 +19,6 @@ import threading
import time
# Keep this digest aligned with LinuxHopper.ts and rerun real-Hopper verification
# before accepting another vendor build.
SUPPORTED_HOPPER_SHA256 = {
"0294ced141cc373468ee22d8343e7dac41980cb05a937994ca81c9f09afe7ded",
"1339f9e58377442b0c6fcb0dfc3cec20d593cc557408521fad9a00dbc6b8da13",
}
EXPECTED_SCREEN = (1280, 1024)
DIALOG_TITLES = {"Registration", "Registration — Hopper Disassembler"}
HOPPER_WINDOW_TITLE = "Hopper Disassembler"
@@ -121,6 +116,7 @@ def parse_args() -> argparse.Namespace:
parser.add_argument("--probe", action="store_true")
parser.add_argument("--owner-stdin", action="store_true")
parser.add_argument("--hopper")
parser.add_argument("--expected-launcher-sha256")
parser.add_argument("--socket")
parser.add_argument(
"--strategy",
@@ -661,7 +657,11 @@ def run_probe(args: argparse.Namespace) -> dict[str, object]:
def run_launch(args: argparse.Namespace) -> int:
if args.hopper is None or args.socket is None:
if (
args.hopper is None or args.socket is None
or args.expected_launcher_sha256 is None
or re.fullmatch(r"[a-f0-9]{64}", args.expected_launcher_sha256) is None
):
raise AdapterFailure(
INVALID_LAUNCH_COMMAND,
"invalid_launch_command",
@@ -673,7 +673,9 @@ def run_launch(args: argparse.Namespace) -> int:
hopper = Path(args.hopper)
socket = Path(args.socket)
try:
supported = digest(hopper) in SUPPORTED_HOPPER_SHA256
# The parent owns publisher/package interpretation. Recheck its admitted
# launcher bytes immediately before execution, preserving all X11 guards.
supported = digest(hopper) == args.expected_launcher_sha256
except OSError as error:
raise AdapterFailure(
INVALID_LAUNCH_COMMAND,
@@ -684,7 +686,7 @@ def run_launch(args: argparse.Namespace) -> int:
raise AdapterFailure(
UNSUPPORTED_HOPPER_BUILD,
"unsupported_hopper_build",
"unsupported Hopper binary",
"Hopper binary differs from the authenticated release",
)
command = args.command[1:] if args.command[:1] == ["--"] else args.command
if not command or Path(command[0]).resolve() != hopper.resolve():
@@ -4,9 +4,11 @@ import { fileURLToPath } from "node:url";
import { Client } from "@modelcontextprotocol/client";
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
import { CdpCommandRejection } from "../../dist/browser/CdpCommandRejection.js";
import { CdpConnection } from "../../dist/browser/CdpConnection.js";
import { createBrowserScenarioProvider } from "../../dist/composition/browserScenario.js";
import { browserScenarioSchema } from "../../dist/domain/browserScenario.js";
import { AnalysisCancelledError } from "../../dist/domain/analysisErrorCore.js";
import { runScenarioCli } from "./browser-scenario-verifier.mjs";
import { requireMcpEvidenceResult } from "./mcp-verifier-results.mjs";
@@ -24,12 +26,24 @@ const alternate = {
width: 700,
height: 500,
};
const expression = `JSON.stringify({
const environmentExpression = `{
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
locale: Intl.DateTimeFormat().resolvedOptions().locale,
dpr: devicePixelRatio, width: innerWidth, height: innerHeight
}`;
const expression = `JSON.stringify(${environmentExpression})`;
const scenarioSnapshotExpression = `JSON.stringify({
timeOrigin: performance.timeOrigin,
environment: ${environmentExpression},
run: document.body?.dataset.run ?? null
})`;
const isNavigationTransitionRejection = (cause) =>
cause instanceof CdpCommandRejection &&
cause.command === "Runtime.evaluate" &&
cause.code === -32_000 &&
cause.reportedMessage === "Inspected target navigated or closed";
const environmentScenario = ({ endpoint, targetId, origin, values, run }) =>
browserScenarioSchema.parse({
browser: { mode: "connect", cdp_endpoint: endpoint, target_id: targetId },
@@ -146,7 +160,6 @@ export async function verifyScenarioEnvironment(endpoint, targetId, origin) {
endpoint,
targetId,
origin,
readEnvironment,
assertRestored,
});
} finally {
@@ -178,12 +191,7 @@ export async function verifyScenarioEnvironment(endpoint, targetId, origin) {
assertCapture(actionFailure.value);
assert.equal(actionFailure.value.steps.at(-1).status, "failed");
await assertRestored();
await verifyCancelledEnvironment(
provider,
connection,
waiting,
readEnvironment,
);
await verifyCancelledEnvironment(provider, connection, waiting);
await assertRestored();
return {
mocked: false,
@@ -208,7 +216,6 @@ const verifyConcurrentMcpCapture = async ({
endpoint,
targetId,
origin,
readEnvironment,
assertRestored,
}) => {
const firstScenario = environmentScenario({
@@ -241,12 +248,13 @@ const verifyConcurrentMcpCapture = async ({
try {
const first = callTool(firstScenario, firstCancellation.signal);
await waitForEnvironment(readEnvironment, connection, expected, "A");
await waitForEnvironment(connection, expected, "A");
const second = callTool(secondScenario, secondCancellation.signal);
await client.ping();
assert.deepEqual(await readEnvironment(), expected);
assert.equal(await readScenarioRun(connection), "A");
const firstSnapshot = await readScenarioSnapshot(connection);
assert.deepEqual(firstSnapshot.environment, expected);
assert.equal(firstSnapshot.run, "A");
const cancelled = callTool(
environmentScenario({
@@ -261,8 +269,9 @@ const verifyConcurrentMcpCapture = async ({
await client.ping();
cancellation.abort(new Error("cancel queued browser scenario"));
await assert.rejects(cancelled, /cancel queued browser scenario/u);
assert.deepEqual(await readEnvironment(), expected);
assert.equal(await readScenarioRun(connection), "A");
const queuedSnapshot = await readScenarioSnapshot(connection);
assert.deepEqual(queuedSnapshot.environment, expected);
assert.equal(queuedSnapshot.run, "A");
await releaseScenario(connection);
assertCapture(
@@ -270,7 +279,7 @@ const verifyConcurrentMcpCapture = async ({
expected,
);
await waitForEnvironment(readEnvironment, connection, alternate, "B");
await waitForEnvironment(connection, alternate, "B");
await releaseScenario(connection);
assertCapture(
requireMcpEvidenceResult(await second, "capture_browser_scenario"),
@@ -287,31 +296,57 @@ const verifyConcurrentMcpCapture = async ({
}
};
const waitForEnvironment = async (
readEnvironment,
connection,
expectedValues,
run,
) => {
const deadline = Date.now() + 10_000;
while (Date.now() < deadline) {
if (
JSON.stringify(await readEnvironment()) ===
JSON.stringify(expectedValues) &&
(await readScenarioRun(connection)) === run
)
return;
await delay(25);
}
throw new Error(`Scenario ${run} never reached its page-controlled gate`);
const waitForEnvironment = async (connection, expectedValues, run) => {
await waitForScenarioSnapshot(
connection,
(snapshot) =>
JSON.stringify(snapshot.environment) === JSON.stringify(expectedValues) &&
snapshot.run === run,
`Scenario ${run} never reached its page-controlled gate`,
);
};
const readScenarioRun = async (connection) => {
const value = await connection.send("Runtime.evaluate", {
expression: "document.body.dataset.run ?? null",
returnByValue: true,
});
return value.result.value;
const waitForScenarioSnapshot = async (connection, accept, message) => {
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), 10_000);
let lastTransitionRejection;
try {
while (!controller.signal.aborted) {
try {
const snapshot = await readScenarioSnapshot(
connection,
controller.signal,
);
if (controller.signal.aborted) break;
if (accept(snapshot)) return;
} catch (cause) {
if (
controller.signal.aborted &&
cause instanceof AnalysisCancelledError
)
break;
if (!isNavigationTransitionRejection(cause)) throw cause;
lastTransitionRejection = cause;
}
await delay(25);
}
throw new Error(message, {
cause: lastTransitionRejection ?? controller.signal.reason,
});
} finally {
clearTimeout(timer);
}
};
const readScenarioSnapshot = async (connection, signal) => {
const value = await connection.send(
"Runtime.evaluate",
{ expression: scenarioSnapshotExpression, returnByValue: true },
undefined,
signal,
);
assert.equal(value.result.type, "string");
return JSON.parse(value.result.value);
};
const releaseScenario = async (connection) => {
@@ -321,39 +356,26 @@ const releaseScenario = async (connection) => {
});
};
async function verifyCancelledEnvironment(
provider,
connection,
scenario,
readEnvironment,
) {
async function verifyCancelledEnvironment(provider, connection, scenario) {
const controller = new AbortController();
const priorNavigation = await connection.send("Runtime.evaluate", {
expression: "performance.timeOrigin",
returnByValue: true,
});
const priorSnapshot = await readScenarioSnapshot(connection);
const pending = provider.captureScenario(
{ ...scenario, actions: [{ ...scenario.actions[0], timeout_ms: 30_000 }] },
{ signal: controller.signal },
);
const settlement = Promise.allSettled([pending]);
try {
const deadline = Date.now() + 10_000;
while (true) {
const navigation = await connection.send("Runtime.evaluate", {
expression: "performance.timeOrigin",
returnByValue: true,
});
if (
navigation.result.value !== priorNavigation.result.value &&
JSON.stringify(await readEnvironment()) === JSON.stringify(expected)
)
break;
assert.ok(Date.now() < deadline, "Scenario never applied emulation");
await delay(25);
}
await waitForScenarioSnapshot(
connection,
(snapshot) =>
snapshot.timeOrigin !== priorSnapshot.timeOrigin &&
JSON.stringify(snapshot.environment) === JSON.stringify(expected),
"Scenario never applied emulation",
);
await delay(100);
} finally {
controller.abort();
await settlement;
}
const cancelled = await pending;
assert.ok(
@@ -12,6 +12,20 @@ import { browserScenarioSchema } from "../../dist/domain/browserScenario.js";
import { runScenarioCli } from "./browser-scenario-verifier.mjs";
import { verifyScenarioPolicySetup } from "./browser-scenario-service-worker-setup-e2e.mjs";
const diagnosticError = (error) =>
error instanceof Error
? {
name: error.name,
message: error.message.slice(0, 1_000),
reason: error.reason,
stack: error.stack?.slice(0, 2_000),
cause:
error.cause instanceof Error
? error.cause.stack?.slice(0, 3_000)
: typeof error.cause,
}
: { kind: typeof error };
const startSite = async () => {
let otherOrigin;
const server = createServer((request, response) => {
@@ -83,6 +97,7 @@ export async function verifyScenarioServiceWorkers(endpoint, targetId) {
first.setOtherOrigin(second.origin);
second.setOtherOrigin(first.origin);
const observer = await chromium.connectOverCDP(endpoint);
console.log("Service-worker fixture browser:", observer.version());
let provider = createBrowserScenarioProvider(process.env);
let session;
let failure;
@@ -129,14 +144,19 @@ export async function verifyScenarioServiceWorkers(endpoint, targetId) {
true,
);
};
const assertRejected = async (scenario) => {
const assertRejected = async (scenario, expectedReason) => {
const result = await provider.captureScenario(scenario);
assert.equal(
result.ok,
false,
"Worker-influenced capture unexpectedly succeeded",
);
assert.equal(result.error.reason, "target_not_allowed");
assert.equal(result.error.reason, expectedReason);
if (expectedReason === "service_worker_blocked")
assert.match(
result.error.userMessage,
/environment\.service_workers to allow/,
);
assert.equal(
result.error.partialObservation.capture.browser.cleanup,
"disconnected-external",
@@ -154,7 +174,42 @@ export async function verifyScenarioServiceWorkers(endpoint, targetId) {
state: "visible",
},
]);
const cleanCapture = (await runScenarioCli(clean)).normalized_result;
let cleanCapture;
try {
cleanCapture = (await runScenarioCli(clean)).normalized_result;
} catch (cause) {
// Retain the original failure. One bounded replay navigates only this
// verifier-owned target and exposes causes the CLI does not serialize.
const state = await page
.locator("#state")
.evaluate(
(element) => ({
text: element.textContent?.slice(0, 100),
blocked: element.getAttribute("data-blocked"),
nativeRegister: navigator.serviceWorker.register
.toString()
.includes("[native code]"),
}),
undefined,
{ timeout: 1_000 },
)
.catch((error) => ({ unavailable: String(error).slice(0, 500) }));
console.error("Service-worker CLI failure state:", {
url: page.url(),
state,
});
const replay = await provider
.captureScenario(clean, { signal: AbortSignal.timeout(5_000) })
.then((result) =>
result.ok ? { ok: true } : diagnosticError(result.error),
)
.catch(diagnosticError);
console.error(
"Service-worker diagnostic replay (original CLI failure retained):",
replay,
);
throw cause;
}
assert.ok(cleanCapture.steps.every(({ status }) => status === "completed"));
assert.equal(cleanCapture.browser.cleanup, "disconnected-external");
await assertRestored();
@@ -179,7 +234,7 @@ export async function verifyScenarioServiceWorkers(endpoint, targetId) {
"worker",
);
await page.goto("about:blank");
await assertRejected(scenarioFor(second.origin));
await assertRejected(scenarioFor(second.origin), "service_worker_blocked");
await page.goto("about:blank");
await assertRejected(
scenarioFor(first.origin, [
@@ -190,6 +245,7 @@ export async function verifyScenarioServiceWorkers(endpoint, targetId) {
wait_until: "load",
},
]),
"service_worker_blocked",
);
await page.goto("about:blank");
await assertRejected(
@@ -201,9 +257,13 @@ export async function verifyScenarioServiceWorkers(endpoint, targetId) {
},
{ step_id: "loaded", action: "wait_for_timeout", duration_ms: 100 },
]),
"service_worker_blocked",
);
await page.goto("about:blank");
await assertRejected(scenarioFor(`${first.origin}/frame`));
await assertRejected(
scenarioFor(`${first.origin}/frame`),
"service_worker_blocked",
);
const allowed = await provider.captureScenario(
scenarioFor(second.origin, [], "allow"),
@@ -0,0 +1,33 @@
export interface GhidraVerifierTimeouts {
readonly clientOptions: {
readonly startupTimeoutMs: number;
};
readonly requestOptions: {
readonly timeout: number;
};
}
/** Resolve one verifier-owned timeout policy before target I/O or allocation. */
export function resolveGhidraVerifierTimeouts(
environment: Readonly<Record<string, string | undefined>>,
): GhidraVerifierTimeouts;
export interface GhidraVerifierMcpClient {
connect(
transport: unknown,
options: GhidraVerifierTimeouts["requestOptions"],
): Promise<void>;
callTool(
request: unknown,
options: GhidraVerifierTimeouts["requestOptions"],
): Promise<unknown>;
}
/** Bind every verifier MCP operation to the same owned request budget. */
export function createGhidraVerifierMcpOperations(
client: GhidraVerifierMcpClient,
requestOptions: GhidraVerifierTimeouts["requestOptions"],
): {
connect(transport: unknown): Promise<void>;
callTool(request: unknown): Promise<unknown>;
};
+31
View File
@@ -0,0 +1,31 @@
import { parseConfig } from "../../dist/config/parseConfig.js";
const FILE_OFFSET_OPERATION_TIMEOUT_MS = 240_000;
const MAX_TIMER_DELAY_MS = 2_147_483_647;
/** Resolve one verifier-owned timeout policy before target I/O or allocation. */
export function resolveGhidraVerifierTimeouts(environment) {
const configuration = parseConfig(environment);
if (!configuration.ok) throw configuration.error;
const startupTimeoutMs = configuration.value.ghidraStartupTimeoutMs;
// A cold public query includes provider startup before its analysis request.
// Preserve the operation budget after the caller-selected startup deadline.
const publicRequestTimeoutMs =
startupTimeoutMs + FILE_OFFSET_OPERATION_TIMEOUT_MS;
if (publicRequestTimeoutMs > MAX_TIMER_DELAY_MS)
throw new RangeError(
"The Ghidra startup and verification operation budgets exceed the Node.js timer limit.",
);
return {
clientOptions: { startupTimeoutMs },
requestOptions: { timeout: publicRequestTimeoutMs },
};
}
/** Bind every verifier MCP operation to the same owned request budget. */
export function createGhidraVerifierMcpOperations(client, requestOptions) {
return {
connect: (transport) => client.connect(transport, requestOptions),
callTool: (request) => client.callTool(request, requestOptions),
};
}
+84
View File
@@ -0,0 +1,84 @@
import assert from "node:assert/strict";
const limitationPattern = /Borland\/Delphi-style SEH frame registration/u;
/** Verify Ghidra reports, and does not absorb, the fixture's handler region. */
export async function verifyGhidraBorlandSeh(functionObservation, x86) {
assert.equal(x86, true, "The SEH control exists only in the x86 PE fixture");
const caller = "0x401015";
const procedure = "0x401080";
const handler = "0x4010c0";
const ordinary = await functionObservation("procedure_info", {
procedure: "0x401010",
});
assert.ok(
!ordinary.limitations.some((item) => limitationPattern.test(item)),
"The ordinary return-42 control unexpectedly reports an SEH limitation",
);
const info = await functionObservation("procedure_info", { procedure });
assert.ok(info.limitations.some((item) => limitationPattern.test(item)));
const outgoing = await functionObservation("procedure_references", {
procedure,
direction: "outgoing",
});
assert.equal(outgoing.value.direction, "outgoing");
assert.ok(outgoing.limitations.some((item) => limitationPattern.test(item)));
assert.ok(
outgoing.value.references.some(
(reference) =>
reference.source_address === "0x401083" &&
reference.target_address === handler &&
reference.kind.available &&
reference.kind.data &&
!reference.kind.call,
),
"The pushed handler address must remain an observed data reference, without inventing a call",
);
const incoming = await functionObservation("procedure_references", {
procedure,
direction: "incoming",
});
assert.equal(incoming.value.direction, "incoming");
assert.ok(incoming.limitations.some((item) => limitationPattern.test(item)));
assert.ok(
incoming.value.references.some(
(reference) =>
reference.source_address === caller &&
reference.target_address === procedure,
),
"The caller-to-registration procedure reference was not observed",
);
const dossier = await functionObservation("analyze_function", {
procedure,
});
assert.ok(dossier.limitations.some((item) => limitationPattern.test(item)));
assert.ok(
dossier.value.limitations.some((item) => limitationPattern.test(item)),
"The normalized function dossier lost the SEH limitation",
);
assert.equal(dossier.value.procedure.body.available, true);
assert.ok(dossier.value.procedure.body.ranges.length > 0);
assert.ok(
!dossier.value.procedure.body.ranges.some(
(range) =>
BigInt(range.start) <= BigInt(handler) &&
BigInt(range.end) >= BigInt(handler),
),
"The handler was incorrectly claimed as part of the procedure body",
);
return {
limitation: true,
ordinary_control: true,
procedure_references_incoming_and_outgoing: true,
handler_data_reference: true,
caller_reference: true,
dossier_limitation: true,
handler_body_not_claimed: true,
};
}
@@ -0,0 +1,16 @@
export interface GhidraFileOffsetVerification {
readonly cli_mcp_parity: true;
readonly explicit_and_numeric_offsets: true;
readonly invalid_and_unmapped_offsets: true;
readonly mapped_offset_without_procedure: true;
readonly ambiguous_mappings: "verified" | "unavailable-single-section";
readonly source_unchanged: true;
readonly cleanup: "complete";
}
/** Exercise file coordinates through public CLI/MCP using a source-owned PE fixture. */
export function verifyGhidraFileOffsets(
targetPath: string,
entrypoint: string,
procedure: string,
): Promise<GhidraFileOffsetVerification>;
+24 -20
View File
@@ -14,6 +14,10 @@ import { promisify } from "node:util";
import { Client } from "@modelcontextprotocol/client";
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
import { parseEvidence } from "../../dist/domain/evidence.js";
import {
createGhidraVerifierMcpOperations,
resolveGhidraVerifierTimeouts,
} from "./ghidra-verifier-timeouts.mjs";
import {
requireMcpOperationResult,
requireMcpToolError,
@@ -26,17 +30,22 @@ export async function verifyGhidraFileOffsets(
entrypoint,
procedure,
) {
const environment = {
...process.env,
REA_ANALYSIS_PROVIDER: "ghidra",
REA_LOG_LEVEL: "silent",
};
const { requestOptions } = resolveGhidraVerifierTimeouts(environment);
const timeoutMs = requestOptions.timeout;
const original = await readFile(targetPath);
const workspace = await mkdtemp(join(tmpdir(), "rea-file-offsets-"));
const runtime = join(workspace, "runtime");
await mkdir(runtime);
const env = {
...process.env,
...environment,
TEMP: runtime,
TMP: runtime,
TMPDIR: runtime,
REA_ANALYSIS_PROVIDER: "ghidra",
REA_LOG_LEVEL: "silent",
};
const client = new Client({ name: "rea-file-offsets", version: "1" });
const transport = new StdioClientTransport({
@@ -45,21 +54,19 @@ export async function verifyGhidraFileOffsets(
env,
stderr: "pipe",
});
const mcp = createGhidraVerifierMcpOperations(client, requestOptions);
let connected = false;
let complete = false;
let primaryFailure;
const call = async (name, arguments_ = {}) => {
const result = await client.callTool(
{ name, arguments: arguments_ },
{ timeout: 240_000 },
);
const result = await mcp.callTool({ name, arguments: arguments_ });
const projected = requireMcpOperationResult(result, name);
return ["open_binary", "binary_session", "close_binary"].includes(name)
? projected
: (result.structuredContent ?? JSON.parse(mcpTextValue(result)));
};
try {
await client.connect(transport);
await mcp.connect(transport);
connected = true;
await call("open_binary", { path: targetPath, provider_id: "ghidra" });
const session = await call("binary_session");
@@ -90,12 +97,12 @@ export async function verifyGhidraFileOffsets(
),
);
}
const invalid = await client.callTool({
const invalid = await mcp.callTool({
name: "procedure_pseudo_code",
arguments: { procedure: "file-offset:0x20000000000000" },
});
assert.equal(requireMcpToolError(invalid).code, "invalid_request");
const unmapped = await client.callTool({
const unmapped = await mcp.callTool({
name: "procedure_pseudo_code",
arguments: { procedure: "file-offset:0x100000" },
});
@@ -122,7 +129,7 @@ export async function verifyGhidraFileOffsets(
assert.equal(headerOffset.normalized_result.file_offset, 0);
for (const selector of ["file-offset:0x0", "0x0"]) {
const missing = requireMcpToolError(
await client.callTool({
await mcp.callTool({
name: "procedure_pseudo_code",
arguments: { procedure: selector },
}),
@@ -147,7 +154,7 @@ export async function verifyGhidraFileOffsets(
"ghidra",
"--json",
],
{ env, timeout: 240_000, maxBuffer: 16 * 1024 * 1024 },
{ env, timeout: timeoutMs, maxBuffer: 16 * 1024 * 1024 },
)
).stdout,
);
@@ -164,7 +171,7 @@ export async function verifyGhidraFileOffsets(
"ghidra",
"--json",
],
{ env, timeout: 240_000, maxBuffer: 16 * 1024 * 1024 },
{ env, timeout: timeoutMs, maxBuffer: 16 * 1024 * 1024 },
).then(
() => {
throw new Error(
@@ -183,13 +190,10 @@ export async function verifyGhidraFileOffsets(
const ambiguousPath = join(workspace, "ambiguous.exe");
await writeFile(ambiguousPath, alias);
await call("open_binary", { path: ambiguousPath, provider_id: "ghidra" });
const ambiguous = await client.callTool(
{
name: "procedure_pseudo_code",
arguments: { procedure: `file-offset:${coordinate}` },
},
{ timeout: 240_000 },
);
const ambiguous = await mcp.callTool({
name: "procedure_pseudo_code",
arguments: { procedure: `file-offset:${coordinate}` },
});
assert.ok(
JSON.stringify(requireMcpToolError(ambiguous)).includes(
"multiple loaded mappings",
+2 -2
View File
@@ -98,9 +98,9 @@ export async function readReleaseHistory(run, base, target) {
return { base: baseSha, target: targetSha, commits };
}
// REA history maps Anthropic and Cursor's agent trailers to ordinary User actors.
// GitHub maps these coding-agent trailers to ordinary User actors.
// Keep those source identities in the inventory while excluding automation credit.
const AGENT_ACCOUNTS = new Set(["claude", "cursoragent"]);
const AGENT_ACCOUNTS = new Set(["claude", "cursoragent", "codex"]);
// REA's maintainer requested external-contributor thanks without self-credit.
const MAINTAINER_ACCOUNTS = new Set(["morluto"]);
const human = (value) =>
+120
View File
@@ -0,0 +1,120 @@
import { Client } from "@modelcontextprotocol/client";
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
import { execFile } from "node:child_process";
import { readFile } from "node:fs/promises";
import { join } from "node:path";
import { promisify } from "node:util";
import { CATALOG_IDENTITY } from "../../dist/catalogIdentity.js";
import { TOOL_CONTRACTS } from "../../dist/contracts/toolContracts.js";
import {
requireMcpLifecycleResult,
sortVerifierNames,
} from "./mcp-verifier-results.mjs";
const execute = promisify(execFile);
/** Install the selected archive or registry specifier before any protocol deadline. */
export async function installCanaryPackage(specifier, workspace, environment) {
const prefix = join(workspace, "installed");
await execute(
"npm",
[
"install",
"--ignore-scripts",
"--no-save",
"--no-package-lock",
"--no-audit",
"--no-fund",
"--prefix",
prefix,
specifier,
],
{ cwd: workspace, env: environment, maxBuffer: 16 * 1024 * 1024 },
);
return join(prefix, "node_modules", "rea-agents");
}
/** Exercise the same installed CLI/MCP contract before and after publication. */
export async function verifyInstalledCanaryPackage(
packageRoot,
version,
workspace,
environment,
) {
const installed = JSON.parse(
await readFile(join(packageRoot, "package.json"), "utf8"),
);
if (installed.name !== "rea-agents" || installed.version !== version)
throw new Error(
`Installed package identity is ${installed.name}@${installed.version}, expected rea-agents@${version}`,
);
const launcher = join(packageRoot, "scripts", "rea.mjs");
for (const option of ["--help", "--llms"])
await execute(process.execPath, [launcher, option], {
cwd: workspace,
env: environment,
maxBuffer: 16 * 1024 * 1024,
});
const transport = new StdioClientTransport({
command: process.execPath,
args: [launcher, "mcp"],
cwd: workspace,
env: environment,
stderr: "pipe",
});
const client = new Client({ name: "release-package-canary", version: "1" });
let stderr = "";
transport.stderr?.on("data", (chunk) => {
if (stderr.length < 16_384)
stderr += chunk.toString("utf8").slice(0, 16_384 - stderr.length);
});
try {
await client.connect(transport);
const tools = await client.listTools();
const toolNames = tools.tools.map(({ name }) => name);
const canonicalToolNames = new Set(TOOL_CONTRACTS.map(({ name }) => name));
const publishedToolNames = new Set(toolNames);
const unknown = toolNames.filter((name) => !canonicalToolNames.has(name));
const missing = [...canonicalToolNames].filter(
(name) => !publishedToolNames.has(name),
);
if (
toolNames.length === 0 ||
publishedToolNames.size !== toolNames.length ||
unknown.length ||
missing.length
)
throw new Error(
`Installed MCP exposed an invalid canonical tool catalog (${toolNames.length} tools, unknown: ${unknown.join(", ") || "none"}, missing: ${missing.join(", ") || "none"})`,
);
const status = requireMcpLifecycleResult(
await client.callTool({ name: "binary_session", arguments: {} }),
"binary_session",
);
const availability = sortVerifierNames(
status.tool_availability.map(({ name }) => name),
);
if (
JSON.stringify(availability) !==
JSON.stringify(sortVerifierNames(canonicalToolNames))
)
throw new Error(
"Installed binary_session omitted canonical tool availability",
);
return {
mcpTools: toolNames.length,
canonicalMcpTools: CATALOG_IDENTITY.counts.mcp_tools,
};
} catch (cause) {
throw new Error(`Installed package MCP verification failed: ${stderr}`, {
cause,
});
} finally {
try {
await client.close();
} finally {
await transport.close();
}
}
}
@@ -0,0 +1,118 @@
import assert from "node:assert/strict";
import { spawn } from "node:child_process";
import { once } from "node:events";
import { createInterface } from "node:readline";
import { resolve } from "node:path";
const withDeadline = async (promise, milliseconds, description) => {
let timer;
try {
return await Promise.race([
promise,
new Promise((_, reject) => {
timer = setTimeout(
() =>
reject(new Error(`${description} exceeded ${milliseconds} ms.`)),
milliseconds,
);
}),
]);
} finally {
clearTimeout(timer);
}
};
export async function verifyVolumeRootAppendLease({
fixturePath,
volumeRoot,
verifyAdmission,
}) {
const lease = spawn(
resolve(fixturePath),
["volume-root-append-lease", volumeRoot],
{ stdio: ["pipe", "pipe", "pipe"], windowsHide: true },
);
const lines = createInterface({ input: lease.stdout });
let leaseStderr = "";
lease.stderr.setEncoding("utf8");
lease.stderr.on("data", (chunk) => {
if (leaseStderr.length < 8192) leaseStderr += chunk;
});
const closed = once(lease, "close").then(([code, signal]) => ({
code,
signal,
}));
const leaseLine = once(lines, "line").then(([line]) => ({ line }));
const leaseError = once(lease, "error").then(([error]) => {
throw error;
});
let verificationFailure;
try {
const ready = await withDeadline(
Promise.race([leaseLine, closed, leaseError]),
10_000,
"Volume-root append lease readiness",
);
assert.equal(
"line" in ready,
true,
`Volume-root append lease exited before readiness (code ${ready.code}, signal ${ready.signal}): ${leaseStderr}`,
);
const observation = JSON.parse(ready.line);
assert.equal(
observation.writeAccessGranted,
true,
`Windows test token cannot hold FILE_ADD_SUBDIRECTORY on ${volumeRoot} (Win32 ${observation.win32Code}).`,
);
await verifyAdmission();
} catch (error) {
verificationFailure = error;
}
lines.close();
if (
lease.exitCode === null &&
lease.signalCode === null &&
!lease.stdin.destroyed
)
lease.stdin.end("x");
let releaseFailure;
try {
const result = await withDeadline(
closed,
10_000,
"Volume-root append lease release",
).catch(async (error) => {
lease.kill();
try {
return await withDeadline(
closed,
5_000,
"Volume-root append lease termination",
);
} catch (terminationError) {
throw new AggregateError(
[error, terminationError],
`Volume-root append lease could not be released: ${leaseStderr}`,
);
}
});
assert.equal(
result.code,
0,
`Volume-root append lease exited with code ${result.code}, signal ${result.signal}: ${leaseStderr}`,
);
} catch (error) {
releaseFailure = error;
}
if (verificationFailure !== undefined && releaseFailure !== undefined)
throw new AggregateError(
[verificationFailure, releaseFailure],
"Volume-root append lease verification and cleanup both failed.",
);
if (verificationFailure !== undefined) throw verificationFailure;
if (releaseFailure !== undefined) throw releaseFailure;
}
Loaded 100 of 687 files, more files were not shown because too many files have changed in this diff. Show more