docs: document roadmap analysis workflows
This commit is contained in:
@@ -5,11 +5,11 @@ REA can attach to a user-owned Chrome-family browser through the Chrome DevTools
|
||||
## Shipped surfaces
|
||||
|
||||
- `list_browser_targets` / `rea list-browser-targets` discovers page targets whose current URL matches an approved exact origin.
|
||||
- `inspect_web_page` / `rea inspect-web-page` captures bounded DOM structure, accessibility nodes, scripts, resources, safe response/DOM metadata, attach-window network and console metadata, WebSocket frame sizes, workers, quota, and optionally storage key names or script sources.
|
||||
- `inspect_web_page` / `rea inspect-web-page` captures bounded DOM structure, accessibility nodes, scripts, resources, safe response/DOM metadata, attach-window network and console metadata, WebSocket frame sizes, workers, quota, and optionally storage key names, redacted storage-content fingerprints, or script sources.
|
||||
- `analyze_web_bundle` / `rea analyze-web-bundle` parses approved script artifacts without execution and derives chunk edges, route and endpoint candidates, vendor fingerprints, static WebMCP declarations, and optionally approved source-map/original-source evidence.
|
||||
- `observe_web_session` / `rea observe-web-session` arms a bounded window for an external user action and records ordered reload, SPA navigation, redirect, failure, lifecycle, and target-termination metadata.
|
||||
- `discover_webmcp_tools` / `rea discover-webmcp-tools` uses the experimental CDP WebMCP domain to inventory page registrations. REA never exposes `WebMCP.invokeTool`.
|
||||
- `compare_web_captures` / `rea compare-web-captures` compares stable DOM, script, resource, network, metadata, and optional WebMCP identities without treating incomplete absence as equivalence.
|
||||
- `compare_web_captures` / `rea compare-web-captures` compares passive captures or exact-step-aligned browser scenarios. Scenario results commit reproducible literal normalization and expose alignment failures plus artifact-level action, screenshot, DOM, accessibility, URL, history, storage, and event differences. Missing or truncated evidence is never treated as equivalence.
|
||||
- `capture_web_screenshot` / `rea capture-web-screenshot` returns an explicitly approved, bounded, content-addressed visible-viewport PNG.
|
||||
- `compare_web_screenshots` / `rea compare-web-screenshots` performs bounded local PNG pixel comparison without OCR or external services.
|
||||
- Every surface has equivalent CLI and MCP contracts and returns Evidence v2 provenance.
|
||||
@@ -96,7 +96,7 @@ rea inspect-web-page http://127.0.0.1:9222 TARGET_ID \
|
||||
--json
|
||||
```
|
||||
|
||||
Accessibility text and script content may contain application secrets and become part of the returned Evidence. Accessibility and console text have independent per-field and aggregate UTF-8 byte limits; credential-shaped console substrings are redacted. JSON and WebSocket captures retain paths, types, counts, and truncation only, never values or examples. Storage values remain redacted even when key-name capture is approved.
|
||||
Accessibility text and script content may contain application secrets and become part of the returned Evidence. Accessibility and console text have independent per-field and aggregate UTF-8 byte limits; credential-shaped console substrings are redacted. JSON and WebSocket captures retain paths, types, counts, and truncation only, never values or examples. Storage values remain redacted even when key-name capture is approved; SHA-256 identity/value fingerprints support comparison only when cookies, DOM storage, IndexedDB, and Cache Storage were all captured completely.
|
||||
|
||||
Screenshot pixels require both `--approved` and `--screenshot-approved`:
|
||||
|
||||
@@ -141,7 +141,7 @@ REA removes sensitive values before normalized event data is retained:
|
||||
- Request/response bodies are not requested or parsed by default. With independent approval, only allowed-origin JSON media types are read within per-body and aggregate budgets, converted immediately to value-free property paths/types, and discarded. `Network.getResponseBody` is never sent without that approval.
|
||||
- Console observations with an approved stack source retain call type, argument types, timestamp, and redacted source location. With independent approval, only already-delivered primitive values are retained after credential redaction and byte bounds; objects, getters, and remote properties are never expanded.
|
||||
- WebSocket observations retain direction, opcode, and payload byte length. With independent approval, bounded text frames are classified as text or 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 are omitted unless explicitly requested.
|
||||
- Storage observations always redact values. Key names, IndexedDB names, cache names, and stable content fingerprints are omitted unless explicitly requested. Cache bodies above 64 KiB and partial IndexedDB remote objects make fingerprint coverage incomplete, so identical observations remain `unknown`.
|
||||
- Script metadata is included only when CDP supplies a URL on an allowed origin. Stable keys exclude transient CDP script IDs, and exact transient raw URLs are used only during script/resource reconciliation. URL-less scripts are excluded because their origin cannot be established. When CDP supplies an execution-context association, the accepted script retains its authorized frame ID for later attribution. Source content is omitted unless explicitly requested and becomes a self-verifying `rea://web-content/sha256/...` artifact subject to per-script and aggregate byte limits.
|
||||
|
||||
Cross-origin frames, resources, scripts, events, and workers are excluded unless their exact origins are also approved. Excluded target details are counted without being exposed.
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
# Browser scenario contract
|
||||
|
||||
`capture_browser_scenario` accepts the versioned provider-neutral
|
||||
`browserScenarioSchema` through both MCP and the
|
||||
`capture-browser-scenario INPUT_JSON` CLI command. Version 1 is declarative and
|
||||
bounded: it admits a fixed action vocabulary, exact HTTP(S) origins,
|
||||
deterministic browser settings, explicit storage and request replay, and finite
|
||||
capture limits. `INPUT_JSON` may be inline JSON or a JSON file path.
|
||||
|
||||
The browser boundary is part of the contract. Launch mode requires a
|
||||
caller-selected absolute executable, a provider-owned temporary profile,
|
||||
headless operation, and close-plus-delete cleanup. Connect mode accepts only an
|
||||
explicit-port loopback CDP endpoint, declares the browser externally owned, and
|
||||
permits disconnect-only cleanup. The Playwright driver preserves this
|
||||
distinction: it closes and deletes provider-owned profiles, but only disconnects
|
||||
from an external CDP browser. Real-browser verification checks both outcomes and
|
||||
confirms that an attached external browser remains alive.
|
||||
|
||||
URLs contain a query-free HTTP(S) base plus ordered query entries. Every query,
|
||||
form, storage, cookie, and replay value is either an explicitly public literal
|
||||
or a reference to a declared environment-backed secret. Raw credentials in
|
||||
URLs and literal credential headers are rejected. Secret query names must also
|
||||
appear in the redaction policy, and the required credential headers cannot be
|
||||
removed from that policy. Durable results must replace resolved secret values
|
||||
with their secret references.
|
||||
|
||||
Every start, navigation, storage, replay, and redirect origin must be listed in
|
||||
`allowed_origins`. Unsupported action tags, unknown fields, duplicate step or
|
||||
route IDs, undeclared or unused secrets, and provider-owned replay headers fail
|
||||
validation. HTTP and WebSocket routing enforces the same declared scope. Exact
|
||||
replay may abort unmatched requests or pass through only approved origins.
|
||||
|
||||
The result is Evidence v2 with an initial state followed by one record per
|
||||
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 bounded by the scenario limits. Missing and truncated sections remain
|
||||
explicit and make the capture ineligible for equality claims. Attach-mode
|
||||
captures also declare the unavoidable pre-attach event gap.
|
||||
|
||||
Browser automation is disabled by default. The administrator ceiling is
|
||||
configured with:
|
||||
|
||||
- `REA_BROWSER_SCENARIO_ENABLED`
|
||||
- `REA_BROWSER_SCENARIO_EXECUTABLE_ROOTS_JSON`
|
||||
- `REA_BROWSER_SCENARIO_CDP_ENDPOINTS_JSON`
|
||||
- `REA_BROWSER_SCENARIO_ALLOWED_ORIGINS_JSON`
|
||||
- `REA_BROWSER_SCENARIO_ALLOWED_ENV_JSON`
|
||||
|
||||
Unlike passive observation, browser automation is not granted automatically.
|
||||
Use an explicit project/session grant, or opt into the administrator grant with
|
||||
`REA_BROWSER_SCENARIO_AUTO_GRANT=true` for a trusted unattended environment.
|
||||
Authorization commits the exact executable or CDP endpoint, origins, environment
|
||||
variable names, network class, and scenario digest before any browser side
|
||||
effect.
|
||||
|
||||
## Scenario comparison
|
||||
|
||||
`compare_web_captures` and `compare-web-captures` also accept two complete
|
||||
browser scenario captures. Steps align only by exact, unique `step_id`.
|
||||
Duplicate IDs, missing counterparts, changed action kinds, and incompatible
|
||||
browser/origin capture context are returned as alignment failures. They prevent
|
||||
an unchanged claim; observed differences may still prove a changed result.
|
||||
|
||||
The comparison records its full normalization commitment and SHA-256 digest.
|
||||
Built-in rules exclude step elapsed time and event sequence/index fields,
|
||||
compare screenshots by content digest, and compare DOM/accessibility captures
|
||||
by normalized text. Optional caller rules are bounded exact-literal
|
||||
replacements over named artifact kinds. Rules and artifact-kind lists are
|
||||
sorted canonically before application, making the same policy reproducible
|
||||
regardless of input order. Rules operate only on already-redacted durable
|
||||
capture fields and are preserved in the result.
|
||||
|
||||
Each aligned step reports changed, unchanged, or unknown. Changed and unknown
|
||||
action, screenshot, DOM, accessibility, URL, history, storage, and event
|
||||
artifacts carry their normalized before/after digests and capture states.
|
||||
`max_changes` bounds retained artifact records while total and omitted counts
|
||||
remain visible. Missing, truncated, or mismatched capture coverage remains
|
||||
unknown instead of being treated as equality.
|
||||
@@ -3,8 +3,9 @@
|
||||
REA derives a bounded feature trace from one authenticated JavaScript
|
||||
Application Graph and compares two authenticated graph versions. The MCP tools
|
||||
are `trace_application_feature`, `trace_javascript_semantics`,
|
||||
`compare_application_versions`, and `compare_javascript_export_shapes`; their
|
||||
CLI equivalents use the same names with hyphens.
|
||||
`compare_application_versions`, `compare_source_to_bundle`, and
|
||||
`compare_javascript_export_shapes`; their CLI equivalents use the same names
|
||||
with hyphens.
|
||||
|
||||
Both workflows consume Evidence v2 produced by
|
||||
`analyze_javascript_application` or `reconcile_javascript_runtime`. They do not
|
||||
@@ -46,14 +47,22 @@ function, module, seed-match, and page limits are validated against exact
|
||||
published ranges. A committed cursor returns the next deterministic relation
|
||||
page only for the same graph, query, and limits.
|
||||
|
||||
The initial extractor covers lexical definitions and reads, closure captures,
|
||||
and uniquely resolved local calls with argument-to-parameter and direct
|
||||
return-to-call candidates. Dynamic calls/properties, parser recovery, and bound
|
||||
frontiers stay explicit. Promise, event, timer, child-process, request,
|
||||
configuration, boundary, resource, and fingerprint families are represented by
|
||||
the versioned schema but report unsupported or unknown coverage until their
|
||||
extractors supply facts. Missing relations in those families are never reported
|
||||
as proven absence.
|
||||
The extractor covers lexical definitions and reads, literal seeds, static
|
||||
property slots, object reads/writes/spreads/destructuring, closure captures,
|
||||
uniquely resolved local calls, argument/return flow, and explicit Promise
|
||||
construction, chaining, aggregation, await, return, assignment, and
|
||||
detachment. It also recovers bounded static candidates for EventEmitter
|
||||
registrations/removals and dispatch, Node timers and cancellation handles, asynchronous
|
||||
`node:child_process` creation and ownership, configuration sources and direct
|
||||
defaults, request construction and response consumers, parse/coercion/
|
||||
validation boundaries, and built-in resource acquisition/release.
|
||||
|
||||
Function fingerprints commit normalized syntax, control-flow shape, relation
|
||||
shape, literal sets, arity, and detected effects without using local names or
|
||||
source offsets. Equal duplicate fingerprints remain ambiguous. Dynamic
|
||||
calls/properties/names, parser recovery, unresolved handles, unsupported API
|
||||
shapes, and every reached bound stay explicit unknowns; a missing relation is
|
||||
never reported as proven behavioral absence.
|
||||
|
||||
Semantic relations use static-inference authority. `resolved` means the static
|
||||
target identity was unique within admitted analysis; it does not mean the path
|
||||
@@ -83,6 +92,25 @@ items, candidate references, graph nodes, edges, and observations. With
|
||||
`unknown_registry_approved: true`, unresolved comparison items can be retained
|
||||
as a residual unknown in a live session.
|
||||
|
||||
## Historical source-to-bundle comparison
|
||||
|
||||
`compare_source_to_bundle` compares one cryptographically committed
|
||||
`HistoricalSourceGraph/v1` with authenticated application-graph Evidence. The
|
||||
stable scoring model reports every admitted signal and weight: exact source
|
||||
digest, source-map original path, exact current path, path suffix, basename, and
|
||||
language extension. Exact digest wins over location inference; weak basename
|
||||
or extension evidence never forces a mapping.
|
||||
|
||||
Each historical source file is classified as `unchanged`, `modified`,
|
||||
`removed`, `split`, `merged`, `duplicated`, or `unknown`. Multiple equally
|
||||
scored path mappings form a bounded static split inference. Multiple current
|
||||
nodes with the exact historical digest are duplicated; multiple historical
|
||||
paths with exact identity to one current node are merged. `removed` requires
|
||||
complete historical and application inventories with no relevant comparison
|
||||
truncation. Ambiguous candidates, partial inventories, and exhausted limits
|
||||
remain unknown. These static mappings do not claim runtime loading or semantic
|
||||
equivalence.
|
||||
|
||||
## Export return-shape comparison
|
||||
|
||||
`compare_javascript_export_shapes` selects exactly one module path and export
|
||||
@@ -108,7 +136,7 @@ replay recommendation; it does not execute JavaScript.
|
||||
|
||||
## CLI and verification
|
||||
|
||||
All four CLI commands accept inline JSON or a JSON file up to 64 MiB. The input
|
||||
All five CLI commands accept inline JSON or a JSON file up to 64 MiB. The input
|
||||
is the same object used by the corresponding MCP tool.
|
||||
|
||||
For two operator-provided directories or ASARs, run:
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
# Passive Node and Electron runtime observation
|
||||
|
||||
REA can attach to an already-running Node.js or Electron V8 Inspector target
|
||||
and retain bounded script-load and execution-context metadata. The
|
||||
`list_javascript_runtime_targets` and `observe_javascript_runtime` MCP tools
|
||||
have equivalent `rea list-javascript-runtime-targets` and
|
||||
`rea observe-javascript-runtime` commands. Successful calls return
|
||||
deterministic Evidence v2.
|
||||
|
||||
This authority is disabled by default and is separate from browser CDP,
|
||||
Electron file-page inspection, Process Capture, and controlled JavaScript
|
||||
replay:
|
||||
|
||||
```bash
|
||||
export REA_V8_INSPECTOR_OBSERVE_ENABLED=true
|
||||
export REA_V8_INSPECTOR_ENDPOINTS_JSON='["http://127.0.0.1:9229"]'
|
||||
export REA_V8_INSPECTOR_FILE_ROOTS_JSON='["/absolute/path/to/app"]'
|
||||
export REA_V8_INSPECTOR_ALLOWED_ORIGINS_JSON='[]'
|
||||
|
||||
rea list-javascript-runtime-targets http://127.0.0.1:9229 \
|
||||
--approved --json
|
||||
rea observe-javascript-runtime http://127.0.0.1:9229 TARGET_ID \
|
||||
--runtime-kind node --approved --json
|
||||
```
|
||||
|
||||
At least one canonical file root or exact HTTP(S) origin is required.
|
||||
Discovery is restricted to a literal-loopback HTTP endpoint. A target must
|
||||
match the exact requested target ID, expose a same-port WebSocket reported by
|
||||
the approved discovery endpoint, and remain inside the requested file or
|
||||
origin scope. Targets already marked attached are rejected rather than
|
||||
displacing another debugger. Canonical file paths are checked after symlink resolution.
|
||||
Excluded locations are counted but never retained.
|
||||
|
||||
## Passive protocol boundary
|
||||
|
||||
The provider sends exactly two protocol commands:
|
||||
|
||||
- `Runtime.enable`
|
||||
- `Debugger.enable`
|
||||
|
||||
It never sends `Runtime.evaluate`, reads script source, installs breakpoints,
|
||||
pauses or resumes execution, calls `Runtime.runIfWaitingForDebugger`, launches
|
||||
the target, instruments JavaScript, or invokes Electron APIs. Closing a call
|
||||
closes only REA's WebSocket.
|
||||
|
||||
The direct observations are:
|
||||
|
||||
- `Debugger.scriptParsed`, establishing that a bounded script location was
|
||||
parsed in the observed execution context;
|
||||
- `Debugger.scriptFailedToParse`, retained only as a bounded invalid-script
|
||||
count;
|
||||
- `Runtime.executionContextCreated`,
|
||||
`Runtime.executionContextDestroyed`, and
|
||||
`Runtime.executionContextsCleared`, establishing context lifecycle within
|
||||
the capture window.
|
||||
|
||||
The Inspector protocol does not directly expose require/import caller edges,
|
||||
EventEmitter emissions or listener invocation, Electron IPC messages or
|
||||
handlers, or script-unload events. Those facts remain explicit unknowns.
|
||||
`scriptParsed` proves script presence, not the importing module, feature
|
||||
execution, initialization order, or causality.
|
||||
|
||||
## Node and Electron roles
|
||||
|
||||
The caller declares one role: `node`, `electron-main`, `electron-preload`, or
|
||||
`electron-renderer`. Node and Electron-main declarations require a protocol
|
||||
target of type `node`; preload and renderer declarations require `page`.
|
||||
Inspector does not authenticate the operating-system PID or distinguish an
|
||||
Electron role, so Evidence records the role authority as
|
||||
`caller-declared-unverified`.
|
||||
|
||||
Electron main, preload, and renderer behavior can therefore be observed only
|
||||
as separate approved Inspector targets. The provider does not infer that two
|
||||
targets belong to the same Electron application.
|
||||
|
||||
## Bounds and determinism
|
||||
|
||||
Every observation commits the window and exact limits for events, scripts,
|
||||
execution contexts, per-location bytes, and total retained metadata bytes.
|
||||
Limit hits increment dropped-event counts and set `capture.truncated`; they
|
||||
never become completeness claims. Scripts are authorized after capture,
|
||||
deduplicated by stable metadata, and canonically sorted. Wall-clock timestamps
|
||||
and protocol script IDs are excluded from the durable result, so identical
|
||||
inputs and captured metadata produce the same Evidence ID.
|
||||
|
||||
Inspector attach is inherently incomplete. Enabling `Debugger` reports known
|
||||
and uncollected scripts, but scripts collected before attachment may be
|
||||
missing. Absence from a bounded capture never proves that a script or behavior
|
||||
does not occur.
|
||||
|
||||
## Static correlation
|
||||
|
||||
Pass the resulting observation Evidence and an
|
||||
`analyze_javascript_application` Evidence record to
|
||||
`reconcile_javascript_runtime`. The reconciliation accepts this provider
|
||||
alongside passive web and Electron page captures. Exact approved file or URL
|
||||
mappings can correlate script presence with JavaScript Application Graph
|
||||
assets. Because this provider never reads source bytes, matches normally use a
|
||||
unique authorized location and remain weaker than captured-byte identity.
|
||||
Builtin `node:` scripts remain runtime-only nodes unless a future explicit
|
||||
static authority models them.
|
||||
@@ -1,7 +1,7 @@
|
||||
# JavaScript static/runtime reconciliation
|
||||
|
||||
REA can combine an existing static JavaScript Application Graph with one or
|
||||
more passive browser or Electron captures without collapsing their different
|
||||
more passive browser, Electron page, or Node/Electron V8 Inspector captures without collapsing their different
|
||||
authorities. The `reconcile_javascript_runtime` MCP tool and
|
||||
`rea reconcile-javascript-runtime` CLI command accept Evidence v2 records and
|
||||
return derived Evidence v2 containing a combined JavaScript Application Graph
|
||||
@@ -9,7 +9,8 @@ and explicit match, ambiguity, mismatch, and unknown classifications.
|
||||
|
||||
The operation performs no filesystem, browser, or Electron I/O. It accepts only
|
||||
semantically verified Evidence produced by `analyze_javascript_application`,
|
||||
`inspect_web_page`, or `inspect_electron_page`; matching operation names alone
|
||||
`inspect_web_page`, `inspect_electron_page`, or
|
||||
`observe_javascript_runtime`; matching operation names alone
|
||||
is insufficient. Provider identity, predicate version, subject digest, target
|
||||
parameters, and normalized-result schemas are checked before reconciliation.
|
||||
|
||||
@@ -18,12 +19,13 @@ parameters, and normalized-result schemas are checked before reconciliation.
|
||||
1. Run `analyze_javascript_application` against exactly one application layer.
|
||||
Optional cache or assets directories can be analyzed independently and
|
||||
supplied as additional layers.
|
||||
2. Run `inspect_web_page` or `inspect_electron_page`. Capturing script sources
|
||||
2. Run `inspect_web_page`, `inspect_electron_page`, or the attach-only
|
||||
`observe_javascript_runtime`. Capturing script sources
|
||||
is optional, but an approved source capture provides the strongest byte
|
||||
identity.
|
||||
3. Pass the resulting Evidence records to `reconcile_javascript_runtime`.
|
||||
Browser URLs normally need an explicit URL-prefix mapping. Extracted
|
||||
Electron directories are mapped automatically when runtime files remain
|
||||
Electron and V8 Inspector file locations are mapped automatically when runtime files remain
|
||||
beneath the analyzed input root; relocated files, ASAR projections, caches,
|
||||
and asset roots need explicit mappings.
|
||||
|
||||
@@ -134,12 +136,19 @@ globally unloaded.
|
||||
|
||||
## Frames, workers, and source maps
|
||||
|
||||
Passive inspection now retains the execution-context frame ID supplied by CDP
|
||||
Passive inspection retains the execution-context frame ID supplied by CDP
|
||||
for each accepted script. Electron captures also inventory authorized worker,
|
||||
service-worker, and shared-worker targets, including bounded opener-target and
|
||||
parent-frame relationships. These fields improve attribution while preserving
|
||||
the original exact-origin or canonical-root filter.
|
||||
|
||||
V8 Inspector observations expose execution-context IDs but no authenticated
|
||||
frame relationship, so their scripts attach to the exact runtime target in the
|
||||
combined graph. They never supply source bytes, require/import caller edges,
|
||||
EventEmitter activity, Electron IPC, or script-unload evidence. A unique
|
||||
authorized file or URL location can still correlate script presence with a
|
||||
static asset, but it does not prove module initialization or feature execution.
|
||||
|
||||
Source-map declarations and approved original-source reads stay under static
|
||||
source-map authority. They are reported in `source_map_authority` but never used
|
||||
as primary runtime byte matches. A source name or `sourcesContent` digest is not
|
||||
|
||||
@@ -11,8 +11,14 @@ expected package version, catalog digest, or registered server path to
|
||||
reports their command vectors as aligned, stale, missing, or invalid, and keeps
|
||||
live-server state `unknown` unless the active connection supplies identity.
|
||||
|
||||
Tool names remain stable. `binary_session.tool_availability` explains each
|
||||
operation with a stable availability reason instead of silently hiding it.
|
||||
Canonical tool names remain stable, while `tools/list` advertises only the
|
||||
operations callable for the current target, provider, policy, host, and
|
||||
negotiated client capabilities. `binary_session.tool_availability` remains the
|
||||
complete inventory: it explains advertised and hidden operations with stable
|
||||
availability reasons and remediation. Each entry also reports required and
|
||||
optional negotiated client features plus the currently missing features. Form elicitation is optional for
|
||||
`capture_process_scenario`: an existing grant remains usable without it, while
|
||||
a missing grant cannot be elicited by a client that does not advertise it.
|
||||
Opening or closing a target, reloading policy, or observing a provider health
|
||||
transition emits `notifications/tools/list_changed`.
|
||||
|
||||
|
||||
@@ -0,0 +1,333 @@
|
||||
# Reconstruction obligation ledgers
|
||||
|
||||
`build_reconstruction_obligation_ledger` turns authenticated Evidence v2 records
|
||||
into a versioned, deterministic list of reconstruction claims. The same workflow
|
||||
is available as:
|
||||
|
||||
- MCP tool: `build_reconstruction_obligation_ledger`
|
||||
- CLI command: `rea build-reconstruction-obligation-ledger`
|
||||
- MCP resource:
|
||||
`rea://evidence/{evidenceId}/reconstruction-obligation-ledger`
|
||||
|
||||
The ledger is conservative by design. Static Application Graph facts create
|
||||
candidate obligations; they do not prove runtime or process behavior. A required
|
||||
obligation closes only when one manifest binding supplies a unique owner, any
|
||||
required parser/schema/domain type, every required case fixture, and a passing
|
||||
verifier whose authority is comparable to the original observation. The
|
||||
verifier must enumerate the obligation ID and its result must be present in the
|
||||
input Evidence bundle. Contradictions, duplicate definitions or owners,
|
||||
residual unknowns, missing dependencies, and unavailable authority keep closure
|
||||
open or failed.
|
||||
|
||||
## Complete CLI request
|
||||
|
||||
This empty request is useful for checking client integration. It is valid and
|
||||
returns an `unknown` ledger with zero obligations; absence of source Evidence
|
||||
never claims closure:
|
||||
|
||||
```sh
|
||||
rea build-reconstruction-obligation-ledger \
|
||||
'{
|
||||
"evidence_bundle": {
|
||||
"bundle_version": 2,
|
||||
"artifacts": [],
|
||||
"providers": [],
|
||||
"environments": [],
|
||||
"scenarios": [],
|
||||
"captures": [],
|
||||
"unknowns": [],
|
||||
"records": []
|
||||
},
|
||||
"reviewed_obligations": [],
|
||||
"manifest": {
|
||||
"schema_version": 1,
|
||||
"bindings": [],
|
||||
"contradictions": []
|
||||
},
|
||||
"limits": { "max_obligations": 100 },
|
||||
"page": { "offset": 0, "limit": 50 }
|
||||
}' \
|
||||
--json
|
||||
```
|
||||
|
||||
For a real investigation, export an Evidence bundle from the session and replace
|
||||
the empty bundle. Application Graph and Process Capture v4 records generate
|
||||
conservative candidates automatically. Add reviewed obligations when a required
|
||||
claim is not represented by those sources.
|
||||
|
||||
## Reviewed obligation examples
|
||||
|
||||
Each example below is a complete `reviewed_obligations` element. Replace the
|
||||
sample Evidence ID with an authenticated review record already present in
|
||||
`evidence_bundle.records`. Stable IDs and versions make changes reviewable.
|
||||
|
||||
### CLI parsing
|
||||
|
||||
```json
|
||||
{
|
||||
"obligation_id": "cli.config.invalid-option",
|
||||
"obligation_version": 1,
|
||||
"title": "Reject an invalid configuration option with the supported CLI error",
|
||||
"application_layer": "cli",
|
||||
"family": "argument-parsing",
|
||||
"target": {
|
||||
"artifact_sha256": null,
|
||||
"application_node_id": null,
|
||||
"semantic_node_id": null,
|
||||
"location": "rea --unknown-option"
|
||||
},
|
||||
"required": true,
|
||||
"required_case_kinds": ["positive", "negative", "malformed"],
|
||||
"required_original_authority": "process",
|
||||
"required_fixture_authority": "packaged-process",
|
||||
"required_verifier_authority": "packaged-process",
|
||||
"requires_parser_type": true,
|
||||
"dependency_obligation_ids": [],
|
||||
"residual_unknown_ids": [],
|
||||
"unavailable_authority": [],
|
||||
"required_next_evidence": ["Capture the installed CLI for all three cases."],
|
||||
"disposition": "active",
|
||||
"review_evidence_ids": [
|
||||
"ev_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Protocol handler
|
||||
|
||||
```json
|
||||
{
|
||||
"obligation_id": "protocol.rpc.cancel",
|
||||
"obligation_version": 1,
|
||||
"title": "Cancel an in-flight request and emit one terminal response",
|
||||
"application_layer": "protocol",
|
||||
"family": "request-response",
|
||||
"target": {
|
||||
"artifact_sha256": null,
|
||||
"application_node_id": null,
|
||||
"semantic_node_id": null,
|
||||
"location": "JSON-RPC request cancellation"
|
||||
},
|
||||
"required": true,
|
||||
"required_case_kinds": ["positive", "negative", "malformed", "cancellation"],
|
||||
"required_original_authority": "external",
|
||||
"required_fixture_authority": "protocol",
|
||||
"required_verifier_authority": "protocol",
|
||||
"requires_parser_type": true,
|
||||
"dependency_obligation_ids": [],
|
||||
"residual_unknown_ids": [],
|
||||
"unavailable_authority": [],
|
||||
"required_next_evidence": [
|
||||
"Record request, cancellation, and terminal response IDs."
|
||||
],
|
||||
"disposition": "active",
|
||||
"review_evidence_ids": [
|
||||
"ev_bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Electron startup and background behavior
|
||||
|
||||
```json
|
||||
{
|
||||
"obligation_id": "electron.background.startup",
|
||||
"obligation_version": 1,
|
||||
"title": "Start the background process before exposing the renderer bridge",
|
||||
"application_layer": "electron",
|
||||
"family": "startup",
|
||||
"target": {
|
||||
"artifact_sha256": null,
|
||||
"application_node_id": null,
|
||||
"semantic_node_id": null,
|
||||
"location": "main process startup"
|
||||
},
|
||||
"required": true,
|
||||
"required_case_kinds": ["positive", "negative", "teardown"],
|
||||
"required_original_authority": "runtime",
|
||||
"required_fixture_authority": "renderer",
|
||||
"required_verifier_authority": "renderer",
|
||||
"requires_parser_type": false,
|
||||
"dependency_obligation_ids": [],
|
||||
"residual_unknown_ids": [],
|
||||
"unavailable_authority": [],
|
||||
"required_next_evidence": [
|
||||
"Observe main/renderer ordering and application shutdown."
|
||||
],
|
||||
"disposition": "active",
|
||||
"review_evidence_ids": [
|
||||
"ev_cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Persistence migration
|
||||
|
||||
```json
|
||||
{
|
||||
"obligation_id": "persistence.profile.migrate-v2",
|
||||
"obligation_version": 1,
|
||||
"title": "Migrate a version-one profile without losing unknown fields",
|
||||
"application_layer": "persistence",
|
||||
"family": "migration",
|
||||
"target": {
|
||||
"artifact_sha256": null,
|
||||
"application_node_id": null,
|
||||
"semantic_node_id": null,
|
||||
"location": "profile schema v1 to v2"
|
||||
},
|
||||
"required": true,
|
||||
"required_case_kinds": ["positive", "negative", "malformed"],
|
||||
"required_original_authority": "runtime",
|
||||
"required_fixture_authority": "integration",
|
||||
"required_verifier_authority": "integration",
|
||||
"requires_parser_type": true,
|
||||
"dependency_obligation_ids": [],
|
||||
"residual_unknown_ids": [],
|
||||
"unavailable_authority": [],
|
||||
"required_next_evidence": [
|
||||
"Compare pre-migration and committed storage snapshots."
|
||||
],
|
||||
"disposition": "active",
|
||||
"review_evidence_ids": [
|
||||
"ev_dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Native ABI
|
||||
|
||||
```json
|
||||
{
|
||||
"obligation_id": "native-abi.helper.status",
|
||||
"obligation_version": 1,
|
||||
"title": "Preserve the helper status-code and output-buffer contract",
|
||||
"application_layer": "native-abi",
|
||||
"family": "ffi",
|
||||
"target": {
|
||||
"artifact_sha256": null,
|
||||
"application_node_id": null,
|
||||
"semantic_node_id": null,
|
||||
"location": "helper_status(const uint8_t *, size_t, uint8_t *, size_t *)"
|
||||
},
|
||||
"required": true,
|
||||
"required_case_kinds": ["positive", "negative", "malformed"],
|
||||
"required_original_authority": "process",
|
||||
"required_fixture_authority": "native-abi",
|
||||
"required_verifier_authority": "native-abi",
|
||||
"requires_parser_type": true,
|
||||
"dependency_obligation_ids": [],
|
||||
"residual_unknown_ids": [],
|
||||
"unavailable_authority": [],
|
||||
"required_next_evidence": [
|
||||
"Run the ABI harness against the shipped and reconstructed libraries."
|
||||
],
|
||||
"disposition": "active",
|
||||
"review_evidence_ids": [
|
||||
"ev_eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Manifest and closure
|
||||
|
||||
A manifest binding names one owner and its exact implementation digest. Both
|
||||
`original_cases` and the reconstruction fixture list must cover every
|
||||
`required_case_kinds` value with authenticated, comparable Evidence.
|
||||
`parser_type` is mandatory when `requires_parser_type` is true.
|
||||
|
||||
```json
|
||||
{
|
||||
"obligation_id": "protocol.rpc.cancel",
|
||||
"owner": {
|
||||
"module_path": "src/protocol/requestRouter.ts",
|
||||
"symbol": "cancelRequest",
|
||||
"owner_sha256": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
|
||||
},
|
||||
"parser_type": {
|
||||
"parser": "parseCancelRequest",
|
||||
"schema": "cancelRequestSchema",
|
||||
"domain_type": "CancelRequest"
|
||||
},
|
||||
"original_cases": [
|
||||
{
|
||||
"kind": "positive",
|
||||
"evidence_id": "ev_6666666666666666666666666666666666666666666666666666666666666666",
|
||||
"location": "/captures/positive"
|
||||
},
|
||||
{
|
||||
"kind": "negative",
|
||||
"evidence_id": "ev_7777777777777777777777777777777777777777777777777777777777777777",
|
||||
"location": "/captures/negative"
|
||||
},
|
||||
{
|
||||
"kind": "malformed",
|
||||
"evidence_id": "ev_8888888888888888888888888888888888888888888888888888888888888888",
|
||||
"location": "/captures/malformed"
|
||||
},
|
||||
{
|
||||
"kind": "cancellation",
|
||||
"evidence_id": "ev_9999999999999999999999999999999999999999999999999999999999999999",
|
||||
"location": "/captures/cancellation"
|
||||
}
|
||||
],
|
||||
"fixtures": [
|
||||
{
|
||||
"fixture_id": "rpc.cancel.positive",
|
||||
"case_kind": "positive",
|
||||
"authority": "protocol",
|
||||
"evidence_ids": [
|
||||
"ev_1111111111111111111111111111111111111111111111111111111111111111"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fixture_id": "rpc.cancel.negative",
|
||||
"case_kind": "negative",
|
||||
"authority": "protocol",
|
||||
"evidence_ids": [
|
||||
"ev_2222222222222222222222222222222222222222222222222222222222222222"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fixture_id": "rpc.cancel.malformed",
|
||||
"case_kind": "malformed",
|
||||
"authority": "protocol",
|
||||
"evidence_ids": [
|
||||
"ev_3333333333333333333333333333333333333333333333333333333333333333"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fixture_id": "rpc.cancel.cancellation",
|
||||
"case_kind": "cancellation",
|
||||
"authority": "protocol",
|
||||
"evidence_ids": [
|
||||
"ev_4444444444444444444444444444444444444444444444444444444444444444"
|
||||
]
|
||||
}
|
||||
],
|
||||
"verifier": {
|
||||
"verifier_id": "rpc.cancel.conformance",
|
||||
"claim_id": "protocol.rpc.cancel.v1",
|
||||
"command": "npm run test:protocol -- cancel",
|
||||
"authority": "protocol",
|
||||
"status": "pass",
|
||||
"result_evidence_id": "ev_5555555555555555555555555555555555555555555555555555555555555555",
|
||||
"enumerated_obligation_ids": ["protocol.rpc.cancel"],
|
||||
"nondeterminism": {
|
||||
"mode": "partial-order",
|
||||
"specification": "cancel precedes the single terminal response"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
All referenced Evidence IDs must exist in the bundle. A green unit test cannot
|
||||
close a `packaged-process` obligation. A static-only source cannot close a
|
||||
runtime or process claim. Marking a claim `blocked` or `out-of-scope` records the
|
||||
disposition but does not silently count it as verified.
|
||||
|
||||
Pagination changes only `page` and the returned `obligations` slice. Every page
|
||||
retains the same `ledger_id`, `closure_digest`, full-ledger summaries, reports,
|
||||
ownership graph, dependency graph, Evidence links, and limitations. Consumers
|
||||
should follow `next_offset` until it is `null`, and should reject pages whose
|
||||
identity or closure digest changes mid-read.
|
||||
@@ -0,0 +1,99 @@
|
||||
# Reconstruction readiness conformance
|
||||
|
||||
Run the complete source-owned native, JavaScript CLI, Electron, Evidence,
|
||||
comparison, obligation, replay, CLI, and MCP journey from a clean checkout:
|
||||
|
||||
```sh
|
||||
npm ci
|
||||
npm run verify:readiness
|
||||
```
|
||||
|
||||
The command builds the redistributable native conformance fixtures, inventories
|
||||
the native executable through the public CLI, analyzes the generated JavaScript
|
||||
CLI and Electron fixture through both CLI and MCP, verifies exact advertised
|
||||
limits, evaluates the same nine-stage report through both surfaces, reads the
|
||||
full MCP report resource, and proves stale/tampered replay rejection. It prints
|
||||
one compact JSON summary.
|
||||
|
||||
Set `REA_READINESS_REPORT_PATH` to retain the complete machine-readable report:
|
||||
|
||||
```sh
|
||||
REA_READINESS_REPORT_PATH=readiness-report.json npm run verify:readiness
|
||||
```
|
||||
|
||||
CI runs this command on Linux, publishes the compact summary, and retains the
|
||||
full report as the `reconstruction-readiness` artifact.
|
||||
|
||||
## Public contracts
|
||||
|
||||
- CLI: `rea evaluate-reconstruction-readiness <json-or-file> --json`
|
||||
- MCP tool: `evaluate_reconstruction_readiness`
|
||||
- Full MCP resource:
|
||||
`rea://evidence/{evidenceId}/reconstruction-readiness-report`
|
||||
|
||||
The MCP tool result contains only report identity, status, summary, metrics, and
|
||||
the resource URI. The full Evidence bundle, stage records, comparisons,
|
||||
contradictions, obligation ledger, and replay inputs stay in the retained
|
||||
resource instead of consuming the tool-response context.
|
||||
|
||||
## Required stages
|
||||
|
||||
| Stage | Required proof |
|
||||
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
||||
| `discover-classify` | target-free startup, artifact inventory, compatible workflow selection, and exact visible limits |
|
||||
| `diagnose-environment` | broken runtime separated from analysis failure, version skew detected, and revision changed after recovery |
|
||||
| `acquire-authority` | exact missing scope, narrow grant, expansion re-prompt, and no launch after denial/cancellation |
|
||||
| `static-analysis` | native and JavaScript routing plus preserved ambiguity, truncation, unsupported syntax, and residual unknowns |
|
||||
| `reactive-scenarios` | predicate-driven interaction, descendant settlement, Electron correlation, and cancellation cleanup Evidence |
|
||||
| `compare-authority-candidate` | explicit partial-order/finite-trace semantics, primary divergence localization, and unknown for incomplete comparison |
|
||||
| `preserve-contradictions` | record-and-continue, affected equivalence blocked, and unaffected comparison retained |
|
||||
| `verify-reconstruction-closure` | incomplete reconstruction detected, incremental verifier closure, and authority-delegating candidates rejected |
|
||||
| `export-replay` | CLI/MCP parity, process/structured failure parity, deterministic replay, tamper rejection, and stale-input rejection |
|
||||
|
||||
Every stage and required check must occur exactly once and link to Evidence in
|
||||
the embedded Evidence v2 bundle. `fail`, `unknown`, `unsupported`, `truncated`,
|
||||
and `skipped` never aggregate to `pass`.
|
||||
|
||||
## Fail-closed rules
|
||||
|
||||
The evaluator rejects or withholds readiness when:
|
||||
|
||||
- a bounded capability omits its effective numeric limits;
|
||||
- a fixture lacks exactly one compatible selected workflow;
|
||||
- an incompatible or unavailable provider was invoked;
|
||||
- a typed CLI failure exits zero, or an MCP failure reports success;
|
||||
- concurrent behavior uses total-order comparison;
|
||||
- truncation, instability, unavailable authority, or contradiction is labeled
|
||||
equivalent;
|
||||
- a deliberate primary divergence is not localized;
|
||||
- contradiction Evidence or its affected comparison is missing;
|
||||
- the reconstruction obligation ledger is not `ready`, has no required
|
||||
obligation, or retains an unowned/unverified required obligation;
|
||||
- denied authority launches a process, cancellation loses diagnostics, or owned
|
||||
resources remain;
|
||||
- replay is nondeterministic, tampering/staleness is not detected, or the
|
||||
expected source digest differs.
|
||||
|
||||
Each finding names its stage, stable reason code, Evidence IDs, and detail.
|
||||
Stage `capability_issue` and `next_action` fields map unsupported or failing
|
||||
work to the responsible capability and remediation without claiming that the
|
||||
requested analysis ran.
|
||||
|
||||
## Fixtures
|
||||
|
||||
The verifier uses only source-owned, redistributable fixtures:
|
||||
|
||||
- `tests/conformance` native executables with stable symbols and deliberate
|
||||
version divergence;
|
||||
- `tests/conformance/readiness/javascript-cli`, which exposes prompts,
|
||||
alternate-screen behavior, configuration precedence, child process,
|
||||
persistence, loopback HTTP, and signal teardown to static reconstruction;
|
||||
- `tests/conformance/readiness/electron`, which exposes main, preload,
|
||||
renderer, utility, IPC, renderer restart, blocked shell effect, and deep-link
|
||||
surfaces;
|
||||
- the shared incomplete reconstruction and broken-runtime observations in
|
||||
`RECONSTRUCTION_READINESS_EXAMPLE`.
|
||||
|
||||
The synthetic example is a public typed input, not a global equivalence claim.
|
||||
It demonstrates that every deliberate fault remains represented in the final
|
||||
report and that only comparable Evidence can close the associated obligation.
|
||||
Reference in New Issue
Block a user