Commit Graph
5133 Commits
Author SHA1 Message Date
morluto e94ca9f223 refactor(mcp): bind GDB and Cutter tools under external-mutation admission through the shared table (#11637)
* refactor(mcp): bind GDB and Cutter tools under external-mutation admission through the shared table

GDB start and status, and Cutter discovery, bind as values outside admission; gdb_console and cutter_command bind on the external-mutation evidence kind (gdb_console with delivery detail), and close_gdb_session on owned-cleanup. Tests build their servers through one debugger fixture, and the Rizin lifecycle regressions now run for all three debuggers.

* refactor(mcp): bind the session target, context and process capture tools through the shared table (#11640)

Value bindings can return a ReducibleValue (alternatives tried when the complete value overflows) or a DetailedFailure (facts delivered beside the error's details). A new query binding reads the analysis its required admission grants. open_binary and open_bundle_resources bind as values; get_navigation_context and inspect_address_context as queries; capture_process_scenario on the analyze kind through an application owner that records its Evidence and residual unknowns.
2026-11-16 09:28:35 +08:00
morluto 653a6d0359 test(snapshots): expect a snapshot binding mismatch to name targets by their persisted identity (#11639)
Since #11551 a snapshot persists its target as { identity, kind }, so binding_mismatch.target reports the identity's sha256 and selection there. Two tests still expected the flat target and fail on main.
2026-11-16 09:27:05 +08:00
morluto 093e41a568 refactor(mcp): bind Frida discovery and session tools through the shared table (#11621)
* refactor(mcp): bind Frida discovery and session tools through the shared table

* refactor(mcp): bind browser observation tools through the shared table (#11622)

* refactor(mcp): bind session record tools through the shared table (#11625)

* fix(mcp): record a completed provider-backed workflow's Evidence once before delivery

* refactor(mcp): bind Rizin debugger tools under external-mutation admission through the shared table (#11629)

* refactor(mcp): bind Rizin debugger tools under external-mutation admission through the shared table

* test(mcp): cancel a Rizin command during its retirement close, and route moved code to the reverse-tools lane
2026-11-16 09:14:20 +08:00
morluto 7b500d7833 fix(browser): report non-literal request URLs as unknown endpoints instead of dropping them (#11630)
* fix(browser): report non-literal request URLs as unknown endpoints instead of dropping them

* fix(browser): read XHR URLs from the proven request kind and bound view call sites
2026-11-16 09:12:44 +08:00
morluto 9738583ed8 fix(native,hopper): keep the descriptor a failed process identity read left open (#11633)
The LLDB tracer's target start-identity read and exit/signal identity checks,
and the Hopper client's bridge start-identity read and exit-identity check,
reduced an inspection-owner rejection to a message, so a descriptor whose close
failed was dropped. Each reader now keeps the identity unavailable (or the exit
unverified) and moves the rejection's descriptor owners into the session's
inspection scope, which trace/close retries; the reported failure names the
descriptor until it is released. The Hopper exit check no longer makes close()
reject.

Fixes #11602
2026-11-16 09:11:49 +08:00
morluto 9699ce9057 fix(frida)!: require an absolute script path over MCP (#11580)
* fix(frida)!: require an absolute script path over MCP

`load_frida_script` and `instrument_with_frida` admitted a relative script
`path`, which the MCP server read against its own working directory rather
than the caller's. Both contracts now admit only an absolute local path, as
the pcap and debugger contracts do. The `instrument-with-frida` CLI resolves a
relative `--script-file` against its working directory before the contract
sees it. `program` is unchanged: on a remote device it may name a path there.

BREAKING CHANGE: MCP `load_frida_script` and `instrument_with_frida` refuse a
relative script `path` with `invalid_request`; send an absolute path. CLI
`--script-file` still accepts a relative path, and Evidence `source_path` is
now the resolved absolute path.

Fixes #11506

* test(frida): assert a refused relative script path starts and loads nothing

* test(frida): verify the CLI fixture's script file spelling is relative

* test(frida): give the contract test an absolute script file

The load and instrument contracts admit only an absolute script path, so
the contract test's relative script.js no longer parsed. Use a resolved
path for the accepted inputs and refuse the relative spelling in its own
test.

* test(frida): drop the contract-level relative path check the MCP test covers
2026-11-16 08:54:51 +08:00
morluto fbea9e8778 fix(verify): read a TypeScript non-null assertion as completing its operand (#11596)
* fix(verify): read a TypeScript non-null assertion as completing its operand

A postfix ! after a completed operand leaves it complete, so a following / divides instead of opening a regular expression that hid the rest of the expression from the guards.

* fix(verify): read export default as the start of an expression
2026-11-16 08:52:06 +08:00
morluto 793ab582be refactor(desktop): give the agentenv provider name an entry file and name the build computer's controlled routes as a port (#11600)
* refactor(desktop): give the agentenv provider name its own entry file and move ComputerRelease into src/domain

* refactor(desktop): name the build computer's controlled routes and controller answer as a port (#11604)
2026-11-16 08:51:27 +08:00
morluto 2910fc0b13 fix(electron): refuse a wait longer than Node can schedule (#11606)
An Electron scenario wait accepted any non-negative duration_ms, and
Playwright's waitForTimeout schedules a delay above 2147483647 ms as 1 ms,
so a very long wait returned at once. Bound it at admission with the shared
Node timer maximum, as the browser scenario wait already does.

Refs #11601
2026-11-16 08:48:38 +08:00
morluto ad4f72dd68 build(scripts): type-check the shared verifier run, fixture, cleanup and source loader (#11609)
* build(scripts): type-check the shared verifier run, fixture, cleanup and source loader

The five scripts/lib modules join tsconfig.scripts.json (69 errors). Named types come from their existing declaration files. The source loader probes the runtime's TypeScript transform once and refuses a Node.js without transform mode (Node.js 26 removed it) with the pinned-runtime message instead of failing on the first owned source file.

* build(scripts): type-check the managed PE and function dossier fixtures (#11611)

* build(scripts): type-check the managed PE and function dossier fixtures

pe.mjs and function-dossier.mjs join tsconfig.scripts.json (68 errors). Named option types come from pe.d.mts; heap names are paired with their rows instead of read back by index; optional metadata tables are added to the row map directly; a placed body's RVA is computed by bodyRva, which refuses an unplaced body. Fixture bytes are unchanged.

* build(scripts): type-check the managed conformance entry point and support (#11612)

conformance.mjs, support.mjs and config.mjs join tsconfig.scripts.json (34 errors), completing the managed conformance closure. Result checks narrow with assert.ok, Evidence results are read through their owners' schemas, the native function subject is an EvidenceSubjectTarget, the comparison check no longer dereferences a right-only method's null left side, and the fixture callback returns the report instead of assigning outer variables.
2026-11-16 08:45:01 +08:00
morluto d6af08e4be test: name tests after the behavior they check, not a removed limit (#11618)
* test: name tests after the behavior they check, not a removed limit

Thirty-one test titles still said "beyond/above/after the former ..." for
limits that no longer exist. They now state what the test checks (the size,
count or depth it exercises, or the bound that still applies, such as
max_snapshot_bytes for the managed manifest snapshot). Test bodies are
unchanged.

Refs #10515

* test: say "more than" where a title counts only part of its fixture
2026-11-16 08:42:11 +08:00
morluto 34ec903786 feat(native): report which Mach-O slices a signature describes and their signing states (#11620)
* feat(native): report which Mach-O slices a signature describes and their signing states

inspect_signature gains slices: described (the codesign architecture the
identity, hashes, requirement, entitlements and runtime state describe),
architectures (every selectable slice), unmapped, checked and unsigned.
Partial coverage and unsigned slices were only limitation prose, so the
native inventory goldens matched sentences. Slices checked before a failed
per-slice read keep their states in the partial observation.

Refs #10508

* fix(native): name a thin slice by codesign's architecture and qualify unknown slice states

A thin file's admitted architecture is a CPU family, so slices.described
reported a thin arm64e file as arm64. It now takes the architecture codesign
names for a thin file (null when it names none) and keeps the selector for a
universal one. The described slice's state is the top-level signed; only
other unchecked slices are unknown, and architectures comes from the admitted
universal header.
2026-11-16 08:40:43 +08:00
morluto d4a7c17b38 feat(errors): project fixed native and producer input allowances as typed refusals (#11623)
* feat(errors): project fixed native and producer input allowances as typed refusals

fixedNativeAllowance wrote its allowance and value only into the remediation
sentence, and fixedProducerInputAllowance put the byte count into the
allowance name. Both now build fixedAllowanceOptions with limit and unit, so
the native command output capture, PE resource metadata, Ghidra
installation-properties and artifact analysis input refusals project
details.refusal {kind: fixed_ceiling, allowance_kind, limit, unit}. The
fixed-ceiling remediation renders the value from those facts for every
ceiling that carries them.

Refs #10508

* test(errors): check the rendered allowance value, not its sentence
2026-11-16 08:39:18 +08:00
morluto 3f4953bfae feat(android)!: require integrity_check on a JNI library integrity failure (#11624)
* feat(android)!: require integrity_check on a JNI library integrity failure

A JNI library failure is now a tagged union: kind integrity carries a
required integrity_check, and no other kind carries one. The producer builds
it from the reader failure, whose integrity constructor requires the check
since #11505. Also drop the stale "evidence produced before this field"
clause from the electron_semantics comment; earlier Evidence revisions are
refused.

BREAKING CHANGE: Android JNI Evidence whose library failure has kind
"integrity" must name integrity_check. Records written before #11191 that
lack it no longer parse; recreate them.

Refs #10510

* test(android): check the JNI failure union in its JSON Schema and the unnamed-check refusal

Exclude integrity from the other failure kinds with excludedValues, so the
JSON Schema conversion declares the exclusion that a bare refine dropped.
The test checks the converted schema against the same valid and malformed
records, and drives an integrity read failure with an explicitly undefined
check: the read is refused, the reader is closed and every checkpoint parses.
2026-11-16 08:38:29 +08:00
morluto 18a47ee5aa test(cli): spy on union branches through the base Zod type so main typechecks (#11627)
#11607 spied on a generic Schema's safeParse; TypeScript cannot resolve
that key on an unresolved generic, so main's typecheck fails (TS2769).
2026-11-16 08:37:42 +08:00
morluto 482165d7ce perf(cli): find recorded controls without reparsing whole union branches (#11607)
* perf(cli): find recorded controls without reparsing whole union branches

The control walk skips schema subtrees that declare no recorded control and rules out union options from their keys and literal values before parsing; when one option remains it is followed without a parse. On a 227 MB analyze-javascript-application --full-output result the walk drops from about 4 s and 0.7 GB of heap to about 1 ms.

* test(cli): assert which union branches the control walk parses
2026-11-15 19:25:40 -05:00
morluto 42e808ff76 test: expect the unknown Evidence subject for resource-only and objdump command records (#11613)
Since #11416 every Evidence record has a subject; one without a file
target names identity {kind: unknown, reason: not-observed} with null name
and local_path. Four tests that #11416's run did not select still expected
subject: null and fail on main: the keyless bundle resource CLI, provider
composition and acceptance tests, and the objdump command identity test.
2026-11-16 08:25:18 +08:00
morluto dbb4bc29f0 fix(process): classify every launcher failure once by errno in the shared launch owner (#11615)
* fix(process): classify every launcher failure once by errno in the shared launch owner

* fix(process): keep the launch owner's syscall, cause and facts in RE and pwntools unavailable reports
2026-11-16 08:24:39 +08:00
morluto 0884836abf refactor(mcp): bind provider-backed workflows on admitted analysis through the shared table (#11617) 2026-11-16 08:22:50 +08:00
morluto 6fa58b0ec8 feat(artifacts): require every integrity reader failure to name its check (#11505)
ArtifactReaderFailure overloads require integrityCheck for a literal
"integrity" reason and an explicit (possibly undefined) check for a rebuild
whose reason is not a literal; primaryFacts always carries it. The .NET bundle
reader uses assertProducedEntry, and the PyInstaller cookie probe and owned
lease cleanup rewrap keep the check they previously dropped.
2026-11-16 08:10:08 +08:00
morluto c1546be70d refactor(ida)!: remove the legacy ida-pro-mcp 1.4 attached protocol (#11546)
* refactor(ida)!: remove the legacy ida-pro-mcp 1.4 attached protocol

Attached IDA analysis now has one protocol, the native ida-free-mcp plugin.
The legacy 1.4 GUI proxy branches, response schemas, tool profile, GUI
navigation effects and plain-text reply kind are removed. A stored
registration that still names "protocol": "legacy" is refused at
configuration with a REA_IDA_MCP_CONFIG constraint naming the migration
section; it is never read as another protocol and the file is not rewritten.
Native and headless request/response handling is unchanged.

Refs #10516

BREAKING CHANGE: "protocol": "legacy" IDA registrations are refused.
Before (accepted, ida-pro-mcp 1.4 GUI proxy):
  {"mode": "attached", "protocol": "legacy", "command": "python",
   "args": ["/path/ida_pro_mcp/server.py", "--ida-rpc", "http://127.0.0.1:13337"]}
After (native plugin for an open GUI database):
  {"mode": "attached", "protocol": "native", "url": "http://127.0.0.1:13337/mcp"}
or an ida-pro-mcp 2.x database supervisor in headless mode:
  {"mode": "headless", "command": "idalib-mcp", "args": ["--stdio", "--max-workers", "1"]}
procedure_callers is no longer available from any IDA profile, and IDA
procedure_assembly/read_function_instructions no longer advertise may_show_ui.
See docs/providers/ida-provider.md#migrate-a-legacy-attached-registration.

* test(ida): deliver null metadata overrides and compare legacy refusal with its owner
2026-11-16 08:08:38 +08:00
morluto 48b4bcd19a feat!: name process capture, Rizin and gdb Evidence by their target identities (#11568)
* feat(process)!: name process capture Evidence by its launched root process

The capture result now carries the launched root process in
`manifest.root_process`: its PID with the start identity that
`observeProcessStartIdentity` read for that PID at launch, bound to the
capture's run token. The harness reads that identity once and shares it
between finalization signalling and the manifest, so the read no longer
depends on a positive finalization interval.

Capture Evidence names the root as its subject,
`{ kind: "process", pid, start_time, executable_sha256 }`. A PID without
its start identity is not an identity, so an unread start identity leaves
the subject `unknown`/`not-observed`. When the caller selects PID
normalization, the raw PID and start identity are not recorded:
`root_process` is `withheld-by-caller` and the subject is
`unknown`/`withheld-by-caller`, a new unknown reason. Capture validation
requires the withheld state exactly when PID normalization is selected.

Refs #11417

BREAKING CHANGE: process capture Evidence IDs change: captures without PID
normalization name `{ kind: "process", pid, start_time, executable_sha256 }`
as their subject, and captures with PID normalization name
`{ kind: "unknown", reason: "withheld-by-caller" }`. Capture results
require `manifest.root_process`; captures without it are refused.
Recreate stored process capture Evidence.

* fix(process): join the launch identity read and let cancellation interrupt its wait

The root's launch identity read now runs for every capture and the
manifest awaits it. The read stays unsignalled, because finalization
signals after a cancellation still need the retained identity, so the
manifest's wait observes cancellation through `waitForAbortable` instead.
`finishProcessRun` and the startup-failure path join the read, so a
capture never returns while it is still running.

* feat(rizin)!: bind Rizin command Evidence to its session and launch file (#11570)

* feat(rizin)!: bind Rizin command Evidence to its session and launch file

Rizin command Evidence was subject-less (`unknown`/`not-observed`). A new
`session` target identity names the debugger session REA minted and the
target it launched: `{ kind: "session", session_kind, id, target }`, where
`target` is a file identity or an explicit unknown. The Evidence subject
validates the nested launch file with the format-owned subject
declaration.

`start_rizin_debug_session` hashes the launch file with the shared stable
file hasher before Rizin starts and binds the session to it (`format:
"file"`, no architecture or selection). Later debugger commands do not
rebind it. A descriptor whose close fails is retained in the startup
resource scope, like the inferior TTY lease, and fails the start, as does
cancellation; any other hash failure leaves the target
`unknown`/`not-observed` and records the reason as a limitation. The
"target identity is not established" limitation is replaced by the
binding's meaning.

Refs #11417

BREAKING CHANGE: `rizin_debug_command` Evidence IDs change: its subject is
`{ kind: "session", session_kind: "rizin", id: <session_id>, target }`
with `target` the launch file hashed at start (`{ kind: "file", sha256,
format: "file", architecture: null, selection: null }`) or
`{ kind: "unknown", reason: "not-observed" }`. Recreate stored Rizin
command Evidence.

* feat(gdb)!: name GDB command Evidence by its debugger session (#11572)

GDB startup and console Evidence was subject-less (`unknown`/`not-observed`).
It now names the session REA minted with the shared `session` identity:
`{ kind: "session", session_kind: "gdb", id, target }`. One projection,
`gdbSessionSubject`, replaces the six `unknownTarget("not-observed")` sites.

`start_gdb_session` launches no program file; programs are loaded or
attached by console commands that REA does not hash, so the session target
stays `unknown`/`not-observed`. REA does not infer a file from a PID or a
path. The existing limitation that the active inferior identity is not
established still applies.

Refs #11417

BREAKING CHANGE: `start_gdb_session` startup Evidence and `gdb_console`
Evidence IDs change: their subject is `{ kind: "session", session_kind:
"gdb", id: <session_id>, target: { kind: "unknown", reason: "not-observed" } }`.
Recreate stored GDB Evidence.

* fix(rizin): keep the launch file read failure when its close also fails

When hashing the launch file failed and closing its descriptor failed
too, the start error kept only the close failure; the retained lease
retries only the close, so the read failure was lost. The cleanup error
now carries it as `launch_file_hash_failure`.

The session-binding test now rewrites the launch file after spawn and
between two commands, and checks that both records keep the digest read
before launch.

* fix(process): keep the descriptor a failed launch identity read could not close

The launch identity read reduced every rejection to an unverified reason, so an inspection-owner failure carrying an unclosed descriptor was dropped and the capture could succeed without retaining it. The retained identity now keeps that owner's failure; startup cleanup and finishProcessRun pass it through the same secondary inspection-failure path as the sampler, which fails the capture and keeps the descriptor owned for cleanup retry.

* refactor(rizin): describe a launch-file hash failure through errorMessage

* test(rizin): create launch-file fixtures through createTestTempDirectory

* fix(process): keep the descriptor a finalization signal's identity check left open (#11603)

* fix(process): keep the descriptor a finalization signal's identity check left open

The root signaller now catches a delivery whose identity check fails through the inspection owner, records the attempt as unverified, and keeps the inspection failure. finishProcessRun joins every delivery (including one that outlasted the finalization grace) and retains those failures through the same secondary inspection-failure path as the launch identity read, so the capture fails with the descriptor still owned for a cleanup retry.

* test(process): release descriptor-retention captures when an assertion fails

Both descriptor-retention regressions register their resource-scope release before the capture starts and use the project deadline instead of a fixed 15 s timeout.
2026-11-16 08:06:35 +08:00
morluto b3ca03972a build(scripts): type-check the Evidence verification scripts against src (#11579)
* build(scripts): type-check the Evidence verification scripts against src

Six JavaScript callers kept passing `undefined` as an Evidence subject
after `createEvidence` stopped accepting it (#11536); `npm run typecheck`
saw only the TypeScript callers. The scripts import built modules by
relative `../dist/` paths, which a checker resolves to the built JavaScript
(or nothing, before a build) rather than the source types.

A package-private `#dist/*` import alias resolves to `./dist/*` at run
time, and `tsconfig.scripts.json` maps it to `./src/*` and checks the
listed scripts with `checkJs` under the main compiler options. `typecheck`,
and so `check:fast`, runs it; turbo's typecheck inputs include the scripts
and the new config.

First slice: `verify-package-evidence.mjs` (its evidence-bundle import
becomes static), `verify/javascript/output.mjs` and
`verify/javascript/digests.mjs`, with the JSDoc types the check required.

Refs #11545

* build(scripts): type-check the MCP verifier results and Ghidra snapshot lifecycle helpers (#11590)

* build(scripts): type-check the managed app manifest verifier (#11592)

* build(scripts): type-check the managed oracles and completion report (#11605)

oracles.mjs and completion-report.mjs join tsconfig.scripts.json (72 errors). ensureIlspy is an assertion function, the ILSpy import returns the imported Evidence and reads its normalized result through managedReconstructionImportResultSchema, the manifest-rejection controls are named records walked by a checked field lookup, and the completion report names its input.
2026-11-16 08:04:12 +08:00
morluto 6eb42a8d8d fix(rust): report compiler-path byte trimming only when it removes a path (#11582)
* fix(rust): report compiler-path byte trimming only when it removes a path

When the reader's compiler guidance did not fit the complete-report
allowance, trimming replaced the reader's coverage (max_rustc_hashes) and its
guidance with the shorter byte-trimming record. In a narrow allowance range
that swap alone made every hash fit, so the report kept all paths but claimed
they were omitted by the byte budget and lost the count-limit control.

Now, when every path fits, the reader's record and control stay and only its
guidance text (which restates rustc_commit.coverage) is left out; if even
that does not fit, one path is dropped so the recorded byte coverage is true.

* fix(rust): keep the complete compiler record whenever it fits without guidance

Check the reader's record without its guidance before building the trimming record, so trimming always removes a path and the unreachable fallback is gone. The boundary test now requires a tight budget that keeps every path with the reader's coverage record.
2026-11-16 07:58:26 +08:00
morluto 65f78edce5 perf(reference): overlap reference-source identity lookups in traversal order (#11585)
The reference-source reader made about nine serial filesystem calls per
directory. It now runs its read-only identity lookups ahead of their turn,
bounded to four running at once (libuv's default filesystem concurrency):
opening admissions of the next pending directories, metadata of the next
listed names, and closing admissions of directories already enumerated.
Results are applied in traversal order: policy and exclusion callbacks keep
their order, the first error in traversal order is returned, a failure a
started lookup observed is retained, and every started lookup settles before
the read returns. Running opening admissions are counted, so older siblings
buried by deeper levels cannot raise concurrency with tree depth.

Measured on macOS, Node 24.22.1: the 130,000-directory regression's
reference-source read 27.5 s -> 17.2 s; a 20,000-directory flat tree
2.1-2.3 s -> 1.2 s; an 8,641-file source tree 1.41 s -> 1.31 s.

Refs #11365
2026-11-16 07:57:51 +08:00
morluto e3eb4c1749 test: state the current contract in tests named after removed limits (#11588)
Eleven tests were named "beyond the former ..." and pinned a value just above
a limit that no longer exists. Each now states and checks the current
contract:

- jsonShape: the caller's byte allowance is the only bound; a shape that fits
  exactly is complete and one byte less is a capacity refusal.
- Hopper download: chunks arriving just inside the stall bound complete (the
  trickle case already covers the total bound).
- Firmware: a selected analysis_timeout_ms above the default governs the owned
  command, expressed from the default constant.
- Provider process output, CDP resources/timeline/WebMCP frames, Playwright
  steps/artifacts/Electron waits, scenario diff and Bun ELF names: renamed to
  the unbounded-count or exact-selection contract they check, with a note on
  what bound (if any) still applies and where it is covered.

The six JavaScript analyzer tests with the same naming are left to their
workstream.

Refs #10515
2026-11-16 07:56:52 +08:00
morluto f8cec67e44 refactor(mcp): bind plain-value application tools under analysis admission (#11591)
* refactor(mcp): bind plain-value application tools under analysis admission

A value binding that declares admitted: true runs under analysis admission. evaluate_reconstruction_coverage and export_environment_bundle move to the shared binding table; registerApplicationTools and its folder are removed.

* refactor(mcp): bind the managed-code workflows as session derivations (#11593)

Each managed workflow's application owner returns its sources and residual unknown; the four MCP tools bind through the shared session-derivation kind, and registerManagedWorkflowTools is removed.
2026-11-16 07:55:43 +08:00
morluto 459553b901 fix(evidence)!: require ESP flash_dump and PE unsigned attribute OIDs (#11595)
* fix(evidence)!: require ESP flash_dump and PE unsigned attribute OIDs

Both fields were optional only for Evidence recorded before REA reported
them (6.8.0 and earlier). Every producer writes them: the ESP image reader
and facts builder write `flash_dump` (null unless the file is a flash dump
read from a later address), and the PE certificate parser writes
`unsigned_attribute_oids` (null when the signer has none). They are now
required and nullable, and the inspection hint no longer branches on an
absent `flash_dump`. The ESP acceptance test that read pre-6.9 inventory
Evidence now checks that such Evidence is refused.

A call-path comment called Evidence without relationship coverage "legacy";
providers that report no coverage still produce it, so the comment now says
so.

BREAKING CHANGE: inline inventory Evidence for an ESP image root without
`format_metadata.flash_dump`, and PE certificate Evidence whose signers lack
`unsigned_attribute_oids`, are refused as invalid input. Recreate the
observation with the current REA.

Refs #10510

* test(certificates): refuse a signer without unsigned_attribute_oids; update the guide
2026-11-16 07:53:42 +08:00
morluto d15304b928 feat(cutter): name the response limit on an unknown-completion command failure (#11598)
When a Cutter response exceeded the framed transport limit after the command
was sent, the client kept the structured limit error only as message prose:
the command result's `message` named the bytes and the launch seed, and the
returned failure (completion unknown) carried no limit. The client result now
keeps that error's setting limit, and the service attaches it to the failure,
so it projects as `details.limit` (`bridge.max_request_bytes` with its
effective value and source). The test asserts the fact instead of the prose.

Refs #10508
2026-11-16 07:51:12 +08:00
morluto 332dea76a6 fix(native): keep unreported value-flow and archive coverage unknown, and exempt generation caps by reason marker (#11288)
* fix(native): keep unreported value-flow truncation and archive decode coverage unknown

* test(verify): count multiline optional-fact defaults and pin the guard's exclusions

* fix(domain): keep unknown counts and costs unknown in comparison and coverage summaries (#11325)

* fix(domain): keep unknown counts and costs unknown in comparison and coverage summaries

* refactor(verify): exempt legitimate optional-fact defaults with a reasoned marker (#11355)

* refactor(verify): exempt legitimate optional-fact defaults with a reasoned marker

The optional-fact-default guard counted request defaults and absence that
is modelled elsewhere as hidden unknowns. A comment
`// optional-fact-default: <reason>` on the default's line or the line
before now exempts it; the guard reads unstripped source for the marker and
ignores matches inside comment lines.

Marked: the two evidence paging offsets and four Swift literal reads whose
absence swiftLiteralCoverage reports. Removed instead of marked: jsdiff 9
types Change.count as required, so its two `?? 0` defaults were dead; the
evidence link traversal now carries retained records, so it no longer
re-looks them up behind `?? []`. Baseline 31 -> 22.

* fix(verify): blank comment spans instead of skipping comment-led lines in the optional-fact guard

Skipping a match whose line starts like a comment hid live code after a
leading block comment and counted defaults inside a block comment without
leading stars. The counter now blanks comment text (keeping offsets and line
breaks, skipping string literals) and matches the blanked code, while
exemption markers are still read from the original lines.

* refactor(domain): mark optional-fact defaults whose absence is not an observation (#11389)

* refactor(domain): mark optional-fact defaults whose absence is not an observation

Per-site review of the remaining optional-fact-default entries. Each marked
default is a caller option (trace ignore_fields, environment rules), a list
whose producer omits the empty case (unknown_size_frames, the schema's
min-1 representation_node_ids), caveat text whose completeness another field
carries (call diagnostics, unresolved calls, semantic resource limits), or
absence that already turns the result unknown (Wasm interface inventory,
WebMCP discovery, managed ExportedType rows, legacy integrity mismatch IDs).

Left counted: webCaptureDiff redirects (2; the CDP producer always records
them, so absence is a legacy record that should compare as unknown, not
as no redirects) and HopperCallerReconciliation (2; index-miss semantics not
yet verified). Baseline 22 -> 4.

* fix(browser): compare redirects as unknown when a capture predates redirect recording (#11402)

* fix(browser): compare redirects as unknown when a capture predates redirect recording

The CDP producer records every request's redirect chain, empty when there was none; a record without one predates redirect recording (#986). Comparing it against a current capture reported the network dimension as unchanged, treating the missing chain as "no redirects". Redirects are now compared only when both captures recorded them, and the network dimension is otherwise unknown with a reason; proven membership changes are still reported.

* refactor(hopper): interpret a caller-index miss once at the lookup (#11403)

The forward index holds observations from the examined procedures only, and relationship coverage stays unknown with the scan facts as its reason. A miss therefore adds no callers without showing there are none; the lookup now says so once instead of four optional reads defaulting at each site. The optional-fact-default baseline is now empty.

* docs(javascript): state why an omitted representation list adds no nodes

* fix(verify): count optional-fact defaults from parsed TypeScript, not comment-blanked text

The guard blanked comments with a hand-written scanner and matched a regular expression on the rest, so a default quoted in a string counted and a regular expression holding /* hid the code after it. It now walks the TypeScript syntax tree for property reads defaulted with ?? 0, ?? [] or ?? false, and reads exemption markers only from comment trivia.

* fix(verify): tokenize optional-fact defaults without a compiler and count chained defaults

* fix(verify): match whole optional-fact default expressions across calls and operators

* fix(verify): count optional-fact defaults in template substitutions and after postfix updates, and tie markers to their own expression

* refactor(verify): exempt generation and sample caps from the constant-maximum-slice guard by reason marker (#11454)

* refactor(verify): exempt generation and sample caps from the constant-maximum-slice guard by reason marker

* fix(verify): read reason markers only from real line comments

* fix(verify): read reason markers from the shared source tokenizer

* fix(verify): read a regular expression after a control head as a statement start

The shared tokenizer treated every closing parenthesis as the end of an operand,
so in `if (ready) /[/*]/.test(v)` it read `/[` as division and `/*` inside the
regex as a block comment, hiding the rest of the file from the marker-aware
guards. Parentheses are now tracked: the `)` closing an if/while/for/with head
allows a regular expression, while a call's `)` still means division.

* fix(verify): keep a keyword-named member call out of control-head detection

`policy.if(ready) / (…)` was read as an if-statement head, so the division was
taken for a regular expression and the denominator's optional-fact default was
not counted. A control keyword after `.` or `?.` is a member call.

* refactor(verify): exempt budget-arithmetic cursors and tallies by a not-an-allowance marker (#11493)

* refactor(verify): exempt budget-arithmetic cursors and tallies by a not-an-allowance marker

The budget-arithmetic guard cannot tell a scan cursor, an observed total, a
string being assembled or a tail buffer's retained length from an allowance
when each is compared with a limit. A field declaration marked
`// not-an-allowance: <reason>` (read through the shared reason-marker scan)
is no longer counted. The four remaining sites carry a marker, so the
baseline is empty and removed.

* refactor(verify): exempt detail levels, lifecycle states and domain vocabularies from the completeness-enum guard by reason marker (#11510)

A zod enum containing "complete" is counted as a local coverage vocabulary. Eleven
are not coverage: a caller-chosen detail level, how far a command or session
ran, and format states (GPU decode depth, WASM name section, SQLite column
details). They now carry `// detail-level:`, `// lifecycle-state:` or
`// domain-vocabulary:` with a reason, read through the shared reason-marker
scan (which gains an optional predicate for the matches a guard counts).
local-completeness-enum: 22 -> 11 on this branch.

* fix(verify): bind a not-an-allowance marker to its own class field

Exemptions were a file-wide set of names, so a marked tally in one class hid an
unmarked allowance with the same name in another, and a marked object property
could exempt a class field. Markers now exempt only a member declaration (at
class member depth) of the top-level class that contains it, and the named-
allowance count is taken per class so the same scoping applies to it.

* fix(artifacts): keep main's resources import in the Deno standalone reader after merging main

* fix(verify): start an expression after a template substitution and a non-member keyword, and accept any marker reason

The shared tokenizer read the `/` after `${` as division, so a regular
expression holding `/*` in a substitution hid the rest of the file from
every tokenizer-based guard, and it treated property names such as
`row.return` as keywords. Tokens now record whether template text opens a
substitution and whether a name is an expression keyword (not after `.` or
`?.`), and the regular-expression rule and the optional-fact-default operand
rule read those facts. The optional-fact-default guard reads markers through
reason-marker's isReasonMarker, so any non-empty reason exempts, as for the
other reason markers.

* fix(verify): blank comments with the shared tokenizer before matching architecture guards (#11573)

* fix(verify): blank comments with the shared tokenizer before matching architecture guards

The guards stripped comments with a regular expression that took a `/*`
inside a string, template or regular expression for a comment opener and
deleted code up to the next `*/`. src/flutter/FlutterBuildProvider.ts's
"lib/*/libapp.so" text hid four --pool-policy remediation strings from
cli-option-text-outside-cli. blankComments in source-tokens.mjs now owns
comment removal for the architecture guards and the reason-marker scan: it
blanks comment tokens in place (newlines kept) and keeps strings, templates
and regular expressions. The scan behind it retains only the last tokens it
reads, and whitespace runs are skipped at once.

The cli-option-text-outside-cli baseline records FlutterBuildProvider.ts at
its true count of 4; no other baseline changed.

Fixes #11477

* fix(verify): read a regular expression after a statement block and keep comment offsets for wide characters

The tokenizer now records whether each `{` opens a statement block or an
object literal (from the token before it) and marks the `}` that closes a
block, after which a statement, and so a regular expression, can start; an
object literal's `}` still ends an operand. blankComments replaces each run
of comment text with one space per UTF-16 unit, so a surrogate pair no longer
shifts later offsets.

* chore(verify): drop the Flutter CLI-text baseline entry now that main names no option there
2026-11-16 07:40:30 +08:00
morluto ff6467ca97 feat(debuggers): name why an owned debugger stop is incomplete (#11517)
* feat(debuggers): name why an owned debugger stop is incomplete

Owned debugger stop results carry a cleanup code; retained Rizin and GDB
cleanup failures project it as details.diagnostics.debugger_cleanup, close-all
failures carry it, and GDB detach refusals name multiple inferiors, a missing
durable output sink, unknown inferior state or a changed inferior TTY.
GdbSessionManagerCoverage asserts the codes instead of reason prose.

* fix(debuggers): put the cleanup code on every returned failure

incompleteStopFacts builds the cleanup observation and debugger_cleanup
diagnostic together, so GDB startup, cancellation and timeout failures carry
the code; Rizin's composed cleanup failure retains it at its top level; and
one-shot debug commands report debugger_cleanup_codes from the close-all
failure.
2026-11-16 07:33:16 +08:00
morluto af0db09605 refactor(resources): move the directory artifact reader into src/resources (#11520) 2026-11-16 07:32:08 +08:00
morluto 44071f9b97 refactor(domain): move retained web-script capture selection into domain and script publication into application (#11576) 2026-11-16 07:30:32 +08:00
morluto 33557c4715 refactor(mcp): bind the application workflows through an application binding kind on the shared table (#11578)
Thirteen application tools (feature and semantic traces, version, endpoint,
source-to-bundle and export-shape comparisons, API contract, NTFS journal and
Playwright trace inspections, the obligation ledger and the three mobile graph
projections) each had a bespoke registration repeating admission, retention
checks, logging, source retention, unknown recording and view delivery.

The shared table gains an application binding kind: a workflow that returns
the completed Evidence, its sources and its residual unknown, and an optional
view selector. One handler runs it under analysis admission, refuses a view
or summary before running when the complete Evidence cannot be retained,
delivers a failure's partial Evidence, and stages the view against the
completed Evidence before recording (deliverApplicationExecution, moved from
registerApplicationTools/helpers.ts). The comparison unknowns and the ledger's
request resolution move to src/application/ApplicationToolExecutions.ts with
their exact question text, so recorded unknown identities do not change.
2026-11-16 07:28:20 +08:00
morluto 2430b081c9 refactor(providers): bind provider refusals' per-call controls instead of naming CLI flags (#11455)
* refactor(native): bind producer_limits and max_input_bytes as the per-call controls of pwntools and Apple dispatch refusals

producerLimitControl in src/domain/producerResourceLimits.ts names one producer budget as producer_limits.<field>; the shared provider outcome classifier now carries a resource signal's limit. Pwntools file-size, CPU and output refusals and the Apple dispatch input refusal bind their control, and their remediation no longer names CLI flags.

* fix(native): report the selected output allowance as the omitted file_bytes default

* fix(native): bind producer_limits.diagnostic_bytes as the pwntools command output-limit control

* refactor(rust): bind producer_limits as the per-call control of Rust input and report refusals (#11458)

* refactor(rust): bind producer_limits as the per-call control of Rust input and report refusals

* test(rust): cover the complete-report refusal's producer_limits control

* refactor(browser): bind caller-selectable browser deadlines as per-call controls instead of naming CLI flags (#11466)

* refactor(rust): bind producer_limits as the per-call control of Rust input and report refusals

* test(rust): cover the complete-report refusal's producer_limits control

* refactor(browser): bind caller-selectable browser deadlines as per-call controls instead of naming CLI flags

deadlineParameterLimit in src/domain/analysisResourceLimits.ts owns the millisecond deadline control that nativeDeadlineRecovery and the browser recoveries share. CDP command and discovery, web bundle per-script and total, network capture and source-map decode deadlines now carry it; browserDeadlineIncrease no longer takes CLI flag text.

* fix(browser): record a per-script deadline's parameter control in partial web bundle results

* refactor(providers): bind Wabt, SQLite, EVMole, Apktool and Go controls instead of naming CLI commands (#11472)

* refactor(providers): bind Wabt, SQLite, EVMole and Apktool deadline and byte controls instead of naming CLI commands

These remediation strings named rea commands and flags through template text the cli-option guard did not count. Wabt byte refusals and output limits bind max_input_bytes, max_tool_bytes or max_output_bytes while a larger value is selectable; SQLite worker_timeout_ms, EVMole timeout_ms and Apktool decode_timeout_ms bind through deadlineParameterLimit; the shared provider outcome classifier now carries an output limit's control.

* refactor(go): bind Go analysis budgets as per-call controls instead of naming CLI flags

* fix(providers): keep the typed primary when Wabt, EVMole or pwntools command cleanup fails

* ci(guards): count template-built CLI option and command text outside the CLI layer (#11478)

* refactor(providers): bind Wabt, SQLite, EVMole and Apktool deadline and byte controls instead of naming CLI commands

These remediation strings named rea commands and flags through template text the cli-option guard did not count. Wabt byte refusals and output limits bind max_input_bytes, max_tool_bytes or max_output_bytes while a larger value is selectable; SQLite worker_timeout_ms, EVMole timeout_ms and Apktool decode_timeout_ms bind through deadlineParameterLimit; the shared provider outcome classifier now carries an output limit's control.

* refactor(go): bind Go analysis budgets as per-call controls instead of naming CLI flags

* fix(providers): keep the typed primary when Wabt, EVMole or pwntools command cleanup fails

* ci(guards): count template-built CLI option and command text outside the CLI layer

The cli-option-text-outside-cli pattern now also matches "(CLI ...", "on the CLI", "or use rea ..." and backticked `rea <command>` references, so remediation built from a template such as --${name} or rea inspect-... <path> is counted. Doctor.ts is exempt: setup and doctor run only through the CLI. The baseline records the newly counted pre-existing sites (22 -> 45 across 21 files).

* ci(guards): extract the CLI text matcher, exempt host-only commands with written reasons, and test each spelling

* ci(guards): exempt a host-only command and its own arguments in any matched CLI phrase

* fix(native): bind producer_limits.output_bytes for oversized pwndbg debugger replies through one owner

* fix(cli): name an Evidence target source failure's control by the source option that sets it

* feat(cli): render the flags of result-recorded controls in the full-output envelope (#11507)

* feat(cli): render the flags of result-recorded controls in the full-output envelope

* fix(cli): collect result controls only for a full-output envelope, in its requested format, past undefined values

* ci(guards): end a host-only command's arguments before the next CLI command

* refactor(reverse): record the output budget that stopped a one-shot command as a parameter control (#11528)

* fix(cli): read result controls only at positions the output schema declares as recorded controls

* refactor(providers): record the controls that bounded Rust compiler paths and kernel module text instead of naming CLI options (#11532)

* refactor(rust): record the control that bounded compiler-path coverage instead of naming CLI options

* refactor(native): record the controls that omitted kernel module .modinfo text instead of naming CLI options (#11534)

* fix(rust): describe compiler coverage from the retained result after report trimming

* refactor(providers): record managed representation and JavaScript semantic ceiling controls instead of naming CLI options (#11537)

* refactor(managed): record the representation budget on a resource-limit issue instead of naming its CLI option

* refactor(javascript): record the semantic retention ceilings that stopped a graph instead of naming CLI options (#11540)

* fix(cli): name a composed command's source options for the controls its result records

* fix(cli): read result controls from the delivered Evidence when a summary wraps it

* fix(rust): keep the report-byte control recorded when trimming omits every compiler path

When the complete-report allowance left room for no compiler path, rustc_commit became null and its coverage.limit was lost, so --full-output could not name the option that raises the allowance. The report now records rustc_commit_omission { reason, limit } outside the dropped record, and the summary view carries it.

* refactor(flutter): record the string-pool budgets that left a projection partial instead of naming the CLI option (#11541)

* refactor(flutter): record the string-pool budgets that left a projection partial instead of naming the CLI option

* test(flutter): assert the complete set of recorded string-pool budgets

* feat(cli): name the options of controls a failure's partial Evidence records (#11557)

meta.cli_controls was collected only from a successful result. A failure whose partial observation is Evidence of the command's own operation is now read the same way, at the positions the output schema declares as recorded controls; Evidence of another operation or a retained reference is not read. When --evidence_output publishes the partial, the delivery records it before replacing it.

* refactor(javascript): record the evaluator budgets that limited sources instead of naming the CLI option (#11564)

Per-value unknown reasons and the Electron wrapper limitation named --semantic-precision. The static examination now records the semantic_precision controls that limited a source (examination.controls), and analyze_javascript_application's semantic_graph.coverage.controls records every evaluator budget that limited any source (examination and semantic IR coverage), beside the retention ceilings. The CLI renders --semantic-precision from those records in meta.cli_controls; the reason texts name only the contract field.
2026-11-16 07:12:16 +08:00
morluto ff0176256a feat(snapshots)!: persist the target identity as the snapshot target (#11551)
* feat(snapshots)!: persist the target identity as the snapshot target

The snapshot target is now `{ kind, identity }`, where `identity` is the
FileTargetIdentity that `binaryTargetIdentity` produces and `kind` is the
binary kind query IDs commit to. The per-format target projection and
`snapshotTargetIdentity` are deleted; the schema checks the format's
selection, architecture and kind instead of keeping one union arm per format.

Entry execution subjects use the Evidence subject shape (file or explicit
unknown), so a snapshot entry commits to the same identity, including the
selection, as its Evidence record. Workflow entries take the subject of the
workflow's own Evidence. Replay no longer re-derives the selection from the
open target.

`FileTargetSelection` gains `universal-slice` (`offset`, `size`, and the FAT
`cpu_type`/`cpu_subtype` when target admission supplied the FAT table, else
null). `binaryTargetIdentity` produces it for `mach-o-universal` targets, so
Evidence and snapshots for different slices of one container no longer share
an identity.

Refs #11417

BREAKING CHANGE: analysis snapshot files change shape: `target` is
`{ kind, identity: { kind: "file", sha256, format, architecture, selection } }`
and entry `execution.subject` is the Evidence subject
(`{ identity, name, local_path }`, never null). Snapshot binding mismatch
details report `target.snapshot`/`target.selected` in the same shape. Evidence
IDs of universal Mach-O targets change because their subject identity now
carries the selected slice. Recreate saved snapshots and Evidence bundles of
universal Mach-O targets.

* docs(evidence): name the universal Mach-O slice selection in the subject contract

* fix(snapshots): read the snapshot target identity in the Ghidra verification scripts

The real Ghidra snapshot checks (lifecycle, RISC-V, MIPS, PowerPC) read
snapshot.target.sha256 and .architecture, which moved under
snapshot.target.identity, so they would fail after saving a valid snapshot.

* feat(evidence)!: name live browser page Evidence by its page URL (#11559)

Browser page observations (inspect_web_page, analyze_web_bundle,
observe_web_session, discover_webmcp_tools, capture_web_screenshot,
observe_web_execution, inspect_web_event_listeners) named an unknown
(`not-observed`) subject although the provider reports the page URL.

`TargetIdentity` gains a `url` kind: the reported URL with userinfo removed
and its origin (`null` for an opaque origin). The schema refuses a URL that
carries userinfo or an origin the URL does not have.
`browserUrlTargetIdentity` in the browser URL owner builds it from the
provider's reported URL; a withheld or unparseable URL stays unknown
(`not-observed`). Target lists and comparisons still name no single
document. Analysis views keep their parent's URL subject, as they already
keep a file subject.

BREAKING CHANGE: Evidence IDs of live browser page observations and their
analysis views change, and their subject is
`{ "kind": "url", "url", "origin" }` with `name` and `local_path` null.
Recreate stored Evidence for these tools. This lands inside Evidence format
revision 2 under the release hold (#11417); no `evidence_format` bump.
2026-11-16 07:04:34 +08:00
morluto a447161a84 test(cutter): keep Cutter command Evidence subjects not-observed (#11561)
Cutter reports the path of the file it opened, but REA neither opens nor
hashes it, so the Evidence subject stays unknown (not-observed). Assert it so
a later change cannot bind the subject to the reported path.
2026-11-16 07:02:19 +08:00
morluto 072b5787b6 refactor(resources): move the ZIP artifact reader into src/resources (#11525) 2026-11-16 06:49:01 +08:00
morluto 55c317d2b6 refactor(domain): give the binary target filesystem failure projection a domain owner (#11531) 2026-11-16 06:47:48 +08:00
morluto 412d621fd1 refactor(domain): move the .NET metadata readers into src/domain/managed (#11544) 2026-11-16 06:45:42 +08:00
morluto 807dd1742f refactor(pe): move the PE resource parser into domain with domain parse failures (#11550)
The I/O-free PE resource tree parser moves from src/artifacts/pe to src/domain/pe and reports malformed structure, decode budgets and cancellation through the domain parse failure algebra. artifactParseFailure in src/resources maps those onto artifact reader reasons at each provider's boundary, so native no longer imports artifacts.

Fixes #11527
2026-11-16 06:43:33 +08:00
morluto c965d2346b refactor(resources): move artifact failure translation into resources and declare JavaScript reconstruction's artifact entries (#11558)
refactor(resources): give artifact failure translation to resources and declare JavaScript reconstruction's artifact entries

translateArtifactFailure projects ArtifactReaderFailure, which src/resources owns, and depends only on resources and domain, so it moves to src/resources and is exported from its index. JavaScript reconstruction drives the canonical inventory scan, the format reader and the source read inside one resource scope; those three artifacts files are declared entry files. application -> artifacts past-entry imports go from 7 to 1 (the ZIP reader, moved by #11525).

Refs #11359
2026-11-16 06:42:44 +08:00
morluto e77793e09a perf(mcp): canonicalize the tool catalog once per digest profile (#11298)
* perf(mcp): canonicalize the tool catalog once per digest profile

* test(mcp): compare the composed combined digest with whole-document canonicalization
2026-11-16 06:30:35 +08:00
morluto 1f24b3fa57 feat(evidence)!: name the Evidence subject by its target identity (format revision 2) (#11416)
* feat(evidence)!: name the Evidence subject by its target identity (format revision 2)

The Evidence subject carries subject.identity (kind, sha256, format,
architecture, selection) and the Evidence ID commits to it, so raw/DOL
entry points and ESP flash offsets of the same bytes are different
subjects. Every record declares evidence_format: 2; revision 1 bundles,
standalone records and snapshots are refused with the recreate guidance.
binaryTargetIdentity is the one projection of an open target, used by
Evidence and snapshot comparison.

BREAKING CHANGE: Evidence format revision 2. Evidence IDs commit to the
subject's target identity (subject.identity, including the raw/DOL entry
point or ESP flash offsets), and every record declares evidence_format: 2.
Evidence bundles, records and analysis snapshots from earlier releases are
refused; recreate the observations with this release.

* refactor(analysis-view): read parent subjects through the Evidence identity accessors (#11423)

Analysis views compare their parent's file identity (evidenceFileTarget)
and take path and digest from evidenceSubjectTarget instead of reading
the subject's digest, format and architecture members, which duplicate
subject.identity until they are removed. A counted guard
(evidence-subject-declaration-read) keeps new direct reads out and
records the 20 remaining files.

* fix(evidence): carry format refusals through Evidence readers and bind target selections

- safeParseEvidence/safeParseImmutableEvidence return the format refusal as
  an expected failure; every consumer maps it to the one integrity refusal
  with the recreate guidance. An unmarked object is an earlier record only
  when it has every member records have always carried.
- ArtifactProvider inventory roots and provider subjects that name the
  target's own bytes carry the target's selection (ESP flash offsets).
- Snapshot rows bind only Evidence whose identity, selection included,
  matches the snapshot target.
- Entry-point selections use the raw-binary entry point form.

* fix(evidence): refuse unauthenticated or earlier-format records instead of reading them as absent

- recognizeEvidence (evidenceValidation) replaces tryParseEvidence: input
  without an evidence_id is not Evidence (ok(undefined)); a record that names
  one but fails authentication or is from another format revision is an
  EvidenceIntegrityError carrying the recreate guidance, never undefined.
- Direct analysis retains that refusal as a secondary failure instead of
  silently skipping source capture; cleanup projection, source-closure
  annotation and the flutter, debugger and release-exposure recoveries use
  the same owner (the last three previously read the unauthenticated schema).
- A desktop capture.json from an earlier format is refused with the recreate
  guidance instead of "not desktop application capture Evidence".

* fix(evidence): advertise revision 2 ledger examples and rank delivery omissions by serialized size

- The obligation ledger and reconstruction coverage examples named
  evidence_format 1, which revision 2 refuses; they now use
  EVIDENCE_FORMAT_REVISION.
- MCP delivery chose which unretained recovery to omit by a parsed-storage
  lower bound clipped at the response budget. Once revision 2 subjects made
  the source record's estimate cross the budget, both candidates tied at the
  clip and the smaller source was omitted ahead of the larger completed
  observation. Candidates are now ranked by serialized size, which is what
  the budget counts.

* refactor(native): compare function snapshots by their Evidence target identity (#11450)

Function snapshots carry the subject's file target identity instead of the
duplicated subject declaration. Call paths and function comparisons compare
targets through sameTargetIdentity, so the same bytes opened at a different
raw entry point or ESP flash offset no longer count as one coordinate space:
build_call_path refuses the mix, and compare_functions no longer matches
entries by address across selections. Structural candidates and native
function matching read the architecture and digest through
evidenceFileTarget.

Refs #11417

* refactor(artifacts): compare artifact and WASM summaries by their Evidence target identity (#11461)

Artifact comparison authenticates a summary against its retained inventory
through sameTargetIdentity and rebinds the alias with the whole target,
selection included, so a flash-selected inventory summary taken under an
alias path is no longer refused. WASM comparison, the analysis view
artifact projection and the inventory root check read the digest, format
and display path through the Evidence identity accessors.

Refs #11417

* refactor(evidence): read record subjects through the identity accessors in JS, managed, ledger and bundle readers (#11470)

JavaScript application graphs, runtime reconciliation, managed inspection
and native verification sources, the record summary filter, the ledger's
residual-unknown target and bundle scope selection read the subject digest,
format and display path through evidenceFileTarget and
evidenceSubjectDisplay. No comparison changes: each reader matches one
record's facts against its own payload or a caller filter.

Refs #11417

* refactor(evidence)!: name the Evidence subject only by its target identity (#11497)

* refactor(evidence)!: name the Evidence subject only by its target identity

The subject keeps `identity` and the display facts `name` and `local_path`.
The duplicated `digest`, `format` and `architecture` members are removed; the
format-owned declaration now validates the identity itself. Readers the type
checker found move to the owner accessors; untyped reads in verify scripts,
the efficiency harness and test matchers move to `subject.identity`. The
`evidence-subject-declaration-read` text guard and its baseline are deleted.

Fixes #11473
Refs #11417

BREAKING CHANGE: the Evidence subject no longer has `digest`, `format` or
`architecture`; read `subject.identity.sha256`, `subject.identity.format` and
`subject.identity.architecture`. A record that still carries them is refused.

* test(evidence): give the Flutter verifier fixture the identity subject and check the DOL declaration without the ID

* test(evidence): drop the removed subject members from the declaration matrix and tamper fixtures

* feat(evidence)!: give every Evidence record an explicit subject identity (#11536)

* feat(evidence)!: give every Evidence record an explicit subject identity

A producer that cannot name a file passes an `unknown` target identity
with a closed reason (derived-from-linked-evidence, not-observed,
unsupported-subject) instead of no subject. The subject is non-null;
unknown subjects have no display facts. The generic missing-subject
limitation and `subjectUnavailableReason` are removed; producer-specific
explanations are ordinary limitations. Comparison identity requires the
derived unknown, and null-subject consumers ask the owner accessors.

Refs #11417

BREAKING CHANGE: every Evidence record has a subject. A record without a
file target names `subject.identity` `{ "kind": "unknown", "reason": … }`
with `name` and `local_path` null, instead of `subject: null` and the
limitation "Artifact identity is unavailable for this observation.".
Their Evidence IDs change.

* fix(evidence): name explicit unknown subjects in JavaScript callers and keep a managed graph's file subject

The verification scripts are not type-checked, so five createEvidence
callers still passed undefined (or a missing first target) after the subject
became required. They now pass unknownTarget("not-observed").

A managed application graph chose the first present input subject. Every
subject is now present, so an unknown artifact subject hid a file subject on
the member or boundary Evidence. The graph now takes the first input subject
that names a file.

* test(evidence): assert the subject kind instead of a presence the type now guarantees

Every Evidence record has a subject after this change, so test guards and
assertions that checked it for null always passed. Each now checks that the
fixture subject names a file, or is removed where a later fileIdentity,
fileSubjectTarget or fileSubjectDisplay call already requires that. Non-null
assertions on Evidence subjects are removed; analysis-view inputs, whose
subject is optional, keep an undefined check.

* test(evidence): expect the Evidence subject format under its identity

Two boundary tests still matched subject.format, which slice 2e moved into
subject.identity. toMatchObject is not type-checked against the Evidence
shape, so they failed only when run (the signature test on macOS).
2026-11-16 06:28:01 +08:00
morluto a20c6590f3 refactor(providers): move the native command runner into the shared provider core (#11462) 2026-11-16 06:26:52 +08:00
morluto 11a7ac93cc fix(mcp): report ENOTCONN on stdio as a lost connection (#11490)
The CLI already treats ENOTCONN on stdout as a closed reader (#11275).
The MCP transport classifier still reported it as an unknown transport
error. It now shares one set of peer-gone codes: EPIPE, ECONNRESET and
ENOTCONN.

Fixes #11362
2026-11-16 06:24:39 +08:00
morluto 928b9df5c0 perf(test): supervise the GDB fixture safety child from launch (#11491)
The backstop supervisor was created in the finally block after the
child had already closed, so it never observed the close and waited out
the 1 s output-close grace. Create it at launch, as the JADX fixture
does since #11283.

Fixes #11363
2026-11-16 06:23:32 +08:00
morluto b305b82a1a refactor(domain): move the PNG visual diff into src/domain (#11496) 2026-11-16 06:22:40 +08:00
morluto 5d3e1dc9cd refactor(mcp): bind analysis settings and session-derived comparison tools through the shared binding table (#11511)
* refactor(mcp): bind analysis settings tools through the shared binding table and count bespoke registrations

* refactor(mcp): bind inspect_analysis_view through the shared binding table (#11514)

* refactor(javascript): bind JavaScript source analysis in composition (#11467)

* refactor(mcp): bind inspect_analysis_view through the shared binding table

* ci(guards): count typed tool registrations and name each registration owner with its reason

* refactor(mcp): bind session-derived comparison tools through a derived binding kind on the shared table (#11547)
2026-11-16 06:18:49 +08:00
morluto 16bee3ea21 refactor(domain): move the Android JNI library and native export parsers into domain (#11513) 2026-11-16 06:16:54 +08:00