diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1c0e55f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# Keep generated projections and actual verification records available for audit +# without obscuring authored source changes in GitHub's default diff view. +src/layer1-uor/generated-model.js linguist-generated=true +product/contracts.json linguist-generated=true +product/source-attestation.json linguist-generated=true +product/source-build-manifest.json linguist-generated=true +product/source-verification.json linguist-generated=true diff --git a/.github/workflows/guest-browser-qualification.yml b/.github/workflows/guest-browser-qualification.yml new file mode 100644 index 0000000..921fb6c --- /dev/null +++ b/.github/workflows/guest-browser-qualification.yml @@ -0,0 +1,49 @@ +name: Qualify integrated Stitch host +on: + push: + branches: ['staging/stitch-upstream-reconciliation'] +permissions: + contents: read +concurrency: + group: stitch-integration-${{ github.ref }} + cancel-in-progress: true +jobs: + runtime: + runs-on: ubuntu-24.04 + timeout-minutes: 15 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version: '24' + cache: npm + - run: npm ci --ignore-scripts + - run: npm test + - run: python3 scripts/verify-custody.py + - run: cargo test --locked + browser: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version: '24' + cache: npm + - run: npm ci --ignore-scripts + - name: Install pinned Chromium and its system dependencies + run: npx playwright install --with-deps chromium --only-shell + - name: Qualify actual Chromium host adapters and bundled guest + run: npm run test:browser + - name: Retain browser diagnostics + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: stitch-browser-${{ github.sha }} + path: | + verification-output/browser/ + if-no-files-found: warn diff --git a/.github/workflows/guest-candidate.yml b/.github/workflows/guest-candidate.yml new file mode 100644 index 0000000..3972971 --- /dev/null +++ b/.github/workflows/guest-candidate.yml @@ -0,0 +1,94 @@ +name: Build and qualify guest candidate +on: + workflow_dispatch: + push: + branches: ['feat/**'] + paths: + # Only image-producing inputs trigger a costly rebuild. Probe/docs and + # workflow-only edits can inspect/requalify existing images or dispatch explicitly. + - 'vendor/guest/board/**' + - 'vendor/guest/configs/**' + - 'vendor/guest/Config.in' + - 'vendor/guest/external.desc' + - 'vendor/guest/external.mk' + - 'vendor/guest/build-candidate.sh' +permissions: + contents: read +concurrency: + group: guest-candidate-${{ github.ref }} + cancel-in-progress: true +jobs: + candidate: + runs-on: ubuntu-24.04 + timeout-minutes: 200 + env: + BUILDROOT_PIN: 7fdeadb3b9f12f78e5fccca914d7fef47090ab9a + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version: '24' + - name: Prepare bounded build host + timeout-minutes: 10 + shell: bash + run: | + set -euo pipefail + mkdir -p "$RUNNER_TEMP/guest-evidence" + df -h "$RUNNER_TEMP" | tee "$RUNNER_TEMP/guest-evidence/disk-before.log" + free_kib=$(df -Pk "$RUNNER_TEMP" | awk 'NR==2 {print $4}') + test "$free_kib" -ge 20971520 || { echo 'Need at least 20 GiB free for first Buildroot build; use a larger authorized runner.'; exit 1; } + sudo apt-get update + sudo apt-get install -y --no-install-recommends build-essential patch perl cpio unzip rsync bc file wget python3 gzip xz-utils git + { gcc --version; make --version; python3 --version; node --version; } > "$RUNNER_TEMP/guest-evidence/host-tools.log" + git init "$RUNNER_TEMP/buildroot" + git -C "$RUNNER_TEMP/buildroot" remote add origin https://github.com/buildroot/buildroot.git + git -C "$RUNNER_TEMP/buildroot" fetch --depth=1 origin "$BUILDROOT_PIN" + git -C "$RUNNER_TEMP/buildroot" checkout --detach FETCH_HEAD + test "$(git -C "$RUNNER_TEMP/buildroot" rev-parse HEAD)" = "$BUILDROOT_PIN" + - name: Build image and collect original source/license materials + timeout-minutes: 175 + shell: bash + run: | + set -euo pipefail + vendor/guest/build-candidate.sh "$RUNNER_TEMP/buildroot" "$RUNNER_TEMP/guest-output" 2>&1 | tee "$RUNNER_TEMP/guest-evidence/build.log" + - name: Qualify actual bundled emulator against candidate + timeout-minutes: 4 + shell: bash + run: | + set -euo pipefail + node vendor/guest/qualify-candidate.mjs "$RUNNER_TEMP/guest-output/images/bzImage" 2>&1 | tee "$RUNNER_TEMP/guest-evidence/runtime.log" + - name: Preserve usable results even on failure + if: always() + timeout-minutes: 8 + shell: bash + run: | + set -euo pipefail + evidence="$RUNNER_TEMP/guest-evidence" + output="$RUNNER_TEMP/guest-output" + mkdir -p "$evidence" + printf '%s\n' 'Candidate evidence only. A failed or interrupted build produces partial materials, not distribution clearance. Inspect build/runtime logs and legal-info warnings. No runtime image was published or replaced.' > "$evidence/STATUS.txt" + if test -d "$output"; then + parts=() + for part in downloads legal-info release-materials; do + test ! -d "$output/$part" || parts+=("$part") + done + if ((${#parts[@]})); then tar -czf "$evidence/sources-and-licenses.tar.gz" -C "$output" "${parts[@]}"; fi + test ! -f "$output/.config" || cp "$output/.config" "$evidence/buildroot.config" + test ! -f "$output/images/bzImage" || cp "$output/images/bzImage" "$evidence/stitch-guest-candidate.bin" + if test -d "$output/build"; then + (cd "$output"; find build -mindepth 2 -maxdepth 2 -name .config -type f -exec cp --parents '{}' "$evidence/" ';') + fi + (cd "$evidence"; find . -type f ! -name SHA256SUMS -print0 | sort -z | xargs -0 sha256sum > SHA256SUMS) + fi + - name: Upload candidate, source materials, configs and logs + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: guest-candidate-${{ github.run_id }}-${{ github.run_attempt }} + path: ${{ runner.temp }}/guest-evidence/ + include-hidden-files: true + if-no-files-found: warn + retention-days: 14 + compression-level: 0 diff --git a/.github/workflows/prism.yml b/.github/workflows/prism.yml new file mode 100644 index 0000000..816a8f6 --- /dev/null +++ b/.github/workflows/prism.yml @@ -0,0 +1,109 @@ +name: Stitch model and runtime +on: + push: + branches: [main, 'feat/**'] + pull_request: + workflow_dispatch: +permissions: + contents: read +concurrency: + group: stitch-${{ github.ref }} + cancel-in-progress: true +jobs: + runtime: + runs-on: ubuntu-24.04 + timeout-minutes: 15 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version: '24' + cache: npm + - run: npm ci --ignore-scripts + - run: npm test + - run: python3 scripts/verify-custody.py + - run: cargo test --locked + browser: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version: '24' + cache: npm + - run: npm ci --ignore-scripts + - name: Install pinned Chromium and its system dependencies + run: npx playwright install --with-deps chromium --only-shell + - name: Qualify actual Chromium host adapters and bundled guest + run: npm run test:browser + - name: Retain browser diagnostics + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: stitch-browser-${{ github.sha }} + path: | + verification-output/browser/ + if-no-files-found: warn + model: + runs-on: ubuntu-24.04 + timeout-minutes: 55 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version: '24' + cache: npm + - run: npm ci --ignore-scripts + - name: Load the exact SDK identity + run: | + node -e 'const fs=require("fs");const x=JSON.parse(fs.readFileSync("prismpm.lock"));if(!/^ghcr\.io\/uor-foundation\/[a-z0-9-]+@sha256:[0-9a-f]{64}$/.test(x.sdk_image))throw Error("unpinned SDK");fs.appendFileSync(process.env.GITHUB_ENV,`SDK_IMAGE=${x.sdk_image}\n`)' + - name: Require committed authoring inputs before downloading the SDK + run: | + test -f app/lexlean.lock + test -n "$(git ls-files app/lexlean.lock)" + - name: Prepare SDK runner + run: | + docker pull "$SDK_IMAGE" + mkdir -p verification-output + cat > "$RUNNER_TEMP/run-sdk" <<'SH' + #!/bin/sh + set -eu + docker run --rm --user "$(id -u):$(id -g)" \ + --group-add "$(stat -c '%g' /var/run/docker.sock)" \ + --tmpfs /tmp:rw,exec,nosuid,size=3g \ + --volume "$PWD:$PWD" --workdir "$PWD" \ + --volume /var/run/docker.sock:/var/run/docker.sock \ + --env HOME=/tmp/prismpm-home --env PRISMPM_EPHEMERAL_HOME=1 \ + "$SDK_IMAGE" "$@" + SH + chmod +x "$RUNNER_TEMP/run-sdk" + - name: Record pinned SDK versions + run: | + "$RUNNER_TEMP/run-sdk" sh -c 'lexlean --version; lean --version; prismpm --version' | tee verification-output/compiler-identity.log + - name: Verify exact canonical source, Lean proofs and Prism artifact + run: | + set -o pipefail + "$RUNNER_TEMP/run-sdk" sh scripts/check-model-sdk.sh --check 2>&1 | tee verification-output/verify.log + git diff --exit-code + - name: Retain exact diagnostics and generated model evidence + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: stitch-model-${{ github.sha }} + include-hidden-files: true + path: | + verification-output/ + app/src/ + app/language/ + app/lexlean.lock + app/.lexlean/ + app/.prism/ + src/layer1-uor/generated-model.js + if-no-files-found: error diff --git a/.gitignore b/.gitignore index 2747ec0..c95cd17 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ /target /node_modules *.log + +node_modules/ +app/.lexlean/ +app/.prism/ +app/.lake/ +verification-output/ diff --git a/CONTRACT.json b/CONTRACT.json index 865ce4c..bae310e 100644 --- a/CONTRACT.json +++ b/CONTRACT.json @@ -1,5 +1,5 @@ { - "contract_version": "1.0.0", + "contract_version": "1.1.0", "frozen_before_run": true, "definitions": { "staleness_event": "A connection attempt or liveness probe that resolves or targets an expired/dead endpoint while the peer is reachable at a newer state.", @@ -7,15 +7,21 @@ }, "thresholds": { "C1_min_trials_per_class": 30, - "C1_min_direct_success_rate": 0.60, + "C1_min_direct_success_rate": 0.6, "C1_max_median_ice_setup_sec": 10.0, - "C2_ttl_range_sec": [30, 60], + "C2_ttl_range_sec": [ + 30, + 60 + ], "C2_max_staleness_multiplier": 2.0, - "C2_max_violation_fraction": 0.20, + "C2_max_violation_fraction": 0.2, "C3_min_paired_runs": 3, "C3_alpha": 0.05, "C3_equal_refresh_budget_per_600s": 30, - "C4_cv_bounds": [0.5, 2.0], + "C4_cv_bounds": [ + 0.5, + 2.0 + ], "C5_max_sustained_updates_per_hour": 12, "C5_kill_updates_per_hour": 24, "C5_min_keepalive_floor_sec": 5.0, @@ -24,15 +30,51 @@ "C10_max_dns_record_bytes": 1024 }, "claim_status": { - "C1": { "status": "UNTESTED", "note": "Requires N>=30 live trials across distinct physical network pairs (home<->mobile, home<->cloud) with TURN disabled." }, - "C2": { "status": "BLOCKED", "note": "Browser fetch/DoH cannot inspect OS/ISP recursive cache state directly without authoritative DNS write credentials + epoch subdomain probes." }, - "C3": { "status": "PARTIAL_REFUTED_ON_UNIFORM", "note": "At equal refresh budget (B=30), Poisson/Entropy schedulers lose to Fixed-Interval under uniform/stationary churn and only win when churn is regime-switching." }, - "C4": { "status": "REFUTED_ON_PERIODIC", "note": "Periodic drops (CV=0.0) violate exponential memorylessness [0.5, 2.0]; requires Weibull/regime model for bursty network drops." }, - "C5": { "status": "BLOCKED", "note": "Browsers cannot speak BGP (TCP 179 / WireGuard); requires external DN42 Linux daemon running BIRD/FRR." }, - "C6": { "status": "REFUTED_WITHOUT_RELAY", "note": "WebRTC ICE exchange requires at least a transient signaling relay (e.g. ntfy.sh) or DNS TXT dynamic update; pure static pages without a relay cannot exchange SDP." }, - "C7": { "status": "VERIFIED", "note": "Hot (5s heartbeat), Warm (30-60s DNS TTL), Route (180s BGP hold), and Cold (3600s+ manifest) separate by >5x per tier." }, - "C8": { "status": "VERIFIED", "note": "UOR 128-bit/256-bit content fingerprint + signature verification takes <0.1ms in browser and fits in <180 bytes of TXT." }, - "C9": { "status": "VERIFIED", "note": "Zero global BGP announcements; all routing tests confined to local/overlay namespaces." }, - "C10": { "status": "VERIFIED", "note": "DNS TXT pointers capped at <255 bytes; bulk shards and VM execution stay strictly on peer edges." } + "C1": { + "status": "UNTESTED", + "note": "Requires N>=30 live trials across distinct physical network pairs (home<->mobile, home<->cloud) with TURN disabled." + }, + "C2": { + "status": "BLOCKED", + "note": "Browser fetch/DoH cannot inspect OS/ISP recursive cache state directly without authoritative DNS write credentials + epoch subdomain probes." + }, + "C3": { + "status": "PARTIAL_REFUTED_ON_UNIFORM", + "note": "At equal refresh budget (B=30), Poisson/Entropy schedulers lose to Fixed-Interval under uniform/stationary churn and only win when churn is regime-switching." + }, + "C4": { + "status": "REFUTED_ON_PERIODIC", + "note": "Periodic drops (CV=0.0) violate exponential memorylessness [0.5, 2.0]; requires Weibull/regime model for bursty network drops." + }, + "C5": { + "status": "BLOCKED", + "note": "Browsers cannot speak BGP (TCP 179 / WireGuard); requires external DN42 Linux daemon running BIRD/FRR." + }, + "C6": { + "status": "REFUTED_WITHOUT_RELAY", + "note": "WebRTC ICE exchange requires at least a transient signaling relay (e.g. ntfy.sh) or DNS TXT dynamic update; pure static pages without a relay cannot exchange SDP." + }, + "C7": { + "status": "SPECIFIED_NOT_FIELD_MEASURED", + "note": "Illustrative layer timescales are configuration, not a measured separation guarantee; browsers do not speak BGP." + }, + "C8": { + "status": "IMPLEMENTATION_TESTED", + "note": "Signature round trips and full content digests are tested. Latency and ownership trust require separate evidence; session-key self-verification is not authority." + }, + "C9": { + "status": "IMPLEMENTATION_SCOPE", + "note": "No browser BGP implementation; overlay discovery and peer/relay transfers only." + }, + "C10": { + "status": "IMPLEMENTATION_TESTED", + "note": "Full object roots are never truncated. DNS serialization has explicit size bounds; bulk data remains at peers or an explicitly enabled public relay." + } + }, + "prism_model": { + "source": "app/src", + "runtime_bindings": "src/layer1-uor/generated-model.js", + "scope": "Pure admission, reconstruction relations and deterministic computation. Host bytes, crypto, clocks, peer assertions and network effects have explicit boundaries.", + "claim_register": "docs/prism-model.md" } } diff --git a/Makefile b/Makefile index 52be27f..1e10c67 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,11 @@ test: test-js test-rust test-js: - node tests/run_all.js + npm test + python3 scripts/verify-custody.py test-rust: - cargo test --quiet + cargo test --locked --quiet serve: python3 -m http.server 8080 diff --git a/README.md b/README.md index febfc42..5064d16 100644 --- a/README.md +++ b/README.md @@ -1,136 +1,77 @@ -# stitch +# Stitch -> **Stratified Routing-Layer Persistence, UOR Content-Addressed Ephemeral Storage, and Distributed Compute** -> Strict functional isolation across 5 testable layers with empirical head-to-head algorithm benchmarks. +Recover exact objects and resume deterministic computation while the available peers change. -**Browser Benchmark & Telemetry Console (Zero Setup):** [https://syntra-labs.github.io/stitch/](https://syntra-labs.github.io/stitch/) +Stitch retains its five layers: object/ring operations, scheduling, storage, compute, and transport. A Prism/LexLean model defines the state and acceptance rules across those layers. The browser applies model-derived admission predicates and independently checks bytes and execution before accepting them. ---- +## What changed -## 1. Stratified Architecture & Isolation Rules +- **Objects have full cryptographic commitments.** Canonical manifests bind raw encoding, byte lengths, indexed XOR fragments and every required dependency. Legacy FNV addresses remain in regression/conformance simulations. +- **Placement is explicit.** Requested transfers are not stored copies. Acknowledgments bind checked fragment bytes to a request and holder. Selected retained objects can be repaired as peers join, leave or renew leases. Only fresh, checked receipts activate replacements; uncertain and superseded copies stay accounted until exact release confirmation. Committed placement and expiry remain separate observations. Different peer IDs do not prove independent failure domains. +- **Jobs carry their program and input.** Every checkpoint is digest-checked and semantically replayed through model-derived ring operations. A well-formed but impossible state is refused. Versioned programs include full-width modular POW and width-tracked byte CONCAT with explicit capacity/work admission. This does not certify arbitrary Linux VM effects. +- **Pointers have a single-writer contract.** A separately pinned Ed25519 authority, full object root, exact revision/predecessor and validity interval are required. Observer-local admission is not consensus. +- **Policies propose; admission enforces limits.** Multidimensional budgets reserve before effects. Ambiguous effects remain charged. The live refresh scheduler uses elapsed monotonic time and enforces its own cap. +- **Host failures have explicit recovery paths.** Mesh generations reject stale callbacks, DNS publication reconciles unknown writes before another mutation, and failed VM startup can be explicitly retried. +- **The operator interface follows modeled journeys.** Relevant controls, persistent labels and local results appear for the current journey. Restarted publication and every retained VM command have explicit reconciliation paths; shell output has a text view. +- **Internet formats are implemented at the byte boundary.** JCS input/encoding, DNS-message DoH and bounded ntfy framing replace the earlier partial formats. Concrete interoperability tests remain distinct from browser/provider qualification. +- **The public relay is opt-in.** Publishing sufficient fragments or a checkpoint discloses its content. A channel name is not a privacy control. -![stitch 5-Layer Architecture & Public Control-Plane Dataflow](./docs/architecture.svg) -*(Source PlantUML: [`docs/architecture.puml`](./docs/architecture.puml) | Pre-Registered Falsification Contract: [`CONTRACT.json`](./CONTRACT.json))* +Origin-local signing authority, explicitly accepted exact trust anchors and publication intent can be restored after reload. [Browser authority controls](docs/browser-authority.md) provide explicit local key rotation/revocation, independently confirmed anchor migration and conservative storage/journal care. This is not a private-key backup, cross-device authority or protection against origin storage loss. -The repository is divided into five strictly isolated strata. Each layer `L_k` may only import from `L_ Bytes) | -| - Tested under 100% node turnover (zero surviving initial nodes) | -+-------------------------------------------------------------------------+ - | -+-------------------------------------------------------------------------+ -| Layer 2: Liveness & Refresh Schedulers (src/layer2-schedulers/) | -| - Failure rate estimation (lambda), survival probability P(t), H(p) | -| - Compares Fixed-Interval, AIMD, Poisson-Survival, Entropy-Hysteresis | -+-------------------------------------------------------------------------+ - | -+-------------------------------------------------------------------------+ -| Layer 1: UOR Content Addressing & Ring Kernel (src/layer1-uor/, lib.rs) | -| - Direct Rust conformance binding to `uor-foundation = "0.5.2"` | -| - Z/(2^n)Z Datum ring ops, Hasher substitution axis, Trace verifier | -+-------------------------------------------------------------------------+ -``` +Read the [model contract and evidence boundaries](docs/prism-model.md), the [product projection and host contracts](docs/product-projection.md), and the [vendor provenance findings](docs/vendor-provenance.md). [Historical benchmarks](docs/legacy-benchmarks.md) remain available with their limitations. The existing [falsification contract](CONTRACT.json) is retained rather than relabeling simulation as network proof. ---- +## Run and test -## 2. Layer-by-Layer Candidate Comparisons & Empirical Results +Node.js 22 or later: -Run all unit assertions and comparative benchmarks locally with: - -```bash -make test +```sh +npm ci --ignore-scripts +npm test +python3 scripts/verify-custody.py +make serve ``` -### Layer 1 — UOR Content-Addressing (`uor-foundation = "0.5.2"`) - -Directly binds [`uor-foundation = "0.5.2"`](https://github.com/UOR-Foundation/UOR-Framework) in [`src/lib.rs`](src/lib.rs) and verifies bit-identical output with [`src/layer1-uor/index.js`](src/layer1-uor/index.js) (`Fnv1aHasher16` digest of `[1, 2, 3, 4]` = `0x66a5cdda2e757277b806e89ae7615aa5`). - -| Hasher Candidate | Output Width (B) | Samples (64B) | Collisions | Throughput (ops/s) | Throughput (MB/s) | -| :--- | ---: | ---: | ---: | ---: | ---: | -| **`UOR-Fnv1aHasher16`** | 16 | 1,000 | 0 | ~119,700 | ~7.31 | -| **`UOR-Fnv1aHasher32`** | 32 | 1,000 | 0 | ~90,000 | ~5.49 | -| **`SHA-256`** | 32 | 1,000 | 0 | ~85,700 | ~5.23 | - ---- - -### Layer 2 — Pointer & Route Refresh Schedulers (Claim C3/C4 Equal-Budget Protocol) - -Evaluated over a 600-second window with record `TTL = 60s` and an **equal refresh budget cap ($B = 30$ refreshes)** across regime-switching churn ($CV = 1.149$): +Open `http://localhost:8080`. Join a mesh to exchange data with peers. Enable the public relay only for intentionally public demonstration data. Fewer than three eligible remote peers means partial placement, not fabricated redundancy. -| Scheduler Policy | Refreshes Issued | Staleness Events | Unavailable Time (s) | Availability Ratio | Mean Recovery Lag (s) | -| :--- | ---: | ---: | ---: | ---: | ---: | -| **`Fixed-Interval (TTL/2)`** | 30 | 15 | 203 | 66.17% | 13.53 | -| **`Adaptive-AIMD`** | 30 | 11 | 181 | 69.83% | 3.60 | -| **`Poisson-Survival` (Unpaced — Refuted by C3)** | 30 | 4 | 336 | 44.00% | 1.33 | -| **`Entropy-Hysteresis` (Unpaced — Refuted by C3)** | 30 | 3 | 408 | 32.00% | 2.00 | -| **`Budget-Paced-Survival` (Cauchy-Schwarz $\sqrt{\hat{\lambda}}$)** | **30** | **16** | **175** | **70.83%** | **9.20** | +The original Rust UOR conformance check is `cargo test --locked`. Both the Node/Python runtime checks and Rust conformance passed in [the initial fork CI run](https://github.com/afflom/stitch/actions/runs/42797265770); that historical formal SDK stage did not pass. The expanded source has passed actual pinned LexLean/Lean/leanchecker/axiom verification, recorded in [the exact-source summary](product/source-verification.json) and [actual verifier attestation](product/source-attestation.json); native Prism artifact acceptance remains pending. [Actual Chromium qualification](https://github.com/afflom/stitch/actions/runs/42909486101/job/130156053948) passed seven scenarios on `2f1fde8`, including authenticated WebRTC payload/recovery, browser authority persistence and real guest shell/stop/destroy. This evidence does not qualify other browsers, physical NAT topologies or a replacement guest. This is still an unqualified development checkpoint. `make test` runs Node and Rust checks. The default JavaScript suite includes in-process transports and real bundled-v86 guest execution. Dedicated hosted Chromium scenarios exercise native browser behavior; neither substitutes for physical WebRTC/NAT trials. -*Falsification Finding (C3/C4):* Under an equal refresh budget ($B=30$), unpaced `Poisson-Survival` and `Entropy-Hysteresis` clamp to the 5s minimum floor and exhaust all 30 refreshes in the first 150 seconds, losing to `Fixed-Interval`. Only `Budget-Paced-Survival` (pacing remaining budget $T_{\text{rem}}/B_{\text{rem}}$ by the Cauchy-Schwarz square-root hazard ratio $\sqrt{\hat{\lambda}_{\text{long}}/\hat{\lambda}_{\text{short}}}$) beats `Fixed-Interval` at equal refresh cost when $CV > 1.0$. +## Model and verification ---- +- `app/src/Stitch/`: typed domain models and theorem obligations. +- `app/src/Product/`: complete component/flow, capability, deployment and dependency contracts, projected through the official architecture facet. +- `product/contracts.json`: source-bound project-owned contract/asset inventory, not a certificate. +- `app/language/`: versioned project vocabulary using LexLean extensibility. +- `src/layer1-uor/generated-model.js`: pure behavior extracted from the model with exact source binding. It is an application adapter, not a replacement Prism compiler or proof certificate. +- `scripts/check-model.mjs`: validates/regenerates the adapter and detects drift. +- `prismpm.lock`, `standards.lock`: exact SDK/standards pins from the official Prism template. +- `.github/workflows/prism.yml`: runtime conformance and SDK model verification on the submitted revision. -### Layer 3 — Ephemeral UOR Database Under 100% Node Turnover - -Strict zero-disk persistence test: 24 UOR content-addressed objects (256B each) are written to 5 initial nodes at $t=0$. Over 8 churn generations, 2 new nodes join and the 2 oldest nodes are hard-killed per generation until **0 initial nodes remain alive**: - -| Storage & Repair Strategy | Initial Nodes Remaining | Objects Recovered | Retention Rate | Storage Amplification | Network Bytes | Repair Ops | -| :--- | ---: | ---: | ---: | ---: | ---: | ---: | -| **`Unreplicated (R=1)`** | 0 | 0 / 24 | 0.0% | 1.0x | 6,144 B | 0 | -| **`Reactive Mirror (R=3)`** | 0 | 0 / 24 | 0.0% | 3.0x | 18,432 B | 0 | -| **`Proactive XOR Parity (2-of-3 + Survival)`** | 0 | 24 / 24 | **100.0%** | **1.5x** | 82,944 B | 576 | - -*Finding:* Reactive full mirroring (`3.0x` storage cost) loses blocks when simultaneous node drops occur between scrub cycles, whereas survival-guided proactive migration with 2-of-3 XOR parity (`1.5x` storage cost) retains **100% of objects** across complete cohort replacement. +```sh +node scripts/check-model.mjs +sh scripts/check-model-sdk.sh +``` ---- +The second command requires the pinned SDK environment. It must run real LexLean/Lean and PrismPM gates; extraction or runtime tests alone do not establish that theorems compiled. No externally hosted verifier is required. Formal acceptance is reported only from an actual successful SDK run. See the [native build diagnosis and passing-project comparison](docs/native-build-diagnosis.md) for the reproduced compiler issue; no native gate was replaced or weakened. -### Layer 4 — Distributed UOR Compute Engine Under Worker Churn +### Retain source evidence -Executes 20 deterministic programs (each consisting of 24 $\mathbb{Z}/(2^{64})\mathbb{Z}$ `PrimitiveOp` ring instructions) across churning workers that drop every 9 steps, verifying every final output with `verifyTrace`: +After the actual pinned verification succeeds, set `VERIFIED_DIR` to the exact current run's directory under `app/.lexlean/verified/`, then retain its original records: -| Execution & Fault-Tolerance Strategy | Tasks Completed | Mean Latency (ticks) | Total Ring Ops | Wasted Ring Ops | Checkpoints Written | Trace Verified Rate | -| :--- | ---: | ---: | ---: | ---: | ---: | ---: | -| **`Single-Worker Restart (No Checkpoint)`** | 20 / 20 | 33.0 | 660 | 180 | 0 | 100.0% | -| **`Speculative 2x Quorum (Active-Active)`** | 20 / 20 | 24.0 | 660 | 180 | 0 | 100.0% | -| **`Survival-Checkpointed UOR Trace`** | 20 / 20 | **24.0** | **480** | **0** | 60 | **100.0%** | +```sh +node scripts/retain-source-evidence.mjs "$VERIFIED_DIR/attestation.json" "$VERIFIED_DIR/build-manifest.json" +node scripts/check-source-evidence.mjs +``` -*Finding:* Checkpointing intermediate `(stepIndex, Datum, TraceEvent[])` into the Layer-3 UOR store when worker survival probability $P(\text{alive at } t) \le 0.60$ achieves the same minimum latency as $2\times$ active-active replication (`24.0` ticks) while eliminating **100% of wasted ring operations** (`480` vs `660` ops). +The helper preserves both input files byte-for-byte and derives `product/source-verification.json` from their records and current inputs. It validates source and lexicon digests, workspace coverage, proof results and pinned tool identities before replacing retained files. The summary is replaced last, so an interrupted multi-file replacement fails the consistency check rather than claiming success. Use only the actual verifier's emitted records: this is retention, not a verifier or a way to authenticate arbitrary JSON. Native Prism acceptance and its artifacts remain separate; capturing the current `app/prism.toml` and `app/prismpm.toml` for later freshness checks does not certify them. ---- +## Nonclaims -## 3. Repository Layout +SHA-256 and Ed25519 establish integrity and signature validity under their security assumptions, not retention or honest peer identity. DNS is discovery, not globally ordered state. The browser VM, STUN, WebRTC, DNS, signaling, relay availability and clocks remain modeled host boundaries. -``` -stitch/ -├── Cargo.toml # Official uor-foundation = "0.5.2" Rust dependency -├── Makefile # Runs both Node stratum benchmarks and Cargo conformance tests -├── package.json # ES module manifest -├── index.html # Utilitarian browser benchmark & telemetry console -├── src/ -│ ├── lib.rs # Rust uor-foundation v0.5.2 conformance library & test -│ ├── layer1-uor/index.js # Layer 1: Z/(2^n)Z Datum, PrimitiveOp, Hasher axis, verifyTrace -│ ├── layer2-schedulers/index.js # Layer 2: Fixed, AIMD, Poisson-Survival, Entropy-Hysteresis -│ ├── layer3-storage/index.js # Layer 3: Unreplicated, Reactive R=3, Proactive 2-of-3 Parity DB -│ ├── layer4-compute/index.js # Layer 4: Restart, 2x Quorum, Survival-Checkpointed Compute -│ └── layer5-transport/index.js # Layer 5: RFC 8484 DoH (SRV/TXT) & WebRTC DataChannel -└── tests/ - └── run_all.js # Isolated unit assertions & comparative table runner -``` +This implementation does not claim private relay storage, persistence after total information loss, exclusive job ownership during partitions, exactly-once effects, multi-writer consistency, optimal scheduling, or storage inside internet routers. New encodings, policies and transports must preserve admission obligations and disclose dependencies. ## License -MIT © [Syntra Labs](https://github.com/Syntra-Labs) +Project source: MIT © [Syntra Labs](https://github.com/Syntra-Labs). Bundled third-party assets retain their respective licenses; see the [provenance and packaging status](docs/vendor-provenance.md) before redistribution. diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..96c6dd4 --- /dev/null +++ b/app/.gitignore @@ -0,0 +1,3 @@ +.lexlean/ +.prism/ +.lake/ diff --git a/app/README.md b/app/README.md new file mode 100644 index 0000000..fa5060a --- /dev/null +++ b/app/README.md @@ -0,0 +1,143 @@ +# Stitch source model + +This is Stitch's project-owned LexLean 1.2 model and `stitch.domain` language +extension. It is not a specification of the whole internet or a proof of the +browser, WebRTC, DNS, a relay, arbitrary VM effects, indefinite retention, or +policy optimality. + +## Domain graph + +- `Identity`: immutable canonical bytes, byte length, eight full 32-bit digest + words, and domain/canonicalization-bound digest observations. The legacy + truncated FNV address is not a cryptographic identity. +- `Encoding`: representation identity distinct from object identity, decoder, + dependency kind/presence/integrity, exact byte recovery, and complete recovery + byte accounting including external basis bytes. +- `Fragments`: indexed manifest-bound fragments; duplicate-index refusal; + XOR bit-plane recovery from systematic/left-parity/right-parity pairs. The + inductive bit-stream definitions cover every finite bit stream, rather than + only one example object. Byte layout, padding and commitments have independent + cross-language runtime vectors. +- `Custody`: requested, acknowledged, committed, failed and uncertain transfers; + exact request/manifest/fragment/index/holder/lease receipt binding; distinct + holders; and indexed migration/retirement transitions. Requests and uncertain + transfers do not establish completed custody. A receipt is not proof of future + reachability. +- `Observation`: observer-relative reachability, sequence and elapsed-time + freshness. A timeout does not assert permanent death. +- `Budget`: four independent resource dimensions, monotonic elapsed epochs, + reserve-before-effect admission and conservative settlement. Unknown outcomes + retain their entire reservation. No heuristic can change the bound. +- `Pointer`: a pinned single writer, full successor/predecessor bindings, exactly + one revision increment and half-open validity intervals. A signature-valid + observation does not establish the authority of an arbitrary key. Explicit + local recovery requires the separately accepted exact recent vault anchor and + matching independent live pin; no different retained head is overwritten. +- `Compute`: a concrete deterministic ring-instruction evaluator, all supported + opcodes and widths, checkpoint program/input/model/predecessor/replay bindings, + strict step advancement and uninterrupted/continued execution equivalence. + POW uses bounded modular square-and-multiply. Version 2 typed programs add + capacity-bound byte-sequence CONCAT and explicit result widths, including + non-power-of-two widths and empty sequences. Version 1 DIV/MOD by zero retain + Stitch's defined legacy zero result. See [primitive semantics](../docs/uor-primitives.md). +- `Effects`: correlated mesh/VM generations, DNS unknown-write reconciliation and honest C1 measurement transitions, bound to actual host callbacks. +- `Relay`: frame admission, assembly counters, deadlines, delivery and disclosure guards. Hash/UTF8 observations and the indexed-buffer representation remain explicit host adapter responsibilities. +- `Product.Experience`: actual browser journeys, evidence views, action guards and context-sensitive disclosure/navigation policy. +- `Evidence`: separate claim kinds and evidence levels, bounded reuse, explicit + host effects and named external assumptions. +- `System`: the product state, budgeted requests with custody/evidence frame + conditions, and a concrete invariant-preserving migration transition. No + caller-supplied “preservation passed” flag serves as the preservation proof. + +## What executes + +The browser runtime imports `src/layer1-uor/generated-model.js`, reproduced by +`node scripts/check-model.mjs --write`. Its closed Nat/Bool/record/list/inductive +subset is evaluated with BigInt. Program replay executes the source-model +`Stitch.Compute.ringStep`, and budget, pointer, checkpoint and custody admission +use the same source-derived predicates. Unsupported translator syntax fails. +The generator binds every source and language-extension file into +`modelSourceDigest` for provenance. Checkpoints bind the separate +`modelExecutionDigest`: reachable replay semantics and exact transitive adapter +bytes. Unrelated model/proof/UI changes need not invalidate execution identity; +changed replay adapters do. Old checkpoints are never silently relabeled. + +This subset translator is not LexLean, a semantic type checker, Lean, a Prism +compiler, an axiom audit, or a certificate. Its freshness check, generated-code +corpus and independent runtime oracles are implementation evidence. They do not +substitute for the exact SDK gate. + +`StitchApp` is explicitly a **conformance probe**, not a full network application. +It builds a source-derived pure WASM probe with 128-bit ring values and u64 +admission quantities. Its receipt/signature flags are observations supplied by +the host, not a crypto implementation. The probe has no host capabilities. + +## Proof and trust boundary + +The source contains stated reconstruction, admission/refusal, reservation, +settlement, migration/frame, pointer-order and continuation obligations with +explicit proof terms. A theorem is kernel-verified only after `lexlean verify` +succeeds for its exact source and axiom policy. Native artifact qualification +separately requires the full PrismPM build. The [source-verification summary](../product/source-verification.json) records the checked20-module closure and exact hashes. +A checked source theorem is still not evidence that separately handwritten +network/crypto/browser adapters implement every assumption. + +Cryptographic collision resistance, signature unforgeability, pinned-authority +bootstrap, receipt authentication, retention through a declared lease, +independent failure domains, a suitable clock, and source/artifact conformance +are explicitly external. Formal records never set these assumptions to true on +behalf of a host. No finite custody condition guarantees indefinite retention. + +## Reproduction + +The repository's `prismpm.lock` and `standards.lock` are copied byte-identically +from the reviewed official template. Use only the immutable SDK that lock names. +There is no handwritten `.holo` or fabricated verification record. + +Authoring, inside that SDK: + +1. `sh scripts/check-model-sdk.sh --prepare` writes the real source lock and + canonical formatting, then checks the source. +2. On the Docker-capable runner, `npx prism-code@0.7.2 axioms --write --project app` + derives exact policies from Lean's observed axiom sets. Review that diff. Do + not invent axiom allowances or weaken the verifier to get green output. +3. `node scripts/check-model.mjs --write` reproduces the source bindings after + canonicalization/auditing. Review and commit the canonical source, actual + lock, exact axiom policies and generated bindings together. +4. `sh scripts/check-model-sdk.sh --check` is read-only: SDK lock/standards, + binding freshness, canonical source and source lock, then the full PrismPM + verification, which owns LexLean checking, Lean and leanchecker verification, + native build and acceptance vectors. No separate proof build repeats it. + +Prepare output is an authoring artifact, not a release. The source lock is +produced by the actual pinned LexLean compiler. CI refuses absent committed +authoring inputs before downloading the SDK; it never rewrites source or axiom +policies to make a submission pass. The gate refuses stale locks and unreviewed +source changes. + +The hosted LexLean service receives publicly unlisted source. This project does +not send the user's private architecture input or invoke that service without +specific authorization. The fork's pinned-SDK Actions job is the intended build +route when the local machine lacks Docker/LexLean. + +## Probe wire contract + +All multibyte integers are unsigned, big-endian. Every request begins with +version byte `1` and operation byte. Lengths and Boolean flag bytes are checked +exactly; Boolean flags must be `0` or `1`. Responses are UTF-8 decimal values, +`admit`, `refuse`, or a typed error string. The model is over mathematical Nat; +the u64/u128 probe fields are a wire representation, not semantic budget limits. + +- `0` (36 bytes): width byte, opcode byte, 16-byte input, 16-byte argument. + Widths are 8/16/32/64/128. Operands are normalized in that ring. +- `1` (58 bytes): seven u64 fields: spent, reserved, cost, limit, now, last, end. +- `2` (45 bytes): current/next revision u64s; predecessor, authority and signature + observation flags; not-before, expiry and now u64s. +- `3` (10 bytes): eight flags: requested, acknowledged, matching manifest, + matching fragment, matching holder, live lease, current source, distinct target. +- `4` (7 bytes): two fragment-index bytes and matching manifest, valid-fragments, + dependencies-present flags. + +The probe's request maximum 58 is derived from these fixed records. Its 512-byte +allocation bound is the inherited SDK resource envelope, not a storage/network +claim; a unique 512-byte rejection vector exercises that boundary. diff --git a/app/lake-manifest.json b/app/lake-manifest.json new file mode 100644 index 0000000..b6674e4 --- /dev/null +++ b/app/lake-manifest.json @@ -0,0 +1 @@ +{"version":"1.2.0","packagesDir":".lake/packages","packages":[],"name":"StitchModel","lakeDir":".lake","fixedToolchain":false} diff --git a/app/lakefile.toml b/app/lakefile.toml new file mode 100644 index 0000000..9f91cb7 --- /dev/null +++ b/app/lakefile.toml @@ -0,0 +1,6 @@ +name = "StitchModel" +version = "0.3.0" +defaultTargets = ["StitchModel"] + +[[lean_lib]] +name = "StitchModel" diff --git a/app/language/prism.arch/entries/arch-component-kind.toml b/app/language/prism.arch/entries/arch-component-kind.toml new file mode 100644 index 0000000..dbd4780 --- /dev/null +++ b/app/language/prism.arch/entries/arch-component-kind.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-component-kind" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "ComponentKind" + +[[form]] +id = "arch-component-kind" +channel = "text" +surface = "architectural component kind" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-component.toml b/app/language/prism.arch/entries/arch-component.toml new file mode 100644 index 0000000..af43c9c --- /dev/null +++ b/app/language/prism.arch/entries/arch-component.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-component" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "Component" + +[[form]] +id = "arch-component" +channel = "text" +surface = "architectural component" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-concern.toml b/app/language/prism.arch/entries/arch-concern.toml new file mode 100644 index 0000000..75fc2df --- /dev/null +++ b/app/language/prism.arch/entries/arch-concern.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-concern" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "Concern" + +[[form]] +id = "arch-concern" +channel = "text" +surface = "architectural concern" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-edge-kind.toml b/app/language/prism.arch/entries/arch-edge-kind.toml new file mode 100644 index 0000000..ff413a4 --- /dev/null +++ b/app/language/prism.arch/entries/arch-edge-kind.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-edge-kind" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "EdgeKind" + +[[form]] +id = "arch-edge-kind" +channel = "text" +surface = "architectural edge kind" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-edge.toml b/app/language/prism.arch/entries/arch-edge.toml new file mode 100644 index 0000000..64cf40e --- /dev/null +++ b/app/language/prism.arch/entries/arch-edge.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-edge" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "Edge" + +[[form]] +id = "arch-edge" +channel = "text" +surface = "architectural edge" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-model-kind.toml b/app/language/prism.arch/entries/arch-model-kind.toml new file mode 100644 index 0000000..0414bac --- /dev/null +++ b/app/language/prism.arch/entries/arch-model-kind.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-model-kind" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "ModelKind" + +[[form]] +id = "arch-model-kind" +channel = "text" +surface = "architecture model kind" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-stakeholder.toml b/app/language/prism.arch/entries/arch-stakeholder.toml new file mode 100644 index 0000000..c3ff77d --- /dev/null +++ b/app/language/prism.arch/entries/arch-stakeholder.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-stakeholder" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "Stakeholder" + +[[form]] +id = "arch-stakeholder" +channel = "text" +surface = "stakeholder" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-standard-reference.toml b/app/language/prism.arch/entries/arch-standard-reference.toml new file mode 100644 index 0000000..1eac4a3 --- /dev/null +++ b/app/language/prism.arch/entries/arch-standard-reference.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-standard-reference" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "StandardReference" + +[[form]] +id = "arch-standard-reference" +channel = "text" +surface = "standards reference" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-text-application-model.toml b/app/language/prism.arch/entries/arch-text-application-model.toml new file mode 100644 index 0000000..23ca3d9 --- /dev/null +++ b/app/language/prism.arch/entries/arch-text-application-model.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-text-application-model" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.View.Text.V1.Model" +component = "TextApplication" + +[[form]] +id = "arch-text-application-model" +channel = "text" +surface = "Text application model" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-view-class.toml b/app/language/prism.arch/entries/arch-view-class.toml new file mode 100644 index 0000000..a49493d --- /dev/null +++ b/app/language/prism.arch/entries/arch-view-class.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-view-class" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "ViewClass" + +[[form]] +id = "arch-view-class" +channel = "text" +surface = "architecture view class" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-view.toml b/app/language/prism.arch/entries/arch-view.toml new file mode 100644 index 0000000..b75ebfa --- /dev/null +++ b/app/language/prism.arch/entries/arch-view.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-view" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "View" + +[[form]] +id = "arch-view" +channel = "text" +surface = "architecture view" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-viewpoint-class.toml b/app/language/prism.arch/entries/arch-viewpoint-class.toml new file mode 100644 index 0000000..fb12ac4 --- /dev/null +++ b/app/language/prism.arch/entries/arch-viewpoint-class.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-viewpoint-class" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "ViewpointClass" + +[[form]] +id = "arch-viewpoint-class" +channel = "text" +surface = "architecture viewpoint class" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/arch-viewpoint.toml b/app/language/prism.arch/entries/arch-viewpoint.toml new file mode 100644 index 0000000..005fb87 --- /dev/null +++ b/app/language/prism.arch/entries/arch-viewpoint.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "arch-viewpoint" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Arch" +component = "Viewpoint" + +[[form]] +id = "arch-viewpoint" +channel = "text" +surface = "architecture viewpoint" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/holo-flat-validation-input.toml b/app/language/prism.arch/entries/holo-flat-validation-input.toml new file mode 100644 index 0000000..9489644 --- /dev/null +++ b/app/language/prism.arch/entries/holo-flat-validation-input.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "holo-flat-validation-input" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Holo" +component = "FlatValidationInput" + +[[form]] +id = "holo-flat-validation-input" +channel = "text" +surface = "flat validation input" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/holo-normalized-model.toml b/app/language/prism.arch/entries/holo-normalized-model.toml new file mode 100644 index 0000000..919f2c8 --- /dev/null +++ b/app/language/prism.arch/entries/holo-normalized-model.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "holo-normalized-model" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Holo" +component = "NormalizedHolo" + +[[form]] +id = "holo-normalized-model" +channel = "text" +surface = "normalized hologram model" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/holo-standards-profile.toml b/app/language/prism.arch/entries/holo-standards-profile.toml new file mode 100644 index 0000000..dfe9042 --- /dev/null +++ b/app/language/prism.arch/entries/holo-standards-profile.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "holo-standards-profile" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Holo" +component = "StandardsProfile" + +[[form]] +id = "holo-standards-profile" +channel = "text" +surface = "fixed standards profile" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/prism-bounded-byte-buffer.toml b/app/language/prism.arch/entries/prism-bounded-byte-buffer.toml new file mode 100644 index 0000000..745b919 --- /dev/null +++ b/app/language/prism.arch/entries/prism-bounded-byte-buffer.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "prism-bounded-byte-buffer" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Bytes" +component = "BoundedBuffer" + +[[form]] +id = "prism-bounded-byte-buffer" +channel = "text" +surface = "Bounded byte buffer" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/prism-browser-system-model.toml b/app/language/prism.arch/entries/prism-browser-system-model.toml new file mode 100644 index 0000000..8c88467 --- /dev/null +++ b/app/language/prism.arch/entries/prism-browser-system-model.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "prism-browser-system-model" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Production.BrowserSystem" +component = "SystemModel" + +[[form]] +id = "prism-browser-system-model" +channel = "text" +surface = "Browser-resident system model" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/prism-production-system-model.toml b/app/language/prism.arch/entries/prism-production-system-model.toml new file mode 100644 index 0000000..534ab28 --- /dev/null +++ b/app/language/prism.arch/entries/prism-production-system-model.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "prism-production-system-model" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Production.Core" +component = "Component" + +[[form]] +id = "prism-production-system-model" +channel = "text" +surface = "Production system model" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/entries/prism-unicode-text-codec.toml b/app/language/prism.arch/entries/prism-unicode-text-codec.toml new file mode 100644 index 0000000..ad3af5c --- /dev/null +++ b/app/language/prism.arch/entries/prism-unicode-text-codec.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "prism-unicode-text-codec" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Foundation.Utf8" +component = "encode" + +[[form]] +id = "prism-unicode-text-codec" +channel = "text" +surface = "Unicode text codec" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/prism.arch/lexicon.toml b/app/language/prism.arch/lexicon.toml new file mode 100644 index 0000000..7639a32 --- /dev/null +++ b/app/language/prism.arch/lexicon.toml @@ -0,0 +1,5 @@ +spec = "lexlean/lexicon/1" +package = "prism.arch" +version = "1.0.0" +language = "1.2" +imports = ["lexlean.core@1.2.0", "lexlean.std.bool@1.2.0", "lexlean.std.nat@1.2.0"] diff --git a/app/language/stitch.domain/entries/stitch-budget.toml b/app/language/stitch.domain/entries/stitch-budget.toml new file mode 100644 index 0000000..3416ea3 --- /dev/null +++ b/app/language/stitch.domain/entries/stitch-budget.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "stitch-budget" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Stitch.Budget" +component = "Budget" + +[[form]] +id = "stitch-budget" +channel = "text" +surface = "resource budget" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/stitch.domain/entries/stitch-checkpoint.toml b/app/language/stitch.domain/entries/stitch-checkpoint.toml new file mode 100644 index 0000000..4733926 --- /dev/null +++ b/app/language/stitch.domain/entries/stitch-checkpoint.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "stitch-checkpoint" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Stitch.Compute" +component = "Checkpoint" + +[[form]] +id = "stitch-checkpoint" +channel = "text" +surface = "deterministic checkpoint" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/stitch.domain/entries/stitch-encoding.toml b/app/language/stitch.domain/entries/stitch-encoding.toml new file mode 100644 index 0000000..4cc43d0 --- /dev/null +++ b/app/language/stitch.domain/entries/stitch-encoding.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "stitch-encoding" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Stitch.Encoding" +component = "Encoding" + +[[form]] +id = "stitch-encoding" +channel = "text" +surface = "exact encoding" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/stitch.domain/entries/stitch-evidence.toml b/app/language/stitch.domain/entries/stitch-evidence.toml new file mode 100644 index 0000000..686b63d --- /dev/null +++ b/app/language/stitch.domain/entries/stitch-evidence.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "stitch-evidence" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Stitch.Evidence" +component = "Evidence" + +[[form]] +id = "stitch-evidence" +channel = "text" +surface = "scoped evidence" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/stitch.domain/entries/stitch-fragment.toml b/app/language/stitch.domain/entries/stitch-fragment.toml new file mode 100644 index 0000000..2bc52c1 --- /dev/null +++ b/app/language/stitch.domain/entries/stitch-fragment.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "stitch-fragment" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Stitch.Fragments" +component = "Fragment" + +[[form]] +id = "stitch-fragment" +channel = "text" +surface = "recovery fragment" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/stitch.domain/entries/stitch-object.toml b/app/language/stitch.domain/entries/stitch-object.toml new file mode 100644 index 0000000..f372952 --- /dev/null +++ b/app/language/stitch.domain/entries/stitch-object.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "stitch-object" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Stitch.Identity" +component = "Object" + +[[form]] +id = "stitch-object" +channel = "text" +surface = "immutable object" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/stitch.domain/entries/stitch-observation.toml b/app/language/stitch.domain/entries/stitch-observation.toml new file mode 100644 index 0000000..a5d4bf5 --- /dev/null +++ b/app/language/stitch.domain/entries/stitch-observation.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "stitch-observation" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Stitch.Observation" +component = "PeerObservation" + +[[form]] +id = "stitch-observation" +channel = "text" +surface = "peer observation" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/stitch.domain/entries/stitch-placement.toml b/app/language/stitch.domain/entries/stitch-placement.toml new file mode 100644 index 0000000..bc37a71 --- /dev/null +++ b/app/language/stitch.domain/entries/stitch-placement.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "stitch-placement" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Stitch.Custody" +component = "Placement" + +[[form]] +id = "stitch-placement" +channel = "text" +surface = "fragment placement" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/stitch.domain/entries/stitch-pointer.toml b/app/language/stitch.domain/entries/stitch-pointer.toml new file mode 100644 index 0000000..2ea13ee --- /dev/null +++ b/app/language/stitch.domain/entries/stitch-pointer.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "stitch-pointer" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Stitch.Pointer" +component = "Pointer" + +[[form]] +id = "stitch-pointer" +channel = "text" +surface = "single writer pointer" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/stitch.domain/entries/stitch-service-model.toml b/app/language/stitch.domain/entries/stitch-service-model.toml new file mode 100644 index 0000000..fdfa706 --- /dev/null +++ b/app/language/stitch.domain/entries/stitch-service-model.toml @@ -0,0 +1,17 @@ +spec = "lexlean/entry/1" +id = "stitch-service-model" +category = "label-word" +surface_arity = 0 +frame = "atom" + +[denotation] +kind = "document" +module = "Stitch.System" +component = "State" + +[[form]] +id = "stitch-service-model" +channel = "text" +surface = "Stitch recoverable service model" +canonical_source = true +features = ["sentence-case", "singular"] diff --git a/app/language/stitch.domain/lexicon.toml b/app/language/stitch.domain/lexicon.toml new file mode 100644 index 0000000..4e5dcc5 --- /dev/null +++ b/app/language/stitch.domain/lexicon.toml @@ -0,0 +1,5 @@ +spec = "lexlean/lexicon/1" +package = "stitch.domain" +version = "1.0.0" +language = "1.2" +imports = ["lexlean.core@1.2.0", "lexlean.std.bool@1.2.0", "lexlean.std.nat@1.2.0"] diff --git a/app/lean-toolchain b/app/lean-toolchain new file mode 100644 index 0000000..2b61957 --- /dev/null +++ b/app/lean-toolchain @@ -0,0 +1 @@ +leanprover/lean4:v4.32.1 diff --git a/app/lexlean.lock b/app/lexlean.lock new file mode 100644 index 0000000..16f78c4 --- /dev/null +++ b/app/lexlean.lock @@ -0,0 +1,67 @@ +spec = "lexlean/lock/2" +language = "1.2" +compiler_semantics = "5262e5b4c8b5668ae7066ad686757a6bb7f80c941d515fb9d586894fbc7de69a" +project_config_sha256 = "48c90de5fb9896bb45b03cc11692ccd1c26c99fadcc0ec4d7c6c2f481da6f56f" +lean_toolchain = "leanprover/lean4:v4.32.1" + +[[workspace_file]] +path = "lake-manifest.json" +sha256 = "1107bc06d0f0bf1716fbc980995e4895f608331a17863d16bb1ff631d70924f6" + +[[workspace_file]] +path = "lakefile.toml" +sha256 = "f93d661ae8380e42c7954c0a90166abb296ac100af42b403d7af0ac7e6b50094" + +[[workspace_file]] +path = "lean-toolchain" +sha256 = "8e3538e0ab5f81a3ee04927d8838c8c674e0e112838b4b3ce87ec218143276af" + +[[package]] +id = "lexlean.core" +version = "1.2.0" +kind = "builtin" +source = "embedded" +revision = "compiler-semantics" +tree_sha256 = "827317cae68c162f3a96c8a8de4e53ab348e7d3724fd2b834fa85ecde1a1b392" +manifest_sha256 = "271079763d269cc873531f515e56da960cd6321393b9460ff0e617666fa01d71" +imports = [] + +[[package]] +id = "lexlean.std.bool" +version = "1.2.0" +kind = "builtin" +source = "embedded" +revision = "compiler-semantics" +tree_sha256 = "3bc0fb09d706ffa7d5a1363302ea87c049acc7c7dcafde63c62682620c11be9b" +manifest_sha256 = "de58de2cf18a7a5a62d8c20649139d6dfe1f7b16b3130c75f150fbac5440a71e" +imports = ["lexlean.core@1.2.0"] + +[[package]] +id = "lexlean.std.nat" +version = "1.2.0" +kind = "builtin" +source = "embedded" +revision = "compiler-semantics" +tree_sha256 = "e0db021e01b91d651c43921d66f6b0023c8efbf17cac2ec53192ce5305e4e1ac" +manifest_sha256 = "6fb446b39e3c1c18a5f10cfa1f7aa2bd431837719eb0eb7489aadf452c9420a7" +imports = ["lexlean.core@1.2.0", "lexlean.std.bool@1.2.0"] + +[[package]] +id = "prism.arch" +version = "1.0.0" +kind = "path" +source = "language/prism.arch" +revision = "none" +tree_sha256 = "a5b1aa879a00c8f86100410c1ec1af4e2e983838f30e6dc82b3e989b0df65e2c" +manifest_sha256 = "14c95df8b512edacacdb1788b58ae90cf573b4e3f1dca0e41074bfde5a380c9f" +imports = ["lexlean.core@1.2.0", "lexlean.std.bool@1.2.0", "lexlean.std.nat@1.2.0"] + +[[package]] +id = "stitch.domain" +version = "1.0.0" +kind = "path" +source = "language/stitch.domain" +revision = "none" +tree_sha256 = "ab5577ce01864b402913437b961ba451f72c4183cc27a601a5b1fc5c066a126f" +manifest_sha256 = "6b9d7544b96a6c0bbeacb5dd9972377ffa4f9ef23dffc92eb191bd90e39cc98d" +imports = ["lexlean.core@1.2.0", "lexlean.std.bool@1.2.0", "lexlean.std.nat@1.2.0"] diff --git a/app/lexlean.toml b/app/lexlean.toml new file mode 100644 index 0000000..fb29a83 --- /dev/null +++ b/app/lexlean.toml @@ -0,0 +1,37 @@ +spec = "lexlean/project/1" +name = "stitch-recoverable-service" +language = "1.2" +module_prefix = "StitchModel" +source_roots = ["src"] +entrypoints = ["src/Product/Architecture.lex.tex", "src/Product/Experience.lex.tex", "src/Product/Host.lex.tex", "src/Product/Model.lex.tex", "src/Stitch/Authority.lex.tex", "src/Stitch/ChannelFlow.lex.tex", "src/Stitch/Effects.lex.tex", "src/Stitch/Recovery.lex.tex", "src/Stitch/Relay.lex.tex", "src/Stitch/Signaling.lex.tex", "src/Stitch/System.lex.tex", "src/Stitch/VmAdministration.lex.tex", "src/StitchApp.lex.tex"] +build_root = ".lexlean" +lockfile = "lexlean.lock" +lean_workspace = "." +lean_toolchain = "leanprover/lean4:v4.32.1" + +[[lexicon_source]] +package = "lexlean.std.nat" +kind = "builtin" + +[[lexicon_source]] +package = "prism.arch" +kind = "path" +path = "language/prism.arch" + +[[lexicon_source]] +package = "stitch.domain" +kind = "path" +path = "language/stitch.domain" + +[limits] +max_file_bytes = 4194304 +max_total_source_bytes = 67108864 +max_primitive_atoms = 2000000 +max_token_lattice_edges = 4000000 +max_parse_states = 4000000 +max_ir_nodes = 2000000 +max_scope_depth = 1024 +max_import_depth = 128 +max_diagnostics = 256 +max_child_output_bytes = 16777216 +child_timeout_ms = 300000 diff --git a/app/prism.toml b/app/prism.toml new file mode 100644 index 0000000..bfea9f2 --- /dev/null +++ b/app/prism.toml @@ -0,0 +1,10 @@ +[application] +name = "stitch-model" +version = "0.3.0" +description = "Source-modeled recovery, custody, resource admission and deterministic continuation contracts for Stitch." + +[model] +source = "src" +watch = ["src/**/*.lex.tex", "language/**/*.toml", "lexlean.toml"] + +[capabilities] diff --git a/app/prismpm.toml b/app/prismpm.toml new file mode 100644 index 0000000..1fa19ff --- /dev/null +++ b/app/prismpm.toml @@ -0,0 +1,9 @@ +spec = "prismpm/project/1" +project = "StitchModel" +lexlean_project = "lexlean.toml" +build_root = ".prism" + +[limits] +max_holo_bytes = 16777216 +max_entities = 100000 +max_diagnostics = 256 diff --git a/app/src/Foundation/Arch.lex.tex b/app/src/Foundation/Arch.lex.tex new file mode 100644 index 0000000..e015d21 --- /dev/null +++ b/app/src/Foundation/Arch.lex.tex @@ -0,0 +1,112 @@ +\begin{lexlean}{Foundation.Arch} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{prism.arch@1.0.0} +\title{architectural component} +\begin{semanticmodule} +structure{ + name: StandardReference, + type_parameters: [], + parameters: [], + fields: [ + {name: standardIndex, type: Nat}, + {name: editionIndex, type: Nat}, + {name: standardId, type: String}, + {name: edition, type: String} + ] +} + +inductive{ + name: ComponentKind, + type_parameters: [], + parameters: [], + constructors: [ + {name: service, fields: []}, + {name: database, fields: []}, + {name: externalSystem, fields: []}, + {name: cliAdapter, fields: []}, + {name: staticSite, fields: []}, + {name: releaseBinary, fields: []} + ] +} + +inductive{ + name: EdgeKind, + type_parameters: [], + parameters: [], + constructors: [{name: dataFlow, fields: []}, {name: controlFlow, fields: []}] +} + +inductive{ + name: ModelKind, + type_parameters: [], + parameters: [], + constructors: [ + {name: componentModel, fields: []}, + {name: securityModel, fields: []}, + {name: qualityModel, fields: []} + ] +} + +structure{ + name: Component, + type_parameters: [], + parameters: [], + fields: [ + {name: index, type: Nat}, + {name: kind, type: ComponentKind}, + {name: name, type: String}, + {name: text, type: String} + ] +} + +structure{ + name: Edge, + type_parameters: [], + parameters: [], + fields: [ + {name: index, type: Nat}, + {name: fromIndex, type: Nat}, + {name: toIndex, type: Nat}, + {name: kind, type: EdgeKind} + ] +} + +structure{ + name: Stakeholder, + type_parameters: [], + parameters: [], + fields: [{name: index, type: Nat}, {name: name, type: String}, {name: text, type: String}] +} + +structure{ + name: Concern, + type_parameters: [], + parameters: [], + fields: [{name: index, type: Nat}, {name: name, type: String}, {name: text, type: String}] +} + +structure{ + name: Viewpoint, + type_parameters: [], + parameters: [], + fields: [ + {name: index, type: Nat}, + {name: stakeholderIndex, type: Nat}, + {name: concernIndex, type: Nat}, + {name: modelKindIndex, type: Nat} + ] +} + +structure{ + name: View, + type_parameters: [], + parameters: [], + fields: [ + {name: index, type: Nat}, + {name: viewpointIndex, type: Nat}, + {name: modelKindIndex, type: Nat} + ] +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Foundation/Bytes.lex.tex b/app/src/Foundation/Bytes.lex.tex new file mode 100644 index 0000000..f54f9c0 --- /dev/null +++ b/app/src/Foundation/Bytes.lex.tex @@ -0,0 +1,68 @@ +\begin{lexlean}{Foundation.Bytes} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{prism.arch@1.0.0} +\title{Bounded byte buffer} +\begin{semanticmodule} +inductive{ + name: ByteOrder, + type_parameters: [], + parameters: [], + constructors: [{name: LittleEndian, fields: []}, {name: BigEndian, fields: []}] +} + +inductive{ + name: BufferError, + type_parameters: [], + parameters: [], + constructors: [ + {name: OutOfBounds, fields: []}, + {name: LengthOverflow, fields: []}, + {name: NonCanonical, fields: []} + ] +} + +structure{ + name: BoundedBuffer, + type_parameters: [], + parameters: [], + fields: [{name: bytes, type: Bytes}, {name: maximum, type: UInt64}] +} + +definition{ + name: appendBytes, + parameters: [left : Bytes, right : Bytes], + result: Bytes, + body: (prim append left right : Bytes) +} + +definition{ + name: byteLength, + parameters: [value : Bytes], + result: Nat, + body: (prim length value : Nat) +} + +definition{ + name: byteAt, + parameters: [value : Bytes, offset : Nat], + result: (Option UInt8), + body: (prim index value offset : (Option UInt8)) +} + +definition{ + name: sliceBytes, + parameters: [value : Bytes, start : Nat, count : Nat], + result: (Option Bytes), + body: (prim slice value start count : (Option Bytes)) +} + +definition{ + name: compareBytes, + parameters: [left : Bytes, right : Bytes], + result: Ordering, + body: (prim compare_bytes left right : Ordering), + axioms: [propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Foundation/View/Text/V1/Model.lex.tex b/app/src/Foundation/View/Text/V1/Model.lex.tex new file mode 100644 index 0000000..dcd17fa --- /dev/null +++ b/app/src/Foundation/View/Text/V1/Model.lex.tex @@ -0,0 +1,63 @@ +\begin{lexlean}{Foundation.View.Text.V1.Model} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{prism.arch@1.0.0} +\title{Text application model} +\begin{semanticmodule} +structure{ + name: TextView, + type_parameters: [], + parameters: [], + fields: [ + {name: title, type: String}, + {name: heading, type: String}, + {name: inputLabel, type: String}, + {name: submitLabel, type: String}, + {name: outputLabel, type: String}, + {name: inputError, type: String}, + {name: responseError, type: String} + ] +} + +structure{ + name: AcceptanceVector, + type_parameters: [], + parameters: [], + fields: [{name: request, type: Bytes}, {name: response, type: Bytes}] +} + +structure{ + name: TextApplication, + type_parameters: [], + parameters: [], + fields: [ + {name: profile, type: String}, + {name: name, type: String}, + {name: cargoName, type: String}, + {name: cargoVersion, type: String}, + {name: cargoDescription, type: String}, + {name: cargoRepository, type: String}, + {name: cargoHomepage, type: String}, + {name: libraryRoots, type: (List String)}, + {name: acceptanceVectors, type: (List AcceptanceVector)}, + {name: entryRoot, type: String}, + {name: coreContract, type: String}, + {name: requestMaximum, type: UInt32}, + {name: responseMaximum, type: UInt32}, + {name: guestAllocationMaximum, type: UInt32}, + {name: capabilitiesEmpty, type: Bool}, + {name: fatArchive, type: Bool}, + {name: primaryLayer, type: UInt8}, + {name: viewLayer, type: UInt8}, + {name: view, type: TextView} + ] +} + +definition{ + name: textApplicationProfile, + parameters: [], + result: String, + body: "prismpm/text-application/1" +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Product/Architecture.lex.tex b/app/src/Product/Architecture.lex.tex new file mode 100644 index 0000000..6fd6a58 --- /dev/null +++ b/app/src/Product/Architecture.lex.tex @@ -0,0 +1,379 @@ +\begin{lexlean}{Product.Architecture} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{prism.arch@1.0.0} +\importmodule{Foundation.Arch} +\title{architectural component} +\begin{semanticmodule} +definition{ + name: admission, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 0, kind := (ctor Foundation.Arch::ComponentKind.service), name := "admission", text := "Four-dimensional reservation ledger. Implementation: src/layer2-schedulers/policy.js. Domain contracts: Stitch.Budget."}) +} + +definition{ + name: browser, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 1, kind := (ctor Foundation.Arch::ComponentKind.staticSite), name := "browser", text := "Interactive five-layer Stitch product. Implementation: index.html. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: compute, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 2, kind := (ctor Foundation.Arch::ComponentKind.service), name := "compute", text := "Deterministic program and checkpoint replay. Implementation: src/layer4-compute/index.js, src/layer4-compute/replay.js. Domain contracts: Stitch.Compute."}) +} + +definition{ + name: cryptography, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 3, kind := (ctor Foundation.Arch::ComponentKind.externalSystem), name := "cryptography", text := "Browser WebCrypto SHA-256 and Ed25519. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: discovery, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 4, kind := (ctor Foundation.Arch::ComponentKind.service), name := "discovery", text := "DNS-over-HTTPS resolver and scoped DNS writer. Implementation: src/layer5-transport/index.js. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: identity, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 5, kind := (ctor Foundation.Arch::ComponentKind.service), name := "identity", text := "Canonical bytes, full commitments, raw encoding and fragments. Implementation: src/layer1-uor/contracts.js, src/layer1-uor/custody.js, src/layer1-uor/generated-model.js. Domain contracts: Stitch.Identity, Stitch.Encoding, Stitch.Fragments."}) +} + +definition{ + name: legacy, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 6, kind := (ctor Foundation.Arch::ComponentKind.service), name := "legacy", text := "Historical UOR and simulation conformance. Implementation: src/layer1-uor/index.js, src/layer3-storage/index.js, src/lib.rs. Domain contracts: historical simulation only."}) +} + +definition{ + name: nativeRouting, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 7, kind := (ctor Foundation.Arch::ComponentKind.externalSystem), name := "nativeRouting", text := "External Linux routing daemon; absent from browser. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: peers, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 8, kind := (ctor Foundation.Arch::ComponentKind.externalSystem), name := "peers", text := "Untrusted remote holders and compute peers. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: pointerAuthority, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 9, kind := (ctor Foundation.Arch::ComponentKind.service), name := "pointerAuthority", text := "Independently pinned single-writer key. Implementation: src/layer1-uor/pointer.js. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: publicRelay, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 10, kind := (ctor Foundation.Arch::ComponentKind.externalSystem), name := "publicRelay", text := "Optional public ntfy warm cache. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: runtimeHost, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 11, kind := (ctor Foundation.Arch::ComponentKind.externalSystem), name := "runtimeHost", text := "Browser, OS, clocks, RAM, networking and permissions. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: scheduler, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 12, kind := (ctor Foundation.Arch::ComponentKind.service), name := "scheduler", text := "Experimental proposals under enforced admission. Implementation: src/layer2-schedulers/index.js. Domain contracts: Stitch.Budget, Stitch.Observation."}) +} + +definition{ + name: signaling, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 13, kind := (ctor Foundation.Arch::ComponentKind.externalSystem), name := "signaling", text := "Public ntfy SDP/ICE signaling; BroadcastChannel on same origin. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: staticHost, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 14, kind := (ctor Foundation.Arch::ComponentKind.externalSystem), name := "staticHost", text := "Same-origin publication of application and VM assets. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: storage, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 15, kind := (ctor Foundation.Arch::ComponentKind.service), name := "storage", text := "Ephemeral local cache and conditional peer custody. Implementation: src/layer3-storage/custody.js, src/layer3-storage/index.js. Domain contracts: Stitch.Custody, Stitch.System."}) +} + +definition{ + name: transport, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 16, kind := (ctor Foundation.Arch::ComponentKind.service), name := "transport", text := "WebRTC channels, bounded messages and VM Ethernet bridge. Implementation: src/layer5-transport/index.js. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: vm, + parameters: [], + result: Foundation.Arch::Component, + body: (record Foundation.Arch::Component {index := 17, kind := (ctor Foundation.Arch::ComponentKind.service), name := "vm", text := "v86 x86 Linux guest and 9p filesystem bridge. Implementation: src/layer4-compute/index.js, v86/libv86.js, v86/v86.wasm, v86/seabios.bin, v86/vgabios.bin, images/buildroot-bzimage.bin. Host or external boundary; semantics require independent evidence."}) +} + +definition{ + name: browserAdmission, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 0, fromIndex := 1, toIndex := 0, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: browserCompute, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 1, fromIndex := 1, toIndex := 2, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: browserDiscovery, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 2, fromIndex := 1, toIndex := 4, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: browserScheduler, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 3, fromIndex := 1, toIndex := 12, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: browserStorage, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 4, fromIndex := 1, toIndex := 15, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: browserTransport, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 5, fromIndex := 1, toIndex := 16, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: browserVm, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 6, fromIndex := 1, toIndex := 17, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: computeAdmission, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 7, fromIndex := 2, toIndex := 0, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: computeIdentity, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 8, fromIndex := 2, toIndex := 5, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: computeStorage, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 9, fromIndex := 2, toIndex := 15, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: computeTransport, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 10, fromIndex := 2, toIndex := 16, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: discoveryAdmission, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 11, fromIndex := 4, toIndex := 0, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: discoveryAuthority, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 12, fromIndex := 4, toIndex := 9, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: discoveryHost, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 13, fromIndex := 4, toIndex := 11, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: identityCryptography, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 14, fromIndex := 5, toIndex := 3, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: relayTransport, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 15, fromIndex := 10, toIndex := 16, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: schedulerAdmission, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 16, fromIndex := 12, toIndex := 0, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: schedulerTransport, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 17, fromIndex := 12, toIndex := 16, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: signalingTransport, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 18, fromIndex := 13, toIndex := 16, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: staticBrowser, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 19, fromIndex := 14, toIndex := 1, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: staticVm, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 20, fromIndex := 14, toIndex := 17, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: storageAdmission, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 21, fromIndex := 15, toIndex := 0, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: storageIdentity, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 22, fromIndex := 15, toIndex := 5, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: storagePeers, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 23, fromIndex := 15, toIndex := 8, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: storageTransport, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 24, fromIndex := 15, toIndex := 16, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: transportAdmission, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 25, fromIndex := 16, toIndex := 0, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: transportPeers, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 26, fromIndex := 16, toIndex := 8, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: transportSignaling, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 27, fromIndex := 16, toIndex := 13, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: transportVm, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 28, fromIndex := 16, toIndex := 17, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: vmStorage, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 29, fromIndex := 17, toIndex := 15, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: vmTransport, + parameters: [], + result: Foundation.Arch::Edge, + body: (record Foundation.Arch::Edge {index := 30, fromIndex := 17, toIndex := 16, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)}) +} + +definition{ + name: operator, + parameters: [], + result: Foundation.Arch::Stakeholder, + body: (record Foundation.Arch::Stakeholder {index := 0, name := "Stitch operator", text := "Chooses mesh participation, public disclosure, trusted pointer authority, DNS writes and VM actions."}) +} + +definition{ + name: recoverability, + parameters: [], + result: Foundation.Arch::Concern, + body: (record Foundation.Arch::Concern {index := 0, name := "Conditional recovery and honest assurance", text := "Recover exact bytes and replay pure jobs without confusing untrusted host observations, network availability or arbitrary VM effects with proved domain rules."}) +} + +definition{ + name: productViewpoint, + parameters: [], + result: Foundation.Arch::Viewpoint, + body: (record Foundation.Arch::Viewpoint {index := 0, stakeholderIndex := 0, concernIndex := 0, modelKindIndex := 0}) +} + +definition{ + name: productView, + parameters: [], + result: Foundation.Arch::View, + body: (record Foundation.Arch::View {index := 0, viewpointIndex := 0, modelKindIndex := 0}) +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Product/Experience.lex.tex b/app/src/Product/Experience.lex.tex new file mode 100644 index 0000000..03eda82 --- /dev/null +++ b/app/src/Product/Experience.lex.tex @@ -0,0 +1,925 @@ +\begin{lexlean}{Product.Experience} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\title{Stitch recoverable service model} +\begin{semanticmodule} +structure{ + name: Facts, + type_parameters: [], + parameters: [], + fields: [ + {name: recoveryBusy, type: Bool}, + {name: recoveryFileSelected, type: Bool}, + {name: recoveryHasEvidence, type: Bool}, + {name: recoveryHasObjects, type: Bool}, + {name: recoveryHasJobs, type: Bool}, + {name: recoveryHasAnchors, type: Bool}, + {name: recoveryAnchorConsent, type: Bool}, + {name: recoveryAcceptedAnchor, type: Bool}, + {name: recoveryCanRestoreAnchor, type: Bool}, + {name: recoveryRestoredAnchor, type: Bool}, + {name: vmCanBoot, type: Bool}, + {name: vmCanExecute, type: Bool}, + {name: vmCanAdminister, type: Bool}, + {name: vmCanCancelObservation, type: Bool}, + {name: vmCanForgetCommand, type: Bool}, + {name: vmCanReconcileCommand, type: Bool}, + {name: vmAdminBlocked, type: Bool}, + {name: vmTerminationPending, type: Bool}, + {name: vmStopped, type: Bool}, + {name: vmDestroyed, type: Bool}, + {name: disclosureAccepted, type: Bool}, + {name: meshJoined, type: Bool}, + {name: peersReachable, type: Bool}, + {name: relayEnabled, type: Bool}, + {name: hasObject, type: Bool}, + {name: hasPartial, type: Bool}, + {name: placementObjectSelected, type: Bool}, + {name: recoverablePlacement, type: Bool}, + {name: hasJobs, type: Bool}, + {name: unfinishedJobs, type: Bool}, + {name: replayedJobs, type: Bool}, + {name: vmBooting, type: Bool}, + {name: vmReady, type: Bool}, + {name: vmFailed, type: Bool}, + {name: authorityPinned, type: Bool}, + {name: headRetained, type: Bool}, + {name: dnsConfigured, type: Bool}, + {name: publicationBusy, type: Bool}, + {name: publicationUnknown, type: Bool}, + {name: publicationPublished, type: Bool}, + {name: policyBlocked, type: Bool}, + {name: policyAttention, type: Bool} + ] +} + +structure{ + name: Journey, + type_parameters: [], + parameters: [], + fields: [ + {name: id, type: String}, + {name: target, type: String}, + {name: title, type: String}, + {name: summary, type: String} + ] +} + +structure{ + name: View, + type_parameters: [], + parameters: [], + fields: [ + {name: id, type: String}, + {name: journey, type: String}, + {name: title, type: String}, + {name: evidence, type: String}, + {name: detail, type: String} + ] +} + +structure{ + name: Action, + type_parameters: [], + parameters: [], + fields: [ + {name: code, type: Nat}, + {name: id, type: String}, + {name: control, type: String}, + {name: journey, type: String}, + {name: label, type: String}, + {name: help, type: String} + ] +} + +definition{ + name: initialFacts, + parameters: [], + result: Facts, + body: (record Facts {recoveryBusy := false, recoveryFileSelected := false, recoveryHasEvidence := false, recoveryHasObjects := false, recoveryHasJobs := false, recoveryHasAnchors := false, recoveryAnchorConsent := false, recoveryAcceptedAnchor := false, recoveryCanRestoreAnchor := false, recoveryRestoredAnchor := false, vmCanBoot := false, vmCanExecute := false, vmCanAdminister := false, vmCanCancelObservation := false, vmCanForgetCommand := false, vmCanReconcileCommand := false, vmAdminBlocked := false, vmTerminationPending := false, vmStopped := false, vmDestroyed := false, disclosureAccepted := false, meshJoined := false, peersReachable := false, relayEnabled := false, hasObject := false, hasPartial := false, placementObjectSelected := false, recoverablePlacement := false, hasJobs := false, unfinishedJobs := false, replayedJobs := false, vmBooting := false, vmReady := false, vmFailed := false, authorityPinned := false, headRetained := false, dnsConfigured := false, publicationBusy := false, publicationUnknown := false, publicationPublished := false, policyBlocked := false, policyAttention := false}) +} + +definition{ + name: journeyMesh, + parameters: [], + result: Journey, + body: (record Journey {id := "mesh", target := "meshPanel", title := "Join a mesh", summary := "Review public signaling disclosure, join explicitly, then inspect reachable peers."}) +} + +definition{ + name: journeyObjects, + parameters: [], + result: Journey, + body: (record Journey {id := "objects", target := "objectsPanel", title := "Store, place and recover objects", summary := "Separate local integrity from conditional peer custody and actual recovery."}) +} + +definition{ + name: journeyCompute, + parameters: [], + result: Journey, + body: (record Journey {id := "compute", target := "computePanel", title := "Run and resume pure jobs", summary := "Replay deterministic checkpoints before continuation; VM effects have a separate contract."}) +} + +definition{ + name: journeyVm, + parameters: [], + result: Journey, + body: (record Journey {id := "vm", target := "vmPanel", title := "Inspect host VM effects", summary := "Boot and execute only through the observed VM lifecycle. Output integrity does not certify execution."}) +} + +definition{ + name: journeyPointers, + parameters: [], + result: Journey, + body: (record Journey {id := "pointers", target := "pointersPanel", title := "Pin, discover and publish pointers", summary := "Pin authority independently, retain the local head, and reconcile uncertain provider writes."}) +} + +definition{ + name: journeyResources, + parameters: [], + result: Journey, + body: (record Journey {id := "resources", target := "resourcesPanel", title := "Inspect and renew allowances", summary := "Inspect bounded application charges, export them, and explicitly grant a new epoch."}) +} + +definition{ + name: journeys, + parameters: [], + result: (List Journey), + body: (cons (journeyMesh) (cons (journeyObjects) (cons (journeyCompute) (cons (journeyVm) (cons (journeyPointers) (cons (journeyResources) (nil Journey))))))) +} + +definition{ + name: meshDisclosure, + parameters: [], + result: View, + body: (record View {id := "meshDisclosure", journey := "mesh", title := "Review disclosure", evidence := "NOT JOINED", detail := "Joining sends mesh topic, signaling messages and ICE connection metadata to public ntfy signaling and STUN services. Mesh keys are not passwords. Object and job bytes require the separate public relay opt-in."}) +} + +definition{ + name: meshReady, + parameters: [], + result: View, + body: (record View {id := "meshReady", journey := "mesh", title := "Ready for explicit join", evidence := "DISCLOSURE ACCEPTED", detail := "No connection is established by accepting disclosure alone. Choose Join Mesh and Sync to start."}) +} + +definition{ + name: meshSearching, + parameters: [], + result: View, + body: (record View {id := "meshSearching", journey := "mesh", title := "Joined; looking for peers", evidence := "NO OPEN PEER OBSERVED", detail := "A join request does not establish peer availability. Keep this tab open or explicitly rejoin after changing the mesh key."}) +} + +definition{ + name: meshConnected, + parameters: [], + result: View, + body: (record View {id := "meshConnected", journey := "mesh", title := "Peer channel observed", evidence := "OPEN CHANNEL OBSERVED", detail := "An open channel is a current local observation, not durable custody, authority, or a distinct failure domain."}) +} + +definition{ + name: objectsEmpty, + parameters: [], + result: View, + body: (record View {id := "objectsEmpty", journey := "objects", title := "No local object bytes", evidence := "NO RECOVERY EVIDENCE", detail := "Store an object, or fetch retained fragments. Recovery needs two distinct valid fragments of the exact encoding; an empty result is not a successful recovery."}) +} + +definition{ + name: objectsPartial, + parameters: [], + result: View, + body: (record View {id := "objectsPartial", journey := "objects", title := "Waiting for enough fragments", evidence := "PARTIAL FRAGMENTS", detail := "Insufficient fragments do not establish object integrity. Fetch again when holders are reachable; do not erase other retained copies."}) +} + +definition{ + name: objectsLocal, + parameters: [], + result: View, + body: (record View {id := "objectsLocal", journey := "objects", title := "Local object verified", evidence := "DIGEST MATCH; REMOTE CUSTODY UNESTABLISHED", detail := "Local bytes match the complete commitment. Select that exact retained object and repair placement after peers join, leases expire or routes change. Pending or uncertain transfers never establish remote redundancy."}) +} + +definition{ + name: objectsPlaced, + parameters: [], + result: View, + body: (record View {id := "objectsPlaced", journey := "objects", title := "Conditional placement observed", evidence := "DIGEST-CHECKED PEER ASSERTIONS", detail := "At least one object has two current committed fragment assertions on currently reachable routes. Repair the selected object to fill missing indices or explicitly replace a current holder. Recovery still depends on truthful, reachable holders and exact encoding. Distinct peer identifiers do not establish independent machines."}) +} + +definition{ + name: computeEmpty, + parameters: [], + result: View, + body: (record View {id := "computeEmpty", journey := "compute", title := "No pure jobs observed", evidence := "NO EXECUTION EVIDENCE", detail := "Start a deterministic job or scan reachable checkpoints. Host and VM effects are not replay-certified."}) +} + +definition{ + name: computeUnverified, + parameters: [], + result: View, + body: (record View {id := "computeUnverified", journey := "compute", title := "Unfinished job requires replay", evidence := "UNVERIFIED CHECKPOINT", detail := "A checkpoint claim is not execution evidence. Resume scans validate identity, program and checkpoint chain and replay before continuation."}) +} + +definition{ + name: computeReplay, + parameters: [], + result: View, + body: (record View {id := "computeReplay", journey := "compute", title := "Pure continuation checked locally", evidence := "REPLAYED PURE CHECKPOINT", detail := "Observed pure checkpoints were independently replayed by this browser adapter. This does not certify VM effects, a remote worker, availability, or durable retention."}) +} + +definition{ + name: computeDone, + parameters: [], + result: View, + body: (record View {id := "computeDone", journey := "compute", title := "Pure job state observed", evidence := "PURE JOB STATE; INSPECT EACH ROW", detail := "Completion and replay are separate. Each job row reports its own execution evidence; no aggregate claim certifies every job."}) +} + +definition{ + name: vmIdle, + parameters: [], + result: View, + body: (record View {id := "vmIdle", journey := "vm", title := "VM not running", evidence := "HOST EFFECT NOT STARTED", detail := "Boot loads the local v86 assets. Guest execution and its network effects remain host assumptions, separate from deterministic pure-job replay."}) +} + +definition{ + name: vmBooting, + parameters: [], + result: View, + body: (record View {id := "vmBooting", journey := "vm", title := "VM boot in progress", evidence := "HOST EFFECT PENDING", detail := "Wait for an observed ready or failed lifecycle. Repeated boot and command execution are unavailable while booting."}) +} + +definition{ + name: vmReady, + parameters: [], + result: View, + body: (record View {id := "vmReady", journey := "vm", title := "VM reports ready", evidence := "HOST-OBSERVED READY", detail := "Commands execute in the guest. Stored stdout can receive an object digest, but that digest is not evidence that the command executed correctly or only once."}) +} + +definition{ + name: vmFailed, + parameters: [], + result: View, + body: (record View {id := "vmFailed", journey := "vm", title := "VM failed or interrupted", evidence := "HOST EFFECT FAILED", detail := "Inspect the VM error before choosing another boot. Do not treat a timeout or missing output as proof that guest effects did not occur."}) +} + +definition{ + name: pointerUnpinned, + parameters: [], + result: View, + body: (record View {id := "pointerUnpinned", journey := "pointers", title := "Authority must be pinned", evidence := "UNTRUSTED DISCOVERY", detail := "DNS records are discovery hints. Enter a key learned independently or explicitly choose and pin a saved or session-only signing key. A discovered key cannot authorize itself."}) +} + +definition{ + name: pointerPinned, + parameters: [], + result: View, + body: (record View {id := "pointerPinned", journey := "pointers", title := "Authority pinned; no retained head", evidence := "PINNED KEY ONLY", detail := "Discover or paste a signed pointer. With no retained head only a valid bootstrap is accepted; a lost later head requires a trusted recent anchor."}) +} + +definition{ + name: pointerLocal, + parameters: [], + result: View, + body: (record View {id := "pointerLocal", journey := "pointers", title := "Local pointer admitted", evidence := "OBSERVER-LOCAL HEAD; NOT PUBLISHED", detail := "The signature, authority and succession were accepted against this session head. This is not a provider publication receipt or global consensus."}) +} + +definition{ + name: pointerPending, + parameters: [], + result: View, + body: (record View {id := "pointerPending", journey := "pointers", title := "Provider operation pending", evidence := "PUBLICATION PENDING", detail := "Wait for the provider observation. Do not start another candidate while the current operation is in flight."}) +} + +definition{ + name: pointerUnknown, + parameters: [], + result: View, + body: (record View {id := "pointerUnknown", journey := "pointers", title := "Reconcile the exact candidate", evidence := "PUBLICATION UNKNOWN", detail := "The write may have completed. The retained candidate remains the reconciliation target. Read the provider without repeating the write or advancing to another candidate."}) +} + +definition{ + name: pointerPublished, + parameters: [], + result: View, + body: (record View {id := "pointerPublished", journey := "pointers", title := "Provider record observed", evidence := "PROVIDER CONFIRMED; OBSERVER-LOCAL", detail := "The provider confirmed this candidate or a read found its exact bytes. This does not establish global DNS ordering, resolver propagation, or consensus."}) +} + +definition{ + name: resourcesActive, + parameters: [], + result: View, + body: (record View {id := "resourcesActive", journey := "resources", title := "Application allowance active", evidence := "APPLICATION ACCOUNTING ONLY", detail := "Requests, application transfer bytes, new cache allocations and pure ring steps are bounded. TLS, ICE/STUN, VM work and host overhead are outside this accounting."}) +} + +definition{ + name: resourcesBlocked, + parameters: [], + result: View, + body: (record View {id := "resourcesBlocked", journey := "resources", title := "Review exhausted or refused allowance", evidence := "ALLOWANCE OR REFUSAL NEEDS REVIEW", detail := "Inspect and export retained charges. Each operation still checks its exact resource vector; a zero or exhausted dimension does not forbid work that consumes none of it. An expired epoch or full reservation log needs renewal. Renewal retains charges and does not retry effects."}) +} + +definition{ + name: actionJoin, + parameters: [], + result: Action, + body: (record Action {code := 0, id := "join", control := "reconnectBtn", journey := "mesh", label := "Join Mesh and Sync", help := "Requires explicit signaling disclosure and an available application allowance."}) +} + +definition{ + name: actionStore, + parameters: [], + result: Action, + body: (record Action {code := 1, id := "store", control := "dbPutBtn", journey := "objects", label := "Store and Request Placement", help := "Commit local bytes; request conditional placement with reachable peers."}) +} + +definition{ + name: actionClear, + parameters: [], + result: Action, + body: (record Action {code := 2, id := "clear", control := "dbWipeLocalBtn", journey := "objects", label := "Clear Local Object Bytes", help := "Only local bytes are cleared. Recovery may fail if no other fragments remain."}) +} + +definition{ + name: actionRecover, + parameters: [], + result: Action, + body: (record Action {code := 3, id := "recover", control := "dbSyncBtn", journey := "objects", label := "Fetch Reachable Fragments", help := "Checks fragments and complete object commitment before recovery."}) +} + +definition{ + name: actionStart, + parameters: [], + result: Action, + body: (record Action {code := 4, id := "start", control := "startJobBtn", journey := "compute", label := "Start Pure Replayable Job", help := "Deterministic ring work; not guest execution."}) +} + +definition{ + name: actionResume, + parameters: [], + result: Action, + body: (record Action {code := 5, id := "resume", control := "takeoverJobsBtn", journey := "compute", label := "Scan and Resume Pure Jobs", help := "Replay accepted checkpoints before continuation."}) +} + +definition{ + name: actionBoot, + parameters: [], + result: Action, + body: (record Action {code := 6, id := "boot", control := "bootVmBtn", journey := "vm", label := "Boot Linux VM", help := "Offline boot needs no IP address. Ethernet sharing requires an explicit static IPv4 host address and compatible subnet prefix before boot. Destroy retained instances before reconfiguration; operators must ensure address uniqueness."}) +} + +definition{ + name: actionExecute, + parameters: [], + result: Action, + body: (record Action {code := 7, id := "execute", control := "runVmCmdBtn", journey := "vm", label := "Run Guest Command and Store Stdout", help := "Host effect; a stored output digest does not certify execution."}) +} + +definition{ + name: actionSrv, + parameters: [], + result: Action, + body: (record Action {code := 8, id := "srv", control := "resolveSrvBtn", journey := "pointers", label := "Discover SRV Records", help := "DNS is discovery evidence only."}) +} + +definition{ + name: actionTxt, + parameters: [], + result: Action, + body: (record Action {code := 9, id := "txt", control := "resolveTxtBtn", journey := "pointers", label := "Discover and Check TXT Pointers", help := "Only independently pinned keys can authorize admitted pointer heads."}) +} + +definition{ + name: actionPin, + parameters: [], + result: Action, + body: (record Action {code := 10, id := "pin", control := "pinSessionAuthorityBtn", journey := "pointers", label := "Trust Saved Key or Create Session Key", help := "Explicitly pin the restored saved key, or create a session-only key if none is loaded. A different key does not inherit earlier trust."}) +} + +definition{ + name: actionAdmit, + parameters: [], + result: Action, + body: (record Action {code := 11, id := "admit", control := "admitPointerBtn", journey := "pointers", label := "Admit Pasted Pointer", help := "Requires a pinned authority and available application allowance."}) +} + +definition{ + name: actionPublish, + parameters: [], + result: Action, + body: (record Action {code := 12, id := "publish", control := "writeSignedDnsBtn", journey := "pointers", label := "Admit Next Pointer and Publish TXT", help := "Without provider credentials, only the local head is admitted. Unresolved writes cannot advance candidates."}) +} + +definition{ + name: actionReconcile, + parameters: [], + result: Action, + body: (record Action {code := 13, id := "reconcile", control := "reconcilePointerBtn", journey := "pointers", label := "Reconcile Unknown Publication", help := "Read the exact scoped provider candidate; do not repeat the uncertain write."}) +} + +definition{ + name: actionRenew, + parameters: [], + result: Action, + body: (record Action {code := 14, id := "renew", control := "renewBudgetBtn", journey := "resources", label := "Start New Epoch with These Limits", help := "Grants a fresh bounded allowance; retains prior epochs and does not retry effects."}) +} + +definition{ + name: actionExport, + parameters: [], + result: Action, + body: (record Action {code := 15, id := "export", control := "exportBudgetHistoryBtn", journey := "resources", label := "Export Policy History", help := "Export existing accounting without changing or refunding charges."}) +} + +definition{ + name: actionRecoveryExport, + parameters: [], + result: Action, + body: (record Action {code := 16, id := "RecoveryExport", control := "exportRecoveryBtn", journey := "objects", label := "Export Live Evidence", help := "Export complete local objects, pure checkpoints and supplied pointer evidence; no keys."}) +} + +definition{ + name: actionRecoveryImport, + parameters: [], + result: Action, + body: (record Action {code := 17, id := "RecoveryImport", control := "importRecoveryBtn", journey := "objects", label := "Verify and Import Locally", help := "Validate the complete bounded file before committing session-only evidence; no host effects."}) +} + +definition{ + name: actionRecoverySave, + parameters: [], + result: Action, + body: (record Action {code := 18, id := "RecoverySave", control := "exportRecoveredBtn", journey := "objects", label := "Export Recovery Vault", help := "Save verified evidence externally; accepted trust is never transferred by a file."}) +} + +definition{ + name: actionRecoveryDownload, + parameters: [], + result: Action, + body: (record Action {code := 19, id := "RecoveryDownload", control := "downloadRecoveredObjectBtn", journey := "objects", label := "Download Verified Object", help := "Download checked local bytes without mounting or publishing them."}) +} + +definition{ + name: actionRecoveryFinish, + parameters: [], + result: Action, + body: (record Action {code := 20, id := "RecoveryFinish", control := "resumeRecoveredJobBtn", journey := "objects", label := "Finish Pure Job Locally", help := "Explicitly finish deterministic ring work only; no VM or external effects."}) +} + +definition{ + name: actionRecoveryTrust, + parameters: [], + result: Action, + body: (record Action {code := 21, id := "RecoveryTrust", control := "acceptRecoveryAnchorBtn", journey := "objects", label := "Accept Exact Recent Anchor", help := "Requires independently obtained exact recent digest and writer key, current validity and explicit consent."}) +} + +definition{ + name: actionVmStop, + parameters: [], + result: Action, + body: (record Action {code := 22, id := "VmStop", control := "stopVmBtn", journey := "vm", label := "Stop VM", help := "Stop the current guest; an unconfirmed stop remains quarantined."}) +} + +definition{ + name: actionVmDestroy, + parameters: [], + result: Action, + body: (record Action {code := 23, id := "VmDestroy", control := "destroyVmBtn", journey := "vm", label := "Destroy VM", help := "Destroy the guest instance, revoke its grants and refuse stale callbacks."}) +} + +definition{ + name: actionVmCancel, + parameters: [], + result: Action, + body: (record Action {code := 24, id := "VmCancel", control := "cancelVmObservationBtn", journey := "vm", label := "Cancel and Stop VM", help := "Before dispatch, prevent the command. After dispatch, stop the whole VM, including other guest work; prior effects remain unknown."}) +} + +definition{ + name: actionVmReconcile, + parameters: [], + result: Action, + body: (record Action {code := 25, id := "VmReconcile", control := "reconcileVmCommandBtn", journey := "vm", label := "Observe Selected Command Result", help := "Observe the same command result without executing the command again."}) +} + +definition{ + name: actionVmForget, + parameters: [], + result: Action, + body: (record Action {code := 26, id := "VmForget", control := "forgetVmCommandBtn", journey := "vm", label := "Forget Resolved Command Evidence", help := "Free retained host command output only when resolved. Unknown effects stay retained; guest files are unchanged."}) +} + +definition{ + name: actionSaveAuthority, + parameters: [], + result: Action, + body: (record Action {code := 27, id := "saveAuthority", control := "saveAuthorityBtn", journey := "pointers", label := "Set Up or Restore Saved Authority", help := "Save a nonextractable origin-local signing key and explicitly pin it. Browser storage can be lost; there is no key backup or automatic replacement."}) +} + +definition{ + name: actionLoadPublication, + parameters: [], + result: Action, + body: (record Action {code := 28, id := "loadPublication", control := "loadPublicationBtn", journey := "pointers", label := "Load Saved Publication", help := "Load the exact zone, name and authority journal before reconciliation. Never repeat an unknown write merely because its owner tab closed."}) +} + +definition{ + name: actionRecoveryRestore, + parameters: [], + result: Action, + body: (record Action {code := 29, id := "RecoveryRestore", control := "restoreRecoveryAnchorBtn", journey := "objects", label := "Restore Accepted Live Head", help := "Explicitly restore only the separately accepted exact anchor into the same pinned live name and key, with no different retained head. No DNS, mesh or VM effect."}) +} + +definition{ + name: actionPlacementRepair, + parameters: [], + result: Action, + body: (record Action {code := 30, id := "PlacementRepair", control := "repairPlacementBtn", journey := "objects", label := "Repair Selected Placement", help := "Use the exact retained verified object to fill missing fragments, refresh expired custody or replace a selected live holder. Uncertain requests and old copies stay accounted; only fresh checked receipts establish custody."}) +} + +definition{ + name: placementRepairAllowed, + parameters: [selected : Bool, peers : Bool, blocked : Bool], + result: Bool, + body: (selected && (peers && (not blocked))) +} + +theorem{ + name: unselectedObjectCannotRepair, + parameters: [], + statement: (forall (peers : Bool), (forall (blocked : Bool), ((placementRepairAllowed false peers blocked) = false))), + proof: decide{} +} + +theorem{ + name: blockedPolicyCannotRepair, + parameters: [], + statement: (forall (selected : Bool), (forall (peers : Bool), ((placementRepairAllowed selected peers true) = false))), + proof: decide{} +} + +definition{ + name: actions, + parameters: [], + result: (List Action), + body: (cons (actionJoin) (cons (actionStore) (cons (actionClear) (cons (actionRecover) (cons (actionStart) (cons (actionResume) (cons (actionBoot) (cons (actionExecute) (cons (actionSrv) (cons (actionTxt) (cons (actionPin) (cons (actionAdmit) (cons (actionPublish) (cons (actionReconcile) (cons (actionRenew) (cons (actionExport) (cons (actionRecoveryExport) (cons (actionRecoveryImport) (cons (actionRecoverySave) (cons (actionRecoveryDownload) (cons (actionRecoveryFinish) (cons (actionRecoveryTrust) (cons (actionVmStop) (cons (actionVmDestroy) (cons (actionVmCancel) (cons (actionVmReconcile) (cons (actionVmForget) (cons (actionSaveAuthority) (cons (actionLoadPublication) (cons (actionRecoveryRestore) (cons (actionPlacementRepair) (nil Action)))))))))))))))))))))))))))))))) +} + +definition{ + name: recoveryEmpty, + parameters: [], + result: View, + body: (record View {id := "recoveryEmpty", journey := "objects", title := "No imported recovery evidence", evidence := "NO RESTORE EVIDENCE", detail := "Export complete live evidence before losing RAM, or choose a retained file. No recovery can survive loss of every required byte."}) +} + +definition{ + name: recoveryChecking, + parameters: [], + result: View, + body: (record View {id := "recoveryChecking", journey := "objects", title := "Checking recovery evidence", evidence := "NOT YET COMMITTED", detail := "The candidate is being validated. Existing evidence remains unchanged until the complete bounded operation commits."}) +} + +definition{ + name: recoveryChecked, + parameters: [], + result: View, + body: (record View {id := "recoveryChecked", journey := "objects", title := "Recovery evidence checked locally", evidence := "SESSION-ONLY VERIFIED EVIDENCE", detail := "Download restored objects or explicitly finish pure jobs. Imported pointer anchors remain untrusted; no mesh, VM or DNS effects ran."}) +} + +definition{ + name: recoveryTrusted, + parameters: [], + result: View, + body: (record View {id := "recoveryTrusted", journey := "objects", title := "Exact anchor accepted locally", evidence := "OPERATOR-ACCEPTED RECENT ANCHOR", detail := "The operator accepted an independently obtained exact digest and writer. Restore it separately into the same independently pinned live scope to resume strict succession. A different retained head is never overwritten. This is not global latest-state evidence or durable authority recovery."}) +} + +definition{ + name: recoveryRestored, + parameters: [], + result: View, + body: (record View {id := "recoveryRestored", journey := "objects", title := "Accepted anchor is the live local head", evidence := "STRICT SUCCESSION AVAILABLE", detail := "Only the exact next revision can advance this pinned observer. Restoration made no DNS write, mesh or VM effect, and proves neither global freshness nor durable retention."}) +} + +definition{ + name: vmTerminationPending, + parameters: [], + result: View, + body: (record View {id := "vmTerminationPending", journey := "vm", title := "Awaiting VM termination confirmation", evidence := "HOST TERMINATION PENDING", detail := "Stop or destroy was requested. The instance remains retained and locked until the host confirms the outcome. Prior command evidence is unchanged; unknown guest effects are not rolled back."}) +} + +definition{ + name: vmStopped, + parameters: [], + result: View, + body: (record View {id := "vmStopped", journey := "vm", title := "VM stop confirmed; instance retained", evidence := "HOST-OBSERVED STOPPED", detail := "The emulator confirmed stop. Destroy the retained instance before booting or changing configuration. Completed command evidence remains available; unknown prior guest effects remain unknown."}) +} + +definition{ + name: vmDestroyed, + parameters: [], + result: View, + body: (record View {id := "vmDestroyed", journey := "vm", title := "VM destruction confirmed", evidence := "HOST-OBSERVED DESTROYED", detail := "The emulator confirmed destruction and released the instance. You may configure and boot a fresh VM. Retained command evidence is unchanged; unknown prior guest effects are not rolled back."}) +} + +definition{ + name: vmQuarantined, + parameters: [], + result: View, + body: (record View {id := "vmQuarantined", journey := "vm", title := "Guest administration unresolved", evidence := "HOST OUTCOME UNKNOWN", detail := "The guest instance is quarantined. Stop or destroy it explicitly; do not repeat an unknown command or boot another instance."}) +} + +definition{ + name: recoveryView, + parameters: [facts : Facts], + result: View, + body: (if (project facts recoveryBusy) then (recoveryChecking) else (if (project facts recoveryRestoredAnchor) then (recoveryRestored) else (if (project facts recoveryAcceptedAnchor) then (recoveryTrusted) else (if (project facts recoveryHasEvidence) then (recoveryChecked) else (recoveryEmpty))))) +} + +definition{ + name: meshView, + parameters: [facts : Facts], + result: View, + body: (if (project facts disclosureAccepted) then (if (project facts meshJoined) then (if (project facts peersReachable) then (meshConnected) else (meshSearching)) else (meshReady)) else (meshDisclosure)) +} + +definition{ + name: objectsView, + parameters: [facts : Facts], + result: View, + body: (if (project facts hasObject) then (if (project facts recoverablePlacement) then (objectsPlaced) else (objectsLocal)) else (if (project facts hasPartial) then (objectsPartial) else (objectsEmpty))) +} + +definition{ + name: computeView, + parameters: [facts : Facts], + result: View, + body: (if (project facts unfinishedJobs) then (if (project facts replayedJobs) then (computeReplay) else (computeUnverified)) else (if (project facts hasJobs) then (computeDone) else (computeEmpty))) +} + +definition{ + name: vmView, + parameters: [facts : Facts], + result: View, + body: (if (project facts vmTerminationPending) then (vmTerminationPending) else (if (project facts vmStopped) then (vmStopped) else (if (project facts vmAdminBlocked) then (vmQuarantined) else (if (project facts vmDestroyed) then (vmDestroyed) else (if (project facts vmBooting) then (vmBooting) else (if (project facts vmReady) then (vmReady) else (if (project facts vmFailed) then (vmFailed) else (vmIdle)))))))) +} + +definition{ + name: pointersView, + parameters: [facts : Facts], + result: View, + body: (if (project facts authorityPinned) then (if (project facts publicationBusy) then (pointerPending) else (if (project facts publicationUnknown) then (pointerUnknown) else (if (project facts publicationPublished) then (pointerPublished) else (if (project facts headRetained) then (pointerLocal) else (pointerPinned))))) else (pointerUnpinned)) +} + +definition{ + name: resourcesView, + parameters: [facts : Facts], + result: View, + body: (if ((project facts policyBlocked) || (project facts policyAttention)) then (resourcesBlocked) else (resourcesActive)) +} + +definition{ + name: joinAllowed, + parameters: [disclosed : Bool, blocked : Bool], + result: Bool, + body: (disclosed && (not blocked)) +} + +definition{ + name: publicationAllowed, + parameters: [pinned : Bool, candidate : Bool, busy : Bool, unknown : Bool, blocked : Bool], + result: Bool, + body: (pinned && (candidate && ((not busy) && ((not unknown) && (not blocked))))) +} + +definition{ + name: reconciliationAllowed, + parameters: [pinned : Bool, configured : Bool, unknown : Bool, busy : Bool, blocked : Bool], + result: Bool, + body: (pinned && (configured && (unknown && ((not busy) && (not blocked))))) +} + +definition{ + name: executionAllowed, + parameters: [ready : Bool, blocked : Bool], + result: Bool, + body: (ready && (not blocked)) +} + +definition{ + name: actionAllowed, + parameters: [action : Nat, facts : Facts], + result: Bool, + body: (if (action =? 0) then (joinAllowed (project facts disclosureAccepted) (project facts policyBlocked)) else (if (action =? 1) then (not (project facts policyBlocked)) else (if (action =? 2) then (project facts hasObject) else (if (action =? 3) then (((project facts meshJoined) || (project facts relayEnabled)) && (not (project facts policyBlocked))) else (if (action =? 4) then (not (project facts policyBlocked)) else (if (action =? 5) then (((project facts unfinishedJobs) || ((project facts meshJoined) || (project facts relayEnabled))) && (not (project facts policyBlocked))) else (if (action =? 6) then ((project facts vmCanBoot) && ((not (project facts vmReady)) && (not (project facts vmBooting)))) else (if (action =? 7) then ((project facts vmCanExecute) && (executionAllowed (project facts vmReady) (project facts policyBlocked))) else (if (action =? 8) then (not (project facts policyBlocked)) else (if (action =? 9) then (not (project facts policyBlocked)) else (if (action =? 10) then true else (if (action =? 11) then ((project facts authorityPinned) && (not (project facts policyBlocked))) else (if (action =? 12) then (publicationAllowed (project facts authorityPinned) ((project facts hasObject) || (project facts headRetained)) (project facts publicationBusy) (project facts publicationUnknown) (project facts policyBlocked)) else (if (action =? 13) then (reconciliationAllowed (project facts authorityPinned) (project facts dnsConfigured) (project facts publicationUnknown) (project facts publicationBusy) (project facts policyBlocked)) else (if (action =? 14) then true else (if (action =? 15) then true else (if (action =? 16) then ((not (project facts recoveryBusy)) && ((project facts hasObject) || ((project facts hasJobs) || (project facts headRetained)))) else (if (action =? 17) then ((not (project facts recoveryBusy)) && (project facts recoveryFileSelected)) else (if (action =? 18) then ((not (project facts recoveryBusy)) && (project facts recoveryHasEvidence)) else (if (action =? 19) then ((not (project facts recoveryBusy)) && (project facts recoveryHasObjects)) else (if (action =? 20) then ((not (project facts recoveryBusy)) && (project facts recoveryHasJobs)) else (if (action =? 21) then ((not (project facts recoveryBusy)) && ((project facts recoveryHasAnchors) && (project facts recoveryAnchorConsent))) else (if (action =? 22) then ((project facts vmCanAdminister) && (not (project facts vmStopped))) else (if (action =? 23) then (project facts vmCanAdminister) else (if (action =? 24) then (project facts vmCanCancelObservation) else (if (action =? 25) then (project facts vmCanReconcileCommand) else (if (action =? 26) then (project facts vmCanForgetCommand) else (if (action =? 30) then (placementRepairAllowed (project facts placementObjectSelected) (project facts peersReachable) (project facts policyBlocked)) else (if (action =? 29) then ((not (project facts recoveryBusy)) && ((project facts recoveryAcceptedAnchor) && (project facts recoveryCanRestoreAnchor))) else ((action =? 27) || (action =? 28))))))))))))))))))))))))))))))) +} + +definition{ + name: integrityLabel, + parameters: [verified : Bool], + result: String, + body: (if verified then "DIGEST MATCH" else "PARTIAL") +} + +definition{ + name: executionLabel, + parameters: [replayed : Bool], + result: String, + body: (if replayed then "REPLAYED PURE CHECKPOINT" else "UNVERIFIED") +} + +definition{ + name: productTitle, + parameters: [], + result: String, + body: "Stitch / recoverable objects and replayable pure jobs" +} + +definition{ + name: disclosureLabel, + parameters: [], + result: String, + body: "Allow public mesh signaling (topic, signaling messages and ICE metadata; not private)" +} + +definition{ + name: relayLabel, + parameters: [], + result: String, + body: "Public object relay: share object/job bytes on ntfy.sh (not private)" +} + +definition{ + name: provenanceLabel, + parameters: [], + result: String, + body: "Journeys, evidence labels and action admission are projected from Product.Experience. Browser observations and adapter tests are not whole-host certification." +} + +definition{ + name: unknownPublicationFacts, + parameters: [], + result: Facts, + body: (record Facts {recoveryBusy := false, recoveryFileSelected := false, recoveryHasEvidence := false, recoveryHasObjects := false, recoveryHasJobs := false, recoveryHasAnchors := false, recoveryAnchorConsent := false, recoveryAcceptedAnchor := false, recoveryCanRestoreAnchor := false, recoveryRestoredAnchor := false, vmCanBoot := false, vmCanExecute := false, vmCanAdminister := false, vmCanCancelObservation := false, vmCanForgetCommand := false, vmCanReconcileCommand := false, vmAdminBlocked := false, vmTerminationPending := false, vmStopped := false, vmDestroyed := false, disclosureAccepted := false, meshJoined := false, peersReachable := false, relayEnabled := false, hasObject := true, hasPartial := false, placementObjectSelected := false, recoverablePlacement := false, hasJobs := false, unfinishedJobs := false, replayedJobs := false, vmBooting := false, vmReady := false, vmFailed := false, authorityPinned := true, headRetained := true, dnsConfigured := true, publicationBusy := false, publicationUnknown := true, publicationPublished := false, policyBlocked := false, policyAttention := false}) +} + +theorem{ + name: unknownPublicationDoesNotPermitNewCandidate, + parameters: [], + statement: ((actionAllowed 12 (unknownPublicationFacts)) = false), + proof: decide{} +} + +theorem{ + name: unknownPublicationOffersReconciliation, + parameters: [], + statement: ((actionAllowed 13 (unknownPublicationFacts)) = true), + proof: decide{} +} + +theorem{ + name: unknownPublicationIsVisible, + parameters: [], + statement: ((project (pointersView (unknownPublicationFacts)) id) = "pointerUnknown"), + proof: decide{} +} + +theorem{ + name: initialMeshCannotJoinWithoutDisclosure, + parameters: [], + statement: ((actionAllowed 0 (initialFacts)) = false), + proof: decide{} +} + +theorem{ + name: initialVmCannotExecute, + parameters: [], + statement: ((actionAllowed 7 (initialFacts)) = false), + proof: decide{} +} + +theorem{ + name: initialPolicyCanBeExported, + parameters: [], + statement: ((actionAllowed 15 (initialFacts)) = true), + proof: decide{} +} + +structure{ + name: EvidenceStyle, + type_parameters: [], + parameters: [], + fields: [{name: id, type: String}, {name: color, type: String}] +} + +definition{ + name: evidenceStyles, + parameters: [], + result: (List EvidenceStyle), + body: (cons (record EvidenceStyle {id := "observed", color := "#8ce6ac"}) (cons (record EvidenceStyle {id := "attention", color := "#f5b66b"}) (cons (record EvidenceStyle {id := "pending", color := "#9bc4ff"}) (cons (record EvidenceStyle {id := "unestablished", color := "#c4c4c4"}) (nil EvidenceStyle))))) +} + +definition{ + name: viewStyle, + parameters: [facts : Facts, journey : Nat], + result: String, + body: (if (journey =? 0) then (if (project facts disclosureAccepted) then (if (project facts peersReachable) then "observed" else "pending") else "attention") else (if (journey =? 1) then (if (project facts hasObject) then "observed" else "unestablished") else (if (journey =? 2) then (if (project facts replayedJobs) then "observed" else "unestablished") else (if (journey =? 3) then (if (project facts vmTerminationPending) then "pending" else (if (project facts vmStopped) then "observed" else (if (project facts vmAdminBlocked) then "attention" else (if (project facts vmDestroyed) then "observed" else (if (project facts vmBooting) then "pending" else (if (project facts vmFailed) then "attention" else "unestablished")))))) else (if (journey =? 4) then (if (project facts publicationUnknown) then "attention" else (if (project facts publicationBusy) then "pending" else (if (project facts headRetained) then "observed" else "unestablished"))) else (if (project facts policyBlocked) then "attention" else "observed")))))) +} + +definition{name: statusLivePolicy, parameters: [], result: String, body: "polite"} + +definition{name: navigationLabel, parameters: [], result: String, body: "Stitch operator journeys"} + +definition{name: focusNavigationTarget, parameters: [], result: Bool, body: true} + +definition{name: navigationScrollBehavior, parameters: [], result: String, body: "auto"} + +theorem{ + name: unknownNeverPermitsPublication, + parameters: [], + statement: (forall (pinned : Bool), (forall (candidate : Bool), (forall (busy : Bool), (forall (blocked : Bool), ((publicationAllowed pinned candidate busy true blocked) = false))))), + proof: decide{} +} + +theorem{ + name: undisclosedNeverPermitsJoin, + parameters: [], + statement: (forall (blocked : Bool), ((joinAllowed false blocked) = false)), + proof: decide{} +} + +theorem{ + name: unreadyNeverPermitsGuestExecution, + parameters: [], + statement: (forall (blocked : Bool), ((executionAllowed false blocked) = false)), + proof: decide{} +} + +theorem{ + name: budgetBlockNeverPermitsPublication, + parameters: [], + statement: (forall (pinned : Bool), (forall (candidate : Bool), (forall (busy : Bool), (forall (unknown : Bool), ((publicationAllowed pinned candidate busy unknown true) = false))))), + proof: decide{} +} + +theorem{ + name: knownPublicationNeverOffersReconciliation, + parameters: [], + statement: (forall (pinned : Bool), (forall (configured : Bool), (forall (busy : Bool), (forall (blocked : Bool), ((reconciliationAllowed pinned configured false busy blocked) = false))))), + proof: decide{} +} + +definition{ + name: journeyVisible, + parameters: [selected : Nat, journey : Nat], + result: Bool, + body: (selected =? journey) +} + +definition{ + name: explanationInitiallyOpen, + parameters: [facts : Facts, journey : Nat], + result: Bool, + body: (if (journey =? 0) then (not (project facts disclosureAccepted)) else (if (journey =? 4) then (project facts publicationUnknown) else (if (journey =? 5) then ((project facts policyBlocked) || (project facts policyAttention)) else false))) +} + +definition{ + name: publicationSetupVisible, + parameters: [facts : Facts], + result: Bool, + body: (project facts authorityPinned) +} + +definition{name: explanationLabel, parameters: [], result: String, body: "What this evidence means"} + +definition{ + name: recoveryPolicyLabel, + parameters: [], + result: String, + body: "Review resource policy" +} + +definition{ + name: recoveryPolicyVisible, + parameters: [facts : Facts], + result: Bool, + body: ((project facts policyBlocked) || (project facts policyAttention)) +} + +definition{ + name: admissionInputVisible, + parameters: [facts : Facts], + result: Bool, + body: (project facts authorityPinned) +} + +definition{ + name: vmCommandVisible, + parameters: [facts : Facts], + result: Bool, + body: (project facts vmReady) +} + +definition{ + name: publicationSetupInitiallyOpen, + parameters: [facts : Facts], + result: Bool, + body: (project facts publicationUnknown) +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Product/Host.lex.tex b/app/src/Product/Host.lex.tex new file mode 100644 index 0000000..aee958d --- /dev/null +++ b/app/src/Product/Host.lex.tex @@ -0,0 +1,326 @@ +\begin{lexlean}{Product.Host} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\importmodule{Stitch.Identity} +\importmodule{Stitch.Budget} +\title{Stitch recoverable service model} +\begin{semanticmodule} +inductive{ + name: Capability, + type_parameters: [], + parameters: [], + constructors: [ + {name: Dom, fields: []}, + {name: Cryptography, fields: []}, + {name: MonotonicClock, fields: []}, + {name: WallClock, fields: []}, + {name: SessionStorage, fields: []}, + {name: PeerChannel, fields: []}, + {name: LocalBroadcast, fields: []}, + {name: PublicSignaling, fields: []}, + {name: DnsRead, fields: []}, + {name: DnsWrite, fields: []}, + {name: PublicRelay, fields: []}, + {name: VirtualMachine, fields: []}, + {name: ArtifactFetch, fields: []}, + {name: NativeRouting, fields: []}, + {name: OriginStorage, fields: []}, + {name: WebLock, fields: []} + ] +} + +inductive{ + name: Outcome, + type_parameters: [], + parameters: [], + constructors: [ + {name: Pending, fields: []}, + {name: Succeeded, fields: []}, + {name: Failed, fields: []}, + {name: Unknown, fields: []} + ] +} + +structure{ + name: Grant, + type_parameters: [], + parameters: [], + fields: [ + {name: capability, type: Capability}, + {name: destinationRoot, type: Stitch.Identity::Digest}, + {name: subjectRoot, type: Stitch.Identity::Digest}, + {name: session, type: Nat}, + {name: validFrom, type: Nat}, + {name: validUntil, type: Nat}, + {name: authorized, type: Bool}, + {name: disclosureAccepted, type: Bool} + ] +} + +structure{ + name: Request, + type_parameters: [], + parameters: [], + fields: [ + {name: actionId, type: Stitch.Identity::Digest}, + {name: capability, type: Capability}, + {name: destinationRoot, type: Stitch.Identity::Digest}, + {name: subjectRoot, type: Stitch.Identity::Digest}, + {name: session, type: Nat}, + {name: cost, type: Stitch.Budget::Resources} + ] +} + +structure{ + name: Effect, + type_parameters: [], + parameters: [], + fields: [ + {name: request, type: Request}, + {name: requestedAt, type: Nat}, + {name: outcome, type: Outcome} + ] +} + +structure{ + name: Observation, + type_parameters: [], + parameters: [], + fields: [ + {name: actionId, type: Stitch.Identity::Digest}, + {name: capability, type: Capability}, + {name: destinationRoot, type: Stitch.Identity::Digest}, + {name: subjectRoot, type: Stitch.Identity::Digest}, + {name: session, type: Nat}, + {name: observedAt, type: Nat}, + {name: outcome, type: Outcome} + ] +} + +structure{ + name: State, + type_parameters: [], + parameters: [], + fields: [ + {name: ledger, type: Stitch.Budget::Ledger}, + {name: session, type: Nat}, + {name: effects, type: (List Effect)}, + {name: observations, type: (List Observation)} + ] +} + +definition{ + name: capabilityCode, + parameters: [capability : Capability], + result: Nat, + body: (match capability + | Capability.Dom => 0 + | Capability.Cryptography => 1 + | Capability.MonotonicClock => 2 + | Capability.WallClock => 3 + | Capability.SessionStorage => 4 + | Capability.PeerChannel => 5 + | Capability.LocalBroadcast => 6 + | Capability.PublicSignaling => 7 + | Capability.DnsRead => 8 + | Capability.DnsWrite => 9 + | Capability.PublicRelay => 10 + | Capability.VirtualMachine => 11 + | Capability.ArtifactFetch => 12 + | Capability.NativeRouting => 13 + | Capability.OriginStorage => 14 + | Capability.WebLock => 15) +} + +definition{ + name: outcomeCode, + parameters: [outcome : Outcome], + result: Nat, + body: (match outcome + | Outcome.Pending => 0 + | Outcome.Succeeded => 1 + | Outcome.Failed => 2 + | Outcome.Unknown => 3) +} + +definition{ + name: requiresDisclosure, + parameters: [capability : Capability], + result: Bool, + body: (((capabilityCode capability) =? 7) || (((capabilityCode capability) =? 9) || ((capabilityCode capability) =? 10))) +} + +definition{ + name: browserSupported, + parameters: [capability : Capability], + result: Bool, + body: (not ((capabilityCode capability) =? 13)) +} + +definition{ + name: requestAllowed, + parameters: [state : State, request : Request, grant : Grant, now : Nat], + result: Bool, + body: ((browserSupported (project request capability)) && ((project grant authorized) && (((project request session) =? (project state session)) && (((project grant session) =? (project state session)) && (((capabilityCode (project request capability)) =? (capabilityCode (project grant capability))) && ((Stitch.Identity::digestWellFormed (project request destinationRoot)) && ((Stitch.Identity::digestWellFormed (project request subjectRoot)) && ((Stitch.Identity::sameDigest (project request destinationRoot) (project grant destinationRoot)) && ((Stitch.Identity::sameDigest (project request subjectRoot) (project grant subjectRoot)) && (((project grant validFrom) <=? now) && ((now false + | List.cons head tail => ((observationMatches head observation) || (pendingMatches tail observation))), + recursive_argument: effects +} + +definition{ + name: finish, + parameters: [effects : (List Effect), observation : Observation], + result: (List Effect), + body: (match effects + | List.nil => (nil Effect) + | List.cons head tail => (if (observationMatches head observation) then (cons (record Effect {request := (project head request), requestedAt := (project head requestedAt), outcome := (project observation outcome)}) tail) else (cons head (finish tail observation)))), + recursive_argument: effects +} + +definition{ + name: sessionFilter, + parameters: [difference : Nat, whenEqual : State, whenDifferent : State], + result: State, + body: (match difference | Nat.zero => whenEqual | Nat.succ rest => whenDifferent) +} + +definition{ + name: ledgerFilter, + parameters: [ + difference : Nat, + whenEqual : Stitch.Budget::Ledger, + whenDifferent : Stitch.Budget::Ledger + ], + result: Stitch.Budget::Ledger, + body: (match difference | Nat.zero => whenEqual | Nat.succ rest => whenDifferent) +} + +theorem{ + name: sessionFilterLedger, + parameters: [difference : Nat, whenEqual : State, whenDifferent : State], + statement: ((project (sessionFilter difference whenEqual whenDifferent) ledger) = (ledgerFilter difference (project whenEqual ledger) (project whenDifferent ledger))), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: zero}, + {proof: reflexivity{}, binders: [rest], constructor: succ} + ], + scrutinee: difference + } +} + +theorem{ + name: ledgerFilterSame, + parameters: [difference : Nat, ledger : Stitch.Budget::Ledger], + statement: ((ledgerFilter difference ledger ledger) = ledger), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: zero}, + {proof: reflexivity{}, binders: [rest], constructor: succ} + ], + scrutinee: difference + } +} + +theorem{ + name: positiveSessionFilterFact, + parameters: [difference : Nat, whenEqual : State, whenDifferent : State], + statement: (((0 < difference) -> ((sessionFilter difference whenEqual whenDifferent) = whenDifferent)) <-> (0 = 0)), + proof: cases{ + branches: [ + { + proof: constructor{ + branches: [linear_arithmetic{}, linear_arithmetic{definitions: [sessionFilter]}] + }, + binders: [], + constructor: zero + }, + { + proof: constructor{ + branches: [linear_arithmetic{}, linear_arithmetic{definitions: [sessionFilter]}] + }, + binders: [rest], + constructor: succ + } + ], + scrutinee: difference + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: sessionLessThanDifference, + parameters: [state : State, observation : Observation], + statement: (((project observation session) < (project state session)) <-> (0 < (prim subtract (project state session) (project observation session) : Nat))), + proof: constructor{branches: [linear_arithmetic{}, linear_arithmetic{}]}, + axioms: [Quot.sound, propext] +} + +definition{ + name: observationCandidate, + parameters: [state : State, observation : Observation], + result: State, + body: (record State {ledger := (project state ledger), session := (project state session), effects := (if (pendingMatches (project state effects) observation) then (finish (project state effects) observation) else (project state effects)), observations := (if (pendingMatches (project state effects) observation) then (cons observation (project state observations)) else (project state observations))}) +} + +definition{ + name: observe, + parameters: [state : State, observation : Observation], + result: State, + body: (sessionFilter (prim subtract (project state session) (project observation session) : Nat) (sessionFilter (prim subtract (project observation session) (project state session) : Nat) (observationCandidate state observation) state) state) +} + +theorem{ + name: requestDoesNotCreateObservation, + parameters: [state : State, request : Request, grant : Grant, now : Nat], + statement: ((project (reserve state request grant now) observations) = (project state observations)), + proof: reflexivity{} +} + +theorem{ + name: observationCannotRefundLedger, + parameters: [state : State, observation : Observation], + statement: ((project (observe state observation) ledger) = (project state ledger)), + proof: simplify{ + definitions: [ledgerFilterSame, observationCandidate, observe, sessionFilterLedger] + }, + axioms: [propext] +} + +theorem{ + name: staleSessionCannotComplete, + parameters: [state : State, observation : Observation], + statement: (((project observation session) < (project state session)) -> ((observe state observation) = state)), + proof: simplify{definitions: [observe, positiveSessionFilterFact, sessionLessThanDifference]}, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: nativeRoutingRefused, + parameters: [], + statement: ((browserSupported (ctor Capability.NativeRouting)) = false), + proof: decide{} +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Product/Model.lex.tex b/app/src/Product/Model.lex.tex new file mode 100644 index 0000000..c8e6668 --- /dev/null +++ b/app/src/Product/Model.lex.tex @@ -0,0 +1,910 @@ +\begin{lexlean}{Product.Model} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\title{Stitch recoverable service model} +\begin{semanticmodule} +structure{ + name: Component, + type_parameters: [], + parameters: [], + fields: [ + {name: id, type: String}, + {name: role, type: String}, + {name: implementation, type: (List String)}, + {name: models, type: (List String)}, + {name: trustBoundary, type: Bool} + ] +} + +structure{ + name: Assumption, + type_parameters: [], + parameters: [], + fields: [ + {name: id, type: String}, + {name: statement, type: String}, + {name: evidence, type: String}, + {name: scope, type: String} + ] +} + +structure{ + name: CapabilityContract, + type_parameters: [], + parameters: [], + fields: [ + {name: id, type: String}, + {name: owner, type: String}, + {name: capability, type: String}, + {name: operation, type: String}, + {name: source, type: String}, + {name: inputs, type: (List String)}, + {name: outputs, type: (List String)}, + {name: preconditions, type: (List String)}, + {name: failures, type: (List String)}, + {name: assumptions, type: (List String)}, + {name: proofScope, type: String}, + {name: enabledByDefault, type: Bool} + ] +} + +structure{ + name: Dependency, + type_parameters: [], + parameters: [], + fields: [ + {name: id, type: String}, + {name: consumer, type: String}, + {name: kind, type: String}, + {name: locator, type: String}, + {name: versionPolicy, type: String}, + {name: trust, type: String}, + {name: required, type: Bool} + ] +} + +structure{ + name: Deployment, + type_parameters: [], + parameters: [], + fields: [ + {name: id, type: String}, + {name: kind, type: String}, + {name: entry, type: String}, + {name: files, type: (List String)}, + {name: requiredCapabilities, type: (List String)}, + {name: secrets, type: (List String)}, + {name: readiness, type: String}, + {name: rollback, type: String}, + {name: releaseGate, type: String} + ] +} + +structure{ + name: Asset, + type_parameters: [], + parameters: [], + fields: [ + {name: path, type: String}, + {name: role, type: String}, + {name: origin, type: String}, + {name: licenseStatus, type: String}, + {name: redistributionCleared, type: Bool} + ] +} + +definition{ + name: componentAdmission, + parameters: [], + result: Component, + body: (record Component {id := "admission", role := "Four-dimensional reservation ledger", implementation := (cons "src/layer2-schedulers/policy.js" (nil String)), models := (cons "Stitch.Budget" (nil String)), trustBoundary := false}) +} + +definition{ + name: componentBrowser, + parameters: [], + result: Component, + body: (record Component {id := "browser", role := "Interactive five-layer Stitch product", implementation := (cons "index.html" (cons "src/product-experience.js" (cons "src/recovery-ui.js" (cons "src/authority-ui.js" (nil String))))), models := (cons "Product.Experience" (cons "Stitch.Recovery" (cons "Product.Host" (cons "Product.Model" (nil String))))), trustBoundary := true}) +} + +definition{ + name: componentCompute, + parameters: [], + result: Component, + body: (record Component {id := "compute", role := "Deterministic program and checkpoint replay", implementation := (cons "src/layer4-compute/index.js" (cons "src/layer4-compute/replay.js" (nil String))), models := (cons "Stitch.Compute" (nil String)), trustBoundary := false}) +} + +definition{ + name: componentCryptography, + parameters: [], + result: Component, + body: (record Component {id := "cryptography", role := "Browser WebCrypto SHA-256 and Ed25519", implementation := (nil String), models := (cons "Stitch.Identity" (cons "Stitch.Pointer" (nil String))), trustBoundary := true}) +} + +definition{ + name: componentDiscovery, + parameters: [], + result: Component, + body: (record Component {id := "discovery", role := "DNS-over-HTTPS resolver and scoped DNS writer", implementation := (cons "src/layer5-transport/index.js" (cons "src/layer5-transport/dns-wire.js" (nil String))), models := (cons "Stitch.Pointer" (cons "Stitch.Observation" (nil String))), trustBoundary := true}) +} + +definition{ + name: componentIdentity, + parameters: [], + result: Component, + body: (record Component {id := "identity", role := "Canonical bytes, full commitments, raw encoding and fragments", implementation := (cons "src/layer1-uor/contracts.js" (cons "src/layer1-uor/custody.js" (cons "src/layer1-uor/generated-model.js" (nil String)))), models := (cons "Stitch.Identity" (cons "Stitch.Encoding" (cons "Stitch.Fragments" (nil String)))), trustBoundary := false}) +} + +definition{ + name: componentLegacy, + parameters: [], + result: Component, + body: (record Component {id := "legacy", role := "Historical UOR and simulation conformance", implementation := (cons "src/layer1-uor/index.js" (cons "src/layer3-storage/index.js" (cons "src/lib.rs" (nil String)))), models := (nil String), trustBoundary := false}) +} + +definition{ + name: componentNativeRouting, + parameters: [], + result: Component, + body: (record Component {id := "nativeRouting", role := "External Linux routing daemon; absent from browser", implementation := (nil String), models := (nil String), trustBoundary := true}) +} + +definition{ + name: componentPeers, + parameters: [], + result: Component, + body: (record Component {id := "peers", role := "Untrusted remote holders and compute peers", implementation := (nil String), models := (cons "Stitch.Custody" (cons "Stitch.Observation" (nil String))), trustBoundary := true}) +} + +definition{ + name: componentPointerAuthority, + parameters: [], + result: Component, + body: (record Component {id := "pointerAuthority", role := "Independently pinned single-writer key", implementation := (cons "src/layer1-uor/pointer.js" (cons "src/layer1-uor/browser-authority.js" (nil String))), models := (cons "Stitch.Authority" (cons "Stitch.Pointer" (cons "Stitch.Effects" (cons "Product.Host" (cons "Product.Experience" (nil String)))))), trustBoundary := true}) +} + +definition{ + name: componentPublicRelay, + parameters: [], + result: Component, + body: (record Component {id := "publicRelay", role := "Optional public ntfy warm cache", implementation := (cons "src/layer5-transport/relay-framing.js" (nil String)), models := (cons "Stitch.Relay" (cons "Stitch.Evidence" (nil String))), trustBoundary := true}) +} + +definition{ + name: componentRuntimeHost, + parameters: [], + result: Component, + body: (record Component {id := "runtimeHost", role := "Browser, OS, clocks, RAM, networking and permissions", implementation := (nil String), models := (cons "Product.Host" (nil String)), trustBoundary := true}) +} + +definition{ + name: componentScheduler, + parameters: [], + result: Component, + body: (record Component {id := "scheduler", role := "Experimental proposals under enforced admission", implementation := (cons "src/layer2-schedulers/index.js" (nil String)), models := (cons "Stitch.Budget" (cons "Stitch.Observation" (nil String))), trustBoundary := false}) +} + +definition{ + name: componentSignaling, + parameters: [], + result: Component, + body: (record Component {id := "signaling", role := "Public ntfy SDP/ICE signaling; BroadcastChannel on same origin", implementation := (cons "src/layer5-transport/signaling.js" (cons "src/layer5-transport/relay-framing.js" (nil String))), models := (cons "Stitch.Signaling" (cons "Stitch.Relay" (cons "Stitch.Effects" (cons "Product.Host" (nil String))))), trustBoundary := true}) +} + +definition{ + name: componentStaticHost, + parameters: [], + result: Component, + body: (record Component {id := "staticHost", role := "Same-origin publication of application and VM assets", implementation := (nil String), models := (nil String), trustBoundary := true}) +} + +definition{ + name: componentStorage, + parameters: [], + result: Component, + body: (record Component {id := "storage", role := "Ephemeral local cache and conditional peer custody", implementation := (cons "src/layer3-storage/custody.js" (cons "src/layer3-storage/index.js" (cons "src/recovery.js" (nil String)))), models := (cons "Stitch.Custody" (cons "Stitch.System" (cons "Stitch.Recovery" (nil String)))), trustBoundary := false}) +} + +definition{ + name: componentTransport, + parameters: [], + result: Component, + body: (record Component {id := "transport", role := "WebRTC channels, bounded messages and VM Ethernet bridge", implementation := (cons "src/layer5-transport/index.js" (cons "src/layer5-transport/channel-flow.js" (nil String))), models := (cons "Stitch.Observation" (cons "Stitch.ChannelFlow" (cons "Product.Host" (nil String)))), trustBoundary := true}) +} + +definition{ + name: componentVm, + parameters: [], + result: Component, + body: (record Component {id := "vm", role := "v86 x86 Linux guest and 9p filesystem bridge", implementation := (cons "src/layer4-compute/index.js" (cons "src/layer4-compute/vm-administration.js" (cons "v86/libv86.js" (cons "v86/v86.wasm" (cons "v86/seabios.bin" (cons "v86/vgabios.bin" (cons "images/buildroot-bzimage.bin" (nil String)))))))), models := (cons "Product.Host" (cons "Stitch.VmAdministration" (nil String))), trustBoundary := true}) +} + +definition{ + name: assumptionArtifactConformance, + parameters: [], + result: Assumption, + body: (record Assumption {id := "artifactConformance", statement := "Released runtime and model match their exact reviewed source and dependency bytes.", evidence := "Exact local artifact hashes plus pinned-SDK source and build acceptance.", scope := "Full product; runtime source hashing alone does not prove behavior."}) +} + +definition{ + name: assumptionBrowserSemantics, + parameters: [], + result: Assumption, + body: (record Assumption {id := "browserSemantics", statement := "The browser correctly implements DOM, typed arrays, WebAssembly, WebCrypto, WebRTC and fetch; optional saved authority and DNS publication additionally require correct IndexedDB CryptoKey structured cloning, transaction commit and Web Locks context-lifetime exclusion.", evidence := "Browser vendor assurance and independent integration testing, not a Stitch kernel theorem.", scope := "Host API behavior."}) +} + +definition{ + name: assumptionCryptographicSecurity, + parameters: [], + result: Assumption, + body: (record Assumption {id := "cryptographicSecurity", statement := "SHA-256 collision resistance and Ed25519 unforgeability hold for the selected implementations.", evidence := "Cryptographic assumptions and implementation review.", scope := "Commitments and pointer signatures only."}) +} + +definition{ + name: assumptionDisclosureConsent, + parameters: [], + result: Assumption, + body: (record Assumption {id := "disclosureConsent", statement := "External publication is authorized for the exact destination and content. Public relay and signaling are not private.", evidence := "Explicit user choice and configured destination.", scope := "Signaling, DNS writes and optional public payload relay."}) +} + +definition{ + name: assumptionFailureDomains, + parameters: [], + result: Assumption, + body: (record Assumption {id := "failureDomains", statement := "Different holder identifiers are independently failing machines only if separate evidence establishes that fact.", evidence := "Physical deployment and correlated-failure measurement.", scope := "Availability and durability claims."}) +} + +definition{ + name: assumptionNetworkAvailability, + parameters: [], + result: Assumption, + body: (record Assumption {id := "networkAvailability", statement := "DoH, DNS provider, STUN, signaling and optional relay are reachable and honor their APIs and policies.", evidence := "Live provider checks and physical multi-network trials.", scope := "No finite field observation establishes indefinite service."}) +} + +definition{ + name: assumptionObserverAnchor, + parameters: [], + result: Assumption, + body: (record Assumption {id := "observerAnchor", statement := "The pointer writer key and recent retained head are obtained independently and protected from rollback.", evidence := "Independently pinned key and retained observer head, or separately accepted exact recent digest explicitly restored into that same live scope. Both heads and anchor trust remain session-only.", scope := "Single-writer authority and freshness."}) +} + +definition{ + name: assumptionPeerAssertion, + parameters: [], + result: Assumption, + body: (record Assumption {id := "peerAssertion", statement := "A local checked acknowledgment is an assertion by the named holder, not authenticated durable custody.", evidence := "Receipt authentication, retained bytes and reachability require external evidence.", scope := "Conditional placement and lease observations."}) +} + +definition{ + name: assumptionSerializedJournal, + parameters: [], + result: Assumption, + body: (record Assumption {id := "serializedJournal", statement := "Host transitions are serialized and their budgets, action IDs, trusted head and journal are retained for the required lifetime.", evidence := "Application adapter review and crash/concurrency tests.", scope := "Pure state transitions do not provide durable atomic storage."}) +} + +definition{ + name: assumptionTimeSources, + parameters: [], + result: Assumption, + body: (record Assumption {id := "timeSources", statement := "Monotonic elapsed time does not regress; pointer wall-clock error is within a separately accepted bound.", evidence := "Clock integration tests and independent clock policy.", scope := "Freshness, budgets and leases; no global time oracle."}) +} + +definition{ + name: assumptionVmIsolation, + parameters: [], + result: Assumption, + body: (record Assumption {id := "vmIsolation", statement := "v86, BIOS, guest image and 9p/Ethernet bridge obey their reviewed isolation and resource contracts.", evidence := "Exact binary inventory, upstream provenance, security review and VM integration tests.", scope := "Arbitrary guest effects are not ring-program semantics."}) +} + +definition{ + name: capabilityDom, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "dom", owner := "browser", capability := "Dom", operation := "Render and collect explicit UI actions", source := "index.html", inputs := (cons "local UI state" (nil String)), outputs := (cons "rendered DOM" (cons "user action" (nil String))), preconditions := (cons "browser API available" (nil String)), failures := (cons "unsupported browser" (cons "handler failure" (nil String))), assumptions := (cons "browserSemantics" (nil String)), proofScope := "Presentation only; no storage or network evidence.", enabledByDefault := true}) +} + +definition{ + name: capabilityCrypto, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "crypto", owner := "cryptography", capability := "Cryptography", operation := "Hash commitments and verify pointer signatures", source := "src/layer1-uor/custody.js", inputs := (cons "canonical bytes" (cons "domain" (cons "pinned writer key" (nil String)))), outputs := (cons "full digest" (cons "signature-valid observation" (nil String))), preconditions := (cons "exact canonicalization" (cons "supported algorithm" (nil String))), failures := (cons "digest mismatch" (cons "invalid signature" (cons "crypto unavailable" (nil String)))), assumptions := (cons "browserSemantics" (cons "cryptographicSecurity" (cons "observerAnchor" (nil String)))), proofScope := "Integrity/signature observations; no authority bootstrap or retention.", enabledByDefault := true}) +} + +definition{ + name: capabilityMonotonicClock, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "monotonicClock", owner := "runtimeHost", capability := "MonotonicClock", operation := "Observe elapsed time for admission", source := "src/layer2-schedulers/policy.js", inputs := (cons "epoch and retained last time" (nil String)), outputs := (cons "nondecreasing elapsed observation" (nil String)), preconditions := (cons "same clock origin and epoch" (nil String)), failures := (cons "clock regression" (cons "epoch expired" (nil String))), assumptions := (cons "timeSources" (cons "serializedJournal" (nil String))), proofScope := "Elapsed admission only; not UTC, liveness or global order.", enabledByDefault := true}) +} + +definition{ + name: capabilityWallClock, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "wallClock", owner := "runtimeHost", capability := "WallClock", operation := "Check pointer and lease validity intervals", source := "src/layer1-uor/pointer.js", inputs := (cons "not-before and expiry" (nil String)), outputs := (cons "observer-local wall time" (nil String)), preconditions := (cons "declared clock uncertainty accepted" (nil String)), failures := (cons "outside validity interval" (cons "clock unavailable" (nil String))), assumptions := (cons "timeSources" (nil String)), proofScope := "No proof of clock accuracy or network propagation.", enabledByDefault := true}) +} + +definition{ + name: capabilitySessionStorage, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "sessionStorage", owner := "storage", capability := "SessionStorage", operation := "Retain checked bytes and local state in RAM", source := "src/layer3-storage/index.js", inputs := (cons "verified manifest and fragment bytes" (nil String)), outputs := (cons "session-local cached bytes" (nil String)), preconditions := (cons "storage reservation" (cons "bounded input" (cons "integrity checks" (nil String)))), failures := (cons "capacity exhausted" (cons "tab lost" (cons "browser eviction" (nil String)))), assumptions := (cons "browserSemantics" (cons "serializedJournal" (nil String))), proofScope := "RAM is ephemeral; no disk persistence or total-loss recovery.", enabledByDefault := true}) +} + +definition{ + name: capabilityPeerChannel, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "peerChannel", owner := "transport", capability := "PeerChannel", operation := "Open channel and exchange bounded messages", source := "src/layer5-transport/index.js", inputs := (cons "peer observation" (cons "SDP and ICE" (cons "bounded payload" (nil String)))), outputs := (cons "DataChannel event" (cons "untrusted peer response" (nil String))), preconditions := (cons "network reservation" (cons "payload limits" (cons "domain validation before acceptance" (nil String)))), failures := (cons "ICE failure" (cons "timeout" (cons "disconnect" (cons "malformed payload" (nil String))))), assumptions := (cons "browserSemantics" (cons "networkAvailability" (cons "peerAssertion" (nil String)))), proofScope := "Opened channel is not authenticated holder identity or durable placement.", enabledByDefault := false}) +} + +definition{ + name: capabilityLocalBroadcast, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "localBroadcast", owner := "signaling", capability := "LocalBroadcast", operation := "Exchange same-origin tab signals", source := "src/layer5-transport/index.js", inputs := (cons "channel topic" (cons "signal envelope" (nil String))), outputs := (cons "same-origin tab message" (nil String)), preconditions := (cons "explicit mesh join" (nil String)), failures := (cons "API unavailable" (cons "tab closes" (nil String))), assumptions := (cons "browserSemantics" (nil String)), proofScope := "Same-origin only; not remote peer discovery.", enabledByDefault := false}) +} + +definition{ + name: capabilityPublicSignaling, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "publicSignaling", owner := "signaling", capability := "PublicSignaling", operation := "Publish and receive SDP/ICE through ntfy", source := "src/layer5-transport/index.js", inputs := (cons "channel topic" (cons "SDP and ICE candidates" (nil String))), outputs := (cons "public signaling response" (nil String)), preconditions := (cons "explicit mesh join" (cons "disclosure accepted" (cons "network reservation" (nil String)))), failures := (cons "provider unavailable" (cons "untrusted signal" (cons "topic collision" (nil String)))), assumptions := (cons "disclosureConsent" (cons "networkAvailability" (nil String))), proofScope := "Ed25519 key-owned session signaling with replay rejection; public metadata disclosure. Keys are not trusted human identity or holder authorization; topics are not privacy.", enabledByDefault := false}) +} + +definition{ + name: capabilityDnsRead, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "dnsRead", owner := "discovery", capability := "DnsRead", operation := "Read full pointers and SRV records through DoH", source := "src/layer5-transport/index.js", inputs := (cons "query name" (cons "record type" (nil String))), outputs := (cons "bounded untrusted DNS answer" (nil String)), preconditions := (cons "response-byte ceiling" (cons "network reservation" (cons "pointer authority and successor admission" (nil String)))), failures := (cons "HTTP error" (cons "invalid answer" (cons "stale or conflicting pointer" (nil String)))), assumptions := (cons "networkAvailability" (cons "observerAnchor" (cons "timeSources" (nil String)))), proofScope := "DoH observation cannot inspect all recursive caches or establish consensus.", enabledByDefault := false}) +} + +definition{ + name: capabilityDnsWrite, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "dnsWrite", owner := "discovery", capability := "DnsWrite", operation := "Write full signed pointer as multipart Cloudflare TXT", source := "src/layer5-transport/index.js", inputs := (cons "zone and record reference" (cons "signed full pointer" (cons "scoped token reference" (nil String)))), outputs := (cons "provider response and record identifier" (nil String)), preconditions := (cons "explicit publish action" (cons "exact destination authorized" (cons "authority key pinned" (cons "network reservation" (nil String))))), failures := (cons "provider rejected" (cons "unknown outcome" (cons "token missing" (cons "DuckDNS full-pointer serialization refused" (nil String))))), assumptions := (cons "disclosureConsent" (cons "networkAvailability" (cons "observerAnchor" (nil String)))), proofScope := "Provider acknowledgment is not global DNS propagation; secrets are not source data.", enabledByDefault := false}) +} + +definition{ + name: capabilityPublicRelay, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "publicRelay", owner := "publicRelay", capability := "PublicRelay", operation := "Publish or retrieve explicitly public warm-cache payloads", source := "src/layer5-transport/index.js", inputs := (cons "bounded object fragments or checkpoint" (cons "topic" (nil String))), outputs := (cons "public relay response" (nil String)), preconditions := (cons "relay separately enabled" (cons "public disclosure accepted" (cons "network reservation" (cons "received domain admission" (nil String))))), failures := (cons "disabled" (cons "provider unavailable" (cons "expired payload" (cons "tampered payload" (nil String))))), assumptions := (cons "disclosureConsent" (cons "networkAvailability" (nil String))), proofScope := "Sufficient fragments disclose the object; no encryption, confidentiality or indefinite retention.", enabledByDefault := false}) +} + +definition{ + name: capabilityVm, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "vm", owner := "vm", capability := "VirtualMachine", operation := "Boot guest, mirror object files, run shell and bridge Ethernet", source := "src/layer4-compute/index.js", inputs := (cons "five local v86/BIOS/kernel assets" (cons "guest command or object bytes" (nil String))), outputs := (cons "guest output bytes" (cons "Ethernet frames" (nil String))), preconditions := (cons "explicit VM action" (cons "all assets available" (cons "runtime deadline configured before boot" (cons "guarded local 9p allocation installed before run" (nil String))))), failures := (cons "missing asset" (cons "boot failure" (cons "guest timeout or runtime expiry" (cons "filesystem or bounded-result limit" (cons "stop outcome unknown" (cons "bridge failure" (nil String))))))), assumptions := (cons "browserSemantics" (cons "vmIsolation" (nil String))), proofScope := "Source predicates govern local 9p allocation and bounded result reads. Runtime expiry and dispatched-command cancellation request whole-VM stop; prior effects remain unknown. Browser scheduling and host VM behavior are assumptions, not guest isolation or ring-work metering.", enabledByDefault := false}) +} + +definition{ + name: capabilityArtifactFetch, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "artifactFetch", owner := "staticHost", capability := "ArtifactFetch", operation := "Serve and load exact local application assets", source := "index.html", inputs := (cons "relative same-origin path" (nil String)), outputs := (cons "asset bytes" (nil String)), preconditions := (cons "published asset inventory" (cons "trusted static origin" (nil String))), failures := (cons "missing file" (cons "substituted bytes" (cons "HTTP failure" (nil String)))), assumptions := (cons "artifactConformance" (cons "browserSemantics" (nil String))), proofScope := "Inventory hashes identify checked local files; current UI does not verify every fetched asset at load time.", enabledByDefault := true}) +} + +definition{ + name: capabilityNativeRouting, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "nativeRouting", owner := "nativeRouting", capability := "NativeRouting", operation := "External BIRD/FRR or DN42 routing daemon", source := "CONTRACT.json", inputs := (nil String), outputs := (nil String), preconditions := (cons "separate Linux daemon and network authority" (nil String)), failures := (cons "unsupported in browser" (nil String)), assumptions := (cons "networkAvailability" (nil String)), proofScope := "Unsupported boundary; browser has no BGP or WireGuard implementation.", enabledByDefault := false}) +} + +definition{ + name: capabilityOriginStorage, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "originStorage", owner := "pointerAuthority", capability := "OriginStorage", operation := "Explicitly retain nonextractable signing authority and exact DNS write-ahead intent", source := "src/layer1-uor/browser-authority.js", inputs := (cons "explicit authority setup" (cons "signed scoped publication candidate" (nil String))), outputs := (cons "restored CryptoKey" (cons "committed origin-local journal" (nil String))), preconditions := (cons "IndexedDB and CryptoKey structured cloning available" (cons "successful transaction commit before provider mutation" (nil String))), failures := (cons "quota or transaction abort" (cons "private browsing loss or eviction" (cons "invalid retained authority" (nil String)))), assumptions := (cons "browserSemantics" (cons "serializedJournal" (nil String))), proofScope := "Origin-local retention only; no backup, cross-device durability, automatic key rotation or provider exactly-once guarantee.", enabledByDefault := false}) +} + +definition{ + name: capabilityWebLock, + parameters: [], + result: CapabilityContract, + body: (record CapabilityContract {id := "webLock", owner := "pointerAuthority", capability := "WebLock", operation := "Exclude same-origin concurrent DNS writers while reading, committing and settling", source := "src/layer1-uor/browser-authority.js", inputs := (cons "exact database zone name and authority scope" (nil String)), outputs := (cons "exclusive context-lifetime operation" (nil String)), preconditions := (cons "Web Locks available" (cons "same-origin lock scope" (nil String))), failures := (cons "API unavailable" (cons "owner context termination leaves journal unknown" (nil String))), assumptions := (cons "browserSemantics" (cons "serializedJournal" (nil String))), proofScope := "No timeout takeover, cross-device exclusion, provider CAS or ordering outside this application origin.", enabledByDefault := false}) +} + +definition{ + name: dependencyBrowserApis, + parameters: [], + result: Dependency, + body: (record Dependency {id := "browserApis", consumer := "runtimeHost", kind := "host", locator := "browser DOM/WebAssembly/WebCrypto/fetch/WebRTC; optional authority publication requires IndexedDB/Web Locks", versionPolicy := "Host-selected implementation; not byte-pinned", trust := "External API and OS trust boundary", required := true}) +} + +definition{ + name: dependencyCloudflareDns, + parameters: [], + result: Dependency, + body: (record Dependency {id := "cloudflareDns", consumer := "discovery", kind := "external-service", locator := "https://cloudflare-dns.com/dns-query", versionPolicy := "RFC8484 DNS-message client; optional provider JSON mode; no immutable service version", trust := "Read results untrusted until domain admission", required := false}) +} + +definition{ + name: dependencyCloudflareWriter, + parameters: [], + result: Dependency, + body: (record Dependency {id := "cloudflareWriter", consumer := "discovery", kind := "external-service", locator := "https://api.cloudflare.com/client/v4", versionPolicy := "Cloudflare API v4; scoped secret reference only", trust := "Writes need explicit destination and content approval", required := false}) +} + +definition{ + name: dependencyGoogleStun, + parameters: [], + result: Dependency, + body: (record Dependency {id := "googleStun", consumer := "transport", kind := "external-service", locator := "stun:stun.l.google.com:19302", versionPolicy := "Host ICE provider; no immutable service version", trust := "Endpoint discovery only", required := false}) +} + +definition{ + name: dependencyCloudflareStun, + parameters: [], + result: Dependency, + body: (record Dependency {id := "cloudflareStun", consumer := "transport", kind := "external-service", locator := "stun:stun.cloudflare.com:3478", versionPolicy := "Host ICE provider; no immutable service version", trust := "Endpoint discovery only", required := false}) +} + +definition{ + name: dependencyNtfySignaling, + parameters: [], + result: Dependency, + body: (record Dependency {id := "ntfySignaling", consumer := "signaling", kind := "external-service", locator := "https://ntfy.sh", versionPolicy := "Public HTTP/WebSocket API; no immutable service version", trust := "Signaling disclosure and service availability", required := false}) +} + +definition{ + name: dependencyNtfyRelay, + parameters: [], + result: Dependency, + body: (record Dependency {id := "ntfyRelay", consumer := "publicRelay", kind := "external-service", locator := "https://ntfy.sh", versionPolicy := "Optional public cache; no persistence promise", trust := "Payload disclosure requires opt-in", required := false}) +} + +definition{ + name: dependencyStaticOrigin, + parameters: [], + result: Dependency, + body: (record Dependency {id := "staticOrigin", consumer := "staticHost", kind := "hosting", locator := "same-origin relative application paths", versionPolicy := "Publication-selected HTTPS origin", trust := "No release/deployment authority inferred", required := true}) +} + +definition{ + name: dependencyVmAssets, + parameters: [], + result: Dependency, + body: (record Dependency {id := "vmAssets", consumer := "vm", kind := "vendored-binary", locator := "v86/ and images/buildroot-bzimage.bin", versionPolicy := "Exact bytes in generated product artifact register", trust := "Exact upstream origins and accompanying source/license materials recorded in vendor/distribution.json; guest source pinned in vendor/guest/SOURCE-NOTICE.md", required := false}) +} + +definition{ + name: dependencyPrismSdk, + parameters: [], + result: Dependency, + body: (record Dependency {id := "prismSdk", consumer := "identity", kind := "build-tool", locator := "prismpm.lock and standards.lock", versionPolicy := "Exact SDK OCI digest and standards lock", trust := "Only real SDK verify may report source/kernel/artifact acceptance", required := true}) +} + +definition{ + name: dependencyPrismCode, + parameters: [], + result: Dependency, + body: (record Dependency {id := "prismCode", consumer := "identity", kind := "build-tool", locator := "package-lock.json", versionPolicy := "prism-code 0.7.2 exact npm lock", trust := "Adapter and package verification, not browser host semantics", required := true}) +} + +definition{ + name: deploymentBrowserSession, + parameters: [], + result: Deployment, + body: (record Deployment {id := "browserSession", kind := "static-browser", entry := "index.html", files := (cons "index.html" (cons "src/**/*.js" (cons "v86/libv86.js" (cons "v86/v86.wasm" (cons "v86/seabios.bin" (cons "v86/vgabios.bin" (cons "images/buildroot-bzimage.bin" (nil String)))))))), requiredCapabilities := (cons "dom" (cons "crypto" (cons "monotonicClock" (cons "wallClock" (cons "sessionStorage" (cons "artifactFetch" (nil String))))))), secrets := (cons "Cloudflare scoped DNS token only when explicitly supplied; session-local, never in repository" (nil String)), readiness := "Asset load and interactive flow checks required; pure probe acceptance is insufficient.", rollback := "Retain prior complete asset set; session state may be lost on reload.", releaseGate := "Runtime tests, artifact closure, vendor license/provenance review, exact SDK model verification and browser integration checks."}) +} + +definition{ + name: deploymentPureProbe, + parameters: [], + result: Deployment, + body: (record Deployment {id := "pureProbe", kind := "prism-text-application", entry := "app/src/StitchApp.lex.tex", files := (cons "SDK-generated holo and browser closure" (nil String)), requiredCapabilities := (nil String), secrets := (nil String), readiness := "Only actual pinned-SDK verify establishes probe acceptance.", rollback := "Retain previous immutable holo and exact source lock.", releaseGate := "lexlean check, Lean and leanchecker, exact axioms, PrismPM artifact and vector verification."}) +} + +definition{ + name: assetLifecycleEffects, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer1-uor/effects.js", role := "Exact identity projections and model-derived transport, DNS and VM lifecycle admissions", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetProductExperience, + parameters: [], + result: Asset, + body: (record Asset {path := "src/product-experience.js", role := "Model-derived operator journeys, evidence and guarded DOM actions", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile0, + parameters: [], + result: Asset, + body: (record Asset {path := "index.html", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile1, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer1-uor/contracts.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile2, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer1-uor/custody.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile3, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer1-uor/generated-model.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile4, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer1-uor/index.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile5, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer1-uor/pointer.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile6, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer2-schedulers/index.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile7, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer2-schedulers/policy.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile8, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer3-storage/custody.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile9, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer3-storage/index.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile10, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer4-compute/index.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile11, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer4-compute/replay.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile12, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer5-transport/index.js", role := "Stitch browser application", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetFile13, + parameters: [], + result: Asset, + body: (record Asset {path := "v86/libv86.js", role := "vendored VM dependency", origin := "Exact official copy.sh distribution; v86 source 1e4f43c954701db9699fa976b27cc675f9971265; JS independently reconstructed", licenseStatus := "BSD/MIT incorporated notices and source supplied in vendor/v86; include accompanying materials in distribution", redistributionCleared := true}) +} + +definition{ + name: assetFile14, + parameters: [], + result: Asset, + body: (record Asset {path := "v86/v86.wasm", role := "vendored VM dependency", origin := "Exact official copy.sh distribution; v86 source 1e4f43c954701db9699fa976b27cc675f9971265; JS independently reconstructed", licenseStatus := "BSD/MIT incorporated notices and source supplied in vendor/v86; include accompanying materials in distribution", redistributionCleared := true}) +} + +definition{ + name: assetFile15, + parameters: [], + result: Asset, + body: (record Asset {path := "v86/seabios.bin", role := "vendored VM dependency", origin := "Exact copy/v86 BIOS blobs; SeaBIOS rel-1.16.2 source ea1b7a0733906b8425d948ae94fba63c32b1d425", licenseStatus := "LGPLv3 source, config, build instructions and licenses supplied in vendor/seabios; include accompanying materials in distribution", redistributionCleared := true}) +} + +definition{ + name: assetFile16, + parameters: [], + result: Asset, + body: (record Asset {path := "v86/vgabios.bin", role := "vendored VM dependency", origin := "Exact copy/v86 BIOS blobs; SeaBIOS rel-1.16.2 source ea1b7a0733906b8425d948ae94fba63c32b1d425", licenseStatus := "LGPLv3 source, config, build instructions and licenses supplied in vendor/seabios; include accompanying materials in distribution", redistributionCleared := true}) +} + +definition{ + name: assetFile17, + parameters: [], + result: Asset, + body: (record Asset {path := "images/buildroot-bzimage.bin", role := "vendored VM dependency", origin := "Linux 6.18.7 from Buildroot 7fdeadb3b9f12f78e5fccca914d7fef47090ab9a; image 313a6b545290a2b47856b49bfcc4c7577469749b315932ae008d39fe70fc7f07", licenseStatus := "Corresponding source, configs, patches and licenses published at immutable commit fd59fae669e9a40271fb584ca071270d8ed0b8f8; preserve vendor/guest/SOURCE-NOTICE.md and equivalent source access with image", redistributionCleared := true}) +} + +definition{ + name: assetRustConformance, + parameters: [], + result: Asset, + body: (record Asset {path := "src/lib.rs", role := "Historical Rust conformance source; not loaded by the browser", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetBrowserAuthority, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer1-uor/browser-authority.js", role := "Origin-local signing authority and transactional publication journal", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetAuthorityUi, + parameters: [], + result: Asset, + body: (record Asset {path := "src/authority-ui.js", role := "Contextual explicit signing, trust-anchor and browser-storage administration", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +structure{ + name: Model, + type_parameters: [], + parameters: [], + fields: [ + {name: productId, type: String}, + {name: owner, type: String}, + {name: version, type: String}, + {name: lifecycle, type: String}, + {name: components, type: (List Component)}, + {name: assumptions, type: (List Assumption)}, + {name: capabilityContracts, type: (List CapabilityContract)}, + {name: dependencies, type: (List Dependency)}, + {name: deployments, type: (List Deployment)}, + {name: assets, type: (List Asset)} + ] +} + +definition{ + name: assetDnsWire, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer5-transport/dns-wire.js", role := "RFC8484 application DNS-message client", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetRelayFraming, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer5-transport/relay-framing.js", role := "Bounded ntfy message framing and reassembly", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetRecovery, + parameters: [], + result: Asset, + body: (record Asset {path := "src/recovery.js", role := "Verified detached recovery bundle import/export; separate exact anchor acceptance and explicit scoped live-head restoration", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetRecoveryUi, + parameters: [], + result: Asset, + body: (record Asset {path := "src/recovery-ui.js", role := "Contextual operator recovery controls without network, VM or DNS effects", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetSignaling, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer5-transport/signaling.js", role := "Signed key-owned signaling with current-session challenge and replay rejection", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetChannelFlow, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer5-transport/channel-flow.js", role := "Negotiated DataChannel framing, bounded queues and generation-fenced delivery", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: assetVmAdministration, + parameters: [], + result: Asset, + body: (record Asset {path := "src/layer4-compute/vm-administration.js", role := "Explicit guest grants, bounded command admission and generation-scoped effect observation", origin := "Project-owned source checkout", licenseStatus := "Project declares MIT; audit applies", redistributionCleared := true}) +} + +definition{ + name: product, + parameters: [], + result: Model, + body: (record Model {productId := "stitch", owner := "Syntra Labs; repository origin afflom/stitch", version := "0.3.0", lifecycle := "development", components := (cons (componentAdmission) (cons (componentBrowser) (cons (componentCompute) (cons (componentCryptography) (cons (componentDiscovery) (cons (componentIdentity) (cons (componentLegacy) (cons (componentNativeRouting) (cons (componentPeers) (cons (componentPointerAuthority) (cons (componentPublicRelay) (cons (componentRuntimeHost) (cons (componentScheduler) (cons (componentSignaling) (cons (componentStaticHost) (cons (componentStorage) (cons (componentTransport) (cons (componentVm) (nil Component))))))))))))))))))), assumptions := (cons (assumptionArtifactConformance) (cons (assumptionBrowserSemantics) (cons (assumptionCryptographicSecurity) (cons (assumptionDisclosureConsent) (cons (assumptionFailureDomains) (cons (assumptionNetworkAvailability) (cons (assumptionObserverAnchor) (cons (assumptionPeerAssertion) (cons (assumptionSerializedJournal) (cons (assumptionTimeSources) (cons (assumptionVmIsolation) (nil Assumption)))))))))))), capabilityContracts := (cons (capabilityDom) (cons (capabilityCrypto) (cons (capabilityMonotonicClock) (cons (capabilityWallClock) (cons (capabilitySessionStorage) (cons (capabilityPeerChannel) (cons (capabilityLocalBroadcast) (cons (capabilityPublicSignaling) (cons (capabilityDnsRead) (cons (capabilityDnsWrite) (cons (capabilityPublicRelay) (cons (capabilityVm) (cons (capabilityArtifactFetch) (cons (capabilityNativeRouting) (cons (capabilityOriginStorage) (cons (capabilityWebLock) (nil CapabilityContract))))))))))))))))), dependencies := (cons (dependencyBrowserApis) (cons (dependencyCloudflareDns) (cons (dependencyCloudflareWriter) (cons (dependencyGoogleStun) (cons (dependencyCloudflareStun) (cons (dependencyNtfySignaling) (cons (dependencyNtfyRelay) (cons (dependencyStaticOrigin) (cons (dependencyVmAssets) (cons (dependencyPrismSdk) (cons (dependencyPrismCode) (nil Dependency)))))))))))), deployments := (cons (deploymentBrowserSession) (cons (deploymentPureProbe) (nil Deployment))), assets := (cons (assetRelayFraming) (cons (assetDnsWire) (cons (assetLifecycleEffects) (cons (assetProductExperience) (cons (assetFile0) (cons (assetFile1) (cons (assetFile2) (cons (assetFile3) (cons (assetFile4) (cons (assetFile5) (cons (assetFile6) (cons (assetFile7) (cons (assetFile8) (cons (assetFile9) (cons (assetFile10) (cons (assetFile11) (cons (assetFile12) (cons (assetFile13) (cons (assetFile14) (cons (assetFile15) (cons (assetFile16) (cons (assetFile17) (cons (assetRustConformance) (cons (assetRecovery) (cons (assetRecoveryUi) (cons (assetSignaling) (cons (assetChannelFlow) (cons (assetVmAdministration) (cons (assetBrowserAuthority) (cons (assetAuthorityUi) (nil Asset)))))))))))))))))))))))))))))))}) +} + +definition{ + name: componentIds, + parameters: [rows : (List Component)], + result: (List String), + body: (match rows + | List.nil => (nil String) + | List.cons head tail => (cons (project head id) (componentIds tail))), + recursive_argument: rows +} + +definition{ + name: assumptionIds, + parameters: [rows : (List Assumption)], + result: (List String), + body: (match rows + | List.nil => (nil String) + | List.cons head tail => (cons (project head id) (assumptionIds tail))), + recursive_argument: rows +} + +definition{ + name: capabilityContractIds, + parameters: [rows : (List CapabilityContract)], + result: (List String), + body: (match rows + | List.nil => (nil String) + | List.cons head tail => (cons (project head id) (capabilityContractIds tail))), + recursive_argument: rows +} + +definition{ + name: dependencyIds, + parameters: [rows : (List Dependency)], + result: (List String), + body: (match rows + | List.nil => (nil String) + | List.cons head tail => (cons (project head id) (dependencyIds tail))), + recursive_argument: rows +} + +definition{ + name: deploymentIds, + parameters: [rows : (List Deployment)], + result: (List String), + body: (match rows + | List.nil => (nil String) + | List.cons head tail => (cons (project head id) (deploymentIds tail))), + recursive_argument: rows +} + +definition{ + name: assetIds, + parameters: [rows : (List Asset)], + result: (List String), + body: (match rows + | List.nil => (nil String) + | List.cons head tail => (cons (project head path) (assetIds tail))), + recursive_argument: rows +} + +definition{ + name: member, + parameters: [value : String, rows : (List String)], + result: Bool, + body: (match rows + | List.nil => false + | List.cons head tail => ((prim equal value head : Bool) || (member value tail))), + recursive_argument: rows +} + +definition{ + name: members, + parameters: [values : (List String), rows : (List String)], + result: Bool, + body: (match values + | List.nil => true + | List.cons head tail => ((member head rows) && (members tail rows))), + recursive_argument: values +} + +definition{ + name: unique, + parameters: [rows : (List String)], + result: Bool, + body: (match rows + | List.nil => true + | List.cons head tail => ((not (member head tail)) && (unique tail))), + recursive_argument: rows +} + +definition{ + name: componentAssetsClosed, + parameters: [rows : (List Component), assets : (List String)], + result: Bool, + body: (match rows + | List.nil => true + | List.cons head tail => ((members (project head implementation) assets) && (componentAssetsClosed tail assets))), + recursive_argument: rows +} + +definition{ + name: contractsClosed, + parameters: [ + rows : (List CapabilityContract), + components : (List String), + assumptions : (List String) + ], + result: Bool, + body: (match rows + | List.nil => true + | List.cons head tail => ((member (project head owner) components) && ((members (project head assumptions) assumptions) && (contractsClosed tail components assumptions)))), + recursive_argument: rows +} + +definition{ + name: dependenciesClosed, + parameters: [rows : (List Dependency), components : (List String)], + result: Bool, + body: (match rows + | List.nil => true + | List.cons head tail => ((member (project head consumer) components) && (dependenciesClosed tail components))), + recursive_argument: rows +} + +definition{ + name: deploymentsClosed, + parameters: [rows : (List Deployment), capabilities : (List String)], + result: Bool, + body: (match rows + | List.nil => true + | List.cons head tail => ((members (project head requiredCapabilities) capabilities) && (deploymentsClosed tail capabilities))), + recursive_argument: rows +} + +definition{ + name: valid, + parameters: [model : Model], + result: Bool, + body: ((unique (componentIds (project model components))) && ((unique (assumptionIds (project model assumptions))) && ((unique (capabilityContractIds (project model capabilityContracts))) && ((unique (dependencyIds (project model dependencies))) && ((unique (deploymentIds (project model deployments))) && ((unique (assetIds (project model assets))) && ((componentAssetsClosed (project model components) (assetIds (project model assets))) && ((contractsClosed (project model capabilityContracts) (componentIds (project model components)) (assumptionIds (project model assumptions))) && ((dependenciesClosed (project model dependencies) (componentIds (project model components))) && (deploymentsClosed (project model deployments) (capabilityContractIds (project model capabilityContracts)))))))))))) +} + +definition{ + name: redistributionClosed, + parameters: [assets : (List Asset)], + result: Bool, + body: (match assets + | List.nil => true + | List.cons head tail => ((project head redistributionCleared) && (redistributionClosed tail))), + recursive_argument: assets +} + +definition{ + name: productAssetsRedistributable, + parameters: [model : Model], + result: Bool, + body: (redistributionClosed (project model assets)) +} + +theorem{ + name: productGraphIsClosed, + parameters: [], + statement: ((valid (product)) = true), + proof: decide{} +} + +theorem{ + name: vendorDistributionMaterialsRecorded, + parameters: [], + statement: ((productAssetsRedistributable (product)) = true), + proof: decide{} +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/Authority.lex.tex b/app/src/Stitch/Authority.lex.tex new file mode 100644 index 0000000..e97309e --- /dev/null +++ b/app/src/Stitch/Authority.lex.tex @@ -0,0 +1,187 @@ +\begin{lexlean}{Stitch.Authority} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\title{Stitch recoverable service model} +\begin{semanticmodule} +structure{ + name: State, + type_parameters: [], + parameters: [], + fields: [{name: generation, type: Nat}, {name: present, type: Bool}, {name: revoked, type: Bool}] +} + +definition{ + name: signingAllowed, + parameters: [active : Bool, expectedKey : Bool, bodyKey : Bool], + result: Bool, + body: (active && (expectedKey && bodyKey)) +} + +definition{ + name: rotationAllowed, + parameters: [confirmed : Bool, exists : Bool, sameKey : Bool, historyCapacity : Bool], + result: Bool, + body: (confirmed && (exists && (sameKey && historyCapacity))) +} + +definition{ + name: revocationAllowed, + parameters: [confirmed : Bool, exists : Bool, sameScope : Bool], + result: Bool, + body: (confirmed && (exists && sameScope)) +} + +definition{ + name: anchorSaveAllowed, + parameters: [confirmed : Bool, scopeCurrent : Bool, absent : Bool, identical : Bool], + result: Bool, + body: (confirmed && (scopeCurrent && (absent || identical))) +} + +definition{ + name: migrationAllowed, + parameters: [ + confirmed : Bool, + scopeCurrent : Bool, + exists : Bool, + samePrior : Bool, + historyCapacity : Bool + ], + result: Bool, + body: (confirmed && (scopeCurrent && (exists && (samePrior && historyCapacity)))) +} + +definition{ + name: anchorChronologyAllowed, + parameters: [ + sameKey : Bool, + older : Bool, + sameRevision : Bool, + sameDigest : Bool, + adjacent : Bool, + predecessor : Bool + ], + result: Bool, + body: ((not sameKey) || ((not older) && (((not sameRevision) || sameDigest) && ((not adjacent) || predecessor)))) +} + +definition{ + name: publicationAllowed, + parameters: [retiredKey : Bool, trustMatches : Bool], + result: Bool, + body: ((not retiredKey) && trustMatches) +} + +definition{ + name: journalRemovalAllowed, + parameters: [confirmed : Bool, definitelyRefused : Bool, noProviderIdentity : Bool], + result: Bool, + body: (confirmed && (definitelyRefused && noProviderIdentity)) +} + +definition{ + name: controlAllowed, + parameters: [ + action : Nat, + busy : Bool, + saved : Bool, + active : Bool, + hasHead : Bool, + hasTrust : Bool + ], + result: Bool, + body: ((not busy) && (if (action =? 1) then saved else (if (action =? 2) then (saved && active) else (if (action =? 3) then hasHead else (if (action =? 4) then hasTrust else (if (action =? 5) then hasTrust else (if (action =? 6) then hasTrust else true))))))) +} + +definition{ + name: rotate, + parameters: [state : State, confirmed : Bool, sameKey : Bool, historyCapacity : Bool], + result: State, + body: (if (rotationAllowed confirmed (project state present) sameKey historyCapacity) then (record State {generation := ((project state generation) + 1), present := true, revoked := false}) else state) +} + +definition{ + name: revoke, + parameters: [state : State, confirmed : Bool, sameScope : Bool], + result: State, + body: (if (revocationAllowed confirmed (project state present) sameScope) then (record State {generation := (project state generation), present := true, revoked := true}) else state) +} + +definition{ + name: migrate, + parameters: [ + state : State, + confirmed : Bool, + scopeCurrent : Bool, + samePrior : Bool, + historyCapacity : Bool + ], + result: State, + body: (if (migrationAllowed confirmed scopeCurrent (project state present) samePrior historyCapacity) then (record State {generation := ((project state generation) + 1), present := true, revoked := false}) else state) +} + +definition{ + name: maySign, + parameters: [state : State, expectedKey : Bool, bodyKey : Bool], + result: Bool, + body: (signingAllowed ((project state present) && (not (project state revoked))) expectedKey bodyKey) +} + +theorem{ + name: unconfirmedRotationRefused, + parameters: [], + statement: (forall (exists : Bool), (forall (sameKey : Bool), (forall (historyCapacity : Bool), ((rotationAllowed false exists sameKey historyCapacity) = false)))), + proof: decide{} +} + +theorem{ + name: changedAnchorCannotMigrate, + parameters: [], + statement: (forall (confirmed : Bool), (forall (scopeCurrent : Bool), (forall (exists : Bool), (forall (historyCapacity : Bool), ((migrationAllowed confirmed scopeCurrent exists false historyCapacity) = false))))), + proof: decide{} +} + +theorem{ + name: retiredAuthorityCannotPublish, + parameters: [], + statement: (forall (trustMatches : Bool), ((publicationAllowed true trustMatches) = false)), + proof: decide{} +} + +theorem{ + name: uncertainJournalCannotBeRemoved, + parameters: [], + statement: (forall (confirmed : Bool), (forall (noProviderIdentity : Bool), ((journalRemovalAllowed confirmed false noProviderIdentity) = false))), + proof: decide{} +} + +theorem{ + name: revocationBlocksSigning, + parameters: [], + statement: (forall (expectedKey : Bool), (forall (bodyKey : Bool), ((maySign (record State {generation := 0, present := true, revoked := true}) expectedKey bodyKey) = false))), + proof: decide{} +} + +theorem{ + name: rotateCreatesNextGeneration, + parameters: [generation : Nat], + statement: ((rotate (record State {generation := generation, present := true, revoked := false}) true true true) = (record State {generation := (generation + 1), present := true, revoked := false})), + proof: reflexivity{} +} + +theorem{ + name: staleMigrationPreservesState, + parameters: [generation : Nat, revoked : Bool], + statement: ((migrate (record State {generation := generation, present := true, revoked := revoked}) true true false true) = (record State {generation := generation, present := true, revoked := revoked})), + proof: reflexivity{} +} + +theorem{ + name: sameKeyRollbackRefused, + parameters: [], + statement: (forall (sameRevision : Bool), (forall (sameDigest : Bool), (forall (adjacent : Bool), (forall (predecessor : Bool), ((anchorChronologyAllowed true true sameRevision sameDigest adjacent predecessor) = false))))), + proof: decide{} +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/Budget.lex.tex b/app/src/Stitch/Budget.lex.tex new file mode 100644 index 0000000..f8ba012 --- /dev/null +++ b/app/src/Stitch/Budget.lex.tex @@ -0,0 +1,1861 @@ +\begin{lexlean}{Stitch.Budget} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\importmodule{Stitch.Identity} +\title{Stitch recoverable service model} +\begin{semanticmodule} +structure{ + name: Resources, + type_parameters: [], + parameters: [], + fields: [ + {name: transferBytes, type: Nat}, + {name: storageBytes, type: Nat}, + {name: computeWork, type: Nat}, + {name: refreshRequests, type: Nat} + ] +} + +structure{ + name: Budget, + type_parameters: [], + parameters: [], + fields: [ + {name: epoch, type: Nat}, + {name: start, type: Nat}, + {name: end, type: Nat}, + {name: last, type: Nat}, + {name: limit, type: Resources}, + {name: spent, type: Resources}, + {name: reserved, type: Resources} + ] +} + +definition{ + name: chooseBool, + parameters: [condition : Bool, whenTrue : Bool, whenFalse : Bool], + result: Bool, + body: (if condition then whenTrue else whenFalse) +} + +definition{ + name: chooseNat, + parameters: [condition : Bool, whenTrue : Nat, whenFalse : Nat], + result: Nat, + body: (if condition then whenTrue else whenFalse) +} + +theorem{ + name: boolAndFalse, + parameters: [], + statement: (forall (value : Bool), ((value && false) = false)), + proof: decide{} +} + +theorem{ + name: boolFalseAnd, + parameters: [], + statement: (forall (value : Bool), ((false && value) = false)), + proof: decide{} +} + +theorem{name: boolNotTrue, parameters: [], statement: ((not true) = false), proof: decide{}} + +theorem{ + name: chooseBoolTrue, + parameters: [], + statement: (forall (whenTrue : Bool), (forall (whenFalse : Bool), ((chooseBool true whenTrue whenFalse) = whenTrue))), + proof: decide{} +} + +theorem{ + name: chooseBoolFalse, + parameters: [], + statement: (forall (whenTrue : Bool), (forall (whenFalse : Bool), ((chooseBool false whenTrue whenFalse) = whenFalse))), + proof: decide{} +} + +theorem{ + name: chooseNatFalse, + parameters: [whenTrue : Nat, whenFalse : Nat], + statement: ((chooseNat false whenTrue whenFalse) = whenFalse), + proof: reflexivity{} +} + +theorem{ + name: chooseNatTrue, + parameters: [whenTrue : Nat, whenFalse : Nat], + statement: ((chooseNat true whenTrue whenFalse) = whenTrue), + proof: reflexivity{} +} + +definition{ + name: reserveAllowed, + parameters: [ + spent : Nat, + reserved : Nat, + cost : Nat, + limit : Nat, + now : Nat, + last : Nat, + end : Nat + ], + result: Bool, + body: ((last <=? now) && ((now ((spent + (reserveAmount spent reserved cost limit now last end)) <= limit)), + proof: linear_arithmetic{definitions: [reserveAllowed, reserveAmount]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: unknownSettlementRetainsReservation, + parameters: [reserved : Nat, ceiling : Nat, actual : Nat], + statement: ((settleReserved reserved ceiling actual false) = reserved), + proof: reflexivity{} +} + +theorem{ + name: settlementDoesNotIncreaseCharge, + parameters: [spent : Nat, reserved : Nat, ceiling : Nat, actual : Nat, known : Bool], + statement: (((settleSpent spent reserved ceiling actual known) + (settleReserved reserved ceiling actual known)) <= (spent + reserved)), + proof: linear_arithmetic{definitions: [settleReserved, settleSpent, settlementAllowed]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: clockRollbackRefused, + parameters: [ + spent : Nat, + reserved : Nat, + cost : Nat, + limit : Nat, + now : Nat, + last : Nat, + end : Nat + ], + statement: ((now < last) -> ((reserveAllowed spent reserved cost limit now last end) = false)), + proof: linear_arithmetic{definitions: [reserveAllowed]}, + axioms: [Quot.sound, propext] +} + +definition{ + name: budgetValid, + parameters: [budget : Budget], + result: Bool, + body: (resourcesWithin (project budget spent) (project budget reserved) (record Resources {transferBytes := 0, storageBytes := 0, computeWork := 0, refreshRequests := 0}) (project budget limit)) +} + +theorem{ + name: vectorReservationPreservesBudget, + parameters: [budget : Budget, cost : Resources, now : Nat], + statement: (((budgetValid budget) = true) -> ((budgetValid (reserveAction budget cost now)) = true)), + proof: linear_arithmetic{definitions: [admitAction, budgetValid, reserveAction, resourcesWithin]}, + axioms: [Classical.choice, Quot.sound, propext] +} + +definition{ + name: zeroResources, + parameters: [], + result: Resources, + body: (record Resources {transferBytes := 0, storageBytes := 0, computeWork := 0, refreshRequests := 0}) +} + +definition{ + name: addResources, + parameters: [left : Resources, right : Resources], + result: Resources, + body: (record Resources {transferBytes := ((project left transferBytes) + (project right transferBytes)), storageBytes := ((project left storageBytes) + (project right storageBytes)), computeWork := ((project left computeWork) + (project right computeWork)), refreshRequests := ((project left refreshRequests) + (project right refreshRequests))}) +} + +definition{ + name: sameResources, + parameters: [left : Resources, right : Resources], + result: Bool, + body: (((project left transferBytes) =? (project right transferBytes)) && (((project left storageBytes) =? (project right storageBytes)) && (((project left computeWork) =? (project right computeWork)) && ((project left refreshRequests) =? (project right refreshRequests))))) +} + +definition{ + name: resourcesAtMost, + parameters: [actual : Resources, ceiling : Resources], + result: Bool, + body: (((project actual transferBytes) <=? (project ceiling transferBytes)) && (((project actual storageBytes) <=? (project ceiling storageBytes)) && (((project actual computeWork) <=? (project ceiling computeWork)) && ((project actual refreshRequests) <=? (project ceiling refreshRequests))))) +} + +structure{ + name: Reservation, + type_parameters: [], + parameters: [], + fields: [ + {name: actionId, type: Stitch.Identity::Digest}, + {name: epoch, type: Nat}, + {name: ceiling, type: Resources}, + {name: actual, type: Resources}, + {name: settled, type: Bool} + ] +} + +structure{ + name: Ledger, + type_parameters: [], + parameters: [], + fields: [{name: budget, type: Budget}, {name: reservations, type: (List Reservation)}] +} + +inductive{ + name: SettlementOutcome, + type_parameters: [], + parameters: [], + constructors: [{name: Unknown, fields: []}, {name: Known, fields: []}] +} + +structure{ + name: SettlementObservation, + type_parameters: [], + parameters: [], + fields: [ + {name: actionId, type: Stitch.Identity::Digest}, + {name: epoch, type: Nat}, + {name: actual, type: Resources}, + {name: outcome, type: SettlementOutcome} + ] +} + +inductive{ + name: Selection, + type_parameters: [], + parameters: [], + constructors: [{name: Reject, fields: []}, {name: Accept, fields: []}] +} + +definition{ + name: selectionFromBool, + parameters: [condition : Bool], + result: Selection, + body: (if condition then (ctor Selection.Accept) else (ctor Selection.Reject)) +} + +definition{ + name: selectionValue, + parameters: [selection : Selection], + result: Bool, + body: (match selection | Selection.Reject => false | Selection.Accept => true) +} + +definition{ + name: selectBoth, + parameters: [pending : Selection, matching : Selection], + result: Selection, + body: (match pending | Selection.Reject => (ctor Selection.Reject) | Selection.Accept => matching) +} + +definition{ + name: selectRemaining, + parameters: [pending : Selection, matching : Selection], + result: Selection, + body: (match pending + | Selection.Reject => (ctor Selection.Reject) + | Selection.Accept => (match matching + | Selection.Reject => (ctor Selection.Accept) + | Selection.Accept => (ctor Selection.Reject))) +} + +definition{ + name: selectBool, + parameters: [selection : Selection, whenTrue : Bool, whenFalse : Bool], + result: Bool, + body: (match selection | Selection.Reject => whenFalse | Selection.Accept => whenTrue) +} + +definition{ + name: selectNat, + parameters: [selection : Selection, whenTrue : Nat, whenFalse : Nat], + result: Nat, + body: (match selection | Selection.Reject => whenFalse | Selection.Accept => whenTrue) +} + +definition{ + name: selectLedger, + parameters: [selection : Selection, whenTrue : Ledger, whenFalse : Ledger], + result: Ledger, + body: (match selection | Selection.Reject => whenFalse | Selection.Accept => whenTrue) +} + +theorem{ + name: boolImpliesTruth, + parameters: [], + statement: (forall (value : Bool), (((value = true) -> (0 = 0)) <-> (0 = 0))), + proof: decide{} +} + +theorem{ + name: selectedAdmissionSafety, + parameters: [], + statement: (forall (before : Bool), (forall (guard : Bool), (forall (candidate : Bool), (((before = true) -> ((selectBool (selectionFromBool guard) candidate before) = true)) <-> ((before = true) -> ((guard = true) -> (candidate = true))))))), + proof: decide{} +} + +theorem{ + name: selectionValueFromBool, + parameters: [], + statement: (forall (value : Bool), ((selectionValue (selectionFromBool value)) = value)), + proof: decide{} +} + +theorem{ + name: selectBoolFromValue, + parameters: [selection : Selection, whenTrue : Bool, whenFalse : Bool], + statement: ((selectBool selection whenTrue whenFalse) = (chooseBool (selectionValue selection) whenTrue whenFalse)), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +definition{ + name: outcomeKnown, + parameters: [outcome : SettlementOutcome], + result: Bool, + body: (match outcome | SettlementOutcome.Unknown => false | SettlementOutcome.Known => true) +} + +definition{ + name: reservationUnused, + parameters: [reservations : (List Reservation), actionId : Stitch.Identity::Digest], + result: Bool, + body: (match reservations + | List.nil => true + | List.cons head tail => ((not (Stitch.Identity::sameDigest (project head actionId) actionId)) && (reservationUnused tail actionId))), + recursive_argument: reservations +} + +definition{ + name: resourceAt, + parameters: [resources : Resources, index : Nat], + result: Nat, + body: (if (index =? 0) then (project resources transferBytes) else (if (index =? 1) then (project resources storageBytes) else (if (index =? 2) then (project resources computeWork) else (project resources refreshRequests)))) +} + +definition{ + name: spentAt, + parameters: [reservations : (List Reservation), index : Nat], + result: Nat, + body: (match reservations + | List.nil => 0 + | List.cons head tail => ((selectNat (selectionFromBool (project head settled)) (resourceAt (project head actual) index) 0) + (spentAt tail index))), + recursive_argument: reservations +} + +definition{ + name: reservedAt, + parameters: [reservations : (List Reservation), index : Nat], + result: Nat, + body: (match reservations + | List.nil => 0 + | List.cons head tail => ((selectNat (selectionFromBool (project head settled)) 0 (resourceAt (project head ceiling) index)) + (reservedAt tail index))), + recursive_argument: reservations +} + +definition{ + name: headChargedAt, + parameters: [reservation : Reservation, index : Nat], + result: Nat, + body: (selectNat (selectionFromBool (project reservation settled)) (resourceAt (project reservation actual) index) (resourceAt (project reservation ceiling) index)) +} + +definition{ + name: chargedAt, + parameters: [reservations : (List Reservation), index : Nat], + result: Nat, + body: (match reservations + | List.nil => 0 + | List.cons head tail => ((headChargedAt head index) + (chargedAt tail index))), + recursive_argument: reservations +} + +definition{ + name: reservedTotal, + parameters: [reservations : (List Reservation)], + result: Resources, + body: (record Resources {transferBytes := (reservedAt reservations 0), storageBytes := (reservedAt reservations 1), computeWork := (reservedAt reservations 2), refreshRequests := (reservedAt reservations 3)}) +} + +definition{ + name: spentTotal, + parameters: [reservations : (List Reservation)], + result: Resources, + body: (record Resources {transferBytes := (spentAt reservations 0), storageBytes := (spentAt reservations 1), computeWork := (spentAt reservations 2), refreshRequests := (spentAt reservations 3)}) +} + +definition{ + name: reservationCostValid, + parameters: [reservation : Reservation], + result: Bool, + body: (if (project reservation settled) then (resourcesAtMost (project reservation actual) (project reservation ceiling)) else (sameResources (project reservation actual) (zeroResources))) +} + +definition{ + name: reservationsValid, + parameters: [reservations : (List Reservation), epoch : Nat], + result: Bool, + body: (match reservations + | List.nil => true + | List.cons head tail => ((Stitch.Identity::digestWellFormed (project head actionId)) && (((project head epoch) =? epoch) && ((reservationUnused tail (project head actionId)) && ((reservationCostValid head) && (reservationsValid tail epoch)))))), + recursive_argument: reservations +} + +definition{ + name: ledgerValid, + parameters: [ledger : Ledger], + result: Bool, + body: ((budgetValid (project ledger budget)) && (((project (project ledger budget) start) <=? (project (project ledger budget) last)) && (((project (project ledger budget) last) false + | List.cons head tail => (selectBool (selectionFromBool (Stitch.Identity::sameDigest (project head actionId) (project observation actionId))) ((not (selectionValue (selectionFromBool (project head settled)))) && (((project head epoch) =? (project observation epoch)) && (resourcesAtMost (project observation actual) (project head ceiling)))) (settlementRecorded tail observation))), + recursive_argument: reservations +} + +definition{ + name: settleLedgerAllowed, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + result: Bool, + body: ((outcomeKnown (project observation outcome)) && ((ledgerValid ledger) && (((project observation epoch) =? (project (project ledger budget) epoch)) && (((project (project ledger budget) last) <=? now) && ((now reservation + | Selection.Accept => (record Reservation {actionId := (project reservation actionId), epoch := (project reservation epoch), ceiling := (project reservation ceiling), actual := (project observation actual), settled := true})) +} + +definition{ + name: updateSettlementRecord, + parameters: [reservation : Reservation, observation : SettlementObservation, pending : Selection], + result: Reservation, + body: (selectedSettlementRecord (selectBoth pending (selectionFromBool (Stitch.Identity::sameDigest (project reservation actionId) (project observation actionId)))) reservation observation) +} + +definition{ + name: recordSettlementFrom, + parameters: [ + reservations : (List Reservation), + observation : SettlementObservation, + pending : Selection + ], + result: (List Reservation), + body: (match reservations + | List.nil => (nil Reservation) + | List.cons head tail => (cons (updateSettlementRecord head observation pending) (recordSettlementFrom tail observation (selectRemaining pending (selectionFromBool (Stitch.Identity::sameDigest (project head actionId) (project observation actionId))))))), + recursive_argument: reservations +} + +definition{ + name: recordSettlement, + parameters: [reservations : (List Reservation), observation : SettlementObservation], + result: (List Reservation), + body: (recordSettlementFrom reservations observation (ctor Selection.Accept)) +} + +definition{ + name: settlementCandidate, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + result: Ledger, + body: (let reservations : (List Reservation) := (recordSettlement (project ledger reservations) observation); (record Ledger {budget := (ledgerBudget (project ledger budget) reservations now), reservations := reservations})) +} + +definition{ + name: settleLedger, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + result: Ledger, + body: (selectLedger (selectionFromBool (settleLedgerAllowed ledger observation now)) (settlementCandidate ledger observation now) ledger) +} + +theorem{ + name: unknownOutcomeRetainsLedger, + parameters: [ + ledger : Ledger, + actionId : Stitch.Identity::Digest, + epoch : Nat, + actual : Resources, + now : Nat + ], + statement: ((settleLedger ledger (record SettlementObservation {actionId := actionId, epoch := epoch, actual := actual, outcome := (ctor SettlementOutcome.Unknown)}) now) = ledger), + proof: reflexivity{} +} + +theorem{ + name: staleEpochCannotSettle, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: (((project observation epoch) < (project (project ledger budget) epoch)) -> ((settleLedgerAllowed ledger observation now) = false)), + proof: linear_arithmetic{definitions: [settleLedgerAllowed]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: settlementClockRollbackRefused, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((now < (project (project ledger budget) last)) -> ((settleLedgerAllowed ledger observation now) = false)), + proof: linear_arithmetic{definitions: [settleLedgerAllowed]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: recordedIdCannotBeReservedAgain, + parameters: [ + budget : Budget, + head : Reservation, + tail : (List Reservation), + cost : Resources, + now : Nat + ], + statement: ((reserveLedgerAllowed (record Ledger {budget := budget, reservations := (cons head tail)}) (project head actionId) cost now) = false), + proof: simplify{ + definitions: [ + boolFalseAnd, + boolNotTrue, + reservationUnused, + reserveLedgerAllowed, + Stitch.Identity::fullDigestReflexive + ] + }, + axioms: [propext] +} + +theorem{ + name: settledHeadCannotBeChargedAgain, + parameters: [ + actionId : Stitch.Identity::Digest, + epoch : Nat, + ceiling : Resources, + priorActual : Resources, + tail : (List Reservation), + actual : Resources + ], + statement: ((settlementRecorded (cons (record Reservation {actionId := actionId, epoch := epoch, ceiling := ceiling, actual := priorActual, settled := true}) tail) (record SettlementObservation {actionId := actionId, epoch := epoch, actual := actual, outcome := (ctor SettlementOutcome.Known)})) = false), + proof: simplify{ + definitions: [ + boolFalseAnd, + boolNotTrue, + chooseBoolTrue, + selectBoolFromValue, + selectionValueFromBool, + settlementRecorded, + Stitch.Identity::fullDigestReflexive + ] + }, + axioms: [propext] +} + +theorem{ + name: ledgerValiditySelect, + parameters: [selection : Selection, whenTrue : Ledger, whenFalse : Ledger], + statement: ((ledgerValid (selectLedger selection whenTrue whenFalse)) = (selectBool selection (ledgerValid whenTrue) (ledgerValid whenFalse))), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +definition{ + name: reservationNumericValidity, + parameters: [ledger : Ledger], + result: Bool, + body: ((budgetValid (project ledger budget)) && (((project (project ledger budget) start) <=? (project (project ledger budget) last)) && (((project (project ledger budget) last) (a = true)) -> (((g = true) -> (b = true)) -> (((g = true) -> ((a && b) = true)) <-> (0 = 0))))))), + proof: decide{} +} + +theorem{ + name: reservationTrueAnd, + parameters: [], + statement: (forall (v : Bool), ((true && v) = v)), + proof: decide{} +} + +theorem{ + name: reservationEpochReflexive, + parameters: [epoch : Nat], + statement: ((epoch =? epoch) = true), + proof: linear_arithmetic{}, + axioms: [propext] +} + +theorem{ + name: reservationFreshCostValidity, + parameters: [actionId : Stitch.Identity::Digest, epoch : Nat, ceiling : Resources], + statement: ((reservationCostValid (record Reservation {actionId := actionId, epoch := epoch, ceiling := ceiling, actual := (zeroResources), settled := false})) = true), + proof: reflexivity{} +} + +theorem{ + name: reservationListAdmissionFact, + parameters: [], + statement: (forall (unused : Bool), (forall (b : Bool), (forall (start : Bool), (forall (end : Bool), (forall (valid : Bool), (forall (spent : Bool), (forall (reserved : Bool), (forall (digest : Bool), (forall (admitted : Bool), ((((unused && ((b && (start && (end && (valid && (spent && reserved))))) && (digest && admitted))) = true) -> ((digest && (unused && valid)) = true)) <-> (0 = 0))))))))))), + proof: decide{} +} + +theorem{ + name: reservationCandidateListGuarantee, + parameters: [ledger : Ledger, actionId : Stitch.Identity::Digest, cost : Resources, now : Nat], + statement: ((((reserveLedgerAllowed ledger actionId cost now) = true) -> ((reservationsValid (project (reservationCandidate ledger actionId cost now) reservations) (project (project (reservationCandidate ledger actionId cost now) budget) epoch)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + ledgerBudget, + ledgerValid, + reservationCandidate, + reservationEpochReflexive, + reservationFreshCostValidity, + reservationListAdmissionFact, + reservationTrueAnd, + reservationsValid, + reserveLedgerAllowed + ] + }, + axioms: [propext] +} + +theorem{ + name: reservationCandidateNumericGuarantee, + parameters: [ledger : Ledger, actionId : Stitch.Identity::Digest, cost : Resources, now : Nat], + statement: ((((reserveLedgerAllowed ledger actionId cost now) = true) -> ((reservationNumericValidity (reservationCandidate ledger actionId cost now)) = true)) <-> (0 = 0)), + proof: constructor{ + branches: [ + linear_arithmetic{}, + linear_arithmetic{ + definitions: [ + admitAction, + budgetValid, + ledgerBudget, + ledgerValid, + reservationCandidate, + reservationNumericValidity, + reserveLedgerAllowed, + reservedAt, + reservedTotal, + resourceAt, + resourcesWithin, + sameResources, + selectNat, + selectionFromBool, + spentAt, + spentTotal, + zeroResources + ] + } + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: reservationCandidateGuarantee, + parameters: [ledger : Ledger, actionId : Stitch.Identity::Digest, cost : Resources, now : Nat], + statement: ((((reserveLedgerAllowed ledger actionId cost now) = true) -> ((ledgerValid (reservationCandidate ledger actionId cost now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + reservationCandidateListGuarantee, + reservationCandidateNumericGuarantee, + reservationConjunctionClosure, + reservationLedgerParts + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: reservationSelectedSafety, + parameters: [], + statement: (forall (before : Bool), (forall (guard : Bool), (forall (candidate : Bool), (((guard = true) -> (candidate = true)) -> (((before = true) -> ((selectBool (selectionFromBool guard) candidate before) = true)) <-> (0 = 0)))))), + proof: decide{} +} + +theorem{ + name: reserveLedgerPreservesValidity, + parameters: [ledger : Ledger, actionId : Stitch.Identity::Digest, cost : Resources, now : Nat], + statement: (((ledgerValid ledger) = true) -> ((ledgerValid (reserveLedger ledger actionId cost now)) = true)), + proof: simplify{ + definitions: [ + ledgerValiditySelect, + reservationCandidateGuarantee, + reservationSelectedSafety, + reserveLedger + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: reserveLedgerPreservesValidityFact, + parameters: [ledger : Ledger, actionId : Stitch.Identity::Digest, cost : Resources, now : Nat], + statement: ((((ledgerValid ledger) = true) -> ((ledgerValid (reserveLedger ledger actionId cost now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + ledgerValiditySelect, + reservationCandidateGuarantee, + reservationSelectedSafety, + reserveLedger + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +definition{ + name: reservationSelectNat, + parameters: [selection : Selection, whenTrue : Nat, whenFalse : Nat], + result: Nat, + body: (match selection | Selection.Reject => whenFalse | Selection.Accept => whenTrue) +} + +theorem{ + name: reservationLedgerClockSelect, + parameters: [selection : Selection, whenTrue : Ledger, whenFalse : Ledger], + statement: ((project (project (selectLedger selection whenTrue whenFalse) budget) last) = (reservationSelectNat selection (project (project whenTrue budget) last) (project (project whenFalse budget) last))), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +theorem{ + name: reservationSelectedClockFact, + parameters: [condition : Bool, whenTrue : Nat, whenFalse : Nat], + statement: (((condition = true) -> ((reservationSelectNat (selectionFromBool condition) whenTrue whenFalse) = whenTrue)) <-> (0 = 0)), + proof: constructor{ + branches: [ + linear_arithmetic{}, + linear_arithmetic{definitions: [reservationSelectNat, selectionFromBool]} + ] + }, + axioms: [propext] +} + +theorem{ + name: reservationCandidateClock, + parameters: [ledger : Ledger, actionId : Stitch.Identity::Digest, cost : Resources, now : Nat], + statement: ((project (project (reservationCandidate ledger actionId cost now) budget) last) = now), + proof: reflexivity{} +} + +theorem{ + name: reserveLedgerClockFact, + parameters: [ledger : Ledger, actionId : Stitch.Identity::Digest, cost : Resources, now : Nat], + statement: ((((reserveLedgerAllowed ledger actionId cost now) = true) -> ((project (project (reserveLedger ledger actionId cost now) budget) last) = now)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + reservationCandidateClock, + reservationLedgerClockSelect, + reservationSelectedClockFact, + reserveLedger + ] + }, + axioms: [propext] +} + +theorem{ + name: selectedRecordId, + parameters: [ + selection : Selection, + reservation : Reservation, + observation : SettlementObservation + ], + statement: ((project (selectedSettlementRecord selection reservation observation) actionId) = (project reservation actionId)), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +theorem{ + name: selectedRecordEpoch, + parameters: [ + selection : Selection, + reservation : Reservation, + observation : SettlementObservation + ], + statement: ((project (selectedSettlementRecord selection reservation observation) epoch) = (project reservation epoch)), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +theorem{ + name: selectedRecordCeiling, + parameters: [ + selection : Selection, + reservation : Reservation, + observation : SettlementObservation + ], + statement: ((project (selectedSettlementRecord selection reservation observation) ceiling) = (project reservation ceiling)), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +theorem{ + name: selectedRecordCostValidity, + parameters: [ + selection : Selection, + reservation : Reservation, + observation : SettlementObservation + ], + statement: ((reservationCostValid (selectedSettlementRecord selection reservation observation)) = (selectBool selection (resourcesAtMost (project observation actual) (project reservation ceiling)) (reservationCostValid reservation))), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +theorem{ + name: selectBoolFromBool, + parameters: [], + statement: (forall (condition : Bool), (forall (whenTrue : Bool), (forall (whenFalse : Bool), ((selectBool (selectionFromBool condition) whenTrue whenFalse) = (chooseBool condition whenTrue whenFalse))))), + proof: decide{} +} + +theorem{ + name: settlementFromPreservesUnusedIds, + parameters: [ + reservations : (List Reservation), + observation : SettlementObservation, + actionId : Stitch.Identity::Digest, + pending : Selection + ], + statement: ((reservationUnused (recordSettlementFrom reservations observation pending) actionId) = (reservationUnused reservations actionId)), + proof: induction{ + branches: [ + { + proof: simplify{definitions: [recordSettlementFrom, reservationUnused]}, + binders: [], + constructor: nil + }, + { + proof: simplify{ + definitions: [ + hypothesis, + recordSettlementFrom, + reservationUnused, + selectedRecordId, + updateSettlementRecord + ] + }, + binders: [head, tail, hypothesis], + constructor: cons + } + ], + generalizing: [actionId, observation, pending], + scrutinee: reservations + }, + axioms: [propext] +} + +theorem{ + name: settlementPreservesUnusedIds, + parameters: [ + reservations : (List Reservation), + observation : SettlementObservation, + actionId : Stitch.Identity::Digest + ], + statement: ((reservationUnused (recordSettlement reservations observation) actionId) = (reservationUnused reservations actionId)), + proof: simplify{definitions: [recordSettlement, settlementFromPreservesUnusedIds]}, + axioms: [propext] +} + +theorem{ + name: selectNatFromBool, + parameters: [selection : Selection, whenTrue : Nat, whenFalse : Nat], + statement: ((selectNat selection whenTrue whenFalse) = (chooseNat (selectionValue selection) whenTrue whenFalse)), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +theorem{ + name: selectedRecordCharge, + parameters: [ + selection : Selection, + reservation : Reservation, + observation : SettlementObservation, + index : Nat + ], + statement: ((headChargedAt (selectedSettlementRecord selection reservation observation) index) = (selectNat selection (resourceAt (project observation actual) index) (headChargedAt reservation index))), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +theorem{ + name: scalarAccountingStep, + parameters: [ + selection : Selection, + actual : Nat, + ceiling : Nat, + spent : Nat, + reserved : Nat, + charged : Nat + ], + statement: (((((selectNat selection actual 0) + spent) + ((selectNat selection 0 ceiling) + reserved)) = ((selectNat selection actual ceiling) + charged)) <-> ((spent + reserved) = charged)), + proof: cases{ + branches: [ + {proof: linear_arithmetic{definitions: [selectNat]}, binders: [], constructor: Reject}, + {proof: linear_arithmetic{definitions: [selectNat]}, binders: [], constructor: Accept} + ], + scrutinee: selection + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: scalarAccounting, + parameters: [reservations : (List Reservation), index : Nat], + statement: (((spentAt reservations index) + (reservedAt reservations index)) = (chargedAt reservations index)), + proof: induction{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: nil}, + { + proof: simplify{ + definitions: [ + chargedAt, + headChargedAt, + hypothesis, + reservedAt, + scalarAccountingStep, + spentAt + ] + }, + binders: [head, tail, hypothesis], + constructor: cons + } + ], + generalizing: [index], + scrutinee: reservations + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: settlementValidityStep, + parameters: [pending : Selection, matching : Selection], + statement: (forall (identity : Bool), (forall (epoch : Bool), (forall (unused : Bool), (forall (headCost : Bool), (forall (tailValid : Bool), (forall (settled : Bool), (forall (epochMatches : Bool), (forall (actualWithin : Bool), (forall (tailRecorded : Bool), (forall (nextValid : Bool), ((((tailValid = true) -> (((chooseBool (selectionValue (selectRemaining pending matching)) tailRecorded true) = true) -> (nextValid = true))) <-> (0 = 0)) -> ((((identity && (epoch && (unused && (headCost && tailValid)))) = true) -> (((chooseBool (selectionValue pending) (selectBool matching ((not settled) && (epochMatches && actualWithin)) tailRecorded) true) = true) -> ((identity && (epoch && (unused && ((selectBool (selectBoth pending matching) actualWithin headCost) && nextValid)))) = true))) <-> (0 = 0))))))))))))), + proof: cases{ + branches: [ + { + proof: cases{ + branches: [ + {proof: decide{}, binders: [], constructor: Reject}, + {proof: decide{}, binders: [], constructor: Accept} + ], + scrutinee: matching + }, + binders: [], + constructor: Reject + }, + { + proof: cases{ + branches: [ + {proof: decide{}, binders: [], constructor: Reject}, + {proof: decide{}, binders: [], constructor: Accept} + ], + scrutinee: matching + }, + binders: [], + constructor: Accept + } + ], + scrutinee: pending + } +} + +theorem{ + name: settlementFromPreservesReservationValidity, + parameters: [ + reservations : (List Reservation), + observation : SettlementObservation, + epoch : Nat, + pending : Selection + ], + statement: ((((reservationsValid reservations epoch) = true) -> (((chooseBool (selectionValue pending) (settlementRecorded reservations observation) true) = true) -> ((reservationsValid (recordSettlementFrom reservations observation pending) epoch) = true))) <-> (0 = 0)), + proof: induction{ + branches: [ + { + proof: constructor{ + branches: [ + linear_arithmetic{}, + linear_arithmetic{ + definitions: [chooseBool, recordSettlementFrom, reservationsValid, settlementRecorded] + } + ] + }, + binders: [], + constructor: nil + }, + { + proof: simplify{ + definitions: [ + hypothesis, + recordSettlementFrom, + reservationsValid, + selectedRecordCostValidity, + selectedRecordEpoch, + selectedRecordId, + settlementFromPreservesUnusedIds, + settlementRecorded, + settlementValidityStep, + updateSettlementRecord + ] + }, + binders: [head, tail, hypothesis], + constructor: cons + } + ], + generalizing: [epoch, observation, pending], + scrutinee: reservations + }, + axioms: [propext] +} + +theorem{ + name: settlementReservationValidityFact, + parameters: [reservations : (List Reservation), observation : SettlementObservation, epoch : Nat], + statement: ((((reservationsValid reservations epoch) = true) -> (((settlementRecorded reservations observation) = true) -> ((reservationsValid (recordSettlement reservations observation) epoch) = true))) <-> (0 = 0)), + proof: apply{ + arguments: [reservations, observation, epoch, (ctor Selection.Accept)], + theorem: settlementFromPreservesReservationValidity + }, + axioms: [propext] +} + +theorem{ + name: settlementPreservesReservationValidity, + parameters: [reservations : (List Reservation), observation : SettlementObservation, epoch : Nat], + statement: (((reservationsValid reservations epoch) = true) -> (((settlementRecorded reservations observation) = true) -> ((reservationsValid (recordSettlement reservations observation) epoch) = true))), + proof: simplify{definitions: [settlementReservationValidityFact]}, + axioms: [propext] +} + +theorem{ + name: scalarBoundToBool, + parameters: [left : Nat, right : Nat], + statement: ((left <= right) <-> ((left <=? right) = true)), + proof: linear_arithmetic{}, + axioms: [propext] +} + +theorem{ + name: scalarBoolToBound, + parameters: [left : Nat, right : Nat], + statement: (((left <=? right) = true) <-> (left <= right)), + proof: linear_arithmetic{}, + axioms: [propext] +} + +theorem{ + name: settledSelectionChargeStep, + parameters: [], + statement: (forall (tailRecorded : Bool), (forall (epochMatches : Bool), (forall (actualWithin : Bool), (forall (tailBound : Bool), (forall (wholeBound : Bool), ((((((chooseBool (selectionValue (selectRemaining (ctor Selection.Accept) (ctor Selection.Accept))) tailRecorded true) = true) -> (tailBound = true)) <-> (0 = 0)) -> (((chooseBool (selectionValue (ctor Selection.Accept)) (selectBool (ctor Selection.Accept) ((not (selectionValue (ctor Selection.Accept))) && (epochMatches && actualWithin)) tailRecorded) true) = true) -> (wholeBound = true))) <-> (0 = 0))))))), + proof: decide{} +} + +definition{ + name: scalarChargeSafe, + parameters: [pending : Selection, recorded : Bool, bound : Bool], + result: Bool, + body: (selectBool pending ((not recorded) || bound) bound) +} + +theorem{ + name: scalarChargeRejected, + parameters: [recorded : Bool, bound : Bool], + statement: ((scalarChargeSafe (ctor Selection.Reject) recorded bound) = bound), + proof: reflexivity{} +} + +definition{ + name: scalarFreshChargeCheck, + parameters: [ + epochMatches : Bool, + actualWithin : Bool, + actualBound : Bool, + tailBound : Bool, + resultBound : Bool + ], + result: Bool, + body: ((not (epochMatches && actualWithin)) || resultBound) +} + +theorem{ + name: scalarAdditionMonotone, + parameters: [actual : Nat, ceiling : Nat, before : Nat, after : Nat], + statement: (((not (actual <=? ceiling)) || ((not (after <=? before)) || ((actual + after) <=? (ceiling + before)))) = true), + proof: linear_arithmetic{}, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: scalarFreshChargeGate, + parameters: [], + statement: (forall (epochMatches : Bool), (forall (actualWithin : Bool), (forall (actualBound : Bool), (forall (tailBound : Bool), (forall (resultBound : Bool), ((((not actualBound) || ((not tailBound) || resultBound)) = true) -> (((((not actualWithin) || actualBound) = true) -> ((tailBound = true) -> ((scalarFreshChargeCheck epochMatches actualWithin actualBound tailBound resultBound) = true))) <-> (0 = 0)))))))), + proof: decide{} +} + +theorem{ + name: scalarSameConsequent, + parameters: [constraint : Bool, observed : Bool], + statement: ((constraint = true) -> ((observed = true) -> (observed = true))), + proof: linear_arithmetic{} +} + +theorem{ + name: scalarTrueConsequentObserved, + parameters: [constraint : Bool, observed : Bool], + statement: ((constraint = true) -> ((observed = true) -> (true = true))), + proof: linear_arithmetic{}, + axioms: [propext] +} + +theorem{ + name: scalarAdditionCancellation, + parameters: [head : Nat, after : Nat, before : Nat], + statement: ((((head + after) <=? (head + before)) = true) <-> ((after <=? before) = true)), + proof: constructor{branches: [linear_arithmetic{}, linear_arithmetic{}]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: scalarCheckComparisonCongruence, + parameters: [pending : Selection], + statement: (forall (recorded : Bool), (forall (left : Bool), (forall (right : Bool), (((left = true) <-> (right = true)) -> (((scalarChargeSafe pending recorded left) = true) <-> ((scalarChargeSafe pending recorded right) = true)))))), + proof: cases{ + branches: [ + {proof: decide{}, binders: [], constructor: Reject}, + {proof: decide{}, binders: [], constructor: Accept} + ], + scrutinee: pending + } +} + +theorem{ + name: scalarCheckReflected, + parameters: [], + statement: (forall (recorded : Bool), (forall (bound : Bool), (((scalarChargeSafe (ctor Selection.Accept) recorded bound) = true) <-> ((recorded = true) -> (bound = true))))), + proof: decide{} +} + +theorem{ + name: scalarCheckAdditionCancellation, + parameters: [recorded : Bool, head : Nat, after : Nat, before : Nat], + statement: (((scalarChargeSafe (ctor Selection.Accept) recorded ((head + after) <=? (head + before))) = true) <-> ((scalarChargeSafe (ctor Selection.Accept) recorded (after <=? before)) = true)), + proof: simplify{definitions: [scalarAdditionCancellation, scalarCheckReflected]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: resourceAtChargeConstraint, + parameters: [actual : Resources, ceiling : Resources, index : Nat], + statement: (((not (resourcesAtMost actual ceiling)) || ((resourceAt actual index) <=? (resourceAt ceiling index))) = true), + proof: linear_arithmetic{definitions: [resourceAt, resourcesAtMost]}, + axioms: [Classical.choice, Quot.sound, propext] +} + +definition{ + name: scalarStepChargeSafe, + parameters: [ + pending : Selection, + matching : Selection, + settled : Selection, + epochMatches : Bool, + actualWithin : Bool, + tailRecorded : Bool, + actual : Nat, + ceiling : Nat, + oldActual : Nat, + before : Nat, + after : Nat + ], + result: Bool, + body: (match pending + | Selection.Reject => (after <=? before) + | Selection.Accept => (match matching + | Selection.Reject => (scalarChargeSafe (ctor Selection.Accept) tailRecorded (after <=? before)) + | Selection.Accept => (match settled + | Selection.Reject => (scalarFreshChargeCheck epochMatches actualWithin (actual <=? ceiling) (after <=? before) ((actual + after) <=? (ceiling + before))) + | Selection.Accept => true))) +} + +theorem{ + name: resourceAtBound, + parameters: [actual : Resources, ceiling : Resources, index : Nat], + statement: (((resourcesAtMost actual ceiling) = true) -> ((resourceAt actual index) <= (resourceAt ceiling index))), + proof: linear_arithmetic{definitions: [resourceAt, resourcesAtMost]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: scalarTrueConsequent, + parameters: [condition : Bool, actual : Nat, ceiling : Nat, tail : Bool], + statement: (((condition = true) -> (actual <= ceiling)) -> ((tail = true) -> (true = true))), + proof: linear_arithmetic{}, + axioms: [propext] +} + +theorem{ + name: scalarStepChargeGuarantee, + parameters: [ + pending : Selection, + matching : Selection, + settled : Selection, + epochMatches : Bool, + actualWithin : Bool, + tailRecorded : Bool, + actual : Nat, + ceiling : Nat, + oldActual : Nat, + before : Nat, + after : Nat + ], + statement: ((((not actualWithin) || (actual <=? ceiling)) = true) -> (((scalarChargeSafe (selectRemaining pending matching) tailRecorded (after <=? before)) = true) -> ((scalarStepChargeSafe pending matching settled epochMatches actualWithin tailRecorded actual ceiling oldActual before after) = true))), + proof: cases{ + branches: [ + { + proof: apply{ + arguments: [((not actualWithin) || (actual <=? ceiling)), (after <=? before)], + theorem: scalarSameConsequent + }, + binders: [], + constructor: Reject + }, + { + proof: cases{ + branches: [ + { + proof: apply{ + arguments: [ + ((not actualWithin) || (actual <=? ceiling)), + (scalarChargeSafe (ctor Selection.Accept) tailRecorded (after <=? before)) + ], + theorem: scalarSameConsequent + }, + binders: [], + constructor: Reject + }, + { + proof: cases{ + branches: [ + { + proof: simplify{ + definitions: [ + scalarAdditionMonotone, + scalarChargeRejected, + scalarFreshChargeGate, + scalarStepChargeSafe, + selectRemaining + ] + }, + binders: [], + constructor: Reject + }, + { + proof: apply{ + arguments: [((not actualWithin) || (actual <=? ceiling)), (after <=? before)], + theorem: scalarTrueConsequentObserved + }, + binders: [], + constructor: Accept + } + ], + scrutinee: settled + }, + binders: [], + constructor: Accept + } + ], + scrutinee: matching + }, + binders: [], + constructor: Accept + } + ], + scrutinee: pending + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: scalarConsChargeCheck, + parameters: [ + pending : Selection, + matching : Selection, + settled : Selection, + epochMatches : Bool, + actualWithin : Bool, + tailRecorded : Bool, + actual : Nat, + ceiling : Nat, + oldActual : Nat, + before : Nat, + after : Nat + ], + statement: (((scalarChargeSafe pending (selectBool matching ((not (selectionValue settled)) && (epochMatches && actualWithin)) tailRecorded) (((selectNat (selectBoth pending matching) actual (selectNat settled oldActual ceiling)) + after) <=? ((selectNat settled oldActual ceiling) + before))) = true) <-> ((scalarStepChargeSafe pending matching settled epochMatches actualWithin tailRecorded actual ceiling oldActual before after) = true)), + proof: cases{ + branches: [ + { + proof: apply{ + arguments: [(selectNat settled oldActual ceiling), after, before], + theorem: scalarAdditionCancellation + }, + binders: [], + constructor: Reject + }, + { + proof: cases{ + branches: [ + { + proof: apply{ + arguments: [tailRecorded, (selectNat settled oldActual ceiling), after, before], + theorem: scalarCheckAdditionCancellation + }, + binders: [], + constructor: Reject + }, + { + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: settled + }, + binders: [], + constructor: Accept + } + ], + scrutinee: matching + }, + binders: [], + constructor: Accept + } + ], + scrutinee: pending + }, + axioms: [Quot.sound, propext] +} + +theorem{ + name: selectedRecordChargeExpanded, + parameters: [ + selection : Selection, + reservation : Reservation, + observation : SettlementObservation, + index : Nat + ], + statement: ((selectNat (selectionFromBool (project (selectedSettlementRecord selection reservation observation) settled)) (resourceAt (project (selectedSettlementRecord selection reservation observation) actual) index) (resourceAt (project (selectedSettlementRecord selection reservation observation) ceiling) index)) = (selectNat selection (resourceAt (project observation actual) index) (selectNat (selectionFromBool (project reservation settled)) (resourceAt (project reservation actual) index) (resourceAt (project reservation ceiling) index)))), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +theorem{ + name: scalarSettlementSafety, + parameters: [ + reservations : (List Reservation), + observation : SettlementObservation, + index : Nat, + pending : Selection + ], + statement: ((scalarChargeSafe pending (settlementRecorded reservations observation) ((chargedAt (recordSettlementFrom reservations observation pending) index) <=? (chargedAt reservations index))) = true), + proof: induction{ + branches: [ + { + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: pending + }, + binders: [], + constructor: nil + }, + { + proof: simplify{ + definitions: [ + chargedAt, + headChargedAt, + hypothesis, + recordSettlementFrom, + resourceAtChargeConstraint, + scalarConsChargeCheck, + scalarStepChargeGuarantee, + selectedRecordChargeExpanded, + settlementRecorded, + updateSettlementRecord + ] + }, + binders: [head, tail, hypothesis], + constructor: cons + } + ], + generalizing: [index, observation, pending], + scrutinee: reservations + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: scalarChargeObservation, + parameters: [], + statement: (forall (recorded : Bool), (forall (bound : Bool), (((recorded = true) -> (bound = true)) <-> ((scalarChargeSafe (ctor Selection.Accept) recorded bound) = true)))), + proof: decide{} +} + +theorem{ + name: scalarSettlementFact, + parameters: [reservations : (List Reservation), observation : SettlementObservation, index : Nat], + statement: ((((settlementRecorded reservations observation) = true) -> ((chargedAt (recordSettlement reservations observation) index) <= (chargedAt reservations index))) <-> (0 = 0)), + proof: simplify{ + definitions: [ + recordSettlement, + scalarBoundToBool, + scalarChargeObservation, + scalarSettlementSafety + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: chargeComparisonObserved, + parameters: [left : Nat, right : Nat], + statement: (((left <=? right) = true) <-> (left <= right)), + proof: linear_arithmetic{}, + axioms: [propext] +} + +theorem{ + name: chargeFourConjunctionFact, + parameters: [], + statement: (forall (guard : Bool), (forall (a : Bool), (forall (b : Bool), (forall (c : Bool), (forall (d : Bool), (((guard = true) -> (a = true)) -> (((guard = true) -> (b = true)) -> (((guard = true) -> (c = true)) -> (((guard = true) -> (d = true)) -> (((guard = true) -> ((a && (b && (c && d))) = true)) <-> (0 = 0))))))))))), + proof: decide{} +} + +theorem{ + name: settlementCannotIncreaseLedgerCharge, + parameters: [reservations : (List Reservation), observation : SettlementObservation], + statement: (((settlementRecorded reservations observation) = true) -> ((resourcesAtMost (addResources (spentTotal (recordSettlement reservations observation)) (reservedTotal (recordSettlement reservations observation))) (addResources (spentTotal reservations) (reservedTotal reservations))) = true)), + proof: simplify{ + definitions: [ + addResources, + chargeComparisonObserved, + chargeFourConjunctionFact, + reservedTotal, + resourcesAtMost, + scalarAccounting, + scalarSettlementFact, + spentTotal + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: settlementCannotIncreaseLedgerChargeFact, + parameters: [reservations : (List Reservation), observation : SettlementObservation], + statement: ((((settlementRecorded reservations observation) = true) -> ((resourcesAtMost (addResources (spentTotal (recordSettlement reservations observation)) (reservedTotal (recordSettlement reservations observation))) (addResources (spentTotal reservations) (reservedTotal reservations))) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + addResources, + chargeComparisonObserved, + chargeFourConjunctionFact, + reservedTotal, + resourcesAtMost, + scalarAccounting, + scalarSettlementFact, + spentTotal + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: settlementValidityProjection, + parameters: [], + statement: (forall (numeric : Bool), (forall (valid : Bool), ((((numeric && valid) = true) -> (valid = true)) <-> (0 = 0)))), + proof: decide{} +} + +theorem{ + name: settlementOldReservationsFact, + parameters: [ledger : Ledger], + statement: ((((ledgerValid ledger) = true) -> ((reservationsValid (project ledger reservations) (project (project ledger budget) epoch)) = true)) <-> (0 = 0)), + proof: simplify{definitions: [reservationLedgerParts, settlementValidityProjection]}, + axioms: [propext] +} + +theorem{ + name: settlementListGateFact, + parameters: [], + statement: (forall (known : Bool), (forall (valid : Bool), (forall (epochMatches : Bool), (forall (lowerBound : Bool), (forall (upperBound : Bool), (forall (recorded : Bool), (forall (beforeList : Bool), (forall (afterList : Bool), (((valid = true) -> (beforeList = true)) -> (((beforeList = true) -> ((recorded = true) -> (afterList = true))) -> ((((known && (valid && (epochMatches && (lowerBound && (upperBound && recorded))))) = true) -> (afterList = true)) <-> (0 = 0)))))))))))), + proof: decide{} +} + +theorem{ + name: settlementNumericGateFact, + parameters: [], + statement: (forall (known : Bool), (forall (valid : Bool), (forall (epochMatches : Bool), (forall (lowerBound : Bool), (forall (upperBound : Bool), (forall (recorded : Bool), (forall (within : Bool), (forall (candidate : Bool), (((recorded = true) -> (within = true)) -> (((valid = true) -> ((lowerBound = true) -> ((upperBound = true) -> ((within = true) -> (candidate = true))))) -> ((((known && (valid && (epochMatches && (lowerBound && (upperBound && recorded))))) = true) -> (candidate = true)) <-> (0 = 0)))))))))))), + proof: decide{} +} + +theorem{ + name: settlementCandidateNumericTransferFact, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((((ledgerValid ledger) = true) -> ((((project (project ledger budget) last) <=? now) = true) -> (((now (((resourcesAtMost (addResources (spentTotal (recordSettlement (project ledger reservations) observation)) (reservedTotal (recordSettlement (project ledger reservations) observation))) (addResources (spentTotal (project ledger reservations)) (reservedTotal (project ledger reservations)))) = true) -> ((reservationNumericValidity (settlementCandidate ledger observation now)) = true))))) <-> (0 = 0)), + proof: constructor{ + branches: [ + linear_arithmetic{}, + linear_arithmetic{ + definitions: [ + addResources, + budgetValid, + ledgerBudget, + ledgerValid, + reservationNumericValidity, + resourcesAtMost, + resourcesWithin, + sameResources, + settlementCandidate, + zeroResources + ] + } + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: settlementCandidateClock, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((project (project (settlementCandidate ledger observation now) budget) last) = now), + proof: reflexivity{} +} + +theorem{ + name: settleLedgerClockFact, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((((settleLedgerAllowed ledger observation now) = true) -> ((project (project (settleLedger ledger observation now) budget) last) = now)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + reservationLedgerClockSelect, + reservationSelectedClockFact, + settleLedger, + settlementCandidateClock + ] + }, + axioms: [propext] +} + +definition{ + name: settlementImplies, + parameters: [guard : Bool, candidate : Bool], + result: Bool, + body: ((not guard) || candidate) +} + +theorem{ + name: settlementImplicationObserved, + parameters: [], + statement: (forall (guard : Bool), (forall (candidate : Bool), (((guard = true) -> (candidate = true)) <-> ((settlementImplies guard candidate) = true)))), + proof: decide{} +} + +theorem{ + name: settlementListGateBooleanFact, + parameters: [], + statement: (forall (known : Bool), (forall (valid : Bool), (forall (epochMatches : Bool), (forall (lowerBound : Bool), (forall (upperBound : Bool), (forall (recorded : Bool), (forall (beforeList : Bool), (forall (afterList : Bool), ((((valid = true) -> (beforeList = true)) -> (((beforeList = true) -> ((recorded = true) -> (afterList = true))) -> ((settlementImplies (known && (valid && (epochMatches && (lowerBound && (upperBound && recorded))))) afterList) = true))) <-> (0 = 0)))))))))), + proof: decide{} +} + +theorem{ + name: settlementNumericGateBooleanFact, + parameters: [], + statement: (forall (known : Bool), (forall (valid : Bool), (forall (epochMatches : Bool), (forall (lowerBound : Bool), (forall (upperBound : Bool), (forall (recorded : Bool), (forall (within : Bool), (forall (candidate : Bool), ((((recorded = true) -> (within = true)) -> (((valid = true) -> ((lowerBound = true) -> ((upperBound = true) -> ((within = true) -> (candidate = true))))) -> ((settlementImplies (known && (valid && (epochMatches && (lowerBound && (upperBound && recorded))))) candidate) = true))) <-> (0 = 0)))))))))), + proof: decide{} +} + +theorem{ + name: settlementListDomainGate, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((((ledgerValid ledger) = true) -> ((reservationsValid (project ledger reservations) (project (project ledger budget) epoch)) = true)) -> ((((reservationsValid (project ledger reservations) (project (project ledger budget) epoch)) = true) -> (((settlementRecorded (project ledger reservations) observation) = true) -> ((reservationsValid (recordSettlement (project ledger reservations) observation) (project (project ledger budget) epoch)) = true))) -> ((settlementImplies (settleLedgerAllowed ledger observation now) (reservationsValid (project (settlementCandidate ledger observation now) reservations) (project (project (settlementCandidate ledger observation now) budget) epoch))) = true))), + proof: simplify{ + definitions: [ + ledgerBudget, + settleLedgerAllowed, + settlementCandidate, + settlementListGateBooleanFact + ] + }, + axioms: [propext] +} + +theorem{ + name: settlementNumericDomainGate, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((((settlementRecorded (project ledger reservations) observation) = true) -> ((resourcesAtMost (addResources (spentTotal (recordSettlement (project ledger reservations) observation)) (reservedTotal (recordSettlement (project ledger reservations) observation))) (addResources (spentTotal (project ledger reservations)) (reservedTotal (project ledger reservations)))) = true)) -> ((((ledgerValid ledger) = true) -> ((((project (project ledger budget) last) <=? now) = true) -> (((now (((resourcesAtMost (addResources (spentTotal (recordSettlement (project ledger reservations) observation)) (reservedTotal (recordSettlement (project ledger reservations) observation))) (addResources (spentTotal (project ledger reservations)) (reservedTotal (project ledger reservations)))) = true) -> ((reservationNumericValidity (settlementCandidate ledger observation now)) = true))))) -> ((settlementImplies (settleLedgerAllowed ledger observation now) (reservationNumericValidity (settlementCandidate ledger observation now))) = true))), + proof: simplify{definitions: [settleLedgerAllowed, settlementNumericGateBooleanFact]}, + axioms: [propext] +} + +theorem{ + name: settlementCandidateListBoolean, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((settlementImplies (settleLedgerAllowed ledger observation now) (reservationsValid (project (settlementCandidate ledger observation now) reservations) (project (project (settlementCandidate ledger observation now) budget) epoch))) = true), + proof: simplify{ + definitions: [ + settlementListDomainGate, + settlementOldReservationsFact, + settlementReservationValidityFact + ] + }, + axioms: [propext] +} + +theorem{ + name: settlementCandidateNumericBoolean, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((settlementImplies (settleLedgerAllowed ledger observation now) (reservationNumericValidity (settlementCandidate ledger observation now))) = true), + proof: simplify{ + definitions: [ + settlementCandidateNumericTransferFact, + settlementCannotIncreaseLedgerChargeFact, + settlementNumericDomainGate + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: settlementCandidateListGuarantee, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((((settleLedgerAllowed ledger observation now) = true) -> ((reservationsValid (project (settlementCandidate ledger observation now) reservations) (project (project (settlementCandidate ledger observation now) budget) epoch)) = true)) <-> (0 = 0)), + proof: simplify{definitions: [settlementCandidateListBoolean, settlementImplicationObserved]}, + axioms: [propext] +} + +theorem{ + name: settlementCandidateNumericGuarantee, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((((settleLedgerAllowed ledger observation now) = true) -> ((reservationNumericValidity (settlementCandidate ledger observation now)) = true)) <-> (0 = 0)), + proof: simplify{definitions: [settlementCandidateNumericBoolean, settlementImplicationObserved]}, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: settlementCandidateGuarantee, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((((settleLedgerAllowed ledger observation now) = true) -> ((ledgerValid (settlementCandidate ledger observation now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + reservationConjunctionClosure, + reservationLedgerParts, + settlementCandidateListGuarantee, + settlementCandidateNumericGuarantee + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: settleLedgerPreservesValidity, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: (((ledgerValid ledger) = true) -> ((ledgerValid (settleLedger ledger observation now)) = true)), + proof: simplify{ + definitions: [ + ledgerValiditySelect, + reservationSelectedSafety, + settleLedger, + settlementCandidateGuarantee + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: settleLedgerPreservesValidityFact, + parameters: [ledger : Ledger, observation : SettlementObservation, now : Nat], + statement: ((((ledgerValid ledger) = true) -> ((ledgerValid (settleLedger ledger observation now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + ledgerValiditySelect, + reservationSelectedSafety, + settleLedger, + settlementCandidateGuarantee + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/ChannelFlow.lex.tex b/app/src/Stitch/ChannelFlow.lex.tex new file mode 100644 index 0000000..3eef613 --- /dev/null +++ b/app/src/Stitch/ChannelFlow.lex.tex @@ -0,0 +1,42 @@ +\begin{lexlean}{Stitch.ChannelFlow} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\title{Stitch recoverable service model} +\begin{semanticmodule} +definition{ + name: queueAllowed, + parameters: [entries : Nat, retained : Nat, bytes : Nat], + result: Bool, + body: ((entries accumulated + | Nat.succ rest => (if (exponent =? 0) then accumulated else (naturalPower rest (prim multiply base base : Nat) (prim quotient exponent 2 0 : Nat) (if ((prim remainder exponent 2 0 : Nat) =? 1) then (prim multiply accumulated base : Nat) else accumulated)))), + recursive_argument: fuel +} + +definition{ + name: ringModulus, + parameters: [bits : Nat], + result: Nat, + body: (naturalPower bits 2 bits 1) +} + +definition{ + name: normalize, + parameters: [value : Nat, modulus : Nat], + result: Nat, + body: (prim remainder value modulus 0 : Nat) +} + +definition{ + name: bitwiseAcc, + parameters: [fuel : Nat, opcode : Nat, left : Nat, right : Nat, place : Nat, accumulated : Nat], + result: Nat, + body: (match fuel + | Nat.zero => accumulated + | Nat.succ rest => (if ((left =? 0) && (right =? 0)) then accumulated else (let lowLeft : Nat := (prim remainder left 2 0 : Nat); (let lowRight : Nat := (prim remainder right 2 0 : Nat); (let low : Nat := (if (opcode =? 7) then (if (lowLeft =? lowRight) then 0 else 1) else (if (opcode =? 8) then (prim multiply lowLeft lowRight : Nat) else (if ((lowLeft + lowRight) =? 0) then 0 else 1))); (bitwiseAcc rest opcode (prim quotient left 2 0 : Nat) (prim quotient right 2 0 : Nat) (prim multiply place 2 : Nat) (accumulated + (prim multiply low place : Nat)))))))), + recursive_argument: fuel +} + +definition{ + name: natBitwise, + parameters: [fuel : Nat, opcode : Nat, left : Nat, right : Nat], + result: Nat, + body: (bitwiseAcc fuel opcode left right 1 0) +} + +definition{ + name: binaryLengthAcc, + parameters: [fuel : Nat, value : Nat, accumulated : Nat], + result: Nat, + body: (match fuel + | Nat.zero => accumulated + | Nat.succ rest => (if (value =? 0) then accumulated else (binaryLengthAcc rest (prim quotient value 2 0 : Nat) (accumulated + 1)))), + recursive_argument: fuel +} + +definition{ + name: binaryLength, + parameters: [fuel : Nat, value : Nat], + result: Nat, + body: (binaryLengthAcc fuel value 0) +} + +definition{ + name: ringPow, + parameters: [fuel : Nat, base : Nat, exponent : Nat, modulus : Nat, accumulated : Nat], + result: Nat, + body: (match fuel + | Nat.zero => (normalize accumulated modulus) + | Nat.succ rest => (if (exponent =? 0) then (normalize accumulated modulus) else (ringPow rest (normalize (prim multiply base base : Nat) modulus) (prim quotient exponent 2 0 : Nat) modulus (if ((prim remainder exponent 2 0 : Nat) =? 1) then (normalize (prim multiply accumulated base : Nat) modulus) else accumulated)))), + recursive_argument: fuel +} + +definition{ + name: powerWorkAcc, + parameters: [fuel : Nat, exponent : Nat, accumulated : Nat], + result: Nat, + body: (match fuel + | Nat.zero => accumulated + | Nat.succ rest => (if (exponent =? 0) then accumulated else (powerWorkAcc rest (prim quotient exponent 2 0 : Nat) (accumulated + (1 + (prim remainder exponent 2 0 : Nat)))))), + recursive_argument: fuel +} + +definition{ + name: powerWork, + parameters: [fuel : Nat, exponent : Nat], + result: Nat, + body: (powerWorkAcc fuel exponent 0) +} + +definition{ + name: instructionWork, + parameters: [instruction : Instruction, bits : Nat], + result: Nat, + body: (if ((project instruction opcode) =? 17) then (1 + (powerWork bits (project instruction argument))) else 1) +} + +theorem{ + name: zeroExponentIsRingUnit, + parameters: [fuel : Nat, base : Nat, modulus : Nat], + statement: ((ringPow fuel base 0 modulus 1) = (normalize 1 modulus)), + proof: induction{ + branches: [ + {proof: linear_arithmetic{definitions: [ringPow]}, binders: [], constructor: zero}, + { + proof: linear_arithmetic{definitions: [ringPow]}, + binders: [rest, hypothesis], + constructor: succ + } + ], + scrutinee: fuel + }, + axioms: [propext] +} + +theorem{ + name: zeroExponentCostsNoMultiplications, + parameters: [fuel : Nat], + statement: ((powerWork fuel 0) = 0), + proof: induction{ + branches: [ + { + proof: linear_arithmetic{definitions: [powerWork, powerWorkAcc]}, + binders: [], + constructor: zero + }, + { + proof: linear_arithmetic{definitions: [powerWork, powerWorkAcc]}, + binders: [rest, hypothesis], + constructor: succ + } + ], + scrutinee: fuel + }, + axioms: [propext] +} + +definition{ + name: ringStep, + parameters: [instruction : Instruction, value : Nat, modulus : Nat], + result: Nat, + body: (let x : Nat := (normalize value modulus); (let y : Nat := (normalize (project instruction argument) modulus); (let op : Nat := (project instruction opcode); (normalize (if (op =? 0) then (prim subtract modulus x : Nat) else (if (op =? 1) then (prim subtract (prim subtract modulus 1 : Nat) x : Nat) else (if (op =? 2) then (x + 1) else (if (op =? 3) then (prim subtract (x + modulus) 1 : Nat) else (if (op =? 4) then (x + y) else (if (op =? 5) then (prim subtract (x + modulus) y : Nat) else (if (op =? 6) then (prim multiply x y : Nat) else (if (op =? 7) then (natBitwise modulus 7 x y) else (if (op =? 8) then (natBitwise modulus 8 x y) else (if (op =? 9) then (natBitwise modulus 9 x y) else (if (op =? 10) then (if (x <=? y) then 1 else 0) else (if (op =? 11) then (if (x value + | List.cons head tail => (execute tail (ringStep head value modulus) modulus)), + recursive_argument: instructions +} + +definition{ + name: appendProgram, + parameters: [prefix : (List Instruction), suffix : (List Instruction)], + result: (List Instruction), + body: (match prefix + | List.nil => suffix + | List.cons head tail => (cons head (appendProgram tail suffix))), + recursive_argument: prefix +} + +definition{ + name: checkpointLinkAllowed, + parameters: [ + jobMatches : Bool, + programMatches : Bool, + inputMatches : Bool, + modelMatches : Bool, + predecessorMatches : Bool, + replayMatches : Bool, + currentStep : Nat, + nextStep : Nat, + programLength : Nat + ], + result: Bool, + body: (replayMatches && (jobMatches && (programMatches && (inputMatches && (modelMatches && (predecessorMatches && ((currentStep (currentStep < nextStep)), + proof: linear_arithmetic{definitions: [checkpointLinkAllowed]}, + axioms: [Quot.sound, propext] +} + +definition{ + name: supportedWidth, + parameters: [bits : Nat], + result: Bool, + body: ((bits =? 8) || ((bits =? 16) || ((bits =? 32) || ((bits =? 64) || (bits =? 128))))) +} + +definition{ + name: instructionsAllowed, + parameters: [instructions : (List Instruction)], + result: Bool, + body: (match instructions + | List.nil => true + | List.cons head tail => ((instructionAllowed (project head opcode)) && (instructionsAllowed tail))), + recursive_argument: instructions +} + +definition{ + name: instructionCount, + parameters: [instructions : (List Instruction)], + result: Nat, + body: (match instructions | List.nil => 0 | List.cons head tail => (1 + (instructionCount tail))), + recursive_argument: instructions +} + +definition{ + name: sameInstruction, + parameters: [left : Instruction, right : Instruction], + result: Bool, + body: (((project left opcode) =? (project right opcode)) && ((project left argument) =? (project right argument))) +} + +definition{ + name: sameInstructions, + parameters: [left : (List Instruction), right : (List Instruction)], + result: Bool, + body: (match left + | List.nil => (match right | List.nil => true | List.cons head tail => false) + | List.cons head tail => (match right + | List.nil => false + | List.cons other rest => ((sameInstruction head other) && (sameInstructions tail rest)))), + recursive_argument: left +} + +definition{ + name: instructionWellFormed, + parameters: [instruction : Instruction, modulus : Nat], + result: Bool, + body: ((instructionAllowed (project instruction opcode)) && (if ((project instruction opcode) <=? 3) then ((project instruction argument) =? 0) else ((project instruction argument) true + | List.cons head tail => ((instructionWellFormed head modulus) && (instructionsWellFormed tail modulus))), + recursive_argument: instructions +} + +definition{ + name: programAllowed, + parameters: [program : Program, maximumSteps : Nat], + result: Bool, + body: ((supportedWidth (project program bits)) && ((Stitch.Identity::digestWellFormed (project program programRoot)) && ((Stitch.Identity::digestWellFormed (project program modelRoot)) && ((instructionsWellFormed (project program instructions) (ringModulus (project program bits))) && ((instructionCount (project program instructions)) <=? maximumSteps))))) +} + +definition{ + name: takeSteps, + parameters: [instructions : (List Instruction), count : Nat], + result: (List Instruction), + body: (match count + | Nat.zero => (nil Instruction) + | Nat.succ rest => (match instructions + | List.nil => (nil Instruction) + | List.cons head tail => (cons head (takeSteps tail rest)))), + recursive_argument: count +} + +definition{ + name: replayedValue, + parameters: [job : Job, checkpoint : Checkpoint], + result: Nat, + body: (execute (takeSteps (project (project job program) instructions) (project checkpoint step)) (project job initialValue) (ringModulus (project (project job program) bits))) +} + +definition{ + name: jobAllowed, + parameters: [job : Job, maximumSteps : Nat], + result: Bool, + body: ((programAllowed (project job program) maximumSteps) && ((Stitch.Identity::digestWellFormed (project job jobRoot)) && ((Stitch.Identity::digestWellFormed (project job inputRoot)) && ((project job initialValue) ((project checkpoint value) = (replayedValue job checkpoint))), + proof: linear_arithmetic{definitions: [checkpointMatchesJob]}, + axioms: [Quot.sound, propext] +} + +structure{ + name: ProgramDigestInput, + type_parameters: [], + parameters: [], + fields: [ + {name: version, type: Nat}, + {name: modelRoot, type: Stitch.Identity::Digest}, + {name: bits, type: Nat}, + {name: instructions, type: (List Instruction)} + ] +} + +structure{ + name: ProgramDigestObservation, + type_parameters: [], + parameters: [], + fields: [ + {name: input, type: ProgramDigestInput}, + {name: digest, type: Stitch.Identity::DigestObservation} + ] +} + +structure{ + name: InputDigestInput, + type_parameters: [], + parameters: [], + fields: [{name: version, type: Nat}, {name: bits, type: Nat}, {name: value, type: Nat}] +} + +structure{ + name: InputDigestObservation, + type_parameters: [], + parameters: [], + fields: [ + {name: input, type: InputDigestInput}, + {name: digest, type: Stitch.Identity::DigestObservation} + ] +} + +structure{ + name: JobDigestInput, + type_parameters: [], + parameters: [], + fields: [ + {name: version, type: Nat}, + {name: programRoot, type: Stitch.Identity::Digest}, + {name: inputRoot, type: Stitch.Identity::Digest}, + {name: modelRoot, type: Stitch.Identity::Digest}, + {name: initialValue, type: Nat} + ] +} + +structure{ + name: JobDigestObservation, + type_parameters: [], + parameters: [], + fields: [ + {name: input, type: JobDigestInput}, + {name: digest, type: Stitch.Identity::DigestObservation} + ] +} + +structure{ + name: StateDigestInput, + type_parameters: [], + parameters: [], + fields: [ + {name: version, type: Nat}, + {name: jobRoot, type: Stitch.Identity::Digest}, + {name: programRoot, type: Stitch.Identity::Digest}, + {name: inputRoot, type: Stitch.Identity::Digest}, + {name: modelRoot, type: Stitch.Identity::Digest}, + {name: bits, type: Nat}, + {name: step, type: Nat}, + {name: value, type: Nat} + ] +} + +structure{ + name: StateDigestObservation, + type_parameters: [], + parameters: [], + fields: [ + {name: input, type: StateDigestInput}, + {name: digest, type: Stitch.Identity::DigestObservation} + ] +} + +structure{ + name: CheckpointDigestInput, + type_parameters: [], + parameters: [], + fields: [ + {name: version, type: Nat}, + {name: jobRoot, type: Stitch.Identity::Digest}, + {name: programRoot, type: Stitch.Identity::Digest}, + {name: inputRoot, type: Stitch.Identity::Digest}, + {name: modelRoot, type: Stitch.Identity::Digest}, + {name: step, type: Nat}, + {name: priorRoot, type: Stitch.Identity::Digest}, + {name: stateRoot, type: Stitch.Identity::Digest}, + {name: value, type: Nat} + ] +} + +structure{ + name: CheckpointDigestObservation, + type_parameters: [], + parameters: [], + fields: [ + {name: input, type: CheckpointDigestInput}, + {name: digest, type: Stitch.Identity::DigestObservation} + ] +} + +structure{ + name: JobCommitments, + type_parameters: [], + parameters: [], + fields: [ + {name: program, type: ProgramDigestObservation}, + {name: input, type: InputDigestObservation}, + {name: job, type: JobDigestObservation} + ] +} + +structure{ + name: CheckpointCommitments, + type_parameters: [], + parameters: [], + fields: [ + {name: state, type: StateDigestObservation}, + {name: checkpoint, type: CheckpointDigestObservation} + ] +} + +definition{ + name: programCommitted, + parameters: [program : Program, observation : ProgramDigestObservation, maximumSteps : Nat], + result: Bool, + body: ((programAllowed program maximumSteps) && (((project (project observation input) version) =? 1) && ((Stitch.Identity::sameDigest (project (project observation input) modelRoot) (project program modelRoot)) && (((project (project observation input) bits) =? (project program bits)) && ((sameInstructions (project (project observation input) instructions) (project program instructions)) && ((Stitch.Identity::digestAccepted (project observation digest)) && (Stitch.Identity::sameDigest (project (project observation digest) expected) (project program programRoot)))))))) +} + +definition{ + name: inputCommitted, + parameters: [job : Job, observation : InputDigestObservation], + result: Bool, + body: (((project (project observation input) version) =? 1) && (((project (project observation input) bits) =? (project (project job program) bits)) && (((project (project observation input) value) =? (project job initialValue)) && ((Stitch.Identity::digestAccepted (project observation digest)) && (Stitch.Identity::sameDigest (project (project observation digest) expected) (project job inputRoot)))))) +} + +definition{ + name: jobCommitted, + parameters: [ + job : Job, + commitments : JobCommitments, + maximumSteps : Nat, + expectedModelRoot : Stitch.Identity::Digest + ], + result: Bool, + body: ((Stitch.Identity::digestWellFormed expectedModelRoot) && ((Stitch.Identity::sameDigest (project (project job program) modelRoot) expectedModelRoot) && ((jobAllowed job maximumSteps) && ((programCommitted (project job program) (project commitments program) maximumSteps) && ((inputCommitted job (project commitments input)) && (((project (project (project commitments job) input) version) =? 1) && ((Stitch.Identity::sameDigest (project (project (project commitments job) input) programRoot) (project (project job program) programRoot)) && ((Stitch.Identity::sameDigest (project (project (project commitments job) input) inputRoot) (project job inputRoot)) && ((Stitch.Identity::sameDigest (project (project (project commitments job) input) modelRoot) (project (project job program) modelRoot)) && (((project (project (project commitments job) input) initialValue) =? (project job initialValue)) && ((Stitch.Identity::digestAccepted (project (project commitments job) digest)) && (Stitch.Identity::sameDigest (project (project (project commitments job) digest) expected) (project job jobRoot))))))))))))) +} + +definition{ + name: stateCommitted, + parameters: [job : Job, checkpoint : Checkpoint, observation : StateDigestObservation], + result: Bool, + body: (((project (project observation input) version) =? 1) && ((Stitch.Identity::sameDigest (project (project observation input) jobRoot) (project checkpoint jobRoot)) && ((Stitch.Identity::sameDigest (project (project observation input) programRoot) (project checkpoint programRoot)) && ((Stitch.Identity::sameDigest (project (project observation input) inputRoot) (project checkpoint inputRoot)) && ((Stitch.Identity::sameDigest (project (project observation input) modelRoot) (project checkpoint modelRoot)) && (((project (project observation input) bits) =? (project (project job program) bits)) && (((project (project observation input) step) =? (project checkpoint step)) && (((project (project observation input) value) =? (project checkpoint value)) && ((Stitch.Identity::digestAccepted (project observation digest)) && (Stitch.Identity::sameDigest (project (project observation digest) expected) (project checkpoint stateRoot))))))))))) +} + +definition{ + name: checkpointCommitted, + parameters: [checkpoint : Checkpoint, observation : CheckpointDigestObservation], + result: Bool, + body: (((project (project observation input) version) =? 1) && ((Stitch.Identity::sameDigest (project (project observation input) jobRoot) (project checkpoint jobRoot)) && ((Stitch.Identity::sameDigest (project (project observation input) programRoot) (project checkpoint programRoot)) && ((Stitch.Identity::sameDigest (project (project observation input) inputRoot) (project checkpoint inputRoot)) && ((Stitch.Identity::sameDigest (project (project observation input) modelRoot) (project checkpoint modelRoot)) && ((Stitch.Identity::sameDigest (project (project observation input) priorRoot) (project checkpoint priorRoot)) && ((Stitch.Identity::sameDigest (project (project observation input) stateRoot) (project checkpoint stateRoot)) && (((project (project observation input) step) =? (project checkpoint step)) && (((project (project observation input) value) =? (project checkpoint value)) && ((Stitch.Identity::digestAccepted (project observation digest)) && (Stitch.Identity::sameDigest (project (project observation digest) expected) (project checkpoint checkpointRoot)))))))))))) +} + +definition{ + name: committedCheckpointAllowed, + parameters: [ + job : Job, + checkpoint : Checkpoint, + jobCommitments : JobCommitments, + checkpointCommitments : CheckpointCommitments, + maximumSteps : Nat, + expectedModelRoot : Stitch.Identity::Digest + ], + result: Bool, + body: ((jobCommitted job jobCommitments maximumSteps expectedModelRoot) && ((checkpointMatchesJob job checkpoint) && ((stateCommitted job checkpoint (project checkpointCommitments state)) && (checkpointCommitted checkpoint (project checkpointCommitments checkpoint))))) +} + +definition{ + name: committedCheckpointSuccessor, + parameters: [ + job : Job, + current : Checkpoint, + candidate : Checkpoint, + jobCommitments : JobCommitments, + currentCommitments : CheckpointCommitments, + candidateCommitments : CheckpointCommitments, + maximumSteps : Nat, + expectedModelRoot : Stitch.Identity::Digest + ], + result: Bool, + body: ((committedCheckpointAllowed job current jobCommitments currentCommitments maximumSteps expectedModelRoot) && ((committedCheckpointAllowed job candidate jobCommitments candidateCommitments maximumSteps expectedModelRoot) && (checkpointSuccessor job current candidate))) +} + +definition{ + name: advanceCheckpoint, + parameters: [ + job : Job, + current : Checkpoint, + candidate : Checkpoint, + jobCommitments : JobCommitments, + currentCommitments : CheckpointCommitments, + candidateCommitments : CheckpointCommitments, + maximumSteps : Nat, + expectedModelRoot : Stitch.Identity::Digest + ], + result: Checkpoint, + body: (if (committedCheckpointSuccessor job current candidate jobCommitments currentCommitments candidateCommitments maximumSteps expectedModelRoot) then candidate else current) +} + +theorem{ + name: committedCheckpointReplays, + parameters: [ + job : Job, + checkpoint : Checkpoint, + jobCommitments : JobCommitments, + checkpointCommitments : CheckpointCommitments, + maximumSteps : Nat, + expectedModelRoot : Stitch.Identity::Digest + ], + statement: (((committedCheckpointAllowed job checkpoint jobCommitments checkpointCommitments maximumSteps expectedModelRoot) = true) -> ((project checkpoint value) = (replayedValue job checkpoint))), + proof: linear_arithmetic{definitions: [checkpointMatchesJob, committedCheckpointAllowed]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: mismatchedStateValueRejected, + parameters: [job : Job, checkpoint : Checkpoint, observation : StateDigestObservation], + statement: (((project (project observation input) value) < (project checkpoint value)) -> ((stateCommitted job checkpoint observation) = false)), + proof: linear_arithmetic{definitions: [stateCommitted]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: unsupportedWidthCannotCommit, + parameters: [program : Program, observation : ProgramDigestObservation, maximumSteps : Nat], + statement: (((project program bits) = 24) -> ((programCommitted program observation maximumSteps) = false)), + proof: linear_arithmetic{definitions: [programAllowed, programCommitted, supportedWidth]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: checkpointTransitionNeverRollsBack, + parameters: [ + job : Job, + current : Checkpoint, + candidate : Checkpoint, + jobCommitments : JobCommitments, + currentCommitments : CheckpointCommitments, + candidateCommitments : CheckpointCommitments, + maximumSteps : Nat, + expectedModelRoot : Stitch.Identity::Digest + ], + statement: ((project current step) <= (project (advanceCheckpoint job current candidate jobCommitments currentCommitments candidateCommitments maximumSteps expectedModelRoot) step)), + proof: linear_arithmetic{ + definitions: [advanceCheckpoint, checkpointSuccessor, committedCheckpointSuccessor] + }, + axioms: [Quot.sound, propext] +} + +structure{ + name: Word, + type_parameters: [], + parameters: [], + fields: [{name: bits, type: Nat}, {name: value, type: Nat}] +} + +structure{ + name: TypedInstruction, + type_parameters: [], + parameters: [], + fields: [{name: opcode, type: Nat}, {name: argument, type: Nat}, {name: argumentBits, type: Nat}] +} + +definition{ + name: byteWidth, + parameters: [bits : Nat], + result: Bool, + body: ((prim remainder bits 8 0 : Nat) =? 0) +} + +definition{ + name: wordAllowed, + parameters: [word : Word], + result: Bool, + body: ((byteWidth (project word bits)) && ((project word value) ((byteWidth bits) && (bits <=? capacityBits)) + | List.cons head tail => ((typedInstructionAllowed head bits capacityBits) && (typedProgramAllowed tail (typedResultBits head bits) capacityBits))), + recursive_argument: instructions +} + +definition{ + name: concatWords, + parameters: [left : Word, right : Word], + result: Word, + body: (record Word {bits := ((project left bits) + (project right bits)), value := ((prim multiply (project left value) (ringModulus (project right bits)) : Nat) + (project right value))}) +} + +definition{ + name: typedStep, + parameters: [instruction : TypedInstruction, word : Word], + result: Word, + body: (if ((project instruction opcode) =? 14) then (concatWords word (record Word {bits := (project instruction argumentBits), value := (project instruction argument)})) else (record Word {bits := (typedResultBits instruction (project word bits)), value := (ringStep (record Instruction {opcode := (project instruction opcode), argument := (project instruction argument)}) (project word value) (ringModulus (arithmeticWidth (project word bits) (project instruction argumentBits))))})) +} + +definition{ + name: typedInstructionWork, + parameters: [instruction : TypedInstruction, bits : Nat], + result: Nat, + body: (let width : Nat := (arithmeticWidth bits (project instruction argumentBits)); (let limbs : Nat := (prim quotient (width + 63) 64 0 : Nat); (let productWork : Nat := (prim multiply limbs limbs : Nat); (if ((project instruction opcode) =? 14) then (1 + (prim quotient (bits + (project instruction argumentBits)) 8 0 : Nat)) else (if ((project instruction opcode) =? 17) then (1 + (prim multiply productWork (powerWork width (project instruction argument)) : Nat)) else (if (((project instruction opcode) =? 6) || ((15 <=? (project instruction opcode)) && ((project instruction opcode) <=? 16))) then (1 + productWork) else (if ((7 <=? (project instruction opcode)) && ((project instruction opcode) <=? 9)) then (1 + width) else (1 + limbs)))))))) +} + +definition{ + name: typedProgramWorkAcc, + parameters: [instructions : (List TypedInstruction), bits : Nat, accumulated : Nat], + result: Nat, + body: (match instructions + | List.nil => accumulated + | List.cons head tail => (typedProgramWorkAcc tail (typedResultBits head bits) (accumulated + (typedInstructionWork head bits)))), + recursive_argument: instructions +} + +definition{ + name: typedProgramWork, + parameters: [instructions : (List TypedInstruction), bits : Nat], + result: Nat, + body: (typedProgramWorkAcc instructions bits 0) +} + +definition{ + name: typedExecute, + parameters: [instructions : (List TypedInstruction), word : Word], + result: Word, + body: (match instructions + | List.nil => word + | List.cons head tail => (typedExecute tail (typedStep head word))), + recursive_argument: instructions +} + +definition{ + name: appendTypedProgram, + parameters: [prefix : (List TypedInstruction), suffix : (List TypedInstruction)], + result: (List TypedInstruction), + body: (match prefix + | List.nil => suffix + | List.cons head tail => (cons head (appendTypedProgram tail suffix))), + recursive_argument: prefix +} + +theorem{ + name: concatPreservesDeclaredWidth, + parameters: [left : Word, right : Word], + statement: ((project (concatWords left right) bits) = ((project left bits) + (project right bits))), + proof: reflexivity{} +} + +theorem{ + name: concatIsBigEndianAppend, + parameters: [left : Word, right : Word], + statement: ((project (concatWords left right) value) = ((prim multiply (project left value) (ringModulus (project right bits)) : Nat) + (project right value))), + proof: reflexivity{} +} + +theorem{ + name: typedResumeEqualsUninterrupted, + parameters: [prefix : (List TypedInstruction), suffix : (List TypedInstruction), word : Word], + statement: ((typedExecute (appendTypedProgram prefix suffix) word) = (typedExecute suffix (typedExecute prefix word))), + proof: induction{ + branches: [ + { + proof: simplify{definitions: [appendTypedProgram, typedExecute]}, + binders: [], + constructor: nil + }, + { + proof: simplify{definitions: [appendTypedProgram, hypothesis, typedExecute]}, + binders: [head, tail, hypothesis], + constructor: cons + } + ], + generalizing: [word], + scrutinee: prefix + }, + axioms: [propext] +} + +theorem{ + name: concatCapacityCannotTruncate, + parameters: [argument : Nat, argumentBits : Nat, bits : Nat, capacityBits : Nat], + statement: ((capacityBits < (bits + argumentBits)) -> ((typedInstructionAllowed (record TypedInstruction {opcode := 14, argument := argument, argumentBits := argumentBits}) bits capacityBits) = false)), + proof: linear_arithmetic{ + definitions: [typedInstructionAdmission, typedInstructionAllowed, typedResultBits] + }, + axioms: [Quot.sound, propext] +} + +theorem{ + name: typedAdmissionBoundsDeclaredWidth, + parameters: [instruction : TypedInstruction, bits : Nat, capacityBits : Nat, resultBits : Nat], + statement: (((typedInstructionAdmission instruction bits capacityBits resultBits) = true) -> (resultBits <= capacityBits)), + proof: linear_arithmetic{definitions: [typedInstructionAdmission]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: typedAdmissionBoundsResultWidth, + parameters: [instruction : TypedInstruction, bits : Nat, capacityBits : Nat], + statement: (((typedInstructionAllowed instruction bits capacityBits) = true) -> ((typedResultBits instruction bits) <= capacityBits)), + proof: apply{ + arguments: [instruction, bits, capacityBits, (typedResultBits instruction bits)], + theorem: typedAdmissionBoundsDeclaredWidth + }, + axioms: [Quot.sound, propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/Custody.lex.tex b/app/src/Stitch/Custody.lex.tex new file mode 100644 index 0000000..ff2ce46 --- /dev/null +++ b/app/src/Stitch/Custody.lex.tex @@ -0,0 +1,986 @@ +\begin{lexlean}{Stitch.Custody} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\importmodule{Stitch.Identity} +\importmodule{Stitch.Fragments} +\title{Stitch recoverable service model} +\begin{semanticmodule} +inductive{ + name: TransferPhase, + type_parameters: [], + parameters: [], + constructors: [ + {name: Requested, fields: []}, + {name: Acknowledged, fields: []}, + {name: Committed, fields: []}, + {name: Failed, fields: []}, + {name: Uncertain, fields: []} + ] +} + +structure{ + name: Receipt, + type_parameters: [], + parameters: [], + fields: [ + {name: requestRoot, type: Stitch.Identity::Digest}, + {name: manifestRoot, type: Stitch.Identity::Digest}, + {name: fragmentRoot, type: Stitch.Identity::Digest}, + {name: holderId, type: Nat}, + {name: index, type: Nat}, + {name: observedAt, type: Nat}, + {name: leaseUntil, type: Nat}, + {name: identityAuthenticated, type: Bool} + ] +} + +structure{ + name: Transfer, + type_parameters: [], + parameters: [], + fields: [ + {name: requestRoot, type: Stitch.Identity::Digest}, + {name: manifestRoot, type: Stitch.Identity::Digest}, + {name: fragmentRoot, type: Stitch.Identity::Digest}, + {name: sourceHolder, type: Nat}, + {name: targetHolder, type: Nat}, + {name: index, type: Nat}, + {name: placementRevision, type: Nat}, + {name: phase, type: TransferPhase}, + {name: receipt, type: Receipt} + ] +} + +structure{ + name: Placement, + type_parameters: [], + parameters: [], + fields: [ + {name: manifestRoot, type: Stitch.Identity::Digest}, + {name: revision, type: Nat}, + {name: holder0, type: Nat}, + {name: holder1, type: Nat}, + {name: holder2, type: Nat}, + {name: active0, type: Bool}, + {name: active1, type: Bool}, + {name: active2, type: Bool}, + {name: receipt0, type: Receipt}, + {name: receipt1, type: Receipt}, + {name: receipt2, type: Receipt} + ] +} + +definition{ + name: distinctHolders, + parameters: [a : Nat, b : Nat, c : Nat], + result: Bool, + body: ((not (a =? b)) && ((not (a =? c)) && (not (b =? c)))) +} + +definition{ + name: activeCount, + parameters: [placement : Placement], + result: Nat, + body: ((if (project placement active0) then 1 else 0) + ((if (project placement active1) then 1 else 0) + (if (project placement active2) then 1 else 0))) +} + +definition{ + name: activeThreshold, + parameters: [a : Bool, b : Bool, c : Bool], + result: Bool, + body: (2 <=? ((if a then 1 else 0) + ((if b then 1 else 0) + (if c then 1 else 0)))) +} + +definition{ + name: recoverable, + parameters: [placement : Placement], + result: Bool, + body: ((distinctHolders (project placement holder0) (project placement holder1) (project placement holder2)) && (activeThreshold (project placement active0) (project placement active1) (project placement active2))) +} + +definition{ + name: receiptLive, + parameters: [ + manifestRoot : Stitch.Identity::Digest, + index : Nat, + holder : Nat, + receipt : Receipt, + now : Nat + ], + result: Bool, + body: ((index (record Transfer {requestRoot := (project transfer requestRoot), manifestRoot := (project transfer manifestRoot), fragmentRoot := (project transfer fragmentRoot), sourceHolder := (project transfer sourceHolder), targetHolder := (project transfer targetHolder), index := (project transfer index), placementRevision := (project transfer placementRevision), phase := (if uncertain then (ctor TransferPhase.Uncertain) else (ctor TransferPhase.Failed)), receipt := (project transfer receipt)}) + | TransferPhase.Acknowledged => (record Transfer {requestRoot := (project transfer requestRoot), manifestRoot := (project transfer manifestRoot), fragmentRoot := (project transfer fragmentRoot), sourceHolder := (project transfer sourceHolder), targetHolder := (project transfer targetHolder), index := (project transfer index), placementRevision := (project transfer placementRevision), phase := (if uncertain then (ctor TransferPhase.Uncertain) else (ctor TransferPhase.Failed)), receipt := (project transfer receipt)}) + | TransferPhase.Committed => transfer + | TransferPhase.Failed => transfer + | TransferPhase.Uncertain => transfer) +} + +theorem{ + name: unacknowledgedCannotCommit, + parameters: [ + requested : Bool, + manifestMatches : Bool, + fragmentMatches : Bool, + holderMatches : Bool, + leaseLive : Bool, + sourceCurrent : Bool, + targetDistinct : Bool + ], + statement: ((commitAllowed requested false manifestMatches fragmentMatches holderMatches leaseLive sourceCurrent targetDistinct) = false), + proof: reflexivity{} +} + +theorem{ + name: uncommittedCannotRetire, + parameters: [remainingDistinctIndices : Nat, threshold : Nat], + statement: ((retireAllowed false remainingDistinctIndices threshold) = false), + proof: reflexivity{} +} + +theorem{ + name: retirementPreservesThreshold, + parameters: [targetCommitted : Bool, remainingDistinctIndices : Nat, threshold : Nat], + statement: (((retireAllowed targetCommitted remainingDistinctIndices threshold) = true) -> (threshold <= remainingDistinctIndices)), + proof: linear_arithmetic{definitions: [retireAllowed]}, + axioms: [Quot.sound, propext] +} + +definition{ + name: replaceFirst, + parameters: [placement : Placement, target : Nat, committed : Bool], + result: Placement, + body: (record Placement {manifestRoot := (project placement manifestRoot), revision := (if (committed && ((not (target =? (project placement holder1))) && (not (target =? (project placement holder2))))) then ((project placement revision) + 1) else (project placement revision)), holder0 := (if (committed && ((not (target =? (project placement holder1))) && (not (target =? (project placement holder2))))) then target else (project placement holder0)), holder1 := (project placement holder1), holder2 := (project placement holder2), active0 := ((committed && ((not (target =? (project placement holder1))) && (not (target =? (project placement holder2))))) || (project placement active0)), active1 := (project placement active1), active2 := (project placement active2), receipt0 := (project placement receipt0), receipt1 := (project placement receipt1), receipt2 := (project placement receipt2)}) +} + +definition{ + name: retireFirst, + parameters: [placement : Placement], + result: Placement, + body: (record Placement {manifestRoot := (project placement manifestRoot), revision := (if ((project placement active1) && (project placement active2)) then ((project placement revision) + 1) else (project placement revision)), holder0 := (project placement holder0), holder1 := (project placement holder1), holder2 := (project placement holder2), active0 := ((project placement active0) && (not ((project placement active1) && (project placement active2)))), active1 := (project placement active1), active2 := (project placement active2), receipt0 := (project placement receipt0), receipt1 := (project placement receipt1), receipt2 := (project placement receipt2)}) +} + +theorem{ + name: conjunctionPreservationFact, + parameters: [], + statement: (forall (p : Bool), (forall (q : Bool), (forall (r : Bool), (forall (s : Bool), (((p = true) -> (r = true)) -> (((q = true) -> (s = true)) -> ((((p && q) = true) -> ((r && s) = true)) <-> (0 = 0)))))))), + proof: decide{} +} + +theorem{ + name: booleanSelfPreservationFact, + parameters: [], + statement: (forall (p : Bool), (((p = true) -> (p = true)) <-> (0 = 0))), + proof: decide{} +} + +theorem{ + name: activeFirstPreservationFact, + parameters: [], + statement: (forall (a : Bool), (forall (b : Bool), (forall (c : Bool), (forall (g : Bool), ((((activeThreshold a b c) = true) -> ((activeThreshold (g || a) b c) = true)) <-> (0 = 0)))))), + proof: decide{} +} + +theorem{ + name: activeRetirementPreservationFact, + parameters: [], + statement: (forall (a : Bool), (forall (b : Bool), (forall (c : Bool), ((((activeThreshold a b c) = true) -> ((activeThreshold (a && (not (b && c))) b c) = true)) <-> (0 = 0))))), + proof: decide{} +} + +theorem{ + name: activeIndexedPreservationFact, + parameters: [], + statement: (forall (a : Bool), (forall (b : Bool), (forall (c : Bool), (forall (g0 : Bool), (forall (g1 : Bool), (forall (g2 : Bool), ((((activeThreshold a b c) = true) -> ((activeThreshold (g0 || a) (g1 || b) (g2 || c)) = true)) <-> (0 = 0)))))))), + proof: decide{} +} + +theorem{ + name: distinctFirstPreservationFact, + parameters: [h0 : Nat, h1 : Nat, h2 : Nat, target : Nat, committed : Bool], + statement: ((((distinctHolders h0 h1 h2) = true) -> ((distinctHolders (if (committed && ((not (target =? h1)) && (not (target =? h2)))) then target else h0) h1 h2) = true)) <-> (0 = 0)), + proof: constructor{ + branches: [ + linear_arithmetic{definitions: [distinctHolders]}, + linear_arithmetic{definitions: [distinctHolders]} + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: committedMigrationPreservesRecovery, + parameters: [placement : Placement, target : Nat, committed : Bool], + statement: (((recoverable placement) = true) -> ((recoverable (replaceFirst placement target committed)) = true)), + proof: simplify{ + definitions: [ + activeFirstPreservationFact, + conjunctionPreservationFact, + distinctFirstPreservationFact, + recoverable, + replaceFirst + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: committedMigrationPreservesRecoveryFact, + parameters: [placement : Placement, target : Nat, committed : Bool], + statement: ((((recoverable placement) = true) -> ((recoverable (replaceFirst placement target committed)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + activeFirstPreservationFact, + conjunctionPreservationFact, + distinctFirstPreservationFact, + recoverable, + replaceFirst + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: retirementPreservesRecovery, + parameters: [placement : Placement], + statement: (((recoverable placement) = true) -> ((recoverable (retireFirst placement)) = true)), + proof: simplify{ + definitions: [ + activeRetirementPreservationFact, + booleanSelfPreservationFact, + conjunctionPreservationFact, + recoverable, + retireFirst + ] + }, + axioms: [propext] +} + +theorem{ + name: retirementPreservesRecoveryFact, + parameters: [placement : Placement], + statement: ((((recoverable placement) = true) -> ((recoverable (retireFirst placement)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + activeRetirementPreservationFact, + booleanSelfPreservationFact, + conjunctionPreservationFact, + recoverable, + retireFirst + ] + }, + axioms: [propext] +} + +definition{ + name: replaceIndex, + parameters: [placement : Placement, index : Nat, target : Nat, committed : Bool], + result: Placement, + body: (record Placement {manifestRoot := (project placement manifestRoot), revision := (if (((index =? 0) && (committed && ((not (target =? (project placement holder1))) && (not (target =? (project placement holder2)))))) || (((index =? 1) && (committed && ((not (target =? (project placement holder0))) && (not (target =? (project placement holder2)))))) || ((index =? 2) && (committed && ((not (target =? (project placement holder0))) && (not (target =? (project placement holder1)))))))) then ((project placement revision) + 1) else (project placement revision)), holder0 := (if ((index =? 0) && (committed && ((not (target =? (project placement holder1))) && (not (target =? (project placement holder2)))))) then target else (project placement holder0)), holder1 := (if ((index =? 1) && (committed && ((not (target =? (project placement holder0))) && (not (target =? (project placement holder2)))))) then target else (project placement holder1)), holder2 := (if ((index =? 2) && (committed && ((not (target =? (project placement holder0))) && (not (target =? (project placement holder1)))))) then target else (project placement holder2)), active0 := (((index =? 0) && (committed && ((not (target =? (project placement holder1))) && (not (target =? (project placement holder2)))))) || (project placement active0)), active1 := (((index =? 1) && (committed && ((not (target =? (project placement holder0))) && (not (target =? (project placement holder2)))))) || (project placement active1)), active2 := (((index =? 2) && (committed && ((not (target =? (project placement holder0))) && (not (target =? (project placement holder1)))))) || (project placement active2)), receipt0 := (project placement receipt0), receipt1 := (project placement receipt1), receipt2 := (project placement receipt2)}) +} + +theorem{ + name: distinctIndexedPreservationFact, + parameters: [h0 : Nat, h1 : Nat, h2 : Nat, index : Nat, target : Nat, committed : Bool], + statement: ((((distinctHolders h0 h1 h2) = true) -> ((distinctHolders (if ((index =? 0) && (committed && ((not (target =? h1)) && (not (target =? h2))))) then target else h0) (if ((index =? 1) && (committed && ((not (target =? h0)) && (not (target =? h2))))) then target else h1) (if ((index =? 2) && (committed && ((not (target =? h0)) && (not (target =? h1))))) then target else h2)) = true)) <-> (0 = 0)), + proof: constructor{ + branches: [ + linear_arithmetic{definitions: [distinctHolders]}, + linear_arithmetic{definitions: [distinctHolders]} + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: indexedMigrationPreservesRecovery, + parameters: [placement : Placement, index : Nat, target : Nat, committed : Bool], + statement: (((recoverable placement) = true) -> ((recoverable (replaceIndex placement index target committed)) = true)), + proof: simplify{ + definitions: [ + activeIndexedPreservationFact, + conjunctionPreservationFact, + distinctIndexedPreservationFact, + recoverable, + replaceIndex + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: indexedMigrationPreservesRecoveryFact, + parameters: [placement : Placement, index : Nat, target : Nat, committed : Bool], + statement: ((((recoverable placement) = true) -> ((recoverable (replaceIndex placement index target committed)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + activeIndexedPreservationFact, + conjunctionPreservationFact, + distinctIndexedPreservationFact, + recoverable, + replaceIndex + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +definition{ + name: acknowledgeTransfer, + parameters: [transfer : Transfer, receipt : Receipt, now : Nat], + result: Transfer, + body: (match (project transfer phase) + | TransferPhase.Requested => (if (receiptBound transfer receipt now) then (record Transfer {requestRoot := (project transfer requestRoot), manifestRoot := (project transfer manifestRoot), fragmentRoot := (project transfer fragmentRoot), sourceHolder := (project transfer sourceHolder), targetHolder := (project transfer targetHolder), index := (project transfer index), placementRevision := (project transfer placementRevision), phase := (ctor TransferPhase.Acknowledged), receipt := receipt}) else transfer) + | TransferPhase.Acknowledged => transfer + | TransferPhase.Committed => transfer + | TransferPhase.Failed => transfer + | TransferPhase.Uncertain => transfer) +} + +definition{ + name: commitTransfer, + parameters: [ + transfer : Transfer, + now : Nat, + fragmentVerified : Bool, + sourceCurrent : Bool, + targetDistinct : Bool + ], + result: Transfer, + body: (match (project transfer phase) + | TransferPhase.Requested => transfer + | TransferPhase.Acknowledged => (if ((receiptBound transfer (project transfer receipt) now) && (fragmentVerified && (sourceCurrent && targetDistinct))) then (record Transfer {requestRoot := (project transfer requestRoot), manifestRoot := (project transfer manifestRoot), fragmentRoot := (project transfer fragmentRoot), sourceHolder := (project transfer sourceHolder), targetHolder := (project transfer targetHolder), index := (project transfer index), placementRevision := (project transfer placementRevision), phase := (ctor TransferPhase.Committed), receipt := (project transfer receipt)}) else transfer) + | TransferPhase.Committed => transfer + | TransferPhase.Failed => transfer + | TransferPhase.Uncertain => transfer) +} + +structure{ + name: PhysicalCopy, + type_parameters: [], + parameters: [], + fields: [ + {name: index, type: Nat}, + {name: holder, type: Nat}, + {name: byteLength, type: Nat}, + {name: retained, type: Bool}, + {name: superseded, type: Bool}, + {name: externalRelay, type: Bool}, + {name: manifestRoot, type: Stitch.Identity::Digest}, + {name: fragmentRoot, type: Stitch.Identity::Digest}, + {name: receipt, type: Receipt} + ] +} + +definition{ + name: physicalCopyLive, + parameters: [copy : PhysicalCopy, now : Nat], + result: Bool, + body: ((project copy retained) && ((not (project copy superseded)) && ((Stitch.Identity::sameDigest (project copy fragmentRoot) (project (project copy receipt) fragmentRoot)) && (receiptLive (project copy manifestRoot) (project copy index) (project copy holder) (project copy receipt) now)))) +} + +definition{ + name: physicalBytes, + parameters: [copies : (List PhysicalCopy)], + result: Nat, + body: (match copies + | List.nil => 0 + | List.cons head tail => ((if (project head retained) then (project head byteLength) else 0) + (physicalBytes tail))), + recursive_argument: copies +} + +definition{ + name: requestedPhase, + parameters: [transfer : Transfer], + result: Bool, + body: (match (project transfer phase) + | TransferPhase.Requested => true + | TransferPhase.Acknowledged => false + | TransferPhase.Committed => false + | TransferPhase.Failed => false + | TransferPhase.Uncertain => false) +} + +definition{ + name: committedPhase, + parameters: [transfer : Transfer], + result: Bool, + body: (match (project transfer phase) + | TransferPhase.Requested => false + | TransferPhase.Acknowledged => false + | TransferPhase.Committed => true + | TransferPhase.Failed => false + | TransferPhase.Uncertain => false) +} + +definition{ + name: sameRequest, + parameters: [left : Transfer, right : Transfer], + result: Bool, + body: ((Stitch.Identity::sameDigest (project left requestRoot) (project right requestRoot)) && ((Stitch.Identity::sameDigest (project left manifestRoot) (project right manifestRoot)) && ((Stitch.Identity::sameDigest (project left fragmentRoot) (project right fragmentRoot)) && (((project left sourceHolder) =? (project right sourceHolder)) && (((project left targetHolder) =? (project right targetHolder)) && (((project left index) =? (project right index)) && ((project left placementRevision) =? (project right placementRevision)))))))) +} + +definition{ + name: requestWellFormed, + parameters: [transfer : Transfer], + result: Bool, + body: ((Stitch.Identity::digestWellFormed (project transfer requestRoot)) && ((Stitch.Identity::digestWellFormed (project transfer manifestRoot)) && ((Stitch.Identity::digestWellFormed (project transfer fragmentRoot)) && ((project transfer index) true + | List.cons head tail => ((not (Stitch.Identity::sameDigest (project head requestRoot) requestRoot)) && (requestUnused tail requestRoot))), + recursive_argument: transfers +} + +definition{ + name: requestRecorded, + parameters: [transfers : (List Transfer), transfer : Transfer], + result: Bool, + body: (match transfers + | List.nil => false + | List.cons head tail => (((sameRequest head transfer) && (requestedPhase head)) || (requestRecorded tail transfer))), + recursive_argument: transfers +} + +definition{ + name: recordCompletion, + parameters: [transfers : (List Transfer), completed : Transfer], + result: (List Transfer), + body: (match transfers + | List.nil => (nil Transfer) + | List.cons head tail => (cons (if (Stitch.Identity::sameDigest (project head requestRoot) (project completed requestRoot)) then completed else head) (recordCompletion tail completed))), + recursive_argument: transfers +} + +definition{ + name: sourcePlaced, + parameters: [placement : Placement, transfer : Transfer], + result: Bool, + body: ((Stitch.Identity::sameDigest (project placement manifestRoot) (project transfer manifestRoot)) && (((project placement revision) =? (project transfer placementRevision)) && (if ((project transfer index) =? 0) then ((project placement active0) && (((project transfer sourceHolder) =? (project placement holder0)) && ((not ((project transfer targetHolder) =? (project placement holder0))) && ((not ((project transfer targetHolder) =? (project placement holder1))) && (not ((project transfer targetHolder) =? (project placement holder2))))))) else (if ((project transfer index) =? 1) then ((project placement active1) && (((project transfer sourceHolder) =? (project placement holder1)) && ((not ((project transfer targetHolder) =? (project placement holder0))) && ((not ((project transfer targetHolder) =? (project placement holder1))) && (not ((project transfer targetHolder) =? (project placement holder2))))))) else (if ((project transfer index) =? 2) then ((project placement active2) && (((project transfer sourceHolder) =? (project placement holder2)) && ((not ((project transfer targetHolder) =? (project placement holder0))) && ((not ((project transfer targetHolder) =? (project placement holder1))) && (not ((project transfer targetHolder) =? (project placement holder2))))))) else false))))) +} + +definition{ + name: sourceLive, + parameters: [placement : Placement, transfer : Transfer, now : Nat], + result: Bool, + body: ((sourcePlaced placement transfer) && (if ((project transfer index) =? 0) then ((Stitch.Identity::sameDigest (project transfer fragmentRoot) (project (project placement receipt0) fragmentRoot)) && (receiptLive (project placement manifestRoot) 0 (project placement holder0) (project placement receipt0) now)) else (if ((project transfer index) =? 1) then ((Stitch.Identity::sameDigest (project transfer fragmentRoot) (project (project placement receipt1) fragmentRoot)) && (receiptLive (project placement manifestRoot) 1 (project placement holder1) (project placement receipt1) now)) else (if ((project transfer index) =? 2) then ((Stitch.Identity::sameDigest (project transfer fragmentRoot) (project (project placement receipt2) fragmentRoot)) && (receiptLive (project placement manifestRoot) 2 (project placement holder2) (project placement receipt2) now)) else false)))) +} + +definition{ + name: fragmentBound, + parameters: [transfer : Transfer, fragment : Stitch.Fragments::Fragment], + result: Bool, + body: ((Stitch.Identity::sameDigest (project transfer manifestRoot) (project fragment manifestRoot)) && ((Stitch.Identity::sameDigest (project transfer fragmentRoot) (project fragment payloadRoot)) && ((project transfer index) =? (project fragment index)))) +} + +structure{ + name: FragmentIntegrityObservation, + type_parameters: [], + parameters: [], + fields: [ + {name: fragmentRoot, type: Stitch.Identity::Digest}, + {name: encodingRoot, type: Stitch.Identity::Digest}, + {name: index, type: Nat}, + {name: payload, type: Bytes}, + {name: digest, type: Stitch.Identity::DigestObservation} + ] +} + +definition{ + name: fragmentIntegrityAccepted, + parameters: [ + transfer : Transfer, + fragment : Stitch.Fragments::Fragment, + observation : FragmentIntegrityObservation + ], + result: Bool, + body: ((fragmentBound transfer fragment) && ((Stitch.Identity::digestAccepted (project observation digest)) && ((Stitch.Identity::sameDigest (project transfer fragmentRoot) (project observation fragmentRoot)) && ((Stitch.Identity::sameDigest (project observation fragmentRoot) (project (project observation digest) expected)) && ((Stitch.Identity::sameDigest (project fragment encodingRoot) (project observation encodingRoot)) && (((project fragment index) =? (project observation index)) && (prim equal (project fragment payload) (project observation payload) : Bool))))))) +} + +definition{ + name: prepareCompletion, + parameters: [ + placement : Placement, + transfer : Transfer, + receipt : Receipt, + fragment : Stitch.Fragments::Fragment, + integrity : FragmentIntegrityObservation, + now : Nat + ], + result: Transfer, + body: (commitTransfer (acknowledgeTransfer transfer receipt now) now (fragmentIntegrityAccepted transfer fragment integrity) (sourceLive placement transfer now) (not ((project transfer sourceHolder) =? (project transfer targetHolder)))) +} + +theorem{ + name: indexedCopyLiveZero, + parameters: [placement : Placement, now : Nat], + statement: ((indexedCopyLive placement 0 now) = ((project placement active0) && (receiptLive (project placement manifestRoot) 0 (project placement holder0) (project placement receipt0) now))), + proof: reflexivity{} +} + +theorem{ + name: indexedCopyLiveOne, + parameters: [placement : Placement, now : Nat], + statement: ((indexedCopyLive placement 1 now) = ((project placement active1) && (receiptLive (project placement manifestRoot) 1 (project placement holder1) (project placement receipt1) now))), + proof: reflexivity{} +} + +theorem{ + name: indexedCopyLiveTwo, + parameters: [placement : Placement, now : Nat], + statement: ((indexedCopyLive placement 2 now) = ((project placement active2) && (receiptLive (project placement manifestRoot) 2 (project placement holder2) (project placement receipt2) now))), + proof: reflexivity{} +} + +definition{ + name: choosePlacement, + parameters: [selection : Stitch.Fragments::Bit, yes : Placement, no : Placement], + result: Placement, + body: (match selection | Stitch.Fragments::Bit.Zero => no | Stitch.Fragments::Bit.One => yes) +} + +definition{ + name: chooseTruth, + parameters: [selection : Stitch.Fragments::Bit, yes : Bool, no : Bool], + result: Bool, + body: (match selection | Stitch.Fragments::Bit.Zero => no | Stitch.Fragments::Bit.One => yes) +} + +definition{ + name: selectionOfTruth, + parameters: [value : Bool], + result: Stitch.Fragments::Bit, + body: (if value then (ctor Stitch.Fragments::Bit.One) else (ctor Stitch.Fragments::Bit.Zero)) +} + +definition{ + name: selectPlacement, + parameters: [guard : Bool, yes : Placement, no : Placement], + result: Placement, + body: (choosePlacement (selectionOfTruth guard) yes no) +} + +definition{ + name: selectTruth, + parameters: [guard : Bool, yes : Bool, no : Bool], + result: Bool, + body: (chooseTruth (selectionOfTruth guard) yes no) +} + +theorem{ + name: recoveryOfChoice, + parameters: [selection : Stitch.Fragments::Bit, yes : Placement, no : Placement], + statement: ((recoverable (choosePlacement selection yes no)) = (chooseTruth selection (recoverable yes) (recoverable no))), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Zero}, + {proof: reflexivity{}, binders: [], constructor: One} + ], + scrutinee: selection + } +} + +theorem{ + name: liveRecoveryOfChoice, + parameters: [selection : Stitch.Fragments::Bit, yes : Placement, no : Placement, now : Nat], + statement: ((recoverableAt (choosePlacement selection yes no) now) = (chooseTruth selection (recoverableAt yes now) (recoverableAt no now))), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Zero}, + {proof: reflexivity{}, binders: [], constructor: One} + ], + scrutinee: selection + } +} + +theorem{ + name: recoveryOfSelection, + parameters: [guard : Bool, yes : Placement, no : Placement], + statement: ((recoverable (selectPlacement guard yes no)) = (selectTruth guard (recoverable yes) (recoverable no))), + proof: apply{arguments: [(selectionOfTruth guard), yes, no], theorem: recoveryOfChoice} +} + +theorem{ + name: liveRecoveryOfSelection, + parameters: [guard : Bool, yes : Placement, no : Placement, now : Nat], + statement: ((recoverableAt (selectPlacement guard yes no) now) = (selectTruth guard (recoverableAt yes now) (recoverableAt no now))), + proof: apply{arguments: [(selectionOfTruth guard), yes, no, now], theorem: liveRecoveryOfChoice} +} + +theorem{ + name: fallbackPreservationFact, + parameters: [], + statement: (forall (old : Bool), (forall (fallback : Bool), (forall (next : Bool), (forall (guard : Bool), (((old = true) -> (fallback = true)) -> (((old = true) -> ((selectTruth guard next old) = true)) -> (((old = true) -> ((selectTruth guard next fallback) = true)) <-> (0 = 0)))))))), + proof: decide{} +} + +definition{ + name: migrationBase, + parameters: [placement : Placement, completed : Transfer, index : Nat, now : Nat], + result: Bool, + body: ((committedPhase completed) && ((receiptBound completed (project completed receipt) now) && ((sourceLive placement completed now) && ((project completed index) =? index)))) +} + +definition{ + name: migrationGate0, + parameters: [placement : Placement, completed : Transfer, now : Nat], + result: Bool, + body: ((migrationBase placement completed 0 now) && ((not ((project completed targetHolder) =? (project placement holder1))) && ((not ((project completed targetHolder) =? (project placement holder2))) && (receiptLive (project placement manifestRoot) 0 (project completed targetHolder) (project completed receipt) now)))) +} + +definition{ + name: committedPlacement0, + parameters: [placement : Placement, completed : Transfer], + result: Placement, + body: (record Placement {manifestRoot := (project placement manifestRoot), revision := ((project placement revision) + 1), holder0 := (project completed targetHolder), holder1 := (project placement holder1), holder2 := (project placement holder2), active0 := true, active1 := (project placement active1), active2 := (project placement active2), receipt0 := (project completed receipt), receipt1 := (project placement receipt1), receipt2 := (project placement receipt2)}) +} + +theorem{ + name: staticGate0Preservation, + parameters: [], + statement: (forall (base : Bool), (forall (d01 : Bool), (forall (d02 : Bool), (forall (d12 : Bool), (forall (a : Bool), (forall (b : Bool), (forall (c : Bool), (forall (n1 : Bool), (forall (n2 : Bool), (forall (lease : Bool), (((((d01 && (d02 && d12)) && (activeThreshold a b c)) = true) -> ((selectTruth (base && (n1 && (n2 && lease))) ((n1 && (n2 && d12)) && (activeThreshold true b c)) ((d01 && (d02 && d12)) && (activeThreshold a b c))) = true)) <-> (0 = 0)))))))))))), + proof: decide{} +} + +theorem{ + name: liveGate0Preservation, + parameters: [], + statement: (forall (base : Bool), (forall (d01 : Bool), (forall (d02 : Bool), (forall (d12 : Bool), (forall (a : Bool), (forall (b : Bool), (forall (c : Bool), (forall (n1 : Bool), (forall (n2 : Bool), (forall (lease : Bool), (((((a && (b && d01)) || ((a && (c && d02)) || (b && (c && d12)))) = true) -> ((selectTruth (base && (n1 && (n2 && lease))) (((true && lease) && (b && n1)) || (((true && lease) && (c && n2)) || (b && (c && d12)))) ((a && (b && d01)) || ((a && (c && d02)) || (b && (c && d12))))) = true)) <-> (0 = 0)))))))))))), + proof: decide{} +} + +theorem{ + name: staticMigrationGate0Fact, + parameters: [placement : Placement, completed : Transfer, now : Nat], + statement: ((((recoverable placement) = true) -> ((selectTruth (migrationGate0 placement completed now) (recoverable (committedPlacement0 placement completed)) (recoverable placement)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + committedPlacement0, + distinctHolders, + migrationGate0, + recoverable, + staticGate0Preservation + ] + }, + axioms: [propext] +} + +theorem{ + name: liveMigrationGate0Fact, + parameters: [placement : Placement, completed : Transfer, now : Nat], + statement: ((((recoverableAt placement now) = true) -> ((selectTruth (migrationGate0 placement completed now) (recoverableAt (committedPlacement0 placement completed) now) (recoverableAt placement now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + committedPlacement0, + indexedCopyLiveOne, + indexedCopyLiveTwo, + indexedCopyLiveZero, + liveGate0Preservation, + migrationGate0, + recoverableAt + ] + }, + axioms: [propext] +} + +definition{ + name: migrationGate1, + parameters: [placement : Placement, completed : Transfer, now : Nat], + result: Bool, + body: ((migrationBase placement completed 1 now) && ((not ((project placement holder0) =? (project completed targetHolder))) && ((not ((project completed targetHolder) =? (project placement holder2))) && (receiptLive (project placement manifestRoot) 1 (project completed targetHolder) (project completed receipt) now)))) +} + +definition{ + name: committedPlacement1, + parameters: [placement : Placement, completed : Transfer], + result: Placement, + body: (record Placement {manifestRoot := (project placement manifestRoot), revision := ((project placement revision) + 1), holder0 := (project placement holder0), holder1 := (project completed targetHolder), holder2 := (project placement holder2), active0 := (project placement active0), active1 := true, active2 := (project placement active2), receipt0 := (project placement receipt0), receipt1 := (project completed receipt), receipt2 := (project placement receipt2)}) +} + +theorem{ + name: staticGate1Preservation, + parameters: [], + statement: (forall (base : Bool), (forall (d01 : Bool), (forall (d02 : Bool), (forall (d12 : Bool), (forall (a : Bool), (forall (b : Bool), (forall (c : Bool), (forall (n1 : Bool), (forall (n2 : Bool), (forall (lease : Bool), (((((d01 && (d02 && d12)) && (activeThreshold a b c)) = true) -> ((selectTruth (base && (n1 && (n2 && lease))) ((n1 && (d02 && n2)) && (activeThreshold a true c)) ((d01 && (d02 && d12)) && (activeThreshold a b c))) = true)) <-> (0 = 0)))))))))))), + proof: decide{} +} + +theorem{ + name: liveGate1Preservation, + parameters: [], + statement: (forall (base : Bool), (forall (d01 : Bool), (forall (d02 : Bool), (forall (d12 : Bool), (forall (a : Bool), (forall (b : Bool), (forall (c : Bool), (forall (n1 : Bool), (forall (n2 : Bool), (forall (lease : Bool), (((((a && (b && d01)) || ((a && (c && d02)) || (b && (c && d12)))) = true) -> ((selectTruth (base && (n1 && (n2 && lease))) ((a && ((true && lease) && n1)) || ((a && (c && d02)) || ((true && lease) && (c && n2)))) ((a && (b && d01)) || ((a && (c && d02)) || (b && (c && d12))))) = true)) <-> (0 = 0)))))))))))), + proof: decide{} +} + +theorem{ + name: staticMigrationGate1Fact, + parameters: [placement : Placement, completed : Transfer, now : Nat], + statement: ((((recoverable placement) = true) -> ((selectTruth (migrationGate1 placement completed now) (recoverable (committedPlacement1 placement completed)) (recoverable placement)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + committedPlacement1, + distinctHolders, + migrationGate1, + recoverable, + staticGate1Preservation + ] + }, + axioms: [propext] +} + +theorem{ + name: liveMigrationGate1Fact, + parameters: [placement : Placement, completed : Transfer, now : Nat], + statement: ((((recoverableAt placement now) = true) -> ((selectTruth (migrationGate1 placement completed now) (recoverableAt (committedPlacement1 placement completed) now) (recoverableAt placement now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + committedPlacement1, + indexedCopyLiveOne, + indexedCopyLiveTwo, + indexedCopyLiveZero, + liveGate1Preservation, + migrationGate1, + recoverableAt + ] + }, + axioms: [propext] +} + +definition{ + name: migrationGate2, + parameters: [placement : Placement, completed : Transfer, now : Nat], + result: Bool, + body: ((migrationBase placement completed 2 now) && ((not ((project placement holder0) =? (project completed targetHolder))) && ((not ((project placement holder1) =? (project completed targetHolder))) && (receiptLive (project placement manifestRoot) 2 (project completed targetHolder) (project completed receipt) now)))) +} + +definition{ + name: committedPlacement2, + parameters: [placement : Placement, completed : Transfer], + result: Placement, + body: (record Placement {manifestRoot := (project placement manifestRoot), revision := ((project placement revision) + 1), holder0 := (project placement holder0), holder1 := (project placement holder1), holder2 := (project completed targetHolder), active0 := (project placement active0), active1 := (project placement active1), active2 := true, receipt0 := (project placement receipt0), receipt1 := (project placement receipt1), receipt2 := (project completed receipt)}) +} + +theorem{ + name: staticGate2Preservation, + parameters: [], + statement: (forall (base : Bool), (forall (d01 : Bool), (forall (d02 : Bool), (forall (d12 : Bool), (forall (a : Bool), (forall (b : Bool), (forall (c : Bool), (forall (n1 : Bool), (forall (n2 : Bool), (forall (lease : Bool), (((((d01 && (d02 && d12)) && (activeThreshold a b c)) = true) -> ((selectTruth (base && (n1 && (n2 && lease))) ((d01 && (n1 && n2)) && (activeThreshold a b true)) ((d01 && (d02 && d12)) && (activeThreshold a b c))) = true)) <-> (0 = 0)))))))))))), + proof: decide{} +} + +theorem{ + name: liveGate2Preservation, + parameters: [], + statement: (forall (base : Bool), (forall (d01 : Bool), (forall (d02 : Bool), (forall (d12 : Bool), (forall (a : Bool), (forall (b : Bool), (forall (c : Bool), (forall (n1 : Bool), (forall (n2 : Bool), (forall (lease : Bool), (((((a && (b && d01)) || ((a && (c && d02)) || (b && (c && d12)))) = true) -> ((selectTruth (base && (n1 && (n2 && lease))) ((a && (b && d01)) || ((a && ((true && lease) && n1)) || (b && ((true && lease) && n2)))) ((a && (b && d01)) || ((a && (c && d02)) || (b && (c && d12))))) = true)) <-> (0 = 0)))))))))))), + proof: decide{} +} + +theorem{ + name: staticMigrationGate2Fact, + parameters: [placement : Placement, completed : Transfer, now : Nat], + statement: ((((recoverable placement) = true) -> ((selectTruth (migrationGate2 placement completed now) (recoverable (committedPlacement2 placement completed)) (recoverable placement)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + committedPlacement2, + distinctHolders, + migrationGate2, + recoverable, + staticGate2Preservation + ] + }, + axioms: [propext] +} + +theorem{ + name: liveMigrationGate2Fact, + parameters: [placement : Placement, completed : Transfer, now : Nat], + statement: ((((recoverableAt placement now) = true) -> ((selectTruth (migrationGate2 placement completed now) (recoverableAt (committedPlacement2 placement completed) now) (recoverableAt placement now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + committedPlacement2, + indexedCopyLiveOne, + indexedCopyLiveTwo, + indexedCopyLiveZero, + liveGate2Preservation, + migrationGate2, + recoverableAt + ] + }, + axioms: [propext] +} + +definition{ + name: migrationAllowed, + parameters: [placement : Placement, completed : Transfer, now : Nat], + result: Bool, + body: ((migrationGate0 placement completed now) || ((migrationGate1 placement completed now) || (migrationGate2 placement completed now))) +} + +definition{ + name: installReceipt, + parameters: [placement : Placement, index : Nat, receipt : Receipt], + result: Placement, + body: (record Placement {manifestRoot := (project placement manifestRoot), revision := (project placement revision), holder0 := (project placement holder0), holder1 := (project placement holder1), holder2 := (project placement holder2), active0 := (project placement active0), active1 := (project placement active1), active2 := (project placement active2), receipt0 := (if (index =? 0) then receipt else (project placement receipt0)), receipt1 := (if (index =? 1) then receipt else (project placement receipt1)), receipt2 := (if (index =? 2) then receipt else (project placement receipt2))}) +} + +definition{ + name: migrate, + parameters: [placement : Placement, completed : Transfer, now : Nat], + result: Placement, + body: (selectPlacement (migrationGate0 placement completed now) (committedPlacement0 placement completed) (selectPlacement (migrationGate1 placement completed now) (committedPlacement1 placement completed) (selectPlacement (migrationGate2 placement completed now) (committedPlacement2 placement completed) placement))) +} + +theorem{ + name: typedMigrationPreservesRecoveryFact, + parameters: [placement : Placement, completed : Transfer, now : Nat], + statement: ((((recoverable placement) = true) -> ((recoverable (migrate placement completed now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + booleanSelfPreservationFact, + fallbackPreservationFact, + migrate, + recoveryOfSelection, + staticMigrationGate0Fact, + staticMigrationGate1Fact, + staticMigrationGate2Fact + ] + }, + axioms: [propext] +} + +theorem{ + name: typedMigrationPreservesRecovery, + parameters: [placement : Placement, completed : Transfer, now : Nat], + statement: (((recoverable placement) = true) -> ((recoverable (migrate placement completed now)) = true)), + proof: simplify{definitions: [typedMigrationPreservesRecoveryFact]}, + axioms: [propext] +} + +theorem{ + name: typedMigrationPreservesLiveRecoveryAtObservationTimeFact, + parameters: [placement : Placement, completed : Transfer, now : Nat], + statement: ((((recoverableAt placement now) = true) -> ((recoverableAt (migrate placement completed now) now) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + booleanSelfPreservationFact, + fallbackPreservationFact, + liveMigrationGate0Fact, + liveMigrationGate1Fact, + liveMigrationGate2Fact, + liveRecoveryOfSelection, + migrate + ] + }, + axioms: [propext] +} + +theorem{ + name: typedMigrationPreservesLiveRecoveryAtObservationTime, + parameters: [placement : Placement, completed : Transfer, now : Nat], + statement: (((recoverableAt placement now) = true) -> ((recoverableAt (migrate placement completed now) now) = true)), + proof: simplify{definitions: [typedMigrationPreservesLiveRecoveryAtObservationTimeFact]}, + axioms: [propext] +} + +theorem{ + name: expiredReceiptDoesNotCountAsLive, + parameters: [ + manifestRoot : Stitch.Identity::Digest, + index : Nat, + holder : Nat, + receipt : Receipt, + now : Nat + ], + statement: (((project receipt leaseUntil) <= now) -> ((receiptLive manifestRoot index holder receipt now) = false)), + proof: linear_arithmetic{definitions: [receiptLive]}, + axioms: [Quot.sound, propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/Effects.lex.tex b/app/src/Stitch/Effects.lex.tex new file mode 100644 index 0000000..a4f961e --- /dev/null +++ b/app/src/Stitch/Effects.lex.tex @@ -0,0 +1,676 @@ +\begin{lexlean}{Stitch.Effects} + +\useglossary{lexlean.std.bool@1.2.0} + +\useglossary{lexlean.std.nat@1.2.0} + +\useglossary{stitch.domain@1.0.0} + +\title{Stitch recoverable service model} + +\begin{semanticmodule} +structure{ + name: Transport, + type_parameters: [], + parameters: [], + fields: [ + {name: generation, type: Nat}, + {name: closed, type: Bool}, + {name: channelKey, type: Bytes}, + {name: localPeer, type: Bytes} + ] +} + +structure{ + name: TransportCallback, + type_parameters: [], + parameters: [], + fields: [ + {name: generation, type: Nat}, + {name: channelKey, type: Bytes}, + {name: localPeer, type: Bytes}, + {name: remotePeer, type: Bytes} + ] +} + +definition{ + name: transportCanSend, + parameters: [state : Transport], + result: Bool, + body: (not (project state closed)) +} + +definition{ + name: transportClose, + parameters: [state : Transport], + result: Transport, + body: (record Transport {generation := ((project state generation) + 1), closed := true, channelKey := (project state channelKey), localPeer := (project state localPeer)}) +} + +definition{ + name: transportOpen, + parameters: [state : Transport, channelKey : Bytes], + result: Transport, + body: (record Transport {generation := (project state generation), closed := false, channelKey := channelKey, localPeer := (project state localPeer)}) +} + +definition{ + name: transportSessionMatches, + parameters: [state : Transport, callback : TransportCallback], + result: Bool, + body: ((transportCanSend state) && (((project state generation) =? (project callback generation)) && ((prim equal (project state channelKey) (project callback channelKey) : Bool) && (prim equal (project state localPeer) (project callback localPeer) : Bool)))) +} + +definition{ + name: transportPeerCallbackAllowed, + parameters: [ + state : Transport, + callback : TransportCallback, + remotePeer : Bytes, + entryCurrent : Bool + ], + result: Bool, + body: ((transportSessionMatches state callback) && ((prim equal (project callback remotePeer) remotePeer : Bool) && entryCurrent)) +} + +definition{ + name: transportChannelCallbackAllowed, + parameters: [ + state : Transport, + callback : TransportCallback, + remotePeer : Bytes, + entryCurrent : Bool, + channelCurrent : Bool + ], + result: Bool, + body: ((transportPeerCallbackAllowed state callback remotePeer entryCurrent) && channelCurrent) +} + +definition{ + name: transportSignalAllowed, + parameters: [ + state : Transport, + channelKey : Bytes, + remotePeer : Bytes, + targetPeer : Bytes, + broadcast : Bool + ], + result: Bool, + body: ((transportCanSend state) && ((prim equal (project state channelKey) channelKey : Bool) && ((not (prim equal (project state localPeer) remotePeer : Bool)) && (broadcast || (prim equal (project state localPeer) targetPeer : Bool))))) +} + +definition{ + name: transportPeerAllocationAllowed, + parameters: [state : Transport, peerCount : Nat, maxPeers : Nat], + result: Bool, + body: ((transportCanSend state) && (peerCount true + | DnsPhase.Published => true + | DnsPhase.Refused => true + | DnsPhase.Unknown => false) +} + +definition{ + name: dnsMayReconcile, + parameters: [phase : DnsPhase], + result: Bool, + body: (not (dnsMayWritePhase phase)) +} + +definition{ + name: dnsRequestAllowed, + parameters: [state : DnsPublication, candidate : DnsCandidate, busy : Bool], + result: Bool, + body: ((not busy) && ((dnsScopeMatches (project state scope) (project candidate scope)) && ((dnsMayWritePhase (project state phase)) || (prim equal (project state pointerDigest) (project candidate pointerDigest) : Bool)))) +} + +definition{ + name: dnsSelectRead, + parameters: [ + phase : DnsPhase, + exactCandidate : Bool, + recordPresent : Bool, + predecessor : Bool, + bootstrap : Bool, + live : Bool + ], + result: DnsDecision, + body: (if exactCandidate then (ctor DnsDecision.Reconciled) else (if (dnsMayReconcile phase) then (ctor DnsDecision.Wait) else (if live then (if recordPresent then (if predecessor then (ctor DnsDecision.Update) else (ctor DnsDecision.Refuse)) else (if bootstrap then (ctor DnsDecision.Create) else (ctor DnsDecision.Refuse))) else (ctor DnsDecision.Refuse)))) +} + +definition{ + name: dnsDecisionWrites, + parameters: [decision : DnsDecision], + result: Bool, + body: (match decision + | DnsDecision.Refuse => false + | DnsDecision.Reconciled => false + | DnsDecision.Wait => false + | DnsDecision.Create => true + | DnsDecision.Update => true) +} + +theorem{ + name: unknownReadNeverWrites, + parameters: [], + statement: (forall (exactCandidate : Bool), (forall (recordPresent : Bool), (forall (predecessor : Bool), (forall (bootstrap : Bool), (forall (live : Bool), ((dnsDecisionWrites (dnsSelectRead (ctor DnsPhase.Unknown) exactCandidate recordPresent predecessor bootstrap live)) = false)))))), + proof: decide{} +} + +definition{ + name: dnsSelectGatedRead, + parameters: [ + admitted : Bool, + phase : DnsPhase, + exactCandidate : Bool, + recordPresent : Bool, + predecessor : Bool, + bootstrap : Bool, + live : Bool + ], + result: DnsDecision, + body: (if admitted then (dnsSelectRead phase exactCandidate recordPresent predecessor bootstrap live) else (ctor DnsDecision.Refuse)) +} + +theorem{ + name: unknownGatedReadNeverWrites, + parameters: [], + statement: (forall (admitted : Bool), (forall (exactCandidate : Bool), (forall (recordPresent : Bool), (forall (predecessor : Bool), (forall (bootstrap : Bool), (forall (live : Bool), ((dnsDecisionWrites (dnsSelectGatedRead admitted (ctor DnsPhase.Unknown) exactCandidate recordPresent predecessor bootstrap live)) = false))))))), + proof: decide{} +} + +definition{ + name: dnsReadDecision, + parameters: [state : DnsPublication, candidate : DnsCandidate, observation : DnsRead, now : Nat], + result: DnsDecision, + body: (dnsSelectGatedRead ((dnsRequestAllowed state candidate false) && ((dnsScopeMatches (project candidate scope) (project observation scope)) && ((prim equal (project candidate pointerDigest) (project observation candidateDigest) : Bool) && ((project observation complete) && (((not (project observation recordPresent)) || (project observation authenticated)) && ((not (project state hasRecordId)) || ((project observation recordPresent) && (prim equal (project state recordId) (project observation recordId) : Bool)))))))) (project state phase) ((project observation recordPresent) && (prim equal (project observation pointerDigest) (project candidate pointerDigest) : Bool)) (project observation recordPresent) ((project candidate hasPrevious) && ((prim equal (project observation pointerDigest) (project candidate previousDigest) : Bool) && (((project observation revision) + 1) =? (project candidate revision)))) ((not (project state hasRecordId)) && ((not (project candidate hasPrevious)) && ((project candidate revision) =? 0))) (((project candidate validFrom) <=? now) && (now state + | DnsDecision.Reconciled => (record DnsPublication {scope := (project state scope), phase := (ctor DnsPhase.Published), pointerDigest := (project candidate pointerDigest), recordId := (project observation recordId), hasRecordId := true}) + | DnsDecision.Wait => state + | DnsDecision.Create => state + | DnsDecision.Update => state) +} + +definition{ + name: dnsBeginWrite, + parameters: [state : DnsPublication, candidate : DnsCandidate, observation : DnsRead, now : Nat], + result: DnsPublication, + body: (match (dnsReadDecision state candidate observation now) + | DnsDecision.Refuse => state + | DnsDecision.Reconciled => state + | DnsDecision.Wait => state + | DnsDecision.Create => (record DnsPublication {scope := (project state scope), phase := (ctor DnsPhase.Unknown), pointerDigest := (project candidate pointerDigest), recordId := (project observation recordId), hasRecordId := (project observation recordPresent)}) + | DnsDecision.Update => (record DnsPublication {scope := (project state scope), phase := (ctor DnsPhase.Unknown), pointerDigest := (project candidate pointerDigest), recordId := (project observation recordId), hasRecordId := (project observation recordPresent)})) +} + +definition{ + name: dnsFinishWrite, + parameters: [state : DnsPublication, result : DnsWriteResult], + result: DnsPublication, + body: (if ((dnsMayReconcile (project state phase)) && ((dnsScopeMatches (project state scope) (project result scope)) && (prim equal (project state pointerDigest) (project result candidateDigest) : Bool))) then (record DnsPublication {scope := (project state scope), phase := (if (project result refused) then (if (project result acknowledged) then (ctor DnsPhase.Unknown) else (ctor DnsPhase.Refused)) else (if ((project result acknowledged) && ((project result recordIdValid) && ((not (project state hasRecordId)) || (prim equal (project state recordId) (project result recordId) : Bool)))) then (ctor DnsPhase.Published) else (ctor DnsPhase.Unknown))), pointerDigest := (project state pointerDigest), recordId := (if ((not (project result refused)) && ((project result acknowledged) && ((project result recordIdValid) && ((not (project state hasRecordId)) || (prim equal (project state recordId) (project result recordId) : Bool))))) then (project result recordId) else (project state recordId)), hasRecordId := ((project state hasRecordId) || ((not (project result refused)) && ((project result acknowledged) && ((project result recordIdValid) && ((not (project state hasRecordId)) || (prim equal (project state recordId) (project result recordId) : Bool))))))}) else state) +} + +theorem{ + name: unknownCannotAuthorizeWrite, + parameters: [], + statement: ((dnsMayWritePhase (ctor DnsPhase.Unknown)) = false), + proof: decide{} +} + +theorem{ + name: unknownOffersReconciliation, + parameters: [], + statement: ((dnsMayReconcile (ctor DnsPhase.Unknown)) = true), + proof: decide{} +} + +inductive{ + name: VmPhase, + type_parameters: [], + parameters: [], + constructors: [ + {name: Idle, fields: []}, + {name: Booting, fields: []}, + {name: Ready, fields: []}, + {name: Failed, fields: []} + ] +} + +structure{ + name: Vm, + type_parameters: [], + parameters: [], + fields: [{name: generation, type: Nat}, {name: phase, type: VmPhase}] +} + +definition{ + name: vmCanBoot, + parameters: [state : Vm], + result: Bool, + body: (match (project state phase) + | VmPhase.Idle => true + | VmPhase.Booting => false + | VmPhase.Ready => false + | VmPhase.Failed => true) +} + +definition{ + name: vmIsBooting, + parameters: [state : Vm], + result: Bool, + body: (match (project state phase) + | VmPhase.Idle => false + | VmPhase.Booting => true + | VmPhase.Ready => false + | VmPhase.Failed => false) +} + +definition{ + name: vmCanExecute, + parameters: [state : Vm], + result: Bool, + body: (match (project state phase) + | VmPhase.Idle => false + | VmPhase.Booting => false + | VmPhase.Ready => true + | VmPhase.Failed => false) +} + +definition{ + name: vmStart, + parameters: [state : Vm], + result: Vm, + body: (if (vmCanBoot state) then (record Vm {generation := ((project state generation) + 1), phase := (ctor VmPhase.Booting)}) else state) +} + +definition{ + name: vmCallbackAllowed, + parameters: [state : Vm, generation : Nat, instanceCurrent : Bool], + result: Bool, + body: (((project state generation) =? generation) && (instanceCurrent && ((vmIsBooting state) || (vmCanExecute state)))) +} + +definition{ + name: vmFailAllowed, + parameters: [state : Vm, generation : Nat], + result: Bool, + body: (((project state generation) =? generation) && (vmIsBooting state)) +} + +definition{ + name: vmFail, + parameters: [state : Vm, generation : Nat], + result: Vm, + body: (if (vmFailAllowed state generation) then (record Vm {generation := ((project state generation) + 1), phase := (ctor VmPhase.Failed)}) else state) +} + +definition{ + name: vmGenerationFilter, + parameters: [difference : Nat, whenEqual : Vm, whenDifferent : Vm], + result: Vm, + body: (match difference | Nat.zero => whenEqual | Nat.succ rest => whenDifferent) +} + +theorem{ + name: vmPositiveGenerationFilterFact, + parameters: [difference : Nat, whenEqual : Vm, whenDifferent : Vm], + statement: (((0 < difference) -> ((vmGenerationFilter difference whenEqual whenDifferent) = whenDifferent)) <-> (0 = 0)), + proof: cases{ + branches: [ + { + proof: constructor{ + branches: [linear_arithmetic{}, linear_arithmetic{definitions: [vmGenerationFilter]}] + }, + binders: [], + constructor: zero + }, + { + proof: constructor{ + branches: [linear_arithmetic{}, linear_arithmetic{definitions: [vmGenerationFilter]}] + }, + binders: [rest], + constructor: succ + } + ], + scrutinee: difference + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: vmOldGenerationDifference, + parameters: [state : Vm, generation : Nat], + statement: ((generation < (project state generation)) <-> (0 < (prim subtract (project state generation) generation : Nat))), + proof: constructor{branches: [linear_arithmetic{}, linear_arithmetic{}]}, + axioms: [Quot.sound, propext] +} + +definition{ + name: vmReadyCandidate, + parameters: [state : Vm, instanceCurrent : Bool, readinessObserved : Bool], + result: Vm, + body: (if ((vmIsBooting state) && (instanceCurrent && readinessObserved)) then (record Vm {generation := (project state generation), phase := (ctor VmPhase.Ready)}) else state) +} + +definition{ + name: vmObserveReady, + parameters: [state : Vm, generation : Nat, instanceCurrent : Bool, readinessObserved : Bool], + result: Vm, + body: (vmGenerationFilter (prim subtract (project state generation) generation : Nat) (vmGenerationFilter (prim subtract generation (project state generation) : Nat) (vmReadyCandidate state instanceCurrent readinessObserved) state) state) +} + +theorem{ + name: bootingCannotBootAgain, + parameters: [generation : Nat], + statement: ((vmCanBoot (record Vm {generation := generation, phase := (ctor VmPhase.Booting)})) = false), + proof: reflexivity{} +} + +theorem{ + name: failedVmCanRetry, + parameters: [generation : Nat], + statement: ((vmCanBoot (record Vm {generation := generation, phase := (ctor VmPhase.Failed)})) = true), + proof: reflexivity{} +} + +theorem{ + name: bootingCannotExecute, + parameters: [generation : Nat], + statement: ((vmCanExecute (record Vm {generation := generation, phase := (ctor VmPhase.Booting)})) = false), + proof: reflexivity{} +} + +theorem{ + name: staleTransportGenerationCannotCallback, + parameters: [state : Transport, callback : TransportCallback], + statement: (((project callback generation) < (project state generation)) -> ((transportSessionMatches state callback) = false)), + proof: linear_arithmetic{definitions: [transportCanSend, transportSessionMatches]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: reconnectCannotReviveCapturedCallback, + parameters: [state : Transport, callback : TransportCallback, channelKey : Bytes], + statement: (((project callback generation) <= (project state generation)) -> ((transportSessionMatches (transportOpen (transportClose state) channelKey) callback) = false)), + proof: linear_arithmetic{ + definitions: [transportCanSend, transportClose, transportOpen, transportSessionMatches] + }, + axioms: [Quot.sound, propext] +} + +theorem{ + name: staleVmGenerationCannotCallback, + parameters: [state : Vm, generation : Nat, instanceCurrent : Bool], + statement: ((generation < (project state generation)) -> ((vmCallbackAllowed state generation instanceCurrent) = false)), + proof: linear_arithmetic{definitions: [vmCallbackAllowed]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: staleVmCannotResurrectReadiness, + parameters: [state : Vm, generation : Nat, instanceCurrent : Bool, readinessObserved : Bool], + statement: ((generation < (project state generation)) -> ((vmObserveReady state generation instanceCurrent readinessObserved) = state)), + proof: simplify{ + definitions: [vmObserveReady, vmOldGenerationDifference, vmPositiveGenerationFilterFact] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: unresolvedDnsReadCannotWrite, + parameters: [ + scope : DnsScope, + pointerDigest : Bytes, + recordId : Bytes, + hasRecordId : Bool, + candidate : DnsCandidate, + observation : DnsRead, + now : Nat + ], + statement: ((dnsDecisionWrites (dnsReadDecision (record DnsPublication {scope := scope, phase := (ctor DnsPhase.Unknown), pointerDigest := pointerDigest, recordId := recordId, hasRecordId := hasRecordId}) candidate observation now)) = false), + proof: simplify{definitions: [dnsReadDecision, unknownGatedReadNeverWrites]}, + axioms: [propext] +} + +structure{ + name: C1Progress, + type_parameters: [], + parameters: [], + fields: [ + {name: startedAt, type: Nat}, + {name: lastSequence, type: Nat}, + {name: hasSequence, type: Bool}, + {name: consecutive, type: Nat} + ] +} + +definition{ + name: c1InWindow, + parameters: [progress : C1Progress, now : Nat], + result: Bool, + body: (((project progress startedAt) <=? now) && (now <=? ((project progress startedAt) + 10000000))) +} + +definition{ + name: c1ProbeAccepted, + parameters: [progress : C1Progress, sequence : Nat, now : Nat, correlated : Bool], + result: Bool, + body: (correlated && ((c1InWindow progress now) && ((not (project progress hasSequence)) || ((project progress lastSequence) ((c1ConnectionQualified progress now orderedChannel) = false)), + proof: linear_arithmetic{definitions: [c1ConnectionQualified]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: expiredConnectionCannotQualify, + parameters: [progress : C1Progress, now : Nat, orderedChannel : Bool], + statement: ((((project progress startedAt) + 10000000) < now) -> ((c1ConnectionQualified progress now orderedChannel) = false)), + proof: linear_arithmetic{definitions: [c1ConnectionQualified, c1InWindow]}, + axioms: [Quot.sound, propext] +} + +definition{ + name: authorityMayCreate, + parameters: [exists : Bool, explicitSetup : Bool], + result: Bool, + body: ((not exists) && explicitSetup) +} + +theorem{ + name: existingAuthorityNeverRotates, + parameters: [], + statement: (forall (explicitSetup : Bool), ((authorityMayCreate true explicitSetup) = false)), + proof: decide{} +} + +definition{ + name: journalMayClaim, + parameters: [unresolved : Bool], + result: Bool, + body: (not unresolved) +} + +definition{ + name: journalMayFinish, + parameters: [sameCandidate : Bool, sameOwner : Bool, exactPublishedRead : Bool], + result: Bool, + body: (sameCandidate && (sameOwner || exactPublishedRead)) +} + +theorem{ + name: unknownJournalCannotClaim, + parameters: [], + statement: ((journalMayClaim true) = false), + proof: decide{} +} + +theorem{ + name: foreignCandidateCannotFinish, + parameters: [], + statement: (forall (sameOwner : Bool), (forall (exactPublishedRead : Bool), ((journalMayFinish false sameOwner exactPublishedRead) = false))), + proof: decide{} +} +\end{semanticmodule} + +\end{lexlean} diff --git a/app/src/Stitch/Encoding.lex.tex b/app/src/Stitch/Encoding.lex.tex new file mode 100644 index 0000000..940ba10 --- /dev/null +++ b/app/src/Stitch/Encoding.lex.tex @@ -0,0 +1,115 @@ +\begin{lexlean}{Stitch.Encoding} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\importmodule{Stitch.Identity} +\title{Stitch recoverable service model} +\begin{semanticmodule} +inductive{ + name: DependencyKind, + type_parameters: [], + parameters: [], + constructors: [ + {name: Decoder, fields: []}, + {name: Parameters, fields: []}, + {name: Basis, fields: []}, + {name: Residual, fields: []}, + {name: Framing, fields: []} + ] +} + +structure{ + name: Dependency, + type_parameters: [], + parameters: [], + fields: [ + {name: root, type: Stitch.Identity::Digest}, + {name: kind, type: DependencyKind}, + {name: byteLength, type: Nat}, + {name: present, type: Bool}, + {name: integrityChecked, type: Bool} + ] +} + +structure{ + name: Encoding, + type_parameters: [], + parameters: [], + fields: [ + {name: objectRoot, type: Stitch.Identity::Digest}, + {name: representationRoot, type: Stitch.Identity::Digest}, + {name: representation, type: Bytes}, + {name: decoderRoot, type: Stitch.Identity::Digest}, + {name: dependencies, type: (List Dependency)}, + {name: modelBytes, type: Nat}, + {name: parameterBytes, type: Nat}, + {name: residualBytes, type: Nat}, + {name: framingBytes, type: Nat}, + {name: metadataBytes, type: Nat}, + {name: externalBasisBytes, type: Nat} + ] +} + +definition{ + name: dependenciesReady, + parameters: [dependencies : (List Dependency)], + result: Bool, + body: (match dependencies + | List.nil => true + | List.cons head tail => ((project head present) && ((project head integrityChecked) && (dependenciesReady tail)))), + recursive_argument: dependencies +} + +definition{ + name: selfContainedBytes, + parameters: [encoding : Encoding], + result: Nat, + body: ((project encoding modelBytes) + ((project encoding parameterBytes) + ((project encoding residualBytes) + ((project encoding framingBytes) + (project encoding metadataBytes))))) +} + +definition{ + name: totalRecoveryBytes, + parameters: [encoding : Encoding], + result: Nat, + body: ((selfContainedBytes encoding) + (project encoding externalBasisBytes)) +} + +definition{name: rawDecode, parameters: [value : Bytes], result: Bytes, body: value} + +theorem{ + name: rawRecoveryExact, + parameters: [value : Bytes], + statement: ((rawDecode value) = value), + proof: reflexivity{} +} + +theorem{ + name: externalBasisNotFree, + parameters: [encoding : Encoding], + statement: ((selfContainedBytes encoding) <= (totalRecoveryBytes encoding)), + proof: linear_arithmetic{definitions: [selfContainedBytes, totalRecoveryBytes]}, + axioms: [Quot.sound, propext] +} + +structure{ + name: RecoveryObservation, + type_parameters: [], + parameters: [], + fields: [ + {name: objectRoot, type: Stitch.Identity::Digest}, + {name: representationRoot, type: Stitch.Identity::Digest}, + {name: recoveredBytes, type: Bytes}, + {name: expectedBytes, type: Bytes}, + {name: decoderBound, type: Bool}, + {name: dependenciesPresent, type: Bool} + ] +} + +definition{ + name: exactRecovery, + parameters: [observation : RecoveryObservation], + result: Bool, + body: ((project observation decoderBound) && ((project observation dependenciesPresent) && (prim equal (project observation recoveredBytes) (project observation expectedBytes) : Bool))) +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/Evidence.lex.tex b/app/src/Stitch/Evidence.lex.tex new file mode 100644 index 0000000..425496f --- /dev/null +++ b/app/src/Stitch/Evidence.lex.tex @@ -0,0 +1,253 @@ +\begin{lexlean}{Stitch.Evidence} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\importmodule{Stitch.Identity} +\importmodule{Stitch.Encoding} +\title{Stitch recoverable service model} +\begin{semanticmodule} +inductive{ + name: ClaimKind, + type_parameters: [], + parameters: [], + constructors: [ + {name: Integrity, fields: []}, + {name: Authorization, fields: []}, + {name: Reconstruction, fields: []}, + {name: PureExecution, fields: []}, + {name: Availability, fields: []}, + {name: Durability, fields: []}, + {name: Confidentiality, fields: []} + ] +} + +inductive{ + name: EvidenceKind, + type_parameters: [], + parameters: [], + constructors: [ + {name: Specified, fields: []}, + {name: KernelChecked, fields: []}, + {name: ImplementationTested, fields: []}, + {name: IndependentlyReplayed, fields: []}, + {name: FieldMeasured, fields: []}, + {name: Refuted, fields: []}, + {name: Untested, fields: []} + ] +} + +inductive{ + name: HostEffect, + type_parameters: [], + parameters: [], + constructors: [ + {name: ReadClock, fields: []}, + {name: SendFragment, fields: []}, + {name: PersistFragment, fields: []}, + {name: ReadDNS, fields: []}, + {name: WriteDNS, fields: []}, + {name: ReceivePeer, fields: []}, + {name: RunVM, fields: []}, + {name: FetchDependency, fields: []}, + {name: VerifySignature, fields: []}, + {name: HashBytes, fields: []} + ] +} + +structure{ + name: HostAssumptions, + type_parameters: [], + parameters: [], + fields: [ + {name: digestCollisionResistance, type: Bool}, + {name: signatureUnforgeability, type: Bool}, + {name: authorizedKeyBinding, type: Bool}, + {name: receiptAuthentication, type: Bool}, + {name: storageRetentionForLease, type: Bool}, + {name: independentFailureDomains, type: Bool}, + {name: monotonicElapsedClock, type: Bool}, + {name: releasedRuntimeMatchesModel, type: Bool} + ] +} + +structure{ + name: Evidence, + type_parameters: [], + parameters: [], + fields: [ + {name: claim, type: ClaimKind}, + {name: kind, type: EvidenceKind}, + {name: modelRoot, type: Stitch.Identity::Digest}, + {name: artifactRoot, type: Stitch.Identity::Digest}, + {name: subjectRoot, type: Stitch.Identity::Digest}, + {name: assumptionsRoot, type: Stitch.Identity::Digest}, + {name: dependencyRoot, type: Stitch.Identity::Digest}, + {name: assumptions, type: HostAssumptions}, + {name: dependencies, type: (List Stitch.Encoding::Dependency)}, + {name: hostEffects, type: (List HostEffect)}, + {name: observedAt, type: Nat}, + {name: validUntil, type: Nat}, + {name: horizon, type: Nat}, + {name: failureBound, type: Nat} + ] +} + +structure{ + name: Scope, + type_parameters: [], + parameters: [], + fields: [ + {name: claim, type: ClaimKind}, + {name: kind, type: EvidenceKind}, + {name: modelRoot, type: Stitch.Identity::Digest}, + {name: artifactRoot, type: Stitch.Identity::Digest}, + {name: subjectRoot, type: Stitch.Identity::Digest}, + {name: assumptionsRoot, type: Stitch.Identity::Digest}, + {name: dependencyRoot, type: Stitch.Identity::Digest}, + {name: assumptions, type: HostAssumptions}, + {name: dependencies, type: (List Stitch.Encoding::Dependency)}, + {name: hostEffects, type: (List HostEffect)}, + {name: horizon, type: Nat}, + {name: failures, type: Nat} + ] +} + +definition{ + name: claimCode, + parameters: [value : ClaimKind], + result: Nat, + body: (match value + | ClaimKind.Integrity => 0 + | ClaimKind.Authorization => 1 + | ClaimKind.Reconstruction => 2 + | ClaimKind.PureExecution => 3 + | ClaimKind.Availability => 4 + | ClaimKind.Durability => 5 + | ClaimKind.Confidentiality => 6) +} + +definition{ + name: kindCode, + parameters: [value : EvidenceKind], + result: Nat, + body: (match value + | EvidenceKind.Specified => 0 + | EvidenceKind.KernelChecked => 1 + | EvidenceKind.ImplementationTested => 2 + | EvidenceKind.IndependentlyReplayed => 3 + | EvidenceKind.FieldMeasured => 4 + | EvidenceKind.Refuted => 5 + | EvidenceKind.Untested => 6) +} + +definition{ + name: effectCode, + parameters: [value : HostEffect], + result: Nat, + body: (match value + | HostEffect.ReadClock => 0 + | HostEffect.SendFragment => 1 + | HostEffect.PersistFragment => 2 + | HostEffect.ReadDNS => 3 + | HostEffect.WriteDNS => 4 + | HostEffect.ReceivePeer => 5 + | HostEffect.RunVM => 6 + | HostEffect.FetchDependency => 7 + | HostEffect.VerifySignature => 8 + | HostEffect.HashBytes => 9) +} + +definition{ + name: dependencyKindCode, + parameters: [value : Stitch.Encoding::DependencyKind], + result: Nat, + body: (match value + | Stitch.Encoding::DependencyKind.Decoder => 0 + | Stitch.Encoding::DependencyKind.Parameters => 1 + | Stitch.Encoding::DependencyKind.Basis => 2 + | Stitch.Encoding::DependencyKind.Residual => 3 + | Stitch.Encoding::DependencyKind.Framing => 4) +} + +definition{ + name: sameAssumptions, + parameters: [left : HostAssumptions, right : HostAssumptions], + result: Bool, + body: (((if (project left digestCollisionResistance) then 1 else 0) =? (if (project right digestCollisionResistance) then 1 else 0)) && (((if (project left signatureUnforgeability) then 1 else 0) =? (if (project right signatureUnforgeability) then 1 else 0)) && (((if (project left authorizedKeyBinding) then 1 else 0) =? (if (project right authorizedKeyBinding) then 1 else 0)) && (((if (project left receiptAuthentication) then 1 else 0) =? (if (project right receiptAuthentication) then 1 else 0)) && (((if (project left storageRetentionForLease) then 1 else 0) =? (if (project right storageRetentionForLease) then 1 else 0)) && (((if (project left independentFailureDomains) then 1 else 0) =? (if (project right independentFailureDomains) then 1 else 0)) && (((if (project left monotonicElapsedClock) then 1 else 0) =? (if (project right monotonicElapsedClock) then 1 else 0)) && ((if (project left releasedRuntimeMatchesModel) then 1 else 0) =? (if (project right releasedRuntimeMatchesModel) then 1 else 0))))))))) +} + +definition{ + name: sameDependency, + parameters: [left : Stitch.Encoding::Dependency, right : Stitch.Encoding::Dependency], + result: Bool, + body: ((Stitch.Identity::sameDigest (project left root) (project right root)) && (((dependencyKindCode (project left kind)) =? (dependencyKindCode (project right kind))) && (((project left byteLength) =? (project right byteLength)) && ((Stitch.Identity::digestWellFormed (project left root)) && ((project left present) && ((project right present) && ((project left integrityChecked) && (project right integrityChecked)))))))) +} + +definition{ + name: dependenciesUnchanged, + parameters: [ + left : (List Stitch.Encoding::Dependency), + right : (List Stitch.Encoding::Dependency) + ], + result: Bool, + body: (match left + | List.nil => (match right | List.nil => true | List.cons other rest => false) + | List.cons head tail => (match right + | List.nil => false + | List.cons other rest => ((sameDependency head other) && (dependenciesUnchanged tail rest)))), + recursive_argument: left +} + +definition{ + name: effectMember, + parameters: [effect : HostEffect, effects : (List HostEffect)], + result: Bool, + body: (match effects + | List.nil => false + | List.cons head tail => (((effectCode effect) =? (effectCode head)) || (effectMember effect tail))), + recursive_argument: effects +} + +definition{ + name: effectsCovered, + parameters: [requested : (List HostEffect), allowed : (List HostEffect)], + result: Bool, + body: (match requested + | List.nil => true + | List.cons head tail => ((effectMember head allowed) && (effectsCovered tail allowed))), + recursive_argument: requested +} + +definition{ + name: positiveEvidenceKind, + parameters: [kind : EvidenceKind], + result: Bool, + body: ((1 <=? (kindCode kind)) && ((kindCode kind) <=? 4)) +} + +definition{ + name: scopeReusable, + parameters: [evidence : Evidence, requested : Scope, now : Nat], + result: Bool, + body: (((claimCode (project evidence claim)) =? (claimCode (project requested claim))) && (((kindCode (project evidence kind)) =? (kindCode (project requested kind))) && ((positiveEvidenceKind (project evidence kind)) && ((Stitch.Identity::digestWellFormed (project evidence modelRoot)) && ((Stitch.Identity::sameDigest (project evidence modelRoot) (project requested modelRoot)) && ((Stitch.Identity::digestWellFormed (project evidence artifactRoot)) && ((Stitch.Identity::sameDigest (project evidence artifactRoot) (project requested artifactRoot)) && ((Stitch.Identity::digestWellFormed (project evidence subjectRoot)) && ((Stitch.Identity::sameDigest (project evidence subjectRoot) (project requested subjectRoot)) && ((Stitch.Identity::digestWellFormed (project evidence assumptionsRoot)) && ((Stitch.Identity::sameDigest (project evidence assumptionsRoot) (project requested assumptionsRoot)) && ((Stitch.Identity::digestWellFormed (project evidence dependencyRoot)) && ((Stitch.Identity::sameDigest (project evidence dependencyRoot) (project requested dependencyRoot)) && ((sameAssumptions (project evidence assumptions) (project requested assumptions)) && ((dependenciesUnchanged (project evidence dependencies) (project requested dependencies)) && ((effectsCovered (project requested hostEffects) (project evidence hostEffects)) && (((project evidence observedAt) <=? now) && ((now ((scopeReusable evidence requested now) = false)), + proof: linear_arithmetic{definitions: [scopeReusable]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: expiredEvidenceCannotBeReused, + parameters: [evidence : Evidence, requested : Scope, now : Nat], + statement: (((project evidence validUntil) <= now) -> ((scopeReusable evidence requested now) = false)), + proof: linear_arithmetic{definitions: [scopeReusable]}, + axioms: [Quot.sound, propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/Fragments.lex.tex b/app/src/Stitch/Fragments.lex.tex new file mode 100644 index 0000000..9b74db6 --- /dev/null +++ b/app/src/Stitch/Fragments.lex.tex @@ -0,0 +1,323 @@ +\begin{lexlean}{Stitch.Fragments} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\importmodule{Stitch.Identity} +\importmodule{Stitch.Encoding} +\title{Stitch recoverable service model} +\begin{semanticmodule} +structure{ + name: BitPair, + type_parameters: [], + parameters: [], + fields: [{name: left, type: Nat}, {name: right, type: Nat}] +} + +inductive{ + name: Blocks, + type_parameters: [], + parameters: [], + constructors: [{name: End, fields: []}, {name: More, fields: [BitPair, Blocks]}] +} + +structure{ + name: Fragment, + type_parameters: [], + parameters: [], + fields: [ + {name: manifestRoot, type: Stitch.Identity::Digest}, + {name: encodingRoot, type: Stitch.Identity::Digest}, + {name: index, type: Nat}, + {name: payloadRoot, type: Stitch.Identity::Digest}, + {name: payload, type: Bytes}, + {name: byteLength, type: Nat} + ] +} + +definition{ + name: xorBit, + parameters: [left : Nat, right : Nat], + result: Nat, + body: (if (left =? right) then 0 else 1) +} + +definition{name: encodePair, parameters: [pair : BitPair], result: BitPair, body: pair} + +definition{ + name: recoverLeftParity, + parameters: [pair : BitPair], + result: BitPair, + body: (record BitPair {left := (project pair left), right := (xorBit (project pair left) (xorBit (project pair left) (project pair right)))}) +} + +definition{ + name: recoverRightParity, + parameters: [pair : BitPair], + result: BitPair, + body: (record BitPair {left := (xorBit (xorBit (project pair left) (project pair right)) (project pair right)), right := (project pair right)}) +} + +theorem{ + name: leftParityBitExact, + parameters: [left : Nat, right : Nat], + statement: ((left <= 1) -> ((right <= 1) -> ((xorBit left (xorBit left right)) = right))), + proof: linear_arithmetic{definitions: [xorBit]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: rightParityBitExact, + parameters: [left : Nat, right : Nat], + statement: ((left <= 1) -> ((right <= 1) -> ((xorBit (xorBit left right) right) = left))), + proof: linear_arithmetic{definitions: [xorBit]}, + axioms: [Quot.sound, propext] +} + +definition{ + name: pairAllowed, + parameters: [ + leftIndex : Nat, + rightIndex : Nat, + manifestMatches : Bool, + fragmentsValid : Bool, + dependenciesPresent : Bool + ], + result: Bool, + body: ((leftIndex right + | Bit.One => (match right | Bit.Zero => (ctor Bit.One) | Bit.One => (ctor Bit.Zero))) +} + +definition{ + name: leftParity, + parameters: [blocks : BitBlocks], + result: BitBlocks, + body: (match blocks + | BitBlocks.End => (ctor BitBlocks.End) + | BitBlocks.More left right tail => (ctor BitBlocks.More left (xorCell left right) (leftParity tail))), + recursive_argument: blocks +} + +definition{ + name: rightParity, + parameters: [blocks : BitBlocks], + result: BitBlocks, + body: (match blocks + | BitBlocks.End => (ctor BitBlocks.End) + | BitBlocks.More left right tail => (ctor BitBlocks.More (xorCell left right) right (rightParity tail))), + recursive_argument: blocks +} + +theorem{ + name: leftParityInvolutive, + parameters: [blocks : BitBlocks], + statement: ((leftParity (leftParity blocks)) = blocks), + proof: induction{ + branches: [ + {proof: simplify{definitions: [leftParity]}, binders: [], constructor: End}, + { + proof: cases{ + branches: [ + { + proof: cases{ + branches: [ + { + proof: simplify{definitions: [hypothesis, leftParity, xorCell]}, + binders: [], + constructor: Zero + }, + { + proof: simplify{definitions: [hypothesis, leftParity, xorCell]}, + binders: [], + constructor: One + } + ], + scrutinee: right + }, + binders: [], + constructor: Zero + }, + { + proof: cases{ + branches: [ + { + proof: simplify{definitions: [hypothesis, leftParity, xorCell]}, + binders: [], + constructor: Zero + }, + { + proof: simplify{definitions: [hypothesis, leftParity, xorCell]}, + binders: [], + constructor: One + } + ], + scrutinee: right + }, + binders: [], + constructor: One + } + ], + scrutinee: left + }, + binders: [left, right, tail, hypothesis], + constructor: More + } + ], + scrutinee: blocks + }, + axioms: [propext] +} + +theorem{ + name: rightParityInvolutive, + parameters: [blocks : BitBlocks], + statement: ((rightParity (rightParity blocks)) = blocks), + proof: induction{ + branches: [ + {proof: simplify{definitions: [rightParity]}, binders: [], constructor: End}, + { + proof: cases{ + branches: [ + { + proof: cases{ + branches: [ + { + proof: simplify{definitions: [hypothesis, rightParity, xorCell]}, + binders: [], + constructor: Zero + }, + { + proof: simplify{definitions: [hypothesis, rightParity, xorCell]}, + binders: [], + constructor: One + } + ], + scrutinee: right + }, + binders: [], + constructor: Zero + }, + { + proof: cases{ + branches: [ + { + proof: simplify{definitions: [hypothesis, rightParity, xorCell]}, + binders: [], + constructor: Zero + }, + { + proof: simplify{definitions: [hypothesis, rightParity, xorCell]}, + binders: [], + constructor: One + } + ], + scrutinee: right + }, + binders: [], + constructor: One + } + ], + scrutinee: left + }, + binders: [left, right, tail, hypothesis], + constructor: More + } + ], + scrutinee: blocks + }, + axioms: [propext] +} + +inductive{ + name: PairSelection, + type_parameters: [], + parameters: [], + constructors: [ + {name: Systematic, fields: []}, + {name: LeftParity, fields: []}, + {name: RightParity, fields: []} + ] +} + +definition{ + name: encodeForPair, + parameters: [blocks : BitBlocks, selection : PairSelection], + result: BitBlocks, + body: (match selection + | PairSelection.Systematic => blocks + | PairSelection.LeftParity => (leftParity blocks) + | PairSelection.RightParity => (rightParity blocks)) +} + +definition{ + name: decodePair, + parameters: [available : BitBlocks, selection : PairSelection], + result: BitBlocks, + body: (match selection + | PairSelection.Systematic => available + | PairSelection.LeftParity => (leftParity available) + | PairSelection.RightParity => (rightParity available)) +} + +theorem{ + name: everyCompatiblePairRecoversFiniteBlocks, + parameters: [blocks : BitBlocks, selection : PairSelection], + statement: ((decodePair (encodeForPair blocks selection) selection) = blocks), + proof: cases{ + branches: [ + { + proof: simplify{definitions: [decodePair, encodeForPair]}, + binders: [], + constructor: Systematic + }, + { + proof: simplify{definitions: [decodePair, encodeForPair, leftParityInvolutive]}, + binders: [], + constructor: LeftParity + }, + { + proof: simplify{definitions: [decodePair, encodeForPair, rightParityInvolutive]}, + binders: [], + constructor: RightParity + } + ], + scrutinee: selection + }, + axioms: [propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/Identity.lex.tex b/app/src/Stitch/Identity.lex.tex new file mode 100644 index 0000000..1218eb2 --- /dev/null +++ b/app/src/Stitch/Identity.lex.tex @@ -0,0 +1,75 @@ +\begin{lexlean}{Stitch.Identity} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\title{Stitch recoverable service model} +\begin{semanticmodule} +structure{ + name: Digest, + type_parameters: [], + parameters: [], + fields: [ + {name: w0, type: Nat}, + {name: w1, type: Nat}, + {name: w2, type: Nat}, + {name: w3, type: Nat}, + {name: w4, type: Nat}, + {name: w5, type: Nat}, + {name: w6, type: Nat}, + {name: w7, type: Nat} + ] +} + +structure{ + name: Object, + type_parameters: [], + parameters: [], + fields: [ + {name: digest, type: Digest}, + {name: canonicalBytes, type: Bytes}, + {name: byteLength, type: Nat} + ] +} + +structure{ + name: DigestObservation, + type_parameters: [], + parameters: [], + fields: [ + {name: expected, type: Digest}, + {name: observed, type: Digest}, + {name: domainMatches, type: Bool}, + {name: canonicalSerializationMatches, type: Bool} + ] +} + +definition{ + name: sameDigest, + parameters: [left : Digest, right : Digest], + result: Bool, + body: (((project left w0) =? (project right w0)) && (((project left w1) =? (project right w1)) && (((project left w2) =? (project right w2)) && (((project left w3) =? (project right w3)) && (((project left w4) =? (project right w4)) && (((project left w5) =? (project right w5)) && (((project left w6) =? (project right w6)) && ((project left w7) =? (project right w7))))))))) +} + +definition{ + name: digestWellFormed, + parameters: [digest : Digest], + result: Bool, + body: (((project digest w0) ((observationFresh observedAt expires now) = false)), + proof: linear_arithmetic{definitions: [observationFresh]}, + axioms: [Quot.sound, propext] +} + +definition{ + name: reachableObservation, + parameters: [observation : PeerObservation, observer : Nat, now : Nat], + result: Bool, + body: (((project observation observer) =? observer) && ((project observation authenticated) && ((observationFresh (project observation observedAt) (project observation expires) now) && (match (project observation reachability) + | Reachability.Unknown => false + | Reachability.Reachable => true + | Reachability.TimedOut => false + | Reachability.Conflicting => false)))) +} + +definition{ + name: updateObservation, + parameters: [current : PeerObservation, candidate : PeerObservation, now : Nat], + result: PeerObservation, + body: (if (acceptObservation current candidate now) then candidate else current) +} + +theorem{ + name: futureObservationRejected, + parameters: [observedAt : Nat, expires : Nat, now : Nat], + statement: ((now < observedAt) -> ((observationFresh observedAt expires now) = false)), + proof: linear_arithmetic{definitions: [observationFresh]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: acceptedObservationIsFresh, + parameters: [current : PeerObservation, candidate : PeerObservation, now : Nat], + statement: (((acceptObservation current candidate now) = true) -> (((project candidate observedAt) <= now) /\ (now < (project candidate expires)))), + proof: linear_arithmetic{definitions: [acceptObservation, observationFresh]}, + axioms: [Classical.choice, Quot.sound, propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/Pointer.lex.tex b/app/src/Stitch/Pointer.lex.tex new file mode 100644 index 0000000..c21fc6f --- /dev/null +++ b/app/src/Stitch/Pointer.lex.tex @@ -0,0 +1,183 @@ +\begin{lexlean}{Stitch.Pointer} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\importmodule{Stitch.Identity} +\title{Stitch recoverable service model} +\begin{semanticmodule} +structure{ + name: Authority, + type_parameters: [], + parameters: [], + fields: [ + {name: nameRoot, type: Stitch.Identity::Digest}, + {name: keyRoot, type: Stitch.Identity::Digest}, + {name: epoch, type: Nat} + ] +} + +structure{ + name: Pointer, + type_parameters: [], + parameters: [], + fields: [ + {name: nameRoot, type: Stitch.Identity::Digest}, + {name: authorityRoot, type: Stitch.Identity::Digest}, + {name: revision, type: Nat}, + {name: predecessor, type: Stitch.Identity::Digest}, + {name: objectRoot, type: Stitch.Identity::Digest}, + {name: transitionRoot, type: Stitch.Identity::Digest}, + {name: pointerRoot, type: Stitch.Identity::Digest}, + {name: notBefore, type: Nat}, + {name: expires, type: Nat}, + {name: signature, type: Bytes} + ] +} + +definition{ + name: successorAllowed, + parameters: [ + currentRevision : Nat, + nextRevision : Nat, + predecessorMatches : Bool, + authorityMatches : Bool, + signatureValid : Bool, + notBefore : Nat, + expires : Nat, + now : Nat + ], + result: Bool, + body: (authorityMatches && ((nextRevision =? (currentRevision + 1)) && (predecessorMatches && (signatureValid && ((notBefore <=? now) && (now ((restoreAllowed accepted scopeMatches digestMatches signatureValid notBefore expires now headPresent sameHead) = false)), + proof: linear_arithmetic{definitions: [restoreAllowed]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: successorStrictlyAdvances, + parameters: [ + currentRevision : Nat, + nextRevision : Nat, + predecessorMatches : Bool, + authorityMatches : Bool, + signatureValid : Bool, + notBefore : Nat, + expires : Nat, + now : Nat + ], + statement: (((successorAllowed currentRevision nextRevision predecessorMatches authorityMatches signatureValid notBefore expires now) = true) -> (currentRevision < nextRevision)), + proof: linear_arithmetic{definitions: [successorAllowed]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: wrongAuthorityRefused, + parameters: [ + currentRevision : Nat, + nextRevision : Nat, + predecessorMatches : Bool, + signatureValid : Bool, + notBefore : Nat, + expires : Nat, + now : Nat + ], + statement: ((successorAllowed currentRevision nextRevision predecessorMatches false signatureValid notBefore expires now) = false), + proof: reflexivity{} +} + +theorem{ + name: rollbackRefused, + parameters: [ + currentRevision : Nat, + nextRevision : Nat, + predecessorMatches : Bool, + authorityMatches : Bool, + signatureValid : Bool, + notBefore : Nat, + expires : Nat, + now : Nat + ], + statement: ((nextRevision <= currentRevision) -> ((successorAllowed currentRevision nextRevision predecessorMatches authorityMatches signatureValid notBefore expires now) = false)), + proof: linear_arithmetic{definitions: [successorAllowed]}, + axioms: [Quot.sound, propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/Recovery.lex.tex b/app/src/Stitch/Recovery.lex.tex new file mode 100644 index 0000000..ef53747 --- /dev/null +++ b/app/src/Stitch/Recovery.lex.tex @@ -0,0 +1,100 @@ +\begin{lexlean}{Stitch.Recovery} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\title{Stitch recoverable service model} +\begin{semanticmodule} +structure{ + name: Limits, + type_parameters: [], + parameters: [], + fields: [ + {name: wireBytes, type: Nat}, + {name: entries, type: Nat}, + {name: objectBytes, type: Nat}, + {name: replaySteps, type: Nat} + ] +} + +structure{ + name: State, + type_parameters: [], + parameters: [], + fields: [ + {name: root, type: Bytes}, + {name: generation, type: Nat}, + {name: wireBytes, type: Nat}, + {name: entries, type: Nat}, + {name: replaySteps, type: Nat} + ] +} + +definition{ + name: admitted, + parameters: [bounds : Limits, current : State, candidate : State, verified : Bool], + result: Bool, + body: (verified && (((project current generation) =? (project candidate generation)) && (((project candidate wireBytes) <=? (project bounds wireBytes)) && (((project candidate entries) <=? (project bounds entries)) && ((project candidate replaySteps) <=? (project bounds replaySteps)))))) +} + +definition{ + name: commit, + parameters: [bounds : Limits, current : State, candidate : State, verified : Bool], + result: State, + body: (if (admitted bounds current candidate verified) then (record State {root := (project candidate root), generation := ((project current generation) + 1), wireBytes := (project candidate wireBytes), entries := (project candidate entries), replaySteps := (project candidate replaySteps)}) else current) +} + +definition{ + name: anchorAllowed, + parameters: [ + suppliedDigest : Bytes, + expectedDigest : Bytes, + validFrom : Nat, + validUntil : Nat, + now : Nat, + retainedRevision : Nat, + candidateRevision : Nat, + sameRetained : Bool + ], + result: Bool, + body: ((prim equal suppliedDigest expectedDigest : Bool) && ((validFrom <=? now) && ((now ((progressAllowed retained candidate sameIdentity linked) = false)), + proof: linear_arithmetic{definitions: [progressAllowed]}, + axioms: [Quot.sound, propext] +} + +theorem{ + name: unverifiedImportPreservesState, + parameters: [bounds : Limits, current : State, candidate : State], + statement: ((commit bounds current candidate false) = current), + proof: reflexivity{} +} + +theorem{ + name: acceptedCandidateWithinBounds, + parameters: [bounds : Limits, current : State, candidate : State, verified : Bool], + statement: (((admitted bounds current candidate verified) = true) -> (((project candidate wireBytes) <= (project bounds wireBytes)) /\ (((project candidate entries) <= (project bounds entries)) /\ ((project candidate replaySteps) <= (project bounds replaySteps))))), + proof: linear_arithmetic{definitions: [admitted]}, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: staleGenerationRefused, + parameters: [bounds : Limits, current : State, candidate : State, verified : Bool], + statement: (((project candidate generation) < (project current generation)) -> ((admitted bounds current candidate verified) = false)), + proof: linear_arithmetic{definitions: [admitted]}, + axioms: [Quot.sound, propext] +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/Relay.lex.tex b/app/src/Stitch/Relay.lex.tex new file mode 100644 index 0000000..99a45d3 --- /dev/null +++ b/app/src/Stitch/Relay.lex.tex @@ -0,0 +1,244 @@ +\begin{lexlean}{Stitch.Relay} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\title{Stitch recoverable service model} +\begin{semanticmodule} +structure{ + name: Limits, + type_parameters: [], + parameters: [], + fields: [ + {name: wireBytes, type: Nat}, + {name: chunkBytes, type: Nat}, + {name: messageBytes, type: Nat}, + {name: frames, type: Nat}, + {name: entries, type: Nat}, + {name: retainedBytes, type: Nat}, + {name: tombstones, type: Nat}, + {name: assemblyAge, type: Nat}, + {name: futureSkew, type: Nat}, + {name: requestTimeout, type: Nat} + ] +} + +definition{ + name: limits, + parameters: [], + result: Limits, + body: (record Limits {wireBytes := 4096, chunkBytes := 2700, messageBytes := 524288, frames := 256, entries := 16, retainedBytes := 2097152, tombstones := 256, assemblyAge := 30000, futureSkew := 5000, requestTimeout := 30000}) +} + +definition{name: signalLifetime, parameters: [], result: Nat, body: 60000} + +definition{name: warmLifetime, parameters: [], result: Nat, body: 1800000} + +structure{ + name: Capacity, + type_parameters: [], + parameters: [], + fields: [ + {name: entries, type: Nat}, + {name: retainedBytes, type: Nat}, + {name: tombstones, type: Nat} + ] +} + +structure{ + name: Identity, + type_parameters: [], + parameters: [], + fields: [ + {name: channel, type: Bytes}, + {name: session, type: Bytes}, + {name: digest, type: Bytes}, + {name: purpose, type: Bytes}, + {name: created, type: Nat}, + {name: messageBytes, type: Nat}, + {name: frames, type: Nat} + ] +} + +structure{ + name: Frame, + type_parameters: [], + parameters: [], + fields: [ + {name: identity, type: Identity}, + {name: index, type: Nat}, + {name: payloadBytes, type: Nat}, + {name: wireBytes, type: Nat} + ] +} + +structure{ + name: Assembly, + type_parameters: [], + parameters: [], + fields: [ + {name: identity, type: Identity}, + {name: receivedFrames, type: Nat}, + {name: receivedBytes, type: Nat}, + {name: started, type: Nat}, + {name: last, type: Nat}, + {name: verifying, type: Bool} + ] +} + +definition{ + name: sameIdentity, + parameters: [left : Identity, right : Identity], + result: Bool, + body: ((prim equal (project left channel) (project right channel) : Bool) && ((prim equal (project left session) (project right session) : Bool) && ((prim equal (project left digest) (project right digest) : Bool) && ((prim equal (project left purpose) (project right purpose) : Bool) && (((project left created) =? (project right created)) && (((project left messageBytes) =? (project right messageBytes)) && ((project left frames) =? (project right frames)))))))) +} + +definition{ + name: frameAllowed, + parameters: [ + bounds : Limits, + frame : Frame, + channel : Bytes, + purpose : Bytes, + wallNow : Nat, + lifetime : Nat + ], + result: Bool, + body: (let identity : Identity := (project frame identity); ((prim equal (project identity channel) channel : Bool) && ((prim equal (project identity purpose) purpose : Bool) && ((0 false + | List.cons head tail => (if (Stitch.Identity::sameDigest (project head actionId) actionId) then (((project head epoch) =? epoch) && (not (project head settled))) else (reservationActive tail actionId epoch))), + recursive_argument: reservations +} + +definition{ + name: completionSafetyGuard, + parameters: [ledger : Stitch.Budget::Ledger, now : Nat], + result: Bool, + body: ((Stitch.Budget::ledgerValid ledger) && (((project (project ledger budget) last) <=? now) && (now (0 = 0)))))), + proof: decide{} +} + +theorem{ + name: ledgerClockView, + parameters: [ledger : Stitch.Budget::Ledger], + statement: ((Stitch.Budget::ledgerValid ledger) = ((ledgerTime (project ledger budget)) && (ledgerHistory ledger))), + proof: simplify{ + definitions: [clockViewGrouping, ledgerHistory, ledgerTime, Stitch.Budget::ledgerValid] + }, + axioms: [propext] +} + +theorem{ + name: completionHistory, + parameters: [ledger : Stitch.Budget::Ledger, now : Nat], + statement: ((ledgerHistory (completionLedger ledger now)) = (ledgerHistory ledger)), + proof: reflexivity{} +} + +theorem{ + name: completionTime, + parameters: [ledger : Stitch.Budget::Ledger, now : Nat], + statement: ((ledgerTime (project (completionLedger ledger now) budget)) = (((project (project ledger budget) start) <=? now) && (now (((((project (project ledger budget) last) <=? now) && (now ((ledgerTime (project (completionLedger ledger now) budget)) = true))) <-> (0 = 0)), + proof: constructor{ + branches: [ + linear_arithmetic{}, + linear_arithmetic{definitions: [completionBudget, completionLedger, ledgerTime]} + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: historyPreservedFact, + parameters: [], + statement: (forall (oldTime : Bool), (forall (newTime : Bool), (forall (history : Bool), (forall (extra : Bool), (((oldTime = true) -> ((extra = true) -> (newTime = true))) -> (((((oldTime && history) && extra) = true) -> ((newTime && history) = true)) <-> (0 = 0))))))), + proof: decide{} +} + +theorem{ + name: completionLedgerValidityFact, + parameters: [ledger : Stitch.Budget::Ledger, now : Nat], + statement: ((((completionSafetyGuard ledger now) = true) -> ((Stitch.Budget::ledgerValid (completionLedger ledger now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + clockAdvanceFact, + completionHistory, + completionSafetyGuard, + historyPreservedFact, + ledgerClockView + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +definition{ + name: choosePlacement, + parameters: [ + selection : Stitch.Budget::Selection, + whenTrue : Stitch.Custody::Placement, + whenFalse : Stitch.Custody::Placement + ], + result: Stitch.Custody::Placement, + body: (match selection + | Stitch.Budget::Selection.Reject => whenFalse + | Stitch.Budget::Selection.Accept => whenTrue) +} + +theorem{ + name: ledgerPlacementValiditySelect, + parameters: [ + selection : Stitch.Budget::Selection, + whenTrue : Stitch.Budget::Ledger, + whenFalse : Stitch.Budget::Ledger, + placement : Stitch.Custody::Placement + ], + statement: ((ledgerPlacementValid (Stitch.Budget::selectLedger selection whenTrue whenFalse) placement) = (Stitch.Budget::selectBool selection (ledgerPlacementValid whenTrue placement) (ledgerPlacementValid whenFalse placement))), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +theorem{ + name: productValiditySelect, + parameters: [ + selection : Stitch.Budget::Selection, + trueLedger : Stitch.Budget::Ledger, + falseLedger : Stitch.Budget::Ledger, + truePlacement : Stitch.Custody::Placement, + falsePlacement : Stitch.Custody::Placement + ], + statement: ((ledgerPlacementValid (Stitch.Budget::selectLedger selection trueLedger falseLedger) (choosePlacement selection truePlacement falsePlacement)) = (Stitch.Budget::selectBool selection (ledgerPlacementValid trueLedger truePlacement) (ledgerPlacementValid falseLedger falsePlacement))), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +theorem{ + name: completionSelectionReserved, + parameters: [selection : Stitch.Budget::Selection, ledger : Stitch.Budget::Ledger, now : Nat], + statement: ((project (project (Stitch.Budget::selectLedger selection (completionLedger ledger now) ledger) budget) reserved) = (project (project ledger budget) reserved)), + proof: cases{ + branches: [ + {proof: reflexivity{}, binders: [], constructor: Reject}, + {proof: reflexivity{}, binders: [], constructor: Accept} + ], + scrutinee: selection + } +} + +theorem{ + name: reservationClock, + parameters: [ + ledger : Stitch.Budget::Ledger, + actionId : Stitch.Identity::Digest, + cost : Stitch.Budget::Resources, + now : Nat + ], + statement: ((project (project (Stitch.Budget::reservationCandidate ledger actionId cost now) budget) last) = now), + proof: reflexivity{} +} + +theorem{ + name: completionClock, + parameters: [ledger : Stitch.Budget::Ledger, now : Nat], + statement: ((project (project (completionLedger ledger now) budget) last) = now), + proof: reflexivity{} +} + +theorem{ + name: guardedProductPreservationFact, + parameters: [], + statement: (forall (before : Bool), (forall (guard : Bool), (forall (candidate : Bool), (((guard = true) -> (candidate = true)) -> (((before = true) -> ((Stitch.Budget::selectBool (Stitch.Budget::selectionFromBool guard) candidate before) = true)) <-> (0 = 0)))))), + proof: decide{} +} + +theorem{ + name: requestAdmissionProductFact, + parameters: [], + statement: (forall (live : Bool), (forall (reserve : Bool), (forall (rest : Bool), (forall (next : Bool), (((reserve = true) -> (next = true)) -> ((((live && (reserve && rest)) = true) -> ((next && live) = true)) <-> (0 = 0))))))), + proof: decide{} +} + +theorem{ + name: weakenAdmissionFact, + parameters: [], + statement: (forall (before : Bool), (forall (after : Bool), (forall (extra : Bool), (((before = true) -> (after = true)) -> ((((before && extra) = true) -> (after = true)) <-> (0 = 0)))))), + proof: decide{} +} + +theorem{ + name: requestMigrationCandidateValidityFact, + parameters: [ + state : State, + transfer : Stitch.Custody::Transfer, + cost : Stitch.Budget::Resources, + now : Nat + ], + statement: ((((requestMigrationAllowed state transfer cost now) = true) -> ((ledgerPlacementValid (Stitch.Budget::reservationCandidate (project state ledger) (project transfer requestRoot) cost now) (project state placement)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + ledgerPlacementValid, + requestAdmissionProductFact, + requestMigrationAllowed, + reservationClock, + Stitch.Budget::reservationCandidateGuarantee + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +definition{ + name: migrationCandidateValidity, + parameters: [ + state : State, + transfer : Stitch.Custody::Transfer, + receipt : Stitch.Custody::Receipt, + fragment : Stitch.Fragments::Fragment, + integrity : Stitch.Custody::FragmentIntegrityObservation, + now : Nat + ], + result: Bool, + body: (ledgerPlacementValid (completionLedger (project state ledger) now) (Stitch.Custody::migrate (project state placement) (Stitch.Custody::prepareCompletion (project state placement) transfer receipt fragment integrity now) now)) +} + +theorem{ + name: migrationCandidateValidityFact, + parameters: [ + state : State, + transfer : Stitch.Custody::Transfer, + receipt : Stitch.Custody::Receipt, + fragment : Stitch.Fragments::Fragment, + integrity : Stitch.Custody::FragmentIntegrityObservation, + now : Nat + ], + statement: ((((completeMigrationAllowed state transfer receipt fragment integrity now) = true) -> ((ledgerPlacementValid (completionLedger (project state ledger) now) (Stitch.Custody::migrate (project state placement) (Stitch.Custody::prepareCompletion (project state placement) transfer receipt fragment integrity now) now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + completeMigrationAllowed, + completionClock, + completionLedgerValidityFact, + ledgerPlacementValid, + weakenAdmissionFact, + Stitch.Custody::conjunctionPreservationFact, + Stitch.Custody::typedMigrationPreservesLiveRecoveryAtObservationTimeFact + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +definition{ + name: applyMigration, + parameters: [ + state : State, + transfer : Stitch.Custody::Transfer, + receipt : Stitch.Custody::Receipt, + fragment : Stitch.Fragments::Fragment, + integrity : Stitch.Custody::FragmentIntegrityObservation, + now : Nat + ], + result: State, + body: (let allowed : Bool := (completeMigrationAllowed state transfer receipt fragment integrity now); (let completed : Stitch.Custody::Transfer := (Stitch.Custody::prepareCompletion (project state placement) transfer receipt fragment integrity now); (let selection : Stitch.Budget::Selection := (Stitch.Budget::selectionFromBool allowed); (record State {objects := (project state objects), encodings := (project state encodings), placement := (choosePlacement selection (Stitch.Custody::migrate (project state placement) completed now) (project state placement)), peers := (project state peers), pointers := (project state pointers), jobs := (project state jobs), checkpoints := (project state checkpoints), ledger := (Stitch.Budget::selectLedger selection (completionLedger (project state ledger) now) (project state ledger)), evidence := (project state evidence), transfers := (if allowed then (Stitch.Custody::recordCompletion (project state transfers) completed) else (project state transfers))})))) +} + +theorem{ + name: migrationRequestDoesNotEstablishCustody, + parameters: [ + state : State, + transfer : Stitch.Custody::Transfer, + cost : Stitch.Budget::Resources, + now : Nat + ], + statement: ((project (requestMigration state transfer cost now) placement) = (project state placement)), + proof: reflexivity{} +} + +theorem{ + name: migrationRequestPreservesProductInvariantFact, + parameters: [ + state : State, + transfer : Stitch.Custody::Transfer, + cost : Stitch.Budget::Resources, + now : Nat + ], + statement: ((((valid state) = true) -> ((valid (requestMigration state transfer cost now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + guardedProductPreservationFact, + ledgerPlacementValiditySelect, + requestMigration, + requestMigrationCandidateValidityFact, + valid + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: migrationRequestPreservesProductInvariant, + parameters: [ + state : State, + transfer : Stitch.Custody::Transfer, + cost : Stitch.Budget::Resources, + now : Nat + ], + statement: (((valid state) = true) -> ((valid (requestMigration state transfer cost now)) = true)), + proof: simplify{definitions: [migrationRequestPreservesProductInvariantFact]}, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: migrationPreservesProductInvariantFact, + parameters: [ + state : State, + transfer : Stitch.Custody::Transfer, + receipt : Stitch.Custody::Receipt, + fragment : Stitch.Fragments::Fragment, + integrity : Stitch.Custody::FragmentIntegrityObservation, + now : Nat + ], + statement: ((((valid state) = true) -> ((valid (applyMigration state transfer receipt fragment integrity now)) = true)) <-> (0 = 0)), + proof: simplify{ + definitions: [ + applyMigration, + guardedProductPreservationFact, + migrationCandidateValidityFact, + productValiditySelect, + valid + ] + }, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: migrationPreservesProductInvariant, + parameters: [ + state : State, + transfer : Stitch.Custody::Transfer, + receipt : Stitch.Custody::Receipt, + fragment : Stitch.Fragments::Fragment, + integrity : Stitch.Custody::FragmentIntegrityObservation, + now : Nat + ], + statement: (((valid state) = true) -> ((valid (applyMigration state transfer receipt fragment integrity now)) = true)), + proof: simplify{definitions: [migrationPreservesProductInvariantFact]}, + axioms: [Classical.choice, Quot.sound, propext] +} + +theorem{ + name: migrationCompletionDoesNotRefundBudget, + parameters: [ + state : State, + transfer : Stitch.Custody::Transfer, + receipt : Stitch.Custody::Receipt, + fragment : Stitch.Fragments::Fragment, + integrity : Stitch.Custody::FragmentIntegrityObservation, + now : Nat + ], + statement: ((project (project (project (applyMigration state transfer receipt fragment integrity now) ledger) budget) reserved) = (project (project (project state ledger) budget) reserved)), + proof: apply{ + arguments: [ + (Stitch.Budget::selectionFromBool (completeMigrationAllowed state transfer receipt fragment integrity now)), + (project state ledger), + now + ], + theorem: completionSelectionReserved + } +} + +definition{ + name: settleActionAllowed, + parameters: [state : State, observation : Stitch.Budget::SettlementObservation, now : Nat], + result: Bool, + body: ((Stitch.Custody::recoverableAt (project state placement) now) && (Stitch.Budget::settleLedgerAllowed (project state ledger) observation now)) +} + +definition{ + name: settleAction, + parameters: [state : State, observation : Stitch.Budget::SettlementObservation, now : Nat], + result: State, + body: (record State {objects := (project state objects), encodings := (project state encodings), placement := (project state placement), peers := (project state peers), pointers := (project state pointers), jobs := (project state jobs), checkpoints := (project state checkpoints), ledger := (if (settleActionAllowed state observation now) then (Stitch.Budget::settleLedger (project state ledger) observation now) else (project state ledger)), evidence := (project state evidence), transfers := (project state transfers)}) +} + +theorem{ + name: settlementDoesNotEstablishCustody, + parameters: [state : State, observation : Stitch.Budget::SettlementObservation, now : Nat], + statement: ((project (settleAction state observation now) placement) = (project state placement)), + proof: reflexivity{} +} +\end{semanticmodule} +\end{lexlean} diff --git a/app/src/Stitch/VmAdministration.lex.tex b/app/src/Stitch/VmAdministration.lex.tex new file mode 100644 index 0000000..fafef10 --- /dev/null +++ b/app/src/Stitch/VmAdministration.lex.tex @@ -0,0 +1,137 @@ +\begin{lexlean}{Stitch.VmAdministration} +\useglossary{lexlean.std.bool@1.2.0} +\useglossary{lexlean.std.nat@1.2.0} +\useglossary{stitch.domain@1.0.0} +\title{Stitch recoverable service model} +\begin{semanticmodule} +definition{ + name: shareAllowed, + parameters: [granted : Bool, current : Bool, blocked : Bool], + result: Bool, + body: (granted && (current && (not blocked))) +} + +definition{ + name: ethernetAllowed, + parameters: [ + granted : Bool, + ready : Bool, + current : Bool, + open : Bool, + valid : Bool, + blocked : Bool + ], + result: Bool, + body: (granted && (ready && (current && (open && (valid && (not blocked)))))) +} + +definition{ + name: commandAllowed, + parameters: [ready : Bool, busy : Bool, blocked : Bool, capacity : Bool], + result: Bool, + body: (ready && ((not busy) && ((not blocked) && capacity))) +} + +definition{ + name: observationAllowed, + parameters: [ + generation : Nat, + captured : Nat, + sameInstance : Bool, + dispatched : Bool, + blocked : Bool + ], + result: Bool, + body: ((generation =? captured) && (sameInstance && (dispatched && (not blocked)))) +} + +definition{ + name: administrationAllowed, + parameters: [instancePresent : Bool, busy : Bool], + result: Bool, + body: (instancePresent && (not busy)) +} + +definition{ + name: forgetAllowed, + parameters: [present : Bool, resolved : Bool, busy : Bool], + result: Bool, + body: (present && (resolved && (not busy))) +} + +definition{ + name: allocationAllowed, + parameters: [used : Nat, requested : Nat, limit : Nat], + result: Bool, + body: ((used + requested) <=? limit) +} + +definition{ + name: metadataAllowed, + parameters: [used : Nat, limit : Nat], + result: Bool, + body: (used 0 + | Option.some byte => (prim to_nat byte : Nat)), + axioms: [Quot.sound, propext] +} + +definition{ + name: unsignedBE, + parameters: [request : Bytes, offset : Nat, remaining : Nat, accumulated : Nat], + result: Nat, + body: (match remaining + | Nat.zero => accumulated + | Nat.succ rest => (unsignedBE request (offset + 1) rest ((prim multiply accumulated 256 : Nat) + (byteNat request offset)))), + axioms: [Quot.sound, propext], + recursive_argument: remaining +} + +definition{ + name: flag, + parameters: [request : Bytes, offset : Nat], + result: Bool, + body: ((byteNat request offset) =? 1), + axioms: [Quot.sound, propext] +} + +definition{ + name: flagsCanonical, + parameters: [request : Bytes, offset : Nat, remaining : Nat], + result: Bool, + body: (match remaining + | Nat.zero => true + | Nat.succ rest => (((byteNat request offset) <=? 1) && (flagsCanonical request (offset + 1) rest))), + axioms: [Quot.sound, propext], + recursive_argument: remaining +} + +definition{ + name: verdict, + parameters: [allowed : Bool], + result: Bytes, + body: (if allowed then (prim utf8_encode "admit" : Bytes) else (prim utf8_encode "refuse" : Bytes)) +} + +definition{ + name: decimalDigit, + parameters: [value : Nat], + result: Bytes, + body: (if (value =? 0) then 0x30 else (if (value =? 1) then 0x31 else (if (value =? 2) then 0x32 else (if (value =? 3) then 0x33 else (if (value =? 4) then 0x34 else (if (value =? 5) then 0x35 else (if (value =? 6) then 0x36 else (if (value =? 7) then 0x37 else (if (value =? 8) then 0x38 else 0x39))))))))) +} + +definition{ + name: decimalBytes, + parameters: [value : Nat, remaining : Nat], + result: Bytes, + body: (match remaining + | Nat.zero => 0x + | Nat.succ rest => (if (value /lexlean.toml lock`, then `build --all`, then `verify --all`. Only temporary candidate locks/output may change. Preserve original source bytes and compare their hashes. +3. Obtain runtime `.lean` sources emitted by that candidate, not from the old SDK or by text patching. In this rehearsal they were copied unchanged from the running verifier's `.lexlean/verified/.staging-*/lean-src` workspace before cleanup; the verification was then required to finish successfully. Stitch's snapshot contains all 25 generated app modules and the three emitted runtime modules. Template's three generated modules came from its build tree; its sole Portable runtime was reused byte-for-byte from the same candidate's emitted runtime. The per-file hashes are in each `generated-native-inputs.json`. +4. Stage those exact generated files in a new native workspace with the accompanying `lakefile.toml`. No `.lake` cache is copied. Run `LEAN_NUM_THREADS=2 lake --verbose build PrismGenerated` with the actual pinned Lake executable on PATH and a 600-second process bound. Both configs use `moreLeanArgs = ["-j2"]`; all native roots are explicit. The logs retain emitted `lean ... -c` commands as evidence that this was native C emission, not an object-only shortcut. +5. Compare exit status, outputs, source provenance, and the resulting evidence with this report. A new compiler or changed source requires its own result; these attestations must not be reused for other inputs. + +No runtime was edited, no Laws import was removed, and no kernel or policy check was disabled. Logs contain temporary diagnostic paths; no full duplicate source tree or binary is included here. + +## Remaining acceptance boundary + +This rehearsal uses the real proposed compiler and demonstrates that it removes the previously observed native stall on these inputs. It does not run the absent local `prismpm` executable, prove complete SDK compatibility, replace the repository's unchanged artifact/vector gate, or qualify external browser/provider/VM behavior. LexLean's full acceptance and the SDK owner's compiler-pair/immutable-artifact qualification remain separate requirements. Track [LexLean #465 / PR #466](https://github.com/UOR-Foundation/LexLean/pull/466) and the existing [PrismPM SDK owner coordination](https://github.com/UOR-Foundation/PrismPM/issues/194#issuecomment-6780585108). Published tags remain untouched. + +## Updated placement-source rehearsal + +The later source checkpoint `c99dc0d74d8b0f1c036df1aff18cc047b3bf5c1a` adds the placement declarations while retaining 25 app modules. Its separate evidence is in `stitch-placement/`; the original `stitch/` result above remains scoped to its earlier input. + +All 25 source files were compared against this exact commit. Actual candidate `lock` and `build --all` ran only in an isolated exported app tree, yielding build `0ad014252e6f1ff6af86aad9d33e66b760cf38724c1fe8d25cd2dcb4cb3859d9`. The 25 freshly generated app modules and the three unchanged runtime modules emitted by the same candidate compiler were staged in a fresh native directory. The unchanged native command/configuration passed all 30 jobs with exit 0 in 16.093 seconds under the same 600-second bound. + +Only affected candidate generation and cold native compilation were repeated. Full candidate verification and the unchanged Template rehearsal were not repeated, so the earlier candidate attestation must not be attributed to this new source. The accepted-pinned source proof is recorded separately by the project; this diagnostic does not replace it or whole-SDK qualification. No accepted lock was modified. diff --git a/docs/evidence/native-candidate-466/SHA256SUMS b/docs/evidence/native-candidate-466/SHA256SUMS new file mode 100644 index 0000000..58bc0b1 --- /dev/null +++ b/docs/evidence/native-candidate-466/SHA256SUMS @@ -0,0 +1,33 @@ +53fbb8bf98b02ef293c49195ec2a26a1b58717a76dea9f07fe307ad890064ec9 README.md +2c11cc903ada3522d60681b2a0afbe22ccd7d5267cca78300654ca6ac688fa53 compiler/README.txt +4be6e17d2e2cc720e42cae9456ba3a7f4cd4526e0bd1c43526813c9fb4cae48b compiler/artifact.json +8e3538e0ab5f81a3ee04927d8838c8c674e0e112838b4b3ce87ec218143276af compiler/lean-toolchain +c8a20b27c959a259477cf5176ac00f36f9eb94f71bbc68b6745e9c2159f20970 compiler/lean-version.txt +108892b177299a457cd3dfc9058c52abdf1fd79172c43c4020ea817f4bed61c9 compiler/lexlean.sha256 +4ae64ac5dc4f595ef8ffd63e4b48231bd8ba972a949e5eac0182257e8408921f compiler/rt03-success.txt +7ed1e0ac881493fd6dbbe3ce96c5f743f933dda86d08654d1d69cdcc242c205d compiler/rt03.log +24a5037a8f0a264369ef37bb46e019ade6c524beaead1c28f77a429f856a066b compiler/rust-toolchain.toml +b2bdf493bcf6d1dc55181a0efc2774b6d9cf7bf5c8dcc5bed592c994b2ad38c4 compiler/rust-version.txt +de9ccef885b037ae49c80d4796c10d6799e6e199bf0b419bc85a9305e4c113bd compiler/source-commit.txt +f34bb2dc2662961e6f2978f459a851bf1bda81000e7ee24e9f1e4c0b9a409295 compiler/source-tree.txt +d3b733785f18a99c6c0fc1136d95440e31b3985880d73d660d60cba6c604eed3 stitch/build.log +56a22b9240738adea4258695fd44713aa30123778eec3f41d37fdf963c7250c0 stitch/generated-native-inputs.json +39ffa560a90f946f8eb06470336eaa6e04b2f2bc4e1df1fc48748f58fcf02430 stitch/lakefile.toml +f6bd0e7353ce6bf0e9379cbb699ac0638d64bc4f593beae1b06a232007568182 stitch/native-result.json +2055e63823a3b8ee792d505c141a8838bab25d511a84a7d6c0a6a031edc29d4f stitch/native.log +56c8f918b8ee1f4ef4151a7bf67526186bce4eabbf9d97104379ebd05dd20d63 stitch/remote-app-comparison.json +fa387bc7599aac2b77405bb6e68addc6f577538386ed812d3c493b403246f15d stitch/source-provenance.json +9dd1cf6293306829b0d7983531417ec7e216b7ece8c2baa32b1df33a12702743 stitch/verify.log +f031f036a83aec6a519748edb9b05f74bedf26fb67ef4f9194af86ed44638748 stitch-placement/build.log +1c945d16dcb9cf3974a94244ff46fef923b8526e7988869af24a5bb90bd55406 stitch-placement/generated-native-inputs.json +39ffa560a90f946f8eb06470336eaa6e04b2f2bc4e1df1fc48748f58fcf02430 stitch-placement/lakefile.toml +d36093311fa7e1a54ea40e5f8d2179a7424b05bef40ef27d309cdb36c1b7ef8a stitch-placement/native-result.json +64532247e7c18692438f6bc085ca479683cbb7999ce6ab91998fa0e2d9ab1f91 stitch-placement/native.log +e76c0f14afe57cc134a22244be871c493397750faa53da28675c339a42da330e stitch-placement/source-provenance.json +520a9b41e0925ab3429c98df99ab767f9e63846b90a8a4b4c4bac00871fb7076 template/build.log +2d7484d7290810bcb09824c6ea6d866ba8dee0bb15459e7a7b08d1b8baa056a8 template/generated-native-inputs.json +9ddc8f1d505f324a5e882683c3f62ac98568d3808d66d855921565a034f8baec template/lakefile.toml +c783d874b3b8352220ef6d20ce20122fde6af979d89812b58c0df8a6a3e0bb7e template/native-result.json +992722340b1cd248d607dc556620e978123341cdb7f720ed919a7ed5e20696af template/native.log +ef2685deccfa24a2087cecabb137af37b7dc3e15d6e82235b99dd6a53e846eef template/source-provenance.json +2863faed2cb0fe32bb71f495b594963cbe2f525eba7d08ad6449637a8e5de804 template/verify.log diff --git a/docs/evidence/native-candidate-466/compiler/README.txt b/docs/evidence/native-candidate-466/compiler/README.txt new file mode 100644 index 0000000..3009038 --- /dev/null +++ b/docs/evidence/native-candidate-466/compiler/README.txt @@ -0,0 +1 @@ +DIAGNOSTIC ONLY. Not a released compiler, qualified SDK, or acceptance substitute. Source is PR466 cc5561203. No product gate has been weakened. RT-03 result and source provenance must accompany any rehearsal. diff --git a/docs/evidence/native-candidate-466/compiler/artifact.json b/docs/evidence/native-candidate-466/compiler/artifact.json new file mode 100644 index 0000000..ce15c51 --- /dev/null +++ b/docs/evidence/native-candidate-466/compiler/artifact.json @@ -0,0 +1,11 @@ +{ + "repository": "UOR-Foundation/LexLean", + "pull_request": 466, + "run_id": 42910816795, + "artifact_id": 13807497041, + "name": "native-candidate-cc5561203-diagnostic-only", + "zip_sha256": "36c696b3ef8c6640b3ed33f058577494ab8a7871931c565e1135dd27add22755", + "binary_sha256": "05ed3b3da7390aa8250288841cbe6baecc20ef28e96249df3d7682b8a51a4cfa", + "expires_at": "2026-11-17T22:06:31Z", + "qualified_sdk": false +} diff --git a/docs/evidence/native-candidate-466/compiler/lean-toolchain b/docs/evidence/native-candidate-466/compiler/lean-toolchain new file mode 100644 index 0000000..2b61957 --- /dev/null +++ b/docs/evidence/native-candidate-466/compiler/lean-toolchain @@ -0,0 +1 @@ +leanprover/lean4:v4.32.1 diff --git a/docs/evidence/native-candidate-466/compiler/lean-version.txt b/docs/evidence/native-candidate-466/compiler/lean-version.txt new file mode 100644 index 0000000..63c062a --- /dev/null +++ b/docs/evidence/native-candidate-466/compiler/lean-version.txt @@ -0,0 +1 @@ +Lean (version 4.32.1, x86_64-unknown-linux-gnu, commit f054605aea4b840552cca2e725580bffd1e1b704, Release) diff --git a/docs/evidence/native-candidate-466/compiler/lexlean.sha256 b/docs/evidence/native-candidate-466/compiler/lexlean.sha256 new file mode 100644 index 0000000..2aa9294 --- /dev/null +++ b/docs/evidence/native-candidate-466/compiler/lexlean.sha256 @@ -0,0 +1 @@ +05ed3b3da7390aa8250288841cbe6baecc20ef28e96249df3d7682b8a51a4cfa diagnostic/lexlean diff --git a/docs/evidence/native-candidate-466/compiler/rt03-success.txt b/docs/evidence/native-candidate-466/compiler/rt03-success.txt new file mode 100644 index 0000000..eb3a1df --- /dev/null +++ b/docs/evidence/native-candidate-466/compiler/rt03-success.txt @@ -0,0 +1 @@ +RT-03 passed on the recorded source and toolchains. diff --git a/docs/evidence/native-candidate-466/compiler/rt03.log b/docs/evidence/native-candidate-466/compiler/rt03.log new file mode 100644 index 0000000..f8bc904 --- /dev/null +++ b/docs/evidence/native-candidate-466/compiler/rt03.log @@ -0,0 +1,11 @@ + Compiling repo-model v0.4.0 (/home/runner/work/LexLean/LexLean/crates/model) + Compiling repo-conformance v0.4.0 (/home/runner/work/LexLean/LexLean/crates/conformance) + Finished `test` profile [unoptimized + debuginfo] target(s) in 29.46s + Running tests/conformance.rs (target/debug/deps/conformance-4b02e7ab9c96bbf8) + +running 1 test +test conformance_rt_03 has been running for over 60 seconds +test conformance_rt_03 ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 481 filtered out; finished in 93.02s + diff --git a/docs/evidence/native-candidate-466/compiler/rust-toolchain.toml b/docs/evidence/native-candidate-466/compiler/rust-toolchain.toml new file mode 100644 index 0000000..5ec5869 --- /dev/null +++ b/docs/evidence/native-candidate-466/compiler/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.97.1" +components = ["rustfmt", "clippy"] +profile = "minimal" diff --git a/docs/evidence/native-candidate-466/compiler/rust-version.txt b/docs/evidence/native-candidate-466/compiler/rust-version.txt new file mode 100644 index 0000000..e6706a0 --- /dev/null +++ b/docs/evidence/native-candidate-466/compiler/rust-version.txt @@ -0,0 +1,7 @@ +rustc 1.97.1 (8bab26f4f 2026-07-14) +binary: rustc +commit-hash: 8bab26f4f68e0e26f0bb7960be334d5b520ea452 +commit-date: 2026-07-14 +host: x86_64-unknown-linux-gnu +release: 1.97.1 +LLVM version: 22.1.6 diff --git a/docs/evidence/native-candidate-466/compiler/source-commit.txt b/docs/evidence/native-candidate-466/compiler/source-commit.txt new file mode 100644 index 0000000..5aa8435 --- /dev/null +++ b/docs/evidence/native-candidate-466/compiler/source-commit.txt @@ -0,0 +1 @@ +cc5561203de8fa5594d573904147a306b2b8bbbf diff --git a/docs/evidence/native-candidate-466/compiler/source-tree.txt b/docs/evidence/native-candidate-466/compiler/source-tree.txt new file mode 100644 index 0000000..0c0cc2a --- /dev/null +++ b/docs/evidence/native-candidate-466/compiler/source-tree.txt @@ -0,0 +1 @@ +c2bbc659b3cea7d58f2a2d0557579d8b2e92ff9e diff --git a/docs/evidence/native-candidate-466/stitch-placement/build.log b/docs/evidence/native-candidate-466/stitch-placement/build.log new file mode 100644 index 0000000..006dec6 --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch-placement/build.log @@ -0,0 +1 @@ +built 25 modules at .lexlean/build/0ad014252e6f1ff6af86aad9d33e66b760cf38724c1fe8d25cd2dcb4cb3859d9 diff --git a/docs/evidence/native-candidate-466/stitch-placement/generated-native-inputs.json b/docs/evidence/native-candidate-466/stitch-placement/generated-native-inputs.json new file mode 100644 index 0000000..9b576ab --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch-placement/generated-native-inputs.json @@ -0,0 +1,114 @@ +[ + { + "path": "LexLeanRuntime/Collections.lean", + "sha256": "03ef41e76f1d32fe97a3b31b91215b3f3caac53fd0c1422abd9efc1a80cd735b" + }, + { + "path": "LexLeanRuntime/Laws.lean", + "sha256": "918e4e066b31216aee098bbfbc41deeb90aefdb88363e94dfe2771303155ae5e" + }, + { + "path": "LexLeanRuntime/Portable.lean", + "sha256": "9a081b865659a3c13a6721ef7c5c93aec0b1ae2ce63bbd38286ec6d28483f8de" + }, + { + "path": "StitchModel/Foundation/Arch.lean", + "sha256": "145af2c29196e286de0fff938a17a61915bb6faac2759141272ce74fa246d608" + }, + { + "path": "StitchModel/Foundation/Bytes.lean", + "sha256": "2376718e1fbece860ef4b9a3ae24ec668e5045db118dfd4c7a7a2c7b7d2e4b39" + }, + { + "path": "StitchModel/Foundation/View/Text/V1/Model.lean", + "sha256": "70473365be15858a0c870172c27ac142f096afe1aee2432eaab2d828af1d55bf" + }, + { + "path": "StitchModel/Product/Architecture.lean", + "sha256": "c4808cbb1a1eccf8b593155d5b9dc1b5e26c3c24526239bb7adac25b46fce773" + }, + { + "path": "StitchModel/Product/Experience.lean", + "sha256": "928dbd1f867a52ec7d1b2d209e644ea1b815376f4c5dbdb89c54b0deec04b05e" + }, + { + "path": "StitchModel/Product/Host.lean", + "sha256": "4feb419016272af67eae5597304d117b4b1a2c7acd759b85493abb067dd0c768" + }, + { + "path": "StitchModel/Product/Model.lean", + "sha256": "6aa18fb9718d254567c5d2b0ed9f97a1d461096fb7fde4af40115aa392936d6d" + }, + { + "path": "StitchModel/Stitch/Authority.lean", + "sha256": "a89ebf120a05fa48a03a46c55bfbff5d2ab30554a7020a6aee491e88072f6f54" + }, + { + "path": "StitchModel/Stitch/Budget.lean", + "sha256": "01f469628c84e8cf66aa9497ed0e82d3f547ae695c7f2a61efb7c8b8bb64fcd7" + }, + { + "path": "StitchModel/Stitch/ChannelFlow.lean", + "sha256": "88ff390c120c789e97f5d56b117d6634806e45f758436be08dc2cc88b5c470b9" + }, + { + "path": "StitchModel/Stitch/Compute.lean", + "sha256": "5e59cbb806a08a0f18a3ac4061704621c435815022d9d8b15896e28104cca191" + }, + { + "path": "StitchModel/Stitch/Custody.lean", + "sha256": "784e463ef8b1f7b3f6d7d6aace5f8750911e20436e020e855c2e9cdbee466765" + }, + { + "path": "StitchModel/Stitch/Effects.lean", + "sha256": "fabf1fbd169c1c9c4043224b2ac253b0c78967e45889389e6d7f5cf90862f1c8" + }, + { + "path": "StitchModel/Stitch/Encoding.lean", + "sha256": "c2b2a20927f3f039298791f30abd4a9cc992b6eaf29334b0b81b3d1f68d98bad" + }, + { + "path": "StitchModel/Stitch/Evidence.lean", + "sha256": "1c6d4247e09a311388b0adf319aa5c59c3807386a2b93527e0120c275a3bad02" + }, + { + "path": "StitchModel/Stitch/Fragments.lean", + "sha256": "556d72531877ee3eb23acf6321b1aadfcc33c1eaaa4b1f3d227c032265aa90fb" + }, + { + "path": "StitchModel/Stitch/Identity.lean", + "sha256": "633907978f9b550c37af80d6b4c975a895e4a9cd09e512d6d0540ba04683dedf" + }, + { + "path": "StitchModel/Stitch/Observation.lean", + "sha256": "4b4ec280f91782403b0c83591f097c8894fc3f70d4545fc60659431c88b6431c" + }, + { + "path": "StitchModel/Stitch/Pointer.lean", + "sha256": "77deec698881364e8739668f427208ce787f376e920a44cc0c2733cb9e04a0ce" + }, + { + "path": "StitchModel/Stitch/Recovery.lean", + "sha256": "71b64b56354ea7f9a02de2f9489fc407e8daf02d26c5773d31a64278240c281a" + }, + { + "path": "StitchModel/Stitch/Relay.lean", + "sha256": "948fe7db4bbe2046c574e5883a17648573f2533bbb5f2a475a278610c6114eda" + }, + { + "path": "StitchModel/Stitch/Signaling.lean", + "sha256": "44713b2e8c2beb9b66658a3ce638f5e7e94285b596cb87458278e2a6925633fb" + }, + { + "path": "StitchModel/Stitch/System.lean", + "sha256": "b5f20f50ccf11fb0b6f403f4f4b2d43f628c7564c6d7630d7d3c956aec7f1ebf" + }, + { + "path": "StitchModel/Stitch/VmAdministration.lean", + "sha256": "2f654ffecc923b2c9c3d2bf17365af6e46eaa945f48cdcd532803c1b0e014db8" + }, + { + "path": "StitchModel/StitchApp.lean", + "sha256": "ccb080862681bb34a67c86fa0d9ec1618969a5de6b097c3e246519d32ec8f47e" + } +] diff --git a/docs/evidence/native-candidate-466/stitch-placement/lakefile.toml b/docs/evidence/native-candidate-466/stitch-placement/lakefile.toml new file mode 100644 index 0000000..36e7e0b --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch-placement/lakefile.toml @@ -0,0 +1,7 @@ +name = "prismpm_verify" +version = "0.1.0" + +[[lean_lib]] +name = "PrismGenerated" +roots = ["LexLeanRuntime.Collections", "LexLeanRuntime.Laws", "LexLeanRuntime.Portable", "StitchModel.Foundation.Arch", "StitchModel.Foundation.Bytes", "StitchModel.Foundation.View.Text.V1.Model", "StitchModel.Product.Architecture", "StitchModel.Product.Experience", "StitchModel.Product.Host", "StitchModel.Product.Model", "StitchModel.Stitch.Authority", "StitchModel.Stitch.Budget", "StitchModel.Stitch.ChannelFlow", "StitchModel.Stitch.Compute", "StitchModel.Stitch.Custody", "StitchModel.Stitch.Effects", "StitchModel.Stitch.Encoding", "StitchModel.Stitch.Evidence", "StitchModel.Stitch.Fragments", "StitchModel.Stitch.Identity", "StitchModel.Stitch.Observation", "StitchModel.Stitch.Pointer", "StitchModel.Stitch.Recovery", "StitchModel.Stitch.Relay", "StitchModel.Stitch.Signaling", "StitchModel.Stitch.System", "StitchModel.Stitch.VmAdministration", "StitchModel.StitchApp"] +moreLeanArgs = ["-j2"] diff --git a/docs/evidence/native-candidate-466/stitch-placement/native-result.json b/docs/evidence/native-candidate-466/stitch-placement/native-result.json new file mode 100644 index 0000000..9dffa52 --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch-placement/native-result.json @@ -0,0 +1 @@ +{"seconds": 16.09338469209615, "exit": 0} \ No newline at end of file diff --git a/docs/evidence/native-candidate-466/stitch-placement/native.log b/docs/evidence/native-candidate-466/stitch-placement/native.log new file mode 100644 index 0000000..8aa993a --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch-placement/native.log @@ -0,0 +1,62 @@ +info: prismpm_verify: no previous manifest, creating one from scratch +info: toolchain not updated; no toolchain information found +✔ [0/30] Ran job computation +✔ [1/30] Ran prismpm_verify:extraDep +ℹ [2/30] Built LexLeanRuntime.Collections (3.2s) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/LexLeanRuntime/Collections.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Collections.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Collections.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/LexLeanRuntime/Collections.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/LexLeanRuntime/Collections.setup.json --json +ℹ [3/30] Built LexLeanRuntime.Portable (3.4s) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/LexLeanRuntime/Portable.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Portable.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Portable.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/LexLeanRuntime/Portable.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/LexLeanRuntime/Portable.setup.json --json +ℹ [4/30] Built StitchModel.Foundation.Arch (294ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Foundation/Arch.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/Arch.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/Arch.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Foundation/Arch.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Foundation/Arch.setup.json --json +ℹ [5/30] Built StitchModel.Foundation.View.Text.V1.Model (234ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Foundation/View/Text/V1/Model.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/View/Text/V1/Model.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/View/Text/V1/Model.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Foundation/View/Text/V1/Model.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Foundation/View/Text/V1/Model.setup.json --json +ℹ [6/30] Built StitchModel.Stitch.Authority (281ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Authority.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Authority.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Authority.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Authority.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Authority.setup.json --json +ℹ [7/30] Built StitchModel.Product.Experience (621ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Product/Experience.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Experience.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Experience.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Product/Experience.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Product/Experience.setup.json --json +ℹ [8/30] Built StitchModel.Stitch.ChannelFlow (209ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/ChannelFlow.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/ChannelFlow.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/ChannelFlow.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/ChannelFlow.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/ChannelFlow.setup.json --json +ℹ [9/30] Built StitchModel.Stitch.Signaling (195ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Signaling.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Signaling.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Signaling.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Signaling.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Signaling.setup.json --json +ℹ [10/30] Built StitchModel.Stitch.VmAdministration (206ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/VmAdministration.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/VmAdministration.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/VmAdministration.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/VmAdministration.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/VmAdministration.setup.json --json +ℹ [11/30] Built StitchModel.Stitch.Relay (343ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Relay.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Relay.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Relay.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Relay.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Relay.setup.json --json +ℹ [12/30] Built StitchModel.Foundation.Bytes (229ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Foundation/Bytes.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/Bytes.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/Bytes.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Foundation/Bytes.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Foundation/Bytes.setup.json --json +ℹ [13/30] Built LexLeanRuntime.Laws (3.6s) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/LexLeanRuntime/Laws.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Laws.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Laws.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/LexLeanRuntime/Laws.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/LexLeanRuntime/Laws.setup.json --json +ℹ [14/30] Built StitchModel.Product.Model (4.3s) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Product/Model.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Model.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Model.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Product/Model.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Product/Model.setup.json --json +ℹ [15/30] Built StitchModel.Product.Architecture (297ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Product/Architecture.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Architecture.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Architecture.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Product/Architecture.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Product/Architecture.setup.json --json +ℹ [16/30] Built StitchModel.Stitch.Recovery (341ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Recovery.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Recovery.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Recovery.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Recovery.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Recovery.setup.json --json +ℹ [17/30] Built StitchModel.Stitch.Observation (322ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Observation.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Observation.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Observation.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Observation.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Observation.setup.json --json +ℹ [18/30] Built StitchModel.Stitch.Effects (787ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Effects.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Effects.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Effects.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Effects.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Effects.setup.json --json +ℹ [19/30] Built StitchModel.Stitch.Identity (250ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Identity.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Identity.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Identity.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Identity.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Identity.setup.json --json +ℹ [20/30] Built StitchModel.Stitch.Encoding (310ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Encoding.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Encoding.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Encoding.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Encoding.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Encoding.setup.json --json +ℹ [21/30] Built StitchModel.Stitch.Compute (1.2s) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Compute.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Compute.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Compute.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Compute.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Compute.setup.json --json +ℹ [22/30] Built StitchModel.Stitch.Pointer (318ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Pointer.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Pointer.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Pointer.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Pointer.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Pointer.setup.json --json +ℹ [23/30] Built StitchModel.Stitch.Fragments (490ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Fragments.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Fragments.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Fragments.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Fragments.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Fragments.setup.json --json +ℹ [24/30] Built StitchModel.Stitch.Evidence (571ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Evidence.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Evidence.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Evidence.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Evidence.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Evidence.setup.json --json +ℹ [25/30] Built StitchModel.Stitch.Budget (3.0s) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Budget.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Budget.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Budget.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Budget.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Budget.setup.json --json +ℹ [26/30] Built StitchModel.Stitch.Custody (1.9s) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/Custody.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Custody.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Custody.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Custody.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Custody.setup.json --json +ℹ [27/30] Built StitchModel.Product.Host (506ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Product/Host.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Host.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Host.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Product/Host.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Product/Host.setup.json --json +ℹ [28/30] Built StitchModel.Stitch.System (511ms) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/Stitch/System.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/System.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/System.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/System.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/Stitch/System.setup.json --json +ℹ [29/30] Built StitchModel.StitchApp (1.3s) +trace: .> LEAN_PATH=/tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-placement-diagnostic/native/StitchModel/StitchApp.lean -o /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/StitchApp.olean -i /tmp/stitch-466-placement-diagnostic/native/.lake/build/lib/lean/StitchModel/StitchApp.ilean -c /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/StitchApp.c --setup /tmp/stitch-466-placement-diagnostic/native/.lake/build/ir/StitchModel/StitchApp.setup.json --json +✔ [30/30] Ran prismpm_verify/PrismGenerated:default +Build completed successfully (30 jobs). diff --git a/docs/evidence/native-candidate-466/stitch-placement/source-provenance.json b/docs/evidence/native-candidate-466/stitch-placement/source-provenance.json new file mode 100644 index 0000000..d136323 --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch-placement/source-provenance.json @@ -0,0 +1,105 @@ +{ + "source_commit": "c99dc0d74d8b0f1c036df1aff18cc047b3bf5c1a", + "files": [ + { + "path": "app/src/Foundation/Arch.lex.tex", + "sha256": "54fdc8eb15c46707e445ff99814d6cbd1731967f801bf064a6c1f4cc01c45394" + }, + { + "path": "app/src/Foundation/Bytes.lex.tex", + "sha256": "ce16e5b439128db3231979381f4599d3ff0617f62c2bf00c348bba35393abcd6" + }, + { + "path": "app/src/Foundation/View/Text/V1/Model.lex.tex", + "sha256": "db124343ad8fe1295bc8eb305c7f59f83cf6ad76d46a5cabea500fe66f3ad5dc" + }, + { + "path": "app/src/Product/Architecture.lex.tex", + "sha256": "d5cc5fd4e64070bddd5c0edc8cb3a318a0965b5e1574efe9a9dfa483b12e8d6d" + }, + { + "path": "app/src/Product/Experience.lex.tex", + "sha256": "10bd1e9b22dc5697b752240ce6d566160dc65bb5810f6a520cb8018f5ff79743" + }, + { + "path": "app/src/Product/Host.lex.tex", + "sha256": "3bb2a621868dc683e776c9b65c58cc60cc2b89e5d007d54c4c152bedd4878871" + }, + { + "path": "app/src/Product/Model.lex.tex", + "sha256": "a811754e08b17292e45f049b9822d7d8d53625a1efdc516687bf8c14aeb44cdb" + }, + { + "path": "app/src/Stitch/Authority.lex.tex", + "sha256": "10afc7af1503f08fe7806dbab24d93f565f34370e3b7d18135f48297e64ee573" + }, + { + "path": "app/src/Stitch/Budget.lex.tex", + "sha256": "581ae188297e3e03e69869a3cfbcdae9554706e007cbeb238d97c8ad30229911" + }, + { + "path": "app/src/Stitch/ChannelFlow.lex.tex", + "sha256": "7f4356ddd38fc94b32a2d6af237ce7382c34bdc7db43c8e8d6ab94cd94fc3e63" + }, + { + "path": "app/src/Stitch/Compute.lex.tex", + "sha256": "ef0f1b8dcf15a8ff26a206b7bd8fa51736bb54ae14e7b6e71a4296deeb4528b7" + }, + { + "path": "app/src/Stitch/Custody.lex.tex", + "sha256": "e9084ba97058adfd3017e634215af1dee12d89c4ff0d409a4271f05387d8d663" + }, + { + "path": "app/src/Stitch/Effects.lex.tex", + "sha256": "7ccc2c30cca7df663541ceece0c85226f921160f56f4ec681703a8d5b589263b" + }, + { + "path": "app/src/Stitch/Encoding.lex.tex", + "sha256": "75b412ab0ed56dea3aa41cc77705fb6233991ea1c2e600a7cf509c3b84e5a95f" + }, + { + "path": "app/src/Stitch/Evidence.lex.tex", + "sha256": "39011e1cf70295427f716d328b1ab754242d3667f0e70a8a48dffa735465c79e" + }, + { + "path": "app/src/Stitch/Fragments.lex.tex", + "sha256": "5cd8d0602cbe501ae4ffc5c18dde17fc6e5766d930ac1d9277545d1ef8d88b83" + }, + { + "path": "app/src/Stitch/Identity.lex.tex", + "sha256": "c4c159234e1623b8f339e86cf47da55c89d197bf21fe334bd893f575ba053870" + }, + { + "path": "app/src/Stitch/Observation.lex.tex", + "sha256": "fe3205a68576d8c7d82f86b45b78f8b6c8b49a873f00c448cccb2eb459749ae8" + }, + { + "path": "app/src/Stitch/Pointer.lex.tex", + "sha256": "10239748c402cdadfc36b150a7a103dfe5124d81fa27bb276575810470c89c46" + }, + { + "path": "app/src/Stitch/Recovery.lex.tex", + "sha256": "4a29e91526ffd1c5aa9fcfc8d990ca1b89d5129813742d9ae55e688eeb6a9121" + }, + { + "path": "app/src/Stitch/Relay.lex.tex", + "sha256": "26a3b5c7f8af3cb058800716a5b73111adbe0188436ae1ad87e1a0e6ce118a03" + }, + { + "path": "app/src/Stitch/Signaling.lex.tex", + "sha256": "97bdfb5160e41a4ed3ab30788f2e3a558836f622c237e4bd3496536212b330c9" + }, + { + "path": "app/src/Stitch/System.lex.tex", + "sha256": "b05a639514a2c56f40b8e960c6cf31023aec8b20d1c18c5ed68a0a936a9d7119" + }, + { + "path": "app/src/Stitch/VmAdministration.lex.tex", + "sha256": "4e578e7e5c9a4f1c83d0181acae555a1c184dd72777473465448a7675b2bb32c" + }, + { + "path": "app/src/StitchApp.lex.tex", + "sha256": "ffd8a4b6b9072b27b06d67d61e1c11d085a6b82e84be4610f27f3805d87f675b" + } + ] +} diff --git a/docs/evidence/native-candidate-466/stitch/build.log b/docs/evidence/native-candidate-466/stitch/build.log new file mode 100644 index 0000000..0000b35 --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch/build.log @@ -0,0 +1 @@ +built 25 modules at .lexlean/build/4e13e97134125c82b1ea9c8c6749558bc9b5b70d4f9b4b248b98382b6f2077c1 diff --git a/docs/evidence/native-candidate-466/stitch/generated-native-inputs.json b/docs/evidence/native-candidate-466/stitch/generated-native-inputs.json new file mode 100644 index 0000000..5563232 --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch/generated-native-inputs.json @@ -0,0 +1,114 @@ +[ + { + "path": "LexLeanRuntime/Collections.lean", + "sha256": "03ef41e76f1d32fe97a3b31b91215b3f3caac53fd0c1422abd9efc1a80cd735b" + }, + { + "path": "LexLeanRuntime/Laws.lean", + "sha256": "918e4e066b31216aee098bbfbc41deeb90aefdb88363e94dfe2771303155ae5e" + }, + { + "path": "LexLeanRuntime/Portable.lean", + "sha256": "9a081b865659a3c13a6721ef7c5c93aec0b1ae2ce63bbd38286ec6d28483f8de" + }, + { + "path": "StitchModel/Foundation/Arch.lean", + "sha256": "145af2c29196e286de0fff938a17a61915bb6faac2759141272ce74fa246d608" + }, + { + "path": "StitchModel/Foundation/Bytes.lean", + "sha256": "2376718e1fbece860ef4b9a3ae24ec668e5045db118dfd4c7a7a2c7b7d2e4b39" + }, + { + "path": "StitchModel/Foundation/View/Text/V1/Model.lean", + "sha256": "70473365be15858a0c870172c27ac142f096afe1aee2432eaab2d828af1d55bf" + }, + { + "path": "StitchModel/Product/Architecture.lean", + "sha256": "c4808cbb1a1eccf8b593155d5b9dc1b5e26c3c24526239bb7adac25b46fce773" + }, + { + "path": "StitchModel/Product/Experience.lean", + "sha256": "0f84782596b1cf620e174bf771582e6225c494195c8819a1c7e7afd47ab066ab" + }, + { + "path": "StitchModel/Product/Host.lean", + "sha256": "4feb419016272af67eae5597304d117b4b1a2c7acd759b85493abb067dd0c768" + }, + { + "path": "StitchModel/Product/Model.lean", + "sha256": "6aa18fb9718d254567c5d2b0ed9f97a1d461096fb7fde4af40115aa392936d6d" + }, + { + "path": "StitchModel/Stitch/Authority.lean", + "sha256": "a89ebf120a05fa48a03a46c55bfbff5d2ab30554a7020a6aee491e88072f6f54" + }, + { + "path": "StitchModel/Stitch/Budget.lean", + "sha256": "01f469628c84e8cf66aa9497ed0e82d3f547ae695c7f2a61efb7c8b8bb64fcd7" + }, + { + "path": "StitchModel/Stitch/ChannelFlow.lean", + "sha256": "88ff390c120c789e97f5d56b117d6634806e45f758436be08dc2cc88b5c470b9" + }, + { + "path": "StitchModel/Stitch/Compute.lean", + "sha256": "5e59cbb806a08a0f18a3ac4061704621c435815022d9d8b15896e28104cca191" + }, + { + "path": "StitchModel/Stitch/Custody.lean", + "sha256": "9e31ce5edee1fe19bab58fca18a77ddf7a5d95abd8be158ad33ee49609089b9b" + }, + { + "path": "StitchModel/Stitch/Effects.lean", + "sha256": "fabf1fbd169c1c9c4043224b2ac253b0c78967e45889389e6d7f5cf90862f1c8" + }, + { + "path": "StitchModel/Stitch/Encoding.lean", + "sha256": "c2b2a20927f3f039298791f30abd4a9cc992b6eaf29334b0b81b3d1f68d98bad" + }, + { + "path": "StitchModel/Stitch/Evidence.lean", + "sha256": "1c6d4247e09a311388b0adf319aa5c59c3807386a2b93527e0120c275a3bad02" + }, + { + "path": "StitchModel/Stitch/Fragments.lean", + "sha256": "556d72531877ee3eb23acf6321b1aadfcc33c1eaaa4b1f3d227c032265aa90fb" + }, + { + "path": "StitchModel/Stitch/Identity.lean", + "sha256": "633907978f9b550c37af80d6b4c975a895e4a9cd09e512d6d0540ba04683dedf" + }, + { + "path": "StitchModel/Stitch/Observation.lean", + "sha256": "4b4ec280f91782403b0c83591f097c8894fc3f70d4545fc60659431c88b6431c" + }, + { + "path": "StitchModel/Stitch/Pointer.lean", + "sha256": "77deec698881364e8739668f427208ce787f376e920a44cc0c2733cb9e04a0ce" + }, + { + "path": "StitchModel/Stitch/Recovery.lean", + "sha256": "71b64b56354ea7f9a02de2f9489fc407e8daf02d26c5773d31a64278240c281a" + }, + { + "path": "StitchModel/Stitch/Relay.lean", + "sha256": "948fe7db4bbe2046c574e5883a17648573f2533bbb5f2a475a278610c6114eda" + }, + { + "path": "StitchModel/Stitch/Signaling.lean", + "sha256": "44713b2e8c2beb9b66658a3ce638f5e7e94285b596cb87458278e2a6925633fb" + }, + { + "path": "StitchModel/Stitch/System.lean", + "sha256": "b5f20f50ccf11fb0b6f403f4f4b2d43f628c7564c6d7630d7d3c956aec7f1ebf" + }, + { + "path": "StitchModel/Stitch/VmAdministration.lean", + "sha256": "2f654ffecc923b2c9c3d2bf17365af6e46eaa945f48cdcd532803c1b0e014db8" + }, + { + "path": "StitchModel/StitchApp.lean", + "sha256": "ccb080862681bb34a67c86fa0d9ec1618969a5de6b097c3e246519d32ec8f47e" + } +] diff --git a/docs/evidence/native-candidate-466/stitch/lakefile.toml b/docs/evidence/native-candidate-466/stitch/lakefile.toml new file mode 100644 index 0000000..36e7e0b --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch/lakefile.toml @@ -0,0 +1,7 @@ +name = "prismpm_verify" +version = "0.1.0" + +[[lean_lib]] +name = "PrismGenerated" +roots = ["LexLeanRuntime.Collections", "LexLeanRuntime.Laws", "LexLeanRuntime.Portable", "StitchModel.Foundation.Arch", "StitchModel.Foundation.Bytes", "StitchModel.Foundation.View.Text.V1.Model", "StitchModel.Product.Architecture", "StitchModel.Product.Experience", "StitchModel.Product.Host", "StitchModel.Product.Model", "StitchModel.Stitch.Authority", "StitchModel.Stitch.Budget", "StitchModel.Stitch.ChannelFlow", "StitchModel.Stitch.Compute", "StitchModel.Stitch.Custody", "StitchModel.Stitch.Effects", "StitchModel.Stitch.Encoding", "StitchModel.Stitch.Evidence", "StitchModel.Stitch.Fragments", "StitchModel.Stitch.Identity", "StitchModel.Stitch.Observation", "StitchModel.Stitch.Pointer", "StitchModel.Stitch.Recovery", "StitchModel.Stitch.Relay", "StitchModel.Stitch.Signaling", "StitchModel.Stitch.System", "StitchModel.Stitch.VmAdministration", "StitchModel.StitchApp"] +moreLeanArgs = ["-j2"] diff --git a/docs/evidence/native-candidate-466/stitch/native-result.json b/docs/evidence/native-candidate-466/stitch/native-result.json new file mode 100644 index 0000000..305ed25 --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch/native-result.json @@ -0,0 +1 @@ +{"seconds": 16.35509194189217, "exit": 0} \ No newline at end of file diff --git a/docs/evidence/native-candidate-466/stitch/native.log b/docs/evidence/native-candidate-466/stitch/native.log new file mode 100644 index 0000000..e150f7e --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch/native.log @@ -0,0 +1,62 @@ +info: prismpm_verify: no previous manifest, creating one from scratch +info: toolchain not updated; no toolchain information found +✔ [0/30] Ran job computation +✔ [1/30] Ran prismpm_verify:extraDep +ℹ [2/30] Built LexLeanRuntime.Collections (3.4s) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/LexLeanRuntime/Collections.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Collections.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Collections.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/LexLeanRuntime/Collections.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/LexLeanRuntime/Collections.setup.json --json +ℹ [3/30] Built LexLeanRuntime.Portable (3.4s) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/LexLeanRuntime/Portable.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Portable.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Portable.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/LexLeanRuntime/Portable.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/LexLeanRuntime/Portable.setup.json --json +ℹ [4/30] Built StitchModel.Foundation.View.Text.V1.Model (235ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Foundation/View/Text/V1/Model.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/View/Text/V1/Model.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/View/Text/V1/Model.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Foundation/View/Text/V1/Model.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Foundation/View/Text/V1/Model.setup.json --json +ℹ [5/30] Built StitchModel.Foundation.Arch (309ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Foundation/Arch.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/Arch.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/Arch.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Foundation/Arch.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Foundation/Arch.setup.json --json +ℹ [6/30] Built StitchModel.Stitch.Authority (277ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Authority.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Authority.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Authority.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Authority.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Authority.setup.json --json +ℹ [7/30] Built StitchModel.Stitch.ChannelFlow (256ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/ChannelFlow.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/ChannelFlow.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/ChannelFlow.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/ChannelFlow.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/ChannelFlow.setup.json --json +ℹ [8/30] Built StitchModel.Product.Experience (665ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Product/Experience.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Experience.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Experience.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Product/Experience.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Product/Experience.setup.json --json +ℹ [9/30] Built StitchModel.Stitch.Signaling (201ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Signaling.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Signaling.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Signaling.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Signaling.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Signaling.setup.json --json +ℹ [10/30] Built StitchModel.Stitch.VmAdministration (226ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/VmAdministration.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/VmAdministration.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/VmAdministration.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/VmAdministration.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/VmAdministration.setup.json --json +ℹ [11/30] Built StitchModel.Stitch.Relay (336ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Relay.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Relay.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Relay.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Relay.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Relay.setup.json --json +ℹ [12/30] Built StitchModel.Foundation.Bytes (249ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Foundation/Bytes.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/Bytes.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Foundation/Bytes.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Foundation/Bytes.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Foundation/Bytes.setup.json --json +ℹ [13/30] Built LexLeanRuntime.Laws (3.4s) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/LexLeanRuntime/Laws.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Laws.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Laws.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/LexLeanRuntime/Laws.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/LexLeanRuntime/Laws.setup.json --json +ℹ [14/30] Built StitchModel.Product.Model (3.0s) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Product/Model.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Model.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Model.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Product/Model.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Product/Model.setup.json --json +ℹ [15/30] Built StitchModel.Product.Architecture (278ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Product/Architecture.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Architecture.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Architecture.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Product/Architecture.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Product/Architecture.setup.json --json +ℹ [16/30] Built StitchModel.Stitch.Recovery (280ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Recovery.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Recovery.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Recovery.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Recovery.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Recovery.setup.json --json +ℹ [17/30] Built StitchModel.Stitch.Effects (817ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Effects.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Effects.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Effects.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Effects.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Effects.setup.json --json +ℹ [18/30] Built StitchModel.Stitch.Observation (390ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Observation.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Observation.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Observation.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Observation.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Observation.setup.json --json +ℹ [19/30] Built StitchModel.Stitch.Identity (265ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Identity.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Identity.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Identity.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Identity.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Identity.setup.json --json +ℹ [20/30] Built StitchModel.Stitch.Encoding (317ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Encoding.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Encoding.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Encoding.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Encoding.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Encoding.setup.json --json +ℹ [21/30] Built StitchModel.Stitch.Compute (1.3s) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Compute.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Compute.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Compute.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Compute.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Compute.setup.json --json +ℹ [22/30] Built StitchModel.Stitch.Pointer (329ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Pointer.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Pointer.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Pointer.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Pointer.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Pointer.setup.json --json +ℹ [23/30] Built StitchModel.Stitch.Fragments (570ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Fragments.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Fragments.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Fragments.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Fragments.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Fragments.setup.json --json +ℹ [24/30] Built StitchModel.Stitch.Evidence (533ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Evidence.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Evidence.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Evidence.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Evidence.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Evidence.setup.json --json +ℹ [25/30] Built StitchModel.Stitch.Budget (4.1s) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Budget.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Budget.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Budget.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Budget.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Budget.setup.json --json +ℹ [26/30] Built StitchModel.Stitch.Custody (2.0s) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/Custody.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Custody.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/Custody.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Custody.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/Custody.setup.json --json +ℹ [27/30] Built StitchModel.Product.Host (495ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Product/Host.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Host.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Product/Host.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Product/Host.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Product/Host.setup.json --json +ℹ [28/30] Built StitchModel.Stitch.System (470ms) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/Stitch/System.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/System.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/Stitch/System.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/System.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/Stitch/System.setup.json --json +ℹ [29/30] Built StitchModel.StitchApp (1.4s) +trace: .> LEAN_PATH=/tmp/stitch-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/stitch-466-diagnostic/native/StitchModel/StitchApp.lean -o /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/StitchApp.olean -i /tmp/stitch-466-diagnostic/native/.lake/build/lib/lean/StitchModel/StitchApp.ilean -c /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/StitchApp.c --setup /tmp/stitch-466-diagnostic/native/.lake/build/ir/StitchModel/StitchApp.setup.json --json +✔ [30/30] Ran prismpm_verify/PrismGenerated:default +Build completed successfully (30 jobs). diff --git a/docs/evidence/native-candidate-466/stitch/remote-app-comparison.json b/docs/evidence/native-candidate-466/stitch/remote-app-comparison.json new file mode 100644 index 0000000..73982a7 --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch/remote-app-comparison.json @@ -0,0 +1,271 @@ +{ + "remote_commit": "2f1fde828fea0d07cb4fca36c3241702e29e193f", + "local_commit": "dad91e429ffbf8248ae6ed9f9319dd90e229a299", + "remote_entries": [ + { + "path": "app/.gitignore", + "sha": "96c6dd485a56eb2d76eb4121c49168ded37afed7" + }, + { + "path": "app/README.md", + "sha": "fa5060a2c69331ecfbe0fdc8176192f54c7a9dba" + }, + { + "path": "app/lake-manifest.json", + "sha": "b6674e4968f648b1f30ef92fe75005adcd66f128" + }, + { + "path": "app/lakefile.toml", + "sha": "9f91cb7a4270496f15be58c3096f0cdb0c6f8fa0" + }, + { + "path": "app/language/prism.arch/entries/arch-component-kind.toml", + "sha": "dbd4780fd730208aef8e37d8085cb89a4fe03a86" + }, + { + "path": "app/language/prism.arch/entries/arch-component.toml", + "sha": "af43c9c8e28f20c9d00ca0c69448c39a0e7407a5" + }, + { + "path": "app/language/prism.arch/entries/arch-concern.toml", + "sha": "75fc2dfb50fc795b0a63b772d8e98905a822a96a" + }, + { + "path": "app/language/prism.arch/entries/arch-edge-kind.toml", + "sha": "ff413a4bcb2c3ff6d7bd54c6cfd9739a570f6252" + }, + { + "path": "app/language/prism.arch/entries/arch-edge.toml", + "sha": "64cf40e85e5ff5aef253d79bf9e0216136587606" + }, + { + "path": "app/language/prism.arch/entries/arch-model-kind.toml", + "sha": "0414bacc7c4927a00815933a216c3f444c9d9cb8" + }, + { + "path": "app/language/prism.arch/entries/arch-stakeholder.toml", + "sha": "c3ff77d92a25e11ca9aad4326fe6f20d1c8d4c54" + }, + { + "path": "app/language/prism.arch/entries/arch-standard-reference.toml", + "sha": "1eac4a3efa14810e0f74148cb729f22e74dc3cf0" + }, + { + "path": "app/language/prism.arch/entries/arch-text-application-model.toml", + "sha": "23ca3d904d7557f9076974190ce72c80b79d3a9c" + }, + { + "path": "app/language/prism.arch/entries/arch-view-class.toml", + "sha": "a49493d642a696ed6fbca9b7418500befcca7e14" + }, + { + "path": "app/language/prism.arch/entries/arch-view.toml", + "sha": "b75ebfa3acd6cc5b975bbda727db32c53785a747" + }, + { + "path": "app/language/prism.arch/entries/arch-viewpoint-class.toml", + "sha": "fb12ac479ebb2d15daa60d1aeebfe1a10b9016cc" + }, + { + "path": "app/language/prism.arch/entries/arch-viewpoint.toml", + "sha": "005fb8730c47248d21ab623e8211307908dea2d2" + }, + { + "path": "app/language/prism.arch/entries/holo-flat-validation-input.toml", + "sha": "9489644b73398c326d7be1f0d955c46677100a36" + }, + { + "path": "app/language/prism.arch/entries/holo-normalized-model.toml", + "sha": "919f2c8aa55dacde44861bf35b691f29b19a5670" + }, + { + "path": "app/language/prism.arch/entries/holo-standards-profile.toml", + "sha": "dfe904272b687b4a49cb4731f8151e52639a339b" + }, + { + "path": "app/language/prism.arch/entries/prism-bounded-byte-buffer.toml", + "sha": "745b919c7869c61729bd3604ee917443b676715a" + }, + { + "path": "app/language/prism.arch/entries/prism-browser-system-model.toml", + "sha": "8c88467aeba35af5f73fb54f2a50e69f6bcd8e61" + }, + { + "path": "app/language/prism.arch/entries/prism-production-system-model.toml", + "sha": "534ab287adecb2af7e9cbb740fe2ca334693acd5" + }, + { + "path": "app/language/prism.arch/entries/prism-unicode-text-codec.toml", + "sha": "ad3af5c179c87edc1f2d9d12336d65c7783f8fee" + }, + { + "path": "app/language/prism.arch/lexicon.toml", + "sha": "7639a320c7eb3d9ffd1d2ca4646e4bb8321d692e" + }, + { + "path": "app/language/stitch.domain/entries/stitch-budget.toml", + "sha": "3416ea366c19483c62a7e04b5a31d9ecbddc980b" + }, + { + "path": "app/language/stitch.domain/entries/stitch-checkpoint.toml", + "sha": "4733926d787752f6b4eee128a7dd71f324671de0" + }, + { + "path": "app/language/stitch.domain/entries/stitch-encoding.toml", + "sha": "4cc43d01c762fb669933d3519cf229c82804f696" + }, + { + "path": "app/language/stitch.domain/entries/stitch-evidence.toml", + "sha": "686b63d4314766ca348b713c5f2e36d40bb79a37" + }, + { + "path": "app/language/stitch.domain/entries/stitch-fragment.toml", + "sha": "2bc52c1358d176259f758b95a0a5d485e149a67e" + }, + { + "path": "app/language/stitch.domain/entries/stitch-object.toml", + "sha": "f3729522dad7b700863e87c922eb5b9847a7999a" + }, + { + "path": "app/language/stitch.domain/entries/stitch-observation.toml", + "sha": "a5d4bf567d777e50d59ac25b16db58c08facfa3b" + }, + { + "path": "app/language/stitch.domain/entries/stitch-placement.toml", + "sha": "bc37a711baed6de4899ff0038554e500392808ca" + }, + { + "path": "app/language/stitch.domain/entries/stitch-pointer.toml", + "sha": "2ea13ee92f4471faf1385e99c17ef4a5fda8b3f5" + }, + { + "path": "app/language/stitch.domain/entries/stitch-service-model.toml", + "sha": "fdfa706677fcf967fe4ec9e235a0ab2e9bb8cf53" + }, + { + "path": "app/language/stitch.domain/lexicon.toml", + "sha": "4e5dcc50d9ce92777427f3dd03039e3d71cbcbe6" + }, + { + "path": "app/lean-toolchain", + "sha": "2b61957be5f4986fcc464cb4f62322f2d6ca3dfc" + }, + { + "path": "app/lexlean.lock", + "sha": "16f78c4044a729ed98498e7732b98fa2154187ff" + }, + { + "path": "app/lexlean.toml", + "sha": "fb29a839ec338b08d974479b466f7354f491e886" + }, + { + "path": "app/prism.toml", + "sha": "bfea9f23cdb485f5aff16e86a8a342f7590e5bac" + }, + { + "path": "app/prismpm.toml", + "sha": "1fa19ff1f3ddf7afede5e001b0e5566284af41cc" + }, + { + "path": "app/src/Foundation/Arch.lex.tex", + "sha": "e015d2169476370a57852dcd5eccd9c5732871fa" + }, + { + "path": "app/src/Foundation/Bytes.lex.tex", + "sha": "f54f9c0266f082c693e9b3c7086e0bca8259a6e2" + }, + { + "path": "app/src/Foundation/View/Text/V1/Model.lex.tex", + "sha": "dcd17faef2d6f91476efa6538c426ffa9d879921" + }, + { + "path": "app/src/Product/Architecture.lex.tex", + "sha": "6fd6a58d4f9bc2cf96e43b55514371ab934ea0e3" + }, + { + "path": "app/src/Product/Experience.lex.tex", + "sha": "7528922c7fd28a3ce563420915017bade9604aca" + }, + { + "path": "app/src/Product/Host.lex.tex", + "sha": "aee958d0c2264cc4419df44de74dda40642d04ab" + }, + { + "path": "app/src/Product/Model.lex.tex", + "sha": "5c75095b83668d2572b80d43249d1a235518416f" + }, + { + "path": "app/src/Stitch/Authority.lex.tex", + "sha": "e97309e9b0716eb407d1754a7dd1dc0a3229e892" + }, + { + "path": "app/src/Stitch/Budget.lex.tex", + "sha": "f8ba012e466bdba0f803c2dccf6c1db6418e5c77" + }, + { + "path": "app/src/Stitch/ChannelFlow.lex.tex", + "sha": "3eef6132e89b3e9636a714f7cb82c153c8dbecd6" + }, + { + "path": "app/src/Stitch/Compute.lex.tex", + "sha": "b8811b8b18145ed2b84f66f7501d78300ddb59c9" + }, + { + "path": "app/src/Stitch/Custody.lex.tex", + "sha": "23ad86330f4e4bb3e3bf788fdadbf5410977f6a7" + }, + { + "path": "app/src/Stitch/Effects.lex.tex", + "sha": "a4f961ed6f9dcd8cee490e92728db4c37ee12483" + }, + { + "path": "app/src/Stitch/Encoding.lex.tex", + "sha": "940ba10d0ba0e4f3976f4fe5b4719b6f8ff58c6c" + }, + { + "path": "app/src/Stitch/Evidence.lex.tex", + "sha": "425496ff62efc5efeaee5a14bb67a09642e72232" + }, + { + "path": "app/src/Stitch/Fragments.lex.tex", + "sha": "9b74db6cb7ae82570800afc72c6deee545c62440" + }, + { + "path": "app/src/Stitch/Identity.lex.tex", + "sha": "1218eb2d4b7143dee74e50592ce8b2ef90f1e769" + }, + { + "path": "app/src/Stitch/Observation.lex.tex", + "sha": "66af6258a6fc7e2633ee04e508dead76e022dc98" + }, + { + "path": "app/src/Stitch/Pointer.lex.tex", + "sha": "c21fc6fedd2a58fa5ed5eaa4b02bb0f0bb0c905c" + }, + { + "path": "app/src/Stitch/Recovery.lex.tex", + "sha": "ef5374794c701226e45720163230abbe8e88feeb" + }, + { + "path": "app/src/Stitch/Relay.lex.tex", + "sha": "99a45d33b000f920300195ede85a03855c3ddc89" + }, + { + "path": "app/src/Stitch/Signaling.lex.tex", + "sha": "34733f48e450db7f0557606824aaba90cc0e4aae" + }, + { + "path": "app/src/Stitch/System.lex.tex", + "sha": "b1c6a3d66c2c52a1140f800e7bcf829025e75dc7" + }, + { + "path": "app/src/Stitch/VmAdministration.lex.tex", + "sha": "f5f6cdec0d75689d68277834bd51eaf643b722b9" + }, + { + "path": "app/src/StitchApp.lex.tex", + "sha": "448dfbcfe52c06565b270956f1203e5e6a582178" + } + ], + "differences": [] +}\n \ No newline at end of file diff --git a/docs/evidence/native-candidate-466/stitch/source-provenance.json b/docs/evidence/native-candidate-466/stitch/source-provenance.json new file mode 100644 index 0000000..4e5d5c7 --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch/source-provenance.json @@ -0,0 +1,105 @@ +{ + "source_commit": "dad91e429ffbf8248ae6ed9f9319dd90e229a299", + "files": [ + { + "path": "app/src/Foundation/Arch.lex.tex", + "sha256": "54fdc8eb15c46707e445ff99814d6cbd1731967f801bf064a6c1f4cc01c45394" + }, + { + "path": "app/src/Foundation/Bytes.lex.tex", + "sha256": "ce16e5b439128db3231979381f4599d3ff0617f62c2bf00c348bba35393abcd6" + }, + { + "path": "app/src/Foundation/View/Text/V1/Model.lex.tex", + "sha256": "db124343ad8fe1295bc8eb305c7f59f83cf6ad76d46a5cabea500fe66f3ad5dc" + }, + { + "path": "app/src/Product/Architecture.lex.tex", + "sha256": "d5cc5fd4e64070bddd5c0edc8cb3a318a0965b5e1574efe9a9dfa483b12e8d6d" + }, + { + "path": "app/src/Product/Experience.lex.tex", + "sha256": "9db08ad24811bc6078c3c9def03464fbbd4262ec817c3feffd50cc40f182a664" + }, + { + "path": "app/src/Product/Host.lex.tex", + "sha256": "3bb2a621868dc683e776c9b65c58cc60cc2b89e5d007d54c4c152bedd4878871" + }, + { + "path": "app/src/Product/Model.lex.tex", + "sha256": "a811754e08b17292e45f049b9822d7d8d53625a1efdc516687bf8c14aeb44cdb" + }, + { + "path": "app/src/Stitch/Authority.lex.tex", + "sha256": "10afc7af1503f08fe7806dbab24d93f565f34370e3b7d18135f48297e64ee573" + }, + { + "path": "app/src/Stitch/Budget.lex.tex", + "sha256": "581ae188297e3e03e69869a3cfbcdae9554706e007cbeb238d97c8ad30229911" + }, + { + "path": "app/src/Stitch/ChannelFlow.lex.tex", + "sha256": "7f4356ddd38fc94b32a2d6af237ce7382c34bdc7db43c8e8d6ab94cd94fc3e63" + }, + { + "path": "app/src/Stitch/Compute.lex.tex", + "sha256": "ef0f1b8dcf15a8ff26a206b7bd8fa51736bb54ae14e7b6e71a4296deeb4528b7" + }, + { + "path": "app/src/Stitch/Custody.lex.tex", + "sha256": "30347fda486b2c4c643dbc6bb8030e9aec0586ded3bb81b5e7cd8ca9bb9745b7" + }, + { + "path": "app/src/Stitch/Effects.lex.tex", + "sha256": "7ccc2c30cca7df663541ceece0c85226f921160f56f4ec681703a8d5b589263b" + }, + { + "path": "app/src/Stitch/Encoding.lex.tex", + "sha256": "75b412ab0ed56dea3aa41cc77705fb6233991ea1c2e600a7cf509c3b84e5a95f" + }, + { + "path": "app/src/Stitch/Evidence.lex.tex", + "sha256": "39011e1cf70295427f716d328b1ab754242d3667f0e70a8a48dffa735465c79e" + }, + { + "path": "app/src/Stitch/Fragments.lex.tex", + "sha256": "5cd8d0602cbe501ae4ffc5c18dde17fc6e5766d930ac1d9277545d1ef8d88b83" + }, + { + "path": "app/src/Stitch/Identity.lex.tex", + "sha256": "c4c159234e1623b8f339e86cf47da55c89d197bf21fe334bd893f575ba053870" + }, + { + "path": "app/src/Stitch/Observation.lex.tex", + "sha256": "fe3205a68576d8c7d82f86b45b78f8b6c8b49a873f00c448cccb2eb459749ae8" + }, + { + "path": "app/src/Stitch/Pointer.lex.tex", + "sha256": "10239748c402cdadfc36b150a7a103dfe5124d81fa27bb276575810470c89c46" + }, + { + "path": "app/src/Stitch/Recovery.lex.tex", + "sha256": "4a29e91526ffd1c5aa9fcfc8d990ca1b89d5129813742d9ae55e688eeb6a9121" + }, + { + "path": "app/src/Stitch/Relay.lex.tex", + "sha256": "26a3b5c7f8af3cb058800716a5b73111adbe0188436ae1ad87e1a0e6ce118a03" + }, + { + "path": "app/src/Stitch/Signaling.lex.tex", + "sha256": "97bdfb5160e41a4ed3ab30788f2e3a558836f622c237e4bd3496536212b330c9" + }, + { + "path": "app/src/Stitch/System.lex.tex", + "sha256": "b05a639514a2c56f40b8e960c6cf31023aec8b20d1c18c5ed68a0a936a9d7119" + }, + { + "path": "app/src/Stitch/VmAdministration.lex.tex", + "sha256": "4e578e7e5c9a4f1c83d0181acae555a1c184dd72777473465448a7675b2bb32c" + }, + { + "path": "app/src/StitchApp.lex.tex", + "sha256": "ffd8a4b6b9072b27b06d67d61e1c11d085a6b82e84be4610f27f3805d87f675b" + } + ] +} diff --git a/docs/evidence/native-candidate-466/stitch/verify.log b/docs/evidence/native-candidate-466/stitch/verify.log new file mode 100644 index 0000000..6b26063 --- /dev/null +++ b/docs/evidence/native-candidate-466/stitch/verify.log @@ -0,0 +1 @@ +verified 25 modules; attestation f8a8f3cde75f310721acf22c24e4cdf8f8594dbc105cbef144d4422d229382e4 diff --git a/docs/evidence/native-candidate-466/template/build.log b/docs/evidence/native-candidate-466/template/build.log new file mode 100644 index 0000000..ac1f757 --- /dev/null +++ b/docs/evidence/native-candidate-466/template/build.log @@ -0,0 +1 @@ +built 3 modules at .lexlean/build/73325d95c8673e962b5a7ad9a3eb9a8b99128271f9dbfb68b5e502c7d0b6b22d diff --git a/docs/evidence/native-candidate-466/template/generated-native-inputs.json b/docs/evidence/native-candidate-466/template/generated-native-inputs.json new file mode 100644 index 0000000..f0d5054 --- /dev/null +++ b/docs/evidence/native-candidate-466/template/generated-native-inputs.json @@ -0,0 +1,18 @@ +[ + { + "path": "LexLeanRuntime/Portable.lean", + "sha256": "9a081b865659a3c13a6721ef7c5c93aec0b1ae2ce63bbd38286ec6d28483f8de" + }, + { + "path": "PrismTemplateContract/Contract.lean", + "sha256": "84af5e952d4d71385ccfb68a9504698309a2a86600654b6cd2932750e1c15909" + }, + { + "path": "PrismTemplateContract/Foundation/Bytes.lean", + "sha256": "c94b21a09161a40b314baddaeb68329b8fad4ebf0060ac7160338f94a1bd679e" + }, + { + "path": "PrismTemplateContract/Foundation/View/Text/V1/Model.lean", + "sha256": "26c14f6e6ad7391233a0979848ff2650d38a3792f9f268ce0e8646ed2b0d5b74" + } +] diff --git a/docs/evidence/native-candidate-466/template/lakefile.toml b/docs/evidence/native-candidate-466/template/lakefile.toml new file mode 100644 index 0000000..55cf2a2 --- /dev/null +++ b/docs/evidence/native-candidate-466/template/lakefile.toml @@ -0,0 +1,7 @@ +name = "prismpm_verify" +version = "0.1.0" + +[[lean_lib]] +name = "PrismGenerated" +roots = ["LexLeanRuntime.Portable", "PrismTemplateContract.Contract", "PrismTemplateContract.Foundation.Bytes", "PrismTemplateContract.Foundation.View.Text.V1.Model"] +moreLeanArgs = ["-j2"] diff --git a/docs/evidence/native-candidate-466/template/native-result.json b/docs/evidence/native-candidate-466/template/native-result.json new file mode 100644 index 0000000..9857721 --- /dev/null +++ b/docs/evidence/native-candidate-466/template/native-result.json @@ -0,0 +1 @@ +{"seconds": 11.096880868077278, "exit": 0} \ No newline at end of file diff --git a/docs/evidence/native-candidate-466/template/native.log b/docs/evidence/native-candidate-466/template/native.log new file mode 100644 index 0000000..495885c --- /dev/null +++ b/docs/evidence/native-candidate-466/template/native.log @@ -0,0 +1,14 @@ +info: prismpm_verify: no previous manifest, creating one from scratch +info: toolchain not updated; no toolchain information found +✔ [0/6] Ran job computation +✔ [1/6] Ran prismpm_verify:extraDep +ℹ [2/6] Built PrismTemplateContract.Foundation.View.Text.V1.Model (233ms) +trace: .> LEAN_PATH=/tmp/template-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/template-466-diagnostic/native/PrismTemplateContract/Foundation/View/Text/V1/Model.lean -o /tmp/template-466-diagnostic/native/.lake/build/lib/lean/PrismTemplateContract/Foundation/View/Text/V1/Model.olean -i /tmp/template-466-diagnostic/native/.lake/build/lib/lean/PrismTemplateContract/Foundation/View/Text/V1/Model.ilean -c /tmp/template-466-diagnostic/native/.lake/build/ir/PrismTemplateContract/Foundation/View/Text/V1/Model.c --setup /tmp/template-466-diagnostic/native/.lake/build/ir/PrismTemplateContract/Foundation/View/Text/V1/Model.setup.json --json +ℹ [3/6] Built LexLeanRuntime.Portable (3.2s) +trace: .> LEAN_PATH=/tmp/template-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/template-466-diagnostic/native/LexLeanRuntime/Portable.lean -o /tmp/template-466-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Portable.olean -i /tmp/template-466-diagnostic/native/.lake/build/lib/lean/LexLeanRuntime/Portable.ilean -c /tmp/template-466-diagnostic/native/.lake/build/ir/LexLeanRuntime/Portable.c --setup /tmp/template-466-diagnostic/native/.lake/build/ir/LexLeanRuntime/Portable.setup.json --json +ℹ [4/6] Built PrismTemplateContract.Foundation.Bytes (191ms) +trace: .> LEAN_PATH=/tmp/template-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/template-466-diagnostic/native/PrismTemplateContract/Foundation/Bytes.lean -o /tmp/template-466-diagnostic/native/.lake/build/lib/lean/PrismTemplateContract/Foundation/Bytes.olean -i /tmp/template-466-diagnostic/native/.lake/build/lib/lean/PrismTemplateContract/Foundation/Bytes.ilean -c /tmp/template-466-diagnostic/native/.lake/build/ir/PrismTemplateContract/Foundation/Bytes.c --setup /tmp/template-466-diagnostic/native/.lake/build/ir/PrismTemplateContract/Foundation/Bytes.setup.json --json +ℹ [5/6] Built PrismTemplateContract.Contract (7.6s) +trace: .> LEAN_PATH=/tmp/template-466-diagnostic/native/.lake/build/lib/lean /tmp/stitch-lean/lean-4.32.1-linux/bin/lean -j2 /tmp/template-466-diagnostic/native/PrismTemplateContract/Contract.lean -o /tmp/template-466-diagnostic/native/.lake/build/lib/lean/PrismTemplateContract/Contract.olean -i /tmp/template-466-diagnostic/native/.lake/build/lib/lean/PrismTemplateContract/Contract.ilean -c /tmp/template-466-diagnostic/native/.lake/build/ir/PrismTemplateContract/Contract.c --setup /tmp/template-466-diagnostic/native/.lake/build/ir/PrismTemplateContract/Contract.setup.json --json +✔ [6/6] Ran prismpm_verify/PrismGenerated:default +Build completed successfully (6 jobs). diff --git a/docs/evidence/native-candidate-466/template/source-provenance.json b/docs/evidence/native-candidate-466/template/source-provenance.json new file mode 100644 index 0000000..5a9cf0b --- /dev/null +++ b/docs/evidence/native-candidate-466/template/source-provenance.json @@ -0,0 +1,17 @@ +{ + "source_commit": "a7a3041cd85d745bb2d6dfc7ee72513185fa48be", + "files": [ + { + "path": "app/src/Contract.lex.tex", + "sha256": "9b5e120204c51602fc783cc2f6bea7456ec64882877528341b523a4f4a580fb3" + }, + { + "path": "app/src/Foundation/Bytes.lex.tex", + "sha256": "ce16e5b439128db3231979381f4599d3ff0617f62c2bf00c348bba35393abcd6" + }, + { + "path": "app/src/Foundation/View/Text/V1/Model.lex.tex", + "sha256": "db124343ad8fe1295bc8eb305c7f59f83cf6ad76d46a5cabea500fe66f3ad5dc" + } + ] +} diff --git a/docs/evidence/native-candidate-466/template/verify.log b/docs/evidence/native-candidate-466/template/verify.log new file mode 100644 index 0000000..2828678 --- /dev/null +++ b/docs/evidence/native-candidate-466/template/verify.log @@ -0,0 +1 @@ +verified 3 modules; attestation 8467b85f3a910a0991610b9999fb8d8285d3ef954e4ee3029d7c49dea2ae3164 diff --git a/docs/evidence/native-fixture-writer-466/README.md b/docs/evidence/native-fixture-writer-466/README.md new file mode 100644 index 0000000..188a1eb --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/README.md @@ -0,0 +1,28 @@ +# Actual regeneration of two LexLean fixture expectations + +The [fork diagnostic run](https://github.com/afflom/stitch/actions/runs/42938289470) +passed at Stitch diagnostic commit `42127189e465c0056ae3416468f44289c48431f3`. +It checked out unchanged LexLean source `cc5561203de8fa5594d573904147a306b2b8bbbf`, +tree `c2bbc659b3cea7d58f2a2d0557579d8b2e92ff9e`, with Rust 1.97.1 and Lean 4.32.1. + +The public `repo_conformance::fixtures::write` implementation used by the normal +fixture writer regenerated exactly `certificate-resource-exhausted` and +`preservation-drift`. Each then passed a fresh `fixtures::check` observation. +The helper did not serialize expected output itself or alter either fixture. + +The preserved patch changes only four JSON files. Both command and diagnostic +records reflect generated module size 274972 → 275460 or Core.lean location +806:8 → 820:8. Comparison with the exact upstream source confirms no other byte +change. Codes LLS8002/LLV7014, exit statuses 4/3, unsuccessful verification and +empty artifacts remain unchanged. `review.json` records the exact output hashes. + +Artifact `13819487356` was downloaded and verified against SHA-256 +`5c585acedcddc986254f438b35a239b863cab610a3e2c8ebebe0824e6b7efa8a`. +Its original patch, generated files, writer log and toolchain/source records are +preserved here. These observations do not establish which earlier change caused +the drift. They also do not replace full EX-07, final PR acceptance or qualified +SDK construction. No upstream LexLean branch or PR was changed by this run. + +The earlier diagnostic run stopped before generation because its temporary +helper lacked crate documentation. The passing run added that documentation; +the existing lint, writer and fixture checks remained enabled. diff --git a/docs/evidence/native-fixture-writer-466/README.txt b/docs/evidence/native-fixture-writer-466/README.txt new file mode 100644 index 0000000..1317755 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/README.txt @@ -0,0 +1 @@ +Generated by the unchanged repo_conformance::fixtures::write owning implementation used by cargo xtask check-fixtures --write, selected to the two actual failing fixture directories. Each was checked by an independent fixtures::check run. No custom serialization or manual oracle editing. This is generation evidence, not a replacement for full EX07 or final acceptance. diff --git a/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/artifacts.json b/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/artifacts.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/artifacts.json @@ -0,0 +1 @@ +[] diff --git a/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/command.json b/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/command.json new file mode 100644 index 0000000..6fe3aa1 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/command.json @@ -0,0 +1 @@ +{"artifacts":[],"command":"verify","diagnostics":[{"causes":[],"code":"LLS8002","help":[],"labels":[],"message":"the pinned Lean exhausted a resource checking `LexLeanPreserve.Cafc7144f8603badcdadce463a7faf8c3.R0` (maximum number of heartbeats): the generated module is 275460 bytes, at least a quarter of max_file_bytes 262144, and is beyond what the machine checks","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}],"exit_code":4,"modules":[],"spec":"lexlean/command-result/1","success":false} diff --git a/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/diagnostics.json b/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/diagnostics.json new file mode 100644 index 0000000..9c20c26 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/diagnostics.json @@ -0,0 +1 @@ +[{"causes":[],"code":"LLS8002","help":[],"labels":[],"message":"the pinned Lean exhausted a resource checking `LexLeanPreserve.Cafc7144f8603badcdadce463a7faf8c3.R0` (maximum number of heartbeats): the generated module is 275460 bytes, at least a quarter of max_file_bytes 262144, and is beyond what the machine checks","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}] diff --git a/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/hashes.toml b/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/hashes.toml new file mode 100644 index 0000000..a8f66a2 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/certificate-resource-exhausted/hashes.toml @@ -0,0 +1,8 @@ +# Platform-independent artifact hashes (compared exactly) and the +# process-bound files whose bytes vary per host, toolchain build, and +# compiler executable (presence only). SPEC.md §28.2, §28.4. + +[platform_independent] + +[process_bound] +files = [] diff --git a/docs/evidence/native-fixture-writer-466/changed-paths.txt b/docs/evidence/native-fixture-writer-466/changed-paths.txt new file mode 100644 index 0000000..d5eab68 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/changed-paths.txt @@ -0,0 +1,4 @@ +tests/negative/certificate-resource-exhausted/expected/command.json +tests/negative/certificate-resource-exhausted/expected/diagnostics.json +tests/negative/preservation-drift/expected/command.json +tests/negative/preservation-drift/expected/diagnostics.json diff --git a/docs/evidence/native-fixture-writer-466/generated-fixtures.patch b/docs/evidence/native-fixture-writer-466/generated-fixtures.patch new file mode 100644 index 0000000..d9c09c3 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/generated-fixtures.patch @@ -0,0 +1,28 @@ +diff --git a/tests/negative/certificate-resource-exhausted/expected/command.json b/tests/negative/certificate-resource-exhausted/expected/command.json +index ac21098..6fe3aa1 100644 +--- a/tests/negative/certificate-resource-exhausted/expected/command.json ++++ b/tests/negative/certificate-resource-exhausted/expected/command.json +@@ -1 +1 @@ +-{"artifacts":[],"command":"verify","diagnostics":[{"causes":[],"code":"LLS8002","help":[],"labels":[],"message":"the pinned Lean exhausted a resource checking `LexLeanPreserve.Cafc7144f8603badcdadce463a7faf8c3.R0` (maximum number of heartbeats): the generated module is 274972 bytes, at least a quarter of max_file_bytes 262144, and is beyond what the machine checks","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}],"exit_code":4,"modules":[],"spec":"lexlean/command-result/1","success":false} ++{"artifacts":[],"command":"verify","diagnostics":[{"causes":[],"code":"LLS8002","help":[],"labels":[],"message":"the pinned Lean exhausted a resource checking `LexLeanPreserve.Cafc7144f8603badcdadce463a7faf8c3.R0` (maximum number of heartbeats): the generated module is 275460 bytes, at least a quarter of max_file_bytes 262144, and is beyond what the machine checks","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}],"exit_code":4,"modules":[],"spec":"lexlean/command-result/1","success":false} +diff --git a/tests/negative/certificate-resource-exhausted/expected/diagnostics.json b/tests/negative/certificate-resource-exhausted/expected/diagnostics.json +index 2a8dc51..9c20c26 100644 +--- a/tests/negative/certificate-resource-exhausted/expected/diagnostics.json ++++ b/tests/negative/certificate-resource-exhausted/expected/diagnostics.json +@@ -1 +1 @@ +-[{"causes":[],"code":"LLS8002","help":[],"labels":[],"message":"the pinned Lean exhausted a resource checking `LexLeanPreserve.Cafc7144f8603badcdadce463a7faf8c3.R0` (maximum number of heartbeats): the generated module is 274972 bytes, at least a quarter of max_file_bytes 262144, and is beyond what the machine checks","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}] ++[{"causes":[],"code":"LLS8002","help":[],"labels":[],"message":"the pinned Lean exhausted a resource checking `LexLeanPreserve.Cafc7144f8603badcdadce463a7faf8c3.R0` (maximum number of heartbeats): the generated module is 275460 bytes, at least a quarter of max_file_bytes 262144, and is beyond what the machine checks","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}] +diff --git a/tests/negative/preservation-drift/expected/command.json b/tests/negative/preservation-drift/expected/command.json +index a54aa25..a966671 100644 +--- a/tests/negative/preservation-drift/expected/command.json ++++ b/tests/negative/preservation-drift/expected/command.json +@@ -1 +1 @@ +-{"artifacts":[],"command":"verify","diagnostics":[{"causes":[],"code":"LLV7014","help":[],"labels":[],"message":"preservation environment: `LexLeanPreservation.Core` does not compile silently under the pinned Lean: error: Type mismatch\n rfl\nhas type\n ?m.8 = ?m.8\nbut is expected to have type\n 1 = 2\n$STAGING/preserve-src/LexLeanPreservation/Core.lean:806:8: error: Not a definitional equality: the left-hand side\n 1\nis not definitionally equal to the right-hand side\n 2\n","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}],"exit_code":3,"modules":[],"spec":"lexlean/command-result/1","success":false} ++{"artifacts":[],"command":"verify","diagnostics":[{"causes":[],"code":"LLV7014","help":[],"labels":[],"message":"preservation environment: `LexLeanPreservation.Core` does not compile silently under the pinned Lean: error: Type mismatch\n rfl\nhas type\n ?m.8 = ?m.8\nbut is expected to have type\n 1 = 2\n$STAGING/preserve-src/LexLeanPreservation/Core.lean:820:8: error: Not a definitional equality: the left-hand side\n 1\nis not definitionally equal to the right-hand side\n 2\n","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}],"exit_code":3,"modules":[],"spec":"lexlean/command-result/1","success":false} +diff --git a/tests/negative/preservation-drift/expected/diagnostics.json b/tests/negative/preservation-drift/expected/diagnostics.json +index cc112b5..5e607b8 100644 +--- a/tests/negative/preservation-drift/expected/diagnostics.json ++++ b/tests/negative/preservation-drift/expected/diagnostics.json +@@ -1 +1 @@ +-[{"causes":[],"code":"LLV7014","help":[],"labels":[],"message":"preservation environment: `LexLeanPreservation.Core` does not compile silently under the pinned Lean: error: Type mismatch\n rfl\nhas type\n ?m.8 = ?m.8\nbut is expected to have type\n 1 = 2\n$STAGING/preserve-src/LexLeanPreservation/Core.lean:806:8: error: Not a definitional equality: the left-hand side\n 1\nis not definitionally equal to the right-hand side\n 2\n","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}] ++[{"causes":[],"code":"LLV7014","help":[],"labels":[],"message":"preservation environment: `LexLeanPreservation.Core` does not compile silently under the pinned Lean: error: Type mismatch\n rfl\nhas type\n ?m.8 = ?m.8\nbut is expected to have type\n 1 = 2\n$STAGING/preserve-src/LexLeanPreservation/Core.lean:820:8: error: Not a definitional equality: the left-hand side\n 1\nis not definitionally equal to the right-hand side\n 2\n","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}] diff --git a/docs/evidence/native-fixture-writer-466/lean-version.txt b/docs/evidence/native-fixture-writer-466/lean-version.txt new file mode 100644 index 0000000..63c062a --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/lean-version.txt @@ -0,0 +1 @@ +Lean (version 4.32.1, x86_64-unknown-linux-gnu, commit f054605aea4b840552cca2e725580bffd1e1b704, Release) diff --git a/docs/evidence/native-fixture-writer-466/preservation-drift/artifacts.json b/docs/evidence/native-fixture-writer-466/preservation-drift/artifacts.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/preservation-drift/artifacts.json @@ -0,0 +1 @@ +[] diff --git a/docs/evidence/native-fixture-writer-466/preservation-drift/command.json b/docs/evidence/native-fixture-writer-466/preservation-drift/command.json new file mode 100644 index 0000000..a966671 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/preservation-drift/command.json @@ -0,0 +1 @@ +{"artifacts":[],"command":"verify","diagnostics":[{"causes":[],"code":"LLV7014","help":[],"labels":[],"message":"preservation environment: `LexLeanPreservation.Core` does not compile silently under the pinned Lean: error: Type mismatch\n rfl\nhas type\n ?m.8 = ?m.8\nbut is expected to have type\n 1 = 2\n$STAGING/preserve-src/LexLeanPreservation/Core.lean:820:8: error: Not a definitional equality: the left-hand side\n 1\nis not definitionally equal to the right-hand side\n 2\n","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}],"exit_code":3,"modules":[],"spec":"lexlean/command-result/1","success":false} diff --git a/docs/evidence/native-fixture-writer-466/preservation-drift/diagnostics.json b/docs/evidence/native-fixture-writer-466/preservation-drift/diagnostics.json new file mode 100644 index 0000000..5e607b8 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/preservation-drift/diagnostics.json @@ -0,0 +1 @@ +[{"causes":[],"code":"LLV7014","help":[],"labels":[],"message":"preservation environment: `LexLeanPreservation.Core` does not compile silently under the pinned Lean: error: Type mismatch\n rfl\nhas type\n ?m.8 = ?m.8\nbut is expected to have type\n 1 = 2\n$STAGING/preserve-src/LexLeanPreservation/Core.lean:820:8: error: Not a definitional equality: the left-hand side\n 1\nis not definitionally equal to the right-hand side\n 2\n","notes":[],"primary":{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"line_end":1,"line_start":1,"path":"lexlean.toml"},"severity":"error","spec":"lexlean/diagnostic/1"}] diff --git a/docs/evidence/native-fixture-writer-466/preservation-drift/hashes.toml b/docs/evidence/native-fixture-writer-466/preservation-drift/hashes.toml new file mode 100644 index 0000000..a8f66a2 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/preservation-drift/hashes.toml @@ -0,0 +1,8 @@ +# Platform-independent artifact hashes (compared exactly) and the +# process-bound files whose bytes vary per host, toolchain build, and +# compiler executable (presence only). SPEC.md §28.2, §28.4. + +[platform_independent] + +[process_bound] +files = [] diff --git a/docs/evidence/native-fixture-writer-466/review.json b/docs/evidence/native-fixture-writer-466/review.json new file mode 100644 index 0000000..eb568c5 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/review.json @@ -0,0 +1,28 @@ +{ + "source_commit": "cc5561203de8fa5594d573904147a306b2b8bbbf", + "source_tree": "c2bbc659b3cea7d58f2a2d0557579d8b2e92ff9e", + "diagnostic_head": "42127189e465c0056ae3416468f44289c48431f3", + "run": 42938289470, + "job": 130253666946, + "artifact": 13819487356, + "artifact_sha256": "5c585acedcddc986254f438b35a239b863cab610a3e2c8ebebe0824e6b7efa8a", + "changed_files": { + "certificate-resource-exhausted/command.json": { + "sha256": "9e1ee2607766df4009cf8f23918fc1ea61a17bd4975c7bfbd55d12843e6f8e1b", + "bytes": 630 + }, + "certificate-resource-exhausted/diagnostics.json": { + "sha256": "daf6c392ca007ccc5e0d2524491b9c47fa84c38f7b71412f42a1326491e8b0d1", + "bytes": 503 + }, + "preservation-drift/command.json": { + "sha256": "63f28680a9a084d5a6987e0a1af80e0dd91e1eee73a9dc84f9d212467dfa6650", + "bytes": 749 + }, + "preservation-drift/diagnostics.json": { + "sha256": "f09ac081407dd4c451b26c5db700fb2d03d9f7ca44087f59f5fb7e49b2a85123", + "bytes": 622 + } + }, + "finding": "Exactly the two observed diagnostic metadata shifts, each in command and diagnostics JSON. No other byte change, error code, exit status, success flag, artifact policy or test weakening." +} diff --git a/docs/evidence/native-fixture-writer-466/rust-version.txt b/docs/evidence/native-fixture-writer-466/rust-version.txt new file mode 100644 index 0000000..e6706a0 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/rust-version.txt @@ -0,0 +1,7 @@ +rustc 1.97.1 (8bab26f4f 2026-07-14) +binary: rustc +commit-hash: 8bab26f4f68e0e26f0bb7960be334d5b520ea452 +commit-date: 2026-07-14 +host: x86_64-unknown-linux-gnu +release: 1.97.1 +LLVM version: 22.1.6 diff --git a/docs/evidence/native-fixture-writer-466/source-commit.txt b/docs/evidence/native-fixture-writer-466/source-commit.txt new file mode 100644 index 0000000..5aa8435 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/source-commit.txt @@ -0,0 +1 @@ +cc5561203de8fa5594d573904147a306b2b8bbbf diff --git a/docs/evidence/native-fixture-writer-466/source-tree.txt b/docs/evidence/native-fixture-writer-466/source-tree.txt new file mode 100644 index 0000000..0c0cc2a --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/source-tree.txt @@ -0,0 +1 @@ +c2bbc659b3cea7d58f2a2d0557579d8b2e92ff9e diff --git a/docs/evidence/native-fixture-writer-466/writer.log b/docs/evidence/native-fixture-writer-466/writer.log new file mode 100644 index 0000000..0f2b4d7 --- /dev/null +++ b/docs/evidence/native-fixture-writer-466/writer.log @@ -0,0 +1,131 @@ + Updating crates.io index + Downloading crates ... + Downloaded anstyle-query v1.1.5 + Downloaded anstyle v1.0.14 + Downloaded anstream v1.0.0 + Downloaded anstyle-parse v1.0.0 + Downloaded bitflags v2.13.1 + Downloaded generic-array v0.14.7 + Downloaded is_terminal_polyfill v1.70.2 + Downloaded itoa v1.0.18 + Downloaded same-file v1.0.6 + Downloaded strsim v0.11.1 + Downloaded equivalent v1.0.2 + Downloaded errno v0.3.14 + Downloaded toml_write v0.1.2 + Downloaded version_check v0.9.5 + Downloaded utf8parse v0.2.2 + Downloaded crypto-common v0.1.7 + Downloaded serde_spanned v0.6.9 + Downloaded fs4 v0.13.1 + Downloaded tinyvec_macros v0.1.1 + Downloaded clap_lex v1.1.0 + Downloaded cpufeatures v0.2.17 + Downloaded toml_datetime v0.6.11 + Downloaded colorchoice v1.0.5 + Downloaded cfg-if v1.0.4 + Downloaded heck v0.5.0 + Downloaded block-buffer v0.10.4 + Downloaded quote v1.0.47 + Downloaded sha2 v0.10.9 + Downloaded zmij v1.0.23 + Downloaded signal-hook-registry v1.4.8 + Downloaded fastrand v2.5.0 + Downloaded semver v1.0.28 + Downloaded camino v1.2.5 + Downloaded getrandom v0.4.3 + Downloaded serde_derive v1.0.229 + Downloaded tinyvec v1.12.0 + Downloaded digest v0.10.7 + Downloaded toml v0.8.23 + Downloaded walkdir v2.5.0 + Downloaded once_cell v1.21.4 + Downloaded signal-hook v0.3.18 + Downloaded tempfile v3.27.0 + Downloaded proc-macro2 v1.0.107 + Downloaded clap_derive v4.6.4 + Downloaded serde_core v1.0.229 + Downloaded unicode-ident v1.0.24 + Downloaded memchr v2.8.3 + Downloaded toml_edit v0.22.27 + Downloaded clap v4.6.6 + Downloaded typenum v1.20.1 + Downloaded serde v1.0.229 + Downloaded indexmap v2.14.0 + Downloaded hashbrown v0.17.1 + Downloaded unicode-normalization v0.1.25 + Downloaded serde_json v1.0.151 + Downloaded winnow v0.7.15 + Downloaded clap_builder v4.6.6 + Downloaded syn v3.0.3 + Downloaded rustix v1.1.4 + Downloaded libc v0.2.189 + Downloaded linux-raw-sys v0.12.1 + Compiling proc-macro2 v1.0.107 + Compiling quote v1.0.47 + Compiling unicode-ident v1.0.24 + Compiling serde_core v1.0.229 + Compiling version_check v0.9.5 + Compiling serde v1.0.229 + Compiling generic-array v0.14.7 + Compiling libc v0.2.189 + Compiling typenum v1.20.1 + Compiling syn v3.0.3 + Compiling utf8parse v0.2.2 + Compiling rustix v1.1.4 + Compiling hashbrown v0.17.1 + Compiling cfg-if v1.0.4 + Compiling equivalent v1.0.2 + Compiling anstyle-parse v1.0.0 + Compiling crypto-common v0.1.7 + Compiling block-buffer v0.10.4 + Compiling winnow v0.7.15 + Compiling anstyle v1.0.14 + Compiling indexmap v2.14.0 + Compiling anstyle-query v1.1.5 + Compiling linux-raw-sys v0.12.1 + Compiling getrandom v0.4.3 + Compiling zmij v1.0.23 + Compiling bitflags v2.13.1 + Compiling colorchoice v1.0.5 + Compiling is_terminal_polyfill v1.70.2 + Compiling toml_write v0.1.2 + Compiling anstream v1.0.0 + Compiling digest v0.10.7 + Compiling errno v0.3.14 + Compiling cpufeatures v0.2.17 + Compiling serde_json v1.0.151 + Compiling strsim v0.11.1 + Compiling camino v1.2.5 + Compiling signal-hook v0.3.18 + Compiling clap_lex v1.1.0 + Compiling heck v0.5.0 + Compiling serde_derive v1.0.229 + Compiling tinyvec_macros v0.1.1 + Compiling clap_derive v4.6.4 + Compiling tinyvec v1.12.0 + Compiling clap_builder v4.6.6 + Compiling sha2 v0.10.9 + Compiling signal-hook-registry v1.4.8 + Compiling fastrand v2.5.0 + Compiling lexlean v0.4.0 (/home/runner/work/stitch/stitch/crates/lexlean) + Compiling memchr v2.8.3 + Compiling once_cell v1.21.4 + Compiling same-file v1.0.6 + Compiling itoa v1.0.18 + Compiling walkdir v2.5.0 + Compiling serde_spanned v0.6.9 + Compiling toml_datetime v0.6.11 + Compiling tempfile v3.27.0 + Compiling toml_edit v0.22.27 + Compiling clap v4.6.6 + Compiling fs4 v0.13.1 + Compiling unicode-normalization v0.1.25 + Compiling semver v1.0.28 + Compiling toml v0.8.23 + Compiling repo-model v0.4.0 (/home/runner/work/stitch/stitch/crates/model) + Compiling repo-conformance v0.4.0 (/home/runner/work/stitch/stitch/crates/conformance) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 54.22s + Running `target/debug/native-fixture-writer` +WROTE AND CHECKED certificate-resource-exhausted +WROTE AND CHECKED preservation-drift diff --git a/docs/guest-browser-qualification.md b/docs/guest-browser-qualification.md new file mode 100644 index 0000000..97ee46e --- /dev/null +++ b/docs/guest-browser-qualification.md @@ -0,0 +1,106 @@ +# Qualified guest candidate and production host evidence + +The exact qualified image is now adopted with a durable corresponding-source +route in [the source notice](../vendor/guest/SOURCE-NOTICE.md). Native Prism acceptance remains a separate +SDK requirement. No product-release or whole-host certification is claimed here. + +## Exact candidate + +- Image SHA-256: `313a6b545290a2b47856b49bfcc4c7577469749b315932ae008d39fe70fc7f07`. +- Image size: 8,053,248 bytes; kernel: Linux 6.18.7. +- Emulator: the repository's existing v86 JS/Wasm/BIOS assets, with 64 MiB RAM. +- Required host boot arguments: `console=tty0 console=ttyS0,115200 rdinit=/init nomodeset`. +- Original image build: [run 42906244489](https://github.com/afflom/stitch/actions/runs/42906244489). + Every qualification below reused that image; none rebuilt the guest/toolchain. + +## Integrated product qualification + +The [combined hosted run](https://github.com/afflom/stitch/actions/runs/42927033321) +at commit `0b0639d61f992bb851ee3e5b2e187d37328b5493` passed the ordinary production +runtime and browser jobs after adoption. Its product files match work checkpoint +`6f7e4d49990bb3a31abcb3328e526f769cc23b56`; only the existing diagnostic workflow +selects these jobs without repeating the separately blocked native SDK gate. +There is no temporary image replacement or host-source patch in this run. + +- 374 JavaScript tests, all five original strata, independent Python wire vectors + and the Rust test passed. +- All 10 actual Chromium scenarios passed in 1.1 minutes, including the permanent + production-image peer Ethernet regression (28.8 seconds) and full VM operator + lifecycle (21.7 seconds). +- The four final screenshots were inspected: ready, stopped, cancelled with + unknown prior effects, and destroyed with configuration unlocked. +- Peer packet/command evidence records natural neighbor recovery on the second + bounded probe, reverse ICMP, denied pre-grant and post-revocation probes, and + unchanged receiver admission count after revocation. + +Browser artifact `13813788967` has ZIP SHA-256 +`7a6bb111def5352b31f9cd1861811f67763a7152b1fc6a9f93fddde8b86e1002`. +The integrated model separately passed actual pinned LexLean/Lean/kernel replay: +25 modules, 1,324 declaration audits and 85 successful processes, retained as +attestation `f85d00e01268644324d3a86938d5270228a14dc7d1ca2a6eaaf0c8fd8011512c`. +This does not turn source proof or host checks into native Prism acceptance; +that remaining SDK gate is still required before declaring the branch ready. + +## Observed production scenarios + +[Final Chromium operator run](https://github.com/afflom/stitch/actions/runs/42923694084/job/130204644360) +at diagnostic commit `d998432925e562577a7559b126af1437e933c0d5` passed in +23.3 seconds. The runner downloaded and SHA-checked the existing image, substituted +it and the exact boot arguments in its temporary checkout, then tested the actual +production UI and VM adapter: + +- VGA and keyboard shell, host/guest 9p readiness nonce, shell output capture and + retained command reconciliation; +- optional network settings initially collapsed, explicit static IPv4/prefix, + correct pending and confirmed-stop/destruction observations; +- stop, destroy, fresh boot and cancellation after actual command dispatch; +- unknown prior command effects retained after confirmed stop/destruction; +- networking and runtime configuration locked while an instance is retained, + then unlocked after confirmed destruction. + +Four screenshots were inspected: ready, stopped, cancelled-command/confirmed-stop, +then destroyed/retained-unknown-command. They distinguish host termination from +command-effect uncertainty and show configuration unlock correctly. Artifact +`13811439946` has ZIP SHA-256 +`51704acb32e72d5b5ac9f99de8865acf582e32b2522541e876909a51141886fc`. + +[Chromium guest peer run](https://github.com/afflom/stitch/actions/runs/42921514892/job/130197253391) +at diagnostic commit `039d30025956b527253bc16c60addb9081976379` passed in +37.6 seconds. Two production VM instances used explicit `10.42.0.2/24` and +`10.42.0.3/24` configurations and a native, authenticated, host-only RTC channel. +The test exercised serial shell, default Ethernet denial, bilateral grants, +bidirectional ICMP, actual ARP/IPv4 packet delivery, receiver revocation and +unchanged filesystem budgets. No public signaling or STUN/TURN was used. + +The intentionally denied first ping left normal guest neighbor-cache state. +The positive phase used at most three genuine bounded ping attempts, without +flushing that state: the first attempt remained FAILED; the second became +REACHABLE and returned a reply. Reverse ping then succeeded. Revocation caused +100% loss while the receiving VM's admitted-frame count stayed unchanged. +Artifact `13812047028` retains exact packet headers, command outputs, neighbor +observations and distinct authenticated routing identities. This is not a +promise of immediate packet delivery or automatic address uniqueness. + +## Reuse and diagnosed deployment requirements + +Buildroot's `/init` wrapper mounts devtmpfs; bypassing it with `/sbin/init` left +console device nodes absent. The candidate's modern graphics driver otherwise +switches v86 away from its legacy text console; `nomodeset` preserves that console. +A probe must recognize a real shell prompt, not a kernel `#1` banner. These are +host/probe corrections, not reasons to repeat an hour-long image build. + +Runtime and source changes are tested by their owning checks. The final operator +fix changed UI settlement refresh, not the image, Ethernet forwarding or source +model; its source proof and previously qualified peer behavior were retained. +The complete feature-branch acceptance still runs after final integration. + +## Distribution boundary + +See [candidate source evidence](guest-candidate-evidence.md) for the verified +398,457,213-byte corresponding-source package, configurations, licenses and +hashes. Actions artifacts expire and are review outputs, not final source +hosting. The complete reviewed package is now preserved at the immutable +repository commit linked by the source notice; retain equivalent source access +alongside the image in every distribution. These checks do not establish cross-device +network availability, guest isolation, exhaustive resource-exhaustion behavior, +or native Prism artifact acceptance. diff --git a/docs/guest-candidate-evidence.md b/docs/guest-candidate-evidence.md new file mode 100644 index 0000000..7c6cbc7 --- /dev/null +++ b/docs/guest-candidate-evidence.md @@ -0,0 +1,97 @@ +# Guest candidate evidence, 2026-11-10 + +This records the build and source review of the subsequently adopted image. +See [hosted qualification](guest-browser-qualification.md) and the durable +[source notice](../vendor/guest/SOURCE-NOTICE.md). It is not native SDK acceptance. + +## Immutable build and inspection + +- Build run: https://github.com/afflom/stitch/actions/runs/42906244489 +- Build commit: `d17aa7f3ffc6944b799ac43f6a5bab04ab3b82ef`. +- Original artifact: `13810385970`, 758474204 bytes; ZIP SHA-256 + `91e8c082de05e97e0781e97f5636ae89a7b0095001192b3019ab9ff7054fc714`. +- Inspection run: https://github.com/afflom/stitch/actions/runs/42917114652 + on isolated diagnostic branch. Original ZIP and internal checksums passed; + source archive partition reassembly matched the unchanged archive digest. +- Candidate image SHA-256: + `313a6b545290a2b47856b49bfcc4c7577469749b315932ae008d39fe70fc7f07`. +- Image artifact `13810002248`; inspection artifact `13809487986`. +- Source parts: `13809457978` and `13809323434`, each below the connector's + 512 MiB limit. Reassemble in aa,ab order and check the supplied digests. +- These artifacts expire 2026-11-24; they are review outputs, not durable + corresponding-source distribution. + +## Exact failure and repair without rebuilding + +The 61-minute image/source build succeeded. Initial qualification failed after +180 seconds. The real guest booted Linux 6.18.7, initialized NE2000 Ethernet and +9p, then repeatedly reported missing `/dev/tty1` and `/dev/ttyS0`. + +The host command line selected `rdinit=/sbin/init`, bypassing Buildroot's +`/init` wrapper. That wrapper mounts devtmpfs before running `/sbin/init`; +initramfs does not automatically mount devtmpfs. In addition, the test's old +byte-stream prompt regex reacted to the `#` in the kernel's `#1` banner and +injected its command before the shell existed. + +The same unmodified candidate image passed after the qualifier supplied +`rdinit=/init` and waited for a newline-anchored, space-terminated shell prompt. +Actual bundled-v86 execution completed in 4.68 seconds with 64 MiB configured +memory, verifying boot, serial command execution, host-to-guest 9p contents, +guest-to-host independent readback and guest eth0 presence/configuration. +No toolchain/image rebuild or runtime asset replacement was needed. The host +must retain `rdinit=/init` for this exact image: its compiled default still +contains the earlier `rdinit=/sbin/init` setting. A future recipe cleanup can +correct that default during a justified image rebuild. + +This does not establish browser VGA/user-interface behavior, peer Ethernet +exchange/consent, administrator resource limits or reset/restart correctness. +Those paths were subsequently exercised in the linked hosted qualification. Do not rerun the full compiler +build merely to change or re-execute the small qualification script. + +## Actual corresponding-source inventory + +The inspection includes resolved Linux/BusyBox configs, Buildroot config, +target/host license manifests, complete source file inventory and build tail. +Target manifests identify Linux 6.18.7, BusyBox 1.38.0, glibc +`2.44-57-g34106fee698c83eb0af71d4d0381e66b399be746`, and GCC runtime components. +The archive includes corresponding package sources, applicable license texts, +BusyBox patches and their ordered series, and host build sources. + +`legal-info/README` reports the standard missing-Buildroot-source warning. This +is addressed by the separately saved `release-materials/buildroot-source.tar.gz` +(SHA-256 `5313d2b5c366ecb6771543a8a587e5fab57d4c254c6c99e575f44466c248dee1`), +plus the exact external-tree archive/configuration and build script. Preserve +those with the package source materials, rather than presenting `legal-info` +alone as complete. Final distribution can deduplicate identical archives; it +must retain actual required source, modifications and instructions, accessible +with the image. A generic upstream link or temporary Actions artifact alone +is not the completed distribution route. + +## Consumable source package prepared after inspection + +The original source archive is 721,901,605 bytes (SHA-256 +`ec0cb061df8f400ec2efbe36e18b9021ae91459c40b046bb9c40585d948d4635`). +It includes unnecessary glibc download-cache Git history: a 271,496,818-byte +pack and 21,747,832-byte index, although the actual 41,528,183-byte glibc source +archive is already present. + +A source-review package was assembled without that redundant cache, preserving +**all** existing `legal-info` target/host sources, license texts and patches, +original `release-materials`, resolved Linux/BusyBox configurations and their +hash inventory. Shared source archives retain hardlinks instead of repeated +copies. The result is 398,457,213 bytes, SHA-256 +`fbc04b0c55f8421ca9bcf9e9dbac1952c07a1a2d82fd644ac67e66415b0106bc`. +All 178 file-path checks and original release-material hashes pass. It fits a +single artifact download. It has now been durably published as verified parts +on a separate source-only Git branch, keeping bulky sources out of the product +feature diff. The immutable commit and reconstruction instructions are in the source notice. + +The necessary release set is the actual image's applicable target sources, +modifications/patches, licenses, configuration and build/install scripts, +including Buildroot and the external tree. General-purpose host tools do not +become a new universal source-disclosure obligation just because they were +used to compile it. This convenient package retains the already-collected host +source materials as well, rather than making further size optimization a +release barrier. Retain the published package with equivalent access +alongside the image and preserve its verified URL/hash notice. No claim +of independent bit-identical image reproduction is required or made. diff --git a/docs/legacy-benchmarks.md b/docs/legacy-benchmarks.md new file mode 100644 index 0000000..ac0a41a --- /dev/null +++ b/docs/legacy-benchmarks.md @@ -0,0 +1,140 @@ +# Historical prototype benchmarks + +This is the upstream README snapshot at `472349ba3df131c47a5116529de453f7d394cd40`, retained for comparison. Its tables are deterministic simulations, not field evidence. Historical wording such as “verified” for traces means structural validation only. Storage strategies have unequal repair opportunities and their result does not isolate coding from scheduling. The current model and guarantees are in [prism-model.md](prism-model.md). + +# stitch + +> **Stratified Routing-Layer Persistence, UOR Content-Addressed Ephemeral Storage, and Distributed Compute** +> Strict functional isolation across 5 testable layers with empirical head-to-head algorithm benchmarks. + +**Browser Benchmark & Telemetry Console (Zero Setup):** [https://syntra-labs.github.io/stitch/](https://syntra-labs.github.io/stitch/) + +--- + +## 1. Stratified Architecture & Isolation Rules + +![stitch 5-Layer Architecture & Public Control-Plane Dataflow](./architecture.svg) +*(Source PlantUML: [`architecture.puml`](./architecture.puml) | Pre-Registered Falsification Contract: [`CONTRACT.json`](./CONTRACT.json))* + +The repository is divided into five strictly isolated strata. Each layer `L_k` may only import from `L_ Bytes) | +| - Tested under 100% node turnover (zero surviving initial nodes) | ++-------------------------------------------------------------------------+ + | ++-------------------------------------------------------------------------+ +| Layer 2: Liveness & Refresh Schedulers (src/layer2-schedulers/) | +| - Failure rate estimation (lambda), survival probability P(t), H(p) | +| - Compares Fixed-Interval, AIMD, Poisson-Survival, Entropy-Hysteresis | ++-------------------------------------------------------------------------+ + | ++-------------------------------------------------------------------------+ +| Layer 1: UOR Content Addressing & Ring Kernel (src/layer1-uor/, lib.rs) | +| - Direct Rust conformance binding to `uor-foundation = "0.5.2"` | +| - Z/(2^n)Z Datum ring ops, Hasher substitution axis, Trace verifier | ++-------------------------------------------------------------------------+ +``` + +--- + +## 2. Layer-by-Layer Candidate Comparisons & Empirical Results + +Run all unit assertions and comparative benchmarks locally with: + +```bash +make test +``` + +### Layer 1 — UOR Content-Addressing (`uor-foundation = "0.5.2"`) + +Directly binds [`uor-foundation = "0.5.2"`](https://github.com/UOR-Foundation/UOR-Framework) in [`src/lib.rs`](src/lib.rs) and verifies bit-identical output with [`src/layer1-uor/index.js`](src/layer1-uor/index.js) (`Fnv1aHasher16` digest of `[1, 2, 3, 4]` = `0x66a5cdda2e757277b806e89ae7615aa5`). + +| Hasher Candidate | Output Width (B) | Samples (64B) | Collisions | Throughput (ops/s) | Throughput (MB/s) | +| :--- | ---: | ---: | ---: | ---: | ---: | +| **`UOR-Fnv1aHasher16`** | 16 | 1,000 | 0 | ~119,700 | ~7.31 | +| **`UOR-Fnv1aHasher32`** | 32 | 1,000 | 0 | ~90,000 | ~5.49 | +| **`SHA-256`** | 32 | 1,000 | 0 | ~85,700 | ~5.23 | + +--- + +### Layer 2 — Pointer & Route Refresh Schedulers (Claim C3/C4 Equal-Budget Protocol) + +Evaluated over a 600-second window with record `TTL = 60s` and an **equal refresh budget cap ($B = 30$ refreshes)** across regime-switching churn ($CV = 1.149$): + +| Scheduler Policy | Refreshes Issued | Staleness Events | Unavailable Time (s) | Availability Ratio | Mean Recovery Lag (s) | +| :--- | ---: | ---: | ---: | ---: | ---: | +| **`Fixed-Interval (TTL/2)`** | 30 | 15 | 203 | 66.17% | 13.53 | +| **`Adaptive-AIMD`** | 30 | 11 | 181 | 69.83% | 3.60 | +| **`Poisson-Survival` (Unpaced — Refuted by C3)** | 30 | 4 | 336 | 44.00% | 1.33 | +| **`Entropy-Hysteresis` (Unpaced — Refuted by C3)** | 30 | 3 | 408 | 32.00% | 2.00 | +| **`Budget-Paced-Survival` (Cauchy-Schwarz $\sqrt{\hat{\lambda}}$)** | **30** | **16** | **175** | **70.83%** | **9.20** | + +*Falsification Finding (C3/C4):* Under an equal refresh budget ($B=30$), unpaced `Poisson-Survival` and `Entropy-Hysteresis` clamp to the 5s minimum floor and exhaust all 30 refreshes in the first 150 seconds, losing to `Fixed-Interval`. Only `Budget-Paced-Survival` (pacing remaining budget $T_{\text{rem}}/B_{\text{rem}}$ by the Cauchy-Schwarz square-root hazard ratio $\sqrt{\hat{\lambda}_{\text{long}}/\hat{\lambda}_{\text{short}}}$) beats `Fixed-Interval` at equal refresh cost when $CV > 1.0$. + +--- + +### Layer 3 — Ephemeral UOR Database Under 100% Node Turnover + +Strict zero-disk persistence test: 24 UOR content-addressed objects (256B each) are written to 5 initial nodes at $t=0$. Over 8 churn generations, 2 new nodes join and the 2 oldest nodes are hard-killed per generation until **0 initial nodes remain alive**: + +| Storage & Repair Strategy | Initial Nodes Remaining | Objects Recovered | Retention Rate | Storage Amplification | Network Bytes | Repair Ops | +| :--- | ---: | ---: | ---: | ---: | ---: | ---: | +| **`Unreplicated (R=1)`** | 0 | 0 / 24 | 0.0% | 1.0x | 6,144 B | 0 | +| **`Reactive Mirror (R=3)`** | 0 | 0 / 24 | 0.0% | 3.0x | 18,432 B | 0 | +| **`Proactive XOR Parity (2-of-3 + Survival)`** | 0 | 24 / 24 | **100.0%** | **1.5x** | 82,944 B | 576 | + +*Finding:* Reactive full mirroring (`3.0x` storage cost) loses blocks when simultaneous node drops occur between scrub cycles, whereas survival-guided proactive migration with 2-of-3 XOR parity (`1.5x` storage cost) retains **100% of objects** across complete cohort replacement. + +--- + +### Layer 4 — Distributed UOR Compute Engine Under Worker Churn + +Executes 20 deterministic programs (each consisting of 24 $\mathbb{Z}/(2^{64})\mathbb{Z}$ `PrimitiveOp` ring instructions) across churning workers that drop every 9 steps, verifying every final output with `verifyTrace`: + +| Execution & Fault-Tolerance Strategy | Tasks Completed | Mean Latency (ticks) | Total Ring Ops | Wasted Ring Ops | Checkpoints Written | Trace Verified Rate | +| :--- | ---: | ---: | ---: | ---: | ---: | ---: | +| **`Single-Worker Restart (No Checkpoint)`** | 20 / 20 | 33.0 | 660 | 180 | 0 | 100.0% | +| **`Speculative 2x Quorum (Active-Active)`** | 20 / 20 | 24.0 | 660 | 180 | 0 | 100.0% | +| **`Survival-Checkpointed UOR Trace`** | 20 / 20 | **24.0** | **480** | **0** | 60 | **100.0%** | + +*Finding:* Checkpointing intermediate `(stepIndex, Datum, TraceEvent[])` into the Layer-3 UOR store when worker survival probability $P(\text{alive at } t) \le 0.60$ achieves the same minimum latency as $2\times$ active-active replication (`24.0` ticks) while eliminating **100% of wasted ring operations** (`480` vs `660` ops). + +--- + +## 3. Repository Layout + +``` +stitch/ +├── Cargo.toml # Official uor-foundation = "0.5.2" Rust dependency +├── Makefile # Runs both Node stratum benchmarks and Cargo conformance tests +├── package.json # ES module manifest +├── index.html # Utilitarian browser benchmark & telemetry console +├── src/ +│ ├── lib.rs # Rust uor-foundation v0.5.2 conformance library & test +│ ├── layer1-uor/index.js # Layer 1: Z/(2^n)Z Datum, PrimitiveOp, Hasher axis, verifyTrace +│ ├── layer2-schedulers/index.js # Layer 2: Fixed, AIMD, Poisson-Survival, Entropy-Hysteresis +│ ├── layer3-storage/index.js # Layer 3: Unreplicated, Reactive R=3, Proactive 2-of-3 Parity DB +│ ├── layer4-compute/index.js # Layer 4: Restart, 2x Quorum, Survival-Checkpointed Compute +│ └── layer5-transport/index.js # Layer 5: RFC 8484 DoH (SRV/TXT) & WebRTC DataChannel +└── tests/ + └── run_all.js # Isolated unit assertions & comparative table runner +``` + +## License + +MIT © [Syntra Labs](https://github.com/Syntra-Labs) diff --git a/docs/lifecycle-effects.md b/docs/lifecycle-effects.md new file mode 100644 index 0000000..fc49b21 --- /dev/null +++ b/docs/lifecycle-effects.md @@ -0,0 +1,177 @@ +# Model-owned host lifecycles + +`app/src/Stitch/Effects.lex.tex` supplies the transition admissions used by the +live transport, DNS publisher and VM. `src/layer1-uor/effects.js` projects their +existing state into source-derived bindings. It does not keep a second effect +journal, allocate substitute identities, infer provider success, or refund +resource charges. + +## State and effect correspondence + +| Runtime | Existing state projected | Source-owned decision | Host observation that remains external | +| --- | --- | --- | --- | +| `WebRtcTransportNode` | Session generation, closed flag, actual topic and local/remote peer IDs | Close/open generation updates, signal admission, peer capacity and callback continuation | Browser peer-entry and DataChannel object identity, RTC events and networking | +| `PointerPublisher` | Scoped retained outcome, exact pointer digest and provider record ID | Candidate/read correlation, create/update/reconcile/wait/refuse, uncertain write completion | Complete provider listing, TXT shape, cryptographic verification and provider response | +| `LinuxVmNode` | Boot generation and one phase: idle, booting, ready or failed | Explicit boot/retry, current-instance callbacks, failure invalidation and readiness transition | Asset loading, emulator instance identity, observed prompt, completed typing, exact guest/9p response and guest execution | + +Identifiers are encoded as exact UTF-16 code units for equality. UTF-8 encoding +would collapse distinct JavaScript strings containing lone surrogates. No +sanitized relay topic, truncated digest, object display name or invented token +substitutes for the identities used by a particular runtime operation. + +## Transport + +Every captured callback binds its generation, topic and local peer. Peer and +channel callbacks additionally bind the remote peer and the captured live object. +The source consumes explicit object-identity facts computed at the adapter +boundary; it cannot inspect or authenticate a browser object itself. A reconnect +increments generation even when joining the same topic. Cleanup invalidates the +session before closing browser objects, which can synchronously invoke callbacks. +Pending offer/answer continuations recheck admission after each asynchronous step. + +These rules do not authenticate a remote peer, implement a signaling standard, +or establish delivery. Peer limits and message/timer bounds are operating policy. + +## DNS + +Publication is scoped by zone, DNS name and independently pinned authority key. +A retained unknown write permits only a read for the same candidate. A complete, +verified read of that exact candidate can reconcile it even after its validity +window. An absent or still-predecessor record never proves that an earlier write +was not applied. New mutations require a current validity window and either a +bootstrap pointer or an exact predecessor with the next revision. A retained +provider record ID cannot silently change. + +The publisher enters unknown before calling the write adapter. The built-in +adapter marks a thrown validation/admission refusal `effectDispatched = false` +only before invoking `fetch`. Such a definite local refusal permits a later +explicit retry without refunding already charged work. An unclassified exception, +lost response, malformed response or mismatched provider ID remains unknown. +Contradictory acknowledged/refused observations also remain unknown in the model. +No write is automatically retried. Provider rejection allows an explicit retry. + +The resolver adapter must establish listing completeness and record shape before +supplying read facts. The pointer verifier must authenticate full pointer bytes +against the pinned authority. Source contracts do neither. The optional session-local publisher is not restart-safe. The browser binds the +origin-local journal described below; neither mode establishes atomic provider CAS, +cross-device serialization, durable retention, DNS propagation, or global order. + +## VM + +A boot or explicit retry increments generation. Missing assets, constructor +failure, download failure and the configured readiness deadline move booting to +failed and invalidate listeners before cleanup. Another boot cannot begin while +booting or ready. Readiness and failure callbacks require the current generation; +readiness also requires the current emulator instance, completed initialization +typing, and an exact fresh bounded bidirectional 9p response. An observed guest +prompt only starts that probe and cannot enable command dispatch. Failed generations cannot resurrect readiness. Object mirrors recheck +the same instance after asynchronous writes. + +The deadline bounds the host's readiness wait, not guest initialization or +correctness. A shell-command timeout reports unknown completion and does not +claim to cancel the guest command. A separate 1–300s whole-VM runtime allowance +continues after observation ends. Explicit cancellation after dispatch, filesystem +quota rejection or result-size refusal requests a whole-VM stop, revokes bridges +and retains unknown prior effects. Guarded local-9p allocation and bounded result +reads are installed before emulator run; see [VM administration](vm-administration.md). +The lifecycle is separate from the deterministic +ring replay model; changing only lifecycle policy preserves that replay execution +identity while changing exact source provenance. + +## Verification boundary + +The source includes universal stale-session, stale-VM and unknown-DNS policy +obligations. Only actual pinned LexLean/Lean verification establishes their proof +status. Generated JavaScript bindings and mutation tests are implementation +conformance evidence, not a compiler or whole-browser proof. + +`tests/effects-model.test.js` checks independent finite lifecycle oracles and +plants source defects, regenerates bindings, and runs the real transport, DNS and +VM regression suites. The planted defects cover stale sessions, replaced channels, +repeating unknown DNS writes, stale VM callbacks and duplicate boot admission. +The existing lifecycle tests cover interrupted continuations, explicit retries, +cleanup reentrancy, exact provider IDs, local refusals and unknown outcomes. + +## Frozen C1 measurement + +The diagnostic connection trial uses the existing frozen contract version 1.1.0: +an ordered channel and ten consecutive heartbeat completions within ten seconds +from connection-attempt start. Source progress tracks only locally issued probes +whose echo matches the current generation, peer entry, channel, sequence, timestamp +and monotonic issue order. Incoming pings, duplicate pongs, old sequences and +after-deadline responses cannot contribute. A sequence gap starts a new run. + +The ordinary five-second heartbeat cadence is unchanged and will normally fail +this diagnostic criterion. The diagnostic deadline records failure without +closing the channel or restricting normal operation. No benchmark traffic is +added. Direct-path success additionally requires observed selected-candidate-pair +stats covering both local and remote candidate types. Missing stats or a relay at +either end is not direct-path success. The local stats wait has a one-second +operating bound; it does not extend the ten-second heartbeat window. + +The logger checks coherent ordered/count/window/setup/path evidence instead of +trusting a success Boolean. Threshold satisfaction is labeled `THRESHOLDS_MET`, +not verified WebRTC conformance. Physical network-pair classification and browser +stats correctness remain external observations. These tests do not establish the +frozen contract's required live trial corpus. + +VM canonical filenames now retain all 64 hex digits of the SHA-256 object root. +Optional human label aliases use a disjoint prefix and also retain the full root, +so shortened root prefixes or sanitized labels cannot overwrite a different +object. Guest file writes snapshot bytes before asynchronous calls. This is not +a proof of guest isolation or a change to the VM's opt-in controls. + +## Origin-local signing authority and publication journal + +The browser now uses `BrowserAuthorityStore` and an IndexedDB `records` store. +Saved authority setup is explicit. The private Ed25519 `CryptoKey` is +nonextractable and stored using the browser's structured-clone algorithm, never +serialized as secret bytes. Restoration validates the key type, usages and +public/private correspondence. Missing or invalid storage never creates or +rotates a key. Concurrent setup transactions keep the first committed authority. +Session-only key creation remains an explicit alternative. There is no private-key +export, import, rotation or backup flow; ordinary recovery bundles exclude keys. +Changing trust anchors remains an independent administrative decision. + +DNS publication in the browser requires this journal even with a session-only +signing key. The prior exact zone/name/pinned-key record is loaded under the Web Lock. +Provider reads, signature/record validation and local resource admission occur +before any unknown claim. Immediately before invoking the write adapter, one +transaction commits the signed candidate, observed provider record ID, owner and +unknown outcome. Failed reads, exhausted admission and aborted intent commits +therefore do not invent an uncertain external write or prevent a repaired explicit +retry. A provably undispatched adapter refusal is settled by its owned transaction; +if saving that refusal fails, the committed intent remains unknown. A scoped browser Web Lock spans each provider operation and journal settlement, +so a live suspended writer cannot be mistaken for an interrupted owner. The browser +releases that lock on context termination; if Web Locks is unavailable publication +is blocked. A competing tab then sees unknown and can only reconcile the retained exact +candidate, not claim a new mutation. No lease timeout or owner-tab interruption +allows another write. A definitive owner result may settle the claim; any tab may +settle an authenticated exact-candidate read. A prior published record cannot be +downgraded by a late refusal. Failure to save completion keeps the earlier unknown +intent. A crash after the write-ahead commit but before dispatch is conservatively +unknown too: absence is not proof that an earlier operation did not execute. + +The setup panel explicitly loads a scoped saved publication after restart. This +allows read-only reconciliation without possession of the private signing key or +live object bytes. It does not automatically import a retained observer head or +assert that a provider record is globally current. Credentials are call-local; +neither tokens nor private keys enter the DNS journal. + +`authorityMayCreate`, `journalMayClaim`, and `journalMayFinish` in +`Stitch.Effects` are bound directly by this runtime; `Product.Experience` owns the +explicit setup/load action descriptions. The transaction adapter and cryptographic +checks are external host observations, not consequences of those Boolean proofs. + +IndexedDB success is origin-local retention, not a durability promise. Quota, +private browsing, eviction, clearing storage, device loss and untrusted same-origin +scripts remain risks. Storage failures block new publication rather than silently +falling back to session-only mutation. Clearing a journal is not reconciliation. +There is no application control to delete unresolved intent. This is not atomic +provider CAS, cross-device coordination, exactly-once provider execution, global +DNS ordering, or a substitute for a recent independently trusted pointer anchor. + +`tests/browser-authority.test.js` uses an isolated synthetic serialized transaction +adapter for crashes, failed commits, concurrent callers and key restoration. It +is not a real browser IndexedDB or quota/eviction qualification. Supported-browser +storage behavior and provider trials remain required before release claims. diff --git a/docs/native-build-diagnosis.md b/docs/native-build-diagnosis.md new file mode 100644 index 0000000..b655f43 --- /dev/null +++ b/docs/native-build-diagnosis.md @@ -0,0 +1,131 @@ +# Native build diagnosis and passing-project comparison + +The source proof and native artifact gate are distinct. A successful Lean kernel +check is not a successful native Prism build. The original pinned SDK and +`scripts/check-model-sdk.sh` acceptance path remain unchanged. + +## Reproduced failure + +The [20-module checkpoint run](https://github.com/afflom/stitch/actions/runs/42843185062) +passed runtime checks but failed the model job with `PP5007: application-lean timed +out`. The SDK is pinned to +`ghcr.io/uor-foundation/prismpm-sdk-candidate@sha256:cd3b47d7a370c4a26b8285f5e9c3bb15e639973c55505c3809ddbe55352fea58`, +using LexLean 0.3.0 and Lean 4.32.1. + +A cold local reproduction used the exact generated 20-module source closure, +PrismPM's Lake configuration, `moreLeanArgs = ["-j2"]` and +`LEAN_NUM_THREADS=2`. Portable, Collections and independent project modules +compiled. `LexLeanRuntime.Laws` emitted its Lean object/IR but stalled during C +emission beyond 600 seconds. + +Post-frontend inspection found 695 declaration-order entries for 689 distinct +local impure declarations. Six matcher-splitter entries from +`LexLeanCollections.lessThan` and `LexLeanLaws.sumNat` had been reconstructed +automatically and then compiled again by the runtime reconstruction loop. +Lean's native declaration ranking consequently asserted while consuming the +longer order list, and C emission repeatedly failed during ranking/sorting. + +A diagnostic-only guard avoiding duplicate reconstruction made the same cold +graph pass all 25 Lake jobs in 15.503 seconds. Every generated Stitch project +module remained byte-identical. This is evidence for the root cause, **not an +accepted runtime patch or release attestation**. A production fix must preserve +mutual-recursion groups, kernel/axiom checking and native exported behavior. + +## Why other Prism projects pass + +- [Template's successful native run](https://github.com/UOR-Foundation/template/actions/runs/42820101494/job/129843150506) + at commit `05855f42dd1186aee9f4907985920514907b255e` uses the same SDK and really + executes `prismpm --project app verify`. Its three generated modules import + `Init` and `LexLeanRuntime.Portable`, not Laws or Collections. An independent + cold native build of that exact source closure passed all six Lake jobs in + about 11 seconds, with no factory seed or warm cache. +- [Rule30's successful proof run](https://github.com/afflom/rule30/actions/runs/42786571256/job/129729166929) + at commit `7e99c8418cade772c10d79be2731c193de7cd31a` uses LexLean 0.4.0 at + `15c667bd36604c94c28e39502edec3fcad38e0ce`. Its build stages Laws as Lean + object/IR without `-c`; Laws is not a native Lake root. That run does not execute + the equivalent `prismpm verify` gate. +- [Verdant's successful web run](https://github.com/afflom/verdant-resonance/actions/runs/42842203896) + at commit `4b5f7fda5c7dac106e11475dc62aaf7147f1cb9f` runs npm, TypeScript, + JavaScript tests and a Vite build. It does not run a native Prism gate. + +Template and Stitch both use a nonroot container user, ephemeral HOME, tmpfs +`/tmp` and `PRISMPM_EPHEMERAL_HOME=1`. Template additionally initializes Docker +buildx and runs earlier checks within the same container. The independent cold +template pass shows that a warm cache is unnecessary for its smaller runtime +closure. This is a specific native reconstruction failure exercised by Stitch, +not evidence that all Prism projects or all uses of this SDK fail. + +## Acceptance of the repair + +Use a corrected immutable upstream SDK, then run the unchanged Stitch source, +kernel, native artifact and vector gates, plus the passing template regression. +Do not remove Laws imports, replace the native gate with object-only compilation, +accept diagnostic artifacts as official outputs, or call a longer timeout a fix. +Full browser/provider/VM qualification and redistribution obligations remain +separate product requirements even after native verification passes. + +## Proposed compiler tested on actual project sources + +The actual compiler built from [LexLean PR #466](https://github.com/UOR-Foundation/LexLean/pull/466) +at `cc5561203de8fa5594d573904147a306b2b8bbbf` passed its integrated native +regression, then generated and verified the unchanged 25-module Stitch +checkpoint at `2f1fde8`. Its cold native graph passed all 30 Lake jobs in +16.355 seconds; the three-module template comparison passed six jobs in +11.097 seconds. [The diagnostic report, original logs and input hashes](evidence/native-candidate-466/README.md) +record the exact scope and reproduction. This used candidate-generated runtime +sources, not edited runtime text. The accepted SDK lock remains unchanged +pending upstream qualification and publication. + +After the placement model changed, the same actual candidate regenerated the +25-module closure at local source checkpoint `c99dc0d` and passed all 30 cold +native jobs again in 16.093 seconds. The separate `stitch-placement/` evidence +records those new input hashes; no earlier source attestation is reused for it. + +## Completion flow and evidence ownership + +Keep the dependency chain explicit instead of rerunning the known broken native +build after unrelated host changes: + +1. **Stitch source → source proof.** The current + [source summary](../product/source-verification.json) binds every declared + source/vocabulary/configuration input to the retained actual + [attestation](../product/source-attestation.json) and + [build manifest](../product/source-build-manifest.json): 25 modules, 1,324 + declaration audits and 85 successful Lean/leanchecker processes. This is + source evidence only, not native acceptance. +2. **LexLean source → repaired compiler.** LexLean owns PR #466's complete + acceptance. The exact compiler candidate and placement-checkpoint native + rehearsal are already retained above. A successful diagnostic does not + authorize a Stitch SDK lock update. +3. **Compiler → qualified SDK.** PrismPM owns reconciliation of the accepted + compiler revision, compiler-pair and SDK qualification, then publication of + an immutable image. Track the existing + [SDK owner coordination](https://github.com/UOR-Foundation/PrismPM/issues/194#issuecomment-6780585108). + The current `prismpm.lock` still selects the reproduced failing compiler; + this dependency is blocked, not a green or skipped native result. +4. **Qualified SDK → Stitch acceptance.** Consume the owner's qualified digest + and matching official locks, regenerate only the authoring outputs required + by that compiler, and run the unchanged + `sh scripts/check-model-sdk.sh --check` in that SDK. Retain its real source, + native artifact and vector evidence. A changed compiler requires new proof + evidence even if the application source is unchanged. + +`node scripts/check-source-evidence.mjs` cheaply checks the retained evidence's +input freshness, existing digest/ID bindings, reported statuses/counts and pinned +proof-tool identities. The normal Node suite includes negative cases for stale, +added, missing and mismatched inputs. Host-only changes leave these exact source +inputs intact, so the same source proof remains useful without another manual +proof build. Discovery includes `.lex.tex` modules and each bound lexicon's +`lexicon.toml` and `entries/` files; other documentation is not a compiler input. +This check authenticates no producer and replays no proof; it is +not a certificate verifier, native gate, workflow router or CI result cache. + +The factory work in [PrismPM #586](https://github.com/UOR-Foundation/PrismPM/pull/586) +describes release-line obligation identities and owner-controlled receipts. It +is draft upstream work, not a qualified consumer receipt API to copy here. +Stitch keeps its existing CI gates. Runtime/browser checks bind their own host +and test inputs; the independent source-complete guest build binds its recipe, +toolchain and resulting image/source/license materials. Neither a passing source +proof nor a passing browser test clears guest redistribution. Do not restart +that long build for unrelated model or host edits, and do not replace the +bundled guest until its actual candidate and accompanying materials qualify. diff --git a/docs/operator-experience.md b/docs/operator-experience.md new file mode 100644 index 0000000..9b55ba1 --- /dev/null +++ b/docs/operator-experience.md @@ -0,0 +1,92 @@ +# Operator experience projection + +`app/src/Product/Experience.lex.tex` owns six browser journeys: mesh disclosure and joining; objects, placement and recovery; deterministic pure jobs; host VM effects; pinned pointers and publication reconciliation; and application resource policy. + +This is the real `index.html` operator interface, not a separate probe. The existing strict project-owned source adapter explicitly selects `Product.Experience` alongside the Stitch domain modules. Its generated definitions in `src/layer1-uor/generated-model.js` supply the actual journey metadata, view selectors, evidence labels, action guards, named evidence palette, navigation visibility, focus policy and explanation-disclosure policy. Unsupported source syntax and stale generated bytes fail the source check. This adapter is not LexLean, a proof compiler or a host certificate. + +`src/product-experience.js` is the handwritten DOM adapter. It reads existing domain/runtime observations; it does not add an effect ledger, resource ledger, custody history or publication journal. `index.html` binds the same model action predicates both to disabled buttons and to the handlers, so a forced click cannot bypass readiness. The real adapters still enforce exact resource costs and domain preconditions before effects. + +## Information in context + +- Only the selected journey panel is visible. Moving between journeys retains form edits and runtime state. Native navigation buttons support Enter/Space, move focus only on explicit navigation and never overwrite the URL's mesh-key hash. Scrolling is nonanimated, including for reduced-motion users. +- Every input has a persistent associated visible label. Instructions describe byte/step bounds, scope, trust and disclosure beside the relevant controls. Contextual polite result/error regions retain the wire log and its details rather than replacing evidence with color. Action descriptions preserve authored explanation references. View summaries use polite, atomic live announcements. Unchanged status does not announce again on every timer tick. Named status colors have tested text contrast on the current dark panel surface; the status wording carries meaning without color. +- Detailed evidence explanations are disclosures. The model initially opens them when first-use signaling disclosure, unknown publication or resource-policy review needs attention. Other explanations remain available on request. Asynchronous observations do not steal navigation or focus. +- Public signaling requires explicit disclosure acceptance and an explicit join. Acceptance alone does not connect; withdrawing it closes the mesh. Public object/job relay disclosure is a separate opt-in. +- Provider publication setup appears after a pinned authority, including after a reload with no object or observer-head RAM. Loading a saved write must not require volatile object state. A separate reconciliation action replaces new publication while an exact scoped candidate is unresolved. Unknown state opens its explanation and reconciliation controls. +- Guest command controls appear only after an observed ready VM lifecycle. Captured stdout/stderr has a bounded, keyboard-scrollable UTF-8 text preview before object storage is attempted. A command selector exposes every retained handle, including an earlier unknown result, through the same per-command admission predicates. Selection never dispatches or replays a command. Forgetting resolved evidence also clears its displayed preview. A guest-output object digest is not execution certification. Pure-job replay evidence remains distinct. +- Scheduler estimates, external inspection commands and experimental benchmarks are contextual diagnostics, not first-use readiness gates. Benchmarks do not run on startup. +- Resource attention is not a second admission system. Exhausting one dimension or refusing an expensive operation does not globally prohibit later cheaper work. The exact runtime vector remains authoritative. Expired epochs, full reservation capacity and clock regression block global application admission; inspection/export/explicit renewal remain available. + +## Evidence scope + +Local object integrity is distinct from conditional, digest-checked peer assertions. Peer identifiers do not establish independent machines, honest retention or reachability. Pure-job aggregate replay status requires every relevant unfinished job to have replay evidence; a completed replayed job cannot mask an unverified unfinished job. A retained local pointer head is not a DNS publication receipt. A confirmed provider record is not global DNS ordering or resolver propagation. An open peer channel is not full WebRTC/NAT certification. Neither a successful join nor a C1 benchmark is a barrier to ordinary local use. + +The module includes finite, kernel-checkable safety witnesses and universally quantified Boolean gate properties for disclosure, guest readiness, unknown publication and blocked budgets. The project-owned projection tests are separate implementation-conformance checks, including a mutation test proving that changing Experience source changes the real generated labels and guards. Neither kind of evidence certifies the whole browser, OS, network, VM or physical host. + +## Checks and remaining boundaries + +Focused checks: + +- `node --test tests/product-experience.test.js tests/runtime-admission.test.js` +- `node scripts/check-model.mjs` +- `node scripts/check-product.mjs --check` +- Actual `lexlean fmt`, `lock`, `check` and `verify` against the official pinned toolchain. The final project closure, not this projection, owns release assurance. + +The surrounding DOM snapshot extraction, markup, layout, spacing, typography, input grouping, advanced-diagnostic copy and table rendering remain handwritten. Do not infer full presentation correspondence or a complete standards implementation from this journey model. The executed-script test harness exercises the actual inline browser script but is not a real graphical browser or physical WebRTC/provider trial. + +## Restart, scope and recovery + +Saved authority setup/restore and the write-ahead publication journal are origin-local mechanisms. They are not backups, key rotation, or private-key export/import. After a reload, explicitly pin the original saved key, use the exact DNS name and Cloudflare zone, then load saved publication. A token is needed for reconciliation reads, not for loading the journal. Unknown writes retain the exact candidate; changing name, key or zone selects another scope rather than resolving an earlier write. Journal/store failures do not establish absence or authorize another candidate. The interface explains scoped token replacement without retaining its value. + +Object/job export/import and explicitly accepted recent-anchor evidence are available through the recovery journey. Import and acceptance do not restore signing keys, provider-write journals or a live observer head. A separate Restore Accepted Live Head action requires the selected exact accepted anchor, matching independently pinned live name/key, current signature/validity and an empty or identical retained head. Normal strict succession then resumes. Different retained heads are never overwritten; even a newer independently accepted anchor cannot replace them. Export selection is retained across panel reopening; new entries are not silently added to a previous selection. Imported selectors retain an available choice and explicitly identify empty evidence sets. Editing the selected anchor, independently trusted key or digest clears the corresponding acceptance checkbox. Editing these inputs or the live scope, or closing recovery, cancels an in-flight restoration before commit. Reopening never repeats an action. The recovery view distinguishes accepted vault evidence from an accepted anchor that is the live local head. + +## Qualification still required + +The new label/instruction checks are static markup checks. Executed-script and synthetic-DOM tests cover refusal feedback, interrupted storage, replay/import state, saved-write access with no object RAM, retained-command selection and text output when caching fails. They do not establish WCAG compliance, browser accessibility-tree correctness, visual reflow, screen-reader announcements, native file/download or clipboard behavior, or real IndexedDB/Web Locks interoperability. The graphical VM display can contain graphics-only applications with no equivalent text. The shell command/output path is a text alternative for the operations this UI exposes, not an accessibility certification of arbitrary guest software. + +A prior Chromium launch was blocked by the execution environment's Unix-socket restriction. No browser launch or alternative bypass was attempted in this change. Real graphical/browser and assistive-technology qualification remains outstanding, along with provider/WebRTC/physical-host trials and the final exact-source/native-artifact gates. Local recent-anchor restoration now has a source-owned admission predicate and explicit operator journey; it remains session-only and cannot establish global latest state, durable trust or key rotation. + +## Repairing a retained object's placement + +Store commits local bytes even before peers join. In the objects journey, select +one exact full verified object, then use **Repair Selected Placement** after +peers join, an ACK lease expires or a data channel is replaced. Repeated Store +for those same bytes runs the same maintenance. Fetch Reachable Fragments stays +a retrieval operation and does not invent writer assignments or remote custody. +The selection is explicit and stable across status updates; a partial fragment +cache cannot authorize repair. The selected-object evidence reports current +route/lease-qualified receipts, pending ACKs, uncertain requests, retained copy +assertions and pending release observations separately. Elapsed time updates the +evidence without dispatching maintenance or changing navigation. + +Repair fills missing indices on distinct current peer routes. A pending transfer +is not repeated while its exact route, lease and resource reservation remain +current. Once those observations lapse, it becomes uncertain, retains its +history and charges, and a later explicit repair can issue a fresh request. +Expired or disconnected committed assertions become superseded, not deleted. +A fresh checked receipt can renew the same physical holder/index assertion +without counting two copies there. No surviving local bytes means repair is +unavailable; recovery still needs enough retained information elsewhere. + +To move an unexpired live fragment, choose its current holder in **Holder to +replace** before repair. The old committed source stays until the new exact +receipt commits. Activation checks the actual dispatch's frame/envelope +reservation IDs in their still-live original epoch, the exact request and +manifest, target route, lease and current source. A changed epoch, replaced +channel, forged/stale receipt or failed/unknown send cannot activate the target. + +Once at least two current fragments and a current replacement for that index +exist, Stitch requests release of the exact superseded sender/request/index +assignment. Only its correlated route-bound release ACK permits retirement from +the sender's accounting. The holder checks that the request is still its current +assignment; old releases cannot erase renewals or other writers' assignments. +Lost release ACKs retain the old assertion and can be retried idempotently by a +later explicit repair after the 15-second local observation deadline. Neither +that deadline nor lease expiry proves remote deletion or refunds resource use. +Local read/full-byte caches and other writers' custody remain additional copies. + +These are bounded session-local observations: at most 256 transfer-history +records and 64 retained copy assertions per placement. Reaching a bound refuses +more transitions rather than discarding unknown custody. Peer assertions and +release assertions still depend on truthful peers; distinct route identities do +not prove independent machines, durable storage or future reachability. diff --git a/docs/prism-model.md b/docs/prism-model.md new file mode 100644 index 0000000..55dae39 --- /dev/null +++ b/docs/prism-model.md @@ -0,0 +1,85 @@ +# Stitch model and implementation contract + +## Authority and scope + +The project-owned LexLean modules under `app/src/Stitch/` define pure domain semantics. A project vocabulary extension names the domain; Foundation byte/application modules supply Prism interfaces. This is not a fixed-choice classifier. Integrity, authority, reconstructibility, execution, resources, evidence and observed availability are distinct. + +The modeled surface covers objects, encodings, fragments, custody, observations, resource admission, pointer succession, pure computation, checkpoint linkage, evidence and their composition. Completeness means coverage of these contracts and explicit boundaries, not a proof of the internet or browser/VM implementation. + +The official skill was discovered through https://uor.foundation/agents.md and its skill index. The website snapshot describes 0.2.0; this repository pins published `prism-code` 0.7.2 and uses its current bundled skill/API. The SDK is separately digest-pinned. `afflom/verdant-resonance` informed modeling depth, without importing garden-specific constants, controllers or Rule 30 mechanisms into a network protocol. + +## Domain map + +| Domain | Invariant / boundary | +|---|---| +| Identity | Distinct immutable object/encoding/manifest commitments; SHA-256 collision resistance is assumed | +| Encoding | Exact decoding and indexed compatible 2-of-3 XOR fragments; every external basis must be declared | +| Custody | Requested/acknowledged/committed/failed/superseded copies; a peer retention assertion is not a storage oracle | +| Observation | Time-bounded observer evidence; timeout means reachability loss, not death or an omniscient global view | +| Budget | Independent resource bounds, reservation before effects, no refund for unknown outcomes | +| Pointer | Pinned writer, exact successor/predecessor, half-open validity interval; retained observer head is required | +| Compute | Identified program/input/model, bounded step, semantic replay and checkpoint links; no VM effects | +| Evidence | Evidence reuse binds model/artifact/subject roots, exact claims, assumptions, ordered dependencies, permitted effects and finite observation horizons | +| System | Composition preserves admission conditions and never treats an attempted effect as completed | + +## Object wire contract + +`src/layer1-uor/custody.js` implements RFC 8785 JCS canonicalization over finite IEEE 754 binary64 numbers, Unicode scalar strings and UTF-16-sorted object names, with UTF-8 output. Negative zero serializes as zero; NaN and infinities are refused. `parseCanonicalJson` rejects duplicate names (including escape-equivalent names) before signature processing. Accessors, custom prototypes, hidden fields, invalid Unicode and explicit resource-budget excess are refused. Application schemas independently reject unknown fields, fractional revisions and malformed digests. See [canonical JSON](canonical-json.md) for standard coverage, compatibility and evidence boundaries. + +Each hash frames a versioned ASCII domain, unsigned 64-bit big-endian payload length and exact bytes. Object, encoding, fragment and manifest domains differ. A fragment binds its encoding digest and unsigned index. A manifest never hashes its own digest field. Initial encoding is raw, self-contained bytes; unsupported dependencies/encodings fail closed. + +XOR splits bytes into two equal-sized halves, padding only the last half, with their XOR as the third fragment. Recovery validates two different compatible indices and full fragment commitments, reconstructs the declared length, then checks object and encoding digests. Empty/odd-length inputs and every pair are covered independently in Node/Python vectors. + +The sender may retain the full original while remote peers hold distinct fragments. Thus 1.5× is a nominal coding ratio, not total physical storage. A placement carries a typed receipt per copy. Recovery is evaluated at the stated time from live, authenticated, exact-manifest/exact-fragment receipts on distinct holders, not a caller-supplied committed flag. Migration activation requires its still-live current-epoch ledger reservation and the exact request root. Superseded copies remain accounted until an exact route-bound release acknowledgement. The live selected-object repair path binds each actual dispatch reservation and its unique local epoch, expires lost ACKs conservatively, and refreshes same-holder/index assertions only after a fresh checked receipt. Expiry or local route loss supersedes reachability without asserting physical deletion. Retrieval copies and public-relay copies are additional. Peer IDs do not prove physical failure-domain independence. + +## Mutable pointers + +The v1 body contains `version`, `name`, `authorityKey`, `revision`, `previousDigest`, `objectRoot`, `validFromMs` and `validUntilMs`. Signature bytes cover a domain label and canonical body. The pointer digest covers body and signature. Bootstrap requires revision zero, no predecessor and an independently supplied trusted authority. A successor is exactly current revision plus one and binds the retained pointer digest. Validity is `from <= now < until`. + +Conflicts/stale updates are refused. A client that loses its trusted head needs a separate independently trusted exact recent anchor to prevent rollback. Import and acceptance alone never change a live head. Explicit local restoration reads only the accepted vault anchor, rechecks signature/validity and exact pinned name/key/digest, and restores only an empty or identical head. Restoration shares ordinary admission's serialized CAS; any different retained head refuses, even a newer accepted anchor. Normal exact successor admission then resumes. Key rotation/revocation are explicit origin-local administrative operations; they never transfer independent trust or provide multi-writer ordering. See [browser authority](browser-authority.md). The DNS UI requires explicit authority pinning, keeps an observer head for strict successor checks, and uses multipart Cloudflare TXT records for full pointers. Saved nonextractable signers and independently accepted exact name anchors can be retained origin-locally. Saved heads advance transactionally on strict succession and restore only through an explicit exact-scope action. Independent retention is still required because browser storage can be lost. The legacy single-255-byte DuckDNS path is refused for full pointers. Publication retains provider record identity and reconciles uncertain writes by bounded exact reads. An unresolved create/update is not repeated blindly; an exact signed match resolves uncertainty. Successors update the existing record. This is not provider-atomic compare-and-swap or global ordering. + +## Pure jobs and checkpoints + +Version 1 programs specify width (8/16/32/64/128), exact input and all instructions. Values use canonical lowercase unsigned hex. The full-width ring operations include modular POW. Version 1 DIV/MOD by zero yield zero, preserving the legacy interpreter. Version 2 adds explicitly capacity-bound, width-tracked byte-sequence CONCAT, all byte-aligned result widths, empty sequences, mixed-width arithmetic and 8-bit comparisons. Version 2 DIV/MOD by zero are refused. Source semantics, upstream profile differences and exact versioned records are documented in [UOR primitives](uor-primitives.md). + +Local policy bounds programs to 1,024 instructions and 1,000,000 abstract work units. Version 2 terms additionally have a tested 32768-bit parsing/memory envelope and explicit program capacity. These are resource bounds, not upstream semantic limits. Work counts modular multiplication rounds, bitwise width, limb complexity and CONCAT bytes rather than treating wide POW as one cheap instruction. Program/input identity, model identity, step, state and predecessor bind checkpoints. Every checkpoint is replayed from input, including when network checkpoints were missed. Direct successors bind the retained predecessor. An independently replayed snapshot with an unavailable predecessor reports its chain link unchecked. + +Checkpoint `modelDigest` identifies the reachable ring/checkpoint definitions and types, the generated evaluator, and the transitive JavaScript replay adapters under `stitch/execution-semantics/v1`. Canonical syntax determines the model portion, so proof formatting or unrelated product changes do not invalidate the same execution. Adapter bytes are deliberately conservative: any adapter change invalidates that execution identity. `MODEL_SOURCE` separately retains exact whole-source/vocabulary provenance. Legacy whole-source checkpoint roots are not implicitly accepted. + +Typed digest observations bind every exact program, input, job, state and checkpoint field to its distinct domain and an independently supplied expected model root. This assumes the host hashes the exact typed input using the declared versioned canonical encoding. The model does not implement SHA-256, prove collision resistance or authenticate an observation producer; wire-byte-to-record correspondence remains a host contract. Legacy root-only predicates check replay, not commitment admission. + +Partitions can cause duplicate pure computation. There is no exclusive execution or exactly-once external effect claim. VM output can be stored as an object but is not a semantically verified ring job. + +## Policies and effects + +Budgets keep request count, transfer bytes, stored bytes and compute steps separate. The caller supplies epoch/time interval/nonnegative limits. The ledger is the sole modeled resource authority, with immutable action IDs, epoch-bound reservations and per-resource aggregate validation. Reservations are immutable; duplicate action IDs fail. Unknown outcomes remain charged. Settlement reduces cost only when actual expenditure is known and within the reservation. A known expenditure observation permits settlement only within the ceiling, and is not proof of delivery or storage. The host must durably retain and serialize the ledger; scalar helpers are compatibility arithmetic, not effectful admission. Clock regression and expired epochs fail closed; a new epoch requires a deliberate new budget. + +The browser exposes all operational limits and duration. Only the explicit Start New Epoch action grants another allowance; prior reservation ledgers remain retained and exportable. Renewal preserves stored objects, jobs, authority pins and trusted pointer heads and does not retry pending work. The browser shares one explicit admission controller across transport, storage, computation, and DNS. It bounds application requests and UTF-8 payload ceilings, cumulative cache allocation, and replayed abstract compute work. It does not meter TLS, ICE/STUN, VM, browser or operating-system overhead. The default ten-minute epoch is configurable and never resets or refunds automatically; exhaustion is an explicit refusal, not evidence of indefinite service. + +The survival heuristic remains an experimental proposal. Browser evaluation uses monotonic elapsed time and an internal cap. One favorable churn schedule does not establish optimality or a universal Poisson model. + +## Evidence register + +| ID | Claim | Required evidence | +|---|---|---| +| ST-OBJ | Compatible fragment pairs recover committed bytes | Formal XOR relation, independent vectors, tamper refusals | +| ST-CUSTODY | Unacknowledged transfer is not committed; a live bound receipt and exact ledger reservation are required before replacement activation | Admission predicates, transition/expiry/superseded-copy tests | +| ST-BUDGET | Admitted reservations stay within every bound | Nat arithmetic theorem, boundary/duplicate/clock/settlement tests | +| ST-POINTER | Accepted successor is fresh, ordered and authorized under a supplied anchor | Successor theorem, signatures/wrong-key/replay/conflict tests | +| ST-JOB | Accepted checkpoints match replay; resume equals uninterrupted execution | Transition/link theorems, all-op/all-width/every-cut tests | +| ST-HOST | Evidence reuse requires exact typed scope and dependency bindings | Modeled boundary and concrete receipts; field trials remain required | +| ST-BINDING | Runtime functions match their source | Strict extractor, source digest, freshness and independent differential tests | + +Evidence labels are not attestations: comparing KernelChecked or HostAssumptions fields does not prove the producer authenticated them. Exact dependency-root and ordered-snapshot checks do not discover unknown dependencies. + +Formal status comes from the actual exact-revision SDK job, not this table. Node/Python conformance proves neither the browser nor a live network. The gate must publish the exact model lock, verification report and built artifact identity before a release proof claim. Handcrafted holos and invented attestations are prohibited. + +## Reproduction and negative tests + +`npm test` checks generated freshness, baseline regressions and adversarial contracts. `python3 scripts/verify-custody.py` independently checks wire vectors. `cargo test --locked` checks original UOR conformance. `sh scripts/check-model-sdk.sh` runs formal acceptance inside the locked SDK. CI uses the same source revision. + +Tests alter fragment bytes, manifests, checkpoint states with recomputed digests, links, signers, revisions and budgets. Correctly hashing a forged state is not enough: semantic replay must reject it. Generated drift must fail before execution. These are deterministic tests, not physical three-peer reliability measurements. + +## Extending Stitch + +New encodings specify exact decoding and all dependencies. New effects expose request/acknowledgment/commit/unknown states. Policies may propose choices but cannot bypass resource/safety admission. Extend LexLean semantics first, add positive and negative vectors, regenerate bindings and pass SDK/runtime gates. Do not introduce random weights or unrelated cellular automata merely to make a model appear richer. diff --git a/docs/product-projection.md b/docs/product-projection.md new file mode 100644 index 0000000..805745f --- /dev/null +++ b/docs/product-projection.md @@ -0,0 +1,213 @@ +# Complete Stitch product projection + +## What is represented + +`app/src/Product/Model.lex.tex` is the project-owned typed product graph. Its +`product` value contains the component, capability, external-assumption, +dependency, deployment and artifact declarations listed in +`product/contracts.json`. `valid` checks identity uniqueness, component-to-asset +closure, capability ownership and assumption closure, dependency consumers and +deployment capability references. `productGraphIsClosed` states the concrete +structural acceptance obligation. The register is derived from these declarations; its counts are not policy +scores, reliability measurements or limits on extension. + +The graph covers all five Stitch layers and the actual browser product: + +- Canonical objects, encodings, XOR fragments, local cache, conditional peer + custody, migrations and recovery. +- Experimental scheduling proposals under independent resource admission. +- Deterministic programs, checkpoint replay, transfer and resumption. +- Independently pinned pointer authority, full pointer DNS serialization, + DoH reads and scoped DNS writes. +- Browser DOM, WebCrypto, elapsed and wall clocks, session RAM, WebRTC, + same-origin BroadcastChannel and public signaling. +- Separately enabled public payload relay and its disclosure boundary. +- v86, WebAssembly, BIOS, Linux guest image, 9p object-file mirroring, shell + output and Ethernet forwarding. +- Same-origin static publication and every currently loaded local asset. +- Historical simulation/Rust conformance, distinguished from the live product. +- Native Linux routing as an explicitly unsupported browser boundary. + +`Product.Host` defines typed requests, destination/content/session-bound grants, +pending effects and matching terminal host observations. Admission reserves the +existing action-ID budget ledger before appending a pending request. Pending +requests do not create observations. Observation binding checks the action ID, +capability, subject, destination, session and non-regressing observation time. +Repeated or wrong-session completions are refused; recording a success, failure +or unknown outcome never refunds the ledger. These are pure contracts, not a +new browser driver or a claim the handwritten runtime already implements this +entire journal. Domain acceptance remains necessary after a host response. + +The host contract does not accept an arbitrary boolean as proof of storage, +cryptography, propagation, guest execution or retention. Its authorization flag +is an externally supplied grant observation with an explicit exact scope. The +host is responsible for obtaining that grant, serializing transitions and +retaining its journal. A source theorem cannot authenticate a host assertion. + +## Tested host-transition correspondence + +The implementation uses existing component state rather than a second generic +budget or journal. Focused interruption tests now exercise these refinements: + +- Transport fences signaling, ICE, sockets, peer replacement and data-channel + callbacks with exact channel and generation identity. Switching or reconnecting + a mesh invalidates old asynchronous work before cleanup. +- DNS publication retains destination/pinned-authority-scoped candidates and + provider record identity. Bounded exact reads precede writes. An uncertain + create or update permits reconciliation reads, not a blind repeat; signed + matching content confirms the observed result. Tokens are not retained in + publication state. Provider acknowledgement is neither DNS propagation nor + atomic compare-and-swap. +- VM startup has constructor/download/readiness failure transitions and a + configurable finite deadline (60 seconds by default). Cleanup permits explicit + retry, and generation identity fences old callbacks. Cleanup is best-effort, + not proof that host downloads stopped. A command timeout means its completion + is unknown, not that the command was cancelled. Whole-VM runtime expiry and + explicit cancellation after dispatch separately request a stop; local-9p + pre-allocation limits and bounded range reads are installed before run. The + retained-command selector can observe earlier available handles without replay. +- `Stitch.Pointer.restoreAllowed` admits only a separately accepted exact vault + anchor in its independently pinned live scope, with current signature/validity + and an empty or identical retained head. `PointerObserver` shares restoration + and succession's serialized CAS; no different retained head can be overwritten. + `Product.Experience` separately exposes import, exact acceptance and explicit + restoration, with checked/accepted/live-head evidence and busy/scope guards. + The branded vault read, cryptographic result, clock and DOM facts remain host + observations; no imported evidence automatically establishes trust. +- Serialized storage/compute ingress, immutable reservations, retained pointer + heads and explicit resource-epoch renewal implement their corresponding local + admission boundaries. Unknown effects do not refund previous charges. + +`tests/transport-generation.test.js`, `tests/dns-publication.test.js`, +`tests/vm-lifecycle.test.js`, `tests/pointer-recovery.test.js`, recovery UI tests and the browser-script harness in +`tests/runtime-admission.test.js` cover these concrete paths. They do not prove +universal runtime refinement of `Product.Host`, physical browser/NAT behavior, +or the host's cryptographic/grant attestations. The full contract's typed grant +roots and complete terminal-observation journal remain specification boundaries, +not claims about mechanisms absent from the runtime. + +## Official Prism representation and the supported route + +The official `Foundation.Arch` facet represents the complete component and flow +view through `app/src/Product/Architecture.lex.tex`: 18 components, 31 directed +flows, an operator, a recoverability concern, a viewpoint and its view. All +indexes are derived contiguous positions in sorted declaration-identifier order. +There are no invented quality scores, thresholds or measured availability rows. + +The type-only `app/src/Foundation/Arch.lex.tex` subset comes from the official +[PrismPM Foundation.Arch source](https://github.com/UOR-Foundation/PrismPM/blob/fe5b8b73a94134c316329a8d1b09ebc97b555c5f/stdlib/src/Foundation/Arch.lex.tex). +The complete original source is 8,959 bytes with SHA-256 +`9a79e4912d33b1736d7451ab726ed0a83d958b8d9c70091a749fbc70acd48cdc`. +Only the architecture record/enumeration types through `View` are retained; +SDK demonstration values, classes, instances and later design-view types are +omitted. The title uses the existing local glossary. This preserves the +qualified type names the official projection registry recognizes and does not +modify the SDK projection mapping. The upstream project offers MIT OR Apache-2.0. This subset is used under MIT; +its original notice is retained in `product/PRISMPM-LICENSE-MIT.txt`. +The application continues using its existing digest-pinned SDK; this reference +inspection does not upgrade or replace `prismpm.lock`. + +The official +[specification sections 2 and 11](https://github.com/UOR-Foundation/PrismPM/blob/fe5b8b73a94134c316329a8d1b09ebc97b555c5f/SPEC.md) +explain the limit of the currently supported containing-system profiles: + +- `prismpm/system-model/2` is a static generated DOM/WebAssembly browser + application with **no persistent storage and no external application + services**. The specification explicitly says empty Holo capabilities do not + admit browser-effect requirements. It cannot truthfully contain full Stitch. +- `system-model/1` is the transactional production-service profile, not an + arbitrary browser product graph. +- `system-model/3` is a separate host-effect server service with loopback-only + Linux/Compose deployment. It is not a WebRTC browser profile and does not + automatically supply whole-product release/replay or deployment acceptance. + +Accordingly, the supported implementation is the project-owned complete typed +product contract plus the official architecture facet projection, with the +existing pure `StitchApp` as the selected TextApplication conformance probe. +No field claims a browser capability grant, and no custom `system-model` JSON +or fabricated product release is introduced. The probe's kernel/artifact +acceptance, when actually obtained, covers that selected pure core and its +stated source obligations, **not the complete live browser implementation**. + +## Exact local assets, dependencies and unresolved provenance + +`product/contracts.json` is an application-owned contract register, not an +SDK input schema, Holo, signed attestation, build receipt or certificate. +`scripts/check-product.mjs` reads closed literal rows from the model and binds +all formal source, local vocabulary/configuration, SDK and npm locks, and the +exact byte length/SHA-256 of every declared local product asset. It checks +cross-reference closure and refuses omitted browser assets. It does not compile +LexLean or prove the runtime implements a contract. + +The inventory records existing v86 JavaScript/Wasm, SeaBIOS, VGA BIOS and Linux +image bytes. [The provenance review](vendor-provenance.md) establishes official +v86 distribution identity, actual JavaScript reconstruction and complete +applicable notices, plus the BIOS origin and corresponding source/configuration. +The four resolved assets require their accompanying `vendor/v86` or +`vendor/seabios` materials in distributions. `vendor/distribution.json` binds the +reviewed asset and companion bytes; the existing product-register check refuses +changed assets or missing/substituted required materials. +The adopted Linux 6.18.7 guest has a verified immutable source-distribution tree, +linked by `vendor/guest/SOURCE-NOTICE.md`. `vendorDistributionMaterialsRecorded` +states the model register now records accompanying materials for every asset; +it is not a legal conclusion, remote-availability proof or native SDK acceptance. +Independent byte-identical compiler reconstruction is useful evidence, not a +new licensing condition for every asset. +An asset digest proves identity of the inventoried local bytes, not ownership, +license, security or that a remote static host served those bytes. The current +browser does not verify every dependency against this inventory at load time. +A production redistribution release needs the original source/license notices +and provenance review for each vendor artifact. + +External dependencies are API/host trust boundaries rather than fictional +immutable hashes: browser APIs, Cloudflare DoH/API, Google/Cloudflare STUN, +public ntfy signaling and optional cache, and the selected static origin. +Cloudflare tokens are secret references only; no token value belongs in the +model, inventory, evidence or repository. A provider's current availability, +API policy, DNS propagation or peer retention needs independent observation. + +## Deployment and lifecycle contracts + +The browser deployment is an ordinary same-origin static product, with the +complete local asset set and explicitly enabled network functions. A valid +static publication is not a successful browser readiness test. Probe-only +publication cannot replace the multi-panel Stitch UI. Rollback retains an +entire prior asset set. Reloading loses RAM, session-local budget state and +unpersisted trusted anchors. Explicitly saved origin-local signing keys and +publication journals survive an ordinary reload when browser storage remains +available; that is not an eviction-proof backup or persistent object-custody +guarantee. Unknown provider outcomes remain unresolved until reconciled. + +VM memory sizes and request ceilings already in the implementation are host +configuration, not derived kernel guarantees. VM boot/shell/Ethernet operations +are outside deterministic ring-job semantics and its compute-work accounting. +DNS provider acknowledgement is not resolver-wide freshness. A timeout is a +local observation, not peer death. Different peer identifiers are not evidence +of independent failure domains. Public signaling/relay topics are not access +controls, and sufficient relayed fragments reveal the object. + +## Reproduce and evaluate + +After an intentional model, runtime or configuration edit: + +```sh +node scripts/check-product.mjs --write +node scripts/check-product.mjs --check +node --test tests/product-model.test.js +``` + +Review register diffs alongside the source changes. The checks cover stale +source/asset hashes, unknown capability owners and assumptions, missing assets, +unknown deployment capabilities, dangling architecture flows, noncanonical +indexes, relay opt-in removal, unsupported browser routing claims, literal +substitution and changed vendor bytes. Mutation tests do not establish network, +VM, browser or cryptographic correctness. + +The sorted LexLean entrypoints `src/Product/Architecture.lex.tex` and +`src/Product/Model.lex.tex` are included in the same source graph as the domain and probe. +Run canonical formatting, source locking, LexLean check, Lean/leanchecker with +actual exact observed axiom policies, and the pinned PrismPM gate. Report each +stage separately. Neither the generated register nor `lexlean check` is a Lean +proof result; real kernel acceptance is distinct from full Prism artifact and +oracle acceptance. No external hosted verifier upload is required or authorized +by this documentation. diff --git a/docs/recovery.md b/docs/recovery.md new file mode 100644 index 0000000..3e07482 --- /dev/null +++ b/docs/recovery.md @@ -0,0 +1,41 @@ +# Operator-controlled recovery evidence + +The object journey's **Export and restore recovery evidence** controls provide a real local backup/restore path. Export copies complete live objects, replay checkpoints and retained signed pointer heads into canonical JSON. Import reconstructs and verifies every object, replays every supplied checkpoint against its exact current execution identity, and verifies supplied pointer signatures. Unknown fields (including keys, grants and journals) are refused. + +Import commits an entire checked candidate to a separate session-only recovery vault. It does not call mesh transport, mount guest files, resume live coordinators, mutate a DNS observer, retry pending writes, or restore authority keys. Download a recovered object or explicitly finish an imported pure ring job locally. The result is volatile until saved externally. Losing all bytes, keys or independently trusted recent anchors cannot be repaired by this feature. + +## Wire and resource contract + +Version 1 has exactly `version`, `objects`, `jobs`, `anchors` fields. Each object contains its complete manifest and two or three `{index, hex}` fragments. Jobs contain the exact program and checkpoint. Anchors are complete signed pointers. Canonical UTF-8 JSON is required; duplicate names, noncanonical spelling, malformed Unicode, unknown schemas and trailing bytes fail closed. + +The default envelope supports up to 32 entries and each object's full live 128 KiB maximum. Hex carries twice the decoded bytes. The wire ceiling is derived as 32 × (2 × 128 KiB + 64 KiB), allowing fragment data and program/manifest overhead. The default replay ceiling is 32,768 abstract work units. The retained `replaySteps` field name measures the source-owned work calculation, including POW and typed-width arithmetic costs, rather than merely counting instructions. This preserves the cost of original version-1 instructions while charging new, more expensive operations explicitly. Operators can lower the wire and replay allowances. Both import preflight and explicit local continuation check work before evaluating a supplied program. These are bounded operation/storage admission limits, not a measurement or guarantee of total browser memory. JSON depth, string and parsed-value counts are separately bounded. The local canonical codec accepts explicit caller bounds while preserving its previous default bounds and exact JCS bytes. + +Preflight checks the aggregate replay work before executing supplied programs. Only incoming jobs are replayed, not all retained history on every import. Canonical serialization of the merged bounded vault is linear in retained wire size. Concurrent imports use a generation comparison at commit; a stale operation fails instead of losing another update. Exact already-retained entries are idempotent. Conflicting object representations, rollback and same-step forks are refused. Strictly later checkpoints of the same exact program replace older replay evidence; an adjacent step must bind the retained predecessor. Newer same-authority signed anchors can update supplied evidence, with adjacent revision linkage checked. Previously accepted trust stays unchanged until the operator independently confirms the exact newer anchor. Missing intermediate links are not claimed verified. No unknown predecessor checkpoint is represented as a checked chain link: checkpoint verification remains independent replay. + +All imported evidence is snapshotted. No retained vault mutation occurs until validation, conflict checks, bounds and generation checks succeed. Failed checks leave existing vault and accepted anchors unchanged. SHA-256 of canonical merged evidence binds the modeled state root; cryptographic verification and exact host-to-model correspondence remain explicit host assumptions. + +## Trust is not transferred by a backup + +A bundle's signed anchor is **untrusted supplied evidence**, even if its self-declared key verifies its signature. The operator must separately supply an independently trusted writer key and exact recent pointer digest, explicitly accept that decision, and satisfy the pointer validity interval at the supplied wall-clock observation. Exact retained-anchor conflicts and revision rollback fail closed. Signature validity or a file timestamp does not establish freshness or a globally latest state. + +Acceptance records that decision in this vault only; existing DNS observers do not change. Export never serializes accepted trust status. Re-importing a previously accepted anchor requires a new independent decision. + +### Explicit live observer restoration + +1. Import the retained evidence file. Its signatures establish internal consistency, not trusted authority or freshness. +2. Independently obtain and enter the exact recent digest and trusted writer key. Accept that exact anchor explicitly. +3. In **Pin, discover and publish pointers**, independently set the live query name and pinned writer key. The recovery panel reports that scope; it never copies an imported key into the live pin. +4. Return to recovery and choose **Restore Accepted Live Head**. The selected supplied anchor must match the separately accepted digest, writer and exact live name. Restoration rechecks the signature, current validity and still-current acceptance after asynchronous crypto, then uses `Stitch.Pointer.restoreAllowed`. +5. Admit only its exact next successor through normal pointer admission. The restored local head is not evidence that any DNS record was published. + +`PointerObserver.restoreFromRecovery` reads accepted provenance through the vault's private-field brand, not a caller-supplied `accepted` flag or bundle snapshot. Restoration and ordinary admission share one serialized compare-and-swap queue. Only an empty observer or the exact same retained digest qualifies. Any different retained head refuses, including a newer accepted anchor, a rollback, a same-revision fork or an otherwise valid direct successor. Advance an existing live head by normal succession instead. Duplicate restoration is idempotent and does not reserve storage twice. A failed validation or local storage reservation leaves the head unchanged and does not poison the queue. + +Changing selected recovery inputs or the live pin, or closing the panel, cancels an in-flight UI restoration before commit. Reopening does not repeat it. There is no DNS, mesh or VM call, journal retry, signing-key restoration, key rotation or automatic takeover. Head and accepted trust remain session-only. Recency and the independently pinned writer are explicit operator assumptions; timestamps, self-signatures and restoration do not prove globally latest state. + +## Verification and boundaries + +`tests/recovery.test.js` covers exact round trips, the live maximum object size, corruption, incomplete fragments, duplicate/unknown fields, recomputed forged checkpoints, foreign execution identity, conflicting snapshots, aggregate limits, stale/untrusted anchors and concurrent imports. `Stitch.Recovery` models atomic accepted bundle-root/capacity/generation transitions and recent-anchor admission. `tests/pointer-recovery.test.js` covers the restore predicate and concrete CAS/trust/expiry races; UI and executed-inline-script tests cover the separate import, accept, restore and strict-successor journey without effects. `Stitch.Pointer` states unaccepted/different-head/expired restoration refusal obligations. Kernel results apply only to the exact source verified by the release workflow, not to browser effects or cryptography. + +The canonical-codec adapter change conservatively changes the execution identity. Checkpoints from earlier execution identities are refused; there is no silent migration or claim that changing a model digest revalidates an old checkpoint. A future migration must explicitly revalidate and generate a new identified pure checkpoint. + +Origin-local saved signing authority and unknown-write journals are separate implemented mechanisms, not recoverable from this bundle. The separate [browser authority controls](browser-authority.md) implement explicit local signer rotation/revocation, trusted-anchor migration, quota inspection, persistence requests and conservative journal export/cleanup. Remaining operational requirements include independent key/recent-head retention and real supported-browser/field qualification. Exporting a local file is not a durability certificate or a cleared whole-product release. diff --git a/docs/relay-framing.md b/docs/relay-framing.md new file mode 100644 index 0000000..c934de3 --- /dev/null +++ b/docs/relay-framing.md @@ -0,0 +1,65 @@ +# Bounded ntfy application framing + +Stitch uses ntfy's HTTP publish, WebSocket text notifications and newline-delimited JSON poll APIs. The provider documents a 4096-byte message limit; a longer publish body may become an attachment. Stitch therefore frames logical messages itself. It never follows attachment URLs, and it rejects old unframed ntfy packets. All peers sharing a topic must use this framing version. BroadcastChannel remains a local logical-message transport. + +The application policy and admission/assembly transitions are defined in `app/src/Stitch/Relay.lex.tex` and consumed through the existing generated model projection by `src/layer5-transport/relay-framing.js`. The projection is not a new compiler or verification receipt. Parsing, SHA-256, clocks, allocation and browser/provider effects remain explicit host facts. Source theorem acceptance requires the project's pinned SDK checks. + +## Wire format + +Each ntfy message is a JSON object with exactly these fields: + +- `v`: `stitch/1`. +- `p`: `signal` or `warm`. The two purposes cannot be concatenated. +- `c`: domain-separated SHA-256 of the JSON-encoded exact channel-key string. The channel and peer identity strings must be valid I-JSON Unicode; malformed local identities are refused before an existing session is closed. JSON-encoded hashing preserves exact code-unit distinctions without normalization. +- `s`: a 128-bit cryptographically random sender-session identifier, lowercase hexadecimal. Reconnect replaces the session. +- `m`: domain-separated SHA-256 of the complete logical message's original UTF-8 bytes. +- `t`: sender creation time, integer milliseconds. It is an untrusted freshness hint, not authority. +- `b`: complete UTF-8 byte length. +- `n`: chunk count. +- `i`: zero-based chunk index. +- `x`: unpadded RFC4648 base64url chunk bytes. Noncanonical padding, alphabet and nonzero pad bits are rejected. + +The existing `sha256Bytes` domain framing is used with domains `relay-channel` and `relay-message`. This framing preserves the enclosed manifest, object, program and checkpoint identities. It does not replace their validation or authenticate the sender. + +A chunk contains 2700 bytes except for the last chunk, which has the exact remaining length. The count must be exactly the ceiling of `b / 2700`. Every serialized provider body, including all framing metadata, is checked against the 4096-byte UTF-8 limit. UTF-8 characters may span binary chunks; strict decoding occurs only after complete reassembly and digest verification. The strict shared JSON parser rejects duplicate names, invalid Unicode, nonfinite values and malformed syntax before an application envelope is admitted. + +## Resource and retention policy + +- The complete logical JSON limit is 512 KiB, matching the existing application message ceiling. The obsolete2048-byte public-object demonstration cap is removed: the full128KiB live-object range fits the512KiB logical envelope ceiling, including worst-case decimal byte-array encoding. JSON entry capacity derives from the byte ceiling rather than an independent limit that rejects a valid maximum-sized fragment. +- At most 256 frames are declared per message. Actual 512 KiB messages require at most 195 frames. +- An assembler admits at most 16 active messages and reserves their full declared lengths before allocating a payload buffer, with a total 2 MiB retained-payload ceiling. Independent pending input work is limited to 256 frames of at most 4096 bytes each. Decoded chunks, bounded parser objects, digest copies and browser/runtime overhead are additional bounded application work, not measurements of total browser memory. +- Completed, rejected and expired identities are kept in at most 256 tombstones. Active entries also reserve a future tombstone slot. Saturation refuses new work instead of evicting unrelated data or weakening duplicate suppression. +- An incomplete assembly has a 30-second local monotonic deadline from its first accepted frame. Receiving duplicates never extends it. One cleanup timer releases expired buffers even with no further traffic. Closing/rejoining cancels live assemblies and fences pending verification. If a host digest still owns its input buffer, that buffer remains charged until the digest settles; cancellation cannot pretend it has been freed. A transport-shared verification pool also counts such buffers from older generations in new-message admission. At most16 pending verification buffers and 2 MiB of their payload bytes can be held, independently of additional bounded digest copies. +- Signaling accepts sender timestamps within a 60-second application lifetime; warm messages use 30 minutes. A timestamp more than 5 seconds in the future is refused. Local retention never exceeds its own receive-time horizon, even if the sender supplies a future timestamp. Clock regression refuses work. +- A warm poll has a 2 MiB provider-body limit, 16 KiB per notification envelope and one in-flight poll per transport. Only complete messages from that snapshot are returned. Incomplete buffers are discarded when the poll finishes. A later poll can retrieve a complete copy. This is an application window, not a promise about ntfy retention. +- Outbound work shares at most 16 pending batches and 2 MiB snapshotted logical bytes across reconnects. Source-derived 30-second abort deadlines cover outbound batches and warm polls. Browser fetch cancellation is best effort; it cannot establish that a publisher-side effect did not occur. + +The existing ResourceAdmission ledger is reused. Before the first external effect, one batch reservation charges the actual serialized frame count and UTF-8 body bytes, including framing overhead, plus any local broadcast destination. Local reassembly separately charges declared storage bytes and conservative validation work. Ingress WebSocket bytes are charged; a poll already reserves its bounded response ceiling. Expiring or completing an assembly releases its resident payload buffer, but does not refund the cumulative resource budget or unknown network effects. + +## Tested host representation relation + +The adapter maintains these relations between concrete browser state and the source projection: + +- Capacity entries equal the active map size; retained bytes equal the sum of active declared `header.b`; tombstones equal the retired-key map size. Cancelled entries with a pending digest remain in the map and retain their charge until settlement. New-message admission additionally includes retained verification entries from other generations sharing the transport pool. +- An active buffer has exactly `header.b` bytes. Its bitmap has exactly `header.n` slots. A seen slot stores the received chunk at `i * chunkBytes` with the exact model-admitted length. Peer identities are limited to 128 code units by the transport adapter. +- Assembly received-frame count equals the bitmap population count; received-byte count equals the sum of exact chunk lengths for those seen indices. Only unseen indices advance either counter. An existing slot is a duplicate, and a conflicting byte is refused and retires that exact assembly. +- Identity agreement includes purpose, exact channel digest, sender session, message digest, creation time, count and declared length. Different sessions never share a buffer. +- Delivery requires complete counters, whole-buffer domain-separated SHA-256 verification, strict UTF-8 and JSON validation, the matching current transport generation, and current payload consent. + +These are adapter representation relations exercised by independent runtime tests. The source does not contain an indexed byte-buffer implementation, a formal SHA-256 or UTF-8 implementation, or a kernel proof that handwritten host operations refine that representation relation. It owns admission, identity correlation, counters, effect fencing and completion gates. Browser allocation, byte placement, parsing, hashing and effects remain named host boundaries. + +## Consent, sessions and outcomes + +`publishWarmEnvelope(value, { publicData: true, consentCurrent })` and `fetchWarmEnvelopes(window, { publicData: true, consentCurrent })` require explicit action-scoped opt-in. The optional live callback and transport-level `publicRelayConsent` callback are checked before every external payload frame and before exposing recovered data. The browser binds the transport callback to its current disclosure checkbox. Withdrawn consent prevents remaining frames but cannot recall frames already posted. Compute also supplies its current relay permission. Private object/job bytes are never published by default. + +`sendSignal` returns a synchronous boolean indicating whether local bounded work was queued. It does not report publication or recipient delivery. Every asynchronous operation captures exact transport generation, channel, sender session and consent, then rechecks them before each effect. Reconnect, Close and replacement callbacks cannot dispatch old-session continuations. + +`relay_publish_result` reports planned, attempted and HTTP-acknowledged frame counts, HTTP status, timeout state and outcome. `acknowledged` means all provider POSTs returned success. `partial`, `refused`, `unknown`, `cancelled`, `timeout`, `unavailable` and `local-only` distinguish incomplete or unavailable publication. A transport generation that is no longer current cannot emit a stale completion into the new session. The warm boolean is true only if all frames were acknowledged and the captured session/consent is still current. Neither result promises durable cache storage or delivery to another peer. + +There is no automatic retry, attachment fallback or background publication. A non-success status, including 429, stops the batch. Earlier acknowledgements and every reservation remain accounted for. ntfy's public quotas and rate limits can make a multi-frame message fail; operators should inspect outcomes, keep public workloads small, and use a suitably provisioned provider for larger workloads. A retained complete copy and subsequent full object/checkpoint validation are still required for recovery. + +## Verification + +`tests/relay-framing.test.js` uses only synthetic fixtures and mocked provider effects. It covers both the original2048-byte all-255 object and a maximum128KiB all-255 object through the real cold database recovery path, large SDP through the actual WebSocket receive path, a full 512 KiB message, UTF-8 splits, reordered/duplicate/conflicting/corrupt/mixed/expired/incomplete messages, malformed JSON and base64url, resource saturation, consent withdrawal, reconnect during digest work, stalled verification across expiry/disposal with shared admission, exact batch charges, 429 and partial outcomes. No real ntfy requests or user payloads are used. + +Provider reference: https://docs.ntfy.sh/publish/ (Limitations and caching), https://docs.ntfy.sh/subscribe/api/ (JSON/WebSocket subscriptions). These are provider contracts, not substitutes for the referenced IETF protocol standards. diff --git a/docs/standards-and-operations.md b/docs/standards-and-operations.md new file mode 100644 index 0000000..50a9ce9 --- /dev/null +++ b/docs/standards-and-operations.md @@ -0,0 +1,32 @@ +# Standards and operational completion + +Stitch's model must describe the delivered product, not merely its pure probe or a collection of claims. Referenced standards are implemented for the actual selected role, including applicable error, lifecycle and interoperability requirements. A runtime test, a source theorem and an external-provider observation answer different questions. + +## Standards roles + +| Reference | Stitch's role and evidence boundary | +|---|---| +| RFC8831 / RFC8825 | Browser WebRTC application. The browser supplies ICE, DTLS and SCTP; Stitch owns signaling, channel lifecycle, message framing, flow control and qualified connection evidence. No independent peer identity or NAT success is inferred from a channel event. | +| RFC8656 | TURN is an optional browser/provider dependency, not a Stitch TURN server. The frozen direct-connect experiment disallows TURN success; that experiment does not block ordinary connectivity. | +| RFC8484 | Real application/dns-message stub client, with HTTP/DNS response/error handling and bounded DNS decoding. See dns-client.md. Authoritative/recursive server and local DNSSEC-validation roles are not claimed. | +| RFC8032 | Ed25519 is delegated to WebCrypto, while Stitch owns signed bytes, exact field validation and trusted-authority/revision admission. No Ed448 or unused signature variant is claimed. | +| RFC8785 | JCS encoding and strict I-JSON input validation. See canonical-json.md. Application integer schema constraints are distinct from the complete binary64 codec. | +| RFC9162 | The original concept cited an optional Merkle-pattern inspiration. Stitch does not claim to operate a Certificate Transparency v2 log merely because that reference exists. | +| ntfy and Cloudflare API v4 | Provider protocols with explicit quotas, disclosure and outcome uncertainty. They are not interchangeable with an IETF standard or a permanent retention guarantee. | +| Prism/LexLean and the SDK standard lock | Exact selected compiler/profile/oracle obligations remain required. The 44 locked authorities and 18 SDK oracle entries are available toolchain metadata, not 44 application compliance certificates or a request to add unrelated Kubernetes/OIDC features. | + +Primary sources: [RFC8831](https://www.rfc-editor.org/rfc/rfc8831.html), [RFC8825](https://www.rfc-editor.org/rfc/rfc8825.html), [RFC8656](https://www.rfc-editor.org/rfc/rfc8656.html), [RFC8484](https://www.rfc-editor.org/rfc/rfc8484.html), [RFC8032](https://www.rfc-editor.org/rfc/rfc8032.html), [RFC8785](https://www.rfc-editor.org/rfc/rfc8785.html), [RFC9162](https://www.rfc-editor.org/rfc/rfc9162.html), [ntfy publishing](https://docs.ntfy.sh/publish/), [Cloudflare DNS API](https://developers.cloudflare.com/api/resources/dns/subresources/records/). + +## Operational work still required + +These are actual unfinished implementation/qualification items, not ceremonial gates or a declaration that the product is complete: + +1. **Retain and restore the right information.** Validated object/job evidence export/import and explicit recent-anchor recovery are now implemented in the recovery journey. Explicit origin-local nonextractable signing-key setup/restoration and transactionally claimed unknown-write journals are now implemented. Actual Chromium persistence/reload, nonextractable signing, multi-tab exclusion and unknown-write retention passed [the hosted browser suite](https://github.com/afflom/stitch/actions/runs/42909486101/job/130156053948). Other browser/eviction behavior is not inferred from that result; there is no private-key backup or cross-device recovery. A zero-disk peer remains possible, but recoverability cannot survive loss of every required byte, key and anchor. Browser storage needs quota/eviction/backup handling rather than a durability promise. +2. **Complete channel interoperability.** Negotiated DataChannel sizing, versioned fragmentation, bounded queues and backpressure are implemented. Ed25519 key-bound session signaling, replay rejection and arrival-ordered RTC admission are implemented; actual Chromium fragmented payload, custody, exact-byte recovery after writer RAM loss and reconnect passed the linked suite. Other browser and physical-network qualification remains outside that evidence. Neither the DataChannel adapter nor ntfy framing certifies all SCTP/browser behavior. +3. **Qualify guest administration.** Explicit object/Ethernet grants, stop/destroy quarantine, instance-bound command handles, unknown-outcome reconciliation and resolved-evidence disposal are implemented. Actual bundled-guest boot, bidirectional 9p readiness, shell result capture, command reconciliation and stop/destroy passed in Chromium. Replacement guests require their own qualification. The browser cannot establish VM isolation from a Boolean model observation. +4. **Resolve distribution provenance.** The original guest image still lacks full kernel/Buildroot/package source materials. The four v86/BIOS assets have resolved origins and accompanying notice/source packages; preserve those materials in distributions. The [pinned replacement build](https://github.com/afflom/stitch/actions/runs/42906244489) is producing candidate evidence; a completed and qualified replacement is not yet claimed. Do not substitute a successful boot for source/license evidence. +5. **Qualify the integrated product.** The exact source proof, runtime/independent vectors, native Prism artifact gate, browser journeys and relevant provider/VM trials must name the revision they tested. Do not rerun identical work redundantly or convert simulations into physical measurements. + +See [recovery](recovery.md), [channel flow](channel-flow.md) and [VM administration](vm-administration.md) for implemented operational contracts and their limits. + +Changes so far correct reproduced defects: DNS response association, C1 false success, truncated guest identity, excessive provider message size and partial canonical JSON. Their tests belong with the implementing code. This document does not defer the remaining product requirements; it keeps them visible until implemented and demonstrated. diff --git a/docs/uor-primitives.md b/docs/uor-primitives.md new file mode 100644 index 0000000..539efe6 --- /dev/null +++ b/docs/uor-primitives.md @@ -0,0 +1,125 @@ +# UOR primitive operations and typed replay + +## Semantic source + +The audit uses UOR-Framework workspace version 0.5.2 at immutable commit +[`51c01382200b0179d6640b07e9c8119364ab69a1`](https://github.com/UOR-Foundation/UOR-Framework/tree/51c01382200b0179d6640b07e9c8119364ab69a1). +The existing Rust dependency remains `uor-foundation = "0.5.2"`; Cargo.lock pins +registry archive checksum `0179d3c29eb68e52ed03f9b48136159d4d4d26bd6b8008da3a9864b43ed0492f`. +The audited Git source and the registry archive are distinct provenance records; +this audit does not assert their byte identity or claim to have run Cargo. + +Specific references under that commit: + +- `foundation/src/enums.rs`: PrimitiveOp discriminants 0 through 17. +- `foundation/src/pipeline.rs:5115–5150`: CONCAT appends the complete big-endian + left term bytes followed by right term bytes. It is not ring multiplication, + OR, a sentinel zero, or truncation modulo the original width. Its evaluator's + INLINE_BYTES parameter controls capacity; the framework has no universal + 128-bit/4096-byte CONCAT limit. ADR-028 validates output capacity before use. +- `foundation/tests/behavior_catamorphism_evaluator.rs:536`: `abcd` concatenated + with `1234` is the four-byte term `abcd1234`. +- `foundation/src/enforcement.rs:5364`: `const_pow_w128` uses square-and-multiply + with the entire 128-bit exponent and wrapping multiplication, including 0^0=1. +- `foundation/src/pipeline.rs:5202–5226,5397`: binary arithmetic uses the maximum + operand byte width, at least one byte. POW operates modulo 2^(8·width), including + the byte-level wide path. Comparisons return one byte. DIV/MOD by zero are + rejected in the term pipeline, whereas the constant ring evaluators return 0. + +The pipeline's unary path currently converts to u64 and clamps output to eight +bytes (`pipeline.rs:5068–5099`). Stitch deliberately retains the genuine full-width +ring unary operations modeled by `const_ring_eval_w128`, rather than silently +copying that truncation into existing jobs. Therefore this is an explicit ring/ +byte-sequence execution profile, not a claim that Stitch implements every detail +of UOR's general term-tree evaluator. Stream, borrowed-carrier, resolver, and +arbitrary term-tree evaluation are outside this pure instruction interface. + +## Existing version 1 programs + +Version 1 program and checkpoint field sets remain unchanged. Program widths +remain 8/16/32/64/128. Existing operation results, including DIV/MOD by zero=0 and +ring-width comparison results, retain their meaning. POW 17 is now supported at +every width. It normalizes both operands in that ring and never narrows an +exponent to Number/u64. CONCAT 14 is still refused in this scalar-only version. + +The legacy `applyPrimitiveOp` adapter also supports POW. Its CONCAT result is a +wider Datum with the sum of operand widths, or a RangeError if that result exceeds +Datum's existing 128-bit implementation envelope. Datum coordinate `toBytes()` +stays little-endian. CONCAT follows the term's big-endian sequence ordering, so +its numeric value is `left · 2^right.bits + right`. These are different encodings. + +## Version 2 width-tracked programs + +A version 2 program has exactly these fields: + +- `version`: 2. +- `bits`: initial byte width in bits, including 0 for the empty sequence. +- `capacityBits`: explicitly declared maximum intermediate/result byte width. +- `initialValueHex`: canonical unsigned lowercase hex numeric value. +- `instructions`: unary `{op}` or binary `{op,argBits,argHex}` records. + +Every width is a multiple of8, including non-power-of-two widths 24,40,72,etc. +`0x0` with width 0 represents the empty sequence. Width is never inferred from +numeric magnitude, so leading zero bytes survive CONCAT and checkpoints. + +CONCAT sums widths and appends without truncation. Arithmetic chooses the maximum +operand width, at least 8 bits, then normalizes in that ring. Comparisons return an +8-bit 0/1 word. Unary operations retain the full input width, at least 8 bits, per +the ring profile above. DIV/MOD zero operands are rejected before execution. + +The source-owned `Word`, `TypedInstruction`, `typedInstructionAllowed`, `typedStep`, +`typedExecute`, and work functions define these rules. Runtime validation uses +the same source predicates and result-width function for every instruction. +`typedResumeEqualsUninterrupted` proves continuation for arbitrary finite typed +instruction lists. The source also proves exact CONCAT value/width identities, +capacity refusal, result-width admission, the zero-exponent unit/cost laws, and a kernel-evaluated 128-bit POW vector with exponent bit 100 set. +These proofs do not establish cryptographic hashing or the complete host adapter. + +Version 2 checkpoint bodies add `stateBits` and use `version:2`. The program hash +binds capacity, initial width, all operand widths and values. Checkpoint hashing +binds state width. Verification replays both width and value, rejecting even a +self-consistently rehashed forged width. Checkpoint predecessor checks remain +strict. Both versions bind `modelExecutionDigest`, including source semantics, +interpreter and transitive replay adapter bytes. Old execution roots are refused; +no old checkpoint is silently relabeled as executing new semantics. + +## Resource contract + +The pure source model is capacity-parametric. The JavaScript host exposes a +separate local policy: at most 1024 instructions, 32768 bits (4096 bytes) per term, +and 1,000,000 abstract work units per program. The 32768-bit limit is a tested +parsing/memory envelope, not an upstream semantic limit or a promise of unbounded +stream handling. Program-wide width and work validation completes before any +replay step. A supplied admission ledger reserves the exact replay range's work +before evaluation; verification and suffix execution each pay for their actual +replay range. + +`computeSteps` is the historical budget field name. It now measures explicit +abstract interpreter work, not just instruction count or wall-clock CPU: + +- Version 1 existing instructions cost 1. POW costs 1 plus one modular square per + exponent bit and one modular multiply per set bit. +- Version 2 CONCAT costs 1 plus output byte count. Bitwise operations cost 1 plus + arithmetic bit width. ADD/SUB/unary/comparisons cost 1 plus 64-bit limb count. +- Version 2 MUL/DIV/MOD cost 1 plus squared limb count. POW costs 1 plus squared + limb count times its exact square/multiply count. The ceiling conservatively + prices wide arithmetic; it is not a benchmark of a JavaScript engine. + +No exponentiation forms the unbounded integer `base ** exponent`. The source +square-and-multiply helpers reduce after every multiply. Source tail calls are +trampolined in the subset interpreter; modulus construction and bitwise helpers +also avoid width-dependent JavaScript call-stack growth. Tests exercise the full +local capacity and refuse a maximum-width hostile exponent on static work cost. +Host validation, hashing, allocations, VM/browser/network overhead and physical +energy remain distinct from these abstract compute units. + +## Verification + +`tests/primitive-operations.test.js` covers pinned upstream examples, independent +left-to-right modular exponentiation across all version 1 widths, exponent bits +above 64, every 8-bit CONCAT output width through 128, empty terms, mixed operands, +comparison widths, checkpoints/resume, recomputed width forgeries, budget refusal, +and maximum-capacity CONCAT/bitwise/power recursion. The existing source/adapter +mutation and execution-identity suites are updated to cover the new reachable +semantics. The SDK's exact Lean/axiom gate remains mandatory; no SDK pin or native +acceptance vector is changed by this implementation. diff --git a/docs/vendor-provenance.md b/docs/vendor-provenance.md new file mode 100644 index 0000000..facb8d1 --- /dev/null +++ b/docs/vendor-provenance.md @@ -0,0 +1,110 @@ +# Vendored VM asset provenance and distribution materials + +Current assessment: 2026-11-10. This replaces the earlier incomplete-origin +review. It distinguishes actual distribution obligations from optional +independent build reproduction. It is an engineering evidence assessment, +not a legal warranty or a whole-runtime correctness claim. + +## Current disposition + +| Asset | Recommendation for repository distribution | Required accompanying material | +| --- | --- | --- | +| `v86/libv86.js` | Clear the former missing-origin/notices blocker | `vendor/v86/` notice package | +| `v86/v86.wasm` | Clear the former missing-origin/notices blocker | `vendor/v86/` notice package | +| `v86/seabios.bin` | Clear the former missing-source/notices blocker | Complete `vendor/seabios/` source, config, build instructions and notices | +| `v86/vgabios.bin` | Clear the former missing-source/notices blocker | Complete `vendor/seabios/` source, config, build instructions and notices | +| `images/buildroot-bzimage.bin` | Replaced with qualified source-complete Linux 6.18.7 image | `vendor/guest/SOURCE-NOTICE.md` and its immutable complete source package | + +These recommendations assume the accompanying directories are actually +included with the repository/download/static deployment that conveys the +assets. Do not strip them out of a release package. This is the concrete +packaging condition to verify, not a requirement to reconstruct every compiler +or make every historical binary reproducible. The product register should +reflect the integrated package after review; no runtime replacement is needed +to clear the four resolved material-packaging gaps. + +## Exact asset identities + +The original five files were introduced by upstream Stitch commit +[`da38ff68f09a78f38ea8600b76ae6df36d46dd57`](https://github.com/Syntra-Labs/stitch/commit/da38ff68f09a78f38ea8600b76ae6df36d46dd57). +The four v86/BIOS files remain unchanged. The guest is now the exact qualified replacement below. + +| Path | Bytes | SHA-256 | +| --- | ---: | --- | +| `v86/libv86.js` | 353762 | `b80fba71dacb7977e5b46800b3ba194bba7fe13e52fa3d22f80cc060ff015a4e` | +| `v86/v86.wasm` | 1418156 | `abd512988f39f5c81d4930f564bafa1a6e1e0d5210de9b20e2bdec13fbc318d9` | +| `v86/seabios.bin` | 131072 | `73e3f359102e3a9982c35fce98eb7cd08f18303ac7f1ba6ebfbe6cdc1c244d98` | +| `v86/vgabios.bin` | 36352 | `a4bc0d80cc3ca028c73dafa8fee396b8d054ce87ebd8abfbd31b06b437607880` | +| `images/buildroot-bzimage.bin` | 8053248 | `313a6b545290a2b47856b49bfcc4c7577469749b315932ae008d39fe70fc7f07` | + +## v86 JavaScript and WebAssembly + +Both files exactly match the official downloads retrieved 2026-11-10: + +- https://copy.sh/v86/build/libv86.js +- https://copy.sh/v86/build/v86.wasm + +The official https://copy.sh/v86/ homepage identifies deployed revision +`1e4f43c95` (Jul 3, 2026 23:07), resolved by GitHub to +[`1e4f43c954701db9699fa976b27cc675f9971265`](https://github.com/copy/v86/commit/1e4f43c954701db9699fa976b27cc675f9971265). +An actual JavaScript build from that pinned source using upstream Closure +v20210601 reproduces the shipped JS byte for byte. `vendor/v86/` supplies the +tracked source archive, checksum-checked offline reconstruction recipe and +applicable distribution notices: + +- v86 BSD-2-Clause copyright, conditions and disclaimer; +- QEMU-derived floppy implementation MIT copyright and terms; +- incorporated SoftFloat copyright, BSD conditions and disclaimer; +- Zstandard 1.4.5 BSD license and incorporated Zstd/xxHash notices; +- preserved per-file notices in the complete source archive. + +These permissive binary-distribution notice obligations do **not** require an +independent bit-identical Wasm reconstruction. The Wasm's exact official byte +origin is established; its source reconstruction has not been independently +performed because Rust/clang are absent on this worker. Record that limitation +honestly, but do not turn it into a release blocker. Similarly, shipping source +is useful here but is not a new BSD/MIT source-disclosure obligation. + +The validated runtime remains untouched. VM administration relies on internal +fs9p APIs in this revision. Any future upgrade/replacement needs compatibility +tests, not a speculative switch to an unrelated npm version. + +## SeaBIOS and its VGA BIOS + +Both bundled files exactly match the upstream Git blobs in +[`copy/v86` bios directory](https://github.com/copy/v86/tree/315b2b0b758703ef0e6cc7b4088d6068f83f3c20/bios): + +- `bios/seabios.bin`: `8c9ab8ffea3b4e4d5fbbbe63a43ceaf2dcb501c7`. +- `bios/vgabios.bin`: `bd393e2b5edb10c04a822fb9e7c02b7cb4ffa6f5`. + +The upstream build recipe explicitly selects `rel-1.16.2`; the BIOS identifies +`rel-1.16.2-0-gea1b7a0`. The official release tag resolves to SeaBIOS commit +[`ea1b7a0733906b8425d948ae94fba63c32b1d425`](https://github.com/coreboot/seabios/tree/ea1b7a0733906b8425d948ae94fba63c32b1d425). +The complete unchanged source archive, original per-file notices, LGPLv3 and +incorporated GPLv3 texts, v86 configuration, original build script and usable +build instructions are supplied in `vendor/seabios/`. + +This supplies a concrete corresponding-source route with the object-code +distribution. Include those materials alongside both ROM files, accessible +without an additional charge or access restriction. Do not relabel them under +v86's BSD license or this repository's MIT license. Retain the ability to use +modified ROMs; this patch imposes no signature or replacement restriction. + +The candidate build script successfully builds both ROMs. Two clean-directory +runs on the same toolchain produce matching candidate hashes, but those hashes +differ from the historical bundled ROMs. That difference alone does **not** +make the supplied original source/configuration inadequate and is not a +license obligation to reproduce an old compiler. It is recorded as a build +reproduction limitation. No candidate adoption is required to resolve this +source/notice packaging gap. If a replacement is chosen later, validate its +actual VM behavior before changing the shipped hashes. + +## Source-complete replacement guest + +The original Linux 5.6.15 image (`7befbaea31e249d9a518c4b95fa42b2a193d0e3de46250d617cbdeb866ee28b0`) matched i.copy.sh, but its complete original build inputs were not recovered. It is no longer the shipped image; this does not retroactively resolve historical distributions. + +The replacement is the existing Linux 6.18.7 image built by [run 42906244489](https://github.com/afflom/stitch/actions/runs/42906244489), from exact Buildroot commit `7fdeadb3b9f12f78e5fccca914d7fef47090ab9a` and Stitch build commit `d17aa7f3ffc6944b799ac43f6a5bab04ab3b82ef`. No image/toolchain rebuild was performed for adoption. + +The [durable corresponding-source tree](https://github.com/afflom/stitch/tree/fd59fae669e9a40271fb584ca071270d8ed0b8f8) supplies all reviewed source/license materials, patches, build scripts, resolved configs and image. Its reassembler validates each part and the 398,457,213-byte final archive SHA-256 `fbc04b0c55f8421ca9bcf9e9dbac1952c07a1a2d82fd644ac67e66415b0106bc`. Retain [the source notice](../vendor/guest/SOURCE-NOTICE.md) and equivalent source access with the image. The existing distribution checker binds the image, notice and exact parts manifest; it does not claim to check remote availability on every CI run. + +Actual hosted production UI/lifecycle and two-peer Ethernet qualification passed on this exact image with the required host arguments; see [the qualification record](guest-browser-qualification.md). The runtime now uses `console=tty0 console=ttyS0,115200 rdinit=/init nomodeset`. Source availability, those observed scenarios, and native Prism SDK acceptance are distinct. The latter remains pending; no product release or whole-runtime certification is claimed. diff --git a/docs/vm-administration.md b/docs/vm-administration.md new file mode 100644 index 0000000..b4edd5d --- /dev/null +++ b/docs/vm-administration.md @@ -0,0 +1,194 @@ +# VM administration and command observations + +The VM journey keeps shell execution, object mirroring and mesh Ethernet available, +with separate explicit object-sharing and Ethernet grants. Both default off. +Object sharing applies to subsequent database mirror attempts, not retroactive +export of the database. Revocation fences later mirror continuations, including +revoke/regrant races. It cannot remove a guest copy already delivered. Canonical +and optional alias filenames retain full SHA-256 roots, and input bytes are +snapshotted before the asynchronous host write. Mirroring is bounded to 16 MiB +per object. Ethernet accepts only integer-byte frames of 14–1518 bytes and requires +an open transport, current ready VM and grant. This operating limit excludes jumbo +frames. An open transport is not evidence that a remote peer is available or trusted. + +Stop and destroy invalidate callbacks and revoke grants before invoking the +emulator. They serialize repeated clicks. Stop retains the stopped instance; +destroy is required before fresh boot. A failed operation retains the instance +and blocks boot and host bridges until explicit successful destroy. Host errors +mean the operation's outcome is unknown, not proof that the emulator stopped. +No control reverses commands or data already sent. Boot-failure cleanup follows the same quarantine rule: asynchronous destroy must +settle successfully before retry, and rejection retains the handle for explicit +destroy retry. Missing assets without an emulator instance remain directly retryable. + +## Readiness and keyboard dispatch + +A visible guest prompt only starts initialization; it does not grant Ready. The +host creates a fresh generation-scoped nonce challenge in 9p, then serializes one +initializer through the shipped keyboard adapter. That initializer checks or +mounts `host9p` at `/mnt`, reads the challenge, configures `eth0`, and writes the +nonce back to a separate response file. Ready requires completed synthetic typing +and an exact bounded host read of that fresh response from the same current VM. +Missing or mismatched responses remain booting until the existing readiness +failure deadline. Repeated polling never types another initializer concurrently. + +This is a guest-controlled operational observation of a working shell/9p path, +not an isolation, honest-guest, correctness or exactly-once execution certificate. +The initializer and later command dispatches share a serialized typing queue. +The bundled `keyboard_send_text` Promise must resolve after its final synthetic +keystroke; adapters without that completion contract fail closed. Stop, destroy +and replacement fence all late initialization continuations. Both initializer +and command keystroke strings end with an actual newline, not literal `\\n`. + +## Runtime and filesystem controls + +Boot uses `autostart: false`. The current bundled v86 filesystem must expose the +reviewed local-9p adapter surface before `run()` is called. Missing methods or a +mounted backing filesystem refuse startup; no unbounded compatibility fallback +is used. The adapter is tied to copy/v86 source commit +`1e4f43c954701db9699fa976b27cc675f9971265`, especially `lib/filesystem.js` and +`src/browser/starter.js`. A future asset replacement must requalify this boundary. + +The operator chooses a 1–300 second **whole-VM elapsed runtime allowance** before +boot. The default is 300 seconds, starting when the emulator is loaded and starts +running, including guest boot. It remains active after a short command observation +timeout or a completed command, so background processes and console work do not +escape it. Expiry requests a stop of the entire emulator and revokes host bridges. +A stopped instance must be destroyed before booting again or changing its +allowance. Browser timer scheduling, suspension and emulator cooperation can delay +stopping. This is not an instruction-accurate CPU quota, CPU-share scheduler, +wall-clock execution certificate, or kill guarantee against a broken emulator. + +Configured guest RAM is 64 MiB, with 2 MiB VGA memory. It does not bound all emulator +or browser allocations. Guest-internal filesystems consume configured guest memory +in this diskless image. Host-backed 9p `/mnt` has separate pre-allocation admission: + +- At most 16 MiB in one data-buffer allocation request. +- At most 64 MiB of cumulative admitted data-buffer allocation requests per + instance, including object mirrors, shell scripts/results and directory listings. + v86 growth slack is charged. Shrinking, unlinking, repeated directory reads and + failed admitted operations do not refund the allowance. This conservative budget + is not 64 MiB of usable free disk or a bound on all JS heap/transient overhead. +- At most 4096 cumulative inode allocations and 4096 directory-entry admissions; + admitted names fit 255 UTF-8 bytes. Hard links consume directory-entry allowance. + +The adapter wraps the bundled local allocator entrances (`ChangeSize`, +`CreateBinaryFile`, `CreateTextFile`, `FillDirectory`) before their allocations and +bounds inode/link creation. The filesystem's `total_size` field only affects +reported capacity; it is not relied on for enforcement. A refused allocation +quarantines subsequent guarded filesystem effects and requests whole-VM stop. +These are scoped filesystem controls, not a complete hostile-guest memory sandbox +or certification of every v86 device, lock, protocol table or browser allocation. + +## Command observations and cancellation + +Each shell command has a session-unique random instance prefix, generation and +monotonic sequence. Its retained handle captures the actual emulator object; +reads never switch to a replacement emulator. Only one execute wait runs at a +time, with at most 128 retained handles per node. Explicit disposal of completed +or known-not-dispatched evidence releases retained host output and command capacity. +Pending or unknown handles cannot be forgotten; disposal does not remove guest files. +Commands accept general shell syntax but reject empty input, NUL and input exceeding +16384 UTF-8 bytes. Observation time is bounded to 300000ms. + +Result observation inspects regular-file metadata first and then calls +`fs9p.Read(id, 0, boundedLength)`, never unbounded `read_file`. The completion marker +is limited to 16 bytes; output is limited to 4 MiB per command and 16 MiB retained +across command handles. Metadata rejection happens before a read, and the captured +range cannot grow while that read awaits. Malformed or oversized results request +whole-VM stop, retain unknown completion and never certify command execution. + +A short observation timeout retains unknown outcome and a handle for explicit +reconciliation while the same VM remains available. It does not stop the command; +the independent VM runtime deadline still applies. **Cancel and Stop VM** prevents +shell dispatch when it has not happened. After dispatch it requests a stop of the +whole VM, including unrelated guest/background work, rather than pretending that +shell signals can reliably kill arbitrary root commands or their descendants. +It interrupts a pending host result wait even if that API has stalled. Stop success +records `vm-stopped` separately from command outcome `unknown`: prior effects are +not rolled back. Rejection records `stop-unknown`, retains the quarantined instance +and requires explicit destroy retry. A pending stop remains pending, not success. +The compatibility `cancelCommandObservation` API uses these stronger semantics. + +Reconciliation reads the same instance's completion flag/output and never resubmits +the command. The files are guest-controlled observations, not trustworthy execution +certificates. Browser reload loses command handles. The UI's retained-command +selector permits observation of any available earlier handle, not just the latest; +selection never executes or replays a command. No automatic replay is performed. + +New typed boundary failures are `vm-boundary-unavailable`, `vm-filesystem-limit`, +`vm-output-limit`, `vm-observation-busy`, `vm-runtime-limit-invalid` and +`vm-runtime-active`, `vm-keyboard-instance-unavailable` and +`vm-keyboard-completion-unavailable`. An uncertain stop is a separate termination observation, not +proof of rollback or a resolved command. + +The emulator kernel command line no longer explicitly disables mitigations or +trusts CPU entropy. It selects `console=tty0 console=ttyS0,115200 rdinit=/init nomodeset` +for the qualified Linux 6.18.7 guest: the init wrapper mounts console devices and +nomodeset preserves the emulator text display. These are guest boot arguments, +not host security settings or a modern-mitigation guarantee. Guest/emulator assets +still need maintenance; observed hosted scenarios are recorded in +[guest qualification](guest-browser-qualification.md). + +## Verification boundary + +`Stitch.VmAdministration` supplies source-derived predicates actually called before +object/Ethernet dispatch, command admission, result observation, filesystem +allocation/metadata admission and administration. Host object identity, valid frame +shape, readiness, clock scheduling and emulator success remain external observations. +Finite oracle tests and mock-emulator regression tests cover boundary values, +revocation, malformed Ethernet, closed transport, repeated clicks, timeout, +reconciliation, replacement, cancellation, stalled reads and failed cleanup. + +`tests/vm-v86-boundary.test.js` additionally loads the **shipped v86 JS/WASM and +BIOS/kernel bytes** in Node. It checks real local-9p API compatibility, captured +result bytes, growth-slack charges, oversized-result refusal before `Read`, +pre-allocation refusal, and a successful stop of an actually running emulated CPU. +A second test boots the shipped guest through production `LinuxVmNode`, requires +its bidirectional 9p readiness response, executes a real shell command, captures +its unique marker and `Linux` output, and stops the CPU. This qualifies that +Node-hosted shell/9p round-trip, not browser, hostile-guest isolation, physical-host +or device-memory behavior. Chromium launch in this +execution environment is blocked by its Unix-socket restriction; live graphical +journeys have not been qualified here. + +Focused commands: + +- `node --test tests/vm-administration.test.js tests/vm-lifecycle.test.js tests/vm-v86-boundary.test.js` +- `node --test tests/runtime-admission.test.js tests/operator-ui.test.js` +- `npm test` and `python3 scripts/verify-custody.py` + +The source predicates/limits changed in this resource-control revision. Historical +six-definition compiler attestations do not cover the additions; exact integrated +source verification must be regenerated against the final source. Neither a source +attestation nor these runtime checks certifies all browser or VM effects. + +Gate sensitivity was checked by planting removal of `ChangeSize` admission in the +adapter. `node --test tests/vm-v86-boundary.test.js` failed on actual-v86 growth +accounting (`25` charged bytes versus expected `64`). Restoring the guard made the +same test pass. The mutation was not retained. + +## Static IPv4 operation + +Offline boot, shell and object work need no IP address. Ethernet sharing requires +an explicit operator-selected IPv4 address and prefix length before boot. Peer +display labels never derive or validate addresses. There is no DHCP, automatic +allocation, conflict detection, gateway or DNS configuration. Coordinate unique +addresses and compatible subnets across guests before enabling mesh Ethernet. +For example, 10.42.0.2/24 and 10.42.0.3/24 share a subnet; reusing .2 does not. +These are examples, not reserved or automatically safe addresses. + +Canonical dotted-decimal parsing rejects ambiguous leading zeros and shell input. +The source-owned staticAddressAllowed predicate rejects unspecified/loopback, +multicast/reserved ranges and ordinary subnet network/broadcast addresses. +Prefixes 0–32 are supported. /31 follows point-to-point host semantics (RFC 3021), +not a general multi-peer subnet; /32 has no directly connected remote hosts and +requires guest-managed routes. No arbitrary last-octet restriction is imposed: +10.42.1.0/23 is a host, while 10.42.0.0/23 is the network address. +The exact selected netmask is passed to ifconfig in the readiness initializer. + +Configuration is frozen and retained independently of labels and status events. +Model-owned admission prevents changes while booting, during administration, or +while any emulator handle exists, including stopped or cleanup-uncertain handles. +Destroy must succeed before changing it. The UI shows the retained configuration +separately from lifecycle status. Guest root shell commands can change networking; +the displayed configuration records host boot intent, not continuous attestation. diff --git a/images/buildroot-bzimage.bin b/images/buildroot-bzimage.bin index 5e149f7..c6a9ef4 100644 Binary files a/images/buildroot-bzimage.bin and b/images/buildroot-bzimage.bin differ diff --git a/index.html b/index.html index 6988903..2358259 100644 --- a/index.html +++ b/index.html @@ -48,11 +48,14 @@ margin-bottom: 12px; } + .grid:has(> section[id$="Panel"]) { grid-template-columns: minmax(0, 1fr); } + @media (max-width: 1024px) { .grid { grid-template-columns: 1fr; } } .stratum { + min-width: 0; border: 1px solid var(--border); background: var(--panel); padding: 12px; @@ -78,7 +81,7 @@ align-items: center; } - input { + input, textarea, select { background: #000; color: var(--fg); border: 1px solid var(--border); @@ -142,148 +145,358 @@ font-size: 12px; color: #e8e8e8; } + .experience-evidence { padding: 8px 12px; border-inline-start: 3px solid; line-height: 1.5; } + #operatorJourneyNav { display: flex; gap: 8px; flex-wrap: wrap; } + #operatorJourneyNav [aria-current="location"] { border-color: #e6e6e6; } + :focus-visible { outline: 2px solid #9bc4ff; outline-offset: 3px; } + input, textarea, select { max-width: 100%; } + .controls > label { display: flex; flex-direction: column; gap: 4px; } + .controls > label:has(input[type="checkbox"]) { display: inline; } + .mono-out { overflow-wrap: anywhere; } + [hidden] { display: none !important; }
-

Syntra-Labs / stitch — Live Multi-Peer UOR Database, Distributed Compute & In-Browser Linux 5.6 VM

+

Stitch / recoverable objects and replayable pure jobs

Local Node: ... | WebRTC Open Peers: 0 | - Scheduler λ̂: 0.017/s | - P(alive): 1.000 | - H(p): 0.000 bit + Application budget: 0 requests
+
+ +
+ +

+

Available next actions:

+ +
About modeled evidence

+ +
+ +
- +

Join a mesh

+ + - - -
- - -
+ +

+

+
What this evidence means

+
Inspect external network observations +

Scheduler estimates, not availability evidence: Scheduler λ̂: 0.017/s | + P(alive): 1.000 | + H(p): 0.000 bit |

-

External Infrastructure Proof & Independent CLI Verification (Zero Local-Only Simulation)

+

Network evidence and independent verification

Cloudflare Edge PoP: probing 1.1.1.1... | STUN Candidate: waiting
- Run these commands in any external Linux terminal (or another machine) to verify live shards, checkpoints, and DNS pointers outside this browser: - + These commands inspect external records. Inspection alone does not establish integrity, authority, or durability; use the repository verifier for exported object evidence: +
curl -s "https://ntfy.sh/syntra-warm-syntra-uor-bus-01/json?poll=1&since=30m" | tail -n 5
+
+ +
+ + + +
+

Inspect and renew allowances

+

+

+
What this evidence means

+
+ Application resource policy (operational demo configuration) +

These are configurable operating allowances, not semantic limits. An expired epoch or exhausted allowance refuses further effects. Choose a new epoch to continue; previous charges are retained, including failed or uncertain effects. Existing objects, jobs and pointer heads stay in this tab.

+
+ + + + + + + + + +
+

Transfer allowances include reserved relay/DNS response ceilings. Cache allowances count new allocations in each epoch, not total browser memory. TLS, ICE/STUN, VM work and host overhead are outside this accounting. History is kept in this tab until exported. Renewal does not retry failed effects; use the relevant sync or resume control.

+
+
No prior epochs.
+
+
+
Experimental diagnostics and trial export
+ + +
-
+
-

Live Network UOR Database (2-of-3 XOR Parity + WebRTC + Warm Cache)

- Survives tab closes & 0-peer gaps +

Live Network UOR Database (2-of-3 XOR Parity + WebRTC + Warm Cache)

+ Recovery requires enough reachable fragments; relay storage is optional
+

+

+
What this evidence means

- - + + + + - + +
+
+ + + +
+

After peers join or change, select exact retained bytes and repair. Missing or expired fragments need fresh receipts. Optional replacement keeps the old holder until the new receipt commits, then requests exact release. A timeout never proves deletion.

+

No retained verified object selected.

+

Text is encoded as UTF-8, at most 128 KiB. The label is a convenience alias, not identity. New objects are shared with the guest only when guest object sharing is enabled.

- - - - - - + + + + + + - +
UOR ContentAddress (u128)Label (/mnt)SizeVerifiedSourcePayload PreviewObject commitment (SHA-256)Label (/mnt)SizeVerifiedSourcePayload Preview
No objects yet. Click "Put & Replicate" or "Recover from Warm Cache".
No local object bytes.
+
+ Export and restore recovery evidence +

Keep a separate backup before clearing RAM. Import checks objects and pure jobs in a local recovery vault, without sending packets, mounting files or retrying writes. Closing this tab loses the vault. Signing keys and pending-write journals are not included.

+
+ + + + + + + +
+

Select 1–32 live entries. Use Ctrl/Command to toggle individual choices or Shift for a range. Reopening refreshes available evidence and retains still-available selections. Imported evidence stays in the separate recovery vault and is not added to live objects or jobs.

+

At most 32 entries, each object up to the live 128 KiB limit. Default wire allowance includes hex fragments and job overhead. Limits bound this operation, not total browser memory; replay is pure computation, not VM execution.

+
+ + + + +
+
Review supplied pointer anchors +

Signatures inside a file do not establish trust or freshness. Independently obtain the exact recent pointer digest and writer key. First accept the exact recent anchor here. Then, in “Pin, discover and publish pointers”, independently pin the same query name and writer key. Return here to restore the accepted anchor into that live observer. Import and acceptance alone never change a live head.

+ + + + + +

+

Restore only an empty observer or the exact already-retained head. A different live head is never overwritten, even by a newer accepted anchor. This session-only action enables ordinary next-revision admission, not publication, key rotation or proof of global freshness.

+ +
+

+

No recovery file imported.

+
-
+
-

Live Distributed Compute Engine (Cross-Tab Checkpoint Failover)

- Close tab mid-job; peer tab resumes from last step +

Live Distributed Compute Engine (Cross-Tab Checkpoint Failover)

+ Pure jobs replay before resume; VM effects are outside this contract
+

+

+
What this evidence means

- - - - + + + + - +
+

This demonstration constructs a deterministic W64 ring program. Choose 3–60 steps and a 100–3000 ms delay. Pure replay is separate from guest shell execution.

- - - - - - + + + + + + - +
Job IDProgressOwner NodeCurrent W64 Ring ValueStatusTrace VerifiedJob IDProgressOwner NodeCurrent W64 Ring ValueStatusExecution evidence
No active jobs. Start a job and close this tab mid-run to test peer takeover.
No pure jobs observed. Use the current journey to start or inspect checkpoint recovery.
- -
+ +
-

In-Browser x86 Linux 5.6 VM (v86 + 9p /mnt + Ethernet-over-WebRTC)

+

In-Browser x86 Linux VM (v86 + 9p /mnt + Ethernet-over-WebRTC)

VM Standby
- +

+

+
What this evidence means

+ +
+ Guest limits and stopping + + +

The whole VM stops when its elapsed-time allowance expires, when Cancel is requested after dispatch, or when a filesystem/result limit is exceeded. This includes background commands and console work. Browser scheduling can delay stopping; this is not an instruction-accurate CPU quota. Destroy the instance before changing its allowance.

+

Guest RAM: 64 MiB. Local 9p /mnt: 16 MiB per buffer, 64 MiB cumulative allocation requests, and 4096 inode/link admissions per instance. Removing files does not refund that allowance. Result reads: 4 MiB per command, 16 MiB retained in total. Other guest filesystems consume configured guest memory; these controls are not a complete host-memory or guest-isolation guarantee.

+

No guest resource usage observed.

+
+
+ Optional guest networking: offline +
+ + + + +

Leave blank for offline shell and object work. For Ethernet sharing, choose a different address for every guest on the mesh and compatible subnet prefixes. The example is not an allocation. Display names do not assign addresses. No DHCP, duplicate-address detection, gateway or DNS setup is provided. /31 is for point-to-point links; /32 needs explicit guest routes. Destroy a retained instance before changing configuration.

+

No static address configured.

+

+
+
- - + + + + + +
-
-
Click "Boot Linux 5.6 VM" to start the in-browser x86 kernel (./images/buildroot-bzimage.bin). -All UOR database objects are automatically mounted inside /mnt/ in the VM, and eth0 is bridged over WebRTC.
+

Commands run in the guest, not on this host. Stdout and stderr are captured as bytes and shown as text below, including when storing the object fails. After dispatch, Cancel requests a stop of the whole VM, including other guest work. Public relay consent also applies to stored command output.

+

No guest command submitted.

+ +

Cancelling before dispatch prevents the command. After dispatch, cancellation stops the whole VM and leaves prior effects unknown. A short observation timeout keeps the guest running until cancellation or the runtime limit. Unknown commands are never automatically replayed. Stop and destroy revoke grants; failures retain the instance for destroy retry. These controls do not certify guest isolation.

+

Observed guest command output (text)

+

No guest output observed.

+
No guest output observed.
+

The console below is the emulator display. Shell commands and their captured text above do not require interacting with its canvas. Graphics-only guest applications may have no text equivalent.

+
+
Click "Boot Linux VM" to start the in-browser x86 kernel (./images/buildroot-bzimage.bin). +Object sharing and Ethernet bridging start off. Grants expose data to the guest or mesh peers. Revocation blocks future transfers; it does not erase guest copies or undo effects.
- -
+ +
-

Layer 5: DNS DoH Resolver, Lightweight DuckDNS TXT Writer & Wire Log

- RFC 8484 DoH + Single-GET Dynamic DNS +

Layer 5: DNS DoH Resolver, Lightweight DuckDNS TXT Writer & Wire Log

+

+

+
What this evidence means

- + +
+

The DNS name, writer key and Zone ID select an exact publication scope. Changing any of them selects another scope; it does not resolve earlier unknown writes. After reload, pin the original writer, enter its exact name and zone, then load saved publication before reconciling. Reconciliation also needs a scoped token.

+
Provider publication setup and reconciliation
- - - + + + + + + +
+

Use a token with DNS Edit restricted to this exact zone. It is sent only to the Cloudflare API when you publish or reconcile; it is not saved or exported. Replace it here when expired or revoked. A provider acknowledgement is not DNS propagation.

+
+
+ + + +
+
Signing authority, saved trust and storage care +

Save or restore a nonextractable Ed25519 key on this origin. Origin scripts can use it; only use a trusted deployment. Local rotation or revocation does not change independently trusted keys, DNS records or remote copies.

+ +

Checking saved signing authority…

+

+ +
Independently accepted exact trust anchor +

+

Enter the public key and exact recent pointer digest obtained independently. Save requires this observer's admitted head. Migration uses the complete signed JSON below, and does not change the live pin. Select the new pin and restore separately. Timestamps and signatures alone do not establish trust or global recency.

+ + + + + +
+
Quota, eviction and public journal +

Storage estimates cover this whole origin. Persistence permission is not a backup. Clearing or eviction can lose keys and unknown-write evidence. Export preserves public anchors, exact candidates and provider identities, never signing keys or API tokens. There is no automatic journal import or unknown-write reset.

+ + + + +
+ +

No lifecycle operation requested.

+
+
Session-only keys and unsaved observer heads last only this session. Save an independently accepted recent trust anchor to restore strict succession after reload. Full pointers use multiple TXT strings, not the legacy 255-byte claim.
+

Paste complete signed JSON, at most 4096 UTF-8 bytes. Admission checks this exact name, independently pinned key and retained head. Restoring an anchor in the recovery vault does not change this observer.

+
+ + + +
Initializing live mesh node...
@@ -305,7 +518,7 @@

Layer 1 Benchmark: UOR Hasher Substitution Axis (1,000 × 64B)

- +
HasherWidth (B)CollisionsTime (ms)Ops/secMB/s
HasherWidth (B)CollisionsTime (ms)Ops/secMB/s
@@ -318,7 +531,7 @@

Layer 2 Benchmark: Equal-Budget C3/C4 Test (B=30, 600s, CV=1.15)

- +
PolicyRefreshesUnavailable (s)AvailabilityMean Lag (s)
PolicyRefreshesUnavailable (s)AvailabilityMean Lag (s)
@@ -331,7 +544,7 @@

Layer 3 Benchmark: Storage Durability (100% Cohort Turnover)

- +
StrategyGen-0 LeftRecoveredRetentionAmpRepair Bytes
StrategyGen-0 LeftRecoveredRetentionAmpRepair Bytes
@@ -344,7 +557,7 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

- +
StrategyDoneLatency (ticks)Total OpsWasted OpsTrace Verified
StrategyDoneLatency (ticks)Total OpsWasted OpsExecution evidence
@@ -370,32 +583,102 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

import { DohResolver, WebRtcTransportNode, - generatePointerKeyPair, - signPointerTxt, - verifyPointerTxt, + readBoundedText, ExperimentTrialLogger } from './src/layer5-transport/index.js'; - const trialLogger = new ExperimentTrialLogger({ contractVersion: '1.0.0' }); - let peerSigningKeys = null; - generatePointerKeyPair().then(kp => { - peerSigningKeys = kp; + import { createOperatorExperience, integrityLabel, executionLabel } from './src/product-experience.js'; + import { placementStatus } from './src/layer3-storage/custody.js'; + import { parseCanonicalJson } from './src/layer1-uor/custody.js'; + import { ResourceAdmission } from './src/layer2-schedulers/policy.js'; + import { installRecoveryControls } from './src/recovery-ui.js'; + import { installAuthorityControls } from './src/authority-ui.js'; + import { BrowserAuthorityStore } from './src/layer1-uor/browser-authority.js'; + import { generateAuthority, signPointer, PointerObserver, PointerPublisher, pointerDnsText, parsePointerDnsText } from './src/layer1-uor/pointer.js'; + + // One stable handle is shared by every adapter. Only the explicit renewal + // control replaces the underlying epoch. Prior ledgers stay retained. + let operatorExperience = null; + let authorityControls = null; + function renderExperience() { operatorExperience?.render(); authorityControls?.render(); } + // The same model guard protects keyboard, repeated and programmatic events. + function bindModelAction(id, handler) { + document.getElementById(id).addEventListener('click', async (...args) => { + if (!operatorExperience?.allow(id)) return; + try { return await handler(...args); } + catch (error) { + operatorExperience.report(id, `Action refused or interrupted: ${error.code || error.message}. Inspect retained evidence before retrying.`); + if (id === 'saveAuthorityBtn') document.getElementById('authorityStorageStatus').textContent = `Saved authority setup failed: ${error.message}. No replacement key was selected. Restore or storage errors do not establish that a key is absent.`; + throw error; + } + finally { renderExperience(); } + }); + } + let activeAdmission = new ResourceAdmission(); + let policyEpoch = 1; + let lastPolicyRefusal = null; + const policyHistory = []; + const admission = { + get state() { return activeAdmission.state; }, + reservationCurrent(id, epoch) { return activeAdmission.reservationCurrent(id, epoch); }, + reserve(kind, cost) { + try { return activeAdmission.reserve(kind, cost); } + catch (error) { + if (['epoch-expired', 'budget-exhausted', 'action-capacity', 'clock-regression'].includes(error.code)) { + lastPolicyRefusal = error.code; + document.getElementById('budgetPolicyPanel').open = true; + renderBudgetPolicy(); + } + throw error; + } + }, + run(kind, cost, effect) { this.reserve(kind, cost); return effect(); } + }; + const trialLogger = new ExperimentTrialLogger({ contractVersion: '1.1.0' }); + const authorityStore = new BrowserAuthorityStore(); + let authorityReady = Promise.resolve(null); + let persistentAuthority = false; + // Restore only; missing, blocked or invalid storage never silently creates a key. + const authorityRestore = (async () => { + const status = await authorityStore.authorityStatus(); + persistentAuthority = !!status; + const authority = status?.status === 'revoked' ? null : await authorityStore.restoreAuthority(); + if (authority) authorityReady = Promise.resolve(authority); + document.getElementById('authorityStorageStatus').textContent = status?.status === 'revoked' + ? 'Saved signer revoked locally. Explicit rotation is required; no replacement key or trust was selected.' + : authority ? 'Saved signing key restored. Explicitly pin it to trust it for this name.' + : 'No saved signing key. Choose session-only or saved authority explicitly.'; + })().catch(() => { + document.getElementById('authorityStorageStatus').textContent = 'Browser storage unavailable or invalid. No key replaced. Persistent signing and publication require working storage. Missing evidence does not prove an earlier write never happened.'; }); + const pointerObservers = new Map(); + const unpublishedPointers = new WeakMap(); + let pointerWriteInFlight = false; const logBox = document.getElementById('wireLogBox'); const cliProofBox = document.getElementById('cliProofBox'); function logWire(tag, text) { const ts = new Date().toISOString().slice(11, 19); logBox.textContent = `[${ts}] [${tag}] ${text}\n` + logBox.textContent.slice(0, 3500); + const journey = /^(VM)/.test(tag) ? 'vm' : /^(POINTER|DNS|DOH|CF-DNS|AUTHORITY)/.test(tag) ? 'pointers' + : /^(PUT|WIPE|WARM|UOR)/.test(tag) ? 'objects' : /^(COMPUTE|RESUME)/.test(tag) ? 'compute' + : /^POLICY/.test(tag) ? 'resources' : /^(SYNC|MESH)/.test(tag) ? 'mesh' : null; + if (journey) document.getElementById(`${journey}ActionStatus`).textContent = `${tag}: ${text}`; + renderExperience(); } + window.addEventListener('unhandledrejection', ev => { + logWire('REFUSED', ev.reason?.code || ev.reason?.message || String(ev.reason)); + ev.preventDefault(); + }); + function updateCliProof(extraLine = '') { const warmTopic = transport.warmCacheTopic(); const dnsName = document.getElementById('dnsQueryInput').value.trim() || '_xmpp-client._tcp.jabber.org'; const lines = [ `# 1. Inspect live 2-of-3 XOR shards & compute checkpoints on public warm bus:`, `curl -s "https://ntfy.sh/${warmTopic}/json?poll=1&since=30m" | tail -n 5`, - `# 2. Query Cloudflare RFC 8484 DoH for live DNS pointer record:`, + `# 2. Inspect the provider DNS-JSON discovery response:`, `curl -s -H "accept: application/dns-json" "https://cloudflare-dns.com/dns-query?name=${dnsName}&type=SRV"` ]; if (extraLine) lines.push(extraLine); @@ -403,27 +686,27 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

} // Probe real Cloudflare edge datacenter & client egress IP - fetch('https://1.1.1.1/cdn-cgi/trace') - .then(r => r.text()) + Promise.resolve().then(() => admission.run('retrieve', { requests: 1, transferBytes: 4096 }, + () => fetch('https://1.1.1.1/cdn-cgi/trace'))) + .then(r => readBoundedText(r, 4096)) .then(txt => { const kv = Object.fromEntries(txt.trim().split('\n').map(l => l.split('='))); document.getElementById('cfTraceLabel').textContent = `${kv.colo || 'CF'} (${kv.ip || 'edge'} / ${kv.http || 'h2'})`; }) .catch(() => { - document.getElementById('cfTraceLabel').textContent = 'cloudflare-dns.com (DoH active)'; + document.getElementById('cfTraceLabel').textContent = 'Trace unavailable; no network evidence'; }); // 1. Layer-2 Budget-Paced Survival Scheduler driving live refreshes (C3 compliant) - const scheduler = new BudgetPacedSurvivalScheduler({ + let scheduler = new BudgetPacedSurvivalScheduler({ ttlSeconds: 60, durationSeconds: 600, maxRefreshBudget: 30, minFloorSeconds: 5 }); - const nowSec = () => Date.now() / 1000; + const schedulerEpoch = performance.now(); + const nowSec = () => (performance.now() - schedulerEpoch) / 1000; scheduler.markRefreshed(nowSec()); - scheduler.recordFailure(nowSec() - 80); - scheduler.recordFailure(nowSec() - 40); // 2. Layer-5 Multi-Peer WebRTC Mesh Transport const hashKey = location.hash.replace(/^#/, '').trim(); @@ -432,6 +715,7 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

const transport = new WebRtcTransportNode({ channelKey: document.getElementById('meshKeyInput').value.trim(), trialLogger, + admission, onEvent: async ev => { document.getElementById('peerCountLabel').textContent = String(transport.openPeers().length); @@ -442,7 +726,7 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

document.getElementById('stunTypeLabel').textContent = ev.candidateType; } else if (ev.type === 'channel_open') { logWire('WEBRTC', `DataChannel open with ${ev.remoteId} (ICE=${ev.iceSetupSec}s); requesting UOR shard sync`); - transport.sendToPeer(ev.remoteId, { type: 'uor_sync_req', from: transport.peerId }); + transport.sendToPeer(ev.remoteId, { type: 'uor_sync_req', version: 1 }); } else if (ev.type === 'c1_trial_complete') { logWire('C1-TRIAL', `Logged C1 trial for ${ev.remote_peer}: success=${ev.success}, ice=${ev.ice_setup_sec}s, hb=${ev.heartbeats_passed}`); } else if (ev.type === 'peer_disconnected') { @@ -454,7 +738,7 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

} } else if (ev.type === 'mesh_message') { const { from, msg } = ev; - if (msg.type === 'uor_shard' || msg.type === 'uor_sync_req') { + if (msg.type === 'uor_shard' || msg.type === 'uor_sync_req' || msg.type === 'uor_shard_ack' || msg.type === 'uor_fragment_req') { await liveDb.handleMeshMessage(from, msg); } else if (msg.type === 'compute_ckpt') { await computeCoord.handleMeshMessage(from, msg); @@ -467,18 +751,23 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

document.getElementById('nodeIdLabel').textContent = transport.peerId; - // 3. Layer-4 In-Browser Linux 5.6 VM Node (v86) + // 3. Layer-4 In-Browser Linux VM Node (v86) const vmNode = new LinuxVmNode({ transport, screenContainer: document.getElementById('vmScreenContainer'), onStatus: st => { document.getElementById('vmStatusLabel').textContent = st.state === 'online' - ? `ONLINE (eth0=${st.ip})` + ? `ONLINE (eth0=${st.cidr || st.ip || 'offline'})` : st.state === 'booting' - ? `BOOTING LINUX 5.6 (${st.ip})...` - : `ERROR: ${st.message}`; - logWire('VM', `Linux 5.6 state=${st.state} ip=${st.ip || ''}`); + ? `BOOTING LINUX (${st.cidr || st.ip || 'offline'})...` + : ['offline', 'stopping'].includes(st.state) + ? st.message + : `ERROR: ${st.message || 'Unknown VM lifecycle observation'}`; + document.getElementById('vmShareObjects').checked = Boolean(vmNode.objectSharing); + document.getElementById('vmShareEthernet').checked = Boolean(vmNode.ethernetSharing); + showVmCommand(); + logWire('VM', `Linux state=${st.state} ip=${st.ip || ''}${st.message ? `: ${st.message}` : ''}`); } }); @@ -490,31 +779,61 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

onUpdate: ev => { renderLiveDbTable(); if (ev.type === 'object_verified') { - logWire('UOR-DB', `Verified & mounted ${ev.entry.addressHex.slice(0, 22)}... (${ev.entry.originalLength}B) from ${ev.entry.source}`); + logWire('UOR-DB', `Verified local object ${ev.entry.addressHex.slice(0, 22)}... (${ev.entry.originalLength}B) from ${ev.entry.source}`); } } }); + function renderRows(tbody, rows) { + tbody.replaceChildren(...rows.map(values => { + const row = document.createElement('tr'); + for (const value of values) { + const cell = document.createElement('td'); + cell.textContent = String(value); + row.append(cell); + } + return row; + })); + } + + function renderPlacementControls() { + const select = document.getElementById('placementObject'); + const selected = select.value; + const objects = [...liveDb.objects.values()].filter(e => e.verified && e.bytes); + const option = (value, text) => { const o = document.createElement('option'); o.value = value; o.textContent = text; return o; }; + const replaceOptions = (control, options) => { + const current = Array.from(control.children); + if (current.length !== options.length || current.some((o, i) => o.value !== options[i].value || o.textContent !== options[i].textContent)) control.replaceChildren(...options); + }; + replaceOptions(select, [option('', 'Select an exact object'), ...objects.map(e => option(e.addressHex, `${e.label || 'object'} · ${e.addressHex}`))]); + select.value = objects.some(e => e.addressHex === selected) ? selected : ''; + const replace = document.getElementById('placementReplaceHolder'), previous = replace.value; + const state = liveDb.placements.get(select.value); + const holders = (state?.copies || []).filter(c => c.status === 'committed').map(c => c.holder); + replaceOptions(replace, [option('', 'Keep current live holders'), ...holders.map(holder => option(holder, holder))]); + replace.value = holders.includes(previous) ? previous : ''; + renderPlacementEvidence(); + } + + function renderPlacementEvidence() { + const select = document.getElementById('placementObject'); + let summary; + try { summary = liveDb.placementSummary(select.value); } + catch (error) { document.getElementById('placementEvidence').textContent = `Placement observation refused: ${error.code || error.message}. Retained bytes and custody history are unchanged.`; return; } + const text = summary ? `${select.value}: ${summary.committedFragments}/3 current distinct-holder receipts; ${summary.requestedTransfers} awaiting ACK; ${summary.uncertainTransfers} uncertain transfers; ${summary.assertedCopies} retained copy assertions; ${summary.pendingReleases} pending releases. ${summary.canRecoverFromCommitted ? 'Conditional remote recovery observed.' : 'Remote recovery threshold not established.'} Local full bytes are additional. No durability or independent-machine guarantee.` : 'No retained verified object selected.'; + const evidence = document.getElementById('placementEvidence'); + if (evidence.textContent !== text) evidence.textContent = text; + } + function renderLiveDbTable() { - const tbody = document.getElementById('liveDbBody'); + renderPlacementControls(); + renderExperience(); const items = Array.from(liveDb.objects.values()); - if (items.length === 0) { - tbody.innerHTML = 'Local browser RAM is empty (0 objects). Click "Recover from Public Bus" to pull shards from external infrastructure.'; - return; - } - tbody.innerHTML = items.map(e => { - const preview = e.bytes ? new TextDecoder().decode(e.bytes).slice(0, 48) : '(reassembling shards...)'; - return ` - - ${e.addressHex.slice(0, 24)}… - ${e.label || '—'} - ${e.originalLength} B - ${e.verified ? 'YES (UOR)' : 'PARTIAL'} - ${e.source} - ${preview.replace(/ - - `; - }).join(''); + renderRows(document.getElementById('liveDbBody'), items.length ? items.map(e => [ + e.addressHex, e.label || '—', `${e.originalLength} B`, + integrityLabel(e.verified), e.source, + e.bytes ? new TextDecoder().decode(e.bytes).slice(0, 48) : '(awaiting fragments)' + ]) : [['No local objects. Recovery needs enough retained, reachable fragments.']]); } // 5. Layer-4 Live Distributed Compute Coordinator @@ -525,100 +844,314 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

}); function renderJobsTable() { - const tbody = document.getElementById('liveJobsBody'); + renderExperience(); const jobs = Array.from(computeCoord.jobs.values()); - if (jobs.length === 0) return; - tbody.innerHTML = jobs.map(j => ` - - ${j.jobId} - ${j.stepIndex} / ${j.totalSteps} - ${j.ownerPeerId} (${j.sourceTag}) - ${j.currentValueHex} - ${j.status.toUpperCase()} - ${j.verified ? 'CERTIFIED' : 'IN-FLIGHT'} - - `).join(''); + renderRows(document.getElementById('liveJobsBody'), jobs.length ? jobs.map(j => [ + j.jobId, `${j.stepIndex} / ${j.totalSteps}`, `${j.ownerPeerId} (${j.sourceTag})`, + j.currentValueHex, j.status.toUpperCase(), executionLabel(j.verification === 'replayed') + ]) : [['No active pure jobs. Host and VM effects are not replay-certified.']]); } + const publicRelayEnabled = () => document.getElementById('allowPublicRelayInput').checked; + transport.publicRelayConsent = publicRelayEnabled; + document.getElementById('allowPublicRelayInput').addEventListener('change', () => { + computeCoord.allowPublicRelay = publicRelayEnabled(); + renderExperience(); + }); + // UI Controls Wiring async function joinAndSync() { const key = document.getElementById('meshKeyInput').value.trim() || 'syntra-uor-bus-01'; location.hash = key; transport.connect(key); - const rec = await liveDb.syncFromNetwork('30m'); + const rec = await liveDb.syncFromNetwork('30m', { publicData: publicRelayEnabled() }); const resumed = await computeCoord.syncAndTakeOverJobs('30m'); logWire('SYNC', `Recovered ${rec} UOR objects from warm cache; resumed ${resumed.length} jobs.`); } - document.getElementById('reconnectBtn').addEventListener('click', joinAndSync); + bindModelAction('reconnectBtn', joinAndSync); document.getElementById('toggleMetricsLabBtn').addEventListener('click', () => { const sec = document.getElementById('metricsLabSection'); const btn = document.getElementById('toggleMetricsLabBtn'); const hidden = sec.style.display === 'none'; sec.style.display = hidden ? 'block' : 'none'; + if (hidden) runAllBenchmarks(); btn.textContent = hidden ? 'Hide Metrics & Falsification Lab' : 'Show Metrics & Falsification Lab (C1–C10)'; }); - document.getElementById('copyCliProofBtn').addEventListener('click', () => { - navigator.clipboard?.writeText(cliProofBox.textContent); - logWire('CLI-PROOF', 'Copied external terminal verification commands to clipboard.'); + document.getElementById('copyCliProofBtn').addEventListener('click', async () => { + try { + if (!navigator.clipboard?.writeText) throw Error('Clipboard unavailable; select the commands below and copy them manually.'); + await navigator.clipboard.writeText(cliProofBox.textContent); + document.getElementById('meshActionStatus').textContent = 'Inspection commands copied. Inspection alone is not verification.'; + } catch (error) { document.getElementById('meshActionStatus').textContent = error.message; } }); - document.getElementById('dbPutBtn').addEventListener('click', async () => { + bindModelAction('dbPutBtn', async () => { const label = document.getElementById('dbLabelInput').value.trim() || 'data.txt'; const payload = document.getElementById('dbPayloadInput').value; - const entry = await liveDb.put(payload, { label, persistWarm: true }); + const entry = await liveDb.put(payload, { label, persistWarm: publicRelayEnabled(), publicData: publicRelayEnabled() }); renderLiveDbTable(); updateCliProof(`# Verify object ${entry.addressHex} directly from terminal:\ncurl -s "https://ntfy.sh/${transport.warmCacheTopic()}/json?poll=1&since=30m" | grep "${entry.addressHex}"`); - logWire('PUT', `Stored & replicated ${entry.addressHex} (2-of-3 XOR parity shards)`); + logWire('PUT', `Committed ${entry.addressHex}; remote placement is conditional on verified receipts and reachability.`); + }); + + document.getElementById('placementObject').addEventListener('change', () => { renderPlacementControls(); renderExperience(); }); + bindModelAction('repairPlacementBtn', async () => { + const key = document.getElementById('placementObject').value; + const replaceHolder = document.getElementById('placementReplaceHolder').value || null; + const summary = await liveDb.repairPlacement(key, { replaceHolder }); + renderLiveDbTable(); + document.getElementById('objectsActionStatus').textContent = `Repair checked ${key}. ${summary.committedFragments}/3 current receipts; ${summary.requestedTransfers} awaiting ACK, ${summary.uncertainTransfers} uncertain transfers. Fresh receipts may arrive later; no pending request counts as custody.${summary.replacementUnavailable ? ' No spare distinct-holder route is available for the selected replacement; the original custody remains retained.' : ''}`; }); - document.getElementById('dbWipeLocalBtn').addEventListener('click', () => { - liveDb.objects.clear(); + bindModelAction('dbWipeLocalBtn', async () => { + await liveDb.clearLocal(); renderLiveDbTable(); - logWire('WIPE-RAM', 'Cleared local browser RAM to 0 objects. Now click "Recover from Public Bus" to prove external persistence.'); + logWire('WIPE-RAM', 'Cleared local object bytes. Recovery succeeds only if enough fragments remain elsewhere.'); }); - document.getElementById('dbSyncBtn').addEventListener('click', async () => { - const count = await liveDb.syncFromNetwork('30m'); + bindModelAction('dbSyncBtn', async () => { + const count = await liveDb.syncFromNetwork('30m', { publicData: publicRelayEnabled() }); renderLiveDbTable(); logWire('WARM-SYNC', `Recovered ${count} verified UOR objects from warm relay buffer.`); }); - document.getElementById('startJobBtn').addEventListener('click', () => { - const totalSteps = Number(document.getElementById('jobStepsInput').value) || 12; - const stepDelayMs = Number(document.getElementById('jobDelayInput').value) || 800; - computeCoord.startOrResumeJob({ totalSteps, stepDelayMs }); + bindModelAction('startJobBtn', () => { + const totalSteps = Number(document.getElementById('jobStepsInput').value); + const stepDelayMs = Number(document.getElementById('jobDelayInput').value); + if (!Number.isSafeInteger(totalSteps) || totalSteps < 3 || totalSteps > 60 || !Number.isSafeInteger(stepDelayMs) || stepDelayMs < 100 || stepDelayMs > 3000) throw Error('Choose 3–60 whole steps and a 100–3000 ms whole-number delay.'); + computeCoord.startOrResumeJob({ totalSteps, stepDelayMs }).catch(e => logWire('COMPUTE-ERR', e.code || e.message)); logWire('COMPUTE', `Started ${totalSteps}-step distributed UOR reduction job`); }); - document.getElementById('takeoverJobsBtn').addEventListener('click', async () => { + bindModelAction('takeoverJobsBtn', async () => { const resumed = await computeCoord.syncAndTakeOverJobs('30m'); - logWire('TAKEOVER', resumed.length ? `Resumed jobs: ${resumed.join(', ')}` : 'No stalled jobs found.'); + for (const job of computeCoord.jobs.values()) { + if (job.status === 'running' && job.ownerPeerId === transport.peerId && !computeCoord.running.has(job.jobId)) { + resumed.push(job.jobId); + computeCoord.startOrResumeJob({ jobId: job.jobId, stepDelayMs: 0 }).catch(error => + logWire('COMPUTE-REFUSED', error.code || error.message)); + } + } + logWire('RESUME', resumed.length ? `Resumed jobs: ${resumed.join(', ')}` : 'No unfinished jobs ready to resume.'); + }); + + document.getElementById('vmShareObjects').addEventListener('change', event => vmNode.setObjectSharing(event.target.checked)); + document.getElementById('vmShareEthernet').addEventListener('change', event => { + try { vmNode.setEthernetSharing(event.target.checked); } + catch (error) { + event.target.checked = Boolean(vmNode.ethernetSharing); + document.getElementById('vmNetworkPanel').open = true; + document.getElementById('vmNetworkValidation').textContent = error.message; + logWire('VM-REFUSED', error.message); + } + }); + async function administerVm(action) { + try { + const pending = vmNode[action](); + showVmCommand(); renderExperience(); + await pending; + } finally { + document.getElementById('vmShareObjects').checked = vmNode.objectSharing; + document.getElementById('vmShareEthernet').checked = vmNode.ethernetSharing; + // onStatus runs before the host clears adminBusy. Refresh settled locks too. + showVmCommand(); renderExperience(); + } + } + bindModelAction('stopVmBtn', () => administerVm('stop')); + bindModelAction('destroyVmBtn', () => administerVm('destroy')); + let vmStdoutCommandId; + function showVmStdout(bytes, commandId) { + vmStdoutCommandId = commandId; + const limit = 16384; + document.getElementById('vmStdoutText').textContent = bytes.length + ? new TextDecoder().decode(bytes.slice(0, limit)) : '(Empty output)'; + document.getElementById('vmStdoutSummary').textContent = `Command ${commandId || 'unavailable'}: ${bytes.length} observed bytes. ${bytes.length > limit ? `Showing first ${limit} bytes. ` : ''}UTF-8 text preview; binary or cut characters may display replacements. This does not certify guest execution or object storage.`; + } + function selectedVmCommandId() { + return document.getElementById('vmCommandSelection').value || vmNode.lastCommandId; + } + function showVmCommand(selectLatest = false) { + const control = document.getElementById('vmCommandSelection'); + const previous = selectLatest ? vmNode.lastCommandId : selectedVmCommandId(); + const entries = vmNode.commands instanceof Map ? [...vmNode.commands.keys()] : []; + document.getElementById('vmRetainedCommandControls').hidden = entries.length === 0; + control.replaceChildren(...entries.map(id => { + const option = document.createElement('option'); option.value = id; + option.textContent = `${id}: ${vmNode.commandEvidence(id)?.outcome}`; return option; + })); + if (entries.includes(previous)) control.value = previous; + const evidence = vmNode.commandEvidence(selectedVmCommandId()); + document.getElementById('vmRuntimeSeconds').disabled = Boolean(vmNode.v86 || vmNode.adminBusy); + const networkLocked = !vmNode.lifecycle.canConfigureNetwork; + document.getElementById('vmIpv4Address').disabled = networkLocked; + document.getElementById('vmPrefixLength').disabled = networkLocked; + document.getElementById('vmNetworkSummary').textContent = `${vmNode.networkConfiguration?.cidr || 'offline'}${networkLocked ? '; configuration locked' : ''}`; + document.getElementById('vmNetworkStatus').textContent = vmNode.networkConfiguration + ? `Configured eth0: ${vmNode.networkConfiguration.cidr} (netmask ${vmNode.networkConfiguration.netmask}). ${networkLocked ? 'Instance retained; configuration locked.' : 'Applied at next boot.'} Address uniqueness and peer subnet compatibility must be checked by the operator.` + : 'Offline configuration: shell and object work available; Ethernet sharing requires configuration before Boot.'; + const usage = vmNode.filesystemUsage; + document.getElementById('vmResourceUsage').textContent = usage + ? `9p allocation requests admitted: ${usage.allocatedBytes}/67108864 bytes. Inode admissions: ${usage.createdInodes}/4096; directory-entry admissions: ${usage.linkedEntries}/4096. Runtime allowance: ${vmNode.vmRuntimeMs / 1000}s. ${vmNode.boundaryReason || ''}` + : `No guest resource usage observed. Runtime allowance: ${vmNode.vmRuntimeMs / 1000}s.`; + document.getElementById('vmCommandOutcome').textContent = evidence + ? `Command ${evidence.id}: ${evidence.outcome} (VM generation ${evidence.generation}); termination: ${evidence.termination}. Retained evidence: ${vmNode.commands.size}/128. Destroying the VM does not undo guest effects or discard this evidence.` : `No guest command selected. Retained evidence: ${vmNode.commands.size}/128.`; + } + document.getElementById('vmCommandSelection').addEventListener('change', () => { showVmCommand(); renderExperience(); }); + bindModelAction('cancelVmObservationBtn', async () => { + const pending = vmNode.cancelCommand(selectedVmCommandId()); + showVmCommand(); renderExperience(); + await pending; showVmCommand(); + }); + bindModelAction('forgetVmCommandBtn', () => { + const commandId = selectedVmCommandId(); + if (vmNode.forgetCommand(commandId) && commandId === vmStdoutCommandId) { + vmStdoutCommandId = undefined; + document.getElementById('vmStdoutText').textContent = 'Output preview forgotten.'; + document.getElementById('vmStdoutSummary').textContent = 'Resolved command evidence and its preview forgotten. Guest files and separately stored objects are unchanged.'; + } + showVmCommand(); + }); + bindModelAction('reconcileVmCommandBtn', async () => { + try { + const commandId = selectedVmCommandId(); + const bytes = await vmNode.reconcileCommand(commandId); + if (bytes !== null) { + showVmStdout(bytes, commandId); + const entry = await liveDb.put(bytes, { label: 'vm_stdout.txt', persistWarm: false, publicData: false }); + renderLiveDbTable(); logWire('VM-OBSERVED', `Stored observed output locally at ${entry.addressHex}`); + } + } catch (error) { logWire('VM-ERR', error.message); } + showVmCommand(); }); - document.getElementById('bootVmBtn').addEventListener('click', () => { - vmNode.boot(); + function configureVmNetwork() { + const feedback = document.getElementById('vmNetworkValidation'); + try { + const prefixText = document.getElementById('vmPrefixLength').value; + vmNode.setNetworkConfiguration(document.getElementById('vmIpv4Address').value || null, /^(0|[1-9][0-9]*)$/.test(prefixText) ? Number(prefixText) : NaN); + feedback.textContent = ''; + showVmCommand(); + return true; + } catch (error) { + document.getElementById('vmNetworkPanel').open = true; + feedback.textContent = error.message; + logWire('VM-REFUSED', error.message); + return false; + } + } + for (const id of ['vmIpv4Address', 'vmPrefixLength']) + document.getElementById(id).addEventListener('change', configureVmNetwork); + bindModelAction('bootVmBtn', () => { + if (!configureVmNetwork()) return; + try { + vmNode.setRuntimeAllowance(Number(document.getElementById('vmRuntimeSeconds').value) * 1000); + vmNode.boot(); showVmCommand(); + } catch (error) { logWire('VM-REFUSED', error.message); } }); - document.getElementById('runVmCmdBtn').addEventListener('click', async () => { + bindModelAction('runVmCmdBtn', async () => { const cmd = document.getElementById('vmCmdInput').value.trim(); if (!cmd) return; try { - logWire('VM-EXEC', `Running inside Linux 5.6 VM: ${cmd}`); - const outBytes = await vmNode.executeShellCommand(cmd, 8000); - const entry = await liveDb.put(outBytes, { label: 'vm_stdout.txt', persistWarm: true }); + logWire('VM-EXEC', `Running inside Linux VM: ${cmd}`); + const pending = vmNode.executeShellCommand(cmd, 8000); + const commandId = vmNode.lastCommandId; + showVmCommand(true); + renderExperience(); + const outBytes = await pending; + showVmStdout(outBytes, commandId); + const entry = await liveDb.put(outBytes, { label: 'vm_stdout.txt', persistWarm: publicRelayEnabled(), publicData: publicRelayEnabled() }); renderLiveDbTable(); logWire('VM-DONE', `Stored VM stdout in UOR DB at ${entry.addressHex}`); } catch (e) { logWire('VM-ERR', e.message); + } finally { showVmCommand(); } + }); + + const policyFields = { + requests: 'budgetRequestsInput', transferBytes: 'budgetTransferInput', + storageBytes: 'budgetStorageInput', computeSteps: 'budgetComputeInput' + }; + const initialPolicy = admission.state; + for (const [measure, id] of Object.entries(policyFields)) document.getElementById(id).value = String(initialPolicy.limit[measure]); + document.getElementById('budgetMinutesInput').value = String((initialPolicy.endMs - initialPolicy.startMs) / 60000); + document.getElementById('budgetActionsInput').value = String(activeAdmission.maxActions); + document.getElementById('budgetRefreshInput').value = String(scheduler.maxRefreshBudget); + + function renderBudgetPolicy() { + const budget = admission.state; + const expired = activeAdmission.clock() >= budget.endMs; + const reached = Object.keys(budget.limit).filter(k => budget.spent[k] >= budget.limit[k]); + const actionsFull = budget.reservations.length >= activeAdmission.maxActions; + const refreshesUsed = Math.max(0, scheduler.refreshCount - 1); + const refreshesFull = refreshesUsed >= scheduler.maxRefreshBudget; + const remainingSeconds = Math.max(0, Math.ceil((budget.endMs - activeAdmission.clock()) / 1000)); + document.getElementById('budgetLabel').textContent = `epoch ${policyEpoch}: ${budget.spent.requests}/${budget.limit.requests} requests, ${budget.spent.transferBytes}/${budget.limit.transferBytes} application bytes, ${remainingSeconds}s left`; + const status = document.getElementById('budgetStatus'); + const reason = expired ? 'Epoch expired.' : actionsFull ? 'Reservation log allowance reached.' + : refreshesFull ? 'Discovery refresh allowance reached.' : lastPolicyRefusal ? `An effect was refused (${lastPolicyRefusal}).` : reached.length ? `Allowance reached: ${reached.join(', ')}.` : ''; + status.textContent = reason ? `${reason} Review Application resource policy and choose Start New Epoch to grant another bounded allowance. Previous charges stay retained.` + : `Epoch ${policyEpoch} active. Edit the operational allowances above and choose Start New Epoch only when you want a new allowance.`; + status.style.color = reason ? '#f5b66b' : ''; + document.getElementById('budgetUsageBox').textContent = `Current epoch ${policyEpoch}: ${JSON.stringify(budget.spent)} / limits ${JSON.stringify(budget.limit)}; ${budget.reservations.length}/${activeAdmission.maxActions} reservation entries; ${refreshesUsed}/${scheduler.maxRefreshBudget} discovery refreshes.`; + renderExperience(); + document.getElementById('budgetHistoryBox').textContent = policyHistory.length + ? policyHistory.map(entry => `Epoch ${entry.epoch}: ${JSON.stringify(entry.budget.spent)}; ${entry.budget.reservations.length} reservations retained; ${entry.refreshesUsed} discovery refreshes.`).join('\n') + : 'No prior epochs. Current charges remain in the active ledger.'; + } + + bindModelAction('renewBudgetBtn', () => { + try { + const integerInput = (id, minimum = 0) => { + const raw = document.getElementById(id).value.trim(); + const value = Number(raw); + if (!raw || !Number.isSafeInteger(value) || value < minimum) throw Error('Policy limits must be nonnegative safe integers.'); + return value; + }; + const minutesText = document.getElementById('budgetMinutesInput').value.trim(); + const durationMs = Number(minutesText) * 60000; + if (!minutesText || !Number.isSafeInteger(durationMs) || durationMs <= 0) throw Error('Choose a positive epoch duration representable in whole milliseconds.'); + const limit = Object.fromEntries(Object.entries(policyFields).map(([measure, id]) => [measure, integerInput(id)])); + const maxActions = integerInput('budgetActionsInput', 1); + const refreshLimit = integerInput('budgetRefreshInput'); + const next = new ResourceAdmission({ durationMs, limit, maxActions }); + const nextScheduler = new BudgetPacedSurvivalScheduler({ ttlSeconds: scheduler.ttlSeconds, + durationSeconds: durationMs / 1000, maxRefreshBudget: refreshLimit, minFloorSeconds: scheduler.minFloorSeconds }); + nextScheduler.failureTimestamps = [...scheduler.failureTimestamps]; + nextScheduler.markRefreshed(nowSec()); + // No old reservation is settled/refunded, and no data or authority state is cleared. + policyHistory.push({ epoch: policyEpoch, budget: activeAdmission.state, maxActions: activeAdmission.maxActions, + refreshesUsed: Math.max(0, scheduler.refreshCount - 1), refreshLimit: scheduler.maxRefreshBudget }); + activeAdmission = next; + policyEpoch++; + scheduler = nextScheduler; + liveDb.scheduler = scheduler; + lastPolicyRefusal = null; + renderBudgetPolicy(); + logWire('POLICY', `Started epoch ${policyEpoch} by explicit choice. Previous charges retained; pending work was not automatically retried.`); + } catch (error) { + document.getElementById('budgetStatus').textContent = `Policy unchanged: ${error.code || error.message}`; + logWire('POLICY-REFUSED', error.code || error.message); } }); - // DNS DoH & DuckDNS TXT Controls - const doh = new DohResolver(); - document.getElementById('resolveSrvBtn').addEventListener('click', async () => { + bindModelAction('exportBudgetHistoryBtn', () => { + const entries = [...policyHistory, { epoch: policyEpoch, budget: activeAdmission.state, maxActions: activeAdmission.maxActions, + refreshesUsed: Math.max(0, scheduler.refreshCount - 1), refreshLimit: scheduler.maxRefreshBudget }]; + const blob = new Blob([JSON.stringify({ version: 1, accounting: 'application resource ceilings, not host or network measurements', epochs: entries }, null, 2)], { type: 'application/json' }); + const link = document.createElement('a'); + const url = URL.createObjectURL(blob); + link.href = url; link.download = `stitch-policy-history-${Date.now()}.json`; link.click(); + setTimeout(() => URL.revokeObjectURL(url), 0); + }); + + // RFC8484 DNS-message discovery and Cloudflare multipart TXT publication controls + const doh = new DohResolver({ admission }); + const pointerPublisher = new PointerPublisher({ resolver: doh, journal: authorityStore }); + bindModelAction('resolveSrvBtn', async () => { const q = document.getElementById('dnsQueryInput').value.trim(); try { const r = await doh.resolve(q, 'SRV'); @@ -628,64 +1161,136 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

} }); - document.getElementById('resolveTxtBtn').addEventListener('click', async () => { + bindModelAction('resolveTxtBtn', async () => { const q = document.getElementById('dnsQueryInput').value.trim(); try { const r = await doh.resolve(q, 'TXT'); - logWire('DOH-TXT', `${q} -> TTL=${r.ttl_seconds}s, RTT=${r.rtt_ms}ms, records=${JSON.stringify(r.records)}`); + logWire('DOH-TXT', `${q} -> TTL=${r.ttl_seconds}s, RTT=${r.rtt_ms}ms`); + const candidates = r.rawRecords.flatMap(raw => { + try { + const p = parsePointerDnsText(raw); + return p && typeof p === 'object' && Number.isSafeInteger(p.revision) ? [p] : []; + } catch { return []; } + }).sort((a, b) => a.revision - b.revision); + for (const candidate of candidates) { + try { + const accepted = await pointerObserver().admit(candidate); + logWire('POINTER-ADMIT', `revision=${accepted.revision}, root=${accepted.objectRoot}; observer-local, not consensus`); + } catch (error) { logWire('POINTER-REFUSED', error.code || error.message); } + } } catch (e) { logWire('DOH-ERR', e.message); } }); - document.getElementById('writeSignedDnsBtn').addEventListener('click', async () => { - const zoneOrSub = document.getElementById('cfZoneInput').value.trim(); - const token = document.getElementById('cfTokenInput').value.trim(); - const latestRoot = Array.from(liveDb.objects.keys()).pop() || '0'; - if (!peerSigningKeys) peerSigningKeys = await generatePointerKeyPair(); - - const signed = await signPointerTxt( - { - peerId: transport.peerId, - endpoint: transport.signalTopic(), - rootAddress: latestRoot.slice(0, 24) - }, - peerSigningKeys.privateKey - ); - const verified = await verifyPointerTxt(signed.txt, peerSigningKeys.publicKeyB64Url); - trialLogger.logTrial('C8', { - byte_length: signed.byteLength, - c10_within_255b: signed.c10_within_255b, - sign_latency_ms: signed.signLatencyMs, - verify_latency_ms: verified.verifyLatencyMs, - verified: verified.ok - }); - logWire('C8-SIGN', `Ed25519 signed TXT (${signed.byteLength}B <= 255B, verify=${verified.verifyLatencyMs}ms): ${signed.txt}`); + function pointerObserver() { + const name = document.getElementById('dnsQueryInput').value.trim(); + const trustedAuthorityKey = document.getElementById('pointerAuthorityInput').value.trim(); + if (!trustedAuthorityKey) throw Error('Pin an independently trusted authority key first, or explicitly trust the demo session key.'); + const key = `${name}:${trustedAuthorityKey}`; + if (!pointerObservers.has(key)) pointerObservers.set(key, new PointerObserver({ name, trustedAuthorityKey, admission, trustStore: authorityStore })); + return pointerObservers.get(key); + } - if (!zoneOrSub || !token) { - logWire('DNS-WRITE', 'Signed pointer logged to O5 trials. Provide Cloudflare Zone ID (32-hex) or DuckDNS subdomain + token to publish.'); - return; - } + authorityControls = installAuthorityControls({ document, store: authorityStore, pointerObserver, + onAuthorityChanged: async status => { + persistentAuthority = true; + authorityReady = status.status === 'active' ? authorityStore.restoreAuthority() : Promise.resolve(null); + await authorityReady; + document.getElementById('authorityStorageStatus').textContent = `Saved signer ${status.status}. Visible trust pin unchanged; unknown publications retained.`; + }, onChange: renderExperience }); + + bindModelAction('pinSessionAuthorityBtn', async () => { + await authorityRestore; + if (persistentAuthority) authorityReady = authorityStore.restoreAuthority(); + else if (!await authorityReady) authorityReady = generateAuthority(); + document.getElementById('pointerAuthorityInput').value = (await authorityReady).publicKey; + logWire('POINTER-PIN', persistentAuthority ? 'Explicitly pinned the restored saved key. Existing trust is not transferred from other keys.' : 'Created and pinned a session-only key. Closing this tab loses signing authority; no automatic replacement after reload.'); + }); + bindModelAction('saveAuthorityBtn', async () => { + await authorityRestore; + const current = await authorityReady; + if (current && !persistentAuthority) throw Error('Session-only key already chosen. Reload and choose saved authority before signing; keys are never silently replaced.'); + const authority = await authorityStore.setupAuthority(); + authorityReady = Promise.resolve(authority); persistentAuthority = true; + document.getElementById('pointerAuthorityInput').value = authority.publicKey; + document.getElementById('authorityStorageStatus').textContent = 'Saved nonextractable signing key and pinned its public key. Browser clearing, eviction or private-session closure can destroy it. No private-key backup is included in evidence exports.'; + await authorityControls.refresh(); + logWire('AUTHORITY', 'Saved authority ready; public-key trust is explicit and origin-scoped.'); + }); + bindModelAction('loadPublicationBtn', async () => { + const destination = { zoneId: document.getElementById('cfZoneInput').value.trim(), + name: document.getElementById('dnsQueryInput').value.trim(), + trustedAuthorityKey: document.getElementById('pointerAuthorityInput').value.trim() }; + const pending = await pointerPublisher.restore(destination); + if (pending) document.getElementById('pointerJsonInput').value = JSON.stringify(pending); + logWire('DNS-JOURNAL', `${destination.name} / zone ${destination.zoneId} / writer ${destination.trustedAuthorityKey}: ${pending ? 'Retained exact candidate loaded. Reconcile reads only; absence never authorizes repeating this write.' : 'No unknown write retained for this exact scope. Storage loss is not evidence that a write never happened.'}`); + }); + bindModelAction('admitPointerBtn', async () => { + const text = document.getElementById('pointerJsonInput').value; + if (text.length > 4096) throw Error('Pointer input exceeds its size limit'); + const accepted = await pointerObserver().admit(parseCanonicalJson(text, { maxBytes: 4096 })); + logWire('POINTER-ADMIT', `Retained revision ${accepted.revision}: ${accepted.objectRoot}`); + }); + + async function publishOrReconcilePointer() { + if (pointerWriteInFlight) return; + pointerWriteInFlight = true; try { - if (/^[a-f0-9]{32}$/i.test(zoneOrSub)) { - const epochName = `e${Math.floor(Date.now() / 1000)}._stitch._udp.${ document.getElementById('dnsQueryInput').value.trim() }`; - const res = await doh.writeCloudflareRecord({ - zoneId: zoneOrSub, - apiToken: token, - type: 'TXT', - name: epochName, - content: signed.txt, - ttl: 30 - }); - logWire('CF-DNS', `Published Cloudflare TXT ${epochName} (TTL=30s) -> ok=${res.ok}`); - } else { - const res = await doh.writeDuckDnsTxt({ subdomain: zoneOrSub, token, txtValue: signed.txt }); - logWire('DUCK-DNS', `Updated ${res.fqdn} TXT -> response=${res.response}`); + const observer = pointerObserver(); + const zoneId = document.getElementById('cfZoneInput').value.trim(); + const apiToken = document.getElementById('cfTokenInput').value.trim(); + const objectRoot = Array.from(liveDb.objects.values()).filter(e => e.verified).at(-1)?.manifest.object.contentDigest; + await authorityRestore; + const authority = await authorityReady; + const restored = /^[a-f0-9]{32}$/i.test(zoneId) ? await pointerPublisher.restore({ zoneId, name: observer.name, trustedAuthorityKey: observer.trustedAuthorityKey }) : null; + if (!restored && (!authority || observer.trustedAuthorityKey !== authority.publicKey)) throw Error('This session does not hold the private key for the pinned authority.'); + const unresolved = restored; + let candidate = unresolved ?? unpublishedPointers.get(observer) ?? null; + // An unresolved candidate remains the reconciliation target even if the + // latest object or its validity interval changed while publication awaited. + if (!unresolved && (!candidate || candidate.pointerDigest !== observer.head?.pointerDigest)) { + if (!objectRoot) throw Error('Store or recover a verified object before creating a pointer.'); + const current = observer.head; + const nowMs = Date.now(); + const body = { version: 1, name: observer.name, authorityKey: authority.publicKey, + revision: current ? current.revision + 1 : 0, previousDigest: current?.pointerDigest ?? null, + objectRoot, validFromMs: nowMs, validUntilMs: nowMs + 600000 }; + candidate = persistentAuthority ? await authorityStore.signPointer(body, authority.publicKey) : await signPointer(body, authority.privateKey); + // Source-derived succession, pinned authority and signature checks run + // before any DNS publication. A retained local head is not a publish receipt. + await observer.admit(candidate); + unpublishedPointers.set(observer, candidate); } - } catch (e) { - logWire('DNS-ERR', e.message); - } - }); + document.getElementById('pointerJsonInput').value = JSON.stringify(candidate); + const txt = pointerDnsText(candidate); + trialLogger.logTrial('ST-POINTER', { revision: candidate.revision, byte_length: new TextEncoder().encode(txt).length, + authority: 'explicit-pinned-authority', admission: 'observer-local', published: false }); + if (!zoneId || !apiToken) { + logWire('POINTER-LOCAL', `Admitted revision ${candidate.revision} locally; not published. Full signed JSON is above.`); + return; + } + if (!/^[a-f0-9]{32}$/i.test(zoneId)) throw Error('Full signed pointers require Cloudflare multipart TXT; this is not a 255-byte DuckDNS payload.'); + const result = await pointerPublisher.publish({ zoneId, apiToken, name: observer.name, + trustedAuthorityKey: observer.trustedAuthorityKey, candidate }); + if (result.outcome === 'unknown') { + logWire('POINTER-UNKNOWN', result.reason); + return; + } + if (result.outcome === 'refused') { + logWire('DNS-REFUSED', 'The provider rejected this publication. Local head retained; retry checks the provider before writing.'); + return; + } + if (unpublishedPointers.get(observer)?.pointerDigest === candidate.pointerDigest) unpublishedPointers.delete(observer); + logWire('CF-DNS', `${result.reconciled ? 'Reconciled' : 'Published'} admitted revision ${candidate.revision} at ${observer.name}; provider record ${result.recordId}. Observer-local only, not atomic DNS ordering.`); + } catch (error) { + logWire('POINTER-REFUSED', error.code || error.message); + } finally { pointerWriteInFlight = false; } + } + bindModelAction('writeSignedDnsBtn', publishOrReconcilePointer); + bindModelAction('reconcilePointerBtn', publishOrReconcilePointer); + + const recoveryControls = installRecoveryControls({ document, liveDb, computeCoord, pointerObservers, pointerObserver, bindModelAction, onChange: renderExperience }); document.getElementById('exportJsonlBtn').addEventListener('click', () => { const jsonl = trialLogger.toJsonl(); @@ -700,12 +1305,13 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

// Live Scheduler Tick Loop (evaluates entropy & triggers proactive sync) setInterval(() => { const st = scheduler.evaluate(nowSec()); + renderPlacementEvidence(); + renderBudgetPolicy(); document.getElementById('schedLambdaLabel').textContent = `${st.lambda.toFixed(3)}/s`; document.getElementById('schedPAliveLabel').textContent = st.pAlive.toFixed(3); document.getElementById('schedEntropyLabel').textContent = `${st.entropyBits.toFixed(3)} bit`; - if (st.shouldRefresh) { - scheduler.markRefreshed(nowSec()); + if (operatorExperience?.facts().meshJoined && st.shouldRefresh && scheduler.markRefreshed(nowSec())) { transport.sendSignal({ kind: 'announce' }); logWire('SCHED', `Proactive refresh triggered [reason=${st.reason}, H=${st.entropyBits.toFixed(3)} bit]`); } @@ -737,8 +1343,72 @@

Layer 4 Benchmark: Compute Engine Under Worker Churn

document.getElementById('runAllBenchBtn').addEventListener('click', runAllBenchmarks); - runAllBenchmarks(); - joinAndSync(); + operatorExperience = createOperatorExperience({ + document, + snapshot: () => { + const objects = Array.from(liveDb.objects.values()); + const jobs = Array.from(computeCoord.jobs.values()); + const mesh = transport.lifecycle; + const vm = { ...vmNode.lifecycle, ...vmNode.commandLifecycle?.(selectedVmCommandId()) }; + const trustedAuthorityKey = document.getElementById('pointerAuthorityInput').value.trim(); + const name = document.getElementById('dnsQueryInput').value.trim(); + const zoneId = document.getElementById('cfZoneInput').value.trim(); + const observer = pointerObservers.get(`${name}:${trustedAuthorityKey}`); + const publication = pointerPublisher.status({ zoneId, name, trustedAuthorityKey }); + const budget = admission.state; + // Only globally impossible admissions disable every application action. + // Resource dimensions and prior operation refusals are not a second ledger: + // each actual adapter checks its own exact resource vector before effects. + const blocked = activeAdmission.clock() >= budget.endMs || + budget.reservations.length >= activeAdmission.maxActions || lastPolicyRefusal === 'clock-regression'; + const attention = Boolean(lastPolicyRefusal) || + Object.keys(budget.limit).some(k => budget.spent[k] >= budget.limit[k]) || + Math.max(0, scheduler.refreshCount - 1) >= scheduler.maxRefreshBudget; + const unfinished = jobs.filter(j => j.status !== 'completed'); + return { + ...recoveryControls.facts(), + vmTerminationPending: vm?.terminationObservation === 'pending', + vmStopped: vm?.terminationObservation === 'stopped', vmDestroyed: vm?.terminationObservation === 'destroyed', + vmCanBoot: Boolean(vm?.canBoot), vmCanExecute: Boolean(vm?.canExecute), + vmCanAdminister: Boolean(vm?.canAdminister), vmCanCancelObservation: Boolean(vm?.canCancelObservation), + vmCanForgetCommand: Boolean(vm?.canForgetCommand), vmCanReconcileCommand: Boolean(vm?.canReconcileCommand), vmAdminBlocked: Boolean(vm?.adminBlocked), + disclosureAccepted: document.getElementById('allowMeshSignalingInput').checked, + meshJoined: Boolean(mesh && !mesh.closed && mesh.generation > 0), + peersReachable: transport.openPeers().length > 0, + relayEnabled: publicRelayEnabled(), + hasObject: objects.some(e => e.verified), + hasPartial: objects.some(e => !e.verified), + placementObjectSelected: Boolean(liveDb.get(document.getElementById('placementObject').value).ok), + recoverablePlacement: Array.from(liveDb.placements.keys()).some(key => { + try { return liveDb.placementSummary(key).canRecoverFromCommitted; } + catch { return false; } + }), + hasJobs: jobs.length > 0, + unfinishedJobs: unfinished.length > 0, + replayedJobs: unfinished.length > 0 && unfinished.every(j => j.verification === 'replayed'), + vmBooting: vm?.phase === 'booting', vmReady: vm?.phase === 'ready', vmFailed: vm?.phase === 'failed', + authorityPinned: /^[0-9a-f]{64}$/.test(trustedAuthorityKey), + headRetained: Boolean(observer?.head), + dnsConfigured: /^[a-f0-9]{32}$/i.test(zoneId) && Boolean(document.getElementById('cfTokenInput').value.trim()), + publicationBusy: pointerWriteInFlight, + publicationUnknown: publication.outcome === 'unknown', + publicationPublished: publication.outcome === 'published', + policyBlocked: blocked, policyAttention: attention + }; + }, + onRefused: message => logWire('MODEL-REFUSED', message) + }); + document.getElementById('allowMeshSignalingInput').addEventListener('change', () => { + if (!document.getElementById('allowMeshSignalingInput').checked) transport.close(); + renderExperience(); + }); + for (const id of ['pointerAuthorityInput', 'dnsQueryInput', 'cfZoneInput', 'cfTokenInput', 'pointerJsonInput']) { + document.getElementById(id).addEventListener('input', renderExperience); + } + renderBudgetPolicy(); + // No automatic public signaling, relay payload publication or job resumption. + renderPlacementControls(); + renderExperience(); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..c09bb42 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,836 @@ +{ + "name": "@syntra-labs/stitch", + "version": "0.2.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@syntra-labs/stitch", + "version": "0.2.0", + "license": "MIT", + "devDependencies": { + "@playwright/test": "1.58.2", + "prism-code": "0.7.2" + } + }, + "node_modules/@gar/promise-retry": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@gar/promise-retry/-/promise-retry-1.0.3.tgz", + "integrity": "sha512-GmzA9ckNokPypTg10pgpeHNQe7ph+iIKKmhKu3Ob9ANkswreCx7R3cKmY781K8QK3AqVL3xVh9A42JvIAbkkSA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/@npmcli/agent": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-5.0.2.tgz", + "integrity": "sha512-EkzGmEsgbQ1rqWkRJe2P0oQHx/ylZozDUNPMXCklLuSFL3GY+QyEfBUjhjCsgGXzh4OGpnHvkboSQgczjP/jJg==", + "dev": true, + "license": "ISC", + "optional": true, + "dependencies": { + "agent-base": "^9.0.0", + "http-proxy-agent": "^9.0.0", + "https-proxy-agent": "^9.0.0", + "lru-cache": "^11.2.1", + "socks-proxy-agent": "^10.0.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@npmcli/fs": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-6.0.0.tgz", + "integrity": "sha512-AheOs4swKka/XLtht6xxJDPezlQ7K2IYQ9Y8lST4JLDjnralnWuMM9AE2CdVcgQJ5omrXhsRzM7F7aYmeZBvKQ==", + "dev": true, + "license": "ISC", + "optional": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@npmcli/redact": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/redact/-/redact-5.0.0.tgz", + "integrity": "sha512-3zcN5Q3yEmeyxXBzqB6fXPQFzYa2ROsGFSr69W0ArXIAGJqxl/aFECOVPD2kbkYPm0U/EHxFKgclK3UA9WQg5A==", + "dev": true, + "license": "ISC", + "optional": true, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@playwright/test": { + "version": "1.58.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.58.2.tgz", + "integrity": "sha512-akea+6bHYBBfA9uQqSYmlJXn61cTa+jbO87xVLCWbTqbWadRVmhxlXATaOjOgcBaWU4ePo0wB41KMFv3o35IXA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.58.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sigstore/bundle": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-5.0.0.tgz", + "integrity": "sha512-wefjygudENbzbQMks1t5u34EP0fFoD0XvaEP7DOUP/sXKvogzEJYFw5E6pegGyp3onGWzVEYKVa3bNZWyTYX+A==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@sigstore/protobuf-specs": "^0.5.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@sigstore/core": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@sigstore/core/-/core-4.0.1.tgz", + "integrity": "sha512-9v5hRjujn5NXq8o7XFEUgLyAtdr5Iisb4pzM05u3K61IS5q3hP3luWAndk0RkPPLTUFoTbg7Vb84UQ1ZQeajWQ==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@sigstore/protobuf-specs": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.5.2.tgz", + "integrity": "sha512-SQqvFMt4V78fdjcDdYX6HbiVSOR4QK3ZgwCa2KOsopAgPIHy1rU5UDUmzLl02r5oyyaYcYHR1hpwDRk/yUe+Mw==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/sign": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-5.0.0.tgz", + "integrity": "sha512-DSFivqz9/i5AkwZ5fq0YdjaJlc4o1WeS2Zffon0kqtChx0vy4W9NOjkEet9bF2vkzOufX72eVH8kZBIGtcBp1w==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@gar/promise-retry": "^1.0.2", + "@sigstore/bundle": "^5.0.0", + "@sigstore/core": "^4.0.0", + "@sigstore/protobuf-specs": "^0.5.0", + "make-fetch-happen": "^16.0.0", + "proc-log": "^7.0.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@sigstore/tuf": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-5.0.0.tgz", + "integrity": "sha512-Zyqg9tcHps3uRAlKHLNmsW4ohsUZAjb9G+31r7lg0ICh/JOcadzmJsIRdjKljlRHpaR0K4aJ2kXXIdywdcdMlA==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@sigstore/protobuf-specs": "^0.5.0", + "tuf-js": "^6.0.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@sigstore/verify": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@sigstore/verify/-/verify-4.1.2.tgz", + "integrity": "sha512-BfD9eLrz3A/DG58aSgfgZYmIR6V9Yw96QVN/frtu2bEH7ctSTk2TDvHU12un3JsDPBTqTNkqkIkucjxljpOFqQ==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@sigstore/bundle": "^5.0.0", + "@sigstore/core": "^4.0.1", + "@sigstore/protobuf-specs": "^0.5.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@tufjs/canonical-json": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz", + "integrity": "sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@tufjs/models": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-5.0.2.tgz", + "integrity": "sha512-YzKuFwBcH+m4/YIN0magcH5AjgYVnNFUGhP14vCs+Ckanqz86dDn6K0anjjb730Iu6SSqjzXQCo3FzVqYyT+wg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tufjs/canonical-json": "2.0.0", + "minimatch": "^10.2.6" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/agent-base": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-9.0.0.tgz", + "integrity": "sha512-TQf59BsZnytt8GdJKLPfUZ54g/iaUL2OWDSFCCvMOhsHduDQxO8xC4PNeyIkVcA5KwL2phPSv0douC0fgWzmnA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 20" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/cacache": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-21.0.1.tgz", + "integrity": "sha512-pTwz/uj3Jyp6WXdJ6fWhR+7LVxVs6RyroQSn7KJwHsSxXuyGSp0pcMVcwSwTpCFq1X2YG8QBe0W+vN+cr0SwzA==", + "dev": true, + "license": "ISC", + "optional": true, + "dependencies": { + "@npmcli/fs": "^6.0.0", + "fs-minipass": "^3.0.0", + "glob": "^13.0.0", + "lru-cache": "^11.1.0", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^7.0.2", + "ssri": "^14.0.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "dev": true, + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/glob": { + "version": "13.0.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.7.tgz", + "integrity": "sha512-wfsFgXQ8A3SEI9XGf7Nl3Y9l7ffSrGh7SUCT7vU/2CzYPep9kjxAn1S40F9OPKxAMGCVl7HtNlJhrCJUeUq83g==", + "dev": true, + "license": "BlueOak-1.0.0", + "optional": true, + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.3.0.tgz", + "integrity": "sha512-M5t5LlJpS1UHMjvwRQVdFHvPISGeLAxNcrWuJkeGh0KxsqCHZ1O3NXZU/8x7cD0BDcGW8kapxMKTvwlqrNkHkA==", + "dev": true, + "license": "BSD-2-Clause", + "optional": true + }, + "node_modules/http-proxy-agent": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-9.1.0.tgz", + "integrity": "sha512-2NxoveTT58mjYT4n3RPTEfCZGLMbidoO8XEieXfpSYxu+PQJ1qpx4ypwH6N+uF9twBPIvRRgvkvW5HUTYWENig==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "9.0.0", + "debug": "^4.3.4", + "proxy-agent-negotiate": "1.1.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/https-proxy-agent": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-9.1.0.tgz", + "integrity": "sha512-ag87y7cJJ9/3+GxFr8Oy4O5faDsGRGnBGsJj/YjOSsSx/5eadKLYTMPlzuR6obgoCDDm0abAAZitXXQkMOPSpA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "9.0.0", + "debug": "^4.3.4", + "proxy-agent-negotiate": "1.1.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ip-address": { + "version": "10.7.6", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.6.tgz", + "integrity": "sha512-00LYkM6byILa9eQIx6qoaXCM40xTLd56AZ4vyaPW3YTyb49VZYPo5xsiAq4tuQ54GH4R7gVdYScJ1B7B77PuTg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "dev": true, + "license": "BlueOak-1.0.0", + "optional": true, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/make-fetch-happen": { + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-16.0.1.tgz", + "integrity": "sha512-uUv1yxHzaKVVEPfcFeGSNov/Cehjv08ovlY8ImTljgL7Q+SiA0dAYLQ6SYVa2kkKqNj4Y3aZEI7xv2teadie0A==", + "dev": true, + "license": "ISC", + "optional": true, + "dependencies": { + "@gar/promise-retry": "^1.0.0", + "@npmcli/agent": "^5.0.0", + "@npmcli/redact": "^5.0.0", + "cacache": "^21.0.0", + "http-cache-semantics": "^4.1.1", + "minipass": "^7.0.2", + "minipass-fetch": "^6.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^1.0.0", + "proc-log": "^7.0.0", + "ssri": "^14.0.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "optional": true, + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "optional": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-collect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", + "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", + "dev": true, + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-fetch": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-6.0.0.tgz", + "integrity": "sha512-AWI8bKapGmgx/J0E6IGYSKj8TiHebZkmKWSs8raPSw8KXwgEAJ+Bw3+LSdXHR6T/RHKAWCOYk2MiLrYluaUU6w==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^2.0.0", + "minizlib": "^3.0.1" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + }, + "optionalDependencies": { + "iconv-lite": "^0.7.2" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.7.tgz", + "integrity": "sha512-TbqTz9cUwWyHS2Dy89P3ocAGUGxKjjLuR9z8w4WUTGAVgEj17/4nhgo2Du56i0Fm3Pm30g4iA8Lcqctc76jCzA==", + "dev": true, + "license": "BlueOak-1.0.0", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-flush/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-2.0.0.tgz", + "integrity": "sha512-zSsHhto5BcUVM2m1LurnXY6M//cGhVaegT71OfOXoprxT6o780GZd792ea6FfrQkuU4usHZIUczAQMRUE2plzA==", + "dev": true, + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^7.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz", + "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "minipass": "^7.1.2" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.1.0.tgz", + "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "content-type": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/p-map": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.1.1.tgz", + "integrity": "sha512-6Lh3jQPLthYujSrlw6ccWXBGZTkoTCz27Hd92g79LH/kjAbgoEu0t442cCCNbegPSJsA0lwDX8z0bcKtkpA32g==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "optional": true, + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/playwright": { + "version": "1.58.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.58.2.tgz", + "integrity": "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.58.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.58.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.2.tgz", + "integrity": "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/prism-code": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/prism-code/-/prism-code-0.7.2.tgz", + "integrity": "sha512-2rGX6XqV8zOwExNxoDrOBUbPpOzFsMF1RYxebvKbMKNym7fafh+FWFOfKTyYYn09bH05Q5r/H/Qceb6GbaFItA==", + "dev": true, + "license": "MIT", + "bin": { + "prism-code": "bin/prism-code.mjs", + "prism-doctor": "bin/prism-doctor.mjs", + "prism-provider-kv": "bin/prism-provider-kv.mjs" + }, + "engines": { + "node": ">=22" + }, + "optionalDependencies": { + "@sigstore/bundle": "5.0.0", + "@sigstore/protobuf-specs": "0.5.2", + "@sigstore/sign": "5.0.0", + "@sigstore/tuf": "5.0.0", + "@sigstore/verify": "4.1.2" + } + }, + "node_modules/proc-log": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-7.0.0.tgz", + "integrity": "sha512-FYgfaA69XZ93zaXLoMNQ+ViDXGGBgR8aLh03txzcFhV+9xOXx7+8DLCULrKKpR9+GsH9ZfHm82aSUPpozX0Ztg==", + "dev": true, + "license": "ISC", + "optional": true, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/proxy-agent-negotiate": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-agent-negotiate/-/proxy-agent-negotiate-1.1.0.tgz", + "integrity": "sha512-N8IBcM3UgCVzz2L2Lqv8DVntDnnC8/hiV4nEDUPkqq72TPUgYWjQc+bdZlBPZK9LzPAvOY//gAt0S0DApoOXWQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "kerberos": "^2.0.0" + }, + "peerDependenciesMeta": { + "kerberos": { + "optional": true + } + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "dev": true, + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.10", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.10.tgz", + "integrity": "sha512-e0VyvkVTwVYViNovRkZ9aodhxVlyoMn7eJhVUPxZ+eK9P/7CBkxvvsBOHqFPEH416726W8tLXXXjKwqgTErrCQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "ip-address": "^10.1.1", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-10.1.0.tgz", + "integrity": "sha512-WlMj/67cEJ6MDI1OcsnjuYKDNDoyPCCYZ249kuuXPiMDw9F8PXkVaQ7YWu3siTydfQ/4BEZcvGzu+aYvz7dDCQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "9.0.0", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/ssri": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-14.0.0.tgz", + "integrity": "sha512-jQxKI0yx0ZnTKrqjKkLDV2DXkBQn3k49JVmVqDGcDwKDtGDbImD/GXsq04KD0VVzCQQ9wZJYal3RwR1GzWTSow==", + "dev": true, + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/tuf-js": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-6.0.2.tgz", + "integrity": "sha512-k78oXrR/Ssi2kTXgP0paoQ7efyw/fO2RBgxXnTQTfoyZRM72XuT8D0ylG9NkJgdnYtx4LWo+qpGdpI4o7FIiJA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@gar/promise-retry": "^1.0.3", + "@tufjs/models": "5.0.2", + "debug": "^4.4.3" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC", + "optional": true + } + } +} diff --git a/package.json b/package.json index 32df8bb..4aac081 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,26 @@ { "name": "@syntra-labs/stitch", "version": "0.2.0", - "description": "Stratified routing persistence, UOR content-addressed ephemeral database, and distributed ring compute", + "description": "Model-driven recoverable objects and replayable computation across changing peers", "type": "module", "main": "src/layer1-uor/index.js", "scripts": { - "test": "node tests/run_all.js", - "serve": "python3 -m http.server 8080" + "test": "node scripts/check-model.mjs && node scripts/check-product.mjs --check && node --test scripts/*-tests.mjs tests/*.test.js && node tests/run_all.js", + "serve": "python3 -m http.server 8080", + "model:write": "node scripts/check-model.mjs --write", + "model:check": "node scripts/check-model.mjs", + "test:independent": "python3 scripts/verify-custody.py", + "product:write": "node scripts/check-product.mjs --write", + "product:check": "node scripts/check-product.mjs --check", + "test:browser": "playwright test --config tests/browser/playwright.config.mjs" }, "repository": { "type": "git", "url": "https://github.com/Syntra-Labs/stitch.git" }, - "license": "MIT" + "license": "MIT", + "devDependencies": { + "@playwright/test": "1.58.2", + "prism-code": "0.7.2" + } } diff --git a/prismpm.lock b/prismpm.lock new file mode 100644 index 0000000..cfbf306 --- /dev/null +++ b/prismpm.lock @@ -0,0 +1 @@ +{"platforms":[{"inventory":[{"digest":"sha256:1e88b7e9aa26ad5cd17601aad064de5b07c1251128b5def20f79d24438b5f4be","id":"action","kind":"workflow","version":"0.3.0"},{"digest":"sha256:5d63cd6921f790c8637e716b632d7777899f37166eff0a6010cd19d1e9127044","id":"adapter-compose","kind":"adapter","version":"compose-spec@fee041b381ffd4aad263410980bdce0cdf4beb7d"},{"digest":"sha256:db0425b35e875a36af50fb3a73e491af9badc759b6c290a731d6fd23fd62c119","id":"adapter-github-pages","kind":"adapter","version":"github-pages-artifact@v4"},{"digest":"sha256:59df071a35deca05e62224e43b82d7bc9b5c649f989a3424fd704123633a539e","id":"adapter-github-pages-browser","kind":"adapter","version":"github-pages-artifact@v4"},{"digest":"sha256:12021a034cb9b796f1ab6b4431e5cdbd9803e16181f6378ce580e40764b62ff6","id":"adapter-kubernetes","kind":"adapter","version":"1.36.4"},{"digest":"sha256:6bec0a3910568ff84f28b8fd9c2f63e3fcde7986bebf3e24b1f4649c150d735b","id":"asyncapi-3.1.0-official-corpus","kind":"test-corpus","version":"b3fac5bb522771428ea57b16129b273cd3ea0180"},{"digest":"sha256:87f962245c8ad4fa95a972f8f67ed9804df22ee385197ae403dafae8b375995e","id":"asyncapi-embedded-launcher","kind":"oracle","version":"1"},{"digest":"sha256:b93c35a475df94fa05d817de7d0a78d569b7c9be932004accdb4dad032bbb729","id":"asyncapi-embedded-runtime","kind":"oracle","version":"@asyncapi/parser/3.6.0"},{"digest":"sha256:5bd20ce206d3b3b76a7034951c9e19e15291c54eec0a1424139b465c980f1205","id":"asyncapi-embedded-runtime-lock","kind":"dependency-lock","version":"@asyncapi/parser/3.6.0"},{"digest":"sha256:dbb7252527064804ec138bb391c90b26d08d3db5d47c4995735d56865c3f9882","id":"asyncapi-embedded-runtime-tests","kind":"test-corpus","version":"1"},{"digest":"sha256:b10e96e4bda8f1971585e93fe2c6e3872af558d5ae185374fb7500933992ae60","id":"asyncapi-oracle","kind":"oracle","version":"3.1.0"},{"digest":"sha256:ace18379af8bcc5723f49c7d50e322fadb8bc5c34102cebba2bb4746f1d82b5b","id":"asyncapi-website-adeo-schemas","kind":"test-corpus","version":"20a31a0396b41dd24b1bac877ab7ce3f58037c28"},{"digest":"sha256:24d82f845768c66d79d87052a265a56e28ad576eb31495a31fdaf716cb6ea43d","id":"bootstrap-historical-runner","kind":"binary","version":"0.2.0-runner/1"},{"digest":"sha256:70c9420062249ab531d56510a28deae6818e75cdfde52375ae9936376b153a23","id":"bootstrap-historical-runtime","kind":"binary","version":"0.2.0-runner/1"},{"digest":"sha256:c256110bb391083e2de1c225e904ba860f7b9b34efe9bf36227c607d36ad5085","id":"browser-account-genesis-construction","kind":"adapter","version":"1"},{"digest":"sha256:1607f069b641cc17df572eaab24fb2ce47288107e8f5a1fc670e94cc9eee3e88","id":"browser-host-primitives","kind":"adapter","version":"1"},{"digest":"sha256:0e2bcaef56d041a486784e54104a81aebe0da44bd03019bd70bc0401e42e4a97","id":"build-base","kind":"base-image","version":"rust-1.97.1-bookworm"},{"digest":"sha256:331555b57a45b264327ec4f034c189f64e20956b630a2d6b9053e767bbb53e90","id":"chromium-input-authority","kind":"dependency-lock","version":"157.0.8099.0"},{"digest":"sha256:ae6f7357f1eea754f07f555dd263d30f2d30ca8cf5440b2494c14facf34743af","id":"chromium-input-installer","kind":"oracle","version":"1"},{"digest":"sha256:48aa53d280e5e78275acfff62ae0173ac06fc86af86c379cad693e05e74a7803","id":"cloudevents-1.0.2-fixtures","kind":"test-corpus","version":"1.0.2"},{"digest":"sha256:9ad865a01c7ccb541255a2f89a2dbb34093c6ae3f57ce9e637eabf9edb146da0","id":"cloudevents-sdk-conformance","kind":"oracle","version":"2.16.2"},{"digest":"sha256:38480c5a48f73d20b8aa0db8366e22ae4ab34c245a370a11b8862cfbdeb5c6d1","id":"cloudevents-sdk-go-corpus","kind":"test-corpus","version":"2.16.2"},{"digest":"sha256:0f25ac26370a32f0d61fb50fc25e9c6ac5357680306e8c6e60f8dddad4f54eae","id":"cloudevents-validator","kind":"oracle","version":"sdk-go/2.16.2"},{"digest":"sha256:cd65e860cbad537bf76598f8e910e9cb027f7c90b1f09252141837df0240d4af","id":"conformance-corpus","kind":"test-corpus","version":"prismpm/ids/1"},{"digest":"sha256:d16d2c85ab2024a98c62f0d8c9fc195f5177ee65e9d6598ac84ecc6e3ede4fed","id":"contracts","kind":"schema","version":"1"},{"digest":"sha256:696bc104bac3bb708eff1af3f8bbc09fda0fd88f5757c1f9b404a35117889224","id":"docker-buildx","kind":"binary","version":"0.28.0"},{"digest":"sha256:cf122ae443d3fcad8b90fe30277d3c37e008c60d56c9658a44848bdb6f2078d4","id":"git-tag-root-akihirosuda","kind":"trust-root","version":"github-key-record-5228653"},{"digest":"sha256:929c5c98f56be683921c84a1ccd542d0d8df3e75657c3711d5557da35267b637","id":"git-tag-root-hayden-io","kind":"trust-root","version":"github-key-record-682831"},{"digest":"sha256:c0f83ab885c007561550bda8d540e620b2ac4e36af0a4b48cd320854a3cf2ea4","id":"git-tag-root-songy23","kind":"trust-root","version":"github-key-record-276780"},{"digest":"sha256:e33e1416f08d6ee24f1c66f3895be7d919ff58c0d4318f2934ec4743f75f0a7e","id":"git-tag-root-sudo-bmitch","kind":"trust-root","version":"github-key-record-2155637"},{"digest":"sha256:6cbad548e30d2e227d1cea0ee23bb09c06c506c27094ccd8f55137d0bef17371","id":"in-toto-attestation-1.0-source","kind":"test-corpus","version":"ee16c68a11dfcfbdc891600cacd767896fe6e724"},{"digest":"sha256:591f463460916feef9ac066f38654ab6be819dccc66738088d7b264ae2e44d79","id":"intoto-statement-validator","kind":"oracle","version":"1.0@ee16c68a"},{"digest":"sha256:8f63dc2d12ed947bfa4ae4cabab2d5926ecc06d86d054b6a3a4f3454446b5551","id":"json-schema-2020-12-corpus","kind":"test-corpus","version":"c9510e3bf8a896c3cba4e08509cf752b4f30dff8"},{"digest":"sha256:e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","id":"lean","kind":"binary","version":"4.32.1"},{"digest":"sha256:29270825b581f950b3914509b7a0613f34964f003eb3c61772636d0805b09148","id":"lean4-prod","kind":"crate","version":"991956fe427bb646498fd0912c89b71be71e7beb"},{"digest":"sha256:b0081437c68a576ea0b19805568e8ac8c418cf5b7b366d7881b02f38dbaf77ed","id":"lean4-prod-exporter","kind":"binary","version":"991956fe427bb646498fd0912c89b71be71e7beb"},{"digest":"sha256:5ad69a24139104bd268a70b2124384a9266903550fe6909804abb6c8c32b9431","id":"lean4-prod-exporter-seed","kind":"dependency-lock","version":"1"},{"digest":"sha256:c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","id":"leanchecker","kind":"binary","version":"4.32.1"},{"digest":"sha256:e4168b533d3369e7e0e2ed7cdb331f8dd94e3aa20362d55ded086a24ca3b16f8","id":"lexlean","kind":"binary","version":"0.3.0"},{"digest":"sha256:c3b22a1cef1975004c948e04005f02c013c02f9698c04da07998e9e13e875acc","id":"oci-distribution-1.1.1-corpus","kind":"test-corpus","version":"a139cc423184af6078077b9b7ee336eddbd03f8f"},{"digest":"sha256:7b0e39ab2f616c7b33a7ffc57331b90a27ea4cc23ffbc1526c3dee80187332b2","id":"oci-distribution-conformance","kind":"oracle","version":"1.1.1@a139cc42"},{"digest":"sha256:6c00d78efd45b6a3acc798497851b21585867042cbdc63dbe0c105825b8dac91","id":"oci-image-1.1.1-corpus","kind":"test-corpus","version":"147f9c13cedb47a0c4d9a11a222961073d585877"},{"digest":"sha256:87e0a99983e0bf9af63d5ac49cd7c1df476231f1de947d0e1c7e7b51b57cc0fd","id":"oci-image-schema-conformance","kind":"oracle","version":"1.1.1@147f9c13"},{"digest":"sha256:9bf0da1272040438e13ce349a39a1dd036c3432f82e2cec5b17d2aa7db316e8a","id":"oci-runtime-1.3.0-corpus","kind":"test-corpus","version":"92249139eea7161e13745abd4cb6d0ea02a3227a"},{"digest":"sha256:65bd7332ae65e906405bb3b4e1dfcbfa7c9e25dcc3ceeff5a7331a1b942be26e","id":"oci-runtime-validate","kind":"oracle","version":"1.3.0@92249139"},{"digest":"sha256:7ee100439bc7dc35cda162b85be68140338bdae5aa3c2fb79412cca621bdd9b1","id":"openid-conformance","kind":"oracle","version":"3e09b13b896f"},{"digest":"sha256:a35012f67dccd4296ab0e380eb86a0e053dbbf6bf52522aca3ed961c83812197","id":"openid-conformance-suite-corpus","kind":"test-corpus","version":"3e09b13b896fce95d78c2c0f931feee9614e9452"},{"digest":"sha256:90cdf6a86d9f2f7c9b60f66c9be7c296b394dfef57ac5e28d78965565252f223","id":"opentelemetry-0.136.0-signal-corpus","kind":"test-corpus","version":"0.136.0"},{"digest":"sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e","id":"playwright-chromium","kind":"oracle","version":"1.62.1"},{"digest":"sha256:8d81de4103b7e342d0f997526d84fb334bf92b562f1035bc66da8b77a0b02ab7","id":"playwright-core","kind":"oracle","version":"1.62.1"},{"digest":"sha256:bf3497a2d26912da443d74ef55c0d8155e00a781e3e6c966368d8bd2c8380b5c","id":"playwright-driver","kind":"oracle","version":"1.62.1"},{"digest":"sha256:18c79a8a6f785debf08393ce22f57cf5923d996c431c5c55610e5a20109905b7","id":"playwright-headless-shell","kind":"oracle","version":"157.0.8099.0"},{"digest":"sha256:58f398f5453e170e19842360ac1bb3ceda2ea032306527bbeb3adf6650b52bca","id":"prism-stdlib","kind":"crate","version":"0.2.0"},{"digest":"sha256:ddd53c416a956ede2d84dedace1af7ad9a12ef1eac0e9220a4a5b3e6de897aa8","id":"prismpm","kind":"binary","version":"0.3.0"},{"digest":"sha256:65270010ca442abafa1ae5ccaa1e00777814d08748e0ffb4565070c43b52e2e9","id":"prismpm-conformance","kind":"binary","version":"0.3.0"},{"digest":"sha256:a3be795af76d3a0d95253ce652828b3d161e6aae0f147996328dd333a9aba531","id":"prismpm-platform-equivalence","kind":"binary","version":"0.3.0"},{"digest":"sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e","id":"runtime-base","kind":"base-image","version":"playwright-v1.62.1-noble"},{"digest":"sha256:22cb82bbc6142c670dfc2b21b225d01edcd036c4e870ef4b668c9e3efa8bb6f1","id":"runtime-os-lock","kind":"dependency-lock","version":"ubuntu-noble@20260901T000000Z"},{"digest":"sha256:2fa9d3ee26c523899ae5314861306daff716320095cd638f1cd54fbff44cd208","id":"sdk-exporter-seed-producer","kind":"schema","version":"1"},{"digest":"sha256:18d8f8d10061d2e4d4ee627cd051481cb79ea366300d191a0e7f81ac8f87f182","id":"sdk-image-input-authorities","kind":"test-corpus","version":"1"},{"digest":"sha256:7f441845b1a471b97b9756b7cbe3f48c6e1997be9acd36cece415111c8453d79","id":"sdk-image-input-verifier","kind":"test-corpus","version":"1"},{"digest":"sha256:d025c5be578b5d2b334c02917cefa3ff60a1fd8b21de7d06348a300ec1b8a072","id":"sdk-metadata-capture","kind":"schema","version":"1"},{"digest":"sha256:d84af5d749355ea4dd97519ee1a7710cc43d8f307d1b8c43cdf93f3e51c24db1","id":"sdk-metadata-cli","kind":"schema","version":"1"},{"digest":"sha256:fb287316d82f21b36386f3a6532af61d4205cee18b74f4c3db2737a90113037d","id":"sdk-metadata-credentials","kind":"schema","version":"1"},{"digest":"sha256:6945bb2808808d2ca6ed237dadfe5749989a0f9c94579ab64280f3e84592cbdf","id":"sdk-metadata-helper","kind":"schema","version":"1"},{"digest":"sha256:3f860b40d5ad29751a592d50f1dc703cdef04a0f0929bcefd90cc844ccc58d43","id":"sdk-metadata-helper-supervisor","kind":"schema","version":"1"},{"digest":"sha256:52951e1caf9eb692436f83c5c5dc0f23ec0a864926140ee3db1e217d823707d5","id":"sdk-metadata-layer","kind":"schema","version":"1"},{"digest":"sha256:ab7c2ce88b40760294514ca846cda0671a8709438c8361f0a18fa1ffa4030732","id":"sdk-metadata-transport","kind":"schema","version":"1"},{"digest":"sha256:870ece6967ce85585dd1935f742ef05d8a4a4111d54ea30b541a43857b43533b","id":"sdk-platform-lock","kind":"schema","version":"2"},{"digest":"sha256:6e0162633a2d8b8ec973c6fb15e1d48e55f92c5889b90961a3a1b17937aa3e97","id":"sdk-vv-advisory","kind":"test-corpus","version":"d5c17953a895cf19e8d3ce66eaa42b6fcfe1fb16"},{"digest":"sha256:f3dd999f5618db154fa06222a06f9de95d86e1dbf683954426ea91c974cbe24c","id":"sdk-vv-bootstrap","kind":"test-corpus","version":"0.2.0"},{"digest":"sha256:f66e5cd2482cf80b5b529b7688b14602753cb8654707a0762c0a49f333d71091","id":"sdk-vv-manifest","kind":"test-corpus","version":"1"},{"digest":"sha256:96c3af78e543b0d02d8972816daee3b58ef421e667cb41d4ea7b421653aa73a9","id":"sdk-vv-policy","kind":"test-corpus","version":"1"},{"digest":"sha256:ecac1c34797bad411cf8a5b9bfe9a1d3c58d33d6c4ec0b25e21be89a92156840","id":"sdk-vv-source","kind":"test-corpus","version":"35e9f01d5415ed4b0b64c152238f291546957ec4"},{"digest":"sha256:d9028fd7692fae3a56dd29848c629ea564e67bbf3f6804f557f6b153a1ceb35c","id":"sdk-vv-verifier","kind":"test-corpus","version":"1"},{"digest":"sha256:844a1c6de3986c9f02070266b25e0d1a2fa99ceccc89f6b9ad90aae47b62a16e","id":"sigstore-trusted-root","kind":"trust-root","version":"cosign-3.1.3-default-services"},{"digest":"sha256:2fa271a49fd04807437003e3a2e8d7d39c3b635b4815a72d1ec2f5f216adaaea","id":"spdx-3.0.1-fixtures","kind":"test-corpus","version":"3.0.1"},{"digest":"sha256:8db53aa63cfc7565f79e057a4da362d4144c546d56320a51b838befe8371b17d","id":"spdx-3.0.1-model","kind":"test-corpus","version":"a745f63e8643d5ae0f0851fcfa6836085308f80b"},{"digest":"sha256:e611189a0028aa1ac4bbd2ee3f06c664a39c7351c65e942b3f2b53e4ab1e3212","id":"spdx-3.0.1-schema","kind":"schema","version":"3.0.1"},{"digest":"sha256:e2670b02913ab07bef777fe30075892652b2fd8b78ca396d83916368946334a1","id":"spdx-validator","kind":"oracle","version":"ajv-8.20.0+spdx-3.0.1"},{"digest":"sha256:54448d21cb1ed3a4af826aa44991e9839b51d97b8975a5b125927c78af922b46","id":"standards-and-oracles","kind":"oracle","version":"prismpm/standards-lock/1"},{"digest":"sha256:840617fbc4df682f893bdefe4f5320de16aebabc20c84936c8a583765e890ff0","id":"stdlib-sources","kind":"crate","version":"0.2.0-sources"},{"digest":"sha256:5ef0eaaaa4220593add7716aad74da927ca3bb10605e964330de64fecc3ef15e","id":"timeout","kind":"binary","version":"coreutils-9.4"},{"digest":"sha256:1885ce2b3409b4f2b4a569c378d243f4a75e22fc10d59a69a69a1cacc16dda9e","id":"unicode-17.0.0-normalization-corpus","kind":"test-corpus","version":"17.0.0"},{"digest":"sha256:299e79e16e6c76cd6b770c66763f436e5b6a947b4280926b9d3b4e3ec99c885b","id":"workflow-reusable-sdk","kind":"workflow","version":"0.3.0"}],"inventory_digest":"sha256:364a355318e5ba674927d3b01ebd13dfc21fc760ac41a6ddd116b7c4ac738fca","inventory_document":"{\"artifacts\":[{\"digest\":\"sha256:1e88b7e9aa26ad5cd17601aad064de5b07c1251128b5def20f79d24438b5f4be\",\"id\":\"action\",\"kind\":\"workflow\",\"version\":\"0.3.0\"},{\"digest\":\"sha256:5d63cd6921f790c8637e716b632d7777899f37166eff0a6010cd19d1e9127044\",\"id\":\"adapter-compose\",\"kind\":\"adapter\",\"version\":\"compose-spec@fee041b381ffd4aad263410980bdce0cdf4beb7d\"},{\"digest\":\"sha256:db0425b35e875a36af50fb3a73e491af9badc759b6c290a731d6fd23fd62c119\",\"id\":\"adapter-github-pages\",\"kind\":\"adapter\",\"version\":\"github-pages-artifact@v4\"},{\"digest\":\"sha256:59df071a35deca05e62224e43b82d7bc9b5c649f989a3424fd704123633a539e\",\"id\":\"adapter-github-pages-browser\",\"kind\":\"adapter\",\"version\":\"github-pages-artifact@v4\"},{\"digest\":\"sha256:12021a034cb9b796f1ab6b4431e5cdbd9803e16181f6378ce580e40764b62ff6\",\"id\":\"adapter-kubernetes\",\"kind\":\"adapter\",\"version\":\"1.36.4\"},{\"digest\":\"sha256:6bec0a3910568ff84f28b8fd9c2f63e3fcde7986bebf3e24b1f4649c150d735b\",\"id\":\"asyncapi-3.1.0-official-corpus\",\"kind\":\"test-corpus\",\"version\":\"b3fac5bb522771428ea57b16129b273cd3ea0180\"},{\"digest\":\"sha256:87f962245c8ad4fa95a972f8f67ed9804df22ee385197ae403dafae8b375995e\",\"id\":\"asyncapi-embedded-launcher\",\"kind\":\"oracle\",\"version\":\"1\"},{\"digest\":\"sha256:b93c35a475df94fa05d817de7d0a78d569b7c9be932004accdb4dad032bbb729\",\"id\":\"asyncapi-embedded-runtime\",\"kind\":\"oracle\",\"version\":\"@asyncapi/parser/3.6.0\"},{\"digest\":\"sha256:5bd20ce206d3b3b76a7034951c9e19e15291c54eec0a1424139b465c980f1205\",\"id\":\"asyncapi-embedded-runtime-lock\",\"kind\":\"dependency-lock\",\"version\":\"@asyncapi/parser/3.6.0\"},{\"digest\":\"sha256:dbb7252527064804ec138bb391c90b26d08d3db5d47c4995735d56865c3f9882\",\"id\":\"asyncapi-embedded-runtime-tests\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:b10e96e4bda8f1971585e93fe2c6e3872af558d5ae185374fb7500933992ae60\",\"id\":\"asyncapi-oracle\",\"kind\":\"oracle\",\"version\":\"3.1.0\"},{\"digest\":\"sha256:ace18379af8bcc5723f49c7d50e322fadb8bc5c34102cebba2bb4746f1d82b5b\",\"id\":\"asyncapi-website-adeo-schemas\",\"kind\":\"test-corpus\",\"version\":\"20a31a0396b41dd24b1bac877ab7ce3f58037c28\"},{\"digest\":\"sha256:24d82f845768c66d79d87052a265a56e28ad576eb31495a31fdaf716cb6ea43d\",\"id\":\"bootstrap-historical-runner\",\"kind\":\"binary\",\"version\":\"0.2.0-runner/1\"},{\"digest\":\"sha256:70c9420062249ab531d56510a28deae6818e75cdfde52375ae9936376b153a23\",\"id\":\"bootstrap-historical-runtime\",\"kind\":\"binary\",\"version\":\"0.2.0-runner/1\"},{\"digest\":\"sha256:c256110bb391083e2de1c225e904ba860f7b9b34efe9bf36227c607d36ad5085\",\"id\":\"browser-account-genesis-construction\",\"kind\":\"adapter\",\"version\":\"1\"},{\"digest\":\"sha256:1607f069b641cc17df572eaab24fb2ce47288107e8f5a1fc670e94cc9eee3e88\",\"id\":\"browser-host-primitives\",\"kind\":\"adapter\",\"version\":\"1\"},{\"digest\":\"sha256:0e2bcaef56d041a486784e54104a81aebe0da44bd03019bd70bc0401e42e4a97\",\"id\":\"build-base\",\"kind\":\"base-image\",\"version\":\"rust-1.97.1-bookworm\"},{\"digest\":\"sha256:331555b57a45b264327ec4f034c189f64e20956b630a2d6b9053e767bbb53e90\",\"id\":\"chromium-input-authority\",\"kind\":\"dependency-lock\",\"version\":\"157.0.8099.0\"},{\"digest\":\"sha256:ae6f7357f1eea754f07f555dd263d30f2d30ca8cf5440b2494c14facf34743af\",\"id\":\"chromium-input-installer\",\"kind\":\"oracle\",\"version\":\"1\"},{\"digest\":\"sha256:48aa53d280e5e78275acfff62ae0173ac06fc86af86c379cad693e05e74a7803\",\"id\":\"cloudevents-1.0.2-fixtures\",\"kind\":\"test-corpus\",\"version\":\"1.0.2\"},{\"digest\":\"sha256:9ad865a01c7ccb541255a2f89a2dbb34093c6ae3f57ce9e637eabf9edb146da0\",\"id\":\"cloudevents-sdk-conformance\",\"kind\":\"oracle\",\"version\":\"2.16.2\"},{\"digest\":\"sha256:38480c5a48f73d20b8aa0db8366e22ae4ab34c245a370a11b8862cfbdeb5c6d1\",\"id\":\"cloudevents-sdk-go-corpus\",\"kind\":\"test-corpus\",\"version\":\"2.16.2\"},{\"digest\":\"sha256:0f25ac26370a32f0d61fb50fc25e9c6ac5357680306e8c6e60f8dddad4f54eae\",\"id\":\"cloudevents-validator\",\"kind\":\"oracle\",\"version\":\"sdk-go/2.16.2\"},{\"digest\":\"sha256:cd65e860cbad537bf76598f8e910e9cb027f7c90b1f09252141837df0240d4af\",\"id\":\"conformance-corpus\",\"kind\":\"test-corpus\",\"version\":\"prismpm/ids/1\"},{\"digest\":\"sha256:d16d2c85ab2024a98c62f0d8c9fc195f5177ee65e9d6598ac84ecc6e3ede4fed\",\"id\":\"contracts\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:696bc104bac3bb708eff1af3f8bbc09fda0fd88f5757c1f9b404a35117889224\",\"id\":\"docker-buildx\",\"kind\":\"binary\",\"version\":\"0.28.0\"},{\"digest\":\"sha256:cf122ae443d3fcad8b90fe30277d3c37e008c60d56c9658a44848bdb6f2078d4\",\"id\":\"git-tag-root-akihirosuda\",\"kind\":\"trust-root\",\"version\":\"github-key-record-5228653\"},{\"digest\":\"sha256:929c5c98f56be683921c84a1ccd542d0d8df3e75657c3711d5557da35267b637\",\"id\":\"git-tag-root-hayden-io\",\"kind\":\"trust-root\",\"version\":\"github-key-record-682831\"},{\"digest\":\"sha256:c0f83ab885c007561550bda8d540e620b2ac4e36af0a4b48cd320854a3cf2ea4\",\"id\":\"git-tag-root-songy23\",\"kind\":\"trust-root\",\"version\":\"github-key-record-276780\"},{\"digest\":\"sha256:e33e1416f08d6ee24f1c66f3895be7d919ff58c0d4318f2934ec4743f75f0a7e\",\"id\":\"git-tag-root-sudo-bmitch\",\"kind\":\"trust-root\",\"version\":\"github-key-record-2155637\"},{\"digest\":\"sha256:6cbad548e30d2e227d1cea0ee23bb09c06c506c27094ccd8f55137d0bef17371\",\"id\":\"in-toto-attestation-1.0-source\",\"kind\":\"test-corpus\",\"version\":\"ee16c68a11dfcfbdc891600cacd767896fe6e724\"},{\"digest\":\"sha256:591f463460916feef9ac066f38654ab6be819dccc66738088d7b264ae2e44d79\",\"id\":\"intoto-statement-validator\",\"kind\":\"oracle\",\"version\":\"1.0@ee16c68a\"},{\"digest\":\"sha256:8f63dc2d12ed947bfa4ae4cabab2d5926ecc06d86d054b6a3a4f3454446b5551\",\"id\":\"json-schema-2020-12-corpus\",\"kind\":\"test-corpus\",\"version\":\"c9510e3bf8a896c3cba4e08509cf752b4f30dff8\"},{\"digest\":\"sha256:e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550\",\"id\":\"lean\",\"kind\":\"binary\",\"version\":\"4.32.1\"},{\"digest\":\"sha256:29270825b581f950b3914509b7a0613f34964f003eb3c61772636d0805b09148\",\"id\":\"lean4-prod\",\"kind\":\"crate\",\"version\":\"991956fe427bb646498fd0912c89b71be71e7beb\"},{\"digest\":\"sha256:b0081437c68a576ea0b19805568e8ac8c418cf5b7b366d7881b02f38dbaf77ed\",\"id\":\"lean4-prod-exporter\",\"kind\":\"binary\",\"version\":\"991956fe427bb646498fd0912c89b71be71e7beb\"},{\"digest\":\"sha256:5ad69a24139104bd268a70b2124384a9266903550fe6909804abb6c8c32b9431\",\"id\":\"lean4-prod-exporter-seed\",\"kind\":\"dependency-lock\",\"version\":\"1\"},{\"digest\":\"sha256:c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f\",\"id\":\"leanchecker\",\"kind\":\"binary\",\"version\":\"4.32.1\"},{\"digest\":\"sha256:e4168b533d3369e7e0e2ed7cdb331f8dd94e3aa20362d55ded086a24ca3b16f8\",\"id\":\"lexlean\",\"kind\":\"binary\",\"version\":\"0.3.0\"},{\"digest\":\"sha256:c3b22a1cef1975004c948e04005f02c013c02f9698c04da07998e9e13e875acc\",\"id\":\"oci-distribution-1.1.1-corpus\",\"kind\":\"test-corpus\",\"version\":\"a139cc423184af6078077b9b7ee336eddbd03f8f\"},{\"digest\":\"sha256:7b0e39ab2f616c7b33a7ffc57331b90a27ea4cc23ffbc1526c3dee80187332b2\",\"id\":\"oci-distribution-conformance\",\"kind\":\"oracle\",\"version\":\"1.1.1@a139cc42\"},{\"digest\":\"sha256:6c00d78efd45b6a3acc798497851b21585867042cbdc63dbe0c105825b8dac91\",\"id\":\"oci-image-1.1.1-corpus\",\"kind\":\"test-corpus\",\"version\":\"147f9c13cedb47a0c4d9a11a222961073d585877\"},{\"digest\":\"sha256:87e0a99983e0bf9af63d5ac49cd7c1df476231f1de947d0e1c7e7b51b57cc0fd\",\"id\":\"oci-image-schema-conformance\",\"kind\":\"oracle\",\"version\":\"1.1.1@147f9c13\"},{\"digest\":\"sha256:9bf0da1272040438e13ce349a39a1dd036c3432f82e2cec5b17d2aa7db316e8a\",\"id\":\"oci-runtime-1.3.0-corpus\",\"kind\":\"test-corpus\",\"version\":\"92249139eea7161e13745abd4cb6d0ea02a3227a\"},{\"digest\":\"sha256:65bd7332ae65e906405bb3b4e1dfcbfa7c9e25dcc3ceeff5a7331a1b942be26e\",\"id\":\"oci-runtime-validate\",\"kind\":\"oracle\",\"version\":\"1.3.0@92249139\"},{\"digest\":\"sha256:7ee100439bc7dc35cda162b85be68140338bdae5aa3c2fb79412cca621bdd9b1\",\"id\":\"openid-conformance\",\"kind\":\"oracle\",\"version\":\"3e09b13b896f\"},{\"digest\":\"sha256:a35012f67dccd4296ab0e380eb86a0e053dbbf6bf52522aca3ed961c83812197\",\"id\":\"openid-conformance-suite-corpus\",\"kind\":\"test-corpus\",\"version\":\"3e09b13b896fce95d78c2c0f931feee9614e9452\"},{\"digest\":\"sha256:90cdf6a86d9f2f7c9b60f66c9be7c296b394dfef57ac5e28d78965565252f223\",\"id\":\"opentelemetry-0.136.0-signal-corpus\",\"kind\":\"test-corpus\",\"version\":\"0.136.0\"},{\"digest\":\"sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e\",\"id\":\"playwright-chromium\",\"kind\":\"oracle\",\"version\":\"1.62.1\"},{\"digest\":\"sha256:8d81de4103b7e342d0f997526d84fb334bf92b562f1035bc66da8b77a0b02ab7\",\"id\":\"playwright-core\",\"kind\":\"oracle\",\"version\":\"1.62.1\"},{\"digest\":\"sha256:bf3497a2d26912da443d74ef55c0d8155e00a781e3e6c966368d8bd2c8380b5c\",\"id\":\"playwright-driver\",\"kind\":\"oracle\",\"version\":\"1.62.1\"},{\"digest\":\"sha256:18c79a8a6f785debf08393ce22f57cf5923d996c431c5c55610e5a20109905b7\",\"id\":\"playwright-headless-shell\",\"kind\":\"oracle\",\"version\":\"157.0.8099.0\"},{\"digest\":\"sha256:58f398f5453e170e19842360ac1bb3ceda2ea032306527bbeb3adf6650b52bca\",\"id\":\"prism-stdlib\",\"kind\":\"crate\",\"version\":\"0.2.0\"},{\"digest\":\"sha256:ddd53c416a956ede2d84dedace1af7ad9a12ef1eac0e9220a4a5b3e6de897aa8\",\"id\":\"prismpm\",\"kind\":\"binary\",\"version\":\"0.3.0\"},{\"digest\":\"sha256:65270010ca442abafa1ae5ccaa1e00777814d08748e0ffb4565070c43b52e2e9\",\"id\":\"prismpm-conformance\",\"kind\":\"binary\",\"version\":\"0.3.0\"},{\"digest\":\"sha256:a3be795af76d3a0d95253ce652828b3d161e6aae0f147996328dd333a9aba531\",\"id\":\"prismpm-platform-equivalence\",\"kind\":\"binary\",\"version\":\"0.3.0\"},{\"digest\":\"sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e\",\"id\":\"runtime-base\",\"kind\":\"base-image\",\"version\":\"playwright-v1.62.1-noble\"},{\"digest\":\"sha256:22cb82bbc6142c670dfc2b21b225d01edcd036c4e870ef4b668c9e3efa8bb6f1\",\"id\":\"runtime-os-lock\",\"kind\":\"dependency-lock\",\"version\":\"ubuntu-noble@20260901T000000Z\"},{\"digest\":\"sha256:2fa9d3ee26c523899ae5314861306daff716320095cd638f1cd54fbff44cd208\",\"id\":\"sdk-exporter-seed-producer\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:18d8f8d10061d2e4d4ee627cd051481cb79ea366300d191a0e7f81ac8f87f182\",\"id\":\"sdk-image-input-authorities\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:7f441845b1a471b97b9756b7cbe3f48c6e1997be9acd36cece415111c8453d79\",\"id\":\"sdk-image-input-verifier\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:d025c5be578b5d2b334c02917cefa3ff60a1fd8b21de7d06348a300ec1b8a072\",\"id\":\"sdk-metadata-capture\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:d84af5d749355ea4dd97519ee1a7710cc43d8f307d1b8c43cdf93f3e51c24db1\",\"id\":\"sdk-metadata-cli\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:fb287316d82f21b36386f3a6532af61d4205cee18b74f4c3db2737a90113037d\",\"id\":\"sdk-metadata-credentials\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:6945bb2808808d2ca6ed237dadfe5749989a0f9c94579ab64280f3e84592cbdf\",\"id\":\"sdk-metadata-helper\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:3f860b40d5ad29751a592d50f1dc703cdef04a0f0929bcefd90cc844ccc58d43\",\"id\":\"sdk-metadata-helper-supervisor\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:52951e1caf9eb692436f83c5c5dc0f23ec0a864926140ee3db1e217d823707d5\",\"id\":\"sdk-metadata-layer\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:ab7c2ce88b40760294514ca846cda0671a8709438c8361f0a18fa1ffa4030732\",\"id\":\"sdk-metadata-transport\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:870ece6967ce85585dd1935f742ef05d8a4a4111d54ea30b541a43857b43533b\",\"id\":\"sdk-platform-lock\",\"kind\":\"schema\",\"version\":\"2\"},{\"digest\":\"sha256:6e0162633a2d8b8ec973c6fb15e1d48e55f92c5889b90961a3a1b17937aa3e97\",\"id\":\"sdk-vv-advisory\",\"kind\":\"test-corpus\",\"version\":\"d5c17953a895cf19e8d3ce66eaa42b6fcfe1fb16\"},{\"digest\":\"sha256:f3dd999f5618db154fa06222a06f9de95d86e1dbf683954426ea91c974cbe24c\",\"id\":\"sdk-vv-bootstrap\",\"kind\":\"test-corpus\",\"version\":\"0.2.0\"},{\"digest\":\"sha256:f66e5cd2482cf80b5b529b7688b14602753cb8654707a0762c0a49f333d71091\",\"id\":\"sdk-vv-manifest\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:96c3af78e543b0d02d8972816daee3b58ef421e667cb41d4ea7b421653aa73a9\",\"id\":\"sdk-vv-policy\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:ecac1c34797bad411cf8a5b9bfe9a1d3c58d33d6c4ec0b25e21be89a92156840\",\"id\":\"sdk-vv-source\",\"kind\":\"test-corpus\",\"version\":\"35e9f01d5415ed4b0b64c152238f291546957ec4\"},{\"digest\":\"sha256:d9028fd7692fae3a56dd29848c629ea564e67bbf3f6804f557f6b153a1ceb35c\",\"id\":\"sdk-vv-verifier\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:844a1c6de3986c9f02070266b25e0d1a2fa99ceccc89f6b9ad90aae47b62a16e\",\"id\":\"sigstore-trusted-root\",\"kind\":\"trust-root\",\"version\":\"cosign-3.1.3-default-services\"},{\"digest\":\"sha256:2fa271a49fd04807437003e3a2e8d7d39c3b635b4815a72d1ec2f5f216adaaea\",\"id\":\"spdx-3.0.1-fixtures\",\"kind\":\"test-corpus\",\"version\":\"3.0.1\"},{\"digest\":\"sha256:8db53aa63cfc7565f79e057a4da362d4144c546d56320a51b838befe8371b17d\",\"id\":\"spdx-3.0.1-model\",\"kind\":\"test-corpus\",\"version\":\"a745f63e8643d5ae0f0851fcfa6836085308f80b\"},{\"digest\":\"sha256:e611189a0028aa1ac4bbd2ee3f06c664a39c7351c65e942b3f2b53e4ab1e3212\",\"id\":\"spdx-3.0.1-schema\",\"kind\":\"schema\",\"version\":\"3.0.1\"},{\"digest\":\"sha256:e2670b02913ab07bef777fe30075892652b2fd8b78ca396d83916368946334a1\",\"id\":\"spdx-validator\",\"kind\":\"oracle\",\"version\":\"ajv-8.20.0+spdx-3.0.1\"},{\"digest\":\"sha256:54448d21cb1ed3a4af826aa44991e9839b51d97b8975a5b125927c78af922b46\",\"id\":\"standards-and-oracles\",\"kind\":\"oracle\",\"version\":\"prismpm/standards-lock/1\"},{\"digest\":\"sha256:840617fbc4df682f893bdefe4f5320de16aebabc20c84936c8a583765e890ff0\",\"id\":\"stdlib-sources\",\"kind\":\"crate\",\"version\":\"0.2.0-sources\"},{\"digest\":\"sha256:5ef0eaaaa4220593add7716aad74da927ca3bb10605e964330de64fecc3ef15e\",\"id\":\"timeout\",\"kind\":\"binary\",\"version\":\"coreutils-9.4\"},{\"digest\":\"sha256:1885ce2b3409b4f2b4a569c378d243f4a75e22fc10d59a69a69a1cacc16dda9e\",\"id\":\"unicode-17.0.0-normalization-corpus\",\"kind\":\"test-corpus\",\"version\":\"17.0.0\"},{\"digest\":\"sha256:299e79e16e6c76cd6b770c66763f436e5b6a947b4280926b9d3b4e3ec99c885b\",\"id\":\"workflow-reusable-sdk\",\"kind\":\"workflow\",\"version\":\"0.3.0\"}],\"commands\":[{\"command\":\"Xvfb\",\"executable\":\"/usr/bin/Xvfb\",\"sha256\":\"2c7f5a9534410fed5092d782a69ca7ffd9fce80e98b81ffe4944d703dd11d3b1\"},{\"command\":\"[\",\"executable\":\"/usr/bin/[\",\"sha256\":\"a948a5e4bc398b4fafbc838808fa83d423773e19e56293d2bb96cf495b794e98\"},{\"command\":\"addpart\",\"executable\":\"/usr/bin/addpart\",\"sha256\":\"275dd8e7d91cb29f98ed937f30b595b79d199b371142277ea541a2c5d0d91dda\"},{\"command\":\"addr2line\",\"executable\":\"/usr/bin/x86_64-linux-gnu-addr2line\",\"sha256\":\"a116f9e176f9f1ef6e2ab31ad41bacb9d2571b479725ebdfe10fb9cb70aa9e53\"},{\"command\":\"apt\",\"executable\":\"/usr/bin/apt\",\"sha256\":\"0dba8843674864cea269a468b723a38ce0a830790e339b84bdc2b57e05aa558a\"},{\"command\":\"apt-cache\",\"executable\":\"/usr/bin/apt-cache\",\"sha256\":\"7b9f8a0a1c6d6e547df46b8401b5fa521d324d959dc29f84927910af64a9401f\"},{\"command\":\"apt-cdrom\",\"executable\":\"/usr/bin/apt-cdrom\",\"sha256\":\"48d7074944bcf1ea85093f14dc21811b57071049a3185cc1fde7de22da3e1c6b\"},{\"command\":\"apt-config\",\"executable\":\"/usr/bin/apt-config\",\"sha256\":\"44ec8b9197670a2c12ed2c6b837dd623c23b641e8c491be03ccefc23dd0fba8c\"},{\"command\":\"apt-get\",\"executable\":\"/usr/bin/apt-get\",\"sha256\":\"eb53b3b66cbb7a90a370e26439e941b7cf146ddd91a5422063c761ce9e59c53b\"},{\"command\":\"apt-key\",\"executable\":\"/usr/bin/apt-key\",\"sha256\":\"45ec8c948cb0f17b38f27b4d8235596b17ece3b7eea5afcbb3be8b1ee5a98c77\"},{\"command\":\"apt-mark\",\"executable\":\"/usr/bin/apt-mark\",\"sha256\":\"6a31af1ed4932f7cb34e64bc6c9ab67b566db96dd478be0eaf96402666687635\"},{\"command\":\"ar\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ar\",\"sha256\":\"6452af2eea333b8c65e1adb92964fc8f97863ab003fa13f9d12bff5345cd7dbe\"},{\"command\":\"arch\",\"executable\":\"/usr/bin/arch\",\"sha256\":\"25dbcfcd41750e6d5f25d95f80bf96d99a68482ef2b9c2d6cd49db4498f37c06\"},{\"command\":\"as\",\"executable\":\"/usr/bin/x86_64-linux-gnu-as\",\"sha256\":\"21aff249b692b5c31a44007491f922dcb49f41323e362c57d2ada3f52eddb7f0\"},{\"command\":\"asyncapi-official\",\"executable\":\"/opt/prismpm/asyncapi-official/scripts/launcher.sh\",\"sha256\":\"b06adb1cd61f9258e2b351314ffbd6cae1ed608a3623da201ac2879676bb302e\"},{\"command\":\"asyncapi-parser\",\"executable\":\"/opt/prismpm/oracles/asyncapi-parser.mjs\",\"sha256\":\"849b552ffa8ef7330511173b4fbd03d77f01ef0e7115abf64394d9160add5caf\"},{\"command\":\"awk\",\"executable\":\"/usr/bin/mawk\",\"sha256\":\"3850bf893d3f4f8ec462c8b59d6d66fdbbe8ddc0715b3d404d9cc574526b781c\"},{\"command\":\"b2sum\",\"executable\":\"/usr/bin/b2sum\",\"sha256\":\"be535356d5b4c4836ae7534dcc608b3e05e9b795ea68ec488d0c89756e2f6797\"},{\"command\":\"base32\",\"executable\":\"/usr/bin/base32\",\"sha256\":\"2328ebe76bd82a370e03ec5a93d3f4d4e7430fe360e36822b05514976ee90361\"},{\"command\":\"base64\",\"executable\":\"/usr/bin/base64\",\"sha256\":\"69eade6cb3d3ec13888c7e4488e2cb697c10669debc5a9bf382b002af3b8139b\"},{\"command\":\"basename\",\"executable\":\"/usr/bin/basename\",\"sha256\":\"4beb496d2c0c39359f01d7e727084a3565237f3c3f5aeeaf06ab585329c0301b\"},{\"command\":\"basenc\",\"executable\":\"/usr/bin/basenc\",\"sha256\":\"21eb33c77c3f70c10fe8077d8a3f91c8c27d27b0048064ea5fe14a25c34a395c\"},{\"command\":\"bash\",\"executable\":\"/usr/bin/bash\",\"sha256\":\"bc5945feb8bd26203ebfafea5ce1878bb2e32cb8fb50ab7ae395cfb1e1aaaef1\"},{\"command\":\"bashbug\",\"executable\":\"/usr/bin/bashbug\",\"sha256\":\"7f635f2983aca8538deaa2f4b08696a1ad89c628772d9e6efb13faad0daaf595\"},{\"command\":\"bdftopcf\",\"executable\":\"/usr/bin/bdftopcf\",\"sha256\":\"9b02f426e29766dea622610627e6926c4b9d1e7c7bd61ad42e65c60036d7f662\"},{\"command\":\"bdftruncate\",\"executable\":\"/usr/bin/bdftruncate\",\"sha256\":\"08fd94166783aa49dc652d104c3e0c2f8972d12b785b2f261cc74afe764524fa\"},{\"command\":\"bunzip2\",\"executable\":\"/usr/bin/bunzip2\",\"sha256\":\"909769e6f36ab54e52f1099d59aec0e8d2f27b8c53f95c63429f5c571e027ada\"},{\"command\":\"busctl\",\"executable\":\"/usr/bin/busctl\",\"sha256\":\"3389e7f9c5db49f3cad2bb04a6f2b84f5fe091eb901cfbf56f3113f8afa72990\"},{\"command\":\"bzcat\",\"executable\":\"/usr/bin/bzcat\",\"sha256\":\"909769e6f36ab54e52f1099d59aec0e8d2f27b8c53f95c63429f5c571e027ada\"},{\"command\":\"bzcmp\",\"executable\":\"/usr/bin/bzdiff\",\"sha256\":\"d115316919735ea43b057063dad2609b05051a11f3819291a403ecceb55ba102\"},{\"command\":\"bzdiff\",\"executable\":\"/usr/bin/bzdiff\",\"sha256\":\"d115316919735ea43b057063dad2609b05051a11f3819291a403ecceb55ba102\"},{\"command\":\"bzegrep\",\"executable\":\"/usr/bin/bzgrep\",\"sha256\":\"3300749d903f145a8815c07fa1389dba04268fee1fec97ca1f01abf07ac5ee04\"},{\"command\":\"bzexe\",\"executable\":\"/usr/bin/bzexe\",\"sha256\":\"bd3ab362765b5313aef3bdd1845ef4743f33ce98ab970b045d872a2cb4536951\"},{\"command\":\"bzfgrep\",\"executable\":\"/usr/bin/bzgrep\",\"sha256\":\"3300749d903f145a8815c07fa1389dba04268fee1fec97ca1f01abf07ac5ee04\"},{\"command\":\"bzgrep\",\"executable\":\"/usr/bin/bzgrep\",\"sha256\":\"3300749d903f145a8815c07fa1389dba04268fee1fec97ca1f01abf07ac5ee04\"},{\"command\":\"bzip2\",\"executable\":\"/usr/bin/bzip2\",\"sha256\":\"909769e6f36ab54e52f1099d59aec0e8d2f27b8c53f95c63429f5c571e027ada\"},{\"command\":\"bzip2recover\",\"executable\":\"/usr/bin/bzip2recover\",\"sha256\":\"318476def50121abdc3c2a1092cd7c706660ecb9e15df180d47aa0d23bae45f1\"},{\"command\":\"bzless\",\"executable\":\"/usr/bin/bzmore\",\"sha256\":\"0e7ca63849eebc9ea476ea1fefab05e60b0ac8066f73c7d58e8ff607c941f212\"},{\"command\":\"bzmore\",\"executable\":\"/usr/bin/bzmore\",\"sha256\":\"0e7ca63849eebc9ea476ea1fefab05e60b0ac8066f73c7d58e8ff607c941f212\"},{\"command\":\"c++\",\"executable\":\"/usr/bin/x86_64-linux-gnu-g++-13\",\"sha256\":\"1353e9bdd29a7295c7226bf6c63abccce056d8cac31f112e5cdbecc3f28c2769\"},{\"command\":\"c++filt\",\"executable\":\"/usr/bin/x86_64-linux-gnu-c++filt\",\"sha256\":\"2c11b66c0fad24afc649517f890eaa8a6a4d4dceb1d613c5631bb96ff09352b4\"},{\"command\":\"c89\",\"executable\":\"/usr/bin/c89-gcc\",\"sha256\":\"999b40b67f690638f601d76b756d529dd40a4325f42dfd9fd2e629ad0a91947c\"},{\"command\":\"c89-gcc\",\"executable\":\"/usr/bin/c89-gcc\",\"sha256\":\"999b40b67f690638f601d76b756d529dd40a4325f42dfd9fd2e629ad0a91947c\"},{\"command\":\"c99\",\"executable\":\"/usr/bin/c99-gcc\",\"sha256\":\"5d3a3621b0f1272264a4d37e379300f2495aabef997eb12c2f8b48cf16d01366\"},{\"command\":\"c99-gcc\",\"executable\":\"/usr/bin/c99-gcc\",\"sha256\":\"5d3a3621b0f1272264a4d37e379300f2495aabef997eb12c2f8b48cf16d01366\"},{\"command\":\"c_rehash\",\"executable\":\"/usr/bin/c_rehash\",\"sha256\":\"e500ac3e4b1a18d117bd1c4b47f3e4f96584040b6ea4a484398fff7ddc3a7d12\"},{\"command\":\"captoinfo\",\"executable\":\"/usr/bin/tic\",\"sha256\":\"21bfaf468804f70b5f21d21d9a5e2bc9194427c5f63217c5dda4033e2c947b65\"},{\"command\":\"cargo\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"cargo-clippy\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"cargo-deny\",\"executable\":\"/usr/local/bin/cargo-deny\",\"sha256\":\"b329e25933d01c36dd7c47d84ea5716694f9b7caf53a5003d45674703a8ed54a\"},{\"command\":\"cargo-fmt\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"cargo-local-registry\",\"executable\":\"/usr/local/cargo/bin/cargo-local-registry\",\"sha256\":\"c659d390a43b9efc96bbc0da173d4245885f2046910c6ec3fa05b28c491c9662\"},{\"command\":\"cargo-miri\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"cat\",\"executable\":\"/usr/bin/cat\",\"sha256\":\"a63158e6e5bce20616425f5d61e5bd7374bb5bccf15bbb93ae2e40238248f179\"},{\"command\":\"cc\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-13\",\"sha256\":\"1b99826121ae6682a634e5efe09bd3e3df58ce58e0b28f849114ab5b89139c26\"},{\"command\":\"chage\",\"executable\":\"/usr/bin/chage\",\"sha256\":\"446bfaec4a2fbea1efc1144b71a2d2e905ee882caeae774202e9405ea9d7e3f7\"},{\"command\":\"chattr\",\"executable\":\"/usr/bin/chattr\",\"sha256\":\"b99f7278f6407a7a1119e344d2f4b6e4fb852c94181fd3b32ff6987c1db5e419\"},{\"command\":\"chcon\",\"executable\":\"/usr/bin/chcon\",\"sha256\":\"d149c337b2680d613be31603a674aa7d0db8265685946592cb7e70ec342e67a4\"},{\"command\":\"chfn\",\"executable\":\"/usr/bin/chfn\",\"sha256\":\"9d8e1c2f1c89f808206c65982fa058369de1af7be19ee325a2f3e95c48ab8052\"},{\"command\":\"chgrp\",\"executable\":\"/usr/bin/chgrp\",\"sha256\":\"65a307e4ba73f52b0775edb621072ee6f89d2ac40d4a0426547bab5aefd6626c\"},{\"command\":\"chmod\",\"executable\":\"/usr/bin/chmod\",\"sha256\":\"f7ba478ce7ff158ccd3ba01bac1c4231e68cbd490fe49b5562a6ea008a586696\"},{\"command\":\"choom\",\"executable\":\"/usr/bin/choom\",\"sha256\":\"3edf84555f818eca49a156babab2e969c0db76e866040c1ec715c9b22a432e0a\"},{\"command\":\"chown\",\"executable\":\"/usr/bin/chown\",\"sha256\":\"ec9a5923a49c9ea288cf5e5becddd9620232df940bd0b327528c4a9077b1aa9e\"},{\"command\":\"chrt\",\"executable\":\"/usr/bin/chrt\",\"sha256\":\"55eda4595995282487dd07a46eaa2b2d6bb83635baafcd1f06b1cdcecd351df0\"},{\"command\":\"chsh\",\"executable\":\"/usr/bin/chsh\",\"sha256\":\"d7aad828e159b1d570f643d2cbe44d551a5b9bc9b2870dab3fd5cbc5260e749d\"},{\"command\":\"cksum\",\"executable\":\"/usr/bin/cksum\",\"sha256\":\"8dfcb10877857084ff3571628066fce63d623de6960fac6ff3d39a04a679771a\"},{\"command\":\"clear\",\"executable\":\"/usr/bin/clear\",\"sha256\":\"4c6abc6a518b5b55188c06790bcb0be202ce8b57b23cfa688ea31b35a245d1ef\"},{\"command\":\"clear_console\",\"executable\":\"/usr/bin/clear_console\",\"sha256\":\"2c38afcdb060815f175ddab8049d6472be3e863da1489fca22025120aebc69a3\"},{\"command\":\"clippy-driver\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"cloudevents-sdk-conformance\",\"executable\":\"/usr/local/bin/cloudevents-sdk-conformance\",\"sha256\":\"9ad865a01c7ccb541255a2f89a2dbb34093c6ae3f57ce9e637eabf9edb146da0\"},{\"command\":\"cloudevents-validator\",\"executable\":\"/usr/local/bin/cloudevents-validator\",\"sha256\":\"0f25ac26370a32f0d61fb50fc25e9c6ac5357680306e8c6e60f8dddad4f54eae\"},{\"command\":\"cmp\",\"executable\":\"/usr/bin/cmp\",\"sha256\":\"e10750ef3db9bd3595d3cbb1e25bcfd6a964dc6aa0ba9561034067913ee1cc04\"},{\"command\":\"comm\",\"executable\":\"/usr/bin/comm\",\"sha256\":\"6964ffc36dc67a844661650a219d8479ad9d96b2947395a1f69ac32ec299a6d8\"},{\"command\":\"corelist\",\"executable\":\"/usr/bin/corelist\",\"sha256\":\"667bc0d6d8de3048ec84678355647805a9e1ecfc53169a780edbc49b5a0da7b5\"},{\"command\":\"corepack\",\"executable\":\"/usr/local/lib/node_modules/corepack/dist/corepack.js\",\"sha256\":\"3655bc798f300951f2070fee411b337d626b0c3ae80c2d24c46ccac4595d4bf9\"},{\"command\":\"cosign\",\"executable\":\"/usr/local/bin/cosign\",\"sha256\":\"4629c757b7618056f8ddd7e2625ae9fdd94c0372a65049520bc7d9df9efc7f71\"},{\"command\":\"cp\",\"executable\":\"/usr/bin/cp\",\"sha256\":\"6187dab32cd7b6291d96c54425a22915a6eeb39add6d95ee9008e1dbba427131\"},{\"command\":\"cpan\",\"executable\":\"/usr/bin/cpan\",\"sha256\":\"d4fba91c6370b8ef2c77850205d6e7eab6d8aeebd57993793fad9eff7720ea5e\"},{\"command\":\"cpan5.38-x86_64-linux-gnu\",\"executable\":\"/usr/bin/cpan5.38-x86_64-linux-gnu\",\"sha256\":\"5787995e7fce5d56543cc892a17f9f372849faa45dbb876ff4f2479d154b9c24\"},{\"command\":\"cpp\",\"executable\":\"/usr/bin/x86_64-linux-gnu-cpp-13\",\"sha256\":\"c48f8b1b5ab757134970d17bc2ecd889df0d1245463036e834ab9be9d5e40765\"},{\"command\":\"cpp-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-cpp-13\",\"sha256\":\"c48f8b1b5ab757134970d17bc2ecd889df0d1245463036e834ab9be9d5e40765\"},{\"command\":\"csplit\",\"executable\":\"/usr/bin/csplit\",\"sha256\":\"790c0505b6138a6d5df16daafdcbd756ae1a6881c56edeeb54ca204ca03e1307\"},{\"command\":\"curl\",\"executable\":\"/usr/bin/curl\",\"sha256\":\"459c937b69bd76620d6d01100a0793294349c89871f4474d398efdae49fcee09\"},{\"command\":\"cut\",\"executable\":\"/usr/bin/cut\",\"sha256\":\"94d1a3030de44ef8e4c2d157911b6246ae009d4eecaa52a072060c7070011b0e\"},{\"command\":\"dash\",\"executable\":\"/usr/bin/dash\",\"sha256\":\"86d31f6fb799e91fa21bad341484564510ca287703a16e9e46c53338776f4f42\"},{\"command\":\"date\",\"executable\":\"/usr/bin/date\",\"sha256\":\"225cf5c9122f922b8315538425bed7610853c853d6a2d2cfd89161b04f692367\"},{\"command\":\"dbus-cleanup-sockets\",\"executable\":\"/usr/bin/dbus-cleanup-sockets\",\"sha256\":\"405f671cd7a5029bf1c7d93d02a539e2845bfb6e3600fcfde2ecddb2d3c96f51\"},{\"command\":\"dbus-daemon\",\"executable\":\"/usr/bin/dbus-daemon\",\"sha256\":\"8c479f1fcddfd6693c736ce541da0955f6752834bdeeef4b928e27f5e974c247\"},{\"command\":\"dbus-monitor\",\"executable\":\"/usr/bin/dbus-monitor\",\"sha256\":\"04ec6be0688f5182b7d4814e61b37b51d9d0150fe1f5544aab66cfc47fd01142\"},{\"command\":\"dbus-run-session\",\"executable\":\"/usr/bin/dbus-run-session\",\"sha256\":\"72aace7d816ab450f09757034093e08b70cdff8f3cc43e4183dbcf0a845b6678\"},{\"command\":\"dbus-send\",\"executable\":\"/usr/bin/dbus-send\",\"sha256\":\"ae37b272dad147c4f47e55db7595bc2892867fe5f86b11349e9ab6caf71e3ffd\"},{\"command\":\"dbus-update-activation-environment\",\"executable\":\"/usr/bin/dbus-update-activation-environment\",\"sha256\":\"b2ea4143a672525321fbd77b864145320afae3a7eeff639f28027a10cc425bc8\"},{\"command\":\"dbus-uuidgen\",\"executable\":\"/usr/bin/dbus-uuidgen\",\"sha256\":\"abe42d54ae585d9802593a2150840b0ff10894744cc4c9d4ab08a0c40e3f6a03\"},{\"command\":\"dd\",\"executable\":\"/usr/bin/dd\",\"sha256\":\"dd07a1b0f236f221f71fac70103765286d1ccf29b747cbb24345d0c57a0311b6\"},{\"command\":\"deb-systemd-helper\",\"executable\":\"/usr/bin/deb-systemd-helper\",\"sha256\":\"a895d5f077651960b6ca4ed9c53f8b36eae422ae170f61c972d0c6579e9f8732\"},{\"command\":\"deb-systemd-invoke\",\"executable\":\"/usr/bin/deb-systemd-invoke\",\"sha256\":\"92eadae89f4df4cd6088f6316f5390b685faf8d0e312a4e5af3a507caaf81bdb\"},{\"command\":\"debconf\",\"executable\":\"/usr/bin/debconf\",\"sha256\":\"d5beef1820da2445e173c90ba14c535f566db12cd7de0cb3d4385a6aa4bcd8e3\"},{\"command\":\"debconf-apt-progress\",\"executable\":\"/usr/bin/debconf-apt-progress\",\"sha256\":\"ab24031d661b531961bab055a344c97d66ded2718c9a4c48ddbe0392273897e0\"},{\"command\":\"debconf-communicate\",\"executable\":\"/usr/bin/debconf-communicate\",\"sha256\":\"95dd9cc45752692e9288eed9abf9d0bbd22bb78ffe59a78cbfcbe96cffefbba5\"},{\"command\":\"debconf-copydb\",\"executable\":\"/usr/bin/debconf-copydb\",\"sha256\":\"02f27a04a3485f487e654051a4e72a806e9aff40ccf87934f896f59c29fd6db2\"},{\"command\":\"debconf-escape\",\"executable\":\"/usr/bin/debconf-escape\",\"sha256\":\"b1e81e2ac04c2a6c286514f2f410c57b9ac6188ed33ed558722f3bc252e93e87\"},{\"command\":\"debconf-set-selections\",\"executable\":\"/usr/bin/debconf-set-selections\",\"sha256\":\"1f32e8a3daba11364b8f4ca795e1fad83b688f02ab27df8066f5c552d1070f98\"},{\"command\":\"debconf-show\",\"executable\":\"/usr/bin/debconf-show\",\"sha256\":\"314fa1730e1efe15db17307848e7a53e450d0093009b6f1596cd3fe0ffec1b67\"},{\"command\":\"delpart\",\"executable\":\"/usr/bin/delpart\",\"sha256\":\"aae3b215df2a274e9fb04920f8e6b0cb5daa39bef48d7a3aff1ceb08bcdc22fd\"},{\"command\":\"devcontainer\",\"executable\":\"/opt/prismpm/devcontainer-cli/node_modules/@devcontainers/cli/devcontainer.js\",\"sha256\":\"e6df20af860208e00365d7b73f64d3940bad087ea8049de12223d1e7376522e3\"},{\"command\":\"devcontainer-validator\",\"executable\":\"/opt/prismpm/oracles/devcontainer-validator.mjs\",\"sha256\":\"05e99e6a92cf44ee2f91accef71823bd06ee92281db29089e8bb784ab4926b58\"},{\"command\":\"df\",\"executable\":\"/usr/bin/df\",\"sha256\":\"dc4d292126dd6a7a120fd5430132d2d94a305cf44ea7e76978b233f85d0ab52d\"},{\"command\":\"diff\",\"executable\":\"/usr/bin/diff\",\"sha256\":\"4d57f4cdb814475fb6fee307ef007fcb2fbc0f03d73a129356dcec4484b2a1fa\"},{\"command\":\"diff3\",\"executable\":\"/usr/bin/diff3\",\"sha256\":\"4a2ee59a65f7e1dffe16a784ac84610736efad041ca3f83cd9a29c8ae5bf9266\"},{\"command\":\"dir\",\"executable\":\"/usr/bin/dir\",\"sha256\":\"f00eaff8806cb730f51b5e5d847f601745956c5218785484739d56f7942ac115\"},{\"command\":\"dircolors\",\"executable\":\"/usr/bin/dircolors\",\"sha256\":\"9c59818814264282c269f2a0d065467aa88e751543b569101bae448e7897f445\"},{\"command\":\"dirmngr\",\"executable\":\"/usr/bin/dirmngr\",\"sha256\":\"1a1ef7127fa7450f29b8a0b56ef264f62e0ca7f183fcf5eb3cf6bfda01b1d84a\"},{\"command\":\"dirmngr-client\",\"executable\":\"/usr/bin/dirmngr-client\",\"sha256\":\"dfecb31d3331e14998b29399354c132227986bea292d42a5173b4ca94d41b614\"},{\"command\":\"dirname\",\"executable\":\"/usr/bin/dirname\",\"sha256\":\"5ed2ac7b191a3457d47a1c718397b819b04754174176c7cdd3c92faadab08055\"},{\"command\":\"dmesg\",\"executable\":\"/usr/bin/dmesg\",\"sha256\":\"d5fe030552da872ff86a42fb82abd6d9c6e7fba1a5897e1c3a9911bf98b70585\"},{\"command\":\"dnsdomainname\",\"executable\":\"/usr/bin/hostname\",\"sha256\":\"071fec20458397874e6121589d5210e7eed22a1b1afe16c2b9970b8a8233cc5b\"},{\"command\":\"docker\",\"executable\":\"/usr/local/bin/docker\",\"sha256\":\"27f239f97492c434e091a70b41b8796c698f0aa2b6052c6f9c28da4ee7ae888b\"},{\"command\":\"docker-buildx\",\"executable\":\"/usr/local/libexec/docker/cli-plugins/docker-buildx\",\"sha256\":\"696bc104bac3bb708eff1af3f8bbc09fda0fd88f5757c1f9b404a35117889224\"},{\"command\":\"docker-compose\",\"executable\":\"/usr/local/libexec/docker/cli-plugins/docker-compose\",\"sha256\":\"837fd1d35bf6a494f41b5b5988269a7be79de337cf1a1a6ff0e45ab51bb4e9be\"},{\"command\":\"domainname\",\"executable\":\"/usr/bin/hostname\",\"sha256\":\"071fec20458397874e6121589d5210e7eed22a1b1afe16c2b9970b8a8233cc5b\"},{\"command\":\"dpkg\",\"executable\":\"/usr/bin/dpkg\",\"sha256\":\"567180a568ad6af680314fdcb4d963246985e682b28a9e8fafed8b09abbd50af\"},{\"command\":\"dpkg-architecture\",\"executable\":\"/usr/bin/dpkg-architecture\",\"sha256\":\"ce16700da9905ac300963e09e9716004c8c35c780b06d108de8b9c93d6ddbbaf\"},{\"command\":\"dpkg-buildapi\",\"executable\":\"/usr/bin/dpkg-buildapi\",\"sha256\":\"69d8be5bc1d2e8b17fc6096912b07b72bcda3759de2301062c2fa5a0aa9e842d\"},{\"command\":\"dpkg-buildflags\",\"executable\":\"/usr/bin/dpkg-buildflags\",\"sha256\":\"4a363aa71affdea49cf5fc894783f3ff13ed66fcfe75646a82809ca7607e953a\"},{\"command\":\"dpkg-buildpackage\",\"executable\":\"/usr/bin/dpkg-buildpackage\",\"sha256\":\"f1a04680031ada877a331bf744aea7ed1cb32ebac24914c7d0b9f5a0267b0d1d\"},{\"command\":\"dpkg-buildtree\",\"executable\":\"/usr/bin/dpkg-buildtree\",\"sha256\":\"9befe7704c770ee771fa90e6dd80d86b191d5a92ee3623eec4e1cd938275e941\"},{\"command\":\"dpkg-checkbuilddeps\",\"executable\":\"/usr/bin/dpkg-checkbuilddeps\",\"sha256\":\"869d51a380a2f7e438af8f836b20ac0232f1a5b45f156ca51955f130cb2c28fa\"},{\"command\":\"dpkg-deb\",\"executable\":\"/usr/bin/dpkg-deb\",\"sha256\":\"fc9dde782ca8309b65ab92e61d13318bf463cd1aa71daa8967b87b81b48b63d2\"},{\"command\":\"dpkg-distaddfile\",\"executable\":\"/usr/bin/dpkg-distaddfile\",\"sha256\":\"48a66e608a612ee9948c0c0dc34db41b9fd62bc3fd658a7ceb8d362563a90e13\"},{\"command\":\"dpkg-divert\",\"executable\":\"/usr/bin/dpkg-divert\",\"sha256\":\"2895ba92403c074bb1e3025bcb2b3c963eee9e4318a06933c256a0e099d1b178\"},{\"command\":\"dpkg-genbuildinfo\",\"executable\":\"/usr/bin/dpkg-genbuildinfo\",\"sha256\":\"ea892fe9ccde89d43d3ab990a00a098cafc0826251973f2eebb01464aa067cf0\"},{\"command\":\"dpkg-genchanges\",\"executable\":\"/usr/bin/dpkg-genchanges\",\"sha256\":\"4b3688a9e0c011c5ecebf9cdf6a80cc5ffd49ce8a05c4d93e671c73527e4a5cd\"},{\"command\":\"dpkg-gencontrol\",\"executable\":\"/usr/bin/dpkg-gencontrol\",\"sha256\":\"21a07292d7f2b969c1746163044adbce7fd48762dfa1b4619d3300af274d0235\"},{\"command\":\"dpkg-gensymbols\",\"executable\":\"/usr/bin/dpkg-gensymbols\",\"sha256\":\"2a7cbc5ff261e22282da62ff54b293e40c6aeccd1f89faace7f40ac6d443d6b6\"},{\"command\":\"dpkg-maintscript-helper\",\"executable\":\"/usr/bin/dpkg-maintscript-helper\",\"sha256\":\"c1ebe2d1281240872a38dd16dcaea57d48a66978f500eeeca58689ae006ca342\"},{\"command\":\"dpkg-mergechangelogs\",\"executable\":\"/usr/bin/dpkg-mergechangelogs\",\"sha256\":\"72d5bb1f9c93730cf1a67e1d93065b7582a9ef3ff9013d89e07071f47fba13e5\"},{\"command\":\"dpkg-name\",\"executable\":\"/usr/bin/dpkg-name\",\"sha256\":\"35019db2113124b0d3db3b44f02615e3ec2be6f365f9986d913c0596930d62f5\"},{\"command\":\"dpkg-parsechangelog\",\"executable\":\"/usr/bin/dpkg-parsechangelog\",\"sha256\":\"1240425d626ff7b28de7022a09222e6f4b88c66c0d481776eea69006c0e22bd4\"},{\"command\":\"dpkg-query\",\"executable\":\"/usr/bin/dpkg-query\",\"sha256\":\"cc2a19017c37132e4ad46c1fbddea6472262d0a62a0b8585c383706c20005ea1\"},{\"command\":\"dpkg-realpath\",\"executable\":\"/usr/bin/dpkg-realpath\",\"sha256\":\"209be6ae092e387589b11752c165e943f0c8d6e940694025d5cd41df4cb49642\"},{\"command\":\"dpkg-scanpackages\",\"executable\":\"/usr/bin/dpkg-scanpackages\",\"sha256\":\"6f2a4e932d7cc8dc1c3010541297adddd09a96c3460f87b6edbde3203679d848\"},{\"command\":\"dpkg-scansources\",\"executable\":\"/usr/bin/dpkg-scansources\",\"sha256\":\"d91bb4217786e327e16f62185daf9632c8e04f5be8d251d90f00b9945b905006\"},{\"command\":\"dpkg-shlibdeps\",\"executable\":\"/usr/bin/dpkg-shlibdeps\",\"sha256\":\"06d7129cf40b0186dfa961f277e79664970d9f9207ae23ab11f8135aef488b02\"},{\"command\":\"dpkg-source\",\"executable\":\"/usr/bin/dpkg-source\",\"sha256\":\"785b2ef79335db87fef3447181503007171b4dfb8f9cbfc52236e6b84847e634\"},{\"command\":\"dpkg-split\",\"executable\":\"/usr/bin/dpkg-split\",\"sha256\":\"b980def0e688879e50b2f25b0dad46a580ef91ec45e8134375cd2794456c433a\"},{\"command\":\"dpkg-statoverride\",\"executable\":\"/usr/bin/dpkg-statoverride\",\"sha256\":\"8ccbfb7966965707cd63fa5882069748ace02d55893b9f5b9b0117c80d073460\"},{\"command\":\"dpkg-trigger\",\"executable\":\"/usr/bin/dpkg-trigger\",\"sha256\":\"5cb022a70fd507b5f13690956eec46a074c09a1411ce0828067f21cd5b39b8b5\"},{\"command\":\"dpkg-vendor\",\"executable\":\"/usr/bin/dpkg-vendor\",\"sha256\":\"603e32f2d611f57b240005c3faca99eaf8c91c63e191bb76f3d9567acb82bebc\"},{\"command\":\"du\",\"executable\":\"/usr/bin/du\",\"sha256\":\"860235f0294d9c2185140f4ebab8301d5db8357fb195f7b79ad3b94b495763c7\"},{\"command\":\"dwp\",\"executable\":\"/usr/bin/x86_64-linux-gnu-dwp\",\"sha256\":\"b4c1bbd491718b74d93a384297728a8c242c62cd040187adc78355b736548553\"},{\"command\":\"echo\",\"executable\":\"/usr/bin/echo\",\"sha256\":\"a972bc0383f4a66cdfdfd1a3bb885a6b1dd93f46c999d4adc505ab127dc0ddff\"},{\"command\":\"egrep\",\"executable\":\"/usr/bin/egrep\",\"sha256\":\"10caa507f39367738ca977a5f2014406159064b072dbade0c0c23a40597f66da\"},{\"command\":\"elan\",\"executable\":\"/usr/local/elan/bin/elan\",\"sha256\":\"840179e70803ef373c2ec53342d6a45ea7d022533e4145489fc1278b4f716385\"},{\"command\":\"elfedit\",\"executable\":\"/usr/bin/x86_64-linux-gnu-elfedit\",\"sha256\":\"c246c9722b60da558f104f8c517c760401bf995c9d4916954c0055a45e8bdb03\"},{\"command\":\"enc2xs\",\"executable\":\"/usr/bin/enc2xs\",\"sha256\":\"9005200ebb19c0328ac671d9a9f72702dd7c3015112878565ffd30f1671bff5d\"},{\"command\":\"encguess\",\"executable\":\"/usr/bin/encguess\",\"sha256\":\"f616952ea1c19fd8159c5a4d25cae587bed2c5cfd45df2b238da88cf7595dc21\"},{\"command\":\"env\",\"executable\":\"/usr/bin/env\",\"sha256\":\"0aefff8f912fb75716c5d4de3b6acde93edbe8fa280fc8ee895c1226d3e373ef\"},{\"command\":\"expand\",\"executable\":\"/usr/bin/expand\",\"sha256\":\"590811afeafed6e2259931195488a13cdcc200ae9abaa3f20da654802ed901da\"},{\"command\":\"expiry\",\"executable\":\"/usr/bin/expiry\",\"sha256\":\"3b60060b2eb7d44ebbab429063e8250ceaf540bf3af36d5ad02c1ba12ca203e2\"},{\"command\":\"expr\",\"executable\":\"/usr/bin/expr\",\"sha256\":\"a20cc40a1cee2970ceabe24586aa3105b494c2a3fec7a91ffc639761020794f4\"},{\"command\":\"factor\",\"executable\":\"/usr/bin/factor\",\"sha256\":\"856738579d66f758f4c9f1c5e3bb2aa4a75be4bbd6866835600ebb33109a744f\"},{\"command\":\"faillog\",\"executable\":\"/usr/bin/faillog\",\"sha256\":\"52277173f0f308a2c63fabfa3f826c6ee1acddac032a5c5c87fcf22b7d6e757e\"},{\"command\":\"fallocate\",\"executable\":\"/usr/bin/fallocate\",\"sha256\":\"ccd7a867766e25f931d6e5cf07a8fd0fb0c9d4baa03c4af4be44f3b41756757a\"},{\"command\":\"false\",\"executable\":\"/usr/bin/false\",\"sha256\":\"68d5dd3517b8fb324b5fbdc365add3c821380e173a951f6632d4b2d6ecb04fd4\"},{\"command\":\"fc-cache\",\"executable\":\"/usr/bin/fc-cache\",\"sha256\":\"39b1208fc5ca3c1adcfb117a2a9052632ce9043bf2ad248bacd3a32cfed9d990\"},{\"command\":\"fc-cat\",\"executable\":\"/usr/bin/fc-cat\",\"sha256\":\"b2e9f6529aa8c37ecd0e0c26b17848a8262840ef9de2dff9da63f3c63ee4ea68\"},{\"command\":\"fc-conflist\",\"executable\":\"/usr/bin/fc-conflist\",\"sha256\":\"367ca2605b0e72750ceb22cdce7fcb4664357ac9f4b97d91000bb93b13b172ab\"},{\"command\":\"fc-list\",\"executable\":\"/usr/bin/fc-list\",\"sha256\":\"6ba4c9975e6c4a933627e223b15eb99a6f88b958ea38b33427b0ace1f8ac06a7\"},{\"command\":\"fc-match\",\"executable\":\"/usr/bin/fc-match\",\"sha256\":\"2e0846b0186dedaa7a626267093d668e24f2d7846a877f316de5c90301484780\"},{\"command\":\"fc-pattern\",\"executable\":\"/usr/bin/fc-pattern\",\"sha256\":\"73d980eee3f05486e135773942c6cc83a990a2fe358ed566f58b0f5e9d633cd4\"},{\"command\":\"fc-query\",\"executable\":\"/usr/bin/fc-query\",\"sha256\":\"9aae9d3ced20be02e643c47cb026bbf43560d7443675adbc19051d068a621409\"},{\"command\":\"fc-scan\",\"executable\":\"/usr/bin/fc-scan\",\"sha256\":\"ecdae5d94ef9b5b51151f78b14c1ce2ff2cf136111c99f62ebf100cb7a383034\"},{\"command\":\"fc-validate\",\"executable\":\"/usr/bin/fc-validate\",\"sha256\":\"7f9397efdf892811f7f683f599032f6d53fd377449aa16920b76d926f98d8957\"},{\"command\":\"fgrep\",\"executable\":\"/usr/bin/fgrep\",\"sha256\":\"f1bdb63da98989d55e56cef651139f70448d4c8f6ea40bb02610be439e29bf0c\"},{\"command\":\"find\",\"executable\":\"/usr/bin/find\",\"sha256\":\"ac1ea1c5391de921aca1572f1bf25d03707beb3887b27c16a5b4948fd553941b\"},{\"command\":\"findmnt\",\"executable\":\"/usr/bin/findmnt\",\"sha256\":\"bb2f0ce5dfffc24cf965c67686c6e8bcc0383161800dfca661fc490dc9c1a63e\"},{\"command\":\"flock\",\"executable\":\"/usr/bin/flock\",\"sha256\":\"487fc764723f08f70a630c517b6847165efab683d42a62f03956320a150cf801\"},{\"command\":\"fmt\",\"executable\":\"/usr/bin/fmt\",\"sha256\":\"e637c18ac7f91480679d8ac9b64251aee05aaa8b4db9667790fb95906b802c2e\"},{\"command\":\"fold\",\"executable\":\"/usr/bin/fold\",\"sha256\":\"2164255fe616c618c74bfa102f5bb5e77c94ac8ca9505456e9f718b2d6524dd2\"},{\"command\":\"fonttosfnt\",\"executable\":\"/usr/bin/fonttosfnt\",\"sha256\":\"a1e9ced3dc34e413a74a3615b47581097702b868dc9a73fe4f046ea6992ae9cb\"},{\"command\":\"free\",\"executable\":\"/usr/bin/free\",\"sha256\":\"3e311eafe7057e69c5e528a7ff7a0aeb7110d60a173eba7f3dfb3d09e5456adf\"},{\"command\":\"g++\",\"executable\":\"/usr/bin/x86_64-linux-gnu-g++-13\",\"sha256\":\"1353e9bdd29a7295c7226bf6c63abccce056d8cac31f112e5cdbecc3f28c2769\"},{\"command\":\"g++-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-g++-13\",\"sha256\":\"1353e9bdd29a7295c7226bf6c63abccce056d8cac31f112e5cdbecc3f28c2769\"},{\"command\":\"gcc\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-13\",\"sha256\":\"1b99826121ae6682a634e5efe09bd3e3df58ce58e0b28f849114ab5b89139c26\"},{\"command\":\"gcc-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-13\",\"sha256\":\"1b99826121ae6682a634e5efe09bd3e3df58ce58e0b28f849114ab5b89139c26\"},{\"command\":\"gcc-ar\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-ar-13\",\"sha256\":\"b980c6ffedb8ceb443f2a95bd3c935a4d6aba09fa05da66864cbcaf2ec79f5c3\"},{\"command\":\"gcc-ar-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-ar-13\",\"sha256\":\"b980c6ffedb8ceb443f2a95bd3c935a4d6aba09fa05da66864cbcaf2ec79f5c3\"},{\"command\":\"gcc-nm\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-nm-13\",\"sha256\":\"b7149256b3cb154a1670c0b17ac8d2c4a7cfa03180ccdef3a4cc5183dd9f1688\"},{\"command\":\"gcc-nm-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-nm-13\",\"sha256\":\"b7149256b3cb154a1670c0b17ac8d2c4a7cfa03180ccdef3a4cc5183dd9f1688\"},{\"command\":\"gcc-ranlib\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-ranlib-13\",\"sha256\":\"c685333bc0ce5a0b432a2263184b378c4182a897e2239091adffac5c965baad1\"},{\"command\":\"gcc-ranlib-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-ranlib-13\",\"sha256\":\"c685333bc0ce5a0b432a2263184b378c4182a897e2239091adffac5c965baad1\"},{\"command\":\"gcov\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-13\",\"sha256\":\"d6298eb8f6da8a5ab277498aac6e5c7695c4d0119d4b0c54285dd8bcf0f58e42\"},{\"command\":\"gcov-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-13\",\"sha256\":\"d6298eb8f6da8a5ab277498aac6e5c7695c4d0119d4b0c54285dd8bcf0f58e42\"},{\"command\":\"gcov-dump\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-dump-13\",\"sha256\":\"13b1027b23cd99ae477ee65495053f091fdbc906135d5b00b86273a8541035b9\"},{\"command\":\"gcov-dump-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-dump-13\",\"sha256\":\"13b1027b23cd99ae477ee65495053f091fdbc906135d5b00b86273a8541035b9\"},{\"command\":\"gcov-tool\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-tool-13\",\"sha256\":\"6b85d6f4b85ed0de1db931e73b957cd79cd95076357d957018d6906306fb213b\"},{\"command\":\"gcov-tool-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-tool-13\",\"sha256\":\"6b85d6f4b85ed0de1db931e73b957cd79cd95076357d957018d6906306fb213b\"},{\"command\":\"gencat\",\"executable\":\"/usr/bin/gencat\",\"sha256\":\"d97c642cdd43861f9f67024c131ca98b65fb91f1d117b0b844170fd06900ce41\"},{\"command\":\"getconf\",\"executable\":\"/usr/bin/getconf\",\"sha256\":\"eb67cc617bc544d1b0149babb88a49cb6acebdf71c729825503c4289765f2297\"},{\"command\":\"getent\",\"executable\":\"/usr/bin/getent\",\"sha256\":\"796d0343a6583c93b64172cb0647412c9e0ede60c77ffd19491ce6c339e1c337\"},{\"command\":\"getopt\",\"executable\":\"/usr/bin/getopt\",\"sha256\":\"7b5a203bc9de7d924273fd7f60afd85e3013eaa6549222d43015fe0614d268f4\"},{\"command\":\"git\",\"executable\":\"/usr/bin/git\",\"sha256\":\"2a8c18fbf43da9f692d75474c72bea9dfd796c260b0f3dfe456376abc3bbd668\"},{\"command\":\"git-receive-pack\",\"executable\":\"/usr/bin/git\",\"sha256\":\"2a8c18fbf43da9f692d75474c72bea9dfd796c260b0f3dfe456376abc3bbd668\"},{\"command\":\"git-shell\",\"executable\":\"/usr/bin/git-shell\",\"sha256\":\"24224cc6bb2ef420e0d1073b88c726664098f692167b164a79f82b39496ec190\"},{\"command\":\"git-signature-validator\",\"executable\":\"/opt/prismpm/oracles/git-signature-validator.mjs\",\"sha256\":\"e940cf45ddbf10b21b6e29d64c70390ade3857eb8cd08cd28c9cec36c78c52a9\"},{\"command\":\"git-upload-archive\",\"executable\":\"/usr/bin/git\",\"sha256\":\"2a8c18fbf43da9f692d75474c72bea9dfd796c260b0f3dfe456376abc3bbd668\"},{\"command\":\"git-upload-pack\",\"executable\":\"/usr/bin/git\",\"sha256\":\"2a8c18fbf43da9f692d75474c72bea9dfd796c260b0f3dfe456376abc3bbd668\"},{\"command\":\"gmake\",\"executable\":\"/usr/bin/make\",\"sha256\":\"d78b8f1d099fbcfb6f2f49ab87223b9b68fb3956642f92d6ec6de812e8afa965\"},{\"command\":\"gold\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ld.gold\",\"sha256\":\"1083eca2c464601fae4b561b1c240e7f787543261891229eebe0b112801c1e13\"},{\"command\":\"gp-archive\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gp-archive\",\"sha256\":\"c3264d9d4b4ce229bcbac43db09e16b57cae242226b449b7327637fe0660c6fb\"},{\"command\":\"gp-collect-app\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gp-collect-app\",\"sha256\":\"1b12058e818536a7c9febf81d621acf182d261f8464b1aee5d745be5dfcfa2b2\"},{\"command\":\"gp-display-html\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gp-display-html\",\"sha256\":\"538acc2bcc24a50de51e88b2d733d50b69237ebfee14660e45a0255215d9f582\"},{\"command\":\"gp-display-src\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gp-display-src\",\"sha256\":\"ba224f01f3c51400529841b905bcf69ec8087b1cf9d2c96ed062d8b43984c6d8\"},{\"command\":\"gp-display-text\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gp-display-text\",\"sha256\":\"2d7e0d598c873dc2b7735edc49309b7fab9db821cbb749b5ab8d62d1b9b66112\"},{\"command\":\"gpasswd\",\"executable\":\"/usr/bin/gpasswd\",\"sha256\":\"b9ef1bde0bde1b6839a0f55d43a606645723436932f072e3bf71e4c1a0ed4c06\"},{\"command\":\"gpg\",\"executable\":\"/usr/bin/gpg\",\"sha256\":\"7ecb1341104b0ee1107fe908abce37e24546de1db0848b29c75f59f72094f4e8\"},{\"command\":\"gpg-agent\",\"executable\":\"/usr/bin/gpg-agent\",\"sha256\":\"68f28ae019b62d6c08fac50ec3cc456f102918ab1d8ecd6bffd7f9771c297dc2\"},{\"command\":\"gpg-connect-agent\",\"executable\":\"/usr/bin/gpg-connect-agent\",\"sha256\":\"7f51064f399016e6be442dad17feedbe45b3587267bc7365d8c6d7f482d9fc08\"},{\"command\":\"gpgconf\",\"executable\":\"/usr/bin/gpgconf\",\"sha256\":\"58a25b1b169b1467ab395ae2011a462fae70b41f3f7c080cec8940e85f85b8c8\"},{\"command\":\"gpgv\",\"executable\":\"/usr/bin/gpgv\",\"sha256\":\"097b577cdf8b51dcc1fb42417d5ef3ca2e22b36a8ad16c9df4bd083a38fe476c\"},{\"command\":\"gprof\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gprof\",\"sha256\":\"71796a26dca3349994b73462bfb49980c05d6181f62c42d6e2c97aed1108a5a0\"},{\"command\":\"gprofng\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gprofng\",\"sha256\":\"91e03573aeedded12a3b80e96ba28316968a8a86af78f0434cd7e87b7691df62\"},{\"command\":\"grep\",\"executable\":\"/usr/bin/grep\",\"sha256\":\"20a35a4c18f2fe9e6305c1cbf866b9c0fcc3f957132ae66028c99ec353bb0a80\"},{\"command\":\"groups\",\"executable\":\"/usr/bin/groups\",\"sha256\":\"788b929ab3b2137d377ab4bcb0cbacad117be3c36f6bdc1e44f37e14f411b75d\"},{\"command\":\"gtk-update-icon-cache\",\"executable\":\"/usr/bin/gtk-update-icon-cache\",\"sha256\":\"2bf836f48971e8a0e64fdad5bfd9aea065f8b80dbb1c5f6dbeab7715344fa102\"},{\"command\":\"gunzip\",\"executable\":\"/usr/bin/gunzip\",\"sha256\":\"55c2f67ca4c3cca0ebac659f0075461dd671ec4937ecd6c71123bb49ed322ebd\"},{\"command\":\"gzexe\",\"executable\":\"/usr/bin/gzexe\",\"sha256\":\"ec1bf1611079caf2a981b570453d4b8b5b4a1efb20dd32138f393eb994b70fea\"},{\"command\":\"gzip\",\"executable\":\"/usr/bin/gzip\",\"sha256\":\"16f1f8dbe5b47b3c1160b9066bd15bfdd80548b1b878b1a025c462fec0ca02b1\"},{\"command\":\"h2ph\",\"executable\":\"/usr/bin/h2ph\",\"sha256\":\"86c19c01835bba602e1e954e48b69846286c9deaf453ea30d63d72190832bdb0\"},{\"command\":\"h2xs\",\"executable\":\"/usr/bin/h2xs\",\"sha256\":\"7292e1d2b1bcef2a1b05ce8bae00b2651e5f115b5aff07272b1fafbdad9e723f\"},{\"command\":\"hardlink\",\"executable\":\"/usr/bin/hardlink\",\"sha256\":\"7b31350bcd5a5db793791f8053780bfdf8043e9a66d5d405d140ce97f9cf510f\"},{\"command\":\"head\",\"executable\":\"/usr/bin/head\",\"sha256\":\"bba6734ebc053fef547ec4a0bcd824011e80c81f8a67f5b83b0fccf7617ce959\"},{\"command\":\"hostid\",\"executable\":\"/usr/bin/hostid\",\"sha256\":\"a340a79bfa61b7bd916f1e48e2a7883083b913cc932e5f105914c55dc9277a0d\"},{\"command\":\"hostname\",\"executable\":\"/usr/bin/hostname\",\"sha256\":\"071fec20458397874e6121589d5210e7eed22a1b1afe16c2b9970b8a8233cc5b\"},{\"command\":\"hostnamectl\",\"executable\":\"/usr/bin/hostnamectl\",\"sha256\":\"91e2a28b79a21ee03257eeff5197e2042ab5330a108076debd63b2de334b81b8\"},{\"command\":\"i386\",\"executable\":\"/usr/bin/setarch\",\"sha256\":\"9cbf126e4a5a2847313b38c766a6d52110bd31a2f90de871bc618166a046e624\"},{\"command\":\"iconv\",\"executable\":\"/usr/bin/iconv\",\"sha256\":\"68840ad3205da948377709f5643934219a752cb8c8360561aca4cb6059aa2046\"},{\"command\":\"id\",\"executable\":\"/usr/bin/id\",\"sha256\":\"9f2e8d80e1c357b889e1b827566e882411ddc6ff45a70196e808f00e62a6c7c5\"},{\"command\":\"infocmp\",\"executable\":\"/usr/bin/infocmp\",\"sha256\":\"6498eed15395c9a0af3547ab73ac3bfbfc9271c245968846ba35e75c607b5f41\"},{\"command\":\"infotocap\",\"executable\":\"/usr/bin/tic\",\"sha256\":\"21bfaf468804f70b5f21d21d9a5e2bc9194427c5f63217c5dda4033e2c947b65\"},{\"command\":\"install\",\"executable\":\"/usr/bin/install\",\"sha256\":\"0e328ae109217200da3207ece12514b867d44fb90b444958b4d64b6007736f33\"},{\"command\":\"instmodsh\",\"executable\":\"/usr/bin/instmodsh\",\"sha256\":\"724aba7a26b1ba4f83af264e7bb31334aee0b56897b41d09c9dfd0b3389d6965\"},{\"command\":\"intoto-statement-validator\",\"executable\":\"/usr/local/bin/intoto-statement-validator\",\"sha256\":\"591f463460916feef9ac066f38654ab6be819dccc66738088d7b264ae2e44d79\"},{\"command\":\"ionice\",\"executable\":\"/usr/bin/ionice\",\"sha256\":\"c4315c8f9cd5b5a3e6d40114966f04d22982a2d2d1955292ff2e2bdfaaab3507\"},{\"command\":\"ipcmk\",\"executable\":\"/usr/bin/ipcmk\",\"sha256\":\"1e88d9451520a394fa98418d715cf9f79588413f6de9875fe6b4d77b5faeb332\"},{\"command\":\"ipcrm\",\"executable\":\"/usr/bin/ipcrm\",\"sha256\":\"bbe03923ce263085fb47d83f55fea39454f7c0c5a25ff0444aa193ce0b132e05\"},{\"command\":\"ipcs\",\"executable\":\"/usr/bin/ipcs\",\"sha256\":\"dc8b5c25ac18cea6b37a7d28b03b27b477516fb6379d836c7d88165827aaa50f\"},{\"command\":\"ischroot\",\"executable\":\"/usr/bin/ischroot\",\"sha256\":\"115afdea031142fd734509138abf8a212636f6d4dac049cbe60651d700a4fe91\"},{\"command\":\"ispell-wrapper\",\"executable\":\"/usr/bin/ispell-wrapper\",\"sha256\":\"11ff62f305a09f52885315cb5dd295e5a47861accc596ebe818751022eb95c7f\"},{\"command\":\"join\",\"executable\":\"/usr/bin/join\",\"sha256\":\"ee519cff640a08b92af041a787300799152368d0ba365fe21f42d36764b61b40\"},{\"command\":\"journalctl\",\"executable\":\"/usr/bin/journalctl\",\"sha256\":\"c49bd25d7e7655b9a44ff867923952ed5a5e0a65e9df7a0510e239bf0558e3fa\"},{\"command\":\"json_pp\",\"executable\":\"/usr/bin/json_pp\",\"sha256\":\"b336e50dc789c31cbd7b0f467d05e0d91188d06c7c27aa4009b904af8c6a4091\"},{\"command\":\"just\",\"executable\":\"/usr/local/bin/just\",\"sha256\":\"8545d0880e84bbd6c9d6a5dc2681df2a6315455bc2a2f1d7bca52085d6adb8e3\"},{\"command\":\"kernel-install\",\"executable\":\"/usr/bin/kernel-install\",\"sha256\":\"fbdf4f0b53b1ccbe622d544b70f2cbe8a59ef007ac7a12680aa26bb88ecd383e\"},{\"command\":\"kill\",\"executable\":\"/usr/bin/kill\",\"sha256\":\"65ce2f8116bbafd0e82875d126d811d051a7aff3d0e732412c1fac9055f766dc\"},{\"command\":\"kind\",\"executable\":\"/usr/local/bin/kind\",\"sha256\":\"eb244cbafcc157dff60cf68693c14c9a75c4e6e6fedaf9cd71c58117cb93e3fa\"},{\"command\":\"kubectl\",\"executable\":\"/usr/local/bin/kubectl\",\"sha256\":\"8b8f088da2dab964f853b38464033b1be15ede2839eca751482357c45abdd05a\"},{\"command\":\"kubernetes-validator\",\"executable\":\"/opt/prismpm/oracles/kubernetes-validator.mjs\",\"sha256\":\"3c2555117a2fe092fc9260dc2672edaac415d36bd16e1edbbe32af847f92e737\"},{\"command\":\"lake\",\"executable\":\"/usr/local/elan/bin/lake\",\"sha256\":\"840179e70803ef373c2ec53342d6a45ea7d022533e4145489fc1278b4f716385\"},{\"command\":\"last\",\"executable\":\"/usr/bin/last\",\"sha256\":\"04be4a5a7b8ea3b8824d150a121b9cdc353e92fae093bcb9b52628a776e79df6\"},{\"command\":\"lastb\",\"executable\":\"/usr/bin/last\",\"sha256\":\"04be4a5a7b8ea3b8824d150a121b9cdc353e92fae093bcb9b52628a776e79df6\"},{\"command\":\"lastlog\",\"executable\":\"/usr/bin/lastlog\",\"sha256\":\"43fedab5ff553697d233a7644466eeb89a519ae9d824f4849c57841e30bb74b6\"},{\"command\":\"ld\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ld.bfd\",\"sha256\":\"e9ceb054c12207970f2726dfc07e9a66b411602748628baf27399f02a9bbb31b\"},{\"command\":\"ld.bfd\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ld.bfd\",\"sha256\":\"e9ceb054c12207970f2726dfc07e9a66b411602748628baf27399f02a9bbb31b\"},{\"command\":\"ld.gold\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ld.gold\",\"sha256\":\"1083eca2c464601fae4b561b1c240e7f787543261891229eebe0b112801c1e13\"},{\"command\":\"ld.so\",\"executable\":\"/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2\",\"sha256\":\"cd4df4f3c7b83673d61189bf2eaebd33ca4f2853ab9772b8a25e025ef99b1e81\"},{\"command\":\"ldd\",\"executable\":\"/usr/bin/ldd\",\"sha256\":\"4f1d37e25f27535e3f02a5b7da63e1ce18d4982445db2c25fc8f985a3d395cc3\"},{\"command\":\"lean\",\"executable\":\"/usr/local/elan/bin/lean\",\"sha256\":\"840179e70803ef373c2ec53342d6a45ea7d022533e4145489fc1278b4f716385\"},{\"command\":\"leanc\",\"executable\":\"/usr/local/elan/bin/leanc\",\"sha256\":\"840179e70803ef373c2ec53342d6a45ea7d022533e4145489fc1278b4f716385\"},{\"command\":\"leanchecker\",\"executable\":\"/usr/local/elan/bin/leanchecker\",\"sha256\":\"840179e70803ef373c2ec53342d6a45ea7d022533e4145489fc1278b4f716385\"},{\"command\":\"leanmake\",\"executable\":\"/usr/local/elan/bin/leanmake\",\"sha256\":\"840179e70803ef373c2ec53342d6a45ea7d022533e4145489fc1278b4f716385\"},{\"command\":\"leanpkg\",\"executable\":\"/usr/local/elan/bin/leanpkg\",\"sha256\":\"840179e70803ef373c2ec53342d6a45ea7d022533e4145489fc1278b4f716385\"},{\"command\":\"lexlean\",\"executable\":\"/usr/local/bin/lexlean\",\"sha256\":\"e4168b533d3369e7e0e2ed7cdb331f8dd94e3aa20362d55ded086a24ca3b16f8\"},{\"command\":\"libnetcfg\",\"executable\":\"/usr/bin/libnetcfg\",\"sha256\":\"78bab79d103416b08a51e070bf599101a897f3753ff729bd3bafd4068f5b2564\"},{\"command\":\"link\",\"executable\":\"/usr/bin/link\",\"sha256\":\"c00e17d1a1c8ee984da9177294c1ba2983dc8c12228a92e0af58f58badd02918\"},{\"command\":\"linux32\",\"executable\":\"/usr/bin/setarch\",\"sha256\":\"9cbf126e4a5a2847313b38c766a6d52110bd31a2f90de871bc618166a046e624\"},{\"command\":\"linux64\",\"executable\":\"/usr/bin/setarch\",\"sha256\":\"9cbf126e4a5a2847313b38c766a6d52110bd31a2f90de871bc618166a046e624\"},{\"command\":\"ln\",\"executable\":\"/usr/bin/ln\",\"sha256\":\"0fa5580b6604a3a26f14f3713725d661f39d35036701b603908700e58cf2cc7f\"},{\"command\":\"locale\",\"executable\":\"/usr/bin/locale\",\"sha256\":\"9ed92f61737558cdbe4c40386a6c275b698af16711ba2a023e3917de3e887e46\"},{\"command\":\"locale-check\",\"executable\":\"/usr/bin/locale-check\",\"sha256\":\"d2790fcfc566e13166e935d97506f43cd7454ab6310a1f4d8fd3d39a40c20eda\"},{\"command\":\"localectl\",\"executable\":\"/usr/bin/localectl\",\"sha256\":\"8c1804507946e72c6dcec417e09eb7b41422e95e4b026fa759f7e44606cabb32\"},{\"command\":\"localedef\",\"executable\":\"/usr/bin/localedef\",\"sha256\":\"159102a8c64948670b9f5bff8eb427e22de15ab3dc23105bac94e3832b766602\"},{\"command\":\"logger\",\"executable\":\"/usr/bin/logger\",\"sha256\":\"23f3041b898ea6dfe4b06957e04c382a7656f3daac77b1b87fd6592cb43123dd\"},{\"command\":\"login\",\"executable\":\"/usr/bin/login\",\"sha256\":\"68e37d7a53aa5d5db142ca0fd5cc80558e57b2d0dab042264f6e0b3a2ac5e10c\"},{\"command\":\"loginctl\",\"executable\":\"/usr/bin/loginctl\",\"sha256\":\"0b8fa7d357c9d26967d53221e10303b45b003ed6389a3a4e35a018b8eb844be7\"},{\"command\":\"logname\",\"executable\":\"/usr/bin/logname\",\"sha256\":\"45db4d2592e64532694c8afe52bc447f025b113b4f528c1d8610c5d1e48c6a94\"},{\"command\":\"ls\",\"executable\":\"/usr/bin/ls\",\"sha256\":\"53a9c0557a948069d56f964cf21c7c0854bb2677d9985080369ed1e172161625\"},{\"command\":\"lsattr\",\"executable\":\"/usr/bin/lsattr\",\"sha256\":\"905fb991f13223a83a062036ae4522ae570d7ac9a4ea5bdfaa372f7d08e3e575\"},{\"command\":\"lsblk\",\"executable\":\"/usr/bin/lsblk\",\"sha256\":\"ed402fc40402a7e569e0f6dd092dde6e365c7114953ab2f746e529de1182797f\"},{\"command\":\"lscpu\",\"executable\":\"/usr/bin/lscpu\",\"sha256\":\"31c24c0492f23fb6737746de6526caf28153ce9b2d252dc99e3ba3729456e734\"},{\"command\":\"lsipc\",\"executable\":\"/usr/bin/lsipc\",\"sha256\":\"5bbdb8551443c6438ccaf8973ae1706b9b47845e9c818ebf02bdad8a3cd53ea3\"},{\"command\":\"lslocks\",\"executable\":\"/usr/bin/lslocks\",\"sha256\":\"8bf64c604089b8992c4ab6f2149d07cf45d5fc19e486fc128ec521329e9689ed\"},{\"command\":\"lslogins\",\"executable\":\"/usr/bin/lslogins\",\"sha256\":\"3ba84dda9f3e5a5f0d2b6822525d1b40bce5b110c3f4b8a700afa62ae1442b79\"},{\"command\":\"lsmem\",\"executable\":\"/usr/bin/lsmem\",\"sha256\":\"f2250bd7974b1bc47a87828140e1aba335c044a69b69abeeb891cf8fa8bb3b42\"},{\"command\":\"lsns\",\"executable\":\"/usr/bin/lsns\",\"sha256\":\"a800738033ac72da56d01b4c7a5ac823d80e2f439529252181a2abdd02ab2c2f\"},{\"command\":\"lto-dump\",\"executable\":\"/usr/bin/x86_64-linux-gnu-lto-dump-13\",\"sha256\":\"ed86753e90565306d3bd55483964eff30dc5b19a0a2cec80bd3c5825c4f8dd57\"},{\"command\":\"lto-dump-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-lto-dump-13\",\"sha256\":\"ed86753e90565306d3bd55483964eff30dc5b19a0a2cec80bd3c5825c4f8dd57\"},{\"command\":\"lzcat\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"b5b163eb273291934556377ab883b4b2a5d4da50bd0dc0a91774ecc234ccd8d0\"},{\"command\":\"lzcmp\",\"executable\":\"/usr/bin/xzdiff\",\"sha256\":\"551e26acd2c7d3f56ab6f43916cfcaafb96955eda66b656f1ed9a708f52e7667\"},{\"command\":\"lzdiff\",\"executable\":\"/usr/bin/xzdiff\",\"sha256\":\"551e26acd2c7d3f56ab6f43916cfcaafb96955eda66b656f1ed9a708f52e7667\"},{\"command\":\"lzegrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"lzfgrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"lzgrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"lzless\",\"executable\":\"/usr/bin/xzless\",\"sha256\":\"a25b3dee9826b993f4fe0043e6d3073c6658925c28afc303917d62b1cf465051\"},{\"command\":\"lzma\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"b5b163eb273291934556377ab883b4b2a5d4da50bd0dc0a91774ecc234ccd8d0\"},{\"command\":\"lzmainfo\",\"executable\":\"/usr/bin/lzmainfo\",\"sha256\":\"0a2bd0f045a0d229d2f71380755b11b3d549ef3c0259802a7df2694892774bf4\"},{\"command\":\"lzmore\",\"executable\":\"/usr/bin/xzmore\",\"sha256\":\"e40b6cfbd6dcfd6fa46b721f7afb36efbbf3a8fbea1cd20f64b6123400f39306\"},{\"command\":\"make\",\"executable\":\"/usr/bin/make\",\"sha256\":\"d78b8f1d099fbcfb6f2f49ab87223b9b68fb3956642f92d6ec6de812e8afa965\"},{\"command\":\"make-first-existing-target\",\"executable\":\"/usr/bin/make-first-existing-target\",\"sha256\":\"1ed1eb3449f3db643b7532550a04b9f0f3acd79a13243c4b474e1546f662e596\"},{\"command\":\"man\",\"executable\":\"/usr/bin/man\",\"sha256\":\"1150abfca60bce252e8a6a449719fec697aa8ac844ae330882a1618a78db05b7\"},{\"command\":\"mawk\",\"executable\":\"/usr/bin/mawk\",\"sha256\":\"3850bf893d3f4f8ec462c8b59d6d66fdbbe8ddc0715b3d404d9cc574526b781c\"},{\"command\":\"mcookie\",\"executable\":\"/usr/bin/mcookie\",\"sha256\":\"8e7bc650992d9b6b21fbeac5d996ee71cb4f6b75293cc20c3a353e58f5cc6192\"},{\"command\":\"md5sum\",\"executable\":\"/usr/bin/md5sum\",\"sha256\":\"07f783b4caa1c8b0dd2cfbda39be93a265bb804218bbca65db2c5ba2c2bbe1dc\"},{\"command\":\"md5sum.textutils\",\"executable\":\"/usr/bin/md5sum\",\"sha256\":\"07f783b4caa1c8b0dd2cfbda39be93a265bb804218bbca65db2c5ba2c2bbe1dc\"},{\"command\":\"mesg\",\"executable\":\"/usr/bin/mesg\",\"sha256\":\"1138cfd11e14543a14ccc11d184d7034a5e4bae20178038055816486cd2604f5\"},{\"command\":\"mkdir\",\"executable\":\"/usr/bin/mkdir\",\"sha256\":\"af2cc5106b37532b2aa1b4981668685cf7aebdf5fea3ac7356d568cf98d7470b\"},{\"command\":\"mkfifo\",\"executable\":\"/usr/bin/mkfifo\",\"sha256\":\"e746d63523729504b4ce7fa8ce8f37d0f6af186b2ed50a4630cd8a62d931f004\"},{\"command\":\"mkfontdir\",\"executable\":\"/usr/bin/mkfontdir\",\"sha256\":\"3e42ff36b592706e5846d6133c38422d33881d3eaef87e59e9fda381c591ef78\"},{\"command\":\"mkfontscale\",\"executable\":\"/usr/bin/mkfontscale\",\"sha256\":\"34db39f7cc459169faaffe6325fe1bde82ac7d3aee55738850f025f545bb348f\"},{\"command\":\"mknod\",\"executable\":\"/usr/bin/mknod\",\"sha256\":\"d774ca7f4efc1465c52f977b3e228ca69aced928e8d11ca86b5ac6eb904d0f54\"},{\"command\":\"mktemp\",\"executable\":\"/usr/bin/mktemp\",\"sha256\":\"45d28b6224635b9506be3fd58b280e8267ea1418f251ccc84f9c4c1b56ce9e45\"},{\"command\":\"more\",\"executable\":\"/usr/bin/more\",\"sha256\":\"31297a5996c047b868d7897d4cdc0571eb42ec308d125d5cfe1cbc91523f1670\"},{\"command\":\"mount\",\"executable\":\"/usr/bin/mount\",\"sha256\":\"ac5aa68d34add5a33ae81ac3a971aea677c4032d768aab5a3c4c2707f728885e\"},{\"command\":\"mountpoint\",\"executable\":\"/usr/bin/mountpoint\",\"sha256\":\"6a76a8993083f3dba87e6741e42325abebb7ba816279d7be7bff8ff8ec6534ed\"},{\"command\":\"mv\",\"executable\":\"/usr/bin/mv\",\"sha256\":\"8f07f577f2438fb80b1d44851bb507b0d517cc6756bb680e0eda1b8bc07f0073\"},{\"command\":\"namei\",\"executable\":\"/usr/bin/namei\",\"sha256\":\"7adb4f33d8b0cc464f7e9f72cd9b9324dba6654d403d3d52935ad35b35fd5243\"},{\"command\":\"nawk\",\"executable\":\"/usr/bin/mawk\",\"sha256\":\"3850bf893d3f4f8ec462c8b59d6d66fdbbe8ddc0715b3d404d9cc574526b781c\"},{\"command\":\"networkctl\",\"executable\":\"/usr/bin/networkctl\",\"sha256\":\"69c01b10b13ceff2fc6a2fd74b48169622076828707785794a5be90e1fe6177d\"},{\"command\":\"newgrp\",\"executable\":\"/usr/bin/newgrp\",\"sha256\":\"572ab15948df3969e929b902641c3a42e76dce7d71a22fbc58011ca89d8d965e\"},{\"command\":\"nice\",\"executable\":\"/usr/bin/nice\",\"sha256\":\"1ad49430066b17c18062ec742254a65fa08ea2248a26db5cab4f548d64bfbecd\"},{\"command\":\"nisdomainname\",\"executable\":\"/usr/bin/hostname\",\"sha256\":\"071fec20458397874e6121589d5210e7eed22a1b1afe16c2b9970b8a8233cc5b\"},{\"command\":\"nl\",\"executable\":\"/usr/bin/nl\",\"sha256\":\"3c291e1cbce852b356785777659f2d3b85c312e5b7dcc8f4f7b9f4488b9b9923\"},{\"command\":\"nm\",\"executable\":\"/usr/bin/x86_64-linux-gnu-nm\",\"sha256\":\"3708df3d7ce16e2c1dcdcd722784ae382d4d582276a71ab7bbe2d542f5621202\"},{\"command\":\"node\",\"executable\":\"/usr/local/bin/node\",\"sha256\":\"3517c2df0b2f8cd7f422b4b8450ef81c6889f08eb03e281d6de9079b15e6a327\"},{\"command\":\"nodejs\",\"executable\":\"/usr/bin/node\",\"sha256\":\"f3432a45b03b2da0d270095fdd8813dc34cbea73f5fc8b18c7a384b7cf9b333a\"},{\"command\":\"nohup\",\"executable\":\"/usr/bin/nohup\",\"sha256\":\"f0155d0dafd80130405fd215e6c539eda0d75adf8c0c0f3873130b518314231e\"},{\"command\":\"npm\",\"executable\":\"/usr/local/lib/node_modules/npm/bin/npm-cli.js\",\"sha256\":\"8e5f6f3429f8cdbe693cdc29904e9d5a7b127a494bd15c804bd54c7403bfcbe7\"},{\"command\":\"nproc\",\"executable\":\"/usr/bin/nproc\",\"sha256\":\"ae595cc6c699d657e556818e1100ec2e2134fc611fcaec420bdbddeb3e26c652\"},{\"command\":\"npx\",\"executable\":\"/usr/local/lib/node_modules/npm/bin/npx-cli.js\",\"sha256\":\"237adf8f3747cad8b9b62fcfd0d9c8d509a64e550337707f55100afcb79e8900\"},{\"command\":\"nsenter\",\"executable\":\"/usr/bin/nsenter\",\"sha256\":\"b1230680d3fd3d3447d3190c30921ede39170e3e01ce22916b922fe0489b7af1\"},{\"command\":\"numfmt\",\"executable\":\"/usr/bin/numfmt\",\"sha256\":\"c9baa9a11f20146c3df9de1908dfff6db6b3fe954453f3c99ff03a8cbf3a72f4\"},{\"command\":\"objcopy\",\"executable\":\"/usr/bin/x86_64-linux-gnu-objcopy\",\"sha256\":\"9276e918e3c26d3aa7ef9dd2232cd8ac692f03d3c1f270bfa5144a2b5492b713\"},{\"command\":\"objdump\",\"executable\":\"/usr/bin/x86_64-linux-gnu-objdump\",\"sha256\":\"325c4205a4c658a9d1e1ebc469ae55975a2b897a3d3c1e79d9b158612d37f745\"},{\"command\":\"oci-distribution-conformance\",\"executable\":\"/usr/local/bin/oci-distribution-conformance\",\"sha256\":\"7b0e39ab2f616c7b33a7ffc57331b90a27ea4cc23ffbc1526c3dee80187332b2\"},{\"command\":\"oci-image-schema-conformance\",\"executable\":\"/usr/local/bin/oci-image-schema-conformance\",\"sha256\":\"87e0a99983e0bf9af63d5ac49cd7c1df476231f1de947d0e1c7e7b51b57cc0fd\"},{\"command\":\"oci-runtime-validate\",\"executable\":\"/usr/local/bin/oci-runtime-validate\",\"sha256\":\"65bd7332ae65e906405bb3b4e1dfcbfa7c9e25dcc3ceeff5a7331a1b942be26e\"},{\"command\":\"od\",\"executable\":\"/usr/bin/od\",\"sha256\":\"74a28d4bd02cfe8d205196275f1e9a923b024b22bf90bd1d48bc1a4dbad0720d\"},{\"command\":\"openid-conformance\",\"executable\":\"/usr/local/bin/openid-conformance\",\"sha256\":\"7ee100439bc7dc35cda162b85be68140338bdae5aa3c2fb79412cca621bdd9b1\"},{\"command\":\"openssl\",\"executable\":\"/usr/bin/openssl\",\"sha256\":\"b86b739329008369aebe1f7cff6c2adb18965609d68a19456fca55232f2908f5\"},{\"command\":\"oras\",\"executable\":\"/usr/local/bin/oras\",\"sha256\":\"040e140304b7dbdd9b40dacd798e2303cea44ad84eeb210750afdf15f1dcf8b4\"},{\"command\":\"osv-scanner\",\"executable\":\"/usr/local/bin/osv-scanner\",\"sha256\":\"15314940c10d26af9c6649f150b8a47c1262e8fc7e17b1d1029b0e479e8ed8a0\"},{\"command\":\"otelcol-contrib\",\"executable\":\"/usr/local/bin/otelcol-contrib\",\"sha256\":\"8133aa166e5a0cc706c7168b16828737baeb9d78b7a630b3cc0c2dac225e57ea\"},{\"command\":\"pager\",\"executable\":\"/usr/bin/more\",\"sha256\":\"31297a5996c047b868d7897d4cdc0571eb42ec308d125d5cfe1cbc91523f1670\"},{\"command\":\"partx\",\"executable\":\"/usr/bin/partx\",\"sha256\":\"66c12078fbc09868ad418b67655f501d10508e6b6670c1a373e90e6744787478\"},{\"command\":\"passwd\",\"executable\":\"/usr/bin/passwd\",\"sha256\":\"ca3fc307dda8259f585bb38c70e82bd15af61e8574cd0d6e430292e328bb3477\"},{\"command\":\"paste\",\"executable\":\"/usr/bin/paste\",\"sha256\":\"d748b478d9942d3c93427259054397f6e902cb5378b67e5d39e6dc913fc4d082\"},{\"command\":\"patch\",\"executable\":\"/usr/bin/patch\",\"sha256\":\"a7ae8b838a75711c06f86a2a8293dcad85a20b564670a120717e704c436e6f3a\"},{\"command\":\"pathchk\",\"executable\":\"/usr/bin/pathchk\",\"sha256\":\"58a6ebb425041c927febfeee381056adb9ce6f774427cbbb43f6452c834a100a\"},{\"command\":\"pdb3\",\"executable\":\"/usr/lib/python3.12/pdb.py\",\"sha256\":\"8d2a36cb0c9a4d8eda57e1a4fe153fff2724570286ecf520648aee4fe7a4fff7\"},{\"command\":\"pdb3.12\",\"executable\":\"/usr/lib/python3.12/pdb.py\",\"sha256\":\"8d2a36cb0c9a4d8eda57e1a4fe153fff2724570286ecf520648aee4fe7a4fff7\"},{\"command\":\"perl\",\"executable\":\"/usr/bin/perl\",\"sha256\":\"56e5ea41974eb1eff0f7ea64677578b1938053d29818c2810bcb21e2ca68cafa\"},{\"command\":\"perl5.38-x86_64-linux-gnu\",\"executable\":\"/usr/bin/perl5.38-x86_64-linux-gnu\",\"sha256\":\"7c0ac53c6ad2597ae0175e3637b573858fb536065e8a0bb2e6a28bde563ce555\"},{\"command\":\"perl5.38.2\",\"executable\":\"/usr/bin/perl5.38.2\",\"sha256\":\"56e5ea41974eb1eff0f7ea64677578b1938053d29818c2810bcb21e2ca68cafa\"},{\"command\":\"perlbug\",\"executable\":\"/usr/bin/perlbug\",\"sha256\":\"f1283dadae7c65a24852623282b6ec235a83e32dfa53c75745de98a672791d41\"},{\"command\":\"perldoc\",\"executable\":\"/usr/bin/perldoc\",\"sha256\":\"d8bebeee62ce30574f40d53182b7fe17619e144233a7f7ddfa3e33ca34deccec\"},{\"command\":\"perlivp\",\"executable\":\"/usr/bin/perlivp\",\"sha256\":\"ea0bc6dfbf245531e7fed7ee22c07d576aaf89e57251bab47a879f40742d565e\"},{\"command\":\"perlthanks\",\"executable\":\"/usr/bin/perlthanks\",\"sha256\":\"f1283dadae7c65a24852623282b6ec235a83e32dfa53c75745de98a672791d41\"},{\"command\":\"pgrep\",\"executable\":\"/usr/bin/pgrep\",\"sha256\":\"8e1a7f00f33b9447e24835307cef71800677a2fe2975c8a1632b613109816b52\"},{\"command\":\"piconv\",\"executable\":\"/usr/bin/piconv\",\"sha256\":\"0ddc062a05a184cc3f89338a44437364a29811b420f3660c13915bddfdc3a689\"},{\"command\":\"pidof\",\"executable\":\"/usr/sbin/killall5\",\"sha256\":\"171e6ffef3a838e24f7b2eab2a93b55ebce963f554ceef41c5170b69d7e96716\"},{\"command\":\"pidwait\",\"executable\":\"/usr/bin/pidwait\",\"sha256\":\"8e1a7f00f33b9447e24835307cef71800677a2fe2975c8a1632b613109816b52\"},{\"command\":\"pinentry\",\"executable\":\"/usr/bin/pinentry-curses\",\"sha256\":\"255b09f7b0199ce75c38e5c4e4a04b0992ed43f3fac89b3f80bbd26fe9b2e9ea\"},{\"command\":\"pinentry-curses\",\"executable\":\"/usr/bin/pinentry-curses\",\"sha256\":\"255b09f7b0199ce75c38e5c4e4a04b0992ed43f3fac89b3f80bbd26fe9b2e9ea\"},{\"command\":\"pinky\",\"executable\":\"/usr/bin/pinky\",\"sha256\":\"0520d212a3909902b59a5dbcf45721a5fd41d927d64c6b2c86e543a154b4fc50\"},{\"command\":\"pkg-config\",\"executable\":\"/usr/bin/pkgconf\",\"sha256\":\"7e8152db1b0c7e49d47b4b82a70dc9997b557951c5d4d938b0e7f208ce9eb10b\"},{\"command\":\"pkgconf\",\"executable\":\"/usr/bin/pkgconf\",\"sha256\":\"7e8152db1b0c7e49d47b4b82a70dc9997b557951c5d4d938b0e7f208ce9eb10b\"},{\"command\":\"pkill\",\"executable\":\"/usr/bin/pgrep\",\"sha256\":\"8e1a7f00f33b9447e24835307cef71800677a2fe2975c8a1632b613109816b52\"},{\"command\":\"pl2pm\",\"executable\":\"/usr/bin/pl2pm\",\"sha256\":\"a974fb9e86c76778a249d47d521e6fa1847c331ba3eea6e240a37b1c44dd6a1d\"},{\"command\":\"pldd\",\"executable\":\"/usr/bin/pldd\",\"sha256\":\"9138682c58a3e75820939b71e034d28aeabb48746f29409168a2847b4708e7f8\"},{\"command\":\"pmap\",\"executable\":\"/usr/bin/pmap\",\"sha256\":\"8fc0034d5d77f19792ad1f9cdbf4821bb8d4a24937033acb6f9b71334f33b81a\"},{\"command\":\"pod2html\",\"executable\":\"/usr/bin/pod2html\",\"sha256\":\"713aa9fdcf27a9b70991c14ee5bc47a8a56ec2cfd804df9b79f90f6024de4750\"},{\"command\":\"pod2man\",\"executable\":\"/usr/bin/pod2man\",\"sha256\":\"fdcf8ff920a7461cad02121890b58039f01206809cea6e09eef84692eb793a17\"},{\"command\":\"pod2text\",\"executable\":\"/usr/bin/pod2text\",\"sha256\":\"e0372745722b8d7eeb3ce932606493381c936886e754913d25578cadfce29a13\"},{\"command\":\"pod2usage\",\"executable\":\"/usr/bin/pod2usage\",\"sha256\":\"6405327f3f8660ed89c068b760f61ffb9bd180e2997e9ba881be00f6989c6da3\"},{\"command\":\"podchecker\",\"executable\":\"/usr/bin/podchecker\",\"sha256\":\"b41c90733b7f4051dbe82d289177add630133f0679660fbfa3f3051ecd309dbb\"},{\"command\":\"pr\",\"executable\":\"/usr/bin/pr\",\"sha256\":\"0d446b68a90909c4e1c77f943ebc6d719bb1736934b8a5655bda833606a9c634\"},{\"command\":\"printenv\",\"executable\":\"/usr/bin/printenv\",\"sha256\":\"0f715cfd157d172699753e32185a05023fd16db8597a34ff048ff8e5e2c2d219\"},{\"command\":\"printf\",\"executable\":\"/usr/bin/printf\",\"sha256\":\"3bd8d9bc341d025ea7b805902e469d047e803979faa5417306bd1b454a95992f\"},{\"command\":\"prismpm\",\"executable\":\"/usr/local/bin/prismpm\",\"sha256\":\"ddd53c416a956ede2d84dedace1af7ad9a12ef1eac0e9220a4a5b3e6de897aa8\"},{\"command\":\"prismpm-conformance\",\"executable\":\"/usr/local/bin/prismpm-conformance\",\"sha256\":\"65270010ca442abafa1ae5ccaa1e00777814d08748e0ffb4565070c43b52e2e9\"},{\"command\":\"prismpm-devcontainer-init\",\"executable\":\"/usr/local/bin/prismpm-devcontainer-init\",\"sha256\":\"b8787fc1f0b996393d4e7c55f84a901916e807570c76f27c027743d27dde487b\"},{\"command\":\"prismpm-platform-equivalence\",\"executable\":\"/usr/local/bin/prismpm-platform-equivalence\",\"sha256\":\"a3be795af76d3a0d95253ce652828b3d161e6aae0f147996328dd333a9aba531\"},{\"command\":\"prlimit\",\"executable\":\"/usr/bin/prlimit\",\"sha256\":\"f27cfd8c1512a4cc6541b59b80cb4cdfd6ef28c34aa21db4299b48264cd0d128\"},{\"command\":\"prove\",\"executable\":\"/usr/bin/prove\",\"sha256\":\"30c7fee6225199bbcd242975fe5b2df0436e9ffa9136a5b8972b922dfaf8485b\"},{\"command\":\"ps\",\"executable\":\"/usr/bin/ps\",\"sha256\":\"8e86f498aa4aabfcea6c179d6181557140b4597f1c39bb94e2aba32158b58297\"},{\"command\":\"ptar\",\"executable\":\"/usr/bin/ptar\",\"sha256\":\"126fc379885309b476100e1150430256ab892c5b5650741af17478984a389758\"},{\"command\":\"ptardiff\",\"executable\":\"/usr/bin/ptardiff\",\"sha256\":\"1d7d45bd4f48409a479886e6cfb6e3e8093fea89b10ce906d399484d92a86cc0\"},{\"command\":\"ptargrep\",\"executable\":\"/usr/bin/ptargrep\",\"sha256\":\"0bca747354107929ecefbab2a8128923763bfa622124e20a1194c7f8a914a20f\"},{\"command\":\"ptx\",\"executable\":\"/usr/bin/ptx\",\"sha256\":\"6fdbe9b0845cb29be9a27a78e2ec25fa29d5a54b829465cd6bb320312da29589\"},{\"command\":\"pwd\",\"executable\":\"/usr/bin/pwd\",\"sha256\":\"efb9314f903f370323c36dbc89c6b45965e6d7cf722870682d30fe9d450d0ac5\"},{\"command\":\"pwdx\",\"executable\":\"/usr/bin/pwdx\",\"sha256\":\"f3fff841b718139554fd3a56050fe29dc3805aa0af42a6a0acceb37c20e8b6f1\"},{\"command\":\"py3clean\",\"executable\":\"/usr/bin/py3clean\",\"sha256\":\"48c7d9e6a14a349beae906eae5fe8cac9a974bda7a40c3dc3b9e1163251eb250\"},{\"command\":\"py3compile\",\"executable\":\"/usr/bin/py3compile\",\"sha256\":\"4ca3cf6f9fbb47571e11c86222f4f3952a22d87f5df37c060388e96b0ef00813\"},{\"command\":\"py3versions\",\"executable\":\"/usr/share/python3/py3versions.py\",\"sha256\":\"8b0eef6d34bd68477d81d89d8e6bf91d6a991cb5034351d564731aa013b6e7e7\"},{\"command\":\"pydoc3\",\"executable\":\"/usr/bin/pydoc3.12\",\"sha256\":\"ddbcea7349aca28998c76624ac9b4a692b3edd4ab80c279e7d97a6aca813191a\"},{\"command\":\"pydoc3.12\",\"executable\":\"/usr/bin/pydoc3.12\",\"sha256\":\"ddbcea7349aca28998c76624ac9b4a692b3edd4ab80c279e7d97a6aca813191a\"},{\"command\":\"pygettext3\",\"executable\":\"/usr/bin/pygettext3.12\",\"sha256\":\"d6d87fa2841d71debfdec183c7df8752a759ca56af467248a79e2e192f80eda1\"},{\"command\":\"pygettext3.12\",\"executable\":\"/usr/bin/pygettext3.12\",\"sha256\":\"d6d87fa2841d71debfdec183c7df8752a759ca56af467248a79e2e192f80eda1\"},{\"command\":\"python3\",\"executable\":\"/usr/bin/python3.12\",\"sha256\":\"1643dacd9feaedc58f3cc581e4d22577dfe25c09b10282936186ccf0f2e61118\"},{\"command\":\"python3.12\",\"executable\":\"/usr/bin/python3.12\",\"sha256\":\"1643dacd9feaedc58f3cc581e4d22577dfe25c09b10282936186ccf0f2e61118\"},{\"command\":\"ranlib\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ranlib\",\"sha256\":\"60254978b8ee2c1b21b41d16a18a621dbbcc72e43eb2fa9f916818256c77e9ee\"},{\"command\":\"rbash\",\"executable\":\"/usr/bin/bash\",\"sha256\":\"bc5945feb8bd26203ebfafea5ce1878bb2e32cb8fb50ab7ae395cfb1e1aaaef1\"},{\"command\":\"readelf\",\"executable\":\"/usr/bin/x86_64-linux-gnu-readelf\",\"sha256\":\"64c58e15274bbbb5153f31078e455e9e77ee5f51489e709bba5bb788ce9df2b0\"},{\"command\":\"readlink\",\"executable\":\"/usr/bin/readlink\",\"sha256\":\"645a5f1f1f2aa9639a1fa1ac0a0b7e9377a2b963baf62d3952a3ce02715e1bf7\"},{\"command\":\"realpath\",\"executable\":\"/usr/bin/realpath\",\"sha256\":\"8f0b843ce0f8ce437dfe78672ffd064cb238551b2ebbf5b8559a7adaaf0e3ef0\"},{\"command\":\"rename.ul\",\"executable\":\"/usr/bin/rename.ul\",\"sha256\":\"c2694fd23b1b4f54ec4484c9f9f1c01e7d217c4cacaee84271ca3d5eaf49d46f\"},{\"command\":\"renice\",\"executable\":\"/usr/bin/renice\",\"sha256\":\"219fe236c0e987017a2ee2ac64f94d8887f95f789fcb2aad726c8dad8f63ab13\"},{\"command\":\"reset\",\"executable\":\"/usr/bin/tset\",\"sha256\":\"2c6a6465382ef8b3c31a2f518efee4eb2dfc3272b009d256828ec6eef14dee20\"},{\"command\":\"resizepart\",\"executable\":\"/usr/bin/resizepart\",\"sha256\":\"dd9abb069c63b78245e7ff8fca52d6c435fca02f18b5af194cfa7d8797d62fdd\"},{\"command\":\"rev\",\"executable\":\"/usr/bin/rev\",\"sha256\":\"5361079aa25fa7312f78bd86f14777e1b4bebb5573a9c72e10e5066d491c36e4\"},{\"command\":\"rgrep\",\"executable\":\"/usr/bin/rgrep\",\"sha256\":\"0a8dd42a068115f058ae57f9f6347e1ef0ae2ffea89bf658b132974246577748\"},{\"command\":\"rls\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"rm\",\"executable\":\"/usr/bin/rm\",\"sha256\":\"aedf2ef491e1ca4ea2682b88a031f7c3960ebb133677a339743e859fa3d3d8b5\"},{\"command\":\"rmdir\",\"executable\":\"/usr/bin/rmdir\",\"sha256\":\"2450cf2f4eaad71378cfdc6ac6da5cd6b40a6aa772766ae9040d32bf2ee45193\"},{\"command\":\"rpcgen\",\"executable\":\"/usr/bin/rpcgen\",\"sha256\":\"6bfcac3fe114746947c7abbbe5bdf4822b8c31a1a9797a7885c47d0a9062e2ce\"},{\"command\":\"run-parts\",\"executable\":\"/usr/bin/run-parts\",\"sha256\":\"3f36124107498d18ddacfbfe773df11e7094d5d143194cdfcec8804cccc81f64\"},{\"command\":\"runcon\",\"executable\":\"/usr/bin/runcon\",\"sha256\":\"2a578af3b87f26bd4e7786661829d4941126f35d07f5195ac7cd6829c2ee4923\"},{\"command\":\"rust-analyzer\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"rust-gdb\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"rust-gdbgui\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"rust-lldb\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"rustc\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"rustdoc\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"rustfmt\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"rustup\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10\"},{\"command\":\"savelog\",\"executable\":\"/usr/bin/savelog\",\"sha256\":\"6a0f55fea1a81f1930c86f534fb5570785b2f12f3da49709e76c3148a89e0197\"},{\"command\":\"scalar\",\"executable\":\"/usr/bin/scalar\",\"sha256\":\"c60b6e9e8162deb16a53c892682a0f09ee921aee94329329f6cd7971ac2ec094\"},{\"command\":\"scp\",\"executable\":\"/usr/bin/scp\",\"sha256\":\"27421348ac188f7381634ce1d521fe9fe774c75cab0d0d2086a052c9bac2da4b\"},{\"command\":\"script\",\"executable\":\"/usr/bin/script\",\"sha256\":\"e2dc34fc70c2ed96b3e919c1103d9f1cc210d32218d582ab271454b2350f50a1\"},{\"command\":\"scriptlive\",\"executable\":\"/usr/bin/scriptlive\",\"sha256\":\"e10074d24c1789e4f9da534b7ca16ecc0c2cd319d6271757cb4f086558579f73\"},{\"command\":\"scriptreplay\",\"executable\":\"/usr/bin/scriptreplay\",\"sha256\":\"e47f72e2e16e39ed16412b9359f4fe0fa8f29f00234e6ac63fb9b2bbf3ce0339\"},{\"command\":\"sdiff\",\"executable\":\"/usr/bin/sdiff\",\"sha256\":\"fdaa16b8d42dc3abe6d7548ad6b86351047e9fbce6382fe33e4fe607cd7761af\"},{\"command\":\"sed\",\"executable\":\"/usr/bin/sed\",\"sha256\":\"23f70dd6496d75419823039e1cebf95a2fd0508c6dfec72ac2352f7e08391dd5\"},{\"command\":\"select-default-iwrap\",\"executable\":\"/usr/bin/select-default-iwrap\",\"sha256\":\"8887e11359e088e96a84494f36b38a9b60d13cb9170bf34d8c3f3a79a3894052\"},{\"command\":\"select-editor\",\"executable\":\"/usr/bin/select-editor\",\"sha256\":\"46ce6e3872a1807f83a958d647ededf626f3aab13ad4b078493358c59aa5b97e\"},{\"command\":\"sensible-browser\",\"executable\":\"/usr/bin/sensible-browser\",\"sha256\":\"0da2fd759bef3369bf3ff660ab0285525ac80836c5cc8adff977b0f714be2945\"},{\"command\":\"sensible-editor\",\"executable\":\"/usr/bin/sensible-editor\",\"sha256\":\"3c92be6eb21bf661df4cc75caa3bd1d587378b313d981ec17af318532d00689b\"},{\"command\":\"sensible-pager\",\"executable\":\"/usr/bin/sensible-pager\",\"sha256\":\"c1cc2231c552a691c0a7da73f9e79954cfa785921019385a2b7f1dedb4446940\"},{\"command\":\"sensible-terminal\",\"executable\":\"/usr/bin/sensible-terminal\",\"sha256\":\"98bbedd54ce47886213d09ab622872e4fb1742e9ba325a0202cfb8e3705ac510\"},{\"command\":\"seq\",\"executable\":\"/usr/bin/seq\",\"sha256\":\"5c7722126a4eabacda73788a6d46d4fd12d3ab5f393e19026f2dada114ec15c6\"},{\"command\":\"session-migration\",\"executable\":\"/usr/bin/session-migration\",\"sha256\":\"6d96065282cd4c04e0a64c113e7967b7d8bcfada6f9be442a01e0a6b2cea0950\"},{\"command\":\"setarch\",\"executable\":\"/usr/bin/setarch\",\"sha256\":\"9cbf126e4a5a2847313b38c766a6d52110bd31a2f90de871bc618166a046e624\"},{\"command\":\"setpriv\",\"executable\":\"/usr/bin/setpriv\",\"sha256\":\"96b083b79c32fd2f0c29657e88e20c7495839349fc64ad5d0503f32d26bf8733\"},{\"command\":\"setsid\",\"executable\":\"/usr/bin/setsid\",\"sha256\":\"fd90e9144a576149eb93e6e9250e04b7121bfcce31b562d0bf0d4441a6bf415a\"},{\"command\":\"setterm\",\"executable\":\"/usr/bin/setterm\",\"sha256\":\"3d421484f8447c6af92e816aecd5194120d397bc8c8affaedfc68629ea58e180\"},{\"command\":\"setxkbmap\",\"executable\":\"/usr/bin/setxkbmap\",\"sha256\":\"864426138b357f6be7210a2bc501540ec095dd24a90c85bff102a23ae2678a35\"},{\"command\":\"sftp\",\"executable\":\"/usr/bin/sftp\",\"sha256\":\"6a28f34c2689a69b6fe886d353ac63a655377b835db6cad8f77923b7f1780907\"},{\"command\":\"sg\",\"executable\":\"/usr/bin/newgrp\",\"sha256\":\"572ab15948df3969e929b902641c3a42e76dce7d71a22fbc58011ca89d8d965e\"},{\"command\":\"sh\",\"executable\":\"/usr/bin/dash\",\"sha256\":\"86d31f6fb799e91fa21bad341484564510ca287703a16e9e46c53338776f4f42\"},{\"command\":\"sha1sum\",\"executable\":\"/usr/bin/sha1sum\",\"sha256\":\"f83c56f59e80ad6027caf81fe507cbab151bf7c24bf76c342ca9f00edd1fafe5\"},{\"command\":\"sha224sum\",\"executable\":\"/usr/bin/sha224sum\",\"sha256\":\"0649450906d541d01851ebc46e1f9692f826ee0c2fc23048c4fa4816f34a0709\"},{\"command\":\"sha256sum\",\"executable\":\"/usr/bin/sha256sum\",\"sha256\":\"9992e1f1feb6f0f396bc8d6691ebc1adbfc269fd628bce84eda1d4ba5c3995c7\"},{\"command\":\"sha384sum\",\"executable\":\"/usr/bin/sha384sum\",\"sha256\":\"b81c50057daa04993d12208b519d1f166814c8a144a3cfe4f8372b02a281cf40\"},{\"command\":\"sha512sum\",\"executable\":\"/usr/bin/sha512sum\",\"sha256\":\"320d0dcefe6222ca812363a1b17db2a741d710c3d9cfe9db8cefdf84888ed74f\"},{\"command\":\"shasum\",\"executable\":\"/usr/bin/shasum\",\"sha256\":\"e3bad5e7cd244f5a24fbee97be7e9a90ee20993ff5b5213ffeac0e0976cffb7c\"},{\"command\":\"shred\",\"executable\":\"/usr/bin/shred\",\"sha256\":\"4adca9c461c53ff3a42c749ab9649e0559329bd41fab50de92e91b47586a246f\"},{\"command\":\"shuf\",\"executable\":\"/usr/bin/shuf\",\"sha256\":\"e6c8f1291f52bad0befa4ee3e8b2ff4cc2e32610056799a0fc70156c51689f82\"},{\"command\":\"size\",\"executable\":\"/usr/bin/x86_64-linux-gnu-size\",\"sha256\":\"ac2e5c6a62140912c3f36d5b65e12465eb75df372d81093a387a949a7d105fa9\"},{\"command\":\"skill\",\"executable\":\"/usr/bin/skill\",\"sha256\":\"51c25d633be75d08bea68f62dc527f9ca126267c695e7aec3ef76e23e2e21d72\"},{\"command\":\"slabtop\",\"executable\":\"/usr/bin/slabtop\",\"sha256\":\"6768483629307feb2248701f1dc0b2489d0565a1c076b3173345012a9bf6fa94\"},{\"command\":\"sleep\",\"executable\":\"/usr/bin/sleep\",\"sha256\":\"a65efec857cfac0d4f43fc53affa73794ff1d1fdcb547931d4b92a98bda8e646\"},{\"command\":\"slogin\",\"executable\":\"/usr/bin/ssh\",\"sha256\":\"3b0701113d8982d71c8cc74e5a1949f03c6f71da804cf4f3507315afbf07042c\"},{\"command\":\"slsa-validator\",\"executable\":\"/opt/prismpm/oracles/slsa-validator.mjs\",\"sha256\":\"04cdd2f287060cc2ba7a93b45ddcb899140451e9375e703aa4aabfee10800b7f\"},{\"command\":\"slsa-verifier\",\"executable\":\"/usr/local/bin/slsa-verifier\",\"sha256\":\"946dbec729094195e88ef78e1734324a27869f03e2c6bd2f61cbc06bd5350339\"},{\"command\":\"snice\",\"executable\":\"/usr/bin/skill\",\"sha256\":\"51c25d633be75d08bea68f62dc527f9ca126267c695e7aec3ef76e23e2e21d72\"},{\"command\":\"sort\",\"executable\":\"/usr/bin/sort\",\"sha256\":\"063baf220830f47b3acb3b68ea67c545d762b4d96d068db31b3a82c6a63fd0f6\"},{\"command\":\"spdx-validator\",\"executable\":\"/opt/prismpm/oracles/spdx-validator.mjs\",\"sha256\":\"e2670b02913ab07bef777fe30075892652b2fd8b78ca396d83916368946334a1\"},{\"command\":\"splain\",\"executable\":\"/usr/bin/splain\",\"sha256\":\"06b28f957c591b63f3c03dd5829ce85e7ce2daf29c82baa4c24445cdf40d3052\"},{\"command\":\"split\",\"executable\":\"/usr/bin/split\",\"sha256\":\"69ceb23ec8299ca9fd0394e33ed7d8ce1dbe9a1c8323b70551f80aa95830459a\"},{\"command\":\"ssh\",\"executable\":\"/usr/bin/ssh\",\"sha256\":\"3b0701113d8982d71c8cc74e5a1949f03c6f71da804cf4f3507315afbf07042c\"},{\"command\":\"ssh-add\",\"executable\":\"/usr/bin/ssh-add\",\"sha256\":\"a8f0927cd3c1600b8b3bbe41371bdf5110997eb89f9915d2864497b46b93e293\"},{\"command\":\"ssh-agent\",\"executable\":\"/usr/bin/ssh-agent\",\"sha256\":\"3eee1438cbceea275881c1e664a9676f398ba96f039121676db6ede654578e69\"},{\"command\":\"ssh-argv0\",\"executable\":\"/usr/bin/ssh-argv0\",\"sha256\":\"fcf4ffdfab652a0882b7b2417a25265d07a936c4268e2d3f4dec14797a9e5734\"},{\"command\":\"ssh-copy-id\",\"executable\":\"/usr/bin/ssh-copy-id\",\"sha256\":\"b625120eeff8b0e64e4e8c71e5ed3a7878fd69d318a88ce0a22e115725f6b815\"},{\"command\":\"ssh-keygen\",\"executable\":\"/usr/bin/ssh-keygen\",\"sha256\":\"bae95dd024aed593da92f8a03fcb5fca6b5a153f89f603bf8118a0cceb7c58f5\"},{\"command\":\"ssh-keyscan\",\"executable\":\"/usr/bin/ssh-keyscan\",\"sha256\":\"ddbcb80313f184b9cd913e564fd226e447b87cdf38d01b7dd18822c4f5fe3663\"},{\"command\":\"stat\",\"executable\":\"/usr/bin/stat\",\"sha256\":\"3b87d297111f11d30b3c51fd2663f131a161e09d8e130e1842adaefb74307efe\"},{\"command\":\"stdbuf\",\"executable\":\"/usr/bin/stdbuf\",\"sha256\":\"1fd37836e4a9060756fcec760b0b0f482621aad3fe13af39591a8c14b118eb5d\"},{\"command\":\"streamzip\",\"executable\":\"/usr/bin/streamzip\",\"sha256\":\"672ee1b2d50455c34d9fc4c294b68e757c4920196d6fdfb4295dd2d76e7696f8\"},{\"command\":\"strings\",\"executable\":\"/usr/bin/x86_64-linux-gnu-strings\",\"sha256\":\"04c76ab1b6e5039c321259351e8d576a597f60c45e41ff543dda5c8680256039\"},{\"command\":\"strip\",\"executable\":\"/usr/bin/x86_64-linux-gnu-strip\",\"sha256\":\"0d980587ada7ab12193f39271f060d5663aa2f289b0e80d2a0274ce7306e4e42\"},{\"command\":\"stty\",\"executable\":\"/usr/bin/stty\",\"sha256\":\"44728ed190ae65a0f11a0bff9e4a3d8e297e1cf5841786b7220e19b051c2fdc6\"},{\"command\":\"su\",\"executable\":\"/usr/bin/su\",\"sha256\":\"c74311fe5636b7d7f9a56239fa8adeeab12ba86fe7d41b91afa85bf9bbdae78b\"},{\"command\":\"sum\",\"executable\":\"/usr/bin/sum\",\"sha256\":\"5102384c6f094417cab21b7119ee8fcb9626f8ba5fb667ea253775ece9f7a6d8\"},{\"command\":\"sync\",\"executable\":\"/usr/bin/sync\",\"sha256\":\"5c395b95d52686ad295045ccb2272ec8858359df6bdc9655d3feffe650790969\"},{\"command\":\"systemctl\",\"executable\":\"/usr/bin/systemctl\",\"sha256\":\"7ba82b5ba146759c710e1b80fadaa3fdbc0f9b85c8fb2c8c3196b7b1a0037ef8\"},{\"command\":\"systemd\",\"executable\":\"/usr/lib/systemd/systemd\",\"sha256\":\"21941483d0d463b590b2bfb8ca818c81e70fd1f7f6b98d92e75395b90495f742\"},{\"command\":\"systemd-ac-power\",\"executable\":\"/usr/bin/systemd-ac-power\",\"sha256\":\"6b9f648c194026021468dbbc3bd713ddce84abb5438e4855cd4da2b368e44ecc\"},{\"command\":\"systemd-analyze\",\"executable\":\"/usr/bin/systemd-analyze\",\"sha256\":\"0a32460240bbe9fb2bb911667d15b6a224c4787698cee54d81c28e82cb6d1561\"},{\"command\":\"systemd-ask-password\",\"executable\":\"/usr/bin/systemd-ask-password\",\"sha256\":\"14434ebc97008c85e58102128debea61caf636e94dfd0cca785e8c4933313f0c\"},{\"command\":\"systemd-cat\",\"executable\":\"/usr/bin/systemd-cat\",\"sha256\":\"537e6b2ad83011b977a6677a89549597fd1868b2d6048022e6c22b4315ff8911\"},{\"command\":\"systemd-cgls\",\"executable\":\"/usr/bin/systemd-cgls\",\"sha256\":\"000c943b0d1764cfbac5dac87c690f9529cf91bda5fd00304fd564ea39d7a019\"},{\"command\":\"systemd-cgtop\",\"executable\":\"/usr/bin/systemd-cgtop\",\"sha256\":\"ae7aff88743f84fcfd4ab4b9996828cf0b277a9fd4ad624191ca968a33f173b3\"},{\"command\":\"systemd-confext\",\"executable\":\"/usr/bin/systemd-sysext\",\"sha256\":\"10e3b107872ef1ee9bb335d6cdeff3e81c0c06d8233c02ce660a4e147a9f38cd\"},{\"command\":\"systemd-creds\",\"executable\":\"/usr/bin/systemd-creds\",\"sha256\":\"d68cdaeefabd87422d99577efb3c64b01d796e3885a96bb21c277ff1b94448f8\"},{\"command\":\"systemd-cryptenroll\",\"executable\":\"/usr/bin/systemd-cryptenroll\",\"sha256\":\"0c50224e8d786589e091e1042ecbf8c6ac50cc1c73d1b540cfa92cc62e28ac3c\"},{\"command\":\"systemd-cryptsetup\",\"executable\":\"/usr/bin/systemd-cryptsetup\",\"sha256\":\"65d57d4ddeceefb1f646e92a4f0fd7b093b20341e097d1dd67fb070a7d385d4d\"},{\"command\":\"systemd-delta\",\"executable\":\"/usr/bin/systemd-delta\",\"sha256\":\"16b3fa5ef6c077650da022c238b8a9248855905f11f356a66213005011864c74\"},{\"command\":\"systemd-detect-virt\",\"executable\":\"/usr/bin/systemd-detect-virt\",\"sha256\":\"6164c9cee9192d71cbec070155ac7be896883bd07c92d082228eb50dba02bfb5\"},{\"command\":\"systemd-escape\",\"executable\":\"/usr/bin/systemd-escape\",\"sha256\":\"01045def183419296b085eb3d2072301b4eb756a40be423f459b57da2330837c\"},{\"command\":\"systemd-firstboot\",\"executable\":\"/usr/bin/systemd-firstboot\",\"sha256\":\"d005b71a4d111cbfc25ba2b4688183cdecd6fffa2df4149f85e79fa33c8b82ff\"},{\"command\":\"systemd-id128\",\"executable\":\"/usr/bin/systemd-id128\",\"sha256\":\"6cac230051233137d8505a66ee7caf3dc2cf50195bc8f882749e7a0e7c9465a7\"},{\"command\":\"systemd-inhibit\",\"executable\":\"/usr/bin/systemd-inhibit\",\"sha256\":\"696e8aff72a606ac7ad69ebd6dfd0bf92685f1cb72087c615da7af9d26300b0f\"},{\"command\":\"systemd-machine-id-setup\",\"executable\":\"/usr/bin/systemd-machine-id-setup\",\"sha256\":\"b3dc34b7b489bbec37e302c75d7858c8bf617f00e3623550116a434b5d180bf6\"},{\"command\":\"systemd-mount\",\"executable\":\"/usr/bin/systemd-mount\",\"sha256\":\"bd56b159ddb5484eed1af6c43cc53c9d8d159f690690e98c9f406dab66834d59\"},{\"command\":\"systemd-notify\",\"executable\":\"/usr/bin/systemd-notify\",\"sha256\":\"deb48f4bf30b543943532fa6eea405cb8f386a671678f379f7327bc83d9b34a2\"},{\"command\":\"systemd-path\",\"executable\":\"/usr/bin/systemd-path\",\"sha256\":\"87efd014d99f86c3b197464f683046b9dffa698631909978f7d5303c5dc7ebe2\"},{\"command\":\"systemd-repart\",\"executable\":\"/usr/bin/systemd-repart\",\"sha256\":\"4ab21da254bb8cb338e77dd445cfb2578b7d1a743ccc7f51bc12dac5479014da\"},{\"command\":\"systemd-run\",\"executable\":\"/usr/bin/systemd-run\",\"sha256\":\"49f0bf95eb8a781b93853bf9fc981b4929dd0009f55a3e6db95534c0a2d11716\"},{\"command\":\"systemd-socket-activate\",\"executable\":\"/usr/bin/systemd-socket-activate\",\"sha256\":\"70568b85a25b601f60b479d2e74bf97af1514b44369759b0be1d4517b3329230\"},{\"command\":\"systemd-stdio-bridge\",\"executable\":\"/usr/bin/systemd-stdio-bridge\",\"sha256\":\"3e1124c7a8e1ac73691e25f37f116e8216e66610e6fcc9059ac43426c9022a01\"},{\"command\":\"systemd-sysext\",\"executable\":\"/usr/bin/systemd-sysext\",\"sha256\":\"10e3b107872ef1ee9bb335d6cdeff3e81c0c06d8233c02ce660a4e147a9f38cd\"},{\"command\":\"systemd-sysusers\",\"executable\":\"/usr/bin/systemd-sysusers\",\"sha256\":\"96527faba1c8f0be146c38d0b2c00cb26ac186644763a64a09ba8b9c35b89714\"},{\"command\":\"systemd-tmpfiles\",\"executable\":\"/usr/bin/systemd-tmpfiles\",\"sha256\":\"6103cd56fc1607168851e7797abebc9b82c0a68ef663eaf5ed7ca370c87ac1ae\"},{\"command\":\"systemd-tty-ask-password-agent\",\"executable\":\"/usr/bin/systemd-tty-ask-password-agent\",\"sha256\":\"a6434866559bd9580b2a86114d2bd093ed1bee03f44f1815601209addfdce969\"},{\"command\":\"systemd-umount\",\"executable\":\"/usr/bin/systemd-mount\",\"sha256\":\"bd56b159ddb5484eed1af6c43cc53c9d8d159f690690e98c9f406dab66834d59\"},{\"command\":\"tabs\",\"executable\":\"/usr/bin/tabs\",\"sha256\":\"198e8d81923a7370827a0c469479dcb59b829e2fed74562e42fedfb23c38a00c\"},{\"command\":\"tac\",\"executable\":\"/usr/bin/tac\",\"sha256\":\"b226452f63d597c67032f820de88df96bb8eaf9dafecea94d09d72e3a62dac2f\"},{\"command\":\"tail\",\"executable\":\"/usr/bin/tail\",\"sha256\":\"871571a28ad9483140d92027915a263311462f4ca96e0451e38d6ebcce370c0b\"},{\"command\":\"tar\",\"executable\":\"/usr/bin/tar\",\"sha256\":\"6453fce2cf2dde32b86557bb44f533afb3b5171b59b8d21cc797b9b20d9c7b06\"},{\"command\":\"taskset\",\"executable\":\"/usr/bin/taskset\",\"sha256\":\"a9c851792e54e91fba7b827019380abee54e715b6817899c835e4f221354b260\"},{\"command\":\"tee\",\"executable\":\"/usr/bin/tee\",\"sha256\":\"8c1efbee8dbee25378fc941db29a88309d6a7525786e4ebba2dda08edb77615e\"},{\"command\":\"tempfile\",\"executable\":\"/usr/bin/tempfile\",\"sha256\":\"8faf51ec1f7519c28a37adc09fb3fc56ec926da27ff18c5e55472b1335e5030a\"},{\"command\":\"test\",\"executable\":\"/usr/bin/test\",\"sha256\":\"854ed66843b5586f657563b3e9a838c46d47b9f44cb7a301534a4b8d2c10297a\"},{\"command\":\"tic\",\"executable\":\"/usr/bin/tic\",\"sha256\":\"21bfaf468804f70b5f21d21d9a5e2bc9194427c5f63217c5dda4033e2c947b65\"},{\"command\":\"timedatectl\",\"executable\":\"/usr/bin/timedatectl\",\"sha256\":\"99e718fee7a83eb2bf1a1f3078357d86bdbec02c3f8096d3bbf266b56ba7a55d\"},{\"command\":\"timeout\",\"executable\":\"/usr/bin/timeout\",\"sha256\":\"4fccd5b0192653a2446b745d5385ea547b78e466150e07ade9e2caff2b7f4e08\"},{\"command\":\"tload\",\"executable\":\"/usr/bin/tload\",\"sha256\":\"b11ffce5be548aadae175edbc9cd20660dcf19601f82e5a32062d63e57b4e242\"},{\"command\":\"toe\",\"executable\":\"/usr/bin/toe\",\"sha256\":\"f6e3ed03989242340cb4d54136689ccb265fc9b48308ddec3e8b0dd390db2cc8\"},{\"command\":\"top\",\"executable\":\"/usr/bin/top\",\"sha256\":\"6fc5a0128c67df177ac2fc87393f9bfae8b4e492ba8de79de2feddb3873ece60\"},{\"command\":\"touch\",\"executable\":\"/usr/bin/touch\",\"sha256\":\"5244e873c97db0bc4cd9d491eac48d08fba366a7e6584b3fc6225e8aa9d2acaf\"},{\"command\":\"tput\",\"executable\":\"/usr/bin/tput\",\"sha256\":\"6a4c26ae7cf29711ce8d094092cd5e82276c2d5562323c607e802ba8dcf06d9d\"},{\"command\":\"tr\",\"executable\":\"/usr/bin/tr\",\"sha256\":\"ce32eb4705821ce89dbf770d1287959f58c452142350862637f09a8aed473213\"},{\"command\":\"true\",\"executable\":\"/usr/bin/true\",\"sha256\":\"4b5a5694e3c0e8b1d58fc52ac6ef076e55e72c2f53195243ac86d5ff517cc2f6\"},{\"command\":\"truncate\",\"executable\":\"/usr/bin/truncate\",\"sha256\":\"e15f93b2bcac7dbc4eca11128c824d0962651319e5dabff3868993dd60d51818\"},{\"command\":\"tset\",\"executable\":\"/usr/bin/tset\",\"sha256\":\"2c6a6465382ef8b3c31a2f518efee4eb2dfc3272b009d256828ec6eef14dee20\"},{\"command\":\"tsort\",\"executable\":\"/usr/bin/tsort\",\"sha256\":\"c09647757a8e7e47be6820c38398304df668dc99ca56ac906d99c2e95c621266\"},{\"command\":\"tty\",\"executable\":\"/usr/bin/tty\",\"sha256\":\"a55b5b1837b59e2266f92c51995acc5cdcf7db96d33cdeba99695ea11ad89e32\"},{\"command\":\"tzselect\",\"executable\":\"/usr/bin/tzselect\",\"sha256\":\"cd14fec50b626461cc68ccc830c269a839cae3bd56bb19b1caab34e16d531768\"},{\"command\":\"uclampset\",\"executable\":\"/usr/bin/uclampset\",\"sha256\":\"e6d631d90a5623b2225d2186a064345db3fd9b1e566143c6810222fbadd0a3b5\"},{\"command\":\"ucs2any\",\"executable\":\"/usr/bin/ucs2any\",\"sha256\":\"ec9fa22a504eb82479267c7553058877ea9ae179984b2f01307104ee2dd56485\"},{\"command\":\"umount\",\"executable\":\"/usr/bin/umount\",\"sha256\":\"2ea59b57d249d58c64b028b2acf6118b62dc3ba89012a1cf4ff5f5a9891f513d\"},{\"command\":\"uname\",\"executable\":\"/usr/bin/uname\",\"sha256\":\"8fd593fd9e1902eb67cfeba15642719b0ef6c44ba97febceac819e7e5c442abb\"},{\"command\":\"uncompress\",\"executable\":\"/usr/bin/uncompress\",\"sha256\":\"55c2f67ca4c3cca0ebac659f0075461dd671ec4937ecd6c71123bb49ed322ebd\"},{\"command\":\"unexpand\",\"executable\":\"/usr/bin/unexpand\",\"sha256\":\"5080f3d1273b774c7693c281626ae9efd9d44280f38b409935b7adc32840d6e9\"},{\"command\":\"uniq\",\"executable\":\"/usr/bin/uniq\",\"sha256\":\"96883a88d1152ae31f3216c2e162fab36da646b83e2ecca74f68b12192d21315\"},{\"command\":\"unlink\",\"executable\":\"/usr/bin/unlink\",\"sha256\":\"cfff86f31d7d52abcd26598e2ac49e3e1a81d5bb8aacbf2aaefd1b5053fc08d8\"},{\"command\":\"unlzma\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"b5b163eb273291934556377ab883b4b2a5d4da50bd0dc0a91774ecc234ccd8d0\"},{\"command\":\"unminimize\",\"executable\":\"/usr/bin/unminimize\",\"sha256\":\"36a235214133e557df60d3a417df146fe113cf54b36c8757c4f15d6378cdc5dc\"},{\"command\":\"unshare\",\"executable\":\"/usr/bin/unshare\",\"sha256\":\"51bcc77ba5db162c80028f861f0a2770d728c1de80773816d863f28d7a817adb\"},{\"command\":\"unxz\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"b5b163eb273291934556377ab883b4b2a5d4da50bd0dc0a91774ecc234ccd8d0\"},{\"command\":\"update-alternatives\",\"executable\":\"/usr/bin/update-alternatives\",\"sha256\":\"d98c3e7e7faee4e1e8f6de1e4fcbf6ce347eee2c31ac833bbcfa6bfe79d362e1\"},{\"command\":\"update-mime-database\",\"executable\":\"/usr/bin/update-mime-database\",\"sha256\":\"6c5902d10ec225bdf57674252264647f6dfa8feeab66ae78544fe067ca875a42\"},{\"command\":\"uptime\",\"executable\":\"/usr/bin/uptime\",\"sha256\":\"08718198389f9f5f818f21cb0bb5a2382297119d4ade1e847628120cedaf8fd9\"},{\"command\":\"users\",\"executable\":\"/usr/bin/users\",\"sha256\":\"4982fc1289cc265f2407a4505291e12dc71cd2cd9b317cd8f059b7089bbfc01f\"},{\"command\":\"utmpdump\",\"executable\":\"/usr/bin/utmpdump\",\"sha256\":\"d788b00bad92438a1bc152d58f4963bb94b9d506a7a0413bea2d5adbd699f9a9\"},{\"command\":\"varlinkctl\",\"executable\":\"/usr/bin/varlinkctl\",\"sha256\":\"5dd2637677dc6909712b01a0aa27059ef4b1ce0312f336b114562e59fb35166b\"},{\"command\":\"vdir\",\"executable\":\"/usr/bin/vdir\",\"sha256\":\"e6b2b3f142086d859eabad590cfbd98ee2269f039578c87495f9e3dc672dbf92\"},{\"command\":\"vmstat\",\"executable\":\"/usr/bin/vmstat\",\"sha256\":\"6f043d6af3c19bd2d1f331b70870bf7bf14375873390cd401eb5588f795f5511\"},{\"command\":\"w\",\"executable\":\"/usr/bin/w\",\"sha256\":\"aa252429dd2488b1424be7953db1d39c00e61f64321bb8be95c347830beb5ce7\"},{\"command\":\"wall\",\"executable\":\"/usr/bin/wall\",\"sha256\":\"11e4712e60d647a5ea372effaaa6e439cb89df3ce03c076e23998b0451e06f56\"},{\"command\":\"wasm-bindgen\",\"executable\":\"/usr/local/cargo/bin/wasm-bindgen\",\"sha256\":\"b488545de6a75ed6c8fdd04d6d466948917ab83081a3405f800c61c2e6757141\"},{\"command\":\"wasm-bindgen-test-runner\",\"executable\":\"/usr/local/cargo/bin/wasm-bindgen-test-runner\",\"sha256\":\"3cbe6d053d9443393a6d3a46e827e1ab8316391553c227f48fe2dcb0e6c56c26\"},{\"command\":\"wasm-tools\",\"executable\":\"/usr/local/cargo/bin/wasm-tools\",\"sha256\":\"ea93fb629a38fa65d7ee6e288dcdd550f6692c7ecfb5b245cce99e8942ebee02\"},{\"command\":\"wasm2es6js\",\"executable\":\"/usr/local/cargo/bin/wasm2es6js\",\"sha256\":\"f84c8d93ce3590599233ef37ada92411ed197d040d7dbf4f932a79e134be3c0e\"},{\"command\":\"wasmtime\",\"executable\":\"/usr/local/cargo/bin/wasmtime\",\"sha256\":\"fb51aeee3ca704d1c72b3fc1926ab9d04ec8372596075f0179975626aeb5ad2f\"},{\"command\":\"watch\",\"executable\":\"/usr/bin/watch\",\"sha256\":\"9f0914d71c91703009c5c5ddd5a31580c58751a827ff86b7222acdb5769c8037\"},{\"command\":\"wc\",\"executable\":\"/usr/bin/wc\",\"sha256\":\"e22049f5ec4c81d4b7e4eb2b75484cdee9ab49f9760f79d9c7e5b1c05084cf15\"},{\"command\":\"wdctl\",\"executable\":\"/usr/bin/wdctl\",\"sha256\":\"2c499b8cf9c4c81f1db7217fb7769ed4b4dce18da4ca33317fa0fc38a56864e1\"},{\"command\":\"wget\",\"executable\":\"/usr/bin/wget\",\"sha256\":\"e898a05b4c2e3d76b2fd8ea37cc0af7529dc4cbe6391f6a1954267608b5e4726\"},{\"command\":\"whereis\",\"executable\":\"/usr/bin/whereis\",\"sha256\":\"0dacc09f179f28f33353ca1e0b92d43ca5cfcc6a0046bc24e8ea264937424d94\"},{\"command\":\"which\",\"executable\":\"/usr/bin/which.debianutils\",\"sha256\":\"59e7cf8b9bd8711ae1aa6f7bbbd4132b61492409c3afe8e1505225efda1cb8f6\"},{\"command\":\"which.debianutils\",\"executable\":\"/usr/bin/which.debianutils\",\"sha256\":\"59e7cf8b9bd8711ae1aa6f7bbbd4132b61492409c3afe8e1505225efda1cb8f6\"},{\"command\":\"who\",\"executable\":\"/usr/bin/who\",\"sha256\":\"78adec63cd53b6a59b02fc494d1e0f956cc760c28367d6725a4afc6cc1e620c2\"},{\"command\":\"whoami\",\"executable\":\"/usr/bin/whoami\",\"sha256\":\"bdc3d53d181fc6149049f6cb0a8db5b155557b41fd93093b7a7c42eff883aeaf\"},{\"command\":\"x86_64\",\"executable\":\"/usr/bin/setarch\",\"sha256\":\"9cbf126e4a5a2847313b38c766a6d52110bd31a2f90de871bc618166a046e624\"},{\"command\":\"x86_64-linux-gnu-addr2line\",\"executable\":\"/usr/bin/x86_64-linux-gnu-addr2line\",\"sha256\":\"a116f9e176f9f1ef6e2ab31ad41bacb9d2571b479725ebdfe10fb9cb70aa9e53\"},{\"command\":\"x86_64-linux-gnu-ar\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ar\",\"sha256\":\"6452af2eea333b8c65e1adb92964fc8f97863ab003fa13f9d12bff5345cd7dbe\"},{\"command\":\"x86_64-linux-gnu-as\",\"executable\":\"/usr/bin/x86_64-linux-gnu-as\",\"sha256\":\"21aff249b692b5c31a44007491f922dcb49f41323e362c57d2ada3f52eddb7f0\"},{\"command\":\"x86_64-linux-gnu-c++filt\",\"executable\":\"/usr/bin/x86_64-linux-gnu-c++filt\",\"sha256\":\"2c11b66c0fad24afc649517f890eaa8a6a4d4dceb1d613c5631bb96ff09352b4\"},{\"command\":\"x86_64-linux-gnu-cpp\",\"executable\":\"/usr/bin/x86_64-linux-gnu-cpp-13\",\"sha256\":\"c48f8b1b5ab757134970d17bc2ecd889df0d1245463036e834ab9be9d5e40765\"},{\"command\":\"x86_64-linux-gnu-cpp-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-cpp-13\",\"sha256\":\"c48f8b1b5ab757134970d17bc2ecd889df0d1245463036e834ab9be9d5e40765\"},{\"command\":\"x86_64-linux-gnu-dwp\",\"executable\":\"/usr/bin/x86_64-linux-gnu-dwp\",\"sha256\":\"b4c1bbd491718b74d93a384297728a8c242c62cd040187adc78355b736548553\"},{\"command\":\"x86_64-linux-gnu-elfedit\",\"executable\":\"/usr/bin/x86_64-linux-gnu-elfedit\",\"sha256\":\"c246c9722b60da558f104f8c517c760401bf995c9d4916954c0055a45e8bdb03\"},{\"command\":\"x86_64-linux-gnu-g++\",\"executable\":\"/usr/bin/x86_64-linux-gnu-g++-13\",\"sha256\":\"1353e9bdd29a7295c7226bf6c63abccce056d8cac31f112e5cdbecc3f28c2769\"},{\"command\":\"x86_64-linux-gnu-g++-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-g++-13\",\"sha256\":\"1353e9bdd29a7295c7226bf6c63abccce056d8cac31f112e5cdbecc3f28c2769\"},{\"command\":\"x86_64-linux-gnu-gcc\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-13\",\"sha256\":\"1b99826121ae6682a634e5efe09bd3e3df58ce58e0b28f849114ab5b89139c26\"},{\"command\":\"x86_64-linux-gnu-gcc-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-13\",\"sha256\":\"1b99826121ae6682a634e5efe09bd3e3df58ce58e0b28f849114ab5b89139c26\"},{\"command\":\"x86_64-linux-gnu-gcc-ar\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-ar-13\",\"sha256\":\"b980c6ffedb8ceb443f2a95bd3c935a4d6aba09fa05da66864cbcaf2ec79f5c3\"},{\"command\":\"x86_64-linux-gnu-gcc-ar-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-ar-13\",\"sha256\":\"b980c6ffedb8ceb443f2a95bd3c935a4d6aba09fa05da66864cbcaf2ec79f5c3\"},{\"command\":\"x86_64-linux-gnu-gcc-nm\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-nm-13\",\"sha256\":\"b7149256b3cb154a1670c0b17ac8d2c4a7cfa03180ccdef3a4cc5183dd9f1688\"},{\"command\":\"x86_64-linux-gnu-gcc-nm-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-nm-13\",\"sha256\":\"b7149256b3cb154a1670c0b17ac8d2c4a7cfa03180ccdef3a4cc5183dd9f1688\"},{\"command\":\"x86_64-linux-gnu-gcc-ranlib\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-ranlib-13\",\"sha256\":\"c685333bc0ce5a0b432a2263184b378c4182a897e2239091adffac5c965baad1\"},{\"command\":\"x86_64-linux-gnu-gcc-ranlib-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcc-ranlib-13\",\"sha256\":\"c685333bc0ce5a0b432a2263184b378c4182a897e2239091adffac5c965baad1\"},{\"command\":\"x86_64-linux-gnu-gcov\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-13\",\"sha256\":\"d6298eb8f6da8a5ab277498aac6e5c7695c4d0119d4b0c54285dd8bcf0f58e42\"},{\"command\":\"x86_64-linux-gnu-gcov-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-13\",\"sha256\":\"d6298eb8f6da8a5ab277498aac6e5c7695c4d0119d4b0c54285dd8bcf0f58e42\"},{\"command\":\"x86_64-linux-gnu-gcov-dump\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-dump-13\",\"sha256\":\"13b1027b23cd99ae477ee65495053f091fdbc906135d5b00b86273a8541035b9\"},{\"command\":\"x86_64-linux-gnu-gcov-dump-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-dump-13\",\"sha256\":\"13b1027b23cd99ae477ee65495053f091fdbc906135d5b00b86273a8541035b9\"},{\"command\":\"x86_64-linux-gnu-gcov-tool\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-tool-13\",\"sha256\":\"6b85d6f4b85ed0de1db931e73b957cd79cd95076357d957018d6906306fb213b\"},{\"command\":\"x86_64-linux-gnu-gcov-tool-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gcov-tool-13\",\"sha256\":\"6b85d6f4b85ed0de1db931e73b957cd79cd95076357d957018d6906306fb213b\"},{\"command\":\"x86_64-linux-gnu-gold\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ld.gold\",\"sha256\":\"1083eca2c464601fae4b561b1c240e7f787543261891229eebe0b112801c1e13\"},{\"command\":\"x86_64-linux-gnu-gp-archive\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gp-archive\",\"sha256\":\"c3264d9d4b4ce229bcbac43db09e16b57cae242226b449b7327637fe0660c6fb\"},{\"command\":\"x86_64-linux-gnu-gp-collect-app\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gp-collect-app\",\"sha256\":\"1b12058e818536a7c9febf81d621acf182d261f8464b1aee5d745be5dfcfa2b2\"},{\"command\":\"x86_64-linux-gnu-gp-display-html\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gp-display-html\",\"sha256\":\"538acc2bcc24a50de51e88b2d733d50b69237ebfee14660e45a0255215d9f582\"},{\"command\":\"x86_64-linux-gnu-gp-display-src\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gp-display-src\",\"sha256\":\"ba224f01f3c51400529841b905bcf69ec8087b1cf9d2c96ed062d8b43984c6d8\"},{\"command\":\"x86_64-linux-gnu-gp-display-text\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gp-display-text\",\"sha256\":\"2d7e0d598c873dc2b7735edc49309b7fab9db821cbb749b5ab8d62d1b9b66112\"},{\"command\":\"x86_64-linux-gnu-gprof\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gprof\",\"sha256\":\"71796a26dca3349994b73462bfb49980c05d6181f62c42d6e2c97aed1108a5a0\"},{\"command\":\"x86_64-linux-gnu-gprofng\",\"executable\":\"/usr/bin/x86_64-linux-gnu-gprofng\",\"sha256\":\"91e03573aeedded12a3b80e96ba28316968a8a86af78f0434cd7e87b7691df62\"},{\"command\":\"x86_64-linux-gnu-ld\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ld.bfd\",\"sha256\":\"e9ceb054c12207970f2726dfc07e9a66b411602748628baf27399f02a9bbb31b\"},{\"command\":\"x86_64-linux-gnu-ld.bfd\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ld.bfd\",\"sha256\":\"e9ceb054c12207970f2726dfc07e9a66b411602748628baf27399f02a9bbb31b\"},{\"command\":\"x86_64-linux-gnu-ld.gold\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ld.gold\",\"sha256\":\"1083eca2c464601fae4b561b1c240e7f787543261891229eebe0b112801c1e13\"},{\"command\":\"x86_64-linux-gnu-lto-dump\",\"executable\":\"/usr/bin/x86_64-linux-gnu-lto-dump-13\",\"sha256\":\"ed86753e90565306d3bd55483964eff30dc5b19a0a2cec80bd3c5825c4f8dd57\"},{\"command\":\"x86_64-linux-gnu-lto-dump-13\",\"executable\":\"/usr/bin/x86_64-linux-gnu-lto-dump-13\",\"sha256\":\"ed86753e90565306d3bd55483964eff30dc5b19a0a2cec80bd3c5825c4f8dd57\"},{\"command\":\"x86_64-linux-gnu-nm\",\"executable\":\"/usr/bin/x86_64-linux-gnu-nm\",\"sha256\":\"3708df3d7ce16e2c1dcdcd722784ae382d4d582276a71ab7bbe2d542f5621202\"},{\"command\":\"x86_64-linux-gnu-objcopy\",\"executable\":\"/usr/bin/x86_64-linux-gnu-objcopy\",\"sha256\":\"9276e918e3c26d3aa7ef9dd2232cd8ac692f03d3c1f270bfa5144a2b5492b713\"},{\"command\":\"x86_64-linux-gnu-objdump\",\"executable\":\"/usr/bin/x86_64-linux-gnu-objdump\",\"sha256\":\"325c4205a4c658a9d1e1ebc469ae55975a2b897a3d3c1e79d9b158612d37f745\"},{\"command\":\"x86_64-linux-gnu-pkg-config\",\"executable\":\"/usr/bin/pkgconf\",\"sha256\":\"7e8152db1b0c7e49d47b4b82a70dc9997b557951c5d4d938b0e7f208ce9eb10b\"},{\"command\":\"x86_64-linux-gnu-pkgconf\",\"executable\":\"/usr/bin/pkgconf\",\"sha256\":\"7e8152db1b0c7e49d47b4b82a70dc9997b557951c5d4d938b0e7f208ce9eb10b\"},{\"command\":\"x86_64-linux-gnu-ranlib\",\"executable\":\"/usr/bin/x86_64-linux-gnu-ranlib\",\"sha256\":\"60254978b8ee2c1b21b41d16a18a621dbbcc72e43eb2fa9f916818256c77e9ee\"},{\"command\":\"x86_64-linux-gnu-readelf\",\"executable\":\"/usr/bin/x86_64-linux-gnu-readelf\",\"sha256\":\"64c58e15274bbbb5153f31078e455e9e77ee5f51489e709bba5bb788ce9df2b0\"},{\"command\":\"x86_64-linux-gnu-size\",\"executable\":\"/usr/bin/x86_64-linux-gnu-size\",\"sha256\":\"ac2e5c6a62140912c3f36d5b65e12465eb75df372d81093a387a949a7d105fa9\"},{\"command\":\"x86_64-linux-gnu-strings\",\"executable\":\"/usr/bin/x86_64-linux-gnu-strings\",\"sha256\":\"04c76ab1b6e5039c321259351e8d576a597f60c45e41ff543dda5c8680256039\"},{\"command\":\"x86_64-linux-gnu-strip\",\"executable\":\"/usr/bin/x86_64-linux-gnu-strip\",\"sha256\":\"0d980587ada7ab12193f39271f060d5663aa2f289b0e80d2a0274ce7306e4e42\"},{\"command\":\"xargs\",\"executable\":\"/usr/bin/xargs\",\"sha256\":\"fa3818410ee7be85ca1484ce44e7c3043fb2d0b8402b42dcd9c3ffca78eb02fa\"},{\"command\":\"xauth\",\"executable\":\"/usr/bin/xauth\",\"sha256\":\"ffcb5f569bf9fce94cbf37f5d61790d463508c6122511a5f4c6e280d3633086e\"},{\"command\":\"xkbbell\",\"executable\":\"/usr/bin/xkbbell\",\"sha256\":\"c0995426a17c3f5e0d4b3e14d87fac2123b83610e9e4ae82cde74bc327586461\"},{\"command\":\"xkbcomp\",\"executable\":\"/usr/bin/xkbcomp\",\"sha256\":\"0967e7e7b03b077327cea74567726b265bd304b4fdf59f87bf7fdfe1074e7591\"},{\"command\":\"xkbevd\",\"executable\":\"/usr/bin/xkbevd\",\"sha256\":\"c942b3566e664d9345032ce0b5e51d693ec5d731d4c826672dca3675ad0e82d3\"},{\"command\":\"xkbprint\",\"executable\":\"/usr/bin/xkbprint\",\"sha256\":\"a15ecd04694f022166e9b8d9b83845c17140d9d775e70bac2bb0d1fff34f9170\"},{\"command\":\"xkbvleds\",\"executable\":\"/usr/bin/xkbvleds\",\"sha256\":\"22ca03b8615db64f507da23f20a98b192b25c4bbf14bc0933cb1aee766d2e436\"},{\"command\":\"xkbwatch\",\"executable\":\"/usr/bin/xkbwatch\",\"sha256\":\"8015a6735d25e78ed785adc9cc44982794fa44334ae87dabaeff40c0621ffd1a\"},{\"command\":\"xsubpp\",\"executable\":\"/usr/bin/xsubpp\",\"sha256\":\"c8c0f265dd2f3f247f179a5464bddfe6391b9e06996e961fa15c51c2e26e39a3\"},{\"command\":\"xvfb-run\",\"executable\":\"/usr/bin/xvfb-run\",\"sha256\":\"48ee444c30fdaaede4cc311644b30e554162e956f949b206858e37eb8ba1ae05\"},{\"command\":\"xz\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"b5b163eb273291934556377ab883b4b2a5d4da50bd0dc0a91774ecc234ccd8d0\"},{\"command\":\"xzcat\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"b5b163eb273291934556377ab883b4b2a5d4da50bd0dc0a91774ecc234ccd8d0\"},{\"command\":\"xzcmp\",\"executable\":\"/usr/bin/xzdiff\",\"sha256\":\"551e26acd2c7d3f56ab6f43916cfcaafb96955eda66b656f1ed9a708f52e7667\"},{\"command\":\"xzdiff\",\"executable\":\"/usr/bin/xzdiff\",\"sha256\":\"551e26acd2c7d3f56ab6f43916cfcaafb96955eda66b656f1ed9a708f52e7667\"},{\"command\":\"xzegrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"xzfgrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"xzgrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"xzless\",\"executable\":\"/usr/bin/xzless\",\"sha256\":\"a25b3dee9826b993f4fe0043e6d3073c6658925c28afc303917d62b1cf465051\"},{\"command\":\"xzmore\",\"executable\":\"/usr/bin/xzmore\",\"sha256\":\"e40b6cfbd6dcfd6fa46b721f7afb36efbbf3a8fbea1cd20f64b6123400f39306\"},{\"command\":\"yarn\",\"executable\":\"/usr/lib/node_modules/yarn/bin/yarn.js\",\"sha256\":\"148e19db309ec9eaf7720b28df811337906eea8a1758deaa54afee60a6305e04\"},{\"command\":\"yarnpkg\",\"executable\":\"/usr/lib/node_modules/yarn/bin/yarn.js\",\"sha256\":\"148e19db309ec9eaf7720b28df811337906eea8a1758deaa54afee60a6305e04\"},{\"command\":\"yes\",\"executable\":\"/usr/bin/yes\",\"sha256\":\"556e21eeb4cb2bf1ae9be95b3996259e055e8a8ac0918447afcce2a6f26ac96c\"},{\"command\":\"ypdomainname\",\"executable\":\"/usr/bin/hostname\",\"sha256\":\"071fec20458397874e6121589d5210e7eed22a1b1afe16c2b9970b8a8233cc5b\"},{\"command\":\"zcat\",\"executable\":\"/usr/bin/zcat\",\"sha256\":\"f0b4d86b6a10064b7f2f41a452ab5437f61d4f17d8b1ab3488f3f345519f4f8d\"},{\"command\":\"zcmp\",\"executable\":\"/usr/bin/zcmp\",\"sha256\":\"6e6da15f127e06d61cbdabb59d3ec9b28b8605178dbe2acf7d275aa6d22e2d0f\"},{\"command\":\"zdiff\",\"executable\":\"/usr/bin/zdiff\",\"sha256\":\"1bcb10de5c01db497f845980ee4e79ec32f025443588a7410ba5001512a61ec9\"},{\"command\":\"zdump\",\"executable\":\"/usr/bin/zdump\",\"sha256\":\"f05239af3242000707dbed1186d973315ab5117464e4538fc3583054830a4abf\"},{\"command\":\"zegrep\",\"executable\":\"/usr/bin/zegrep\",\"sha256\":\"67ee7fadec7ea53b4c1f8cfc3c81427b29c0b1381e80b55642617620c84d0bcc\"},{\"command\":\"zfgrep\",\"executable\":\"/usr/bin/zfgrep\",\"sha256\":\"87ab5f4c7cb344e409d614d1a69cc156b3b1053d6ae0b59d8e2c2131f3e63e5a\"},{\"command\":\"zforce\",\"executable\":\"/usr/bin/zforce\",\"sha256\":\"61b3a0106c72648199611b79caf2e7a8c0800a8ef5745193cc0fa16455a79901\"},{\"command\":\"zgrep\",\"executable\":\"/usr/bin/zgrep\",\"sha256\":\"2f506d3547724df8e8dc9bdfa73bccb1a641b530fd5a40adc9b537f851d86b7f\"},{\"command\":\"zipdetails\",\"executable\":\"/usr/bin/zipdetails\",\"sha256\":\"58439587867aabee0504e493722c74e0725f649f4050848c91c59d48e90cd34f\"},{\"command\":\"zless\",\"executable\":\"/usr/bin/zless\",\"sha256\":\"e29f317fc56ce49eb5bd1e938b7f87923b91b40e5516ec9146f678519330f6bb\"},{\"command\":\"zmore\",\"executable\":\"/usr/bin/zmore\",\"sha256\":\"bb9ee270bee119238c74779fb5fa5cddc7939ec4923a22c5649bcb9aa7d70b76\"},{\"command\":\"znew\",\"executable\":\"/usr/bin/znew\",\"sha256\":\"969931d9eadae06db92a01b00458aa43d86bdf3692020d6f10b0fb8d060e1f38\"}],\"schema\":\"prismpm/sdk-inventory/1\"}\n","manifest_digest":"sha256:fc87624954a1985f2a6594946aa22ca16efc4095fe8d6d9b18f21c69e937f7dc","platform":"linux/amd64"},{"inventory":[{"digest":"sha256:1e88b7e9aa26ad5cd17601aad064de5b07c1251128b5def20f79d24438b5f4be","id":"action","kind":"workflow","version":"0.3.0"},{"digest":"sha256:5d63cd6921f790c8637e716b632d7777899f37166eff0a6010cd19d1e9127044","id":"adapter-compose","kind":"adapter","version":"compose-spec@fee041b381ffd4aad263410980bdce0cdf4beb7d"},{"digest":"sha256:db0425b35e875a36af50fb3a73e491af9badc759b6c290a731d6fd23fd62c119","id":"adapter-github-pages","kind":"adapter","version":"github-pages-artifact@v4"},{"digest":"sha256:59df071a35deca05e62224e43b82d7bc9b5c649f989a3424fd704123633a539e","id":"adapter-github-pages-browser","kind":"adapter","version":"github-pages-artifact@v4"},{"digest":"sha256:12021a034cb9b796f1ab6b4431e5cdbd9803e16181f6378ce580e40764b62ff6","id":"adapter-kubernetes","kind":"adapter","version":"1.36.4"},{"digest":"sha256:6bec0a3910568ff84f28b8fd9c2f63e3fcde7986bebf3e24b1f4649c150d735b","id":"asyncapi-3.1.0-official-corpus","kind":"test-corpus","version":"b3fac5bb522771428ea57b16129b273cd3ea0180"},{"digest":"sha256:87f962245c8ad4fa95a972f8f67ed9804df22ee385197ae403dafae8b375995e","id":"asyncapi-embedded-launcher","kind":"oracle","version":"1"},{"digest":"sha256:b93c35a475df94fa05d817de7d0a78d569b7c9be932004accdb4dad032bbb729","id":"asyncapi-embedded-runtime","kind":"oracle","version":"@asyncapi/parser/3.6.0"},{"digest":"sha256:5bd20ce206d3b3b76a7034951c9e19e15291c54eec0a1424139b465c980f1205","id":"asyncapi-embedded-runtime-lock","kind":"dependency-lock","version":"@asyncapi/parser/3.6.0"},{"digest":"sha256:dbb7252527064804ec138bb391c90b26d08d3db5d47c4995735d56865c3f9882","id":"asyncapi-embedded-runtime-tests","kind":"test-corpus","version":"1"},{"digest":"sha256:b10e96e4bda8f1971585e93fe2c6e3872af558d5ae185374fb7500933992ae60","id":"asyncapi-oracle","kind":"oracle","version":"3.1.0"},{"digest":"sha256:ace18379af8bcc5723f49c7d50e322fadb8bc5c34102cebba2bb4746f1d82b5b","id":"asyncapi-website-adeo-schemas","kind":"test-corpus","version":"20a31a0396b41dd24b1bac877ab7ce3f58037c28"},{"digest":"sha256:24d82f845768c66d79d87052a265a56e28ad576eb31495a31fdaf716cb6ea43d","id":"bootstrap-historical-runner","kind":"binary","version":"0.2.0-runner/1"},{"digest":"sha256:ed0f35e94108a629d4a163417bc13bf61e86a51fc6a7c05455fc7544ce8eec1b","id":"bootstrap-historical-runtime","kind":"binary","version":"0.2.0-runner/1"},{"digest":"sha256:3010124a16784fd361fd3527e8a0e8638d23da8e6ee951108b6e1a0a2c8804bb","id":"browser-account-genesis-construction","kind":"adapter","version":"1"},{"digest":"sha256:1607f069b641cc17df572eaab24fb2ce47288107e8f5a1fc670e94cc9eee3e88","id":"browser-host-primitives","kind":"adapter","version":"1"},{"digest":"sha256:0e2bcaef56d041a486784e54104a81aebe0da44bd03019bd70bc0401e42e4a97","id":"build-base","kind":"base-image","version":"rust-1.97.1-bookworm"},{"digest":"sha256:331555b57a45b264327ec4f034c189f64e20956b630a2d6b9053e767bbb53e90","id":"chromium-input-authority","kind":"dependency-lock","version":"157.0.8099.0"},{"digest":"sha256:ae6f7357f1eea754f07f555dd263d30f2d30ca8cf5440b2494c14facf34743af","id":"chromium-input-installer","kind":"oracle","version":"1"},{"digest":"sha256:48aa53d280e5e78275acfff62ae0173ac06fc86af86c379cad693e05e74a7803","id":"cloudevents-1.0.2-fixtures","kind":"test-corpus","version":"1.0.2"},{"digest":"sha256:519ec1d39566de154730bc87930f274be947d0eff0ce7d5ed00606cb4bda2117","id":"cloudevents-sdk-conformance","kind":"oracle","version":"2.16.2"},{"digest":"sha256:38480c5a48f73d20b8aa0db8366e22ae4ab34c245a370a11b8862cfbdeb5c6d1","id":"cloudevents-sdk-go-corpus","kind":"test-corpus","version":"2.16.2"},{"digest":"sha256:7d91646555ef85ca92aef3c100efd3c36a3b76b1f46000ffa1558b4715a25d58","id":"cloudevents-validator","kind":"oracle","version":"sdk-go/2.16.2"},{"digest":"sha256:cd65e860cbad537bf76598f8e910e9cb027f7c90b1f09252141837df0240d4af","id":"conformance-corpus","kind":"test-corpus","version":"prismpm/ids/1"},{"digest":"sha256:d16d2c85ab2024a98c62f0d8c9fc195f5177ee65e9d6598ac84ecc6e3ede4fed","id":"contracts","kind":"schema","version":"1"},{"digest":"sha256:4e850583cc68ffd8d739ddb8a782b83f2ef9d3bf437ae7c44da4fbfde2613a8e","id":"docker-buildx","kind":"binary","version":"0.28.0"},{"digest":"sha256:cf122ae443d3fcad8b90fe30277d3c37e008c60d56c9658a44848bdb6f2078d4","id":"git-tag-root-akihirosuda","kind":"trust-root","version":"github-key-record-5228653"},{"digest":"sha256:929c5c98f56be683921c84a1ccd542d0d8df3e75657c3711d5557da35267b637","id":"git-tag-root-hayden-io","kind":"trust-root","version":"github-key-record-682831"},{"digest":"sha256:c0f83ab885c007561550bda8d540e620b2ac4e36af0a4b48cd320854a3cf2ea4","id":"git-tag-root-songy23","kind":"trust-root","version":"github-key-record-276780"},{"digest":"sha256:e33e1416f08d6ee24f1c66f3895be7d919ff58c0d4318f2934ec4743f75f0a7e","id":"git-tag-root-sudo-bmitch","kind":"trust-root","version":"github-key-record-2155637"},{"digest":"sha256:6cbad548e30d2e227d1cea0ee23bb09c06c506c27094ccd8f55137d0bef17371","id":"in-toto-attestation-1.0-source","kind":"test-corpus","version":"ee16c68a11dfcfbdc891600cacd767896fe6e724"},{"digest":"sha256:ccda3abd60d6616425f0f4af1b1444dd1245e76c4c9fa1b8bba4d2f65e587f02","id":"intoto-statement-validator","kind":"oracle","version":"1.0@ee16c68a"},{"digest":"sha256:8f63dc2d12ed947bfa4ae4cabab2d5926ecc06d86d054b6a3a4f3454446b5551","id":"json-schema-2020-12-corpus","kind":"test-corpus","version":"c9510e3bf8a896c3cba4e08509cf752b4f30dff8"},{"digest":"sha256:79fb1d26fa5a39385d59fdc48a711a14b0710ca6480271acce99b4d177cea085","id":"lean","kind":"binary","version":"4.32.1"},{"digest":"sha256:29270825b581f950b3914509b7a0613f34964f003eb3c61772636d0805b09148","id":"lean4-prod","kind":"crate","version":"991956fe427bb646498fd0912c89b71be71e7beb"},{"digest":"sha256:a11a0a0245ee53ed4058eed14ca705d12a731131bd519069ce6e8e21bdd6f77d","id":"lean4-prod-exporter","kind":"binary","version":"991956fe427bb646498fd0912c89b71be71e7beb"},{"digest":"sha256:82bba2fcfabbaa1ae29d80331e2459ebfb663d777759ebe1fcd9b6121e61a504","id":"lean4-prod-exporter-seed","kind":"dependency-lock","version":"1"},{"digest":"sha256:8bc50bb93c2d510a366b879161ea5f0741e4039b6c43bd55c3b9b8a7b15f13de","id":"leanchecker","kind":"binary","version":"4.32.1"},{"digest":"sha256:fa5f07242a5ad0bffc563dae614bf83dec075043ad03c5486b54e2b478f752a5","id":"lexlean","kind":"binary","version":"0.3.0"},{"digest":"sha256:c3b22a1cef1975004c948e04005f02c013c02f9698c04da07998e9e13e875acc","id":"oci-distribution-1.1.1-corpus","kind":"test-corpus","version":"a139cc423184af6078077b9b7ee336eddbd03f8f"},{"digest":"sha256:6fa5e5b29dd6727e2e0af3eacdac7f5597a77bde14ef16957467ebfe42cc40fd","id":"oci-distribution-conformance","kind":"oracle","version":"1.1.1@a139cc42"},{"digest":"sha256:6c00d78efd45b6a3acc798497851b21585867042cbdc63dbe0c105825b8dac91","id":"oci-image-1.1.1-corpus","kind":"test-corpus","version":"147f9c13cedb47a0c4d9a11a222961073d585877"},{"digest":"sha256:b1342cb1c38c1072e2c86a0e35343605d2bf5c63affa768a5116c1d5fc68e4b0","id":"oci-image-schema-conformance","kind":"oracle","version":"1.1.1@147f9c13"},{"digest":"sha256:9bf0da1272040438e13ce349a39a1dd036c3432f82e2cec5b17d2aa7db316e8a","id":"oci-runtime-1.3.0-corpus","kind":"test-corpus","version":"92249139eea7161e13745abd4cb6d0ea02a3227a"},{"digest":"sha256:e2a80254467d17855b584e82aaf1c248c7cbe58ad6a18c4af3d7d783b7081b78","id":"oci-runtime-validate","kind":"oracle","version":"1.3.0@92249139"},{"digest":"sha256:7ee100439bc7dc35cda162b85be68140338bdae5aa3c2fb79412cca621bdd9b1","id":"openid-conformance","kind":"oracle","version":"3e09b13b896f"},{"digest":"sha256:a35012f67dccd4296ab0e380eb86a0e053dbbf6bf52522aca3ed961c83812197","id":"openid-conformance-suite-corpus","kind":"test-corpus","version":"3e09b13b896fce95d78c2c0f931feee9614e9452"},{"digest":"sha256:90cdf6a86d9f2f7c9b60f66c9be7c296b394dfef57ac5e28d78965565252f223","id":"opentelemetry-0.136.0-signal-corpus","kind":"test-corpus","version":"0.136.0"},{"digest":"sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e","id":"playwright-chromium","kind":"oracle","version":"1.62.1"},{"digest":"sha256:8d81de4103b7e342d0f997526d84fb334bf92b562f1035bc66da8b77a0b02ab7","id":"playwright-core","kind":"oracle","version":"1.62.1"},{"digest":"sha256:bf3497a2d26912da443d74ef55c0d8155e00a781e3e6c966368d8bd2c8380b5c","id":"playwright-driver","kind":"oracle","version":"1.62.1"},{"digest":"sha256:49e77977a9f39581feb53d2b3e058790417236010d41e982930b3aeafb35a159","id":"playwright-headless-shell","kind":"oracle","version":"157.0.8099.0"},{"digest":"sha256:58f398f5453e170e19842360ac1bb3ceda2ea032306527bbeb3adf6650b52bca","id":"prism-stdlib","kind":"crate","version":"0.2.0"},{"digest":"sha256:62da63d950a9bee4bd2a7d8c5ff254222aca45780c9b5862856a5dff61e9fe7b","id":"prismpm","kind":"binary","version":"0.3.0"},{"digest":"sha256:578e2e0ab7ee0859ee39b6f45d72b6c79ae5680b9f17c22264ed374db7bc1b11","id":"prismpm-conformance","kind":"binary","version":"0.3.0"},{"digest":"sha256:909e32fb88aaa039f362d1bba795ae97762c1957d297223c454a457ed8e90d9a","id":"prismpm-platform-equivalence","kind":"binary","version":"0.3.0"},{"digest":"sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e","id":"runtime-base","kind":"base-image","version":"playwright-v1.62.1-noble"},{"digest":"sha256:22cb82bbc6142c670dfc2b21b225d01edcd036c4e870ef4b668c9e3efa8bb6f1","id":"runtime-os-lock","kind":"dependency-lock","version":"ubuntu-noble@20260901T000000Z"},{"digest":"sha256:2fa9d3ee26c523899ae5314861306daff716320095cd638f1cd54fbff44cd208","id":"sdk-exporter-seed-producer","kind":"schema","version":"1"},{"digest":"sha256:18d8f8d10061d2e4d4ee627cd051481cb79ea366300d191a0e7f81ac8f87f182","id":"sdk-image-input-authorities","kind":"test-corpus","version":"1"},{"digest":"sha256:7f441845b1a471b97b9756b7cbe3f48c6e1997be9acd36cece415111c8453d79","id":"sdk-image-input-verifier","kind":"test-corpus","version":"1"},{"digest":"sha256:d025c5be578b5d2b334c02917cefa3ff60a1fd8b21de7d06348a300ec1b8a072","id":"sdk-metadata-capture","kind":"schema","version":"1"},{"digest":"sha256:d84af5d749355ea4dd97519ee1a7710cc43d8f307d1b8c43cdf93f3e51c24db1","id":"sdk-metadata-cli","kind":"schema","version":"1"},{"digest":"sha256:fb287316d82f21b36386f3a6532af61d4205cee18b74f4c3db2737a90113037d","id":"sdk-metadata-credentials","kind":"schema","version":"1"},{"digest":"sha256:6945bb2808808d2ca6ed237dadfe5749989a0f9c94579ab64280f3e84592cbdf","id":"sdk-metadata-helper","kind":"schema","version":"1"},{"digest":"sha256:3f860b40d5ad29751a592d50f1dc703cdef04a0f0929bcefd90cc844ccc58d43","id":"sdk-metadata-helper-supervisor","kind":"schema","version":"1"},{"digest":"sha256:52951e1caf9eb692436f83c5c5dc0f23ec0a864926140ee3db1e217d823707d5","id":"sdk-metadata-layer","kind":"schema","version":"1"},{"digest":"sha256:ab7c2ce88b40760294514ca846cda0671a8709438c8361f0a18fa1ffa4030732","id":"sdk-metadata-transport","kind":"schema","version":"1"},{"digest":"sha256:870ece6967ce85585dd1935f742ef05d8a4a4111d54ea30b541a43857b43533b","id":"sdk-platform-lock","kind":"schema","version":"2"},{"digest":"sha256:6e0162633a2d8b8ec973c6fb15e1d48e55f92c5889b90961a3a1b17937aa3e97","id":"sdk-vv-advisory","kind":"test-corpus","version":"d5c17953a895cf19e8d3ce66eaa42b6fcfe1fb16"},{"digest":"sha256:f3dd999f5618db154fa06222a06f9de95d86e1dbf683954426ea91c974cbe24c","id":"sdk-vv-bootstrap","kind":"test-corpus","version":"0.2.0"},{"digest":"sha256:f66e5cd2482cf80b5b529b7688b14602753cb8654707a0762c0a49f333d71091","id":"sdk-vv-manifest","kind":"test-corpus","version":"1"},{"digest":"sha256:96c3af78e543b0d02d8972816daee3b58ef421e667cb41d4ea7b421653aa73a9","id":"sdk-vv-policy","kind":"test-corpus","version":"1"},{"digest":"sha256:ecac1c34797bad411cf8a5b9bfe9a1d3c58d33d6c4ec0b25e21be89a92156840","id":"sdk-vv-source","kind":"test-corpus","version":"35e9f01d5415ed4b0b64c152238f291546957ec4"},{"digest":"sha256:d9028fd7692fae3a56dd29848c629ea564e67bbf3f6804f557f6b153a1ceb35c","id":"sdk-vv-verifier","kind":"test-corpus","version":"1"},{"digest":"sha256:844a1c6de3986c9f02070266b25e0d1a2fa99ceccc89f6b9ad90aae47b62a16e","id":"sigstore-trusted-root","kind":"trust-root","version":"cosign-3.1.3-default-services"},{"digest":"sha256:2fa271a49fd04807437003e3a2e8d7d39c3b635b4815a72d1ec2f5f216adaaea","id":"spdx-3.0.1-fixtures","kind":"test-corpus","version":"3.0.1"},{"digest":"sha256:8db53aa63cfc7565f79e057a4da362d4144c546d56320a51b838befe8371b17d","id":"spdx-3.0.1-model","kind":"test-corpus","version":"a745f63e8643d5ae0f0851fcfa6836085308f80b"},{"digest":"sha256:e611189a0028aa1ac4bbd2ee3f06c664a39c7351c65e942b3f2b53e4ab1e3212","id":"spdx-3.0.1-schema","kind":"schema","version":"3.0.1"},{"digest":"sha256:e2670b02913ab07bef777fe30075892652b2fd8b78ca396d83916368946334a1","id":"spdx-validator","kind":"oracle","version":"ajv-8.20.0+spdx-3.0.1"},{"digest":"sha256:54448d21cb1ed3a4af826aa44991e9839b51d97b8975a5b125927c78af922b46","id":"standards-and-oracles","kind":"oracle","version":"prismpm/standards-lock/1"},{"digest":"sha256:840617fbc4df682f893bdefe4f5320de16aebabc20c84936c8a583765e890ff0","id":"stdlib-sources","kind":"crate","version":"0.2.0-sources"},{"digest":"sha256:3629fa180f625d4de2e3fd3b15b12c5d42315e5733ecae6d1550b306abd7d482","id":"timeout","kind":"binary","version":"coreutils-9.4"},{"digest":"sha256:1885ce2b3409b4f2b4a569c378d243f4a75e22fc10d59a69a69a1cacc16dda9e","id":"unicode-17.0.0-normalization-corpus","kind":"test-corpus","version":"17.0.0"},{"digest":"sha256:299e79e16e6c76cd6b770c66763f436e5b6a947b4280926b9d3b4e3ec99c885b","id":"workflow-reusable-sdk","kind":"workflow","version":"0.3.0"}],"inventory_digest":"sha256:48670d0e608c04d2f4a7415a240a3fc7c9082016854fbd240953d15dc3858108","inventory_document":"{\"artifacts\":[{\"digest\":\"sha256:1e88b7e9aa26ad5cd17601aad064de5b07c1251128b5def20f79d24438b5f4be\",\"id\":\"action\",\"kind\":\"workflow\",\"version\":\"0.3.0\"},{\"digest\":\"sha256:5d63cd6921f790c8637e716b632d7777899f37166eff0a6010cd19d1e9127044\",\"id\":\"adapter-compose\",\"kind\":\"adapter\",\"version\":\"compose-spec@fee041b381ffd4aad263410980bdce0cdf4beb7d\"},{\"digest\":\"sha256:db0425b35e875a36af50fb3a73e491af9badc759b6c290a731d6fd23fd62c119\",\"id\":\"adapter-github-pages\",\"kind\":\"adapter\",\"version\":\"github-pages-artifact@v4\"},{\"digest\":\"sha256:59df071a35deca05e62224e43b82d7bc9b5c649f989a3424fd704123633a539e\",\"id\":\"adapter-github-pages-browser\",\"kind\":\"adapter\",\"version\":\"github-pages-artifact@v4\"},{\"digest\":\"sha256:12021a034cb9b796f1ab6b4431e5cdbd9803e16181f6378ce580e40764b62ff6\",\"id\":\"adapter-kubernetes\",\"kind\":\"adapter\",\"version\":\"1.36.4\"},{\"digest\":\"sha256:6bec0a3910568ff84f28b8fd9c2f63e3fcde7986bebf3e24b1f4649c150d735b\",\"id\":\"asyncapi-3.1.0-official-corpus\",\"kind\":\"test-corpus\",\"version\":\"b3fac5bb522771428ea57b16129b273cd3ea0180\"},{\"digest\":\"sha256:87f962245c8ad4fa95a972f8f67ed9804df22ee385197ae403dafae8b375995e\",\"id\":\"asyncapi-embedded-launcher\",\"kind\":\"oracle\",\"version\":\"1\"},{\"digest\":\"sha256:b93c35a475df94fa05d817de7d0a78d569b7c9be932004accdb4dad032bbb729\",\"id\":\"asyncapi-embedded-runtime\",\"kind\":\"oracle\",\"version\":\"@asyncapi/parser/3.6.0\"},{\"digest\":\"sha256:5bd20ce206d3b3b76a7034951c9e19e15291c54eec0a1424139b465c980f1205\",\"id\":\"asyncapi-embedded-runtime-lock\",\"kind\":\"dependency-lock\",\"version\":\"@asyncapi/parser/3.6.0\"},{\"digest\":\"sha256:dbb7252527064804ec138bb391c90b26d08d3db5d47c4995735d56865c3f9882\",\"id\":\"asyncapi-embedded-runtime-tests\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:b10e96e4bda8f1971585e93fe2c6e3872af558d5ae185374fb7500933992ae60\",\"id\":\"asyncapi-oracle\",\"kind\":\"oracle\",\"version\":\"3.1.0\"},{\"digest\":\"sha256:ace18379af8bcc5723f49c7d50e322fadb8bc5c34102cebba2bb4746f1d82b5b\",\"id\":\"asyncapi-website-adeo-schemas\",\"kind\":\"test-corpus\",\"version\":\"20a31a0396b41dd24b1bac877ab7ce3f58037c28\"},{\"digest\":\"sha256:24d82f845768c66d79d87052a265a56e28ad576eb31495a31fdaf716cb6ea43d\",\"id\":\"bootstrap-historical-runner\",\"kind\":\"binary\",\"version\":\"0.2.0-runner/1\"},{\"digest\":\"sha256:ed0f35e94108a629d4a163417bc13bf61e86a51fc6a7c05455fc7544ce8eec1b\",\"id\":\"bootstrap-historical-runtime\",\"kind\":\"binary\",\"version\":\"0.2.0-runner/1\"},{\"digest\":\"sha256:3010124a16784fd361fd3527e8a0e8638d23da8e6ee951108b6e1a0a2c8804bb\",\"id\":\"browser-account-genesis-construction\",\"kind\":\"adapter\",\"version\":\"1\"},{\"digest\":\"sha256:1607f069b641cc17df572eaab24fb2ce47288107e8f5a1fc670e94cc9eee3e88\",\"id\":\"browser-host-primitives\",\"kind\":\"adapter\",\"version\":\"1\"},{\"digest\":\"sha256:0e2bcaef56d041a486784e54104a81aebe0da44bd03019bd70bc0401e42e4a97\",\"id\":\"build-base\",\"kind\":\"base-image\",\"version\":\"rust-1.97.1-bookworm\"},{\"digest\":\"sha256:331555b57a45b264327ec4f034c189f64e20956b630a2d6b9053e767bbb53e90\",\"id\":\"chromium-input-authority\",\"kind\":\"dependency-lock\",\"version\":\"157.0.8099.0\"},{\"digest\":\"sha256:ae6f7357f1eea754f07f555dd263d30f2d30ca8cf5440b2494c14facf34743af\",\"id\":\"chromium-input-installer\",\"kind\":\"oracle\",\"version\":\"1\"},{\"digest\":\"sha256:48aa53d280e5e78275acfff62ae0173ac06fc86af86c379cad693e05e74a7803\",\"id\":\"cloudevents-1.0.2-fixtures\",\"kind\":\"test-corpus\",\"version\":\"1.0.2\"},{\"digest\":\"sha256:519ec1d39566de154730bc87930f274be947d0eff0ce7d5ed00606cb4bda2117\",\"id\":\"cloudevents-sdk-conformance\",\"kind\":\"oracle\",\"version\":\"2.16.2\"},{\"digest\":\"sha256:38480c5a48f73d20b8aa0db8366e22ae4ab34c245a370a11b8862cfbdeb5c6d1\",\"id\":\"cloudevents-sdk-go-corpus\",\"kind\":\"test-corpus\",\"version\":\"2.16.2\"},{\"digest\":\"sha256:7d91646555ef85ca92aef3c100efd3c36a3b76b1f46000ffa1558b4715a25d58\",\"id\":\"cloudevents-validator\",\"kind\":\"oracle\",\"version\":\"sdk-go/2.16.2\"},{\"digest\":\"sha256:cd65e860cbad537bf76598f8e910e9cb027f7c90b1f09252141837df0240d4af\",\"id\":\"conformance-corpus\",\"kind\":\"test-corpus\",\"version\":\"prismpm/ids/1\"},{\"digest\":\"sha256:d16d2c85ab2024a98c62f0d8c9fc195f5177ee65e9d6598ac84ecc6e3ede4fed\",\"id\":\"contracts\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:4e850583cc68ffd8d739ddb8a782b83f2ef9d3bf437ae7c44da4fbfde2613a8e\",\"id\":\"docker-buildx\",\"kind\":\"binary\",\"version\":\"0.28.0\"},{\"digest\":\"sha256:cf122ae443d3fcad8b90fe30277d3c37e008c60d56c9658a44848bdb6f2078d4\",\"id\":\"git-tag-root-akihirosuda\",\"kind\":\"trust-root\",\"version\":\"github-key-record-5228653\"},{\"digest\":\"sha256:929c5c98f56be683921c84a1ccd542d0d8df3e75657c3711d5557da35267b637\",\"id\":\"git-tag-root-hayden-io\",\"kind\":\"trust-root\",\"version\":\"github-key-record-682831\"},{\"digest\":\"sha256:c0f83ab885c007561550bda8d540e620b2ac4e36af0a4b48cd320854a3cf2ea4\",\"id\":\"git-tag-root-songy23\",\"kind\":\"trust-root\",\"version\":\"github-key-record-276780\"},{\"digest\":\"sha256:e33e1416f08d6ee24f1c66f3895be7d919ff58c0d4318f2934ec4743f75f0a7e\",\"id\":\"git-tag-root-sudo-bmitch\",\"kind\":\"trust-root\",\"version\":\"github-key-record-2155637\"},{\"digest\":\"sha256:6cbad548e30d2e227d1cea0ee23bb09c06c506c27094ccd8f55137d0bef17371\",\"id\":\"in-toto-attestation-1.0-source\",\"kind\":\"test-corpus\",\"version\":\"ee16c68a11dfcfbdc891600cacd767896fe6e724\"},{\"digest\":\"sha256:ccda3abd60d6616425f0f4af1b1444dd1245e76c4c9fa1b8bba4d2f65e587f02\",\"id\":\"intoto-statement-validator\",\"kind\":\"oracle\",\"version\":\"1.0@ee16c68a\"},{\"digest\":\"sha256:8f63dc2d12ed947bfa4ae4cabab2d5926ecc06d86d054b6a3a4f3454446b5551\",\"id\":\"json-schema-2020-12-corpus\",\"kind\":\"test-corpus\",\"version\":\"c9510e3bf8a896c3cba4e08509cf752b4f30dff8\"},{\"digest\":\"sha256:79fb1d26fa5a39385d59fdc48a711a14b0710ca6480271acce99b4d177cea085\",\"id\":\"lean\",\"kind\":\"binary\",\"version\":\"4.32.1\"},{\"digest\":\"sha256:29270825b581f950b3914509b7a0613f34964f003eb3c61772636d0805b09148\",\"id\":\"lean4-prod\",\"kind\":\"crate\",\"version\":\"991956fe427bb646498fd0912c89b71be71e7beb\"},{\"digest\":\"sha256:a11a0a0245ee53ed4058eed14ca705d12a731131bd519069ce6e8e21bdd6f77d\",\"id\":\"lean4-prod-exporter\",\"kind\":\"binary\",\"version\":\"991956fe427bb646498fd0912c89b71be71e7beb\"},{\"digest\":\"sha256:82bba2fcfabbaa1ae29d80331e2459ebfb663d777759ebe1fcd9b6121e61a504\",\"id\":\"lean4-prod-exporter-seed\",\"kind\":\"dependency-lock\",\"version\":\"1\"},{\"digest\":\"sha256:8bc50bb93c2d510a366b879161ea5f0741e4039b6c43bd55c3b9b8a7b15f13de\",\"id\":\"leanchecker\",\"kind\":\"binary\",\"version\":\"4.32.1\"},{\"digest\":\"sha256:fa5f07242a5ad0bffc563dae614bf83dec075043ad03c5486b54e2b478f752a5\",\"id\":\"lexlean\",\"kind\":\"binary\",\"version\":\"0.3.0\"},{\"digest\":\"sha256:c3b22a1cef1975004c948e04005f02c013c02f9698c04da07998e9e13e875acc\",\"id\":\"oci-distribution-1.1.1-corpus\",\"kind\":\"test-corpus\",\"version\":\"a139cc423184af6078077b9b7ee336eddbd03f8f\"},{\"digest\":\"sha256:6fa5e5b29dd6727e2e0af3eacdac7f5597a77bde14ef16957467ebfe42cc40fd\",\"id\":\"oci-distribution-conformance\",\"kind\":\"oracle\",\"version\":\"1.1.1@a139cc42\"},{\"digest\":\"sha256:6c00d78efd45b6a3acc798497851b21585867042cbdc63dbe0c105825b8dac91\",\"id\":\"oci-image-1.1.1-corpus\",\"kind\":\"test-corpus\",\"version\":\"147f9c13cedb47a0c4d9a11a222961073d585877\"},{\"digest\":\"sha256:b1342cb1c38c1072e2c86a0e35343605d2bf5c63affa768a5116c1d5fc68e4b0\",\"id\":\"oci-image-schema-conformance\",\"kind\":\"oracle\",\"version\":\"1.1.1@147f9c13\"},{\"digest\":\"sha256:9bf0da1272040438e13ce349a39a1dd036c3432f82e2cec5b17d2aa7db316e8a\",\"id\":\"oci-runtime-1.3.0-corpus\",\"kind\":\"test-corpus\",\"version\":\"92249139eea7161e13745abd4cb6d0ea02a3227a\"},{\"digest\":\"sha256:e2a80254467d17855b584e82aaf1c248c7cbe58ad6a18c4af3d7d783b7081b78\",\"id\":\"oci-runtime-validate\",\"kind\":\"oracle\",\"version\":\"1.3.0@92249139\"},{\"digest\":\"sha256:7ee100439bc7dc35cda162b85be68140338bdae5aa3c2fb79412cca621bdd9b1\",\"id\":\"openid-conformance\",\"kind\":\"oracle\",\"version\":\"3e09b13b896f\"},{\"digest\":\"sha256:a35012f67dccd4296ab0e380eb86a0e053dbbf6bf52522aca3ed961c83812197\",\"id\":\"openid-conformance-suite-corpus\",\"kind\":\"test-corpus\",\"version\":\"3e09b13b896fce95d78c2c0f931feee9614e9452\"},{\"digest\":\"sha256:90cdf6a86d9f2f7c9b60f66c9be7c296b394dfef57ac5e28d78965565252f223\",\"id\":\"opentelemetry-0.136.0-signal-corpus\",\"kind\":\"test-corpus\",\"version\":\"0.136.0\"},{\"digest\":\"sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e\",\"id\":\"playwright-chromium\",\"kind\":\"oracle\",\"version\":\"1.62.1\"},{\"digest\":\"sha256:8d81de4103b7e342d0f997526d84fb334bf92b562f1035bc66da8b77a0b02ab7\",\"id\":\"playwright-core\",\"kind\":\"oracle\",\"version\":\"1.62.1\"},{\"digest\":\"sha256:bf3497a2d26912da443d74ef55c0d8155e00a781e3e6c966368d8bd2c8380b5c\",\"id\":\"playwright-driver\",\"kind\":\"oracle\",\"version\":\"1.62.1\"},{\"digest\":\"sha256:49e77977a9f39581feb53d2b3e058790417236010d41e982930b3aeafb35a159\",\"id\":\"playwright-headless-shell\",\"kind\":\"oracle\",\"version\":\"157.0.8099.0\"},{\"digest\":\"sha256:58f398f5453e170e19842360ac1bb3ceda2ea032306527bbeb3adf6650b52bca\",\"id\":\"prism-stdlib\",\"kind\":\"crate\",\"version\":\"0.2.0\"},{\"digest\":\"sha256:62da63d950a9bee4bd2a7d8c5ff254222aca45780c9b5862856a5dff61e9fe7b\",\"id\":\"prismpm\",\"kind\":\"binary\",\"version\":\"0.3.0\"},{\"digest\":\"sha256:578e2e0ab7ee0859ee39b6f45d72b6c79ae5680b9f17c22264ed374db7bc1b11\",\"id\":\"prismpm-conformance\",\"kind\":\"binary\",\"version\":\"0.3.0\"},{\"digest\":\"sha256:909e32fb88aaa039f362d1bba795ae97762c1957d297223c454a457ed8e90d9a\",\"id\":\"prismpm-platform-equivalence\",\"kind\":\"binary\",\"version\":\"0.3.0\"},{\"digest\":\"sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e\",\"id\":\"runtime-base\",\"kind\":\"base-image\",\"version\":\"playwright-v1.62.1-noble\"},{\"digest\":\"sha256:22cb82bbc6142c670dfc2b21b225d01edcd036c4e870ef4b668c9e3efa8bb6f1\",\"id\":\"runtime-os-lock\",\"kind\":\"dependency-lock\",\"version\":\"ubuntu-noble@20260901T000000Z\"},{\"digest\":\"sha256:2fa9d3ee26c523899ae5314861306daff716320095cd638f1cd54fbff44cd208\",\"id\":\"sdk-exporter-seed-producer\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:18d8f8d10061d2e4d4ee627cd051481cb79ea366300d191a0e7f81ac8f87f182\",\"id\":\"sdk-image-input-authorities\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:7f441845b1a471b97b9756b7cbe3f48c6e1997be9acd36cece415111c8453d79\",\"id\":\"sdk-image-input-verifier\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:d025c5be578b5d2b334c02917cefa3ff60a1fd8b21de7d06348a300ec1b8a072\",\"id\":\"sdk-metadata-capture\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:d84af5d749355ea4dd97519ee1a7710cc43d8f307d1b8c43cdf93f3e51c24db1\",\"id\":\"sdk-metadata-cli\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:fb287316d82f21b36386f3a6532af61d4205cee18b74f4c3db2737a90113037d\",\"id\":\"sdk-metadata-credentials\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:6945bb2808808d2ca6ed237dadfe5749989a0f9c94579ab64280f3e84592cbdf\",\"id\":\"sdk-metadata-helper\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:3f860b40d5ad29751a592d50f1dc703cdef04a0f0929bcefd90cc844ccc58d43\",\"id\":\"sdk-metadata-helper-supervisor\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:52951e1caf9eb692436f83c5c5dc0f23ec0a864926140ee3db1e217d823707d5\",\"id\":\"sdk-metadata-layer\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:ab7c2ce88b40760294514ca846cda0671a8709438c8361f0a18fa1ffa4030732\",\"id\":\"sdk-metadata-transport\",\"kind\":\"schema\",\"version\":\"1\"},{\"digest\":\"sha256:870ece6967ce85585dd1935f742ef05d8a4a4111d54ea30b541a43857b43533b\",\"id\":\"sdk-platform-lock\",\"kind\":\"schema\",\"version\":\"2\"},{\"digest\":\"sha256:6e0162633a2d8b8ec973c6fb15e1d48e55f92c5889b90961a3a1b17937aa3e97\",\"id\":\"sdk-vv-advisory\",\"kind\":\"test-corpus\",\"version\":\"d5c17953a895cf19e8d3ce66eaa42b6fcfe1fb16\"},{\"digest\":\"sha256:f3dd999f5618db154fa06222a06f9de95d86e1dbf683954426ea91c974cbe24c\",\"id\":\"sdk-vv-bootstrap\",\"kind\":\"test-corpus\",\"version\":\"0.2.0\"},{\"digest\":\"sha256:f66e5cd2482cf80b5b529b7688b14602753cb8654707a0762c0a49f333d71091\",\"id\":\"sdk-vv-manifest\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:96c3af78e543b0d02d8972816daee3b58ef421e667cb41d4ea7b421653aa73a9\",\"id\":\"sdk-vv-policy\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:ecac1c34797bad411cf8a5b9bfe9a1d3c58d33d6c4ec0b25e21be89a92156840\",\"id\":\"sdk-vv-source\",\"kind\":\"test-corpus\",\"version\":\"35e9f01d5415ed4b0b64c152238f291546957ec4\"},{\"digest\":\"sha256:d9028fd7692fae3a56dd29848c629ea564e67bbf3f6804f557f6b153a1ceb35c\",\"id\":\"sdk-vv-verifier\",\"kind\":\"test-corpus\",\"version\":\"1\"},{\"digest\":\"sha256:844a1c6de3986c9f02070266b25e0d1a2fa99ceccc89f6b9ad90aae47b62a16e\",\"id\":\"sigstore-trusted-root\",\"kind\":\"trust-root\",\"version\":\"cosign-3.1.3-default-services\"},{\"digest\":\"sha256:2fa271a49fd04807437003e3a2e8d7d39c3b635b4815a72d1ec2f5f216adaaea\",\"id\":\"spdx-3.0.1-fixtures\",\"kind\":\"test-corpus\",\"version\":\"3.0.1\"},{\"digest\":\"sha256:8db53aa63cfc7565f79e057a4da362d4144c546d56320a51b838befe8371b17d\",\"id\":\"spdx-3.0.1-model\",\"kind\":\"test-corpus\",\"version\":\"a745f63e8643d5ae0f0851fcfa6836085308f80b\"},{\"digest\":\"sha256:e611189a0028aa1ac4bbd2ee3f06c664a39c7351c65e942b3f2b53e4ab1e3212\",\"id\":\"spdx-3.0.1-schema\",\"kind\":\"schema\",\"version\":\"3.0.1\"},{\"digest\":\"sha256:e2670b02913ab07bef777fe30075892652b2fd8b78ca396d83916368946334a1\",\"id\":\"spdx-validator\",\"kind\":\"oracle\",\"version\":\"ajv-8.20.0+spdx-3.0.1\"},{\"digest\":\"sha256:54448d21cb1ed3a4af826aa44991e9839b51d97b8975a5b125927c78af922b46\",\"id\":\"standards-and-oracles\",\"kind\":\"oracle\",\"version\":\"prismpm/standards-lock/1\"},{\"digest\":\"sha256:840617fbc4df682f893bdefe4f5320de16aebabc20c84936c8a583765e890ff0\",\"id\":\"stdlib-sources\",\"kind\":\"crate\",\"version\":\"0.2.0-sources\"},{\"digest\":\"sha256:3629fa180f625d4de2e3fd3b15b12c5d42315e5733ecae6d1550b306abd7d482\",\"id\":\"timeout\",\"kind\":\"binary\",\"version\":\"coreutils-9.4\"},{\"digest\":\"sha256:1885ce2b3409b4f2b4a569c378d243f4a75e22fc10d59a69a69a1cacc16dda9e\",\"id\":\"unicode-17.0.0-normalization-corpus\",\"kind\":\"test-corpus\",\"version\":\"17.0.0\"},{\"digest\":\"sha256:299e79e16e6c76cd6b770c66763f436e5b6a947b4280926b9d3b4e3ec99c885b\",\"id\":\"workflow-reusable-sdk\",\"kind\":\"workflow\",\"version\":\"0.3.0\"}],\"commands\":[{\"command\":\"Xvfb\",\"executable\":\"/usr/bin/Xvfb\",\"sha256\":\"5ca4be733f4b4599f684563771f87d4672f1caf9a06b55613ec5dff66fec8bd9\"},{\"command\":\"[\",\"executable\":\"/usr/bin/[\",\"sha256\":\"598445e174e4da2c39135e7a8d92e7595eb1ccfb38c4e8583ed15f22a1703339\"},{\"command\":\"aarch64-linux-gnu-addr2line\",\"executable\":\"/usr/bin/aarch64-linux-gnu-addr2line\",\"sha256\":\"ed4a2a90659b5a37a0c5b11cabb87cf98dfc1b3ece62ef11d66758bbb0af8d5c\"},{\"command\":\"aarch64-linux-gnu-ar\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ar\",\"sha256\":\"f4583a612510e038dbc1ae8afb5eae5f0445c435bdd7c4c28e78acc7e757d2b1\"},{\"command\":\"aarch64-linux-gnu-as\",\"executable\":\"/usr/bin/aarch64-linux-gnu-as\",\"sha256\":\"1ffda50efb6d91b6b05ef933aced099595c36577594c0296c91161f2d13db374\"},{\"command\":\"aarch64-linux-gnu-c++filt\",\"executable\":\"/usr/bin/aarch64-linux-gnu-c++filt\",\"sha256\":\"aa08d269fe1c87b8737179c9c07813f615366185d4e7668c7c503e8278daa62f\"},{\"command\":\"aarch64-linux-gnu-cpp\",\"executable\":\"/usr/bin/aarch64-linux-gnu-cpp-13\",\"sha256\":\"f1cb3f991a50e83bce2b9f9573fe280a2572208ef88805adcf5de317f86f230e\"},{\"command\":\"aarch64-linux-gnu-cpp-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-cpp-13\",\"sha256\":\"f1cb3f991a50e83bce2b9f9573fe280a2572208ef88805adcf5de317f86f230e\"},{\"command\":\"aarch64-linux-gnu-dwp\",\"executable\":\"/usr/bin/aarch64-linux-gnu-dwp\",\"sha256\":\"5c3139afd1082faea0e0e42af65af52f15a2bc2f6dcce7014a2d0bd77309486c\"},{\"command\":\"aarch64-linux-gnu-elfedit\",\"executable\":\"/usr/bin/aarch64-linux-gnu-elfedit\",\"sha256\":\"9289f2befbe76fbf8cb8ef0087bed8fbdf5d964d507afce2607662bc600ec514\"},{\"command\":\"aarch64-linux-gnu-g++\",\"executable\":\"/usr/bin/aarch64-linux-gnu-g++-13\",\"sha256\":\"fc02363794280f404c6ca6f5da1c8fe469be902e9de140d35d8573bb3393f53b\"},{\"command\":\"aarch64-linux-gnu-g++-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-g++-13\",\"sha256\":\"fc02363794280f404c6ca6f5da1c8fe469be902e9de140d35d8573bb3393f53b\"},{\"command\":\"aarch64-linux-gnu-gcc\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-13\",\"sha256\":\"a20520ee21543f243d40636a9181a142c45ecd989de31ab86b99a8ea5ada870d\"},{\"command\":\"aarch64-linux-gnu-gcc-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-13\",\"sha256\":\"a20520ee21543f243d40636a9181a142c45ecd989de31ab86b99a8ea5ada870d\"},{\"command\":\"aarch64-linux-gnu-gcc-ar\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-ar-13\",\"sha256\":\"ffc6a16e898aa3e5a0e3c6d418b41c815498d282be19e01d060eef0e1433ccfe\"},{\"command\":\"aarch64-linux-gnu-gcc-ar-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-ar-13\",\"sha256\":\"ffc6a16e898aa3e5a0e3c6d418b41c815498d282be19e01d060eef0e1433ccfe\"},{\"command\":\"aarch64-linux-gnu-gcc-nm\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-nm-13\",\"sha256\":\"5f145435894fbe10cc4bfb841e256381351bff398d19d8e9d85b5f009734e1a0\"},{\"command\":\"aarch64-linux-gnu-gcc-nm-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-nm-13\",\"sha256\":\"5f145435894fbe10cc4bfb841e256381351bff398d19d8e9d85b5f009734e1a0\"},{\"command\":\"aarch64-linux-gnu-gcc-ranlib\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-ranlib-13\",\"sha256\":\"e79a258937f68762e1a86f2b4aabd7eca20ba0d5970b725f12d8836208f228fe\"},{\"command\":\"aarch64-linux-gnu-gcc-ranlib-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-ranlib-13\",\"sha256\":\"e79a258937f68762e1a86f2b4aabd7eca20ba0d5970b725f12d8836208f228fe\"},{\"command\":\"aarch64-linux-gnu-gcov\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-13\",\"sha256\":\"7d7e793195f80c6164b220ca4b7339a102a9f57bc04cfed79fd581ae54bab688\"},{\"command\":\"aarch64-linux-gnu-gcov-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-13\",\"sha256\":\"7d7e793195f80c6164b220ca4b7339a102a9f57bc04cfed79fd581ae54bab688\"},{\"command\":\"aarch64-linux-gnu-gcov-dump\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-dump-13\",\"sha256\":\"26b03d13aea8cb68156618ec79b091c58a2d877d1bc2ef5aca27d03aec41cb97\"},{\"command\":\"aarch64-linux-gnu-gcov-dump-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-dump-13\",\"sha256\":\"26b03d13aea8cb68156618ec79b091c58a2d877d1bc2ef5aca27d03aec41cb97\"},{\"command\":\"aarch64-linux-gnu-gcov-tool\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-tool-13\",\"sha256\":\"1e1dec404a3b6c21b1c0470a67eecb6e937e70dcf95995380d6d69d0b6aea2ee\"},{\"command\":\"aarch64-linux-gnu-gcov-tool-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-tool-13\",\"sha256\":\"1e1dec404a3b6c21b1c0470a67eecb6e937e70dcf95995380d6d69d0b6aea2ee\"},{\"command\":\"aarch64-linux-gnu-gold\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ld.gold\",\"sha256\":\"91be8ad8ab23070ae4d55989793e457d507370cb3537338b403f6f5e8229b6d9\"},{\"command\":\"aarch64-linux-gnu-gp-archive\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gp-archive\",\"sha256\":\"2f26b485311c0ca7d741c5221221056fb8d72397965a3cf4f21cd5aad5b23358\"},{\"command\":\"aarch64-linux-gnu-gp-collect-app\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gp-collect-app\",\"sha256\":\"47dc715a7ae9eab495de6e741cbe938a96d9a39df1113eae82cd22d45f75e2af\"},{\"command\":\"aarch64-linux-gnu-gp-display-html\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gp-display-html\",\"sha256\":\"538acc2bcc24a50de51e88b2d733d50b69237ebfee14660e45a0255215d9f582\"},{\"command\":\"aarch64-linux-gnu-gp-display-src\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gp-display-src\",\"sha256\":\"fd2d6a61e0d8a75986e85a1ee7728755fd209fad15798db8e01a419a6472c3e5\"},{\"command\":\"aarch64-linux-gnu-gp-display-text\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gp-display-text\",\"sha256\":\"4d72c93772d03cd6de507678b532bcfdb8a7c761898cb2ba7a227618fe53b511\"},{\"command\":\"aarch64-linux-gnu-gprof\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gprof\",\"sha256\":\"fafe04ca52d0dbddaa1eaca63f4d58f484c1400434182b6f69e5db6bb864b02f\"},{\"command\":\"aarch64-linux-gnu-gprofng\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gprofng\",\"sha256\":\"8fe24cd8b82f26ddd41f0d7493bf5883c967e60f7b1cc85dbec21cae36c664cc\"},{\"command\":\"aarch64-linux-gnu-ld\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ld.bfd\",\"sha256\":\"1e4d3369b76845fa8e099b83513bf28f6f722e046f9b2cde1378c9e27f96d19c\"},{\"command\":\"aarch64-linux-gnu-ld.bfd\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ld.bfd\",\"sha256\":\"1e4d3369b76845fa8e099b83513bf28f6f722e046f9b2cde1378c9e27f96d19c\"},{\"command\":\"aarch64-linux-gnu-ld.gold\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ld.gold\",\"sha256\":\"91be8ad8ab23070ae4d55989793e457d507370cb3537338b403f6f5e8229b6d9\"},{\"command\":\"aarch64-linux-gnu-lto-dump\",\"executable\":\"/usr/bin/aarch64-linux-gnu-lto-dump-13\",\"sha256\":\"388e29e8f31599e067ee5ffdccc3722a55fb449276a58dbe4de03bab92c0a9ad\"},{\"command\":\"aarch64-linux-gnu-lto-dump-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-lto-dump-13\",\"sha256\":\"388e29e8f31599e067ee5ffdccc3722a55fb449276a58dbe4de03bab92c0a9ad\"},{\"command\":\"aarch64-linux-gnu-nm\",\"executable\":\"/usr/bin/aarch64-linux-gnu-nm\",\"sha256\":\"338d018c73ef394539da2566405a1f2f50a808e3c15ef72e9b48dd2f0b0d262f\"},{\"command\":\"aarch64-linux-gnu-objcopy\",\"executable\":\"/usr/bin/aarch64-linux-gnu-objcopy\",\"sha256\":\"1216ee3b084501a5132643fef4bba7221186f4b7dc99cd46e2bf9e3e7d37c344\"},{\"command\":\"aarch64-linux-gnu-objdump\",\"executable\":\"/usr/bin/aarch64-linux-gnu-objdump\",\"sha256\":\"f2e917a5d118ebf5679b24740e20d30338308e7f3f0630527c469de452d5a250\"},{\"command\":\"aarch64-linux-gnu-pkg-config\",\"executable\":\"/usr/bin/pkgconf\",\"sha256\":\"b21b58e97876992968c82d823d74034abbc6a4176f8c9d5f2e0400f343e73fc1\"},{\"command\":\"aarch64-linux-gnu-pkgconf\",\"executable\":\"/usr/bin/pkgconf\",\"sha256\":\"b21b58e97876992968c82d823d74034abbc6a4176f8c9d5f2e0400f343e73fc1\"},{\"command\":\"aarch64-linux-gnu-ranlib\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ranlib\",\"sha256\":\"824de22ce448c3567e631425f7754a6df72e90bd758079daa94f1aa6edf41513\"},{\"command\":\"aarch64-linux-gnu-readelf\",\"executable\":\"/usr/bin/aarch64-linux-gnu-readelf\",\"sha256\":\"6bca2bbd23b072db9e9a19ae0e65cf7b7c15c08a3c2cf01dd56453e1ac9340b1\"},{\"command\":\"aarch64-linux-gnu-size\",\"executable\":\"/usr/bin/aarch64-linux-gnu-size\",\"sha256\":\"59043ac56a8c2c059cd4cad6de00d80d0efd004c69efbb40f00a44b530323973\"},{\"command\":\"aarch64-linux-gnu-strings\",\"executable\":\"/usr/bin/aarch64-linux-gnu-strings\",\"sha256\":\"f6b809537477dfed119b80ad8c0da1653a2b9ed0173ebb72ebf236a1c94ce018\"},{\"command\":\"aarch64-linux-gnu-strip\",\"executable\":\"/usr/bin/aarch64-linux-gnu-strip\",\"sha256\":\"3a69e3786ea2884baf4d9811e509ba6d16be03d5d6f541103b8de317a2465fca\"},{\"command\":\"addpart\",\"executable\":\"/usr/bin/addpart\",\"sha256\":\"6081cff147546f210115fbaf9319df29097fd22198eb50b238b66c346d7595b6\"},{\"command\":\"addr2line\",\"executable\":\"/usr/bin/aarch64-linux-gnu-addr2line\",\"sha256\":\"ed4a2a90659b5a37a0c5b11cabb87cf98dfc1b3ece62ef11d66758bbb0af8d5c\"},{\"command\":\"apt\",\"executable\":\"/usr/bin/apt\",\"sha256\":\"25091d790a7f2e44a0df654d985bb555976e0cfb54eade2a7cb81f81d7c45345\"},{\"command\":\"apt-cache\",\"executable\":\"/usr/bin/apt-cache\",\"sha256\":\"86961892a2a0f6d3b70234b334fcfaaccc2f0c015924d43101647553856f750d\"},{\"command\":\"apt-cdrom\",\"executable\":\"/usr/bin/apt-cdrom\",\"sha256\":\"8c7f4ad4f4171b24238e18659447cc3cb7777d13b44bb6b7569d9a0e54013ded\"},{\"command\":\"apt-config\",\"executable\":\"/usr/bin/apt-config\",\"sha256\":\"2e791791b1149da102b375b36915fc5902f450e05f6fe1711f593a56223ee319\"},{\"command\":\"apt-get\",\"executable\":\"/usr/bin/apt-get\",\"sha256\":\"72a25a79b0549eddd159182c427e9f65a60a2e393232524687b7cbe9b163232d\"},{\"command\":\"apt-key\",\"executable\":\"/usr/bin/apt-key\",\"sha256\":\"45ec8c948cb0f17b38f27b4d8235596b17ece3b7eea5afcbb3be8b1ee5a98c77\"},{\"command\":\"apt-mark\",\"executable\":\"/usr/bin/apt-mark\",\"sha256\":\"847f7abe00572ea4c136225a231cd42a56a2513e2c170f5fa174a0dd70b1576f\"},{\"command\":\"ar\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ar\",\"sha256\":\"f4583a612510e038dbc1ae8afb5eae5f0445c435bdd7c4c28e78acc7e757d2b1\"},{\"command\":\"arch\",\"executable\":\"/usr/bin/arch\",\"sha256\":\"7d10e00d288c23ce8aa229d7e79fd5c37bc436c45c6dfc45a6d6c00b18b7fbd5\"},{\"command\":\"as\",\"executable\":\"/usr/bin/aarch64-linux-gnu-as\",\"sha256\":\"1ffda50efb6d91b6b05ef933aced099595c36577594c0296c91161f2d13db374\"},{\"command\":\"asyncapi-official\",\"executable\":\"/opt/prismpm/asyncapi-official/scripts/launcher.sh\",\"sha256\":\"b06adb1cd61f9258e2b351314ffbd6cae1ed608a3623da201ac2879676bb302e\"},{\"command\":\"asyncapi-parser\",\"executable\":\"/opt/prismpm/oracles/asyncapi-parser.mjs\",\"sha256\":\"849b552ffa8ef7330511173b4fbd03d77f01ef0e7115abf64394d9160add5caf\"},{\"command\":\"awk\",\"executable\":\"/usr/bin/mawk\",\"sha256\":\"38a07fb3962f22f50f09ed60bb7cc945053f25cd48519b974e597c4ee7a97a0c\"},{\"command\":\"b2sum\",\"executable\":\"/usr/bin/b2sum\",\"sha256\":\"0051a2a383507ea1ab388b5c57d1a2ac9aaf3d259aa1974fa4084b029f62132d\"},{\"command\":\"base32\",\"executable\":\"/usr/bin/base32\",\"sha256\":\"dfcbb1f1ec0cfc5d8ab92e6717db46306b792f42531dd03e5a8bb3015de168ed\"},{\"command\":\"base64\",\"executable\":\"/usr/bin/base64\",\"sha256\":\"e2908860aa083442b9a059a4df8ce27444dfa74d9fdfb45f92c14d747d076e91\"},{\"command\":\"basename\",\"executable\":\"/usr/bin/basename\",\"sha256\":\"6f59798300ab8020d300226e74f6600e11f3ccc19501e834fdb8c7e494087037\"},{\"command\":\"basenc\",\"executable\":\"/usr/bin/basenc\",\"sha256\":\"4bada29d4480fac3866b6b36e4027248dcf93e30d0a31e3c6dd47185ac1535a5\"},{\"command\":\"bash\",\"executable\":\"/usr/bin/bash\",\"sha256\":\"af955ef55333c8fc9c5aa50df91ad1a629d9a79a9afa125cd5e9629585f78015\"},{\"command\":\"bashbug\",\"executable\":\"/usr/bin/bashbug\",\"sha256\":\"a676ca94526cfba4eeb6f743406d0a650e48567bd4fbcb77c9326a00c19bef4b\"},{\"command\":\"bdftopcf\",\"executable\":\"/usr/bin/bdftopcf\",\"sha256\":\"fadf48a2177aba43ef5f1b38fd6be8e03bb41996df9ab19978e23ace2981b364\"},{\"command\":\"bdftruncate\",\"executable\":\"/usr/bin/bdftruncate\",\"sha256\":\"b3d987d8b29819061fb11ee25c61025368caa3d2274d3cb5f1a3773715b67f20\"},{\"command\":\"bunzip2\",\"executable\":\"/usr/bin/bunzip2\",\"sha256\":\"18dc92a2280b181d2ef764dad96a9266ac1bf42a186e42f1aecb84b1bb7cb439\"},{\"command\":\"busctl\",\"executable\":\"/usr/bin/busctl\",\"sha256\":\"27bb72a32a312b0871d46b8502216a73c398a499a65d7213d380f4cdff54aa4e\"},{\"command\":\"bzcat\",\"executable\":\"/usr/bin/bzcat\",\"sha256\":\"18dc92a2280b181d2ef764dad96a9266ac1bf42a186e42f1aecb84b1bb7cb439\"},{\"command\":\"bzcmp\",\"executable\":\"/usr/bin/bzdiff\",\"sha256\":\"d115316919735ea43b057063dad2609b05051a11f3819291a403ecceb55ba102\"},{\"command\":\"bzdiff\",\"executable\":\"/usr/bin/bzdiff\",\"sha256\":\"d115316919735ea43b057063dad2609b05051a11f3819291a403ecceb55ba102\"},{\"command\":\"bzegrep\",\"executable\":\"/usr/bin/bzgrep\",\"sha256\":\"3300749d903f145a8815c07fa1389dba04268fee1fec97ca1f01abf07ac5ee04\"},{\"command\":\"bzexe\",\"executable\":\"/usr/bin/bzexe\",\"sha256\":\"bd3ab362765b5313aef3bdd1845ef4743f33ce98ab970b045d872a2cb4536951\"},{\"command\":\"bzfgrep\",\"executable\":\"/usr/bin/bzgrep\",\"sha256\":\"3300749d903f145a8815c07fa1389dba04268fee1fec97ca1f01abf07ac5ee04\"},{\"command\":\"bzgrep\",\"executable\":\"/usr/bin/bzgrep\",\"sha256\":\"3300749d903f145a8815c07fa1389dba04268fee1fec97ca1f01abf07ac5ee04\"},{\"command\":\"bzip2\",\"executable\":\"/usr/bin/bzip2\",\"sha256\":\"18dc92a2280b181d2ef764dad96a9266ac1bf42a186e42f1aecb84b1bb7cb439\"},{\"command\":\"bzip2recover\",\"executable\":\"/usr/bin/bzip2recover\",\"sha256\":\"54e08e8a9806076a9b186db82680b44fc91b6a9900693e9aa5bdf880d9ab1e4c\"},{\"command\":\"bzless\",\"executable\":\"/usr/bin/bzmore\",\"sha256\":\"0e7ca63849eebc9ea476ea1fefab05e60b0ac8066f73c7d58e8ff607c941f212\"},{\"command\":\"bzmore\",\"executable\":\"/usr/bin/bzmore\",\"sha256\":\"0e7ca63849eebc9ea476ea1fefab05e60b0ac8066f73c7d58e8ff607c941f212\"},{\"command\":\"c++\",\"executable\":\"/usr/bin/aarch64-linux-gnu-g++-13\",\"sha256\":\"fc02363794280f404c6ca6f5da1c8fe469be902e9de140d35d8573bb3393f53b\"},{\"command\":\"c++filt\",\"executable\":\"/usr/bin/aarch64-linux-gnu-c++filt\",\"sha256\":\"aa08d269fe1c87b8737179c9c07813f615366185d4e7668c7c503e8278daa62f\"},{\"command\":\"c89\",\"executable\":\"/usr/bin/c89-gcc\",\"sha256\":\"999b40b67f690638f601d76b756d529dd40a4325f42dfd9fd2e629ad0a91947c\"},{\"command\":\"c89-gcc\",\"executable\":\"/usr/bin/c89-gcc\",\"sha256\":\"999b40b67f690638f601d76b756d529dd40a4325f42dfd9fd2e629ad0a91947c\"},{\"command\":\"c99\",\"executable\":\"/usr/bin/c99-gcc\",\"sha256\":\"5d3a3621b0f1272264a4d37e379300f2495aabef997eb12c2f8b48cf16d01366\"},{\"command\":\"c99-gcc\",\"executable\":\"/usr/bin/c99-gcc\",\"sha256\":\"5d3a3621b0f1272264a4d37e379300f2495aabef997eb12c2f8b48cf16d01366\"},{\"command\":\"c_rehash\",\"executable\":\"/usr/bin/c_rehash\",\"sha256\":\"e500ac3e4b1a18d117bd1c4b47f3e4f96584040b6ea4a484398fff7ddc3a7d12\"},{\"command\":\"captoinfo\",\"executable\":\"/usr/bin/tic\",\"sha256\":\"71234d7ee819f7391990856281f772d578b19ae3b4e7f4626976c926310c2aae\"},{\"command\":\"cargo\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"cargo-clippy\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"cargo-deny\",\"executable\":\"/usr/local/bin/cargo-deny\",\"sha256\":\"21e797104e371854dde7f05f52d834e70312749d361c168429ced996f2194462\"},{\"command\":\"cargo-fmt\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"cargo-local-registry\",\"executable\":\"/usr/local/cargo/bin/cargo-local-registry\",\"sha256\":\"fe3bced4bd5f98c0278dc7b4931079fb987aece78602dc6cf984e205dd13b399\"},{\"command\":\"cargo-miri\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"cat\",\"executable\":\"/usr/bin/cat\",\"sha256\":\"604ff8110ab37748594c3e61d6ba52140788c7c29500fb0edc314e08db155f2a\"},{\"command\":\"cc\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-13\",\"sha256\":\"a20520ee21543f243d40636a9181a142c45ecd989de31ab86b99a8ea5ada870d\"},{\"command\":\"chage\",\"executable\":\"/usr/bin/chage\",\"sha256\":\"c47a9d4e8b9cc11124a660f8d4b5e4dd6d42e9059f9fcc925a19014b69418983\"},{\"command\":\"chattr\",\"executable\":\"/usr/bin/chattr\",\"sha256\":\"58650d7f80deb4e41f4af258c364402acd2a113cb3bdf34fb4d8909219c090f7\"},{\"command\":\"chcon\",\"executable\":\"/usr/bin/chcon\",\"sha256\":\"2273b478cae7bb7a045ce06fa8dbf4c94b5dd390edf6ce1adcd9f06dd8795bb1\"},{\"command\":\"chfn\",\"executable\":\"/usr/bin/chfn\",\"sha256\":\"ad99bfbcedc731883446b2402a3ac51603d3d2d21daec02b11e9c84db5ed7e96\"},{\"command\":\"chgrp\",\"executable\":\"/usr/bin/chgrp\",\"sha256\":\"69aa129ffc8499e2dc7047ec467a0d0f6e094f0416d9dd47ff07955e6b090aaa\"},{\"command\":\"chmod\",\"executable\":\"/usr/bin/chmod\",\"sha256\":\"4fe3b161f39da2cd87d2c55fe8c4f8d61aa3080b9eeaaf21ca7b693c4f4ca473\"},{\"command\":\"choom\",\"executable\":\"/usr/bin/choom\",\"sha256\":\"fbfe99fb1582eb6614548dcdf59c625609bed837a6f159c55c79bc1c7ee0d0a8\"},{\"command\":\"chown\",\"executable\":\"/usr/bin/chown\",\"sha256\":\"2501dd8710dc928c97740f2014d0795f778fea6f7eb7e374228865a33e65be7f\"},{\"command\":\"chrt\",\"executable\":\"/usr/bin/chrt\",\"sha256\":\"90793624278879b50f2a9c392923b9a36fffa9db2d1070ea46cda955044ae3b4\"},{\"command\":\"chsh\",\"executable\":\"/usr/bin/chsh\",\"sha256\":\"bd0c486a0f316d99405abbc7553260fbb9611293ec2239f95d760dbf4224a6fb\"},{\"command\":\"cksum\",\"executable\":\"/usr/bin/cksum\",\"sha256\":\"130c8404dcc0254ec6e4835215513f7bc725b40dce83230d952dc740950af2d5\"},{\"command\":\"clear\",\"executable\":\"/usr/bin/clear\",\"sha256\":\"022bd7fc9938b62008e4e252ec329e24ddabd571fd6d01027386178c1d29d95b\"},{\"command\":\"clear_console\",\"executable\":\"/usr/bin/clear_console\",\"sha256\":\"22f0ee4504073fb21f9554b7190c68240840d27738113f2943e7c3b3f2676034\"},{\"command\":\"clippy-driver\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"cloudevents-sdk-conformance\",\"executable\":\"/usr/local/bin/cloudevents-sdk-conformance\",\"sha256\":\"519ec1d39566de154730bc87930f274be947d0eff0ce7d5ed00606cb4bda2117\"},{\"command\":\"cloudevents-validator\",\"executable\":\"/usr/local/bin/cloudevents-validator\",\"sha256\":\"7d91646555ef85ca92aef3c100efd3c36a3b76b1f46000ffa1558b4715a25d58\"},{\"command\":\"cmp\",\"executable\":\"/usr/bin/cmp\",\"sha256\":\"e7a3863a965c20d9b4beaad4736ff4406108bb88ba2d09a122c931ca246a0db4\"},{\"command\":\"comm\",\"executable\":\"/usr/bin/comm\",\"sha256\":\"6f9efb0ca067e135ffda9e2dd4c2c505df38306e517cd156226614110b39954d\"},{\"command\":\"corelist\",\"executable\":\"/usr/bin/corelist\",\"sha256\":\"667bc0d6d8de3048ec84678355647805a9e1ecfc53169a780edbc49b5a0da7b5\"},{\"command\":\"corepack\",\"executable\":\"/usr/local/lib/node_modules/corepack/dist/corepack.js\",\"sha256\":\"3655bc798f300951f2070fee411b337d626b0c3ae80c2d24c46ccac4595d4bf9\"},{\"command\":\"cosign\",\"executable\":\"/usr/local/bin/cosign\",\"sha256\":\"c5d324e091826b0d7a78eb16fef316450b4eb9aaec045611c08ba06f5e73220a\"},{\"command\":\"cp\",\"executable\":\"/usr/bin/cp\",\"sha256\":\"3ec1dff780dc05085e68c636879751629e2972ad05e4c02a1e57ac67ad16f2fc\"},{\"command\":\"cpan\",\"executable\":\"/usr/bin/cpan\",\"sha256\":\"d4fba91c6370b8ef2c77850205d6e7eab6d8aeebd57993793fad9eff7720ea5e\"},{\"command\":\"cpan5.38-aarch64-linux-gnu\",\"executable\":\"/usr/bin/cpan5.38-aarch64-linux-gnu\",\"sha256\":\"536a6678c135f196e2e5e5f6b66d0e5ff9544abe224b3340c87b09f259c04171\"},{\"command\":\"cpp\",\"executable\":\"/usr/bin/aarch64-linux-gnu-cpp-13\",\"sha256\":\"f1cb3f991a50e83bce2b9f9573fe280a2572208ef88805adcf5de317f86f230e\"},{\"command\":\"cpp-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-cpp-13\",\"sha256\":\"f1cb3f991a50e83bce2b9f9573fe280a2572208ef88805adcf5de317f86f230e\"},{\"command\":\"csplit\",\"executable\":\"/usr/bin/csplit\",\"sha256\":\"9e52812e43e93aca218294e77da44a0a14ed74cdf15441323ccaf097871b1468\"},{\"command\":\"curl\",\"executable\":\"/usr/bin/curl\",\"sha256\":\"67054bcf748d42e1bf4b2a0eb4ba768e37dde8681313a64edd2f343c5d17a0ac\"},{\"command\":\"cut\",\"executable\":\"/usr/bin/cut\",\"sha256\":\"e2cdff490904b029d89ea8e0f39b709d4674e2f828637fad324bd8985381a1d2\"},{\"command\":\"dash\",\"executable\":\"/usr/bin/dash\",\"sha256\":\"c883d9c27228339580994a1d0ea960645368c7d1b960a712bd0c655860c2d0d7\"},{\"command\":\"date\",\"executable\":\"/usr/bin/date\",\"sha256\":\"90b4b67c4de251db8c845731670d78ec3fe40ae9f60477a975f83d6dc42efc59\"},{\"command\":\"dbus-cleanup-sockets\",\"executable\":\"/usr/bin/dbus-cleanup-sockets\",\"sha256\":\"34a63db64db4b4af4d5d8dffa8d609dc092c73cef2f33bb3d47cda41d07f36c8\"},{\"command\":\"dbus-daemon\",\"executable\":\"/usr/bin/dbus-daemon\",\"sha256\":\"42f32cef025bf558013890bd28062932c253710c083e8428fc79ae34d7ccf7c2\"},{\"command\":\"dbus-monitor\",\"executable\":\"/usr/bin/dbus-monitor\",\"sha256\":\"ab893e8562750704a45e9b8f76fada69791fac6356fa41489aae2a16896c12e0\"},{\"command\":\"dbus-run-session\",\"executable\":\"/usr/bin/dbus-run-session\",\"sha256\":\"e3877b5c268bc07ec1a4df0527b89b1321e8ba301b2f92663f9e3bd2fcba5289\"},{\"command\":\"dbus-send\",\"executable\":\"/usr/bin/dbus-send\",\"sha256\":\"01465ee4b342baf957bc32c7f3999834604ea438952701f61dda13b63c0b010d\"},{\"command\":\"dbus-update-activation-environment\",\"executable\":\"/usr/bin/dbus-update-activation-environment\",\"sha256\":\"f54e4b73d79d3d65e55dafcd83ff739b515b754bd11118b1993d849fb98194ca\"},{\"command\":\"dbus-uuidgen\",\"executable\":\"/usr/bin/dbus-uuidgen\",\"sha256\":\"27ec5ee57a6ae62a335797c582c3eacce6fa07914f7708c4c70f7d06ef805d76\"},{\"command\":\"dd\",\"executable\":\"/usr/bin/dd\",\"sha256\":\"04e9763f3e05f6b47b859b521697d55b1b05d4078cb26576c58f52a3d30e21d8\"},{\"command\":\"deb-systemd-helper\",\"executable\":\"/usr/bin/deb-systemd-helper\",\"sha256\":\"a895d5f077651960b6ca4ed9c53f8b36eae422ae170f61c972d0c6579e9f8732\"},{\"command\":\"deb-systemd-invoke\",\"executable\":\"/usr/bin/deb-systemd-invoke\",\"sha256\":\"92eadae89f4df4cd6088f6316f5390b685faf8d0e312a4e5af3a507caaf81bdb\"},{\"command\":\"debconf\",\"executable\":\"/usr/bin/debconf\",\"sha256\":\"d5beef1820da2445e173c90ba14c535f566db12cd7de0cb3d4385a6aa4bcd8e3\"},{\"command\":\"debconf-apt-progress\",\"executable\":\"/usr/bin/debconf-apt-progress\",\"sha256\":\"ab24031d661b531961bab055a344c97d66ded2718c9a4c48ddbe0392273897e0\"},{\"command\":\"debconf-communicate\",\"executable\":\"/usr/bin/debconf-communicate\",\"sha256\":\"95dd9cc45752692e9288eed9abf9d0bbd22bb78ffe59a78cbfcbe96cffefbba5\"},{\"command\":\"debconf-copydb\",\"executable\":\"/usr/bin/debconf-copydb\",\"sha256\":\"02f27a04a3485f487e654051a4e72a806e9aff40ccf87934f896f59c29fd6db2\"},{\"command\":\"debconf-escape\",\"executable\":\"/usr/bin/debconf-escape\",\"sha256\":\"b1e81e2ac04c2a6c286514f2f410c57b9ac6188ed33ed558722f3bc252e93e87\"},{\"command\":\"debconf-set-selections\",\"executable\":\"/usr/bin/debconf-set-selections\",\"sha256\":\"1f32e8a3daba11364b8f4ca795e1fad83b688f02ab27df8066f5c552d1070f98\"},{\"command\":\"debconf-show\",\"executable\":\"/usr/bin/debconf-show\",\"sha256\":\"314fa1730e1efe15db17307848e7a53e450d0093009b6f1596cd3fe0ffec1b67\"},{\"command\":\"delpart\",\"executable\":\"/usr/bin/delpart\",\"sha256\":\"93dae401e3876c7e23eefe99b5f637520e62cca06ede336c843711fc1f66d252\"},{\"command\":\"devcontainer\",\"executable\":\"/opt/prismpm/devcontainer-cli/node_modules/@devcontainers/cli/devcontainer.js\",\"sha256\":\"e6df20af860208e00365d7b73f64d3940bad087ea8049de12223d1e7376522e3\"},{\"command\":\"devcontainer-validator\",\"executable\":\"/opt/prismpm/oracles/devcontainer-validator.mjs\",\"sha256\":\"05e99e6a92cf44ee2f91accef71823bd06ee92281db29089e8bb784ab4926b58\"},{\"command\":\"df\",\"executable\":\"/usr/bin/df\",\"sha256\":\"03633dca1cc85bf7a0acd19e8554c39b4e0d070539ac73a9a9a5a7227469438f\"},{\"command\":\"diff\",\"executable\":\"/usr/bin/diff\",\"sha256\":\"8a4e71dc45f025517c4df4bb4ff97e671754dbe6eb365f71cfbb57c6aad3cf20\"},{\"command\":\"diff3\",\"executable\":\"/usr/bin/diff3\",\"sha256\":\"9c245bf3c888d25e0befabec6032d48a87e61e70d19e822558a1a6041b261b3e\"},{\"command\":\"dir\",\"executable\":\"/usr/bin/dir\",\"sha256\":\"5204b89312af150b5c1060c12035460c84b3dd28608b7e0cbaad4f1b6e01a7ac\"},{\"command\":\"dircolors\",\"executable\":\"/usr/bin/dircolors\",\"sha256\":\"d5780d1983643ee6c99a351b2b493a2e6a5e8776483b6fe1e8f73536035a1d3a\"},{\"command\":\"dirmngr\",\"executable\":\"/usr/bin/dirmngr\",\"sha256\":\"28e20fb6faa3c908b61b1d3dd905af7e467a85c6eb37b3bbe9d02d491f13335a\"},{\"command\":\"dirmngr-client\",\"executable\":\"/usr/bin/dirmngr-client\",\"sha256\":\"67a7d2dfad417fc2d49fb362fc168a65ecab39c27ccd4eb3d16520629d9ef5e8\"},{\"command\":\"dirname\",\"executable\":\"/usr/bin/dirname\",\"sha256\":\"0aed6960221e6ec4f6dc82c1009aee99fb26ddbc1dd5634c2be697e2e03782c6\"},{\"command\":\"dmesg\",\"executable\":\"/usr/bin/dmesg\",\"sha256\":\"ffbf1baa7e19f7498862828915a9263a51c1a4c9f24726f8bfb7748db309eabb\"},{\"command\":\"dnsdomainname\",\"executable\":\"/usr/bin/hostname\",\"sha256\":\"529801b643662701c07a120d133850a3a1d407fd0edd8390b3f2db759715eb8f\"},{\"command\":\"docker\",\"executable\":\"/usr/local/bin/docker\",\"sha256\":\"5813af76173228c7744670ce7370f7d93924f095bfa5dba2df6ac46a039ccf3c\"},{\"command\":\"docker-buildx\",\"executable\":\"/usr/local/libexec/docker/cli-plugins/docker-buildx\",\"sha256\":\"4e850583cc68ffd8d739ddb8a782b83f2ef9d3bf437ae7c44da4fbfde2613a8e\"},{\"command\":\"docker-compose\",\"executable\":\"/usr/local/libexec/docker/cli-plugins/docker-compose\",\"sha256\":\"fc5d1371f1ec7987e703da94ede49af3fbfb240b83f22991a98511de7bc4b93b\"},{\"command\":\"domainname\",\"executable\":\"/usr/bin/hostname\",\"sha256\":\"529801b643662701c07a120d133850a3a1d407fd0edd8390b3f2db759715eb8f\"},{\"command\":\"dpkg\",\"executable\":\"/usr/bin/dpkg\",\"sha256\":\"32cf5b3ab2fd7166eb9bbb9aea29efbe552c520907641207020fc5f031e24888\"},{\"command\":\"dpkg-architecture\",\"executable\":\"/usr/bin/dpkg-architecture\",\"sha256\":\"ce16700da9905ac300963e09e9716004c8c35c780b06d108de8b9c93d6ddbbaf\"},{\"command\":\"dpkg-buildapi\",\"executable\":\"/usr/bin/dpkg-buildapi\",\"sha256\":\"69d8be5bc1d2e8b17fc6096912b07b72bcda3759de2301062c2fa5a0aa9e842d\"},{\"command\":\"dpkg-buildflags\",\"executable\":\"/usr/bin/dpkg-buildflags\",\"sha256\":\"4a363aa71affdea49cf5fc894783f3ff13ed66fcfe75646a82809ca7607e953a\"},{\"command\":\"dpkg-buildpackage\",\"executable\":\"/usr/bin/dpkg-buildpackage\",\"sha256\":\"f1a04680031ada877a331bf744aea7ed1cb32ebac24914c7d0b9f5a0267b0d1d\"},{\"command\":\"dpkg-buildtree\",\"executable\":\"/usr/bin/dpkg-buildtree\",\"sha256\":\"9befe7704c770ee771fa90e6dd80d86b191d5a92ee3623eec4e1cd938275e941\"},{\"command\":\"dpkg-checkbuilddeps\",\"executable\":\"/usr/bin/dpkg-checkbuilddeps\",\"sha256\":\"869d51a380a2f7e438af8f836b20ac0232f1a5b45f156ca51955f130cb2c28fa\"},{\"command\":\"dpkg-deb\",\"executable\":\"/usr/bin/dpkg-deb\",\"sha256\":\"3cf93403af757e938bda51322774697b8ff1e1d030b333008b2308e0b79a8dd6\"},{\"command\":\"dpkg-distaddfile\",\"executable\":\"/usr/bin/dpkg-distaddfile\",\"sha256\":\"48a66e608a612ee9948c0c0dc34db41b9fd62bc3fd658a7ceb8d362563a90e13\"},{\"command\":\"dpkg-divert\",\"executable\":\"/usr/bin/dpkg-divert\",\"sha256\":\"433ab574fe26fac3f3c03ad08e7195af63585764a410f5dd557f7a5cee7b3d38\"},{\"command\":\"dpkg-genbuildinfo\",\"executable\":\"/usr/bin/dpkg-genbuildinfo\",\"sha256\":\"ea892fe9ccde89d43d3ab990a00a098cafc0826251973f2eebb01464aa067cf0\"},{\"command\":\"dpkg-genchanges\",\"executable\":\"/usr/bin/dpkg-genchanges\",\"sha256\":\"4b3688a9e0c011c5ecebf9cdf6a80cc5ffd49ce8a05c4d93e671c73527e4a5cd\"},{\"command\":\"dpkg-gencontrol\",\"executable\":\"/usr/bin/dpkg-gencontrol\",\"sha256\":\"21a07292d7f2b969c1746163044adbce7fd48762dfa1b4619d3300af274d0235\"},{\"command\":\"dpkg-gensymbols\",\"executable\":\"/usr/bin/dpkg-gensymbols\",\"sha256\":\"2a7cbc5ff261e22282da62ff54b293e40c6aeccd1f89faace7f40ac6d443d6b6\"},{\"command\":\"dpkg-maintscript-helper\",\"executable\":\"/usr/bin/dpkg-maintscript-helper\",\"sha256\":\"c1ebe2d1281240872a38dd16dcaea57d48a66978f500eeeca58689ae006ca342\"},{\"command\":\"dpkg-mergechangelogs\",\"executable\":\"/usr/bin/dpkg-mergechangelogs\",\"sha256\":\"72d5bb1f9c93730cf1a67e1d93065b7582a9ef3ff9013d89e07071f47fba13e5\"},{\"command\":\"dpkg-name\",\"executable\":\"/usr/bin/dpkg-name\",\"sha256\":\"35019db2113124b0d3db3b44f02615e3ec2be6f365f9986d913c0596930d62f5\"},{\"command\":\"dpkg-parsechangelog\",\"executable\":\"/usr/bin/dpkg-parsechangelog\",\"sha256\":\"1240425d626ff7b28de7022a09222e6f4b88c66c0d481776eea69006c0e22bd4\"},{\"command\":\"dpkg-query\",\"executable\":\"/usr/bin/dpkg-query\",\"sha256\":\"eea6a1a5fc4fff653dfc733c9b4a551625d5fb7720a84952013076cacdb0927f\"},{\"command\":\"dpkg-realpath\",\"executable\":\"/usr/bin/dpkg-realpath\",\"sha256\":\"209be6ae092e387589b11752c165e943f0c8d6e940694025d5cd41df4cb49642\"},{\"command\":\"dpkg-scanpackages\",\"executable\":\"/usr/bin/dpkg-scanpackages\",\"sha256\":\"6f2a4e932d7cc8dc1c3010541297adddd09a96c3460f87b6edbde3203679d848\"},{\"command\":\"dpkg-scansources\",\"executable\":\"/usr/bin/dpkg-scansources\",\"sha256\":\"d91bb4217786e327e16f62185daf9632c8e04f5be8d251d90f00b9945b905006\"},{\"command\":\"dpkg-shlibdeps\",\"executable\":\"/usr/bin/dpkg-shlibdeps\",\"sha256\":\"06d7129cf40b0186dfa961f277e79664970d9f9207ae23ab11f8135aef488b02\"},{\"command\":\"dpkg-source\",\"executable\":\"/usr/bin/dpkg-source\",\"sha256\":\"785b2ef79335db87fef3447181503007171b4dfb8f9cbfc52236e6b84847e634\"},{\"command\":\"dpkg-split\",\"executable\":\"/usr/bin/dpkg-split\",\"sha256\":\"c9793b76878167723dd0857e4c6697b7d4f16c235b17390174ff93b9af77a890\"},{\"command\":\"dpkg-statoverride\",\"executable\":\"/usr/bin/dpkg-statoverride\",\"sha256\":\"bd5d0e517b474214b1e99d7ea19c1ebd2a8d325649ef4026e7a38cdf8905af55\"},{\"command\":\"dpkg-trigger\",\"executable\":\"/usr/bin/dpkg-trigger\",\"sha256\":\"547263d4e4533de161a3b80ee60f41dea2d1e8e7fed427b62236f16801e38374\"},{\"command\":\"dpkg-vendor\",\"executable\":\"/usr/bin/dpkg-vendor\",\"sha256\":\"603e32f2d611f57b240005c3faca99eaf8c91c63e191bb76f3d9567acb82bebc\"},{\"command\":\"du\",\"executable\":\"/usr/bin/du\",\"sha256\":\"c2bae24e0e31eed0e04801c5f2c2ed5340bfbe56ef171ff5f9795fcddd3b8293\"},{\"command\":\"dwp\",\"executable\":\"/usr/bin/aarch64-linux-gnu-dwp\",\"sha256\":\"5c3139afd1082faea0e0e42af65af52f15a2bc2f6dcce7014a2d0bd77309486c\"},{\"command\":\"echo\",\"executable\":\"/usr/bin/echo\",\"sha256\":\"263080dc70c33401517a7f465e15bb6c1cf7e6d7b673399de264396cc09cc2a3\"},{\"command\":\"egrep\",\"executable\":\"/usr/bin/egrep\",\"sha256\":\"10caa507f39367738ca977a5f2014406159064b072dbade0c0c23a40597f66da\"},{\"command\":\"elan\",\"executable\":\"/usr/local/elan/bin/elan\",\"sha256\":\"3985b63010981974c86c01c8e17f0c72ad5350104253f9cac8c7c87f8183de8d\"},{\"command\":\"elfedit\",\"executable\":\"/usr/bin/aarch64-linux-gnu-elfedit\",\"sha256\":\"9289f2befbe76fbf8cb8ef0087bed8fbdf5d964d507afce2607662bc600ec514\"},{\"command\":\"enc2xs\",\"executable\":\"/usr/bin/enc2xs\",\"sha256\":\"9005200ebb19c0328ac671d9a9f72702dd7c3015112878565ffd30f1671bff5d\"},{\"command\":\"encguess\",\"executable\":\"/usr/bin/encguess\",\"sha256\":\"f616952ea1c19fd8159c5a4d25cae587bed2c5cfd45df2b238da88cf7595dc21\"},{\"command\":\"env\",\"executable\":\"/usr/bin/env\",\"sha256\":\"dde57443115af498aa981159ba6517b156547173342af36487ed58631d9e47c3\"},{\"command\":\"expand\",\"executable\":\"/usr/bin/expand\",\"sha256\":\"4b69b7e551135b387eed4c117c4ae75042fe670523022d91e83e2c1c5a20c3c7\"},{\"command\":\"expiry\",\"executable\":\"/usr/bin/expiry\",\"sha256\":\"7aea9e8f2a8eb693f1b4dcb0fc4d02d6399960ff9f854ace890b0e091c6452e6\"},{\"command\":\"expr\",\"executable\":\"/usr/bin/expr\",\"sha256\":\"0a83825e4bb9d11c2997f8fa355c0f01a9ddb1d6e558b21373ae8ec6c85d92b0\"},{\"command\":\"factor\",\"executable\":\"/usr/bin/factor\",\"sha256\":\"6cfebfe3a7565df5eff3e973f8b42182c5b5758122c53024afb0564ec803afc7\"},{\"command\":\"faillog\",\"executable\":\"/usr/bin/faillog\",\"sha256\":\"eb028bfd65a96a0b80e80c0fca3a696d26442764ded26bb7e33ec0ee0d4d51a2\"},{\"command\":\"fallocate\",\"executable\":\"/usr/bin/fallocate\",\"sha256\":\"a45934061861fe7966891b529e3642015749109845ccf4fd87ef2053b2226b38\"},{\"command\":\"false\",\"executable\":\"/usr/bin/false\",\"sha256\":\"9b2b3f201c1350102f909a3c17e547229e038591c4cc24881b5c140c97763df5\"},{\"command\":\"fc-cache\",\"executable\":\"/usr/bin/fc-cache\",\"sha256\":\"96569edc4cd9d86c8d713bb8193ed4d113a663aff19d8836f88be4ad9bb218f8\"},{\"command\":\"fc-cat\",\"executable\":\"/usr/bin/fc-cat\",\"sha256\":\"4e9f6a41c435aeb7193018d072afc930628b81bfd571c4f26afbe5b1b1cc83e5\"},{\"command\":\"fc-conflist\",\"executable\":\"/usr/bin/fc-conflist\",\"sha256\":\"50f4e57c89462322950c808a81e83431ed5d0ac1a534b9bf490a1fc2c14dc248\"},{\"command\":\"fc-list\",\"executable\":\"/usr/bin/fc-list\",\"sha256\":\"32b9d29afabc3291a355ea2f5022dfdbd211ccd86ab521e69962edf851c33ee0\"},{\"command\":\"fc-match\",\"executable\":\"/usr/bin/fc-match\",\"sha256\":\"39ab22956a614d998a127d5d52eef22eae6ae06c46fbf3579d7a0afee0ffe854\"},{\"command\":\"fc-pattern\",\"executable\":\"/usr/bin/fc-pattern\",\"sha256\":\"befbe4ec03d679e7c3587e80dfa427ec001fcd751d21a34f629a20875548421e\"},{\"command\":\"fc-query\",\"executable\":\"/usr/bin/fc-query\",\"sha256\":\"a1b7030e9374b7c6fc31bd8da8a2e81ae5fa9b1926d549300d450079c5c1dfed\"},{\"command\":\"fc-scan\",\"executable\":\"/usr/bin/fc-scan\",\"sha256\":\"83439931082c19c4760ffc91c898c08aca3a7493d8e3692faa4f38fd4e4a4e29\"},{\"command\":\"fc-validate\",\"executable\":\"/usr/bin/fc-validate\",\"sha256\":\"be5eb52c5ffd264a3c8abea33c12e5cde92ea6b2c92699074a41a046cca8ae17\"},{\"command\":\"fgrep\",\"executable\":\"/usr/bin/fgrep\",\"sha256\":\"f1bdb63da98989d55e56cef651139f70448d4c8f6ea40bb02610be439e29bf0c\"},{\"command\":\"find\",\"executable\":\"/usr/bin/find\",\"sha256\":\"1ee9e96c55e9d3551cebb991882087c5b21d18c4b4ead73203ca84ab54940ce1\"},{\"command\":\"findmnt\",\"executable\":\"/usr/bin/findmnt\",\"sha256\":\"0ce223f42a582d43fc2a43b6aa23cada2da2b3b8f69906b2c3c939c0336d9055\"},{\"command\":\"flock\",\"executable\":\"/usr/bin/flock\",\"sha256\":\"2cd7af43ad6967d6049c882ccd914623e30db81e29e7d69e430c4aaa59d44144\"},{\"command\":\"fmt\",\"executable\":\"/usr/bin/fmt\",\"sha256\":\"39f2f76159e5c75739e9ca0e3606f74aabb78aab8acbcbc4f31d4e3b3db920c6\"},{\"command\":\"fold\",\"executable\":\"/usr/bin/fold\",\"sha256\":\"4025f1cef02d7666bc369e4fced9fab6741729905a49b6d1867639da3a99cca9\"},{\"command\":\"fonttosfnt\",\"executable\":\"/usr/bin/fonttosfnt\",\"sha256\":\"52e2955e5bd7bc4ada0414b7f8087dad38a95757b2f79756bd9f94d253fc3188\"},{\"command\":\"free\",\"executable\":\"/usr/bin/free\",\"sha256\":\"75f10d9f7265e2d7aa3a422c609315a30cf5befbd81cf61d5506b247d57c3371\"},{\"command\":\"g++\",\"executable\":\"/usr/bin/aarch64-linux-gnu-g++-13\",\"sha256\":\"fc02363794280f404c6ca6f5da1c8fe469be902e9de140d35d8573bb3393f53b\"},{\"command\":\"g++-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-g++-13\",\"sha256\":\"fc02363794280f404c6ca6f5da1c8fe469be902e9de140d35d8573bb3393f53b\"},{\"command\":\"gcc\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-13\",\"sha256\":\"a20520ee21543f243d40636a9181a142c45ecd989de31ab86b99a8ea5ada870d\"},{\"command\":\"gcc-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-13\",\"sha256\":\"a20520ee21543f243d40636a9181a142c45ecd989de31ab86b99a8ea5ada870d\"},{\"command\":\"gcc-ar\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-ar-13\",\"sha256\":\"ffc6a16e898aa3e5a0e3c6d418b41c815498d282be19e01d060eef0e1433ccfe\"},{\"command\":\"gcc-ar-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-ar-13\",\"sha256\":\"ffc6a16e898aa3e5a0e3c6d418b41c815498d282be19e01d060eef0e1433ccfe\"},{\"command\":\"gcc-nm\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-nm-13\",\"sha256\":\"5f145435894fbe10cc4bfb841e256381351bff398d19d8e9d85b5f009734e1a0\"},{\"command\":\"gcc-nm-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-nm-13\",\"sha256\":\"5f145435894fbe10cc4bfb841e256381351bff398d19d8e9d85b5f009734e1a0\"},{\"command\":\"gcc-ranlib\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-ranlib-13\",\"sha256\":\"e79a258937f68762e1a86f2b4aabd7eca20ba0d5970b725f12d8836208f228fe\"},{\"command\":\"gcc-ranlib-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcc-ranlib-13\",\"sha256\":\"e79a258937f68762e1a86f2b4aabd7eca20ba0d5970b725f12d8836208f228fe\"},{\"command\":\"gcov\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-13\",\"sha256\":\"7d7e793195f80c6164b220ca4b7339a102a9f57bc04cfed79fd581ae54bab688\"},{\"command\":\"gcov-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-13\",\"sha256\":\"7d7e793195f80c6164b220ca4b7339a102a9f57bc04cfed79fd581ae54bab688\"},{\"command\":\"gcov-dump\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-dump-13\",\"sha256\":\"26b03d13aea8cb68156618ec79b091c58a2d877d1bc2ef5aca27d03aec41cb97\"},{\"command\":\"gcov-dump-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-dump-13\",\"sha256\":\"26b03d13aea8cb68156618ec79b091c58a2d877d1bc2ef5aca27d03aec41cb97\"},{\"command\":\"gcov-tool\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-tool-13\",\"sha256\":\"1e1dec404a3b6c21b1c0470a67eecb6e937e70dcf95995380d6d69d0b6aea2ee\"},{\"command\":\"gcov-tool-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gcov-tool-13\",\"sha256\":\"1e1dec404a3b6c21b1c0470a67eecb6e937e70dcf95995380d6d69d0b6aea2ee\"},{\"command\":\"gencat\",\"executable\":\"/usr/bin/gencat\",\"sha256\":\"29c0722ad12bce55dcd805036b42aad59b7e4d99380ddb4fd8711c81206a7495\"},{\"command\":\"getconf\",\"executable\":\"/usr/bin/getconf\",\"sha256\":\"7c9dd928cf45b89d34652f2626ca2fc236cba32bc3460d216576d709aaa7b6cc\"},{\"command\":\"getent\",\"executable\":\"/usr/bin/getent\",\"sha256\":\"7cbb5cb86b917b37b855dc5d43f9d9f258a72c7c444260c696f208f54678a3bc\"},{\"command\":\"getopt\",\"executable\":\"/usr/bin/getopt\",\"sha256\":\"01ad0c99563e8b7b452be500d5d5cc99fff5901785649691a53d8f478808705d\"},{\"command\":\"git\",\"executable\":\"/usr/bin/git\",\"sha256\":\"aa6540695d076182256dd6e96c8b302e4d56381e3000bbfd5c71bbdfe94a4942\"},{\"command\":\"git-receive-pack\",\"executable\":\"/usr/bin/git\",\"sha256\":\"aa6540695d076182256dd6e96c8b302e4d56381e3000bbfd5c71bbdfe94a4942\"},{\"command\":\"git-shell\",\"executable\":\"/usr/bin/git-shell\",\"sha256\":\"203ceb003bfda9f24357ff5483843a5609940cd065b1047e4deffd92fa9a9152\"},{\"command\":\"git-signature-validator\",\"executable\":\"/opt/prismpm/oracles/git-signature-validator.mjs\",\"sha256\":\"e940cf45ddbf10b21b6e29d64c70390ade3857eb8cd08cd28c9cec36c78c52a9\"},{\"command\":\"git-upload-archive\",\"executable\":\"/usr/bin/git\",\"sha256\":\"aa6540695d076182256dd6e96c8b302e4d56381e3000bbfd5c71bbdfe94a4942\"},{\"command\":\"git-upload-pack\",\"executable\":\"/usr/bin/git\",\"sha256\":\"aa6540695d076182256dd6e96c8b302e4d56381e3000bbfd5c71bbdfe94a4942\"},{\"command\":\"gmake\",\"executable\":\"/usr/bin/make\",\"sha256\":\"abbecc214fcadef6530d1cc137bde7ceb74cae3f6b992c7d10a8669a7314c7e0\"},{\"command\":\"gold\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ld.gold\",\"sha256\":\"91be8ad8ab23070ae4d55989793e457d507370cb3537338b403f6f5e8229b6d9\"},{\"command\":\"gp-archive\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gp-archive\",\"sha256\":\"2f26b485311c0ca7d741c5221221056fb8d72397965a3cf4f21cd5aad5b23358\"},{\"command\":\"gp-collect-app\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gp-collect-app\",\"sha256\":\"47dc715a7ae9eab495de6e741cbe938a96d9a39df1113eae82cd22d45f75e2af\"},{\"command\":\"gp-display-html\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gp-display-html\",\"sha256\":\"538acc2bcc24a50de51e88b2d733d50b69237ebfee14660e45a0255215d9f582\"},{\"command\":\"gp-display-src\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gp-display-src\",\"sha256\":\"fd2d6a61e0d8a75986e85a1ee7728755fd209fad15798db8e01a419a6472c3e5\"},{\"command\":\"gp-display-text\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gp-display-text\",\"sha256\":\"4d72c93772d03cd6de507678b532bcfdb8a7c761898cb2ba7a227618fe53b511\"},{\"command\":\"gpasswd\",\"executable\":\"/usr/bin/gpasswd\",\"sha256\":\"a9ffc9491711b0e10a49328a39ea5d5fbcfa1b326224152fc95596373a5c6200\"},{\"command\":\"gpg\",\"executable\":\"/usr/bin/gpg\",\"sha256\":\"d0871bc0b26cf1308ace6f6fe800de2a4d914e9b8c67c02f9c1b6adbb778c41e\"},{\"command\":\"gpg-agent\",\"executable\":\"/usr/bin/gpg-agent\",\"sha256\":\"5bd7c61c431192d41478e288e6f5bba0287aa5e766b007db82d25f27c8b8cdd7\"},{\"command\":\"gpg-connect-agent\",\"executable\":\"/usr/bin/gpg-connect-agent\",\"sha256\":\"e6206a01b83afa1b0ce9c594dbb08cdd650c1974214c7f171bf2b25d86704789\"},{\"command\":\"gpgconf\",\"executable\":\"/usr/bin/gpgconf\",\"sha256\":\"c963223a000f287aa8ce6eb264dcd54614e51d5701952694ba73866a8f16e6f5\"},{\"command\":\"gpgv\",\"executable\":\"/usr/bin/gpgv\",\"sha256\":\"a7b1bc1a88927e6f5b30101c415c311aaa9810f51642c12a6b1a824a4c1df1fa\"},{\"command\":\"gprof\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gprof\",\"sha256\":\"fafe04ca52d0dbddaa1eaca63f4d58f484c1400434182b6f69e5db6bb864b02f\"},{\"command\":\"gprofng\",\"executable\":\"/usr/bin/aarch64-linux-gnu-gprofng\",\"sha256\":\"8fe24cd8b82f26ddd41f0d7493bf5883c967e60f7b1cc85dbec21cae36c664cc\"},{\"command\":\"grep\",\"executable\":\"/usr/bin/grep\",\"sha256\":\"fb7efa5f6b958b44258b08ab860b086aaa0446b8b50564b3d43367b2ba4ed407\"},{\"command\":\"groups\",\"executable\":\"/usr/bin/groups\",\"sha256\":\"d4aee2c49d27d63b769d24c1aaded0b7a2c0c105fd3d0f1b18d838512dac5417\"},{\"command\":\"gtk-update-icon-cache\",\"executable\":\"/usr/bin/gtk-update-icon-cache\",\"sha256\":\"9ebe606540501dc57d1057cbcee0336618e3a71f41c1e7db030c1d15de55ff8d\"},{\"command\":\"gunzip\",\"executable\":\"/usr/bin/gunzip\",\"sha256\":\"55c2f67ca4c3cca0ebac659f0075461dd671ec4937ecd6c71123bb49ed322ebd\"},{\"command\":\"gzexe\",\"executable\":\"/usr/bin/gzexe\",\"sha256\":\"ec1bf1611079caf2a981b570453d4b8b5b4a1efb20dd32138f393eb994b70fea\"},{\"command\":\"gzip\",\"executable\":\"/usr/bin/gzip\",\"sha256\":\"51641b277c149e1b1e33b4ff1debcdfe29c9520b5826ae693927eb7c16a182c4\"},{\"command\":\"h2ph\",\"executable\":\"/usr/bin/h2ph\",\"sha256\":\"86c19c01835bba602e1e954e48b69846286c9deaf453ea30d63d72190832bdb0\"},{\"command\":\"h2xs\",\"executable\":\"/usr/bin/h2xs\",\"sha256\":\"7292e1d2b1bcef2a1b05ce8bae00b2651e5f115b5aff07272b1fafbdad9e723f\"},{\"command\":\"hardlink\",\"executable\":\"/usr/bin/hardlink\",\"sha256\":\"b566027c07dcef27edc1d611d4e673068d1f54988a1959f5e601d26f2818b265\"},{\"command\":\"head\",\"executable\":\"/usr/bin/head\",\"sha256\":\"612ef32edfefd3fc4ca1af14fb1bdfd6a48d8318a7901ffb38ffc2a604347f3c\"},{\"command\":\"hostid\",\"executable\":\"/usr/bin/hostid\",\"sha256\":\"d7426ee0610322a1ea25ccfc7aa3a74305aa22c5ed1b0fd34eec4b262fd7bce9\"},{\"command\":\"hostname\",\"executable\":\"/usr/bin/hostname\",\"sha256\":\"529801b643662701c07a120d133850a3a1d407fd0edd8390b3f2db759715eb8f\"},{\"command\":\"hostnamectl\",\"executable\":\"/usr/bin/hostnamectl\",\"sha256\":\"a7174e82c9db910865316af2aa2a8a98562d6ff5fec5fc43988b497f5e62f503\"},{\"command\":\"iconv\",\"executable\":\"/usr/bin/iconv\",\"sha256\":\"26b702236ab06b8310ea82bd97466d57bafe032f4d2c2ff48a10c8000db5f800\"},{\"command\":\"id\",\"executable\":\"/usr/bin/id\",\"sha256\":\"3b3b0197ad50b7e388e433e4e116bca4c860214148c108909154eb516d2dc9ed\"},{\"command\":\"infocmp\",\"executable\":\"/usr/bin/infocmp\",\"sha256\":\"52fcbe2149f210c71bc3433d0a60c65a62a8544cd66c01822c87cc834acb1496\"},{\"command\":\"infotocap\",\"executable\":\"/usr/bin/tic\",\"sha256\":\"71234d7ee819f7391990856281f772d578b19ae3b4e7f4626976c926310c2aae\"},{\"command\":\"install\",\"executable\":\"/usr/bin/install\",\"sha256\":\"8f4d01e05292943dcd00cb00551cd360c8383c7c4765dda7633f2069cd8afb1f\"},{\"command\":\"instmodsh\",\"executable\":\"/usr/bin/instmodsh\",\"sha256\":\"724aba7a26b1ba4f83af264e7bb31334aee0b56897b41d09c9dfd0b3389d6965\"},{\"command\":\"intoto-statement-validator\",\"executable\":\"/usr/local/bin/intoto-statement-validator\",\"sha256\":\"ccda3abd60d6616425f0f4af1b1444dd1245e76c4c9fa1b8bba4d2f65e587f02\"},{\"command\":\"ionice\",\"executable\":\"/usr/bin/ionice\",\"sha256\":\"5853dfc5b2513284f4e837b837aa5c05747ef98b9ce150cb0ba096b2ede6fa4b\"},{\"command\":\"ipcmk\",\"executable\":\"/usr/bin/ipcmk\",\"sha256\":\"a4815547b082b59d9eadb7d5a12936263acdd2a54d0324ab2b0eb21e1ae3eb97\"},{\"command\":\"ipcrm\",\"executable\":\"/usr/bin/ipcrm\",\"sha256\":\"bb260aef1f4235f53b7adb24bdc390cc27997b11c57dcdc6294b212cd7a8a0e9\"},{\"command\":\"ipcs\",\"executable\":\"/usr/bin/ipcs\",\"sha256\":\"d2e103ed9aa1875d6fca70a51f255eb09af8055e99959c17124f545793bab716\"},{\"command\":\"ischroot\",\"executable\":\"/usr/bin/ischroot\",\"sha256\":\"ca886bc4c52cf50b3239de26fed4da7ff1ae591cc075a581edc9f255462c1966\"},{\"command\":\"ispell-wrapper\",\"executable\":\"/usr/bin/ispell-wrapper\",\"sha256\":\"11ff62f305a09f52885315cb5dd295e5a47861accc596ebe818751022eb95c7f\"},{\"command\":\"join\",\"executable\":\"/usr/bin/join\",\"sha256\":\"e89548de35159655780e7797dde2e5e72c0fef232a1e57d1dc5ca020819c77e5\"},{\"command\":\"journalctl\",\"executable\":\"/usr/bin/journalctl\",\"sha256\":\"2507b16b76d739e587313828ff791f5fe033b437376aa2015fe7cd196a3131a4\"},{\"command\":\"json_pp\",\"executable\":\"/usr/bin/json_pp\",\"sha256\":\"b336e50dc789c31cbd7b0f467d05e0d91188d06c7c27aa4009b904af8c6a4091\"},{\"command\":\"just\",\"executable\":\"/usr/local/bin/just\",\"sha256\":\"ba5140b1d235ad37231a1acce6ce0867741ed241893e25d4ab8d5f33184eb1d2\"},{\"command\":\"kernel-install\",\"executable\":\"/usr/bin/kernel-install\",\"sha256\":\"d1247114e8adefa7e4f480bfb22462243e47f3ce71c16bf7c54dcb64153c8630\"},{\"command\":\"kill\",\"executable\":\"/usr/bin/kill\",\"sha256\":\"073d3e537f9659193d91b546d3dd58e077e2aef4b0dc5bb5b65220137a50a243\"},{\"command\":\"kind\",\"executable\":\"/usr/local/bin/kind\",\"sha256\":\"8e1014e87c34901cc422a1445866835d1e666f2a61301c27e722bdeab5a1f7e4\"},{\"command\":\"kubectl\",\"executable\":\"/usr/local/bin/kubectl\",\"sha256\":\"0ecf44450ee6063bf19dd166a103ee6df4a9034455c2abce626e6eea657d73fb\"},{\"command\":\"kubernetes-validator\",\"executable\":\"/opt/prismpm/oracles/kubernetes-validator.mjs\",\"sha256\":\"3c2555117a2fe092fc9260dc2672edaac415d36bd16e1edbbe32af847f92e737\"},{\"command\":\"lake\",\"executable\":\"/usr/local/elan/bin/lake\",\"sha256\":\"3985b63010981974c86c01c8e17f0c72ad5350104253f9cac8c7c87f8183de8d\"},{\"command\":\"last\",\"executable\":\"/usr/bin/last\",\"sha256\":\"0d89dcde6ca47477c4d91080595c99ae63e7c7d2f2fa79b8fa3507c3f49d919d\"},{\"command\":\"lastb\",\"executable\":\"/usr/bin/last\",\"sha256\":\"0d89dcde6ca47477c4d91080595c99ae63e7c7d2f2fa79b8fa3507c3f49d919d\"},{\"command\":\"lastlog\",\"executable\":\"/usr/bin/lastlog\",\"sha256\":\"5b7f450f259b044ad80187774777dfe645cd652e935d86bd4e258c58b2cd4f16\"},{\"command\":\"ld\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ld.bfd\",\"sha256\":\"1e4d3369b76845fa8e099b83513bf28f6f722e046f9b2cde1378c9e27f96d19c\"},{\"command\":\"ld.bfd\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ld.bfd\",\"sha256\":\"1e4d3369b76845fa8e099b83513bf28f6f722e046f9b2cde1378c9e27f96d19c\"},{\"command\":\"ld.gold\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ld.gold\",\"sha256\":\"91be8ad8ab23070ae4d55989793e457d507370cb3537338b403f6f5e8229b6d9\"},{\"command\":\"ld.so\",\"executable\":\"/usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1\",\"sha256\":\"49005ef8e9db9a45691ff875e6ca18dd8723c7ec5c1a863a276a1186dbf22774\"},{\"command\":\"ldd\",\"executable\":\"/usr/bin/ldd\",\"sha256\":\"2d9c1643ea67548e601baa6f6f4f4478cdd93afc5247a10ea94ae88a6e78d788\"},{\"command\":\"lean\",\"executable\":\"/usr/local/elan/bin/lean\",\"sha256\":\"3985b63010981974c86c01c8e17f0c72ad5350104253f9cac8c7c87f8183de8d\"},{\"command\":\"leanc\",\"executable\":\"/usr/local/elan/bin/leanc\",\"sha256\":\"3985b63010981974c86c01c8e17f0c72ad5350104253f9cac8c7c87f8183de8d\"},{\"command\":\"leanchecker\",\"executable\":\"/usr/local/elan/bin/leanchecker\",\"sha256\":\"3985b63010981974c86c01c8e17f0c72ad5350104253f9cac8c7c87f8183de8d\"},{\"command\":\"leanmake\",\"executable\":\"/usr/local/elan/bin/leanmake\",\"sha256\":\"3985b63010981974c86c01c8e17f0c72ad5350104253f9cac8c7c87f8183de8d\"},{\"command\":\"leanpkg\",\"executable\":\"/usr/local/elan/bin/leanpkg\",\"sha256\":\"3985b63010981974c86c01c8e17f0c72ad5350104253f9cac8c7c87f8183de8d\"},{\"command\":\"lexlean\",\"executable\":\"/usr/local/bin/lexlean\",\"sha256\":\"fa5f07242a5ad0bffc563dae614bf83dec075043ad03c5486b54e2b478f752a5\"},{\"command\":\"libnetcfg\",\"executable\":\"/usr/bin/libnetcfg\",\"sha256\":\"78bab79d103416b08a51e070bf599101a897f3753ff729bd3bafd4068f5b2564\"},{\"command\":\"link\",\"executable\":\"/usr/bin/link\",\"sha256\":\"7e9d9817bb0446b0c328c2a2f2fd972da5f1e66a3aecd7e663f0a4af3597a295\"},{\"command\":\"linux32\",\"executable\":\"/usr/bin/setarch\",\"sha256\":\"31d82c92b67440e4efa2331b7a6deb94a08e006696e61900825417120467f640\"},{\"command\":\"linux64\",\"executable\":\"/usr/bin/setarch\",\"sha256\":\"31d82c92b67440e4efa2331b7a6deb94a08e006696e61900825417120467f640\"},{\"command\":\"ln\",\"executable\":\"/usr/bin/ln\",\"sha256\":\"925e8bd7b49c7538616c070f2c17bb8b24908c1138c834dcce6c4117485b6118\"},{\"command\":\"locale\",\"executable\":\"/usr/bin/locale\",\"sha256\":\"a590aeb58b31980aba56df76288b0b5f1326612610fe8b65fba9a99561c93916\"},{\"command\":\"locale-check\",\"executable\":\"/usr/bin/locale-check\",\"sha256\":\"361ad88ab73a210c95ee99c9f1846a373dedd8ce07bc40df746c0e87fde9e169\"},{\"command\":\"localectl\",\"executable\":\"/usr/bin/localectl\",\"sha256\":\"0b6383108c49d2f54219b1d11f9f3bd3ce5c2769bcc7374580fb3b6d4e783b00\"},{\"command\":\"localedef\",\"executable\":\"/usr/bin/localedef\",\"sha256\":\"26fa2163e19f9661d50a5f194fcf29b78e2d33a0d8ec9bebf20496b20f04fd88\"},{\"command\":\"logger\",\"executable\":\"/usr/bin/logger\",\"sha256\":\"0e7a24b7ba0c4edaf0890da16c8d519f2b26d933a008b86447d9544c18fc21c1\"},{\"command\":\"login\",\"executable\":\"/usr/bin/login\",\"sha256\":\"c7274f3267ed4b1a6f620c50022ccbcd3526e73d832e8487f48b9a90f6b9e59a\"},{\"command\":\"loginctl\",\"executable\":\"/usr/bin/loginctl\",\"sha256\":\"6ba92d7b49ef99860e886252e8d643e5b1ff2ae5c3428b2eadef9d9f11a7ce03\"},{\"command\":\"logname\",\"executable\":\"/usr/bin/logname\",\"sha256\":\"54e9ab8bbfca02fff009d3f4b190cb6f08bae156c593ae88b7363e88a2c0068a\"},{\"command\":\"ls\",\"executable\":\"/usr/bin/ls\",\"sha256\":\"87337ebe81d2853af9f16915ad394344b287d0c99df48162fe15cc96c3fe6edf\"},{\"command\":\"lsattr\",\"executable\":\"/usr/bin/lsattr\",\"sha256\":\"cc7997da2d4bf3082c52ad35bb00ebf0cda13b36fb0cb64c181371a9b7a4b763\"},{\"command\":\"lsblk\",\"executable\":\"/usr/bin/lsblk\",\"sha256\":\"1846eb32336e9f15c82ef13126148a9273ed7ca568d422b092de95c8e4c1b646\"},{\"command\":\"lscpu\",\"executable\":\"/usr/bin/lscpu\",\"sha256\":\"e53e77cfa3772963de7585a989298d6049e031a056f5e3477ce42e84c3d464fd\"},{\"command\":\"lsipc\",\"executable\":\"/usr/bin/lsipc\",\"sha256\":\"a1996be797460534218819040b71f99673da3ac5af0f71412ebea87c898b3348\"},{\"command\":\"lslocks\",\"executable\":\"/usr/bin/lslocks\",\"sha256\":\"a9c933ef92d00fcea268bfd004cf38702000da9ecf62f1c531ec70bf677630c4\"},{\"command\":\"lslogins\",\"executable\":\"/usr/bin/lslogins\",\"sha256\":\"98abc2faf3afd380fa88d9d8367aed6e2e9bd69449298ec37eab9a65c8c7bc2f\"},{\"command\":\"lsmem\",\"executable\":\"/usr/bin/lsmem\",\"sha256\":\"e5c6202f54f64c0f9357297a2d455e9b0c0794808272889cf8c53ae03d259c70\"},{\"command\":\"lsns\",\"executable\":\"/usr/bin/lsns\",\"sha256\":\"001037f69f7c75a77e5e13b7f95e679627f9fc9477b789ffe0ffb4b39dfa7a6e\"},{\"command\":\"lto-dump\",\"executable\":\"/usr/bin/aarch64-linux-gnu-lto-dump-13\",\"sha256\":\"388e29e8f31599e067ee5ffdccc3722a55fb449276a58dbe4de03bab92c0a9ad\"},{\"command\":\"lto-dump-13\",\"executable\":\"/usr/bin/aarch64-linux-gnu-lto-dump-13\",\"sha256\":\"388e29e8f31599e067ee5ffdccc3722a55fb449276a58dbe4de03bab92c0a9ad\"},{\"command\":\"lzcat\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"296a7eaf0ac8cc4f37bd29f8fded9c768ed60fc646f64333e83e4f3a9148451d\"},{\"command\":\"lzcmp\",\"executable\":\"/usr/bin/xzdiff\",\"sha256\":\"551e26acd2c7d3f56ab6f43916cfcaafb96955eda66b656f1ed9a708f52e7667\"},{\"command\":\"lzdiff\",\"executable\":\"/usr/bin/xzdiff\",\"sha256\":\"551e26acd2c7d3f56ab6f43916cfcaafb96955eda66b656f1ed9a708f52e7667\"},{\"command\":\"lzegrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"lzfgrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"lzgrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"lzless\",\"executable\":\"/usr/bin/xzless\",\"sha256\":\"a25b3dee9826b993f4fe0043e6d3073c6658925c28afc303917d62b1cf465051\"},{\"command\":\"lzma\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"296a7eaf0ac8cc4f37bd29f8fded9c768ed60fc646f64333e83e4f3a9148451d\"},{\"command\":\"lzmainfo\",\"executable\":\"/usr/bin/lzmainfo\",\"sha256\":\"2d8ac87c84a531e0b3f9cbbd18852e286b23b1e67ed4d9ac95ad87163bec7069\"},{\"command\":\"lzmore\",\"executable\":\"/usr/bin/xzmore\",\"sha256\":\"e40b6cfbd6dcfd6fa46b721f7afb36efbbf3a8fbea1cd20f64b6123400f39306\"},{\"command\":\"make\",\"executable\":\"/usr/bin/make\",\"sha256\":\"abbecc214fcadef6530d1cc137bde7ceb74cae3f6b992c7d10a8669a7314c7e0\"},{\"command\":\"make-first-existing-target\",\"executable\":\"/usr/bin/make-first-existing-target\",\"sha256\":\"1ed1eb3449f3db643b7532550a04b9f0f3acd79a13243c4b474e1546f662e596\"},{\"command\":\"man\",\"executable\":\"/usr/bin/man\",\"sha256\":\"1150abfca60bce252e8a6a449719fec697aa8ac844ae330882a1618a78db05b7\"},{\"command\":\"mawk\",\"executable\":\"/usr/bin/mawk\",\"sha256\":\"38a07fb3962f22f50f09ed60bb7cc945053f25cd48519b974e597c4ee7a97a0c\"},{\"command\":\"mcookie\",\"executable\":\"/usr/bin/mcookie\",\"sha256\":\"5a9b732f10bbccf0ea7e9ec372753218a2d1e5dac4247a20333d90a7efcd55ed\"},{\"command\":\"md5sum\",\"executable\":\"/usr/bin/md5sum\",\"sha256\":\"146c9c1a25715930557f0cb97363228278a079aa869246daf3b731f897b0fcc0\"},{\"command\":\"md5sum.textutils\",\"executable\":\"/usr/bin/md5sum\",\"sha256\":\"146c9c1a25715930557f0cb97363228278a079aa869246daf3b731f897b0fcc0\"},{\"command\":\"mesg\",\"executable\":\"/usr/bin/mesg\",\"sha256\":\"53dbb4a30480568aa316babe88b9b7e0bad6cf299c2a8775dff88cef1bc1bf18\"},{\"command\":\"mkdir\",\"executable\":\"/usr/bin/mkdir\",\"sha256\":\"e0308b807656f115c844f785865ca009e6df2f5789ebfa3efb49c4b01640344e\"},{\"command\":\"mkfifo\",\"executable\":\"/usr/bin/mkfifo\",\"sha256\":\"008cd305d0d8ad589d11154b206a0ca3c4b829117127822959e451102b570668\"},{\"command\":\"mkfontdir\",\"executable\":\"/usr/bin/mkfontdir\",\"sha256\":\"3e42ff36b592706e5846d6133c38422d33881d3eaef87e59e9fda381c591ef78\"},{\"command\":\"mkfontscale\",\"executable\":\"/usr/bin/mkfontscale\",\"sha256\":\"fc059d114fb20ec6a8c5970c6e374f3526302b3ae30c63e712c4b70d7bc7db74\"},{\"command\":\"mknod\",\"executable\":\"/usr/bin/mknod\",\"sha256\":\"0039d8dbac20c752e0ac6147ebdf519ce19facbeaedbd48836ce0cc46eee25fb\"},{\"command\":\"mktemp\",\"executable\":\"/usr/bin/mktemp\",\"sha256\":\"4d082e92bcb9a6a2071fb7247e5785b748f4b5e0f8261ce3fcffeda775f9a05f\"},{\"command\":\"more\",\"executable\":\"/usr/bin/more\",\"sha256\":\"8ee32e17689c2dd4f81b0fca14a12fd1a8332e8f9db0e99b3ab518415d3f3ea6\"},{\"command\":\"mount\",\"executable\":\"/usr/bin/mount\",\"sha256\":\"d1f8e1f8e0b78f702f9d4ee0d996abd27f290ce0aa8a5490aa497d1c87b39092\"},{\"command\":\"mountpoint\",\"executable\":\"/usr/bin/mountpoint\",\"sha256\":\"2110f50f0b485633b997c4b050aa96755e88cc21a758fe19a5e57f636a3fab3a\"},{\"command\":\"mv\",\"executable\":\"/usr/bin/mv\",\"sha256\":\"8d17f81426c154381c58d5e9d957473b66a828589d4adf20f461b476137ae469\"},{\"command\":\"namei\",\"executable\":\"/usr/bin/namei\",\"sha256\":\"52321b7c4e2f3b2b47157d3c1a03ac4860082311e88280f6a25a94a0abecc9f1\"},{\"command\":\"nawk\",\"executable\":\"/usr/bin/mawk\",\"sha256\":\"38a07fb3962f22f50f09ed60bb7cc945053f25cd48519b974e597c4ee7a97a0c\"},{\"command\":\"networkctl\",\"executable\":\"/usr/bin/networkctl\",\"sha256\":\"0489cbbca0b7a567999477b405b3b4807abd07e359f59a8f7cc2f6c266082879\"},{\"command\":\"newgrp\",\"executable\":\"/usr/bin/newgrp\",\"sha256\":\"e8be2a2bd7c015f6bf3f8e721878a844070d17cbbfe354f2d80918a578597d58\"},{\"command\":\"nice\",\"executable\":\"/usr/bin/nice\",\"sha256\":\"0746d1600af7606b356e98974e05a26ce8db22e7c99df5bf4613d06128a3e566\"},{\"command\":\"nisdomainname\",\"executable\":\"/usr/bin/hostname\",\"sha256\":\"529801b643662701c07a120d133850a3a1d407fd0edd8390b3f2db759715eb8f\"},{\"command\":\"nl\",\"executable\":\"/usr/bin/nl\",\"sha256\":\"5ecde33d3629e777693d979d7092ef264e8fd147c2d1c17cbc4937dcd5523640\"},{\"command\":\"nm\",\"executable\":\"/usr/bin/aarch64-linux-gnu-nm\",\"sha256\":\"338d018c73ef394539da2566405a1f2f50a808e3c15ef72e9b48dd2f0b0d262f\"},{\"command\":\"node\",\"executable\":\"/usr/local/bin/node\",\"sha256\":\"1a638b0fe2b68da0489276aca95526c5122fc61ba54d6a2d0d00c1c92ab7b876\"},{\"command\":\"nodejs\",\"executable\":\"/usr/bin/node\",\"sha256\":\"a990a8ae388fc285ddbce280e63fca48cfd7695f632b66aec6ed581566eace99\"},{\"command\":\"nohup\",\"executable\":\"/usr/bin/nohup\",\"sha256\":\"53051eae19352198441e9bc09e2ef64035941791490d883950bf864dddda6186\"},{\"command\":\"npm\",\"executable\":\"/usr/local/lib/node_modules/npm/bin/npm-cli.js\",\"sha256\":\"8e5f6f3429f8cdbe693cdc29904e9d5a7b127a494bd15c804bd54c7403bfcbe7\"},{\"command\":\"nproc\",\"executable\":\"/usr/bin/nproc\",\"sha256\":\"aca08386960083c1bf7b556d4a9a25e0b0fbe3f7494679e1f26c22893c1d09d3\"},{\"command\":\"npx\",\"executable\":\"/usr/local/lib/node_modules/npm/bin/npx-cli.js\",\"sha256\":\"237adf8f3747cad8b9b62fcfd0d9c8d509a64e550337707f55100afcb79e8900\"},{\"command\":\"nsenter\",\"executable\":\"/usr/bin/nsenter\",\"sha256\":\"cb407a058c84154e192a5b6a4be111f2891b4223f93e11c61bf7620303cc241e\"},{\"command\":\"numfmt\",\"executable\":\"/usr/bin/numfmt\",\"sha256\":\"a7b615e6d54f4cd80214c03ba91bbd0d47cae0301a1059eb3ab00ab818913de9\"},{\"command\":\"objcopy\",\"executable\":\"/usr/bin/aarch64-linux-gnu-objcopy\",\"sha256\":\"1216ee3b084501a5132643fef4bba7221186f4b7dc99cd46e2bf9e3e7d37c344\"},{\"command\":\"objdump\",\"executable\":\"/usr/bin/aarch64-linux-gnu-objdump\",\"sha256\":\"f2e917a5d118ebf5679b24740e20d30338308e7f3f0630527c469de452d5a250\"},{\"command\":\"oci-distribution-conformance\",\"executable\":\"/usr/local/bin/oci-distribution-conformance\",\"sha256\":\"6fa5e5b29dd6727e2e0af3eacdac7f5597a77bde14ef16957467ebfe42cc40fd\"},{\"command\":\"oci-image-schema-conformance\",\"executable\":\"/usr/local/bin/oci-image-schema-conformance\",\"sha256\":\"b1342cb1c38c1072e2c86a0e35343605d2bf5c63affa768a5116c1d5fc68e4b0\"},{\"command\":\"oci-runtime-validate\",\"executable\":\"/usr/local/bin/oci-runtime-validate\",\"sha256\":\"e2a80254467d17855b584e82aaf1c248c7cbe58ad6a18c4af3d7d783b7081b78\"},{\"command\":\"od\",\"executable\":\"/usr/bin/od\",\"sha256\":\"d3020bc8b33d45d395c42a27de9104ae6a0101b3447ffff4a61853acb2f5e43f\"},{\"command\":\"openid-conformance\",\"executable\":\"/usr/local/bin/openid-conformance\",\"sha256\":\"7ee100439bc7dc35cda162b85be68140338bdae5aa3c2fb79412cca621bdd9b1\"},{\"command\":\"openssl\",\"executable\":\"/usr/bin/openssl\",\"sha256\":\"4b181b2ff3334c33d5572dab210b2855375ac5179e2729247afc0a9b6041d588\"},{\"command\":\"oras\",\"executable\":\"/usr/local/bin/oras\",\"sha256\":\"e2b67c4efb35f20a546aacc680e0f81f907d3cf4cf9f1b2040c34bb471c428f1\"},{\"command\":\"osv-scanner\",\"executable\":\"/usr/local/bin/osv-scanner\",\"sha256\":\"44e580752910f0ff36ec99aff59af20f65df1e859aa31e5605a8f0d055b496e9\"},{\"command\":\"otelcol-contrib\",\"executable\":\"/usr/local/bin/otelcol-contrib\",\"sha256\":\"ab2a5776537bdf16c9adc4f986ada565f339fd954c48a25d574e9b72195515fa\"},{\"command\":\"pager\",\"executable\":\"/usr/bin/more\",\"sha256\":\"8ee32e17689c2dd4f81b0fca14a12fd1a8332e8f9db0e99b3ab518415d3f3ea6\"},{\"command\":\"partx\",\"executable\":\"/usr/bin/partx\",\"sha256\":\"4ae7f2ed951d61cf7a270b2cc56bba54d9e2b4018950f5c242acd34e95f1beaa\"},{\"command\":\"passwd\",\"executable\":\"/usr/bin/passwd\",\"sha256\":\"8685741e7fc8089ac84764e55e7a1734e14658d7124d020c1f39f3d25fd8b0ae\"},{\"command\":\"paste\",\"executable\":\"/usr/bin/paste\",\"sha256\":\"16f1811628ecb90917aa45178b47c4ddf41738468e1f7863f9d909bbfc15917e\"},{\"command\":\"patch\",\"executable\":\"/usr/bin/patch\",\"sha256\":\"1b04b2a8dffbcfa9d75d17eb386a73f271415142d4e48baab2acfc10b1cca8f5\"},{\"command\":\"pathchk\",\"executable\":\"/usr/bin/pathchk\",\"sha256\":\"7ae646afc527208c574a65f7072f994f7cf9b93e5d27f3a6624b37c897f42de2\"},{\"command\":\"pdb3\",\"executable\":\"/usr/lib/python3.12/pdb.py\",\"sha256\":\"8d2a36cb0c9a4d8eda57e1a4fe153fff2724570286ecf520648aee4fe7a4fff7\"},{\"command\":\"pdb3.12\",\"executable\":\"/usr/lib/python3.12/pdb.py\",\"sha256\":\"8d2a36cb0c9a4d8eda57e1a4fe153fff2724570286ecf520648aee4fe7a4fff7\"},{\"command\":\"perl\",\"executable\":\"/usr/bin/perl\",\"sha256\":\"e16baa3bf04329253c99ba0ce60f84afc87a7330e271646cdee1e54885c38007\"},{\"command\":\"perl5.38-aarch64-linux-gnu\",\"executable\":\"/usr/bin/perl5.38-aarch64-linux-gnu\",\"sha256\":\"2f95c3bf4c22fbb04242dd9a96cc29eae6baa84e29356ebf9ef27a1483c08f24\"},{\"command\":\"perl5.38.2\",\"executable\":\"/usr/bin/perl5.38.2\",\"sha256\":\"e16baa3bf04329253c99ba0ce60f84afc87a7330e271646cdee1e54885c38007\"},{\"command\":\"perlbug\",\"executable\":\"/usr/bin/perlbug\",\"sha256\":\"f1283dadae7c65a24852623282b6ec235a83e32dfa53c75745de98a672791d41\"},{\"command\":\"perldoc\",\"executable\":\"/usr/bin/perldoc\",\"sha256\":\"d8bebeee62ce30574f40d53182b7fe17619e144233a7f7ddfa3e33ca34deccec\"},{\"command\":\"perlivp\",\"executable\":\"/usr/bin/perlivp\",\"sha256\":\"ea0bc6dfbf245531e7fed7ee22c07d576aaf89e57251bab47a879f40742d565e\"},{\"command\":\"perlthanks\",\"executable\":\"/usr/bin/perlthanks\",\"sha256\":\"f1283dadae7c65a24852623282b6ec235a83e32dfa53c75745de98a672791d41\"},{\"command\":\"pgrep\",\"executable\":\"/usr/bin/pgrep\",\"sha256\":\"62b85644146d2ef2a8441b25220e3b1ea8ab7303ae56a828af12cbd87d7fdb3b\"},{\"command\":\"piconv\",\"executable\":\"/usr/bin/piconv\",\"sha256\":\"0ddc062a05a184cc3f89338a44437364a29811b420f3660c13915bddfdc3a689\"},{\"command\":\"pidof\",\"executable\":\"/usr/sbin/killall5\",\"sha256\":\"7cc77d6d070b63e53336eb1233f1d2ceb131d185c200f0043537bfc7d0e4699c\"},{\"command\":\"pidwait\",\"executable\":\"/usr/bin/pidwait\",\"sha256\":\"62b85644146d2ef2a8441b25220e3b1ea8ab7303ae56a828af12cbd87d7fdb3b\"},{\"command\":\"pinentry\",\"executable\":\"/usr/bin/pinentry-curses\",\"sha256\":\"4f8a668bd0db04683466dc31385c1ac6f317ce8f7dcc0262157b7238aae7a2b3\"},{\"command\":\"pinentry-curses\",\"executable\":\"/usr/bin/pinentry-curses\",\"sha256\":\"4f8a668bd0db04683466dc31385c1ac6f317ce8f7dcc0262157b7238aae7a2b3\"},{\"command\":\"pinky\",\"executable\":\"/usr/bin/pinky\",\"sha256\":\"f685f53acac3d973665b737bb3333edd3af14cd6e77fc5ed9b3ae84d595e8833\"},{\"command\":\"pkg-config\",\"executable\":\"/usr/bin/pkgconf\",\"sha256\":\"b21b58e97876992968c82d823d74034abbc6a4176f8c9d5f2e0400f343e73fc1\"},{\"command\":\"pkgconf\",\"executable\":\"/usr/bin/pkgconf\",\"sha256\":\"b21b58e97876992968c82d823d74034abbc6a4176f8c9d5f2e0400f343e73fc1\"},{\"command\":\"pkill\",\"executable\":\"/usr/bin/pgrep\",\"sha256\":\"62b85644146d2ef2a8441b25220e3b1ea8ab7303ae56a828af12cbd87d7fdb3b\"},{\"command\":\"pl2pm\",\"executable\":\"/usr/bin/pl2pm\",\"sha256\":\"a974fb9e86c76778a249d47d521e6fa1847c331ba3eea6e240a37b1c44dd6a1d\"},{\"command\":\"pldd\",\"executable\":\"/usr/bin/pldd\",\"sha256\":\"9a100429c740c442c0f88b06166460661806d070f2d49ba0484c75a00244d1ce\"},{\"command\":\"pmap\",\"executable\":\"/usr/bin/pmap\",\"sha256\":\"1b22197a71a07653eef28c8dee7ee72358a4694b3b9d444b8c1543fd0e20c96e\"},{\"command\":\"pod2html\",\"executable\":\"/usr/bin/pod2html\",\"sha256\":\"713aa9fdcf27a9b70991c14ee5bc47a8a56ec2cfd804df9b79f90f6024de4750\"},{\"command\":\"pod2man\",\"executable\":\"/usr/bin/pod2man\",\"sha256\":\"fdcf8ff920a7461cad02121890b58039f01206809cea6e09eef84692eb793a17\"},{\"command\":\"pod2text\",\"executable\":\"/usr/bin/pod2text\",\"sha256\":\"e0372745722b8d7eeb3ce932606493381c936886e754913d25578cadfce29a13\"},{\"command\":\"pod2usage\",\"executable\":\"/usr/bin/pod2usage\",\"sha256\":\"6405327f3f8660ed89c068b760f61ffb9bd180e2997e9ba881be00f6989c6da3\"},{\"command\":\"podchecker\",\"executable\":\"/usr/bin/podchecker\",\"sha256\":\"b41c90733b7f4051dbe82d289177add630133f0679660fbfa3f3051ecd309dbb\"},{\"command\":\"pr\",\"executable\":\"/usr/bin/pr\",\"sha256\":\"56a5874a702f793ce3189206e214d3b1a1e1568954e9ad3c94ef574addddd3ee\"},{\"command\":\"printenv\",\"executable\":\"/usr/bin/printenv\",\"sha256\":\"9b05218074e82cb36afa0d1236874bd48e871a29bb91211ce1540238a6af5b26\"},{\"command\":\"printf\",\"executable\":\"/usr/bin/printf\",\"sha256\":\"f431071e7304e8448a4565facfc27afefd2578a993da3f1942b3e457d70f8730\"},{\"command\":\"prismpm\",\"executable\":\"/usr/local/bin/prismpm\",\"sha256\":\"62da63d950a9bee4bd2a7d8c5ff254222aca45780c9b5862856a5dff61e9fe7b\"},{\"command\":\"prismpm-conformance\",\"executable\":\"/usr/local/bin/prismpm-conformance\",\"sha256\":\"578e2e0ab7ee0859ee39b6f45d72b6c79ae5680b9f17c22264ed374db7bc1b11\"},{\"command\":\"prismpm-devcontainer-init\",\"executable\":\"/usr/local/bin/prismpm-devcontainer-init\",\"sha256\":\"b8787fc1f0b996393d4e7c55f84a901916e807570c76f27c027743d27dde487b\"},{\"command\":\"prismpm-platform-equivalence\",\"executable\":\"/usr/local/bin/prismpm-platform-equivalence\",\"sha256\":\"909e32fb88aaa039f362d1bba795ae97762c1957d297223c454a457ed8e90d9a\"},{\"command\":\"prlimit\",\"executable\":\"/usr/bin/prlimit\",\"sha256\":\"2a479939c95a886fb8b52244381639816f8cf1f68eee713a9227d0c5d257c805\"},{\"command\":\"prove\",\"executable\":\"/usr/bin/prove\",\"sha256\":\"30c7fee6225199bbcd242975fe5b2df0436e9ffa9136a5b8972b922dfaf8485b\"},{\"command\":\"ps\",\"executable\":\"/usr/bin/ps\",\"sha256\":\"3fa1c04e29647304817b1ffe9a7600dc80c879ea4c8a9302032799830e0c2133\"},{\"command\":\"ptar\",\"executable\":\"/usr/bin/ptar\",\"sha256\":\"126fc379885309b476100e1150430256ab892c5b5650741af17478984a389758\"},{\"command\":\"ptardiff\",\"executable\":\"/usr/bin/ptardiff\",\"sha256\":\"1d7d45bd4f48409a479886e6cfb6e3e8093fea89b10ce906d399484d92a86cc0\"},{\"command\":\"ptargrep\",\"executable\":\"/usr/bin/ptargrep\",\"sha256\":\"0bca747354107929ecefbab2a8128923763bfa622124e20a1194c7f8a914a20f\"},{\"command\":\"ptx\",\"executable\":\"/usr/bin/ptx\",\"sha256\":\"cea67db2ac5c2a0fca52ca9c23977125618a2b7c6f101cde6b9c6731cc1d6b88\"},{\"command\":\"pwd\",\"executable\":\"/usr/bin/pwd\",\"sha256\":\"e5d415b20c643d99f6268254045f006ddd6609d71b065d490a1501f716da4fd2\"},{\"command\":\"pwdx\",\"executable\":\"/usr/bin/pwdx\",\"sha256\":\"92d622ec724bf1dafe937039cf8b8f3a489c59fcf1d401059a107e72087e0c58\"},{\"command\":\"py3clean\",\"executable\":\"/usr/bin/py3clean\",\"sha256\":\"48c7d9e6a14a349beae906eae5fe8cac9a974bda7a40c3dc3b9e1163251eb250\"},{\"command\":\"py3compile\",\"executable\":\"/usr/bin/py3compile\",\"sha256\":\"4ca3cf6f9fbb47571e11c86222f4f3952a22d87f5df37c060388e96b0ef00813\"},{\"command\":\"py3versions\",\"executable\":\"/usr/share/python3/py3versions.py\",\"sha256\":\"8b0eef6d34bd68477d81d89d8e6bf91d6a991cb5034351d564731aa013b6e7e7\"},{\"command\":\"pydoc3\",\"executable\":\"/usr/bin/pydoc3.12\",\"sha256\":\"ddbcea7349aca28998c76624ac9b4a692b3edd4ab80c279e7d97a6aca813191a\"},{\"command\":\"pydoc3.12\",\"executable\":\"/usr/bin/pydoc3.12\",\"sha256\":\"ddbcea7349aca28998c76624ac9b4a692b3edd4ab80c279e7d97a6aca813191a\"},{\"command\":\"pygettext3\",\"executable\":\"/usr/bin/pygettext3.12\",\"sha256\":\"d6d87fa2841d71debfdec183c7df8752a759ca56af467248a79e2e192f80eda1\"},{\"command\":\"pygettext3.12\",\"executable\":\"/usr/bin/pygettext3.12\",\"sha256\":\"d6d87fa2841d71debfdec183c7df8752a759ca56af467248a79e2e192f80eda1\"},{\"command\":\"python3\",\"executable\":\"/usr/bin/python3.12\",\"sha256\":\"a7d56a8a764faf7bbf5c164055a48fd072be52287bdeb523a9e07b2042f4e7e1\"},{\"command\":\"python3.12\",\"executable\":\"/usr/bin/python3.12\",\"sha256\":\"a7d56a8a764faf7bbf5c164055a48fd072be52287bdeb523a9e07b2042f4e7e1\"},{\"command\":\"ranlib\",\"executable\":\"/usr/bin/aarch64-linux-gnu-ranlib\",\"sha256\":\"824de22ce448c3567e631425f7754a6df72e90bd758079daa94f1aa6edf41513\"},{\"command\":\"rbash\",\"executable\":\"/usr/bin/bash\",\"sha256\":\"af955ef55333c8fc9c5aa50df91ad1a629d9a79a9afa125cd5e9629585f78015\"},{\"command\":\"readelf\",\"executable\":\"/usr/bin/aarch64-linux-gnu-readelf\",\"sha256\":\"6bca2bbd23b072db9e9a19ae0e65cf7b7c15c08a3c2cf01dd56453e1ac9340b1\"},{\"command\":\"readlink\",\"executable\":\"/usr/bin/readlink\",\"sha256\":\"068bf5e7b3cfa43ae02ccf7b854f13863adb05d75d011a2de9e89adafd1a524b\"},{\"command\":\"realpath\",\"executable\":\"/usr/bin/realpath\",\"sha256\":\"8dd4c640bedcb4044098c8fb6aa7725ef92c824d1938084fa9abc9a5be5ffc61\"},{\"command\":\"rename.ul\",\"executable\":\"/usr/bin/rename.ul\",\"sha256\":\"d722c496ff5f9c67ca5072fad141b1c4460d9fc5f83f623a11b06b54e76d95c4\"},{\"command\":\"renice\",\"executable\":\"/usr/bin/renice\",\"sha256\":\"79a5d7f65ec6df91405ba529d1dc9fa4449761272ee3aec10c5ca1e9a86053e5\"},{\"command\":\"reset\",\"executable\":\"/usr/bin/tset\",\"sha256\":\"65369c25251289d5009f7f5481383c021f358a6c565f7d4310f5ebc115362dc8\"},{\"command\":\"resizepart\",\"executable\":\"/usr/bin/resizepart\",\"sha256\":\"c9489b516e682e4e90d330fe4f8d2e486844527fba65ddf44e604b41c0863836\"},{\"command\":\"rev\",\"executable\":\"/usr/bin/rev\",\"sha256\":\"43e429dede9dfd39d02ee407ff7f4ef8180a1f816a5a7e8c5f626c4664f5ef7d\"},{\"command\":\"rgrep\",\"executable\":\"/usr/bin/rgrep\",\"sha256\":\"0a8dd42a068115f058ae57f9f6347e1ef0ae2ffea89bf658b132974246577748\"},{\"command\":\"rls\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"rm\",\"executable\":\"/usr/bin/rm\",\"sha256\":\"acc9c5cb7387a25725bb504bf60fc35fbd487e902dd6b4a725f444d3188e95a6\"},{\"command\":\"rmdir\",\"executable\":\"/usr/bin/rmdir\",\"sha256\":\"e0ccd8e45e85e1b1e3b4c3ca571354937632a2b651d24299c1910c388d4509cc\"},{\"command\":\"rpcgen\",\"executable\":\"/usr/bin/rpcgen\",\"sha256\":\"c08bb44246dc702c11bc3f31b5994addacf62c520f28f00f10dd16c8b76a895f\"},{\"command\":\"run-parts\",\"executable\":\"/usr/bin/run-parts\",\"sha256\":\"a0bf35fb6e8053a4b9026090016d0e8d1e870705cde7c9f750d58445c4aa700d\"},{\"command\":\"runcon\",\"executable\":\"/usr/bin/runcon\",\"sha256\":\"536161f98700f2bc51916690e7c102093d67acd20e501a15bacd2c9e54f7ee87\"},{\"command\":\"rust-analyzer\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"rust-gdb\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"rust-gdbgui\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"rust-lldb\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"rustc\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"rustdoc\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"rustfmt\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"rustup\",\"executable\":\"/usr/local/cargo/bin/rustup\",\"sha256\":\"9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792\"},{\"command\":\"savelog\",\"executable\":\"/usr/bin/savelog\",\"sha256\":\"6a0f55fea1a81f1930c86f534fb5570785b2f12f3da49709e76c3148a89e0197\"},{\"command\":\"scalar\",\"executable\":\"/usr/bin/scalar\",\"sha256\":\"1ddce4a9a6bafc21ba5db7b92a19c6c83e2b5e2596ea6257bb36e184487d0a7e\"},{\"command\":\"scp\",\"executable\":\"/usr/bin/scp\",\"sha256\":\"3fcd364740fc61c5244427412289eae08319275f998a42942a3a7ad4d28a26e4\"},{\"command\":\"script\",\"executable\":\"/usr/bin/script\",\"sha256\":\"f9fb256e6474c30ba9e69976e5a3fbf473e532cdecc37cc27d8fb51dbce90340\"},{\"command\":\"scriptlive\",\"executable\":\"/usr/bin/scriptlive\",\"sha256\":\"d5fb627d6062b976f3b3415dd681a4be52febcdb7178480490699fe4de4d473d\"},{\"command\":\"scriptreplay\",\"executable\":\"/usr/bin/scriptreplay\",\"sha256\":\"7e77b496879e1086bee3fad6c2c4e19ae06ec9aede5f87574112038447517ce0\"},{\"command\":\"sdiff\",\"executable\":\"/usr/bin/sdiff\",\"sha256\":\"661b67f524a61633eba317cbc21d691851841ef95f2dcf91f89d7f9997a11f13\"},{\"command\":\"sed\",\"executable\":\"/usr/bin/sed\",\"sha256\":\"39ca7d42a112f32abd4f2a016c8a0d1777a5fd75608f8e1a5d80ac161337a0fe\"},{\"command\":\"select-default-iwrap\",\"executable\":\"/usr/bin/select-default-iwrap\",\"sha256\":\"8887e11359e088e96a84494f36b38a9b60d13cb9170bf34d8c3f3a79a3894052\"},{\"command\":\"select-editor\",\"executable\":\"/usr/bin/select-editor\",\"sha256\":\"46ce6e3872a1807f83a958d647ededf626f3aab13ad4b078493358c59aa5b97e\"},{\"command\":\"sensible-browser\",\"executable\":\"/usr/bin/sensible-browser\",\"sha256\":\"0da2fd759bef3369bf3ff660ab0285525ac80836c5cc8adff977b0f714be2945\"},{\"command\":\"sensible-editor\",\"executable\":\"/usr/bin/sensible-editor\",\"sha256\":\"3c92be6eb21bf661df4cc75caa3bd1d587378b313d981ec17af318532d00689b\"},{\"command\":\"sensible-pager\",\"executable\":\"/usr/bin/sensible-pager\",\"sha256\":\"c1cc2231c552a691c0a7da73f9e79954cfa785921019385a2b7f1dedb4446940\"},{\"command\":\"sensible-terminal\",\"executable\":\"/usr/bin/sensible-terminal\",\"sha256\":\"98bbedd54ce47886213d09ab622872e4fb1742e9ba325a0202cfb8e3705ac510\"},{\"command\":\"seq\",\"executable\":\"/usr/bin/seq\",\"sha256\":\"55c96307f0875b1a9205ff228cab8afa1af66835e2c472039ecc2b340481e754\"},{\"command\":\"session-migration\",\"executable\":\"/usr/bin/session-migration\",\"sha256\":\"e318b3d0ef3299f9e916f04195bffb647460eae14138f70ceaa62192e04c00ea\"},{\"command\":\"setarch\",\"executable\":\"/usr/bin/setarch\",\"sha256\":\"31d82c92b67440e4efa2331b7a6deb94a08e006696e61900825417120467f640\"},{\"command\":\"setpriv\",\"executable\":\"/usr/bin/setpriv\",\"sha256\":\"aa302d81cc4bccd088cd887d5e729f2c2488eb67cf8c2541385de21db3907c8c\"},{\"command\":\"setsid\",\"executable\":\"/usr/bin/setsid\",\"sha256\":\"fb541a17af14a6c71863a12f24684e813668835654e2b8fb1df170a4568ac725\"},{\"command\":\"setterm\",\"executable\":\"/usr/bin/setterm\",\"sha256\":\"0e783626cf79edffd350fc1a4bb35f3d8678e43f12068af44c5e08dd83e925d0\"},{\"command\":\"setxkbmap\",\"executable\":\"/usr/bin/setxkbmap\",\"sha256\":\"08eb5014ac72cee8982c3754565000b98a23862328ffae4b75868573c060d5d9\"},{\"command\":\"sftp\",\"executable\":\"/usr/bin/sftp\",\"sha256\":\"9e53913afdf26161700611419a5ff7d823d0d05a4c3643657eb27c8703b7bc9b\"},{\"command\":\"sg\",\"executable\":\"/usr/bin/newgrp\",\"sha256\":\"e8be2a2bd7c015f6bf3f8e721878a844070d17cbbfe354f2d80918a578597d58\"},{\"command\":\"sh\",\"executable\":\"/usr/bin/dash\",\"sha256\":\"c883d9c27228339580994a1d0ea960645368c7d1b960a712bd0c655860c2d0d7\"},{\"command\":\"sha1sum\",\"executable\":\"/usr/bin/sha1sum\",\"sha256\":\"fb8a6fcbb64e8cdeb84b0e41cdcdd55ac42edfb9c51f77c68191f352440ee15d\"},{\"command\":\"sha224sum\",\"executable\":\"/usr/bin/sha224sum\",\"sha256\":\"ffb9efbd80cf57bd32de32063e219ff09ca75247523d807276eb3d8e9d6f3b9b\"},{\"command\":\"sha256sum\",\"executable\":\"/usr/bin/sha256sum\",\"sha256\":\"f3d040161f5c29e4c7cd4e3d6bb513ce9a43b9d1bd06f456a6aab3d34d0f1e33\"},{\"command\":\"sha384sum\",\"executable\":\"/usr/bin/sha384sum\",\"sha256\":\"64e145ee1b3507148d8aa3d11b80d73266e52ffff33374500980bb7f42151546\"},{\"command\":\"sha512sum\",\"executable\":\"/usr/bin/sha512sum\",\"sha256\":\"4136092171c939e640db094217b4de0ab17f2ec02b2eb87a4edb05de03ef5b9b\"},{\"command\":\"shasum\",\"executable\":\"/usr/bin/shasum\",\"sha256\":\"e3bad5e7cd244f5a24fbee97be7e9a90ee20993ff5b5213ffeac0e0976cffb7c\"},{\"command\":\"shred\",\"executable\":\"/usr/bin/shred\",\"sha256\":\"aea49cf561626d6450542c27f000d59190f6402ad2ed5a1f386e5641a73f4524\"},{\"command\":\"shuf\",\"executable\":\"/usr/bin/shuf\",\"sha256\":\"051696ca48c1aac3658df7d7bf405cfdbf85af532c888d9eee1daa81977cf3b3\"},{\"command\":\"size\",\"executable\":\"/usr/bin/aarch64-linux-gnu-size\",\"sha256\":\"59043ac56a8c2c059cd4cad6de00d80d0efd004c69efbb40f00a44b530323973\"},{\"command\":\"skill\",\"executable\":\"/usr/bin/skill\",\"sha256\":\"644a8de8bea0bea81a0133fe81ec93d6ad5985b2b69e19fa24d6c52d414e1d7c\"},{\"command\":\"slabtop\",\"executable\":\"/usr/bin/slabtop\",\"sha256\":\"136699d09efd98ea4660687cb18a442054016a1c51710491f90f0866928bc9f3\"},{\"command\":\"sleep\",\"executable\":\"/usr/bin/sleep\",\"sha256\":\"a3202123ba517a3c4f08ca25429e3f48eb9dffae9b888a9d353c21451f807f6a\"},{\"command\":\"slogin\",\"executable\":\"/usr/bin/ssh\",\"sha256\":\"8d595230ff925ba5df41daef600b4e7334d429464629c0072b8fcf78498839c3\"},{\"command\":\"slsa-validator\",\"executable\":\"/opt/prismpm/oracles/slsa-validator.mjs\",\"sha256\":\"04cdd2f287060cc2ba7a93b45ddcb899140451e9375e703aa4aabfee10800b7f\"},{\"command\":\"slsa-verifier\",\"executable\":\"/usr/local/bin/slsa-verifier\",\"sha256\":\"5d3b2349ede7bfec19e7a21569f18b9f7410145ad12e9584b175370669e14061\"},{\"command\":\"snice\",\"executable\":\"/usr/bin/skill\",\"sha256\":\"644a8de8bea0bea81a0133fe81ec93d6ad5985b2b69e19fa24d6c52d414e1d7c\"},{\"command\":\"sort\",\"executable\":\"/usr/bin/sort\",\"sha256\":\"585d23713156762b18afcebc553fee6d46fe2d5848c27f3f46ab13d877341d79\"},{\"command\":\"spdx-validator\",\"executable\":\"/opt/prismpm/oracles/spdx-validator.mjs\",\"sha256\":\"e2670b02913ab07bef777fe30075892652b2fd8b78ca396d83916368946334a1\"},{\"command\":\"splain\",\"executable\":\"/usr/bin/splain\",\"sha256\":\"06b28f957c591b63f3c03dd5829ce85e7ce2daf29c82baa4c24445cdf40d3052\"},{\"command\":\"split\",\"executable\":\"/usr/bin/split\",\"sha256\":\"a8efa448605a658c10407d7c7c49fb754ae70984be050f9eb29f13d2787233e7\"},{\"command\":\"ssh\",\"executable\":\"/usr/bin/ssh\",\"sha256\":\"8d595230ff925ba5df41daef600b4e7334d429464629c0072b8fcf78498839c3\"},{\"command\":\"ssh-add\",\"executable\":\"/usr/bin/ssh-add\",\"sha256\":\"83a77d6d92665756f1fbccf4ee084b1f10c4ea161f4efc0c607b34346e162a8b\"},{\"command\":\"ssh-agent\",\"executable\":\"/usr/bin/ssh-agent\",\"sha256\":\"79a3a7ed7c3fba571dc3de7468c0c498f4081dc3d30029dd1850e5d5f3218115\"},{\"command\":\"ssh-argv0\",\"executable\":\"/usr/bin/ssh-argv0\",\"sha256\":\"fcf4ffdfab652a0882b7b2417a25265d07a936c4268e2d3f4dec14797a9e5734\"},{\"command\":\"ssh-copy-id\",\"executable\":\"/usr/bin/ssh-copy-id\",\"sha256\":\"b625120eeff8b0e64e4e8c71e5ed3a7878fd69d318a88ce0a22e115725f6b815\"},{\"command\":\"ssh-keygen\",\"executable\":\"/usr/bin/ssh-keygen\",\"sha256\":\"621136662bb8552f45bdec675fa676d47d2ba9f258574bc58efeccb813b14bc0\"},{\"command\":\"ssh-keyscan\",\"executable\":\"/usr/bin/ssh-keyscan\",\"sha256\":\"97dc9d62283a0435c43edd8185c518707ba2f830b68937255818bd43d73245ba\"},{\"command\":\"stat\",\"executable\":\"/usr/bin/stat\",\"sha256\":\"86b89355842f54a49698069b345eabb94c2f26d2f33b5734ec91c68de8fe6f7a\"},{\"command\":\"stdbuf\",\"executable\":\"/usr/bin/stdbuf\",\"sha256\":\"9fb39588cadcc6bbec9e1da3f84789c6e409cc3ee58577f860ea0de3d6a32da2\"},{\"command\":\"streamzip\",\"executable\":\"/usr/bin/streamzip\",\"sha256\":\"672ee1b2d50455c34d9fc4c294b68e757c4920196d6fdfb4295dd2d76e7696f8\"},{\"command\":\"strings\",\"executable\":\"/usr/bin/aarch64-linux-gnu-strings\",\"sha256\":\"f6b809537477dfed119b80ad8c0da1653a2b9ed0173ebb72ebf236a1c94ce018\"},{\"command\":\"strip\",\"executable\":\"/usr/bin/aarch64-linux-gnu-strip\",\"sha256\":\"3a69e3786ea2884baf4d9811e509ba6d16be03d5d6f541103b8de317a2465fca\"},{\"command\":\"stty\",\"executable\":\"/usr/bin/stty\",\"sha256\":\"9d7bb61f709ddc6f8d427b2388ff5f632436a111ee5ab7c9cc3892f613e592bc\"},{\"command\":\"su\",\"executable\":\"/usr/bin/su\",\"sha256\":\"26a3c00a4e11be92a4f7f9b2eb36b5543efbf722b34d5651bd03833e786389d4\"},{\"command\":\"sum\",\"executable\":\"/usr/bin/sum\",\"sha256\":\"174719077667beffcef4fe041b9e4f647a601a795d8d4d4df6b9e2a76a96b29e\"},{\"command\":\"sync\",\"executable\":\"/usr/bin/sync\",\"sha256\":\"2108de36adb79e402ebf43ada3eb84e6dd05078a9d1ade2f32d501a2b9f9485d\"},{\"command\":\"systemctl\",\"executable\":\"/usr/bin/systemctl\",\"sha256\":\"f158408c8ff84e0dfd2eda0678b7939a028a7c3c19039ef5792511a92a36267e\"},{\"command\":\"systemd\",\"executable\":\"/usr/lib/systemd/systemd\",\"sha256\":\"2c89a676735d70cf4142b4e8e76c9c524e0d8d53d8a629565e08fe81303a5c4a\"},{\"command\":\"systemd-ac-power\",\"executable\":\"/usr/bin/systemd-ac-power\",\"sha256\":\"a8d16fe6fe57241de9bdfde7e0ce4b40b6436b43cf20c8e9e1a97243d4563d16\"},{\"command\":\"systemd-analyze\",\"executable\":\"/usr/bin/systemd-analyze\",\"sha256\":\"ade358aec5d0dd48fef6ff8ff8d810f35852a27fd213e237e6ea800eaeb8f4e9\"},{\"command\":\"systemd-ask-password\",\"executable\":\"/usr/bin/systemd-ask-password\",\"sha256\":\"b54b9d9ad705244781e3132e4b858a7f90e75afee9083b6eac764f8e3d1571ee\"},{\"command\":\"systemd-cat\",\"executable\":\"/usr/bin/systemd-cat\",\"sha256\":\"0547f98fb603909fb025220cd5ee310b2820658a15ddd8650c291eb941c7066f\"},{\"command\":\"systemd-cgls\",\"executable\":\"/usr/bin/systemd-cgls\",\"sha256\":\"31f203b067ccfc101f2ffa7a8cc2f47012b846e92f09a17e3781473853a4329a\"},{\"command\":\"systemd-cgtop\",\"executable\":\"/usr/bin/systemd-cgtop\",\"sha256\":\"2c2534b4ff4e512e87ea957a9b228d59108d0733fdb449d963a0611650a9aa05\"},{\"command\":\"systemd-confext\",\"executable\":\"/usr/bin/systemd-sysext\",\"sha256\":\"7787e8ee8a31ee1e0be8c3e6769195102de2c71818df95539f693b0c0c536065\"},{\"command\":\"systemd-creds\",\"executable\":\"/usr/bin/systemd-creds\",\"sha256\":\"05da3a8bdac15a0e2440694021ff644ec4b7cb3a9ab7b6a33f4bcaa0e04a23b7\"},{\"command\":\"systemd-cryptenroll\",\"executable\":\"/usr/bin/systemd-cryptenroll\",\"sha256\":\"49cf688a19410086b43b5c5642e7417c59a49348808b154211596aaf806e2a38\"},{\"command\":\"systemd-cryptsetup\",\"executable\":\"/usr/bin/systemd-cryptsetup\",\"sha256\":\"0668c33382c0c6e47eb9aeb1e692131b61c77f23f196ca1a6607403ab0cfe7e4\"},{\"command\":\"systemd-delta\",\"executable\":\"/usr/bin/systemd-delta\",\"sha256\":\"a8d7859033acc883ac163e9c2b0202df64e717f0d8a4feed66fd5d3000d57818\"},{\"command\":\"systemd-detect-virt\",\"executable\":\"/usr/bin/systemd-detect-virt\",\"sha256\":\"d7168d841bcfe28de8feeed6f09a7c1df37d98d7db3f87302428a983cccfc16f\"},{\"command\":\"systemd-escape\",\"executable\":\"/usr/bin/systemd-escape\",\"sha256\":\"9aa98887e683deedc877ca578450ae785bf4a80a6071d6238387f8d77126b4e1\"},{\"command\":\"systemd-firstboot\",\"executable\":\"/usr/bin/systemd-firstboot\",\"sha256\":\"270c4cad77fabe7d3402e27bf6363aa23634c32f5e0f89526943226b79b7265f\"},{\"command\":\"systemd-id128\",\"executable\":\"/usr/bin/systemd-id128\",\"sha256\":\"bac4557255fc4a98bcbe948290ee3adb2cee53f1b71db216bbcab8cbcbc9ad45\"},{\"command\":\"systemd-inhibit\",\"executable\":\"/usr/bin/systemd-inhibit\",\"sha256\":\"8c6bf9d71e0e3877d82297ef704765e8a6f188b56a1e5d5097defc316df7a9b2\"},{\"command\":\"systemd-machine-id-setup\",\"executable\":\"/usr/bin/systemd-machine-id-setup\",\"sha256\":\"2e474bbc30385ea51f576c43ebf699ef2f21d553598a28dbbabda55e285f82d5\"},{\"command\":\"systemd-mount\",\"executable\":\"/usr/bin/systemd-mount\",\"sha256\":\"acdfab06af7b288dc3ca0098d3a9b9b9bb1703be77db3f79e528baf5e281659b\"},{\"command\":\"systemd-notify\",\"executable\":\"/usr/bin/systemd-notify\",\"sha256\":\"8baeab8f50e4111e626827e651b40020b993d5bd8721a1014035a937e2c5ecf4\"},{\"command\":\"systemd-path\",\"executable\":\"/usr/bin/systemd-path\",\"sha256\":\"0f4c3a986630981b8ffe2613c5e9f29a76384d55093aa7db437a14fb2e35d720\"},{\"command\":\"systemd-repart\",\"executable\":\"/usr/bin/systemd-repart\",\"sha256\":\"548f294b41aff518f5de7c8887b79742e0be05ad16ecf72a7f9a4351f461f75d\"},{\"command\":\"systemd-run\",\"executable\":\"/usr/bin/systemd-run\",\"sha256\":\"02cdd2f7cd4a62523c54681e785aeb091106fa5df32d0a09a696dadaec700939\"},{\"command\":\"systemd-socket-activate\",\"executable\":\"/usr/bin/systemd-socket-activate\",\"sha256\":\"02724ccdfad3709f18894603f60b7a35e52f7fde26e564824b56f8c13c319d3e\"},{\"command\":\"systemd-stdio-bridge\",\"executable\":\"/usr/bin/systemd-stdio-bridge\",\"sha256\":\"210bfd9081cb65e91b4e586f7dfef832c7307ee000860528728be3531e536566\"},{\"command\":\"systemd-sysext\",\"executable\":\"/usr/bin/systemd-sysext\",\"sha256\":\"7787e8ee8a31ee1e0be8c3e6769195102de2c71818df95539f693b0c0c536065\"},{\"command\":\"systemd-sysusers\",\"executable\":\"/usr/bin/systemd-sysusers\",\"sha256\":\"13c5e0ed907c80fd61611774efb0628491fe406ae5e0beeb60af386efffa0ba1\"},{\"command\":\"systemd-tmpfiles\",\"executable\":\"/usr/bin/systemd-tmpfiles\",\"sha256\":\"f1f9ad14b6ff16ea6d9093550cf885d664c4ee4187a1b771396bdfadbbae8837\"},{\"command\":\"systemd-tty-ask-password-agent\",\"executable\":\"/usr/bin/systemd-tty-ask-password-agent\",\"sha256\":\"5e02bf85a6d73b32d1a1a9bbc5bfff660c50ba52e84fcb29f5836ecdb55e3578\"},{\"command\":\"systemd-umount\",\"executable\":\"/usr/bin/systemd-mount\",\"sha256\":\"acdfab06af7b288dc3ca0098d3a9b9b9bb1703be77db3f79e528baf5e281659b\"},{\"command\":\"tabs\",\"executable\":\"/usr/bin/tabs\",\"sha256\":\"c75a273d7427a12ef86b5091936397f354b39930955c5fcbcf65d0e855011f20\"},{\"command\":\"tac\",\"executable\":\"/usr/bin/tac\",\"sha256\":\"74a16f6addd590730f201d1555271799b02140f0097c30876a130a4bfea5318a\"},{\"command\":\"tail\",\"executable\":\"/usr/bin/tail\",\"sha256\":\"bda3fdb8d345067d09204aa35301fd6b5d4f4de3b3b7f15e0dcdb92e9451992f\"},{\"command\":\"tar\",\"executable\":\"/usr/bin/tar\",\"sha256\":\"867ff0dfd2d702cfebcff6a64eee5835c928fe359b9deced92e442211362d16d\"},{\"command\":\"taskset\",\"executable\":\"/usr/bin/taskset\",\"sha256\":\"ddd2f16366b29b9887de9185059ceb085fa3fd3952a685047255bca02d6b5c25\"},{\"command\":\"tee\",\"executable\":\"/usr/bin/tee\",\"sha256\":\"5b6aa05ad8c4294197cdf38cc5b18693b387be9ab4838f8cba71bf0f78544d94\"},{\"command\":\"tempfile\",\"executable\":\"/usr/bin/tempfile\",\"sha256\":\"dad4dd9872307c09aeee6cc003815d7c58fd60364a5616b289e8526efdc1cbf6\"},{\"command\":\"test\",\"executable\":\"/usr/bin/test\",\"sha256\":\"38ea770724b003a328beee7a859c8755c46a40a0342ea7dd55c3b51591f66037\"},{\"command\":\"tic\",\"executable\":\"/usr/bin/tic\",\"sha256\":\"71234d7ee819f7391990856281f772d578b19ae3b4e7f4626976c926310c2aae\"},{\"command\":\"timedatectl\",\"executable\":\"/usr/bin/timedatectl\",\"sha256\":\"14797b3d88d212c44005eb519efb27566e4bc062bd74061321c188542f34ca65\"},{\"command\":\"timeout\",\"executable\":\"/usr/bin/timeout\",\"sha256\":\"2db30bc57746c940a0643581cd5e2671e505442bea16164143f0ea8ff4e36453\"},{\"command\":\"tload\",\"executable\":\"/usr/bin/tload\",\"sha256\":\"5cfd3cb2a129708b64a60d0a871ca9c30efe615e47843f4a7730ad7a948e31f1\"},{\"command\":\"toe\",\"executable\":\"/usr/bin/toe\",\"sha256\":\"439615b7112a79c06164072ac79e463eed4fce73d650519290703b0215048358\"},{\"command\":\"top\",\"executable\":\"/usr/bin/top\",\"sha256\":\"c87663a75421984791e955deb071cd233930a69dc5f2acbf89f71ed196c3f264\"},{\"command\":\"touch\",\"executable\":\"/usr/bin/touch\",\"sha256\":\"6d99d27b87a756a755a0904238579ccc2d88ab35e529935bbf67ecc2696abb27\"},{\"command\":\"tput\",\"executable\":\"/usr/bin/tput\",\"sha256\":\"778f6fcb587cd99c0c01f59acfea145b10e81dae8c8ed87e6e4b8b7494457a6d\"},{\"command\":\"tr\",\"executable\":\"/usr/bin/tr\",\"sha256\":\"98805355098cc9a3c6efb8c766d8ccbb01226070bdd13f386655d2713d9b1f6c\"},{\"command\":\"true\",\"executable\":\"/usr/bin/true\",\"sha256\":\"69851c424c4519cd11af710b69d52ddf44b929b74470a02e62e0aab227c07543\"},{\"command\":\"truncate\",\"executable\":\"/usr/bin/truncate\",\"sha256\":\"ee92d80b9ad881ed98a0a8437f9e2afa699e474f0e294abd9d945e486f5a1d49\"},{\"command\":\"tset\",\"executable\":\"/usr/bin/tset\",\"sha256\":\"65369c25251289d5009f7f5481383c021f358a6c565f7d4310f5ebc115362dc8\"},{\"command\":\"tsort\",\"executable\":\"/usr/bin/tsort\",\"sha256\":\"f747c130b5cf778c2a4c3d775b91e40524b75f42d2e033ed6ba67413cc2f2d74\"},{\"command\":\"tty\",\"executable\":\"/usr/bin/tty\",\"sha256\":\"1e0147333087a4b2c480ceef5d14292bb4bdb7059f9520d3fc618993e266d4f9\"},{\"command\":\"tzselect\",\"executable\":\"/usr/bin/tzselect\",\"sha256\":\"cd14fec50b626461cc68ccc830c269a839cae3bd56bb19b1caab34e16d531768\"},{\"command\":\"uclampset\",\"executable\":\"/usr/bin/uclampset\",\"sha256\":\"b41d1841ffed1e12806c182e20be475fe41a26f1b5fba4f1b059eb30c264a604\"},{\"command\":\"ucs2any\",\"executable\":\"/usr/bin/ucs2any\",\"sha256\":\"66ad342ea0a7e397c48a716a74e62d91f2894f151ee94018141285a8d130c956\"},{\"command\":\"umount\",\"executable\":\"/usr/bin/umount\",\"sha256\":\"75d109a00d6489feae6eb9fd0e99511d82e6f6cb0d933e02cfd48afd525c27f5\"},{\"command\":\"uname\",\"executable\":\"/usr/bin/uname\",\"sha256\":\"37b5a64a72058548742fca7fa0c11e30c88b9042a533ab0c8433409ddc61f4f9\"},{\"command\":\"uncompress\",\"executable\":\"/usr/bin/uncompress\",\"sha256\":\"55c2f67ca4c3cca0ebac659f0075461dd671ec4937ecd6c71123bb49ed322ebd\"},{\"command\":\"unexpand\",\"executable\":\"/usr/bin/unexpand\",\"sha256\":\"ae07391d1d9c82b1ec8b7bd8ac3a912172dba998275641b7fb68354a0d4afd6f\"},{\"command\":\"uniq\",\"executable\":\"/usr/bin/uniq\",\"sha256\":\"0f883fac36de9b1b40debd103e98613bb308c1b914586fadab3c2ecec0f67bbc\"},{\"command\":\"unlink\",\"executable\":\"/usr/bin/unlink\",\"sha256\":\"6748cc16c407bc2a555ca9471fb9bda981841724718637fe8cb79f8d10223dd4\"},{\"command\":\"unlzma\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"296a7eaf0ac8cc4f37bd29f8fded9c768ed60fc646f64333e83e4f3a9148451d\"},{\"command\":\"unminimize\",\"executable\":\"/usr/bin/unminimize\",\"sha256\":\"36a235214133e557df60d3a417df146fe113cf54b36c8757c4f15d6378cdc5dc\"},{\"command\":\"unshare\",\"executable\":\"/usr/bin/unshare\",\"sha256\":\"d6380bede9030d3c776ce658b40373c7edf36717ea37e4f2b4c32a8e814c6816\"},{\"command\":\"unxz\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"296a7eaf0ac8cc4f37bd29f8fded9c768ed60fc646f64333e83e4f3a9148451d\"},{\"command\":\"update-alternatives\",\"executable\":\"/usr/bin/update-alternatives\",\"sha256\":\"f3fc8c13fa8fbe37f95723f98b13201db90a9e75fc35928472cf8b827bbc62c5\"},{\"command\":\"update-mime-database\",\"executable\":\"/usr/bin/update-mime-database\",\"sha256\":\"0412fee8d633b97a0c6cee8008f70eadc31a0f574b365431494ea68921f08956\"},{\"command\":\"uptime\",\"executable\":\"/usr/bin/uptime\",\"sha256\":\"42164f8374ef9688afa1d3a261de1c89a7f6541ea494f49d0328f69cc00d0f43\"},{\"command\":\"users\",\"executable\":\"/usr/bin/users\",\"sha256\":\"d56b17a97be7cd69ecf2b85a18291ff73c5c978bd7d476e9cac572e9846dfba5\"},{\"command\":\"utmpdump\",\"executable\":\"/usr/bin/utmpdump\",\"sha256\":\"93364b0d8695d2ae4831ed0176a8e38001da60e720e45c4029b2d951104fae50\"},{\"command\":\"varlinkctl\",\"executable\":\"/usr/bin/varlinkctl\",\"sha256\":\"1b9cc8bafbc95815c1a0144aa0abd83c5c68513f653eb9066f70294f6c82b662\"},{\"command\":\"vdir\",\"executable\":\"/usr/bin/vdir\",\"sha256\":\"f605bd2d1368664330bf517957e85654e61abb3c8b7125b06e637f0c06589f28\"},{\"command\":\"vmstat\",\"executable\":\"/usr/bin/vmstat\",\"sha256\":\"73924192f6f599514e4fcf3c43456a5d1b921db57f3a25e36cfd2311090e872a\"},{\"command\":\"w\",\"executable\":\"/usr/bin/w\",\"sha256\":\"f83cfbccfb00e658088397fc002158b3fe21c643c22751f9cb9ca01baf3447b5\"},{\"command\":\"wall\",\"executable\":\"/usr/bin/wall\",\"sha256\":\"d02989894186fbfa7aa04a5484ed85f54819c9f35cb7f1242c30ccf9ad76577b\"},{\"command\":\"wasm-bindgen\",\"executable\":\"/usr/local/cargo/bin/wasm-bindgen\",\"sha256\":\"2551c3211e22dbd6002555c9aad77197a3e61d6669b6c7c3061a53e8667af9d3\"},{\"command\":\"wasm-bindgen-test-runner\",\"executable\":\"/usr/local/cargo/bin/wasm-bindgen-test-runner\",\"sha256\":\"4817b134f2e39f5322af339f2c43327f48ab1e582363e6c233546938cd179e37\"},{\"command\":\"wasm-tools\",\"executable\":\"/usr/local/cargo/bin/wasm-tools\",\"sha256\":\"62033463f5fdc2f257ee3de7f6f3212870e3dc84aa3c29aa96d282e1264f1520\"},{\"command\":\"wasm2es6js\",\"executable\":\"/usr/local/cargo/bin/wasm2es6js\",\"sha256\":\"6bebe96e10f7974228187c38d6ff22bccdb7953a39918daa4d03e245584a0d5a\"},{\"command\":\"wasmtime\",\"executable\":\"/usr/local/cargo/bin/wasmtime\",\"sha256\":\"d6f187e0d549c3f7df37df572d26177d8cc43adeaf4af490c7f18b4a68ab7492\"},{\"command\":\"watch\",\"executable\":\"/usr/bin/watch\",\"sha256\":\"d498378ce59aed8f1c9713ccd7dd378d06532d5f37905ecabf2fbcc9bc5172a6\"},{\"command\":\"wc\",\"executable\":\"/usr/bin/wc\",\"sha256\":\"4bab599a0dbd6d87e5bcedaa021b727d9306777741850fdb5a4b8a1804e486fe\"},{\"command\":\"wdctl\",\"executable\":\"/usr/bin/wdctl\",\"sha256\":\"4e8269475d2c83823b2ddb7365a626c99488fb57b56da10bbe24f841366e92e6\"},{\"command\":\"wget\",\"executable\":\"/usr/bin/wget\",\"sha256\":\"d32eaf3aaa9580ce87aec57aa53740fd44dc8c9a5b33e44e1c36551ed9033374\"},{\"command\":\"whereis\",\"executable\":\"/usr/bin/whereis\",\"sha256\":\"1d9b24e89d52c024ca7d17649679856805f846cc78f877c6c45fd702837b88ca\"},{\"command\":\"which\",\"executable\":\"/usr/bin/which.debianutils\",\"sha256\":\"59e7cf8b9bd8711ae1aa6f7bbbd4132b61492409c3afe8e1505225efda1cb8f6\"},{\"command\":\"which.debianutils\",\"executable\":\"/usr/bin/which.debianutils\",\"sha256\":\"59e7cf8b9bd8711ae1aa6f7bbbd4132b61492409c3afe8e1505225efda1cb8f6\"},{\"command\":\"who\",\"executable\":\"/usr/bin/who\",\"sha256\":\"aee0f4429b0452e41b1831a3805dd44c8dbdba95b63da75314f52b77d63ff89b\"},{\"command\":\"whoami\",\"executable\":\"/usr/bin/whoami\",\"sha256\":\"bd9f4553e4407f93c53af8e7b0db39b89df0b89ddde83b4d9cb445a64112e56d\"},{\"command\":\"xargs\",\"executable\":\"/usr/bin/xargs\",\"sha256\":\"e4d376e8f56a26f8e968566585c6cdbf593e5c77d271b5a16d85d449e57d5993\"},{\"command\":\"xauth\",\"executable\":\"/usr/bin/xauth\",\"sha256\":\"66924d27d60e30aacba01ddcbe2fc1accb1a1a79d9a954078aaa24d891800e8d\"},{\"command\":\"xkbbell\",\"executable\":\"/usr/bin/xkbbell\",\"sha256\":\"97fdec2d7d8773eb1f7f7a800aaecbe5a868d656485ba0b7c350cb7f9b54c654\"},{\"command\":\"xkbcomp\",\"executable\":\"/usr/bin/xkbcomp\",\"sha256\":\"7c666b5dd7321507deae224a381078a7ea264fd98df9258ffca39571c93f207e\"},{\"command\":\"xkbevd\",\"executable\":\"/usr/bin/xkbevd\",\"sha256\":\"8a004003748fd4db8af526bb1eec9d42011f428988e61ad1db13d317434e630d\"},{\"command\":\"xkbprint\",\"executable\":\"/usr/bin/xkbprint\",\"sha256\":\"1298db0547971f49dbbf147f663603cb969e21c1d0f17bc7123eb760bf03f1cf\"},{\"command\":\"xkbvleds\",\"executable\":\"/usr/bin/xkbvleds\",\"sha256\":\"61285505de8551325107ec2cf710b3428081b8546a1cf87fa727fdae7a2d0dcb\"},{\"command\":\"xkbwatch\",\"executable\":\"/usr/bin/xkbwatch\",\"sha256\":\"17e1e03014ddc58af7b6de1f98b6b3f8888dffce48c0f8be28e508392257acbd\"},{\"command\":\"xsubpp\",\"executable\":\"/usr/bin/xsubpp\",\"sha256\":\"c8c0f265dd2f3f247f179a5464bddfe6391b9e06996e961fa15c51c2e26e39a3\"},{\"command\":\"xvfb-run\",\"executable\":\"/usr/bin/xvfb-run\",\"sha256\":\"48ee444c30fdaaede4cc311644b30e554162e956f949b206858e37eb8ba1ae05\"},{\"command\":\"xz\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"296a7eaf0ac8cc4f37bd29f8fded9c768ed60fc646f64333e83e4f3a9148451d\"},{\"command\":\"xzcat\",\"executable\":\"/usr/bin/xz\",\"sha256\":\"296a7eaf0ac8cc4f37bd29f8fded9c768ed60fc646f64333e83e4f3a9148451d\"},{\"command\":\"xzcmp\",\"executable\":\"/usr/bin/xzdiff\",\"sha256\":\"551e26acd2c7d3f56ab6f43916cfcaafb96955eda66b656f1ed9a708f52e7667\"},{\"command\":\"xzdiff\",\"executable\":\"/usr/bin/xzdiff\",\"sha256\":\"551e26acd2c7d3f56ab6f43916cfcaafb96955eda66b656f1ed9a708f52e7667\"},{\"command\":\"xzegrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"xzfgrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"xzgrep\",\"executable\":\"/usr/bin/xzgrep\",\"sha256\":\"e83ca59b0c0e5eb2170abc6d89a34980fd04891399a65ceea18d810301a275e3\"},{\"command\":\"xzless\",\"executable\":\"/usr/bin/xzless\",\"sha256\":\"a25b3dee9826b993f4fe0043e6d3073c6658925c28afc303917d62b1cf465051\"},{\"command\":\"xzmore\",\"executable\":\"/usr/bin/xzmore\",\"sha256\":\"e40b6cfbd6dcfd6fa46b721f7afb36efbbf3a8fbea1cd20f64b6123400f39306\"},{\"command\":\"yarn\",\"executable\":\"/usr/lib/node_modules/yarn/bin/yarn.js\",\"sha256\":\"148e19db309ec9eaf7720b28df811337906eea8a1758deaa54afee60a6305e04\"},{\"command\":\"yarnpkg\",\"executable\":\"/usr/lib/node_modules/yarn/bin/yarn.js\",\"sha256\":\"148e19db309ec9eaf7720b28df811337906eea8a1758deaa54afee60a6305e04\"},{\"command\":\"yes\",\"executable\":\"/usr/bin/yes\",\"sha256\":\"ab478e91bc00ad1dd5dac40a6d2110f148f777d2f8cdacd216392ffc54413f63\"},{\"command\":\"ypdomainname\",\"executable\":\"/usr/bin/hostname\",\"sha256\":\"529801b643662701c07a120d133850a3a1d407fd0edd8390b3f2db759715eb8f\"},{\"command\":\"zcat\",\"executable\":\"/usr/bin/zcat\",\"sha256\":\"f0b4d86b6a10064b7f2f41a452ab5437f61d4f17d8b1ab3488f3f345519f4f8d\"},{\"command\":\"zcmp\",\"executable\":\"/usr/bin/zcmp\",\"sha256\":\"6e6da15f127e06d61cbdabb59d3ec9b28b8605178dbe2acf7d275aa6d22e2d0f\"},{\"command\":\"zdiff\",\"executable\":\"/usr/bin/zdiff\",\"sha256\":\"1bcb10de5c01db497f845980ee4e79ec32f025443588a7410ba5001512a61ec9\"},{\"command\":\"zdump\",\"executable\":\"/usr/bin/zdump\",\"sha256\":\"8cdbc0face3816488f998b1a1e82b51000ecadfc2e305fd7d4ec29950386bba2\"},{\"command\":\"zegrep\",\"executable\":\"/usr/bin/zegrep\",\"sha256\":\"67ee7fadec7ea53b4c1f8cfc3c81427b29c0b1381e80b55642617620c84d0bcc\"},{\"command\":\"zfgrep\",\"executable\":\"/usr/bin/zfgrep\",\"sha256\":\"87ab5f4c7cb344e409d614d1a69cc156b3b1053d6ae0b59d8e2c2131f3e63e5a\"},{\"command\":\"zforce\",\"executable\":\"/usr/bin/zforce\",\"sha256\":\"61b3a0106c72648199611b79caf2e7a8c0800a8ef5745193cc0fa16455a79901\"},{\"command\":\"zgrep\",\"executable\":\"/usr/bin/zgrep\",\"sha256\":\"2f506d3547724df8e8dc9bdfa73bccb1a641b530fd5a40adc9b537f851d86b7f\"},{\"command\":\"zipdetails\",\"executable\":\"/usr/bin/zipdetails\",\"sha256\":\"58439587867aabee0504e493722c74e0725f649f4050848c91c59d48e90cd34f\"},{\"command\":\"zless\",\"executable\":\"/usr/bin/zless\",\"sha256\":\"e29f317fc56ce49eb5bd1e938b7f87923b91b40e5516ec9146f678519330f6bb\"},{\"command\":\"zmore\",\"executable\":\"/usr/bin/zmore\",\"sha256\":\"bb9ee270bee119238c74779fb5fa5cddc7939ec4923a22c5649bcb9aa7d70b76\"},{\"command\":\"znew\",\"executable\":\"/usr/bin/znew\",\"sha256\":\"969931d9eadae06db92a01b00458aa43d86bdf3692020d6f10b0fb8d060e1f38\"}],\"schema\":\"prismpm/sdk-inventory/1\"}\n","manifest_digest":"sha256:b08c38d43b7045b3af347f4a21c5ce27fc0eda7cef2beae11e4a40f6cfe59c37","platform":"linux/arm64"}],"schema":"prismpm/sdk-lock/2","sdk_image":"ghcr.io/uor-foundation/prismpm-sdk-candidate@sha256:cd3b47d7a370c4a26b8285f5e9c3bb15e639973c55505c3809ddbe55352fea58","sdk_index":"{\"schemaVersion\":2,\"mediaType\":\"application/vnd.oci.image.index.v1+json\",\"manifests\":[{\"mediaType\":\"application/vnd.oci.image.manifest.v1+json\",\"digest\":\"sha256:fc87624954a1985f2a6594946aa22ca16efc4095fe8d6d9b18f21c69e937f7dc\",\"size\":6177,\"platform\":{\"architecture\":\"amd64\",\"os\":\"linux\"}},{\"mediaType\":\"application/vnd.oci.image.manifest.v1+json\",\"digest\":\"sha256:b08c38d43b7045b3af347f4a21c5ce27fc0eda7cef2beae11e4a40f6cfe59c37\",\"size\":6177,\"platform\":{\"architecture\":\"arm64\",\"os\":\"linux\"}}]}","sdk_version":"0.3.0","standards_lock":"sha256:54448d21cb1ed3a4af826aa44991e9839b51d97b8975a5b125927c78af922b46"} \ No newline at end of file diff --git a/product/PRISMPM-LICENSE-MIT.txt b/product/PRISMPM-LICENSE-MIT.txt new file mode 100644 index 0000000..3bd0b7d --- /dev/null +++ b/product/PRISMPM-LICENSE-MIT.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Alex Flom + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/product/THIRD_PARTY_NOTICES.md b/product/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000..14bf423 --- /dev/null +++ b/product/THIRD_PARTY_NOTICES.md @@ -0,0 +1,16 @@ +# Third-party source notice + +`app/src/Foundation/Arch.lex.tex` adapts the architecture data types from +UOR Foundation's PrismPM `stdlib/src/Foundation/Arch.lex.tex`, commit +`fe5b8b73a94134c316329a8d1b09ebc97b555c5f`. + +The original project offers MIT OR Apache-2.0. The copied subset is used under +MIT, whose original notice is retained in `PRISMPM-LICENSE-MIT.txt` beside this +file. Changes: retained only the type declarations through `View`, omitted +upstream demonstration values and later types, and changed the document title +to an available local glossary phrase. The official qualified type ownership +and field shapes are unchanged. + +This notice does not establish the provenance or redistribution terms of the +existing v86, BIOS or Linux image files. Those remain separately unresolved in +the product model and generated contract register. diff --git a/product/contracts.json b/product/contracts.json new file mode 100644 index 0000000..a00ca72 --- /dev/null +++ b/product/contracts.json @@ -0,0 +1,2173 @@ +{ + "format": "Stitch project-owned product contract register", + "version": 1, + "assurance": "Source contracts and local byte inventory, not a Prism receipt or whole-browser proof", + "reference": { + "repository": "https://github.com/UOR-Foundation/PrismPM", + "revision": "fe5b8b73a94134c316329a8d1b09ebc97b555c5f", + "specSections": [ + "2", + "11" + ], + "foundationArchUpstreamBytes": 8959, + "foundationArchUpstreamSha256": "9a79e4912d33b1736d7451ab726ed0a83d958b8d9c70091a749fbc70acd48cdc", + "foundationArch": "Type-only subset; source types preserved, title localized to available glossary, examples omitted", + "sdk": "Existing prismpm.lock; no dependency or profile upgrade" + }, + "releaseBlockers": [], + "components": [ + { + "declaration": "componentAdmission", + "type": "Component", + "id": "admission", + "role": "Four-dimensional reservation ledger", + "implementation": [ + "src/layer2-schedulers/policy.js" + ], + "models": [ + "Stitch.Budget" + ], + "trustBoundary": false + }, + { + "declaration": "componentBrowser", + "type": "Component", + "id": "browser", + "role": "Interactive five-layer Stitch product", + "implementation": [ + "index.html", + "src/product-experience.js", + "src/recovery-ui.js", + "src/authority-ui.js" + ], + "models": [ + "Product.Experience", + "Stitch.Recovery", + "Product.Host", + "Product.Model" + ], + "trustBoundary": true + }, + { + "declaration": "componentCompute", + "type": "Component", + "id": "compute", + "role": "Deterministic program and checkpoint replay", + "implementation": [ + "src/layer4-compute/index.js", + "src/layer4-compute/replay.js" + ], + "models": [ + "Stitch.Compute" + ], + "trustBoundary": false + }, + { + "declaration": "componentCryptography", + "type": "Component", + "id": "cryptography", + "role": "Browser WebCrypto SHA-256 and Ed25519", + "implementation": [], + "models": [ + "Stitch.Identity", + "Stitch.Pointer" + ], + "trustBoundary": true + }, + { + "declaration": "componentDiscovery", + "type": "Component", + "id": "discovery", + "role": "DNS-over-HTTPS resolver and scoped DNS writer", + "implementation": [ + "src/layer5-transport/index.js", + "src/layer5-transport/dns-wire.js" + ], + "models": [ + "Stitch.Pointer", + "Stitch.Observation" + ], + "trustBoundary": true + }, + { + "declaration": "componentIdentity", + "type": "Component", + "id": "identity", + "role": "Canonical bytes, full commitments, raw encoding and fragments", + "implementation": [ + "src/layer1-uor/contracts.js", + "src/layer1-uor/custody.js", + "src/layer1-uor/generated-model.js" + ], + "models": [ + "Stitch.Identity", + "Stitch.Encoding", + "Stitch.Fragments" + ], + "trustBoundary": false + }, + { + "declaration": "componentLegacy", + "type": "Component", + "id": "legacy", + "role": "Historical UOR and simulation conformance", + "implementation": [ + "src/layer1-uor/index.js", + "src/layer3-storage/index.js", + "src/lib.rs" + ], + "models": [], + "trustBoundary": false + }, + { + "declaration": "componentNativeRouting", + "type": "Component", + "id": "nativeRouting", + "role": "External Linux routing daemon; absent from browser", + "implementation": [], + "models": [], + "trustBoundary": true + }, + { + "declaration": "componentPeers", + "type": "Component", + "id": "peers", + "role": "Untrusted remote holders and compute peers", + "implementation": [], + "models": [ + "Stitch.Custody", + "Stitch.Observation" + ], + "trustBoundary": true + }, + { + "declaration": "componentPointerAuthority", + "type": "Component", + "id": "pointerAuthority", + "role": "Independently pinned single-writer key", + "implementation": [ + "src/layer1-uor/pointer.js", + "src/layer1-uor/browser-authority.js" + ], + "models": [ + "Stitch.Authority", + "Stitch.Pointer", + "Stitch.Effects", + "Product.Host", + "Product.Experience" + ], + "trustBoundary": true + }, + { + "declaration": "componentPublicRelay", + "type": "Component", + "id": "publicRelay", + "role": "Optional public ntfy warm cache", + "implementation": [ + "src/layer5-transport/relay-framing.js" + ], + "models": [ + "Stitch.Relay", + "Stitch.Evidence" + ], + "trustBoundary": true + }, + { + "declaration": "componentRuntimeHost", + "type": "Component", + "id": "runtimeHost", + "role": "Browser, OS, clocks, RAM, networking and permissions", + "implementation": [], + "models": [ + "Product.Host" + ], + "trustBoundary": true + }, + { + "declaration": "componentScheduler", + "type": "Component", + "id": "scheduler", + "role": "Experimental proposals under enforced admission", + "implementation": [ + "src/layer2-schedulers/index.js" + ], + "models": [ + "Stitch.Budget", + "Stitch.Observation" + ], + "trustBoundary": false + }, + { + "declaration": "componentSignaling", + "type": "Component", + "id": "signaling", + "role": "Public ntfy SDP/ICE signaling; BroadcastChannel on same origin", + "implementation": [ + "src/layer5-transport/signaling.js", + "src/layer5-transport/relay-framing.js" + ], + "models": [ + "Stitch.Signaling", + "Stitch.Relay", + "Stitch.Effects", + "Product.Host" + ], + "trustBoundary": true + }, + { + "declaration": "componentStaticHost", + "type": "Component", + "id": "staticHost", + "role": "Same-origin publication of application and VM assets", + "implementation": [], + "models": [], + "trustBoundary": true + }, + { + "declaration": "componentStorage", + "type": "Component", + "id": "storage", + "role": "Ephemeral local cache and conditional peer custody", + "implementation": [ + "src/layer3-storage/custody.js", + "src/layer3-storage/index.js", + "src/recovery.js" + ], + "models": [ + "Stitch.Custody", + "Stitch.System", + "Stitch.Recovery" + ], + "trustBoundary": false + }, + { + "declaration": "componentTransport", + "type": "Component", + "id": "transport", + "role": "WebRTC channels, bounded messages and VM Ethernet bridge", + "implementation": [ + "src/layer5-transport/index.js", + "src/layer5-transport/channel-flow.js" + ], + "models": [ + "Stitch.Observation", + "Stitch.ChannelFlow", + "Product.Host" + ], + "trustBoundary": true + }, + { + "declaration": "componentVm", + "type": "Component", + "id": "vm", + "role": "v86 x86 Linux guest and 9p filesystem bridge", + "implementation": [ + "src/layer4-compute/index.js", + "src/layer4-compute/vm-administration.js", + "v86/libv86.js", + "v86/v86.wasm", + "v86/seabios.bin", + "v86/vgabios.bin", + "images/buildroot-bzimage.bin" + ], + "models": [ + "Product.Host", + "Stitch.VmAdministration" + ], + "trustBoundary": true + } + ], + "assumptions": [ + { + "declaration": "assumptionArtifactConformance", + "type": "Assumption", + "id": "artifactConformance", + "statement": "Released runtime and model match their exact reviewed source and dependency bytes.", + "evidence": "Exact local artifact hashes plus pinned-SDK source and build acceptance.", + "scope": "Full product; runtime source hashing alone does not prove behavior." + }, + { + "declaration": "assumptionBrowserSemantics", + "type": "Assumption", + "id": "browserSemantics", + "statement": "The browser correctly implements DOM, typed arrays, WebAssembly, WebCrypto, WebRTC and fetch; optional saved authority and DNS publication additionally require correct IndexedDB CryptoKey structured cloning, transaction commit and Web Locks context-lifetime exclusion.", + "evidence": "Browser vendor assurance and independent integration testing, not a Stitch kernel theorem.", + "scope": "Host API behavior." + }, + { + "declaration": "assumptionCryptographicSecurity", + "type": "Assumption", + "id": "cryptographicSecurity", + "statement": "SHA-256 collision resistance and Ed25519 unforgeability hold for the selected implementations.", + "evidence": "Cryptographic assumptions and implementation review.", + "scope": "Commitments and pointer signatures only." + }, + { + "declaration": "assumptionDisclosureConsent", + "type": "Assumption", + "id": "disclosureConsent", + "statement": "External publication is authorized for the exact destination and content. Public relay and signaling are not private.", + "evidence": "Explicit user choice and configured destination.", + "scope": "Signaling, DNS writes and optional public payload relay." + }, + { + "declaration": "assumptionFailureDomains", + "type": "Assumption", + "id": "failureDomains", + "statement": "Different holder identifiers are independently failing machines only if separate evidence establishes that fact.", + "evidence": "Physical deployment and correlated-failure measurement.", + "scope": "Availability and durability claims." + }, + { + "declaration": "assumptionNetworkAvailability", + "type": "Assumption", + "id": "networkAvailability", + "statement": "DoH, DNS provider, STUN, signaling and optional relay are reachable and honor their APIs and policies.", + "evidence": "Live provider checks and physical multi-network trials.", + "scope": "No finite field observation establishes indefinite service." + }, + { + "declaration": "assumptionObserverAnchor", + "type": "Assumption", + "id": "observerAnchor", + "statement": "The pointer writer key and recent retained head are obtained independently and protected from rollback.", + "evidence": "Independently pinned key and retained observer head, or separately accepted exact recent digest explicitly restored into that same live scope. Both heads and anchor trust remain session-only.", + "scope": "Single-writer authority and freshness." + }, + { + "declaration": "assumptionPeerAssertion", + "type": "Assumption", + "id": "peerAssertion", + "statement": "A local checked acknowledgment is an assertion by the named holder, not authenticated durable custody.", + "evidence": "Receipt authentication, retained bytes and reachability require external evidence.", + "scope": "Conditional placement and lease observations." + }, + { + "declaration": "assumptionSerializedJournal", + "type": "Assumption", + "id": "serializedJournal", + "statement": "Host transitions are serialized and their budgets, action IDs, trusted head and journal are retained for the required lifetime.", + "evidence": "Application adapter review and crash/concurrency tests.", + "scope": "Pure state transitions do not provide durable atomic storage." + }, + { + "declaration": "assumptionTimeSources", + "type": "Assumption", + "id": "timeSources", + "statement": "Monotonic elapsed time does not regress; pointer wall-clock error is within a separately accepted bound.", + "evidence": "Clock integration tests and independent clock policy.", + "scope": "Freshness, budgets and leases; no global time oracle." + }, + { + "declaration": "assumptionVmIsolation", + "type": "Assumption", + "id": "vmIsolation", + "statement": "v86, BIOS, guest image and 9p/Ethernet bridge obey their reviewed isolation and resource contracts.", + "evidence": "Exact binary inventory, upstream provenance, security review and VM integration tests.", + "scope": "Arbitrary guest effects are not ring-program semantics." + } + ], + "capabilities": [ + { + "declaration": "capabilityDom", + "type": "CapabilityContract", + "id": "dom", + "owner": "browser", + "capability": "Dom", + "operation": "Render and collect explicit UI actions", + "source": "index.html", + "inputs": [ + "local UI state" + ], + "outputs": [ + "rendered DOM", + "user action" + ], + "preconditions": [ + "browser API available" + ], + "failures": [ + "unsupported browser", + "handler failure" + ], + "assumptions": [ + "browserSemantics" + ], + "proofScope": "Presentation only; no storage or network evidence.", + "enabledByDefault": true + }, + { + "declaration": "capabilityCrypto", + "type": "CapabilityContract", + "id": "crypto", + "owner": "cryptography", + "capability": "Cryptography", + "operation": "Hash commitments and verify pointer signatures", + "source": "src/layer1-uor/custody.js", + "inputs": [ + "canonical bytes", + "domain", + "pinned writer key" + ], + "outputs": [ + "full digest", + "signature-valid observation" + ], + "preconditions": [ + "exact canonicalization", + "supported algorithm" + ], + "failures": [ + "digest mismatch", + "invalid signature", + "crypto unavailable" + ], + "assumptions": [ + "browserSemantics", + "cryptographicSecurity", + "observerAnchor" + ], + "proofScope": "Integrity/signature observations; no authority bootstrap or retention.", + "enabledByDefault": true + }, + { + "declaration": "capabilityMonotonicClock", + "type": "CapabilityContract", + "id": "monotonicClock", + "owner": "runtimeHost", + "capability": "MonotonicClock", + "operation": "Observe elapsed time for admission", + "source": "src/layer2-schedulers/policy.js", + "inputs": [ + "epoch and retained last time" + ], + "outputs": [ + "nondecreasing elapsed observation" + ], + "preconditions": [ + "same clock origin and epoch" + ], + "failures": [ + "clock regression", + "epoch expired" + ], + "assumptions": [ + "timeSources", + "serializedJournal" + ], + "proofScope": "Elapsed admission only; not UTC, liveness or global order.", + "enabledByDefault": true + }, + { + "declaration": "capabilityWallClock", + "type": "CapabilityContract", + "id": "wallClock", + "owner": "runtimeHost", + "capability": "WallClock", + "operation": "Check pointer and lease validity intervals", + "source": "src/layer1-uor/pointer.js", + "inputs": [ + "not-before and expiry" + ], + "outputs": [ + "observer-local wall time" + ], + "preconditions": [ + "declared clock uncertainty accepted" + ], + "failures": [ + "outside validity interval", + "clock unavailable" + ], + "assumptions": [ + "timeSources" + ], + "proofScope": "No proof of clock accuracy or network propagation.", + "enabledByDefault": true + }, + { + "declaration": "capabilitySessionStorage", + "type": "CapabilityContract", + "id": "sessionStorage", + "owner": "storage", + "capability": "SessionStorage", + "operation": "Retain checked bytes and local state in RAM", + "source": "src/layer3-storage/index.js", + "inputs": [ + "verified manifest and fragment bytes" + ], + "outputs": [ + "session-local cached bytes" + ], + "preconditions": [ + "storage reservation", + "bounded input", + "integrity checks" + ], + "failures": [ + "capacity exhausted", + "tab lost", + "browser eviction" + ], + "assumptions": [ + "browserSemantics", + "serializedJournal" + ], + "proofScope": "RAM is ephemeral; no disk persistence or total-loss recovery.", + "enabledByDefault": true + }, + { + "declaration": "capabilityPeerChannel", + "type": "CapabilityContract", + "id": "peerChannel", + "owner": "transport", + "capability": "PeerChannel", + "operation": "Open channel and exchange bounded messages", + "source": "src/layer5-transport/index.js", + "inputs": [ + "peer observation", + "SDP and ICE", + "bounded payload" + ], + "outputs": [ + "DataChannel event", + "untrusted peer response" + ], + "preconditions": [ + "network reservation", + "payload limits", + "domain validation before acceptance" + ], + "failures": [ + "ICE failure", + "timeout", + "disconnect", + "malformed payload" + ], + "assumptions": [ + "browserSemantics", + "networkAvailability", + "peerAssertion" + ], + "proofScope": "Opened channel is not authenticated holder identity or durable placement.", + "enabledByDefault": false + }, + { + "declaration": "capabilityLocalBroadcast", + "type": "CapabilityContract", + "id": "localBroadcast", + "owner": "signaling", + "capability": "LocalBroadcast", + "operation": "Exchange same-origin tab signals", + "source": "src/layer5-transport/index.js", + "inputs": [ + "channel topic", + "signal envelope" + ], + "outputs": [ + "same-origin tab message" + ], + "preconditions": [ + "explicit mesh join" + ], + "failures": [ + "API unavailable", + "tab closes" + ], + "assumptions": [ + "browserSemantics" + ], + "proofScope": "Same-origin only; not remote peer discovery.", + "enabledByDefault": false + }, + { + "declaration": "capabilityPublicSignaling", + "type": "CapabilityContract", + "id": "publicSignaling", + "owner": "signaling", + "capability": "PublicSignaling", + "operation": "Publish and receive SDP/ICE through ntfy", + "source": "src/layer5-transport/index.js", + "inputs": [ + "channel topic", + "SDP and ICE candidates" + ], + "outputs": [ + "public signaling response" + ], + "preconditions": [ + "explicit mesh join", + "disclosure accepted", + "network reservation" + ], + "failures": [ + "provider unavailable", + "untrusted signal", + "topic collision" + ], + "assumptions": [ + "disclosureConsent", + "networkAvailability" + ], + "proofScope": "Ed25519 key-owned session signaling with replay rejection; public metadata disclosure. Keys are not trusted human identity or holder authorization; topics are not privacy.", + "enabledByDefault": false + }, + { + "declaration": "capabilityDnsRead", + "type": "CapabilityContract", + "id": "dnsRead", + "owner": "discovery", + "capability": "DnsRead", + "operation": "Read full pointers and SRV records through DoH", + "source": "src/layer5-transport/index.js", + "inputs": [ + "query name", + "record type" + ], + "outputs": [ + "bounded untrusted DNS answer" + ], + "preconditions": [ + "response-byte ceiling", + "network reservation", + "pointer authority and successor admission" + ], + "failures": [ + "HTTP error", + "invalid answer", + "stale or conflicting pointer" + ], + "assumptions": [ + "networkAvailability", + "observerAnchor", + "timeSources" + ], + "proofScope": "DoH observation cannot inspect all recursive caches or establish consensus.", + "enabledByDefault": false + }, + { + "declaration": "capabilityDnsWrite", + "type": "CapabilityContract", + "id": "dnsWrite", + "owner": "discovery", + "capability": "DnsWrite", + "operation": "Write full signed pointer as multipart Cloudflare TXT", + "source": "src/layer5-transport/index.js", + "inputs": [ + "zone and record reference", + "signed full pointer", + "scoped token reference" + ], + "outputs": [ + "provider response and record identifier" + ], + "preconditions": [ + "explicit publish action", + "exact destination authorized", + "authority key pinned", + "network reservation" + ], + "failures": [ + "provider rejected", + "unknown outcome", + "token missing", + "DuckDNS full-pointer serialization refused" + ], + "assumptions": [ + "disclosureConsent", + "networkAvailability", + "observerAnchor" + ], + "proofScope": "Provider acknowledgment is not global DNS propagation; secrets are not source data.", + "enabledByDefault": false + }, + { + "declaration": "capabilityPublicRelay", + "type": "CapabilityContract", + "id": "publicRelay", + "owner": "publicRelay", + "capability": "PublicRelay", + "operation": "Publish or retrieve explicitly public warm-cache payloads", + "source": "src/layer5-transport/index.js", + "inputs": [ + "bounded object fragments or checkpoint", + "topic" + ], + "outputs": [ + "public relay response" + ], + "preconditions": [ + "relay separately enabled", + "public disclosure accepted", + "network reservation", + "received domain admission" + ], + "failures": [ + "disabled", + "provider unavailable", + "expired payload", + "tampered payload" + ], + "assumptions": [ + "disclosureConsent", + "networkAvailability" + ], + "proofScope": "Sufficient fragments disclose the object; no encryption, confidentiality or indefinite retention.", + "enabledByDefault": false + }, + { + "declaration": "capabilityVm", + "type": "CapabilityContract", + "id": "vm", + "owner": "vm", + "capability": "VirtualMachine", + "operation": "Boot guest, mirror object files, run shell and bridge Ethernet", + "source": "src/layer4-compute/index.js", + "inputs": [ + "five local v86/BIOS/kernel assets", + "guest command or object bytes" + ], + "outputs": [ + "guest output bytes", + "Ethernet frames" + ], + "preconditions": [ + "explicit VM action", + "all assets available", + "runtime deadline configured before boot", + "guarded local 9p allocation installed before run" + ], + "failures": [ + "missing asset", + "boot failure", + "guest timeout or runtime expiry", + "filesystem or bounded-result limit", + "stop outcome unknown", + "bridge failure" + ], + "assumptions": [ + "browserSemantics", + "vmIsolation" + ], + "proofScope": "Source predicates govern local 9p allocation and bounded result reads. Runtime expiry and dispatched-command cancellation request whole-VM stop; prior effects remain unknown. Browser scheduling and host VM behavior are assumptions, not guest isolation or ring-work metering.", + "enabledByDefault": false + }, + { + "declaration": "capabilityArtifactFetch", + "type": "CapabilityContract", + "id": "artifactFetch", + "owner": "staticHost", + "capability": "ArtifactFetch", + "operation": "Serve and load exact local application assets", + "source": "index.html", + "inputs": [ + "relative same-origin path" + ], + "outputs": [ + "asset bytes" + ], + "preconditions": [ + "published asset inventory", + "trusted static origin" + ], + "failures": [ + "missing file", + "substituted bytes", + "HTTP failure" + ], + "assumptions": [ + "artifactConformance", + "browserSemantics" + ], + "proofScope": "Inventory hashes identify checked local files; current UI does not verify every fetched asset at load time.", + "enabledByDefault": true + }, + { + "declaration": "capabilityNativeRouting", + "type": "CapabilityContract", + "id": "nativeRouting", + "owner": "nativeRouting", + "capability": "NativeRouting", + "operation": "External BIRD/FRR or DN42 routing daemon", + "source": "CONTRACT.json", + "inputs": [], + "outputs": [], + "preconditions": [ + "separate Linux daemon and network authority" + ], + "failures": [ + "unsupported in browser" + ], + "assumptions": [ + "networkAvailability" + ], + "proofScope": "Unsupported boundary; browser has no BGP or WireGuard implementation.", + "enabledByDefault": false + }, + { + "declaration": "capabilityOriginStorage", + "type": "CapabilityContract", + "id": "originStorage", + "owner": "pointerAuthority", + "capability": "OriginStorage", + "operation": "Explicitly retain nonextractable signing authority and exact DNS write-ahead intent", + "source": "src/layer1-uor/browser-authority.js", + "inputs": [ + "explicit authority setup", + "signed scoped publication candidate" + ], + "outputs": [ + "restored CryptoKey", + "committed origin-local journal" + ], + "preconditions": [ + "IndexedDB and CryptoKey structured cloning available", + "successful transaction commit before provider mutation" + ], + "failures": [ + "quota or transaction abort", + "private browsing loss or eviction", + "invalid retained authority" + ], + "assumptions": [ + "browserSemantics", + "serializedJournal" + ], + "proofScope": "Origin-local retention only; no backup, cross-device durability, automatic key rotation or provider exactly-once guarantee.", + "enabledByDefault": false + }, + { + "declaration": "capabilityWebLock", + "type": "CapabilityContract", + "id": "webLock", + "owner": "pointerAuthority", + "capability": "WebLock", + "operation": "Exclude same-origin concurrent DNS writers while reading, committing and settling", + "source": "src/layer1-uor/browser-authority.js", + "inputs": [ + "exact database zone name and authority scope" + ], + "outputs": [ + "exclusive context-lifetime operation" + ], + "preconditions": [ + "Web Locks available", + "same-origin lock scope" + ], + "failures": [ + "API unavailable", + "owner context termination leaves journal unknown" + ], + "assumptions": [ + "browserSemantics", + "serializedJournal" + ], + "proofScope": "No timeout takeover, cross-device exclusion, provider CAS or ordering outside this application origin.", + "enabledByDefault": false + } + ], + "dependencies": [ + { + "declaration": "dependencyBrowserApis", + "type": "Dependency", + "id": "browserApis", + "consumer": "runtimeHost", + "kind": "host", + "locator": "browser DOM/WebAssembly/WebCrypto/fetch/WebRTC; optional authority publication requires IndexedDB/Web Locks", + "versionPolicy": "Host-selected implementation; not byte-pinned", + "trust": "External API and OS trust boundary", + "required": true + }, + { + "declaration": "dependencyCloudflareDns", + "type": "Dependency", + "id": "cloudflareDns", + "consumer": "discovery", + "kind": "external-service", + "locator": "https://cloudflare-dns.com/dns-query", + "versionPolicy": "RFC8484 DNS-message client; optional provider JSON mode; no immutable service version", + "trust": "Read results untrusted until domain admission", + "required": false + }, + { + "declaration": "dependencyCloudflareWriter", + "type": "Dependency", + "id": "cloudflareWriter", + "consumer": "discovery", + "kind": "external-service", + "locator": "https://api.cloudflare.com/client/v4", + "versionPolicy": "Cloudflare API v4; scoped secret reference only", + "trust": "Writes need explicit destination and content approval", + "required": false + }, + { + "declaration": "dependencyGoogleStun", + "type": "Dependency", + "id": "googleStun", + "consumer": "transport", + "kind": "external-service", + "locator": "stun:stun.l.google.com:19302", + "versionPolicy": "Host ICE provider; no immutable service version", + "trust": "Endpoint discovery only", + "required": false + }, + { + "declaration": "dependencyCloudflareStun", + "type": "Dependency", + "id": "cloudflareStun", + "consumer": "transport", + "kind": "external-service", + "locator": "stun:stun.cloudflare.com:3478", + "versionPolicy": "Host ICE provider; no immutable service version", + "trust": "Endpoint discovery only", + "required": false + }, + { + "declaration": "dependencyNtfySignaling", + "type": "Dependency", + "id": "ntfySignaling", + "consumer": "signaling", + "kind": "external-service", + "locator": "https://ntfy.sh", + "versionPolicy": "Public HTTP/WebSocket API; no immutable service version", + "trust": "Signaling disclosure and service availability", + "required": false + }, + { + "declaration": "dependencyNtfyRelay", + "type": "Dependency", + "id": "ntfyRelay", + "consumer": "publicRelay", + "kind": "external-service", + "locator": "https://ntfy.sh", + "versionPolicy": "Optional public cache; no persistence promise", + "trust": "Payload disclosure requires opt-in", + "required": false + }, + { + "declaration": "dependencyStaticOrigin", + "type": "Dependency", + "id": "staticOrigin", + "consumer": "staticHost", + "kind": "hosting", + "locator": "same-origin relative application paths", + "versionPolicy": "Publication-selected HTTPS origin", + "trust": "No release/deployment authority inferred", + "required": true + }, + { + "declaration": "dependencyVmAssets", + "type": "Dependency", + "id": "vmAssets", + "consumer": "vm", + "kind": "vendored-binary", + "locator": "v86/ and images/buildroot-bzimage.bin", + "versionPolicy": "Exact bytes in generated product artifact register", + "trust": "Exact upstream origins and accompanying source/license materials recorded in vendor/distribution.json; guest source pinned in vendor/guest/SOURCE-NOTICE.md", + "required": false + }, + { + "declaration": "dependencyPrismSdk", + "type": "Dependency", + "id": "prismSdk", + "consumer": "identity", + "kind": "build-tool", + "locator": "prismpm.lock and standards.lock", + "versionPolicy": "Exact SDK OCI digest and standards lock", + "trust": "Only real SDK verify may report source/kernel/artifact acceptance", + "required": true + }, + { + "declaration": "dependencyPrismCode", + "type": "Dependency", + "id": "prismCode", + "consumer": "identity", + "kind": "build-tool", + "locator": "package-lock.json", + "versionPolicy": "prism-code 0.7.2 exact npm lock", + "trust": "Adapter and package verification, not browser host semantics", + "required": true + } + ], + "deployments": [ + { + "declaration": "deploymentBrowserSession", + "type": "Deployment", + "id": "browserSession", + "kind": "static-browser", + "entry": "index.html", + "files": [ + "index.html", + "src/**/*.js", + "v86/libv86.js", + "v86/v86.wasm", + "v86/seabios.bin", + "v86/vgabios.bin", + "images/buildroot-bzimage.bin" + ], + "requiredCapabilities": [ + "dom", + "crypto", + "monotonicClock", + "wallClock", + "sessionStorage", + "artifactFetch" + ], + "secrets": [ + "Cloudflare scoped DNS token only when explicitly supplied; session-local, never in repository" + ], + "readiness": "Asset load and interactive flow checks required; pure probe acceptance is insufficient.", + "rollback": "Retain prior complete asset set; session state may be lost on reload.", + "releaseGate": "Runtime tests, artifact closure, vendor license/provenance review, exact SDK model verification and browser integration checks." + }, + { + "declaration": "deploymentPureProbe", + "type": "Deployment", + "id": "pureProbe", + "kind": "prism-text-application", + "entry": "app/src/StitchApp.lex.tex", + "files": [ + "SDK-generated holo and browser closure" + ], + "requiredCapabilities": [], + "secrets": [], + "readiness": "Only actual pinned-SDK verify establishes probe acceptance.", + "rollback": "Retain previous immutable holo and exact source lock.", + "releaseGate": "lexlean check, Lean and leanchecker, exact axioms, PrismPM artifact and vector verification." + } + ], + "assets": [ + { + "declaration": "assetFile17", + "type": "Asset", + "path": "images/buildroot-bzimage.bin", + "role": "vendored VM dependency", + "origin": "Linux 6.18.7 from Buildroot 7fdeadb3b9f12f78e5fccca914d7fef47090ab9a; image 313a6b545290a2b47856b49bfcc4c7577469749b315932ae008d39fe70fc7f07", + "licenseStatus": "Corresponding source, configs, patches and licenses published at immutable commit fd59fae669e9a40271fb584ca071270d8ed0b8f8; preserve vendor/guest/SOURCE-NOTICE.md and equivalent source access with image", + "redistributionCleared": true, + "bytes": 8053248, + "sha256": "313a6b545290a2b47856b49bfcc4c7577469749b315932ae008d39fe70fc7f07" + }, + { + "declaration": "assetFile0", + "type": "Asset", + "path": "index.html", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 89258, + "sha256": "c7b8a6c92c15eda28d16ce002e3dba31b1cad77e08130cc743ecbe84c8d1b89d" + }, + { + "declaration": "assetAuthorityUi", + "type": "Asset", + "path": "src/authority-ui.js", + "role": "Contextual explicit signing, trust-anchor and browser-storage administration", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 9734, + "sha256": "96e76a92918a52dff05780b76f59158916540fd38d1ced986fd6001d3ee1482b" + }, + { + "declaration": "assetBrowserAuthority", + "type": "Asset", + "path": "src/layer1-uor/browser-authority.js", + "role": "Origin-local signing authority and transactional publication journal", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 22890, + "sha256": "3b9ba8d4a23fbe056358791d4e2d5ad377faf5a9a3cc2ac3d2dc1c3906087d09" + }, + { + "declaration": "assetFile1", + "type": "Asset", + "path": "src/layer1-uor/contracts.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 1357, + "sha256": "94c67e0811f78029b251c55edbf365b2335040106b8125fa5298e59315d2c2d3" + }, + { + "declaration": "assetFile2", + "type": "Asset", + "path": "src/layer1-uor/custody.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 16869, + "sha256": "597b34d6740b6b371e30af24ee18cd10f8c4142da38e616b9ec5e04d042ab74c" + }, + { + "declaration": "assetLifecycleEffects", + "type": "Asset", + "path": "src/layer1-uor/effects.js", + "role": "Exact identity projections and model-derived transport, DNS and VM lifecycle admissions", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 9822, + "sha256": "b685f497bf80f1ad58a2176e83d32b106e3bb718cb542a75a2b9c1bf6a8b4fb0" + }, + { + "declaration": "assetFile3", + "type": "Asset", + "path": "src/layer1-uor/generated-model.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 1229338, + "sha256": "aa3756d0392e9284b9ffd6b23aa0786a6faa6b961e4451a8826657c4ac672d10" + }, + { + "declaration": "assetFile4", + "type": "Asset", + "path": "src/layer1-uor/index.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 16965, + "sha256": "55f246f29cdd0bfa934c079d3f3afffca9e1e26c0800777dc4e2351351bca1cf" + }, + { + "declaration": "assetFile5", + "type": "Asset", + "path": "src/layer1-uor/pointer.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 19626, + "sha256": "99cce36bc7a981536e1c6df22956b5c34db9689ccc377b0e808b09502d5f09fc" + }, + { + "declaration": "assetFile6", + "type": "Asset", + "path": "src/layer2-schedulers/index.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 18472, + "sha256": "3223da0497c3a46c310541278cc7ed9042b5105e37667dd9c9d2e384f2a91f48" + }, + { + "declaration": "assetFile7", + "type": "Asset", + "path": "src/layer2-schedulers/policy.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 5894, + "sha256": "8f2074f8fe07a7b1fda51896d78f11a797564afb64accebc7291261e5c00639f" + }, + { + "declaration": "assetFile8", + "type": "Asset", + "path": "src/layer3-storage/custody.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 18523, + "sha256": "70ec7500e9a1aea0a2f383344bebea4acbe410c3aff76ccadd8869feaac24aee" + }, + { + "declaration": "assetFile9", + "type": "Asset", + "path": "src/layer3-storage/index.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 49158, + "sha256": "905067fe5ebac2f6a6cb2cdda29e37265409f3e7a5e4b786e9e18e21bc4af676" + }, + { + "declaration": "assetFile10", + "type": "Asset", + "path": "src/layer4-compute/index.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 43196, + "sha256": "73bcc96f06f89f74ba555f8d24c550ae7e80d91caba2f3a1c2d4c48aadd1a2b4" + }, + { + "declaration": "assetFile11", + "type": "Asset", + "path": "src/layer4-compute/replay.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 9523, + "sha256": "112653100e2ea57c6b732e64dbc2086fd5237eb2129fe255cb5627498494f1d3" + }, + { + "declaration": "assetVmAdministration", + "type": "Asset", + "path": "src/layer4-compute/vm-administration.js", + "role": "Explicit guest grants, bounded command admission and generation-scoped effect observation", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 8780, + "sha256": "2a307a700e38dfb7f38af4a5cfc3207e3d2b274b6c89b943e6b17add424376bc" + }, + { + "declaration": "assetChannelFlow", + "type": "Asset", + "path": "src/layer5-transport/channel-flow.js", + "role": "Negotiated DataChannel framing, bounded queues and generation-fenced delivery", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 10835, + "sha256": "728ba79197ce0fd73a289a713a7eead42f031deeb55727b720f96e88b5bedaf3" + }, + { + "declaration": "assetDnsWire", + "type": "Asset", + "path": "src/layer5-transport/dns-wire.js", + "role": "RFC8484 application DNS-message client", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 11588, + "sha256": "186267ac0296ed22d84665627400999d0ee1643e618088309c799f0299e87185" + }, + { + "declaration": "assetFile12", + "type": "Asset", + "path": "src/layer5-transport/index.js", + "role": "Stitch browser application", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 56455, + "sha256": "cc2cd97926df848aea0031a2a405fe0561881ccf06723ea0bca8a60ffb4485f8" + }, + { + "declaration": "assetRelayFraming", + "type": "Asset", + "path": "src/layer5-transport/relay-framing.js", + "role": "Bounded ntfy message framing and reassembly", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 15145, + "sha256": "35672c5720f5f1e5d009f1875a1c63de3a6badea2546d66baf73c77fb7c90ae0" + }, + { + "declaration": "assetSignaling", + "type": "Asset", + "path": "src/layer5-transport/signaling.js", + "role": "Signed key-owned signaling with current-session challenge and replay rejection", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 6863, + "sha256": "422137184e9a95a55c2c1ec7f9bd8c6a21986675a4041ce62f8451c61bb4b876" + }, + { + "declaration": "assetRustConformance", + "type": "Asset", + "path": "src/lib.rs", + "role": "Historical Rust conformance source; not loaded by the browser", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 3236, + "sha256": "159aeb7ff0afaf9dac4baa41c6ea5959ab55036cfa0d79af728da20c3f77f621" + }, + { + "declaration": "assetProductExperience", + "type": "Asset", + "path": "src/product-experience.js", + "role": "Model-derived operator journeys, evidence and guarded DOM actions", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 8322, + "sha256": "0ee000cfe9b8c3bd0ce6a0a792561e8afc7cb40314eacc4d64b02148a2f154ae" + }, + { + "declaration": "assetRecoveryUi", + "type": "Asset", + "path": "src/recovery-ui.js", + "role": "Contextual operator recovery controls without network, VM or DNS effects", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 12293, + "sha256": "ba2672ac912b1d6e1ef4ff8780f460d1643ee751d3507729eb6cd90c97c0ba60" + }, + { + "declaration": "assetRecovery", + "type": "Asset", + "path": "src/recovery.js", + "role": "Verified detached recovery bundle import/export; separate exact anchor acceptance and explicit scoped live-head restoration", + "origin": "Project-owned source checkout", + "licenseStatus": "Project declares MIT; audit applies", + "redistributionCleared": true, + "bytes": 11049, + "sha256": "89c7b3abcd713ee1c2131d6a841a94526f59c0a6118ac09834a2e6cf43c3a2c0" + }, + { + "declaration": "assetFile13", + "type": "Asset", + "path": "v86/libv86.js", + "role": "vendored VM dependency", + "origin": "Exact official copy.sh distribution; v86 source 1e4f43c954701db9699fa976b27cc675f9971265; JS independently reconstructed", + "licenseStatus": "BSD/MIT incorporated notices and source supplied in vendor/v86; include accompanying materials in distribution", + "redistributionCleared": true, + "bytes": 353762, + "sha256": "b80fba71dacb7977e5b46800b3ba194bba7fe13e52fa3d22f80cc060ff015a4e" + }, + { + "declaration": "assetFile15", + "type": "Asset", + "path": "v86/seabios.bin", + "role": "vendored VM dependency", + "origin": "Exact copy/v86 BIOS blobs; SeaBIOS rel-1.16.2 source ea1b7a0733906b8425d948ae94fba63c32b1d425", + "licenseStatus": "LGPLv3 source, config, build instructions and licenses supplied in vendor/seabios; include accompanying materials in distribution", + "redistributionCleared": true, + "bytes": 131072, + "sha256": "73e3f359102e3a9982c35fce98eb7cd08f18303ac7f1ba6ebfbe6cdc1c244d98" + }, + { + "declaration": "assetFile14", + "type": "Asset", + "path": "v86/v86.wasm", + "role": "vendored VM dependency", + "origin": "Exact official copy.sh distribution; v86 source 1e4f43c954701db9699fa976b27cc675f9971265; JS independently reconstructed", + "licenseStatus": "BSD/MIT incorporated notices and source supplied in vendor/v86; include accompanying materials in distribution", + "redistributionCleared": true, + "bytes": 1418156, + "sha256": "abd512988f39f5c81d4930f564bafa1a6e1e0d5210de9b20e2bdec13fbc318d9" + }, + { + "declaration": "assetFile16", + "type": "Asset", + "path": "v86/vgabios.bin", + "role": "vendored VM dependency", + "origin": "Exact copy/v86 BIOS blobs; SeaBIOS rel-1.16.2 source ea1b7a0733906b8425d948ae94fba63c32b1d425", + "licenseStatus": "LGPLv3 source, config, build instructions and licenses supplied in vendor/seabios; include accompanying materials in distribution", + "redistributionCleared": true, + "bytes": 36352, + "sha256": "a4bc0d80cc3ca028c73dafa8fee396b8d054ce87ebd8abfbd31b06b437607880" + } + ], + "architecture": [ + { + "declaration": "admission", + "type": "Foundation.Arch::Component", + "index": 0, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.service" + }, + "name": "admission", + "text": "Four-dimensional reservation ledger. Implementation: src/layer2-schedulers/policy.js. Domain contracts: Stitch.Budget." + }, + { + "declaration": "browser", + "type": "Foundation.Arch::Component", + "index": 1, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.staticSite" + }, + "name": "browser", + "text": "Interactive five-layer Stitch product. Implementation: index.html. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "compute", + "type": "Foundation.Arch::Component", + "index": 2, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.service" + }, + "name": "compute", + "text": "Deterministic program and checkpoint replay. Implementation: src/layer4-compute/index.js, src/layer4-compute/replay.js. Domain contracts: Stitch.Compute." + }, + { + "declaration": "cryptography", + "type": "Foundation.Arch::Component", + "index": 3, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.externalSystem" + }, + "name": "cryptography", + "text": "Browser WebCrypto SHA-256 and Ed25519. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "discovery", + "type": "Foundation.Arch::Component", + "index": 4, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.service" + }, + "name": "discovery", + "text": "DNS-over-HTTPS resolver and scoped DNS writer. Implementation: src/layer5-transport/index.js. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "identity", + "type": "Foundation.Arch::Component", + "index": 5, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.service" + }, + "name": "identity", + "text": "Canonical bytes, full commitments, raw encoding and fragments. Implementation: src/layer1-uor/contracts.js, src/layer1-uor/custody.js, src/layer1-uor/generated-model.js. Domain contracts: Stitch.Identity, Stitch.Encoding, Stitch.Fragments." + }, + { + "declaration": "legacy", + "type": "Foundation.Arch::Component", + "index": 6, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.service" + }, + "name": "legacy", + "text": "Historical UOR and simulation conformance. Implementation: src/layer1-uor/index.js, src/layer3-storage/index.js, src/lib.rs. Domain contracts: historical simulation only." + }, + { + "declaration": "nativeRouting", + "type": "Foundation.Arch::Component", + "index": 7, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.externalSystem" + }, + "name": "nativeRouting", + "text": "External Linux routing daemon; absent from browser. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "peers", + "type": "Foundation.Arch::Component", + "index": 8, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.externalSystem" + }, + "name": "peers", + "text": "Untrusted remote holders and compute peers. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "pointerAuthority", + "type": "Foundation.Arch::Component", + "index": 9, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.service" + }, + "name": "pointerAuthority", + "text": "Independently pinned single-writer key. Implementation: src/layer1-uor/pointer.js. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "publicRelay", + "type": "Foundation.Arch::Component", + "index": 10, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.externalSystem" + }, + "name": "publicRelay", + "text": "Optional public ntfy warm cache. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "runtimeHost", + "type": "Foundation.Arch::Component", + "index": 11, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.externalSystem" + }, + "name": "runtimeHost", + "text": "Browser, OS, clocks, RAM, networking and permissions. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "scheduler", + "type": "Foundation.Arch::Component", + "index": 12, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.service" + }, + "name": "scheduler", + "text": "Experimental proposals under enforced admission. Implementation: src/layer2-schedulers/index.js. Domain contracts: Stitch.Budget, Stitch.Observation." + }, + { + "declaration": "signaling", + "type": "Foundation.Arch::Component", + "index": 13, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.externalSystem" + }, + "name": "signaling", + "text": "Public ntfy SDP/ICE signaling; BroadcastChannel on same origin. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "staticHost", + "type": "Foundation.Arch::Component", + "index": 14, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.externalSystem" + }, + "name": "staticHost", + "text": "Same-origin publication of application and VM assets. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "storage", + "type": "Foundation.Arch::Component", + "index": 15, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.service" + }, + "name": "storage", + "text": "Ephemeral local cache and conditional peer custody. Implementation: src/layer3-storage/custody.js, src/layer3-storage/index.js. Domain contracts: Stitch.Custody, Stitch.System." + }, + { + "declaration": "transport", + "type": "Foundation.Arch::Component", + "index": 16, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.service" + }, + "name": "transport", + "text": "WebRTC channels, bounded messages and VM Ethernet bridge. Implementation: src/layer5-transport/index.js. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "vm", + "type": "Foundation.Arch::Component", + "index": 17, + "kind": { + "constructor": "Foundation.Arch::ComponentKind.service" + }, + "name": "vm", + "text": "v86 x86 Linux guest and 9p filesystem bridge. Implementation: src/layer4-compute/index.js, v86/libv86.js, v86/v86.wasm, v86/seabios.bin, v86/vgabios.bin, images/buildroot-bzimage.bin. Host or external boundary; semantics require independent evidence." + }, + { + "declaration": "browserAdmission", + "type": "Foundation.Arch::Edge", + "index": 0, + "fromIndex": 1, + "toIndex": 0, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "browserCompute", + "type": "Foundation.Arch::Edge", + "index": 1, + "fromIndex": 1, + "toIndex": 2, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "browserDiscovery", + "type": "Foundation.Arch::Edge", + "index": 2, + "fromIndex": 1, + "toIndex": 4, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "browserScheduler", + "type": "Foundation.Arch::Edge", + "index": 3, + "fromIndex": 1, + "toIndex": 12, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "browserStorage", + "type": "Foundation.Arch::Edge", + "index": 4, + "fromIndex": 1, + "toIndex": 15, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "browserTransport", + "type": "Foundation.Arch::Edge", + "index": 5, + "fromIndex": 1, + "toIndex": 16, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "browserVm", + "type": "Foundation.Arch::Edge", + "index": 6, + "fromIndex": 1, + "toIndex": 17, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "computeAdmission", + "type": "Foundation.Arch::Edge", + "index": 7, + "fromIndex": 2, + "toIndex": 0, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "computeIdentity", + "type": "Foundation.Arch::Edge", + "index": 8, + "fromIndex": 2, + "toIndex": 5, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "computeStorage", + "type": "Foundation.Arch::Edge", + "index": 9, + "fromIndex": 2, + "toIndex": 15, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "computeTransport", + "type": "Foundation.Arch::Edge", + "index": 10, + "fromIndex": 2, + "toIndex": 16, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "discoveryAdmission", + "type": "Foundation.Arch::Edge", + "index": 11, + "fromIndex": 4, + "toIndex": 0, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "discoveryAuthority", + "type": "Foundation.Arch::Edge", + "index": 12, + "fromIndex": 4, + "toIndex": 9, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "discoveryHost", + "type": "Foundation.Arch::Edge", + "index": 13, + "fromIndex": 4, + "toIndex": 11, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "identityCryptography", + "type": "Foundation.Arch::Edge", + "index": 14, + "fromIndex": 5, + "toIndex": 3, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "relayTransport", + "type": "Foundation.Arch::Edge", + "index": 15, + "fromIndex": 10, + "toIndex": 16, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "schedulerAdmission", + "type": "Foundation.Arch::Edge", + "index": 16, + "fromIndex": 12, + "toIndex": 0, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "schedulerTransport", + "type": "Foundation.Arch::Edge", + "index": 17, + "fromIndex": 12, + "toIndex": 16, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "signalingTransport", + "type": "Foundation.Arch::Edge", + "index": 18, + "fromIndex": 13, + "toIndex": 16, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "staticBrowser", + "type": "Foundation.Arch::Edge", + "index": 19, + "fromIndex": 14, + "toIndex": 1, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "staticVm", + "type": "Foundation.Arch::Edge", + "index": 20, + "fromIndex": 14, + "toIndex": 17, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "storageAdmission", + "type": "Foundation.Arch::Edge", + "index": 21, + "fromIndex": 15, + "toIndex": 0, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "storageIdentity", + "type": "Foundation.Arch::Edge", + "index": 22, + "fromIndex": 15, + "toIndex": 5, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "storagePeers", + "type": "Foundation.Arch::Edge", + "index": 23, + "fromIndex": 15, + "toIndex": 8, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "storageTransport", + "type": "Foundation.Arch::Edge", + "index": 24, + "fromIndex": 15, + "toIndex": 16, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "transportAdmission", + "type": "Foundation.Arch::Edge", + "index": 25, + "fromIndex": 16, + "toIndex": 0, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "transportPeers", + "type": "Foundation.Arch::Edge", + "index": 26, + "fromIndex": 16, + "toIndex": 8, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "transportSignaling", + "type": "Foundation.Arch::Edge", + "index": 27, + "fromIndex": 16, + "toIndex": 13, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "transportVm", + "type": "Foundation.Arch::Edge", + "index": 28, + "fromIndex": 16, + "toIndex": 17, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "vmStorage", + "type": "Foundation.Arch::Edge", + "index": 29, + "fromIndex": 17, + "toIndex": 15, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "vmTransport", + "type": "Foundation.Arch::Edge", + "index": 30, + "fromIndex": 17, + "toIndex": 16, + "kind": { + "constructor": "Foundation.Arch::EdgeKind.dataFlow" + } + }, + { + "declaration": "operator", + "type": "Foundation.Arch::Stakeholder", + "index": 0, + "name": "Stitch operator", + "text": "Chooses mesh participation, public disclosure, trusted pointer authority, DNS writes and VM actions." + }, + { + "declaration": "recoverability", + "type": "Foundation.Arch::Concern", + "index": 0, + "name": "Conditional recovery and honest assurance", + "text": "Recover exact bytes and replay pure jobs without confusing untrusted host observations, network availability or arbitrary VM effects with proved domain rules." + }, + { + "declaration": "productViewpoint", + "type": "Foundation.Arch::Viewpoint", + "index": 0, + "stakeholderIndex": 0, + "concernIndex": 0, + "modelKindIndex": 0 + }, + { + "declaration": "productView", + "type": "Foundation.Arch::View", + "index": 0, + "viewpointIndex": 0, + "modelKindIndex": 0 + } + ], + "hostCapabilities": [ + "Dom", + "Cryptography", + "MonotonicClock", + "WallClock", + "SessionStorage", + "PeerChannel", + "LocalBroadcast", + "PublicSignaling", + "DnsRead", + "DnsWrite", + "PublicRelay", + "VirtualMachine", + "ArtifactFetch", + "NativeRouting", + "OriginStorage", + "WebLock" + ], + "sources": [ + { + "path": "app/language/prism.arch/entries/arch-component-kind.toml", + "sha256": "bb54f236dd64badfc74d57ee43a0f4d886786b9270edb07347f062541bec613e" + }, + { + "path": "app/language/prism.arch/entries/arch-component.toml", + "sha256": "ef7345b3d4cb74e68c5da598895f13cd887cca2d2247058a1fd062adc2597c50" + }, + { + "path": "app/language/prism.arch/entries/arch-concern.toml", + "sha256": "e2b1b3f560e85d0fb51f75b19b1c18b9f5f83f48eaf952b6c9a9a75ae73f3248" + }, + { + "path": "app/language/prism.arch/entries/arch-edge-kind.toml", + "sha256": "333c549f1db8311e47c74e391839649e20ba45495f6c40843348a45588db444f" + }, + { + "path": "app/language/prism.arch/entries/arch-edge.toml", + "sha256": "3a9d18d8e28a3a3b50be9d1315037fd2c426d56cfc8e2f6115a4b0785e6a5840" + }, + { + "path": "app/language/prism.arch/entries/arch-model-kind.toml", + "sha256": "ccb283501e64ab83914728371e1e2fdf8301837bc502804c4bd18c1d49128ada" + }, + { + "path": "app/language/prism.arch/entries/arch-stakeholder.toml", + "sha256": "f8e4bc507df3cf0e384d6c9a92912500ddca2004be3cfeede0f3cc3d38a04ec7" + }, + { + "path": "app/language/prism.arch/entries/arch-standard-reference.toml", + "sha256": "07e3dcf71b75ee0dcfe8441894e5ad3744f042577c502619b3bedb787c86ca1b" + }, + { + "path": "app/language/prism.arch/entries/arch-text-application-model.toml", + "sha256": "6d92d1a7d29d4516dde60bd9539e758b1076dfbf889860e3e435f289c504b9d1" + }, + { + "path": "app/language/prism.arch/entries/arch-view-class.toml", + "sha256": "ef9465462b1adcf5c36b10b2669f03057d5215bbfd10e863db58e81727408fdb" + }, + { + "path": "app/language/prism.arch/entries/arch-view.toml", + "sha256": "2bee3378b0f94165eb8f023279eaab32ec70c5e112e3c06bce7237a1498e0e31" + }, + { + "path": "app/language/prism.arch/entries/arch-viewpoint-class.toml", + "sha256": "c1efce0dd43342b471433ae8a89d7cc46876d54ef3200aed8e08e817f36795cf" + }, + { + "path": "app/language/prism.arch/entries/arch-viewpoint.toml", + "sha256": "a6f53b7f4c58950d7230fb6445a35a80e3a93772fb024b5e7c09381c10cd466c" + }, + { + "path": "app/language/prism.arch/entries/holo-flat-validation-input.toml", + "sha256": "e3a0cf83efd144e1aa3ed6ce5b67ea3bed1df1c4f198c71655c817b65b1d0108" + }, + { + "path": "app/language/prism.arch/entries/holo-normalized-model.toml", + "sha256": "5f7f66774560717cfa55842e30e8fc1b097e1e038b0eba6da6ea3312b583080e" + }, + { + "path": "app/language/prism.arch/entries/holo-standards-profile.toml", + "sha256": "1cf436bcdcc986f4ffcb41db1f31eba74aab4e534a867b4dc5d6d6cf7523417d" + }, + { + "path": "app/language/prism.arch/entries/prism-bounded-byte-buffer.toml", + "sha256": "9b8f6d61f42389a8e63bfbac674ec1b3061f5f004adda8279158df549ee7c902" + }, + { + "path": "app/language/prism.arch/entries/prism-browser-system-model.toml", + "sha256": "3ba45fd6754e84290033a4f18ebc06f5338c8e8affd5e58ee95b07e572fcf42b" + }, + { + "path": "app/language/prism.arch/entries/prism-production-system-model.toml", + "sha256": "91df8207b685a56ba0f0032ed06e875f707202789d21aa3cb6e8b31b4855fb34" + }, + { + "path": "app/language/prism.arch/entries/prism-unicode-text-codec.toml", + "sha256": "7c296475b0a97eccee73eb522af93359eaf185b04571e280b01d394b20f9e1e1" + }, + { + "path": "app/language/prism.arch/lexicon.toml", + "sha256": "14c95df8b512edacacdb1788b58ae90cf573b4e3f1dca0e41074bfde5a380c9f" + }, + { + "path": "app/language/stitch.domain/entries/stitch-budget.toml", + "sha256": "0bba5b43f718ceefbe562a5f08ad29c8724071ccf4464c4bf91860288428d8f9" + }, + { + "path": "app/language/stitch.domain/entries/stitch-checkpoint.toml", + "sha256": "4d52a393476ad8e6944092fba2255b733a2980ca1c200e8e897d6b08e8e1a62a" + }, + { + "path": "app/language/stitch.domain/entries/stitch-encoding.toml", + "sha256": "7e1624765b469c5519fc07888d480477aaf20ab0d14adc2ace1b394939fff543" + }, + { + "path": "app/language/stitch.domain/entries/stitch-evidence.toml", + "sha256": "7bbbe2db8b2970c5b9943e499d1f67ee0e965d9330556f7ab9b428da8c6b6fba" + }, + { + "path": "app/language/stitch.domain/entries/stitch-fragment.toml", + "sha256": "6ecf049cdb84d7b134022012e38c5e1a114471f3b0330fd22aa6e39a1e5af8b1" + }, + { + "path": "app/language/stitch.domain/entries/stitch-object.toml", + "sha256": "9713cff899bf01e9cddbd9599e3ea70395d089b3296c79ffa5cdc1c364329714" + }, + { + "path": "app/language/stitch.domain/entries/stitch-observation.toml", + "sha256": "3ee41f31ef11a0d4fc1b54674c9bd0a55870bd7ec29354b5e189a35ca0cc3579" + }, + { + "path": "app/language/stitch.domain/entries/stitch-placement.toml", + "sha256": "2dfa9c8901fa29b87f33aff74305a72dac70a2f79ca9a480d6790d03cf51b0b2" + }, + { + "path": "app/language/stitch.domain/entries/stitch-pointer.toml", + "sha256": "fbe10dae37ae4a6ef039a7ec38585da18a434b4f8266ab285a4c85b35d3df23b" + }, + { + "path": "app/language/stitch.domain/entries/stitch-service-model.toml", + "sha256": "4277ffc608483787cffbd79f05cfbd7ede7db687549ee0c5ce7b4dbe8bd422d9" + }, + { + "path": "app/language/stitch.domain/lexicon.toml", + "sha256": "6b9d7544b96a6c0bbeacb5dd9972377ffa4f9ef23dffc92eb191bd90e39cc98d" + }, + { + "path": "app/lexlean.toml", + "sha256": "48c90de5fb9896bb45b03cc11692ccd1c26c99fadcc0ec4d7c6c2f481da6f56f" + }, + { + "path": "app/prism.toml", + "sha256": "5445be94ddceff0efdf9492eab20e7746ba7b3533ae4853607c7b72a185b18c9" + }, + { + "path": "app/prismpm.toml", + "sha256": "9469bbd2a7dd5d844f0e2d0b83b931b4a988f24d21e03f5ee9433fcab1ebe02e" + }, + { + "path": "app/src/Foundation/Arch.lex.tex", + "sha256": "54fdc8eb15c46707e445ff99814d6cbd1731967f801bf064a6c1f4cc01c45394" + }, + { + "path": "app/src/Foundation/Bytes.lex.tex", + "sha256": "ce16e5b439128db3231979381f4599d3ff0617f62c2bf00c348bba35393abcd6" + }, + { + "path": "app/src/Foundation/View/Text/V1/Model.lex.tex", + "sha256": "db124343ad8fe1295bc8eb305c7f59f83cf6ad76d46a5cabea500fe66f3ad5dc" + }, + { + "path": "app/src/Product/Architecture.lex.tex", + "sha256": "d5cc5fd4e64070bddd5c0edc8cb3a318a0965b5e1574efe9a9dfa483b12e8d6d" + }, + { + "path": "app/src/Product/Experience.lex.tex", + "sha256": "6f2625fdce3d3d51899cabc17ce3d57ec0a9381dd3bf3e6477da6ae3ccfb84bd" + }, + { + "path": "app/src/Product/Host.lex.tex", + "sha256": "3bb2a621868dc683e776c9b65c58cc60cc2b89e5d007d54c4c152bedd4878871" + }, + { + "path": "app/src/Product/Model.lex.tex", + "sha256": "281fcf4954a28d3afa3fd86fda167541207ef572f16cb3a853aa1fb43216ebed" + }, + { + "path": "app/src/Stitch/Authority.lex.tex", + "sha256": "10afc7af1503f08fe7806dbab24d93f565f34370e3b7d18135f48297e64ee573" + }, + { + "path": "app/src/Stitch/Budget.lex.tex", + "sha256": "581ae188297e3e03e69869a3cfbcdae9554706e007cbeb238d97c8ad30229911" + }, + { + "path": "app/src/Stitch/ChannelFlow.lex.tex", + "sha256": "7f4356ddd38fc94b32a2d6af237ce7382c34bdc7db43c8e8d6ab94cd94fc3e63" + }, + { + "path": "app/src/Stitch/Compute.lex.tex", + "sha256": "ef0f1b8dcf15a8ff26a206b7bd8fa51736bb54ae14e7b6e71a4296deeb4528b7" + }, + { + "path": "app/src/Stitch/Custody.lex.tex", + "sha256": "e9084ba97058adfd3017e634215af1dee12d89c4ff0d409a4271f05387d8d663" + }, + { + "path": "app/src/Stitch/Effects.lex.tex", + "sha256": "7ccc2c30cca7df663541ceece0c85226f921160f56f4ec681703a8d5b589263b" + }, + { + "path": "app/src/Stitch/Encoding.lex.tex", + "sha256": "75b412ab0ed56dea3aa41cc77705fb6233991ea1c2e600a7cf509c3b84e5a95f" + }, + { + "path": "app/src/Stitch/Evidence.lex.tex", + "sha256": "39011e1cf70295427f716d328b1ab754242d3667f0e70a8a48dffa735465c79e" + }, + { + "path": "app/src/Stitch/Fragments.lex.tex", + "sha256": "5cd8d0602cbe501ae4ffc5c18dde17fc6e5766d930ac1d9277545d1ef8d88b83" + }, + { + "path": "app/src/Stitch/Identity.lex.tex", + "sha256": "c4c159234e1623b8f339e86cf47da55c89d197bf21fe334bd893f575ba053870" + }, + { + "path": "app/src/Stitch/Observation.lex.tex", + "sha256": "fe3205a68576d8c7d82f86b45b78f8b6c8b49a873f00c448cccb2eb459749ae8" + }, + { + "path": "app/src/Stitch/Pointer.lex.tex", + "sha256": "10239748c402cdadfc36b150a7a103dfe5124d81fa27bb276575810470c89c46" + }, + { + "path": "app/src/Stitch/Recovery.lex.tex", + "sha256": "4a29e91526ffd1c5aa9fcfc8d990ca1b89d5129813742d9ae55e688eeb6a9121" + }, + { + "path": "app/src/Stitch/Relay.lex.tex", + "sha256": "26a3b5c7f8af3cb058800716a5b73111adbe0188436ae1ad87e1a0e6ce118a03" + }, + { + "path": "app/src/Stitch/Signaling.lex.tex", + "sha256": "97bdfb5160e41a4ed3ab30788f2e3a558836f622c237e4bd3496536212b330c9" + }, + { + "path": "app/src/Stitch/System.lex.tex", + "sha256": "b05a639514a2c56f40b8e960c6cf31023aec8b20d1c18c5ed68a0a936a9d7119" + }, + { + "path": "app/src/Stitch/VmAdministration.lex.tex", + "sha256": "4c27a3a3d1b3650aa78d8fe22b6f07a7335d7e9ec58969ad50f7ad9294f30f81" + }, + { + "path": "app/src/StitchApp.lex.tex", + "sha256": "ffd8a4b6b9072b27b06d67d61e1c11d085a6b82e84be4610f27f3805d87f675b" + }, + { + "path": "package-lock.json", + "sha256": "2b48cacfb23afb0b149221dfb9f2c9736073f4b6886e6c0d83b9899af0ab4425" + }, + { + "path": "package.json", + "sha256": "c1c89bc6b5fb746218fe6387c6bfdc20bf58deb0f4eb568bbd74f80d96c6f219" + }, + { + "path": "prismpm.lock", + "sha256": "3773d32926962ef5d2556b74e0df9b34bdaf72353022f3256ebaa04a4ba8db7f" + }, + { + "path": "standards.lock", + "sha256": "54448d21cb1ed3a4af826aa44991e9839b51d97b8975a5b125927c78af922b46" + }, + { + "path": "vendor/distribution.json", + "sha256": "02263c2d4bf1a1913a673466554c19593b5a6c39b22a2da32ce4375675868347" + } + ], + "sourceDigest": "sha256:d41113060544b9443593c0f768653ef808eba28e611eaf159daefbe8c2a05bb2" +} diff --git a/product/source-attestation.json b/product/source-attestation.json new file mode 100644 index 0000000..703ba6e --- /dev/null +++ b/product/source-attestation.json @@ -0,0 +1 @@ +{"attestation_id":"f85d00e01268644324d3a86938d5270228a14dc7d1ca2a6eaaf0c8fd8011512c","build_id":"3620ec55cbea22062aaabf69fede3f08fd24d378cd0969c306c62a60aee7103e","build_manifest":{"byte_length":29525,"sha256":"ea91e398a0bcdadbb74c8a34ba9da7cdf88731f624363bac98d83536466d76c3"},"declarations":[{"name":"StitchModel.Foundation.Arch.StandardReference","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Arch.ComponentKind","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Arch.EdgeKind","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Arch.ModelKind","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Arch.Component","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Arch.Edge","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Arch.Stakeholder","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Arch.Concern","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Arch.Viewpoint","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Arch.View","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Bytes.ByteOrder","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Bytes.BufferError","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Bytes.BoundedBuffer","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Bytes.appendBytes","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Bytes.byteLength","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Bytes.byteAt","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Bytes.sliceBytes","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.Bytes.compareBytes","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Foundation.View.Text.V1.Model.TextView","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.View.Text.V1.Model.AcceptanceVector","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.View.Text.V1.Model.TextApplication","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Foundation.View.Text.V1.Model.textApplicationProfile","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.admission","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.browser","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.compute","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.cryptography","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.discovery","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.identity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.legacy","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.nativeRouting","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.peers","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.pointerAuthority","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.publicRelay","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.runtimeHost","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.scheduler","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.signaling","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.staticHost","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.storage","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.transport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.vm","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.browserAdmission","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.browserCompute","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.browserDiscovery","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.browserScheduler","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.browserStorage","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.browserTransport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.browserVm","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.computeAdmission","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.computeIdentity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.computeStorage","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.computeTransport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.discoveryAdmission","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.discoveryAuthority","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.discoveryHost","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.identityCryptography","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.relayTransport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.schedulerAdmission","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.schedulerTransport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.signalingTransport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.staticBrowser","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.staticVm","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.storageAdmission","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.storageIdentity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.storagePeers","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.storageTransport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.transportAdmission","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.transportPeers","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.transportSignaling","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.transportVm","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.vmStorage","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.vmTransport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.operator","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.recoverability","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.productViewpoint","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Architecture.productView","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.Facts","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.Journey","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.View","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.Action","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.initialFacts","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.journeyMesh","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.journeyObjects","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.journeyCompute","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.journeyVm","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.journeyPointers","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.journeyResources","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.journeys","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.meshDisclosure","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.meshReady","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.meshSearching","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.meshConnected","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.objectsEmpty","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.objectsPartial","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.objectsLocal","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.objectsPlaced","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.computeEmpty","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.computeUnverified","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.computeReplay","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.computeDone","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.vmIdle","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.vmBooting","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.vmReady","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.vmFailed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.pointerUnpinned","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.pointerPinned","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.pointerLocal","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.pointerPending","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.pointerUnknown","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.pointerPublished","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.resourcesActive","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.resourcesBlocked","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionJoin","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionStore","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionClear","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionRecover","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionStart","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionResume","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionBoot","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionExecute","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionSrv","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionTxt","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionPin","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionAdmit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionPublish","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionReconcile","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionRenew","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionExport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionRecoveryExport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionRecoveryImport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionRecoverySave","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionRecoveryDownload","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionRecoveryFinish","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionRecoveryTrust","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionVmStop","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionVmDestroy","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionVmCancel","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionVmReconcile","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionVmForget","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionSaveAuthority","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionLoadPublication","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionRecoveryRestore","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionPlacementRepair","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.placementRepairAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.unselectedObjectCannotRepair","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.blockedPolicyCannotRepair","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actions","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.recoveryEmpty","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.recoveryChecking","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.recoveryChecked","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.recoveryTrusted","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.recoveryRestored","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.vmTerminationPending","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.vmStopped","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.vmDestroyed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.vmQuarantined","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.recoveryView","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.meshView","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.objectsView","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.computeView","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.vmView","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.pointersView","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.resourcesView","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.joinAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.publicationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.reconciliationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.executionAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.actionAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.integrityLabel","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.executionLabel","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.productTitle","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.disclosureLabel","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.relayLabel","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.provenanceLabel","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.unknownPublicationFacts","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.unknownPublicationDoesNotPermitNewCandidate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.unknownPublicationOffersReconciliation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.unknownPublicationIsVisible","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.initialMeshCannotJoinWithoutDisclosure","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.initialVmCannotExecute","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.initialPolicyCanBeExported","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.EvidenceStyle","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.evidenceStyles","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.viewStyle","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.statusLivePolicy","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.navigationLabel","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.focusNavigationTarget","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.navigationScrollBehavior","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.unknownNeverPermitsPublication","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.undisclosedNeverPermitsJoin","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.unreadyNeverPermitsGuestExecution","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.budgetBlockNeverPermitsPublication","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.knownPublicationNeverOffersReconciliation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.journeyVisible","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.explanationInitiallyOpen","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.publicationSetupVisible","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.explanationLabel","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.recoveryPolicyLabel","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.recoveryPolicyVisible","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.admissionInputVisible","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.vmCommandVisible","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Experience.publicationSetupInitiallyOpen","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.Capability","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.Outcome","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.Grant","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.Request","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.Effect","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.Observation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.State","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.capabilityCode","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.outcomeCode","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.requiresDisclosure","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.browserSupported","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.requestAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.reserve","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.observationMatches","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.pendingMatches","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.finish","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.sessionFilter","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.ledgerFilter","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.sessionFilterLedger","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.ledgerFilterSame","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.positiveSessionFilterFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Product.Host.sessionLessThanDifference","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Product.Host.observationCandidate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.observe","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.requestDoesNotCreateObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Host.observationCannotRefundLedger","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Product.Host.staleSessionCannotComplete","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Product.Host.nativeRoutingRefused","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.Component","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.Assumption","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.CapabilityContract","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.Dependency","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.Deployment","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.Asset","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentAdmission","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentBrowser","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentCompute","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentCryptography","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentDiscovery","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentIdentity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentLegacy","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentNativeRouting","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentPeers","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentPointerAuthority","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentPublicRelay","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentRuntimeHost","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentScheduler","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentSignaling","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentStaticHost","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentStorage","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentTransport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentVm","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionArtifactConformance","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionBrowserSemantics","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionCryptographicSecurity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionDisclosureConsent","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionFailureDomains","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionNetworkAvailability","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionObserverAnchor","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionPeerAssertion","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionSerializedJournal","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionTimeSources","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionVmIsolation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityDom","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityCrypto","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityMonotonicClock","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityWallClock","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilitySessionStorage","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityPeerChannel","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityLocalBroadcast","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityPublicSignaling","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityDnsRead","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityDnsWrite","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityPublicRelay","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityVm","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityArtifactFetch","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityNativeRouting","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityOriginStorage","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityWebLock","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyBrowserApis","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyCloudflareDns","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyCloudflareWriter","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyGoogleStun","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyCloudflareStun","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyNtfySignaling","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyNtfyRelay","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyStaticOrigin","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyVmAssets","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyPrismSdk","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyPrismCode","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.deploymentBrowserSession","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.deploymentPureProbe","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetLifecycleEffects","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetProductExperience","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile0","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile1","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile2","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile3","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile4","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile5","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile6","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile7","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile8","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile9","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile10","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile11","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile12","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile13","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile14","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile15","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile16","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetFile17","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetRustConformance","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetBrowserAuthority","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetAuthorityUi","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.Model","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetDnsWire","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetRelayFraming","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetRecovery","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetRecoveryUi","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetSignaling","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetChannelFlow","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetVmAdministration","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.product","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentIds","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assumptionIds","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.capabilityContractIds","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependencyIds","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.deploymentIds","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.assetIds","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.member","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.members","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.unique","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.componentAssetsClosed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.contractsClosed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.dependenciesClosed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.deploymentsClosed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.valid","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.redistributionClosed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.productAssetsRedistributable","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.productGraphIsClosed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Product.Model.vendorDistributionMaterialsRecorded","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.State","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.signingAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.rotationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.revocationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.anchorSaveAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.migrationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.anchorChronologyAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.publicationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.journalRemovalAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.controlAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.rotate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.revoke","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.migrate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.maySign","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.unconfirmedRotationRefused","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.changedAnchorCannotMigrate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.retiredAuthorityCannotPublish","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.uncertainJournalCannotBeRemoved","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.revocationBlocksSigning","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.rotateCreatesNextGeneration","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.staleMigrationPreservesState","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Authority.sameKeyRollbackRefused","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.Resources","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.Budget","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.chooseBool","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.chooseNat","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.boolAndFalse","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.boolFalseAnd","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.boolNotTrue","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.chooseBoolTrue","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.chooseBoolFalse","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.chooseNatFalse","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.chooseNatTrue","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reserveAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reserveAmount","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settleReserved","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settleSpent","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.resourcesWithin","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.admitAction","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reserveAction","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationPreservesLimit","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.unknownSettlementRetainsReservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementDoesNotIncreaseCharge","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.clockRollbackRefused","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.budgetValid","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.vectorReservationPreservesBudget","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.zeroResources","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.addResources","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.sameResources","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.resourcesAtMost","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.Reservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.Ledger","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.SettlementOutcome","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.SettlementObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.Selection","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectionFromBool","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectionValue","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectBoth","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectRemaining","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectBool","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectNat","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectLedger","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.boolImpliesTruth","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectedAdmissionSafety","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectionValueFromBool","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectBoolFromValue","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.outcomeKnown","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationUnused","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.resourceAt","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.spentAt","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservedAt","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.headChargedAt","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.chargedAt","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservedTotal","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.spentTotal","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationCostValid","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationsValid","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.ledgerValid","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.ledgerBudget","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reserveLedgerAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationCandidate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reserveLedger","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementRecorded","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settleLedgerAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectedSettlementRecord","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.updateSettlementRecord","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.recordSettlementFrom","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.recordSettlement","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementCandidate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settleLedger","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.unknownOutcomeRetainsLedger","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.staleEpochCannotSettle","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementClockRollbackRefused","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.recordedIdCannotBeReservedAgain","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settledHeadCannotBeChargedAgain","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.ledgerValiditySelect","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationNumericValidity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationValidityOrder","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationLedgerParts","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationConjunctionClosure","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationTrueAnd","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationEpochReflexive","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationFreshCostValidity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationListAdmissionFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationCandidateListGuarantee","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationCandidateNumericGuarantee","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationCandidateGuarantee","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationSelectedSafety","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reserveLedgerPreservesValidity","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reserveLedgerPreservesValidityFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationSelectNat","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationLedgerClockSelect","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationSelectedClockFact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reservationCandidateClock","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.reserveLedgerClockFact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectedRecordId","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectedRecordEpoch","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectedRecordCeiling","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectedRecordCostValidity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectBoolFromBool","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementFromPreservesUnusedIds","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementPreservesUnusedIds","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectNatFromBool","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectedRecordCharge","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarAccountingStep","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarAccounting","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementValidityStep","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementFromPreservesReservationValidity","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementReservationValidityFact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementPreservesReservationValidity","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarBoundToBool","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarBoolToBound","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settledSelectionChargeStep","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarChargeSafe","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarChargeRejected","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarFreshChargeCheck","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarAdditionMonotone","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarFreshChargeGate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarSameConsequent","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarTrueConsequentObserved","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarAdditionCancellation","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarCheckComparisonCongruence","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarCheckReflected","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarCheckAdditionCancellation","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.resourceAtChargeConstraint","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarStepChargeSafe","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.resourceAtBound","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarTrueConsequent","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarStepChargeGuarantee","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarConsChargeCheck","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.selectedRecordChargeExpanded","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarSettlementSafety","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarChargeObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.scalarSettlementFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.chargeComparisonObserved","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.chargeFourConjunctionFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementCannotIncreaseLedgerCharge","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementCannotIncreaseLedgerChargeFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementValidityProjection","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementOldReservationsFact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementListGateFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementNumericGateFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementCandidateNumericTransferFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementCandidateClock","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settleLedgerClockFact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementImplies","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementImplicationObserved","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementListGateBooleanFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementNumericGateBooleanFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementListDomainGate","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementNumericDomainGate","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementCandidateListBoolean","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementCandidateNumericBoolean","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementCandidateListGuarantee","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementCandidateNumericGuarantee","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settlementCandidateGuarantee","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settleLedgerPreservesValidity","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Budget.settleLedgerPreservesValidityFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.ChannelFlow.queueAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.ChannelFlow.sendAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.ChannelFlow.appendAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.ChannelFlow.append","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.ChannelFlow.staleCannotSend","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.Instruction","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.Program","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.Job","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.Checkpoint","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.instructionAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.naturalPower","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.ringModulus","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.normalize","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.bitwiseAcc","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.natBitwise","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.binaryLengthAcc","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.binaryLength","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.ringPow","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.powerWorkAcc","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.powerWork","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.instructionWork","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.zeroExponentIsRingUnit","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.zeroExponentCostsNoMultiplications","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.ringStep","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.powerRetainsExponentBitsAboveU64","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.execute","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.appendProgram","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.checkpointLinkAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.semanticTamperingRefused","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.resumeEqualsUninterrupted","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.checkpointStrictlyAdvances","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.supportedWidth","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.instructionsAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.instructionCount","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.sameInstruction","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.sameInstructions","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.instructionWellFormed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.instructionsWellFormed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.programAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.takeSteps","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.replayedValue","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.jobAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.checkpointMatchesJob","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.checkpointSuccessor","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.acceptedCheckpointIsSemanticReplay","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.ProgramDigestInput","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.ProgramDigestObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.InputDigestInput","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.InputDigestObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.JobDigestInput","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.JobDigestObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.StateDigestInput","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.StateDigestObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.CheckpointDigestInput","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.CheckpointDigestObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.JobCommitments","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.CheckpointCommitments","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.programCommitted","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.inputCommitted","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.jobCommitted","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.stateCommitted","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.checkpointCommitted","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.committedCheckpointAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.committedCheckpointSuccessor","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.advanceCheckpoint","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.committedCheckpointReplays","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.mismatchedStateValueRejected","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.unsupportedWidthCannotCommit","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.checkpointTransitionNeverRollsBack","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.Word","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.TypedInstruction","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.byteWidth","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.wordAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.operandWidth","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.arithmeticWidth","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedResultBits","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedInstructionAdmission","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedInstructionAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedProgramAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.concatWords","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedStep","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedInstructionWork","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedProgramWorkAcc","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedProgramWork","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedExecute","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.appendTypedProgram","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.concatPreservesDeclaredWidth","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.concatIsBigEndianAppend","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedResumeEqualsUninterrupted","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.concatCapacityCannotTruncate","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedAdmissionBoundsDeclaredWidth","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Compute.typedAdmissionBoundsResultWidth","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.TransferPhase","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.Receipt","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.Transfer","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.Placement","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.distinctHolders","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.activeCount","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.activeThreshold","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.recoverable","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.receiptLive","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.indexedCopyLive","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.liveCount","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.recoverableAt","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.commitAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.activationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.expiredReservationCannotActivate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.replacedRouteCannotActivate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.retireAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.receiptBound","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.failTransfer","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.unacknowledgedCannotCommit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.uncommittedCannotRetire","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.retirementPreservesThreshold","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.replaceFirst","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.retireFirst","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.conjunctionPreservationFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.booleanSelfPreservationFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.activeFirstPreservationFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.activeRetirementPreservationFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.activeIndexedPreservationFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.distinctFirstPreservationFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.committedMigrationPreservesRecovery","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.committedMigrationPreservesRecoveryFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.retirementPreservesRecovery","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.retirementPreservesRecoveryFact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.replaceIndex","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.distinctIndexedPreservationFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.indexedMigrationPreservesRecovery","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.indexedMigrationPreservesRecoveryFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.acknowledgeTransfer","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.commitTransfer","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.PhysicalCopy","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.physicalCopyLive","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.physicalBytes","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.requestedPhase","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.committedPhase","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.sameRequest","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.requestWellFormed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.requestUnused","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.requestRecorded","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.recordCompletion","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.sourcePlaced","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.sourceLive","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.fragmentBound","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.FragmentIntegrityObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.fragmentIntegrityAccepted","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.prepareCompletion","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.indexedCopyLiveZero","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.indexedCopyLiveOne","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.indexedCopyLiveTwo","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.choosePlacement","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.chooseTruth","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.selectionOfTruth","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.selectPlacement","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.selectTruth","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.recoveryOfChoice","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.liveRecoveryOfChoice","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.recoveryOfSelection","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.liveRecoveryOfSelection","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.fallbackPreservationFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.migrationBase","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.migrationGate0","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.committedPlacement0","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.staticGate0Preservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.liveGate0Preservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.staticMigrationGate0Fact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.liveMigrationGate0Fact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.migrationGate1","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.committedPlacement1","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.staticGate1Preservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.liveGate1Preservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.staticMigrationGate1Fact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.liveMigrationGate1Fact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.migrationGate2","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.committedPlacement2","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.staticGate2Preservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.liveGate2Preservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.staticMigrationGate2Fact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.liveMigrationGate2Fact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.migrationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.installReceipt","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.migrate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.typedMigrationPreservesRecoveryFact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.typedMigrationPreservesRecovery","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.typedMigrationPreservesLiveRecoveryAtObservationTimeFact","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.typedMigrationPreservesLiveRecoveryAtObservationTime","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Custody.expiredReceiptDoesNotCountAsLive","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.Transport","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.TransportCallback","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.transportCanSend","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.transportClose","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.transportOpen","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.transportSessionMatches","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.transportPeerCallbackAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.transportChannelCallbackAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.transportSignalAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.transportPeerAllocationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.closedTransportCannotSend","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.closingAdvancesGeneration","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.DnsPhase","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.DnsDecision","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.DnsScope","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.DnsPublication","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.DnsCandidate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.DnsRead","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.DnsWriteResult","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.dnsScopeMatches","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.dnsMayWritePhase","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.dnsMayReconcile","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.dnsRequestAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.dnsSelectRead","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.dnsDecisionWrites","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.unknownReadNeverWrites","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.dnsSelectGatedRead","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.unknownGatedReadNeverWrites","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.dnsReadDecision","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.dnsReconciled","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.dnsBeginWrite","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.dnsFinishWrite","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.unknownCannotAuthorizeWrite","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.unknownOffersReconciliation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.VmPhase","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.Vm","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmCanBoot","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmIsBooting","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmCanExecute","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmStart","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmCallbackAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmFailAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmFail","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmGenerationFilter","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmPositiveGenerationFilterFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmOldGenerationDifference","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmReadyCandidate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.vmObserveReady","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.bootingCannotBootAgain","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.failedVmCanRetry","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.bootingCannotExecute","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.staleTransportGenerationCannotCallback","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.reconnectCannotReviveCapturedCallback","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.staleVmGenerationCannotCallback","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.staleVmCannotResurrectReadiness","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.unresolvedDnsReadCannotWrite","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.C1Progress","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.c1InWindow","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.c1ProbeAccepted","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.c1ObserveProbe","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.c1ConnectionQualified","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.c1DirectSuccess","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.fewerThanTenCannotQualify","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.expiredConnectionCannotQualify","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.authorityMayCreate","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.existingAuthorityNeverRotates","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.journalMayClaim","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.journalMayFinish","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.unknownJournalCannotClaim","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Effects.foreignCandidateCannotFinish","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Encoding.DependencyKind","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Encoding.Dependency","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Encoding.Encoding","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Encoding.dependenciesReady","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Encoding.selfContainedBytes","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Encoding.totalRecoveryBytes","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Encoding.rawDecode","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Encoding.rawRecoveryExact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Encoding.externalBasisNotFree","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Encoding.RecoveryObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Encoding.exactRecovery","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.ClaimKind","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.EvidenceKind","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.HostEffect","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.HostAssumptions","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.Evidence","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.Scope","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.claimCode","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.kindCode","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.effectCode","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.dependencyKindCode","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.sameAssumptions","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.sameDependency","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.dependenciesUnchanged","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.effectMember","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.effectsCovered","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.positiveEvidenceKind","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.scopeReusable","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.pureEffectAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.cannotExtendEvidenceHorizon","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Evidence.expiredEvidenceCannotBeReused","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.BitPair","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.Blocks","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.Fragment","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.xorBit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.encodePair","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.recoverLeftParity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.recoverRightParity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.leftParityBitExact","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.rightParityBitExact","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.pairAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.duplicateIndexCannotRecover","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.Bit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.BitBlocks","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.xorCell","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.leftParity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.rightParity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.leftParityInvolutive","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.rightParityInvolutive","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.PairSelection","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.encodeForPair","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.decodePair","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Fragments.everyCompatiblePairRecoversFiniteBlocks","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Identity.Digest","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Identity.Object","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Identity.DigestObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Identity.sameDigest","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Identity.digestWellFormed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Identity.digestAccepted","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Identity.fullDigestReflexive","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Observation.Reachability","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Observation.PeerObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Observation.observationFresh","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Observation.acceptObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Observation.expiredObservationRejected","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Observation.reachableObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Observation.updateObservation","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Observation.futureObservationRejected","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Observation.acceptedObservationIsFresh","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.Authority","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.Pointer","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.successorAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.acceptPointer","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.restoreAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.unacceptedRestoreRefused","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.restoreDifferentHeadGuard","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.differentRetainedHeadRestoreRefused","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.expiredRestoreRefused","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.successorStrictlyAdvances","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.wrongAuthorityRefused","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Pointer.rollbackRefused","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Recovery.Limits","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Recovery.State","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Recovery.admitted","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Recovery.commit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Recovery.anchorAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Recovery.progressAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Recovery.rollbackProgressRefused","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Recovery.unverifiedImportPreservesState","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Recovery.acceptedCandidateWithinBounds","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Recovery.staleGenerationRefused","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.Limits","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.limits","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.signalLifetime","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.warmLifetime","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.Capacity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.Identity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.Frame","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.Assembly","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.sameIdentity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.frameAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.admissionAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.admitCapacity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.release","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.assemblyCurrent","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.appendAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.append","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.ready","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.beginVerification","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.deliveryAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.effectAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.duplicateDoesNotAdvanceAssembly","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.unverifiedMessageCannotDeliver","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.closedSessionCannotPublish","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.effectFalseGuard","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Relay.withdrawnConsentCannotPublish","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.Signaling.admissionAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.Signaling.unverifiedCannotAdmit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.ActionKind","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.State","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.Action","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.admitAction","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.requestAction","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.requestDoesNotChangeObjectCustody","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.requestDoesNotCreateEvidence","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.ledgerPlacementValid","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.valid","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.validAt","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.requestMigrationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.requestMigration","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.reservationActive","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.completionSafetyGuard","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.completeMigrationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.completionBudget","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.completionLedger","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.ledgerTime","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.ledgerHistory","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.clockViewGrouping","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.ledgerClockView","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.System.completionHistory","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.completionTime","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.clockAdvanceFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.System.historyPreservedFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.completionLedgerValidityFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.System.choosePlacement","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.ledgerPlacementValiditySelect","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.productValiditySelect","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.completionSelectionReserved","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.reservationClock","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.completionClock","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.guardedProductPreservationFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.requestAdmissionProductFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.weakenAdmissionFact","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.requestMigrationCandidateValidityFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.System.migrationCandidateValidity","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.migrationCandidateValidityFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.System.applyMigration","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.migrationRequestDoesNotEstablishCustody","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.migrationRequestPreservesProductInvariantFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.System.migrationRequestPreservesProductInvariant","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.System.migrationPreservesProductInvariantFact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.System.migrationPreservesProductInvariant","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.Stitch.System.migrationCompletionDoesNotRefundBudget","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.settleActionAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.settleAction","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.System.settlementDoesNotEstablishCustody","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.shareAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.ethernetAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.commandAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.observationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.administrationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.forgetAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.allocationAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.metadataAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.resultReadAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.terminationRequired","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.filesystemAllocationLimit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.filesystemFileLimit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.filesystemMetadataLimit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.outputLimit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.retainedOutputLimit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.runtimeLimitMs","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.staticAddressAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.networkChangeAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.networkSharingAllowed","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.retainedInstanceCannotReconfigure","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.Stitch.VmAdministration.unconfiguredCannotShareEthernet","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.StitchApp.byteNat","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.StitchApp.unsignedBE","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.StitchApp.flag","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.StitchApp.flagsCanonical","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.StitchApp.verdict","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.StitchApp.decimalDigit","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.StitchApp.decimalBytes","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"StitchModel.StitchApp.ringProbe","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.StitchApp.budgetProbe","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.StitchApp.pointerProbe","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.StitchApp.custodyProbe","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.StitchApp.pairProbe","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.StitchApp.dispatch","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"StitchModel.StitchApp.application","observed":[],"policy":{"axioms":[],"kind":"none"},"result":"ok"},{"name":"LexLeanRuntime.Appendable","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Appendable.append","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Appendable.casesOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Appendable.ctorIdx","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Appendable.mk._flat_ctor","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Appendable.mk.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Appendable.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Appendable.noConfusionType","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Appendable.recOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Decimal","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Decimal.casesOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Decimal.ctorIdx","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Decimal.format","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Decimal.mk._flat_ctor","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Decimal.mk.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Decimal.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Decimal.noConfusionType","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Decimal.parse","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Decimal.recOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.bitAnd","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.bitNot","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.bitOr","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.bitXor","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.casesOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.ctorIdx","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.fromInt","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.maximum","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.minimum","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.mk._flat_ctor","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.mk.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.noConfusionType","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.recOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.shiftLeft","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.shiftRight","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Fixed.toToMathInt","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Indexable","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Indexable.casesOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Indexable.ctorIdx","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Indexable.index","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Indexable.mk._flat_ctor","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Indexable.mk.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Indexable.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Indexable.noConfusionType","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Indexable.recOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Lengthable","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Lengthable.casesOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Lengthable.ctorIdx","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Lengthable.length","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Lengthable.mk._flat_ctor","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Lengthable.mk.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Lengthable.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Lengthable.noConfusionType","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Lengthable.recOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Quotient","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Quotient.casesOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Quotient.ctorIdx","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Quotient.isZero","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Quotient.mk._flat_ctor","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Quotient.mk.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Quotient.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Quotient.noConfusionType","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Quotient.quotient","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Quotient.recOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Quotient.remainder","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Sliceable","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Sliceable.casesOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Sliceable.ctorIdx","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Sliceable.mk._flat_ctor","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Sliceable.mk.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Sliceable.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Sliceable.noConfusionType","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Sliceable.recOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.Sliceable.slice","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.ToMathInt","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.ToMathInt.casesOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.ToMathInt.ctorIdx","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.ToMathInt.mk._flat_ctor","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.ToMathInt.mk.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.ToMathInt.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.ToMathInt.noConfusionType","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.ToMathInt.recOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.ToMathInt.toInt","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.append","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.bitAnd","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.bitNot","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.bitOr","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.bitXor","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedAdd","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedAddInt64","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedConvert","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedFromInt","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedMultiply","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedMultiplyInt64","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedMultiplyInt64.match_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedNegate","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedNegateInt64","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedQuotient","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedQuotientInt64","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedSubtract","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.checkedSubtractInt64","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.compareBytes","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.divideMagnitudeInt64","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.divideMagnitudeInt64._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.divideMagnitudeInt64._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.divideMagnitudeInt64._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.divideMagnitudeInt64.match_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.equal","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.formatDecimal","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.index","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instAppendableByteArray","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instAppendableList","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instDecimalInt","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instDecimalInt.match_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instDecimalOfFixedOfToString","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instFixedInt16","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instFixedInt32","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instFixedInt64","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instFixedInt8","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instFixedUInt16","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instFixedUInt32","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instFixedUInt64","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instFixedUInt8","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instIndexableByteArrayUInt8","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instIndexableList","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instLengthableByteArray","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instLengthableList","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instLengthableString","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instQuotientInt","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instQuotientNat","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instSliceableByteArray","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instSliceableList","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.instToMathIntInt","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.join","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.length","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.listIndex","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.listIndex._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.listIndex._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.listIndex._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.listIndex.match_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.magnitudeInt64","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.multiply","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.multiplyMagnitudeInt64","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.multiplyMagnitudeInt64._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.multiplyMagnitudeInt64._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.multiplyMagnitudeInt64._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.multiplyMagnitudeInt64.match_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.negate","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.parseDecimal","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.quotient","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.remainder","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.shiftLeft","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.shiftRight","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.signedMagnitudeInt64","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.slice","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.splitExact","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.subtract","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.utf8Decode","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.utf8Encode","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.Key","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.Key.casesOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.Key.compare","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.Key.ctorIdx","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.Key.mk._flat_ctor","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.Key.mk.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.Key.noConfusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.Key.noConfusionType","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.Key.recOn","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.compareCodes","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.compareCodes._f","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.compareCodes._sparseCasesOn_1","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.compareCodes._sunfold","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.compareCodes._unsafe_rec","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.compareCodes.match_1","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.compareCodes.match_4","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.containsElement","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.containsElement._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.containsElement._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.containsElement._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.graphNodes","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.graphReachable","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.graphSuccessors","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.graphTopological","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.insertElement","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.insertElement._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.insertElement._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.insertElement._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.insertElement.match_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.insertEntry","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.insertEntry._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.insertEntry._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.insertEntry._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.insertEntry.match_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.insertEntry.match_3","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyBool","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyInt","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyInt16","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyInt32","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyInt64","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyInt8","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyNat","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyProd","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyString","observed":["Classical.choice","Quot.sound","propext"],"policy":{"axioms":["Classical.choice","Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyUInt16","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyUInt32","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyUInt64","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.instKeyUInt8","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.iterate","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.iterate._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.iterate._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.iterate._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.iterate.match_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.iterateUntil","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.iterateUntil._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.iterateUntil._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.iterateUntil._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.iterateUntil.match_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.lessThan","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.lessThan._sparseCasesOn_1","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.lessThan.match_1","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.listFold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.lookupEntry","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.lookupEntry._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.lookupEntry._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.lookupEntry._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.mapContains","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.mapEntries","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.mapFold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.mapInsert","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.mapKeys","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.mapLookup","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.mapRemove","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.mapSize","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.mapValues","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.reachableFrom","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.reachableFrom._f","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.reachableFrom._sparseCasesOn_1","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.reachableFrom._sunfold","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.reachableFrom._unsafe_rec","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.reachableFrom.match_1","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.reachableFrom.match_4","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.removeElement","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.removeElement._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.removeElement._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.removeElement._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.removeEntry","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.removeEntry._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.removeEntry._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.removeEntry._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.setContains","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.setDifference","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.setElements","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.setFold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.setInsert","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.setIntersection","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.setRemove","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.setSize","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.setUnion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.topological","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.topological._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.topological._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.topological._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.lessThan._sparseCasesOn_1.else_eq","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.lessThan.eq_1","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanCollections.listFold.eq_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.append_list","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.length_list","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.lessThan_int","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.lessThan_int16","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.lessThan_int32","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.lessThan_int64","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.lessThan_int8","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.lessThan_nat","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.lessThan_uint16","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.lessThan_uint32","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.lessThan_uint64","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.lessThan_uint8","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_add_int","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_add_int_self","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_add_nat","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_add_nat_self","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_append","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_cons","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_extend","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_fusion","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_nil","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_pair","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_prepend","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_sub_int","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.listFold_sub_int_self","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.mapEntries_self","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.mapFold_listFold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.mapSize_length","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.quotient_int","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.quotient_nat","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.remainder_int","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.remainder_nat","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.setElements_self","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.setFold_listFold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.setSize_length","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt.eq_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt.eq_2","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt.eq_def","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_add","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_append","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_cons","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_const","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_mul","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_mul_right","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_mul_self","observed":["propext"],"policy":{"axioms":["propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_neg","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_neg_self","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_nil","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_perm","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_reverse","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumInt_sub","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat._f","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat._sunfold","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat._unsafe_rec","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat.eq_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat.eq_2","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat.eq_def","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat.match_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat_add","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat_append","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat_cons","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat_const","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat_mul","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat_mul_right","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat_mul_self","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat_nil","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat_perm","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.sumNat_reverse","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.tdiv_ediv","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanLaws.tmod_emod","observed":["Quot.sound","propext"],"policy":{"axioms":["Quot.sound","propext"],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.quotient.eq_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"},{"name":"LexLeanRuntime.remainder.eq_1","observed":[],"policy":{"axioms":[],"kind":"exact"},"result":"ok"}],"host":{"arch":"x86_64","os":"linux"},"lake_workspace":[{"path":"lake-manifest.json","sha256":"1107bc06d0f0bf1716fbc980995e4895f608331a17863d16bb1ff631d70924f6"},{"path":"lakefile.toml","sha256":"f93d661ae8380e42c7954c0a90166abb296ac100af42b403d7af0ac7e6b50094"},{"path":"lean-toolchain","sha256":"8e3538e0ab5f81a3ee04927d8838c8c674e0e112838b4b3ce87ec218143276af"}],"lexlean":{"compiler_semantics":"5262e5b4c8b5668ae7066ad686757a6bb7f80c941d515fb9d586894fbc7de69a","executable_sha256":"e4168b533d3369e7e0e2ed7cdb331f8dd94e3aa20362d55ded086a24ca3b16f8","version":"0.3.0"},"oleans":[{"byte_length":430856,"module":"LexLeanRuntime.Portable","sha256":"b977672854525e77607b537c3be5adba33aaca00b47edfa6a30bd0d36ffd5094"},{"byte_length":303136,"module":"LexLeanRuntime.Collections","sha256":"9eac5c21764b72bf897ffe00d9e5624799e1eb1bae2dea3c81f33864928b4f87"},{"byte_length":334096,"module":"LexLeanRuntime.Laws","sha256":"ba661b0b6bc49533546a02810a274bde3e58849f52d6ff55a473c95c51453cfa"},{"byte_length":215720,"module":"StitchModel.Foundation.Arch","sha256":"e1f5abdcc42f820288bb5cafa28d59a62b233a82b54741a895f80706879f638f"},{"byte_length":87896,"module":"StitchModel.Foundation.Bytes","sha256":"77aa5bdaccf11b32dba7bdbd7f91a177ea06b47d7bdc89f36e5f2d785b24d4d7"},{"byte_length":110960,"module":"StitchModel.Foundation.View.Text.V1.Model","sha256":"9be71a3d821686f501f1c798f898f0f4b62db34898093042124ad63228627072"},{"byte_length":45512,"module":"StitchModel.Product.Architecture","sha256":"afa114a464df31635316cc9e1a2f99478d77d768785bc57160e8467c566dedcd"},{"byte_length":358200,"module":"StitchModel.Product.Experience","sha256":"f98fff2c83f77a9f51458144603a31a925964e6562c9e1a77321c62d42e42ae6"},{"byte_length":323360,"module":"StitchModel.Product.Host","sha256":"def1f4815fde1fc154be9835c1154e3b858fd32d2df4009cd84c61beb9988329"},{"byte_length":431856,"module":"StitchModel.Product.Model","sha256":"4183f3e4fe1e01224db9e151d29daf1c6d6fa53b9b3c84df5f53c42d23dcae68"},{"byte_length":65032,"module":"StitchModel.Stitch.Authority","sha256":"738cc7f8b390cd59584679bc4c5863858f4519b516a6d47f909806be51b68d22"},{"byte_length":507144,"module":"StitchModel.Stitch.Budget","sha256":"977c119dd56b881e0305a9eb9e2f29bd2bc5c6adf6f7e2000dbcf2f7ea5d9234"},{"byte_length":17200,"module":"StitchModel.Stitch.ChannelFlow","sha256":"62984864890a74209655cc039c0439ba7c0b649541313d35c6a81110ce6e25e6"},{"byte_length":673256,"module":"StitchModel.Stitch.Compute","sha256":"5e480d363afa1596c21a7213e420e38e52b12bd4feb1106e631aaf658387fe11"},{"byte_length":378056,"module":"StitchModel.Stitch.Custody","sha256":"324958e2649b135e37aeb669fb8a3806f4e540ae70d4439b2addbda4e1f3544e"},{"byte_length":404512,"module":"StitchModel.Stitch.Effects","sha256":"c1a6549b69e48580738638045e2304e26f5e6fb913d65113d5ad531aef5379bb"},{"byte_length":153176,"module":"StitchModel.Stitch.Encoding","sha256":"18ca75c74fae7901620b63bf87278bc50bfe3e79a9cab30d3361078baf9396a9"},{"byte_length":345648,"module":"StitchModel.Stitch.Evidence","sha256":"389a481d1333e0da1bf80a7bcab6fc5e11161317c827c6c48527f8bb82937fda"},{"byte_length":228968,"module":"StitchModel.Stitch.Fragments","sha256":"ba420fc12c4576dc08c71e81954ce8783147b7b8284999b5a1f5a535726b8c92"},{"byte_length":92264,"module":"StitchModel.Stitch.Identity","sha256":"c85c3fbaa9946a5f9e0e3d2aa48d4d30414591986a1f7098b441dbd499c3d5bf"},{"byte_length":100232,"module":"StitchModel.Stitch.Observation","sha256":"c17866d71e33bfc12fe245787245ba8efa3a78aad41ade76c405241183c29f59"},{"byte_length":88160,"module":"StitchModel.Stitch.Pointer","sha256":"fa948ee72c532933e6b2b09b6ef4dceccfad262b91bb2f505e5a9d0d6cca58db"},{"byte_length":79552,"module":"StitchModel.Stitch.Recovery","sha256":"a69cc2a587fd363aa199cb841b0d37f3cb3349efb1832173b8740c1c04393663"},{"byte_length":168416,"module":"StitchModel.Stitch.Relay","sha256":"1d761a7220e74766b1e0da7c77ff48c398d363aee2e19f7f17c53b4b2a5911fa"},{"byte_length":9360,"module":"StitchModel.Stitch.Signaling","sha256":"1c03b15d5517819285480dd3874c51dd77b6a5bc62e6799e14755524e7f02837"},{"byte_length":215096,"module":"StitchModel.Stitch.System","sha256":"6c1078e09a2d3b8bbd6892cdacc987da5ee7f7ded64be2adf4c346fff7524933"},{"byte_length":36528,"module":"StitchModel.Stitch.VmAdministration","sha256":"e211676f1d506e28c8cabada3407dc0b24743124bd1d28a5c1e63c600e1698c3"},{"byte_length":121112,"module":"StitchModel.StitchApp","sha256":"22ea6260d513387f4968d06aef0a8e2a9ccd29eccff6047680eb3f4d0b4fa4be"}],"processes":[{"argv":["env","lean","$STAGING/probe/LexLeanProbe.P6629359d26d7d175e5e1766d87d3065a.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanProbe.P6629359d26d7d175e5e1766d87d3065a","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/LexLeanRuntime/Portable.olean","$STAGING/lean-src/LexLeanRuntime/Portable.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanRuntime.Portable","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/LexLeanRuntime/Collections.olean","$STAGING/lean-src/LexLeanRuntime/Collections.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanRuntime.Collections","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/LexLeanRuntime/Laws.olean","$STAGING/lean-src/LexLeanRuntime/Laws.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanRuntime.Laws","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Foundation/Arch.olean","$STAGING/lean-src/StitchModel/Foundation/Arch.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Foundation.Arch","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Foundation/Bytes.olean","$STAGING/lean-src/StitchModel/Foundation/Bytes.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Foundation.Bytes","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Foundation/View/Text/V1/Model.olean","$STAGING/lean-src/StitchModel/Foundation/View/Text/V1/Model.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Foundation.View.Text.V1.Model","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Product/Experience.olean","$STAGING/lean-src/StitchModel/Product/Experience.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Product.Experience","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Product/Model.olean","$STAGING/lean-src/StitchModel/Product/Model.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Product.Model","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Authority.olean","$STAGING/lean-src/StitchModel/Stitch/Authority.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Authority","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/ChannelFlow.olean","$STAGING/lean-src/StitchModel/Stitch/ChannelFlow.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.ChannelFlow","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Effects.olean","$STAGING/lean-src/StitchModel/Stitch/Effects.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Effects","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Identity.olean","$STAGING/lean-src/StitchModel/Stitch/Identity.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Identity","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Observation.olean","$STAGING/lean-src/StitchModel/Stitch/Observation.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Observation","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Recovery.olean","$STAGING/lean-src/StitchModel/Stitch/Recovery.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Recovery","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Relay.olean","$STAGING/lean-src/StitchModel/Stitch/Relay.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Relay","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Signaling.olean","$STAGING/lean-src/StitchModel/Stitch/Signaling.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Signaling","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/VmAdministration.olean","$STAGING/lean-src/StitchModel/Stitch/VmAdministration.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.VmAdministration","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Product/Architecture.olean","$STAGING/lean-src/StitchModel/Product/Architecture.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Product.Architecture","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Budget.olean","$STAGING/lean-src/StitchModel/Stitch/Budget.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Budget","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Compute.olean","$STAGING/lean-src/StitchModel/Stitch/Compute.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Compute","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Encoding.olean","$STAGING/lean-src/StitchModel/Stitch/Encoding.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Encoding","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Pointer.olean","$STAGING/lean-src/StitchModel/Stitch/Pointer.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Pointer","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Product/Host.olean","$STAGING/lean-src/StitchModel/Product/Host.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Product.Host","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Evidence.olean","$STAGING/lean-src/StitchModel/Stitch/Evidence.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Evidence","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Fragments.olean","$STAGING/lean-src/StitchModel/Stitch/Fragments.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Fragments","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/Custody.olean","$STAGING/lean-src/StitchModel/Stitch/Custody.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.Custody","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/Stitch/System.olean","$STAGING/lean-src/StitchModel/Stitch/System.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.Stitch.System","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","lean","-R","$STAGING/lean-src","-o","$STAGING/oleans/StitchModel/StitchApp.olean","$STAGING/lean-src/StitchModel/StitchApp.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"StitchModel.StitchApp","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"lean"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","LexLeanRuntime.Portable"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"LexLeanRuntime.Portable","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","LexLeanRuntime.Collections"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"LexLeanRuntime.Collections","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","LexLeanRuntime.Laws"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"LexLeanRuntime.Laws","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Foundation.Arch"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Foundation.Arch","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Foundation.Bytes"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Foundation.Bytes","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Foundation.View.Text.V1.Model"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Foundation.View.Text.V1.Model","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Product.Architecture"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Product.Architecture","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Product.Experience"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Product.Experience","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Product.Host"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Product.Host","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Product.Model"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Product.Model","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Authority"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Authority","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Budget"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Budget","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.ChannelFlow"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.ChannelFlow","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Compute"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Compute","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Custody"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Custody","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Effects"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Effects","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Encoding"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Encoding","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Evidence"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Evidence","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Fragments"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Fragments","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Identity"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Identity","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Observation"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Observation","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Pointer"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Pointer","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Recovery"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Recovery","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Relay"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Relay","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.Signaling"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.Signaling","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.System"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.System","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.Stitch.VmAdministration"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.Stitch.VmAdministration","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","$TOOLCHAIN/bin/leanchecker","StitchModel.StitchApp"],"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","exit_code":0,"module":"StitchModel.StitchApp","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"\n","stdout_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","tool":"leanchecker"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.LexLeanRuntime.Collections.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.LexLeanRuntime.Collections","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'LexLeanCollections.Key' does not depend on any axioms\n'LexLeanCollections.Key.casesOn' does not depend on any axioms\n'LexLeanCollections.Key.compare' does not depend on any axioms\n'LexLeanCollections.Key.ctorIdx' does not depend on any axioms\n'LexLeanCollections.Key.mk._flat_ctor' does not depend on any axioms\n'LexLeanCollections.Key.mk.noConfusion' does not depend on any axioms\n'LexLeanCollections.Key.noConfusion' does not depend on any axioms\n'LexLeanCollections.Key.noConfusionType' does not depend on any axioms\n'LexLeanCollections.Key.recOn' does not depend on any axioms\n'LexLeanCollections.compareCodes' depends on axioms: [propext]\n'LexLeanCollections.compareCodes._f' depends on axioms: [propext]\n'LexLeanCollections.compareCodes._sparseCasesOn_1' depends on axioms: [propext]\n'LexLeanCollections.compareCodes._sunfold' depends on axioms: [propext]\n'LexLeanCollections.compareCodes._unsafe_rec' depends on axioms: [propext]\n'LexLeanCollections.compareCodes.match_1' depends on axioms: [propext]\n'LexLeanCollections.compareCodes.match_4' does not depend on any axioms\n'LexLeanCollections.containsElement' does not depend on any axioms\n'LexLeanCollections.containsElement._f' does not depend on any axioms\n'LexLeanCollections.containsElement._sunfold' does not depend on any axioms\n'LexLeanCollections.containsElement._unsafe_rec' does not depend on any axioms\n'LexLeanCollections.graphNodes' does not depend on any axioms\n'LexLeanCollections.graphReachable' depends on axioms: [propext]\n'LexLeanCollections.graphSuccessors' does not depend on any axioms\n'LexLeanCollections.graphTopological' does not depend on any axioms\n'LexLeanCollections.insertElement' does not depend on any axioms\n'LexLeanCollections.insertElement._f' does not depend on any axioms\n'LexLeanCollections.insertElement._sunfold' does not depend on any axioms\n'LexLeanCollections.insertElement._unsafe_rec' does not depend on any axioms\n'LexLeanCollections.insertElement.match_1' does not depend on any axioms\n'LexLeanCollections.insertEntry' does not depend on any axioms\n'LexLeanCollections.insertEntry._f' does not depend on any axioms\n'LexLeanCollections.insertEntry._sunfold' does not depend on any axioms\n'LexLeanCollections.insertEntry._unsafe_rec' does not depend on any axioms\n'LexLeanCollections.insertEntry.match_1' does not depend on any axioms\n'LexLeanCollections.insertEntry.match_3' does not depend on any axioms\n'LexLeanCollections.instKeyBool' depends on axioms: [propext]\n'LexLeanCollections.instKeyInt' does not depend on any axioms\n'LexLeanCollections.instKeyInt16' does not depend on any axioms\n'LexLeanCollections.instKeyInt32' does not depend on any axioms\n'LexLeanCollections.instKeyInt64' does not depend on any axioms\n'LexLeanCollections.instKeyInt8' does not depend on any axioms\n'LexLeanCollections.instKeyNat' does not depend on any axioms\n'LexLeanCollections.instKeyProd' depends on axioms: [propext]\n'LexLeanCollections.instKeyString' depends on axioms: [propext, Classical.choice, Quot.sound]\n'LexLeanCollections.instKeyUInt16' does not depend on any axioms\n'LexLeanCollections.instKeyUInt32' does not depend on any axioms\n'LexLeanCollections.instKeyUInt64' does not depend on any axioms\n'LexLeanCollections.instKeyUInt8' does not depend on any axioms\n'LexLeanCollections.iterate' does not depend on any axioms\n'LexLeanCollections.iterate._f' does not depend on any axioms\n'LexLeanCollections.iterate._sunfold' does not depend on any axioms\n'LexLeanCollections.iterate._unsafe_rec' does not depend on any axioms\n'LexLeanCollections.iterate.match_1' does not depend on any axioms\n'LexLeanCollections.iterateUntil' does not depend on any axioms\n'LexLeanCollections.iterateUntil._f' does not depend on any axioms\n'LexLeanCollections.iterateUntil._sunfold' does not depend on any axioms\n'LexLeanCollections.iterateUntil._unsafe_rec' does not depend on any axioms\n'LexLeanCollections.iterateUntil.match_1' does not depend on any axioms\n'LexLeanCollections.lessThan' depends on axioms: [propext]\n'LexLeanCollections.lessThan._sparseCasesOn_1' depends on axioms: [propext]\n'LexLeanCollections.lessThan.match_1' depends on axioms: [propext]\n'LexLeanCollections.listFold' does not depend on any axioms\n'LexLeanCollections.lookupEntry' does not depend on any axioms\n'LexLeanCollections.lookupEntry._f' does not depend on any axioms\n'LexLeanCollections.lookupEntry._sunfold' does not depend on any axioms\n'LexLeanCollections.lookupEntry._unsafe_rec' does not depend on any axioms\n'LexLeanCollections.mapContains' does not depend on any axioms\n'LexLeanCollections.mapEntries' does not depend on any axioms\n'LexLeanCollections.mapFold' does not depend on any axioms\n'LexLeanCollections.mapInsert' does not depend on any axioms\n'LexLeanCollections.mapKeys' does not depend on any axioms\n'LexLeanCollections.mapLookup' does not depend on any axioms\n'LexLeanCollections.mapRemove' does not depend on any axioms\n'LexLeanCollections.mapSize' does not depend on any axioms\n'LexLeanCollections.mapValues' does not depend on any axioms\n'LexLeanCollections.reachableFrom' depends on axioms: [propext]\n'LexLeanCollections.reachableFrom._f' depends on axioms: [propext]\n'LexLeanCollections.reachableFrom._sparseCasesOn_1' depends on axioms: [propext]\n'LexLeanCollections.reachableFrom._sunfold' depends on axioms: [propext]\n'LexLeanCollections.reachableFrom._unsafe_rec' depends on axioms: [propext]\n'LexLeanCollections.reachableFrom.match_1' depends on axioms: [propext]\n'LexLeanCollections.reachableFrom.match_4' does not depend on any axioms\n'LexLeanCollections.removeElement' does not depend on any axioms\n'LexLeanCollections.removeElement._f' does not depend on any axioms\n'LexLeanCollections.removeElement._sunfold' does not depend on any axioms\n'LexLeanCollections.removeElement._unsafe_rec' does not depend on any axioms\n'LexLeanCollections.removeEntry' does not depend on any axioms\n'LexLeanCollections.removeEntry._f' does not depend on any axioms\n'LexLeanCollections.removeEntry._sunfold' does not depend on any axioms\n'LexLeanCollections.removeEntry._unsafe_rec' does not depend on any axioms\n'LexLeanCollections.setContains' does not depend on any axioms\n'LexLeanCollections.setDifference' does not depend on any axioms\n'LexLeanCollections.setElements' does not depend on any axioms\n'LexLeanCollections.setFold' does not depend on any axioms\n'LexLeanCollections.setInsert' does not depend on any axioms\n'LexLeanCollections.setIntersection' does not depend on any axioms\n'LexLeanCollections.setRemove' does not depend on any axioms\n'LexLeanCollections.setSize' does not depend on any axioms\n'LexLeanCollections.setUnion' does not depend on any axioms\n'LexLeanCollections.topological' does not depend on any axioms\n'LexLeanCollections.topological._f' does not depend on any axioms\n'LexLeanCollections.topological._sunfold' does not depend on any axioms\n'LexLeanCollections.topological._unsafe_rec' does not depend on any axioms\n","stdout_sha256":"b75acc0e99e23684c3cc876eacbfc93f47161cfee8a7440df17fa45f321c8c6a","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.LexLeanRuntime.Laws.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.LexLeanRuntime.Laws","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'LexLeanCollections.lessThan._sparseCasesOn_1.else_eq' depends on axioms: [propext]\n'LexLeanCollections.lessThan.eq_1' depends on axioms: [propext]\n'LexLeanCollections.listFold.eq_1' does not depend on any axioms\n'LexLeanLaws.append_list' does not depend on any axioms\n'LexLeanLaws.length_list' does not depend on any axioms\n'LexLeanLaws.lessThan_int' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.lessThan_int16' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.lessThan_int32' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.lessThan_int64' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.lessThan_int8' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.lessThan_nat' depends on axioms: [propext]\n'LexLeanLaws.lessThan_uint16' depends on axioms: [propext]\n'LexLeanLaws.lessThan_uint32' depends on axioms: [propext]\n'LexLeanLaws.lessThan_uint64' depends on axioms: [propext]\n'LexLeanLaws.lessThan_uint8' depends on axioms: [propext]\n'LexLeanLaws.listFold_add_int' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.listFold_add_int_self' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.listFold_add_nat' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.listFold_add_nat_self' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.listFold_append' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.listFold_cons' does not depend on any axioms\n'LexLeanLaws.listFold_extend' depends on axioms: [propext]\n'LexLeanLaws.listFold_fusion' does not depend on any axioms\n'LexLeanLaws.listFold_nil' does not depend on any axioms\n'LexLeanLaws.listFold_pair' does not depend on any axioms\n'LexLeanLaws.listFold_prepend' depends on axioms: [propext]\n'LexLeanLaws.listFold_sub_int' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.listFold_sub_int_self' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.mapEntries_self' does not depend on any axioms\n'LexLeanLaws.mapFold_listFold' does not depend on any axioms\n'LexLeanLaws.mapSize_length' does not depend on any axioms\n'LexLeanLaws.quotient_int' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.quotient_nat' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.remainder_int' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.remainder_nat' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.setElements_self' does not depend on any axioms\n'LexLeanLaws.setFold_listFold' does not depend on any axioms\n'LexLeanLaws.setSize_length' does not depend on any axioms\n'LexLeanLaws.sumInt' does not depend on any axioms\n'LexLeanLaws.sumInt._f' does not depend on any axioms\n'LexLeanLaws.sumInt._sunfold' does not depend on any axioms\n'LexLeanLaws.sumInt._unsafe_rec' does not depend on any axioms\n'LexLeanLaws.sumInt.eq_1' does not depend on any axioms\n'LexLeanLaws.sumInt.eq_2' does not depend on any axioms\n'LexLeanLaws.sumInt.eq_def' does not depend on any axioms\n'LexLeanLaws.sumInt_add' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumInt_append' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumInt_cons' does not depend on any axioms\n'LexLeanLaws.sumInt_const' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumInt_mul' depends on axioms: [propext]\n'LexLeanLaws.sumInt_mul_right' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumInt_mul_self' depends on axioms: [propext]\n'LexLeanLaws.sumInt_neg' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumInt_neg_self' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumInt_nil' does not depend on any axioms\n'LexLeanLaws.sumInt_perm' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumInt_reverse' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumInt_sub' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumNat' does not depend on any axioms\n'LexLeanLaws.sumNat._f' does not depend on any axioms\n'LexLeanLaws.sumNat._sunfold' does not depend on any axioms\n'LexLeanLaws.sumNat._unsafe_rec' does not depend on any axioms\n'LexLeanLaws.sumNat.eq_1' does not depend on any axioms\n'LexLeanLaws.sumNat.eq_2' does not depend on any axioms\n'LexLeanLaws.sumNat.eq_def' does not depend on any axioms\n'LexLeanLaws.sumNat.match_1' does not depend on any axioms\n'LexLeanLaws.sumNat_add' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumNat_append' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumNat_cons' does not depend on any axioms\n'LexLeanLaws.sumNat_const' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumNat_mul' does not depend on any axioms\n'LexLeanLaws.sumNat_mul_right' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumNat_mul_self' does not depend on any axioms\n'LexLeanLaws.sumNat_nil' does not depend on any axioms\n'LexLeanLaws.sumNat_perm' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.sumNat_reverse' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.tdiv_ediv' depends on axioms: [propext, Quot.sound]\n'LexLeanLaws.tmod_emod' depends on axioms: [propext, Quot.sound]\n'LexLeanRuntime.quotient.eq_1' does not depend on any axioms\n'LexLeanRuntime.remainder.eq_1' does not depend on any axioms\n","stdout_sha256":"a4ba2d39c9cdfd5e40c41c5ccf4726d937fd192fc042b74bb56cc0651e28919e","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.LexLeanRuntime.Portable.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.LexLeanRuntime.Portable","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'LexLeanRuntime.Appendable' does not depend on any axioms\n'LexLeanRuntime.Appendable.append' does not depend on any axioms\n'LexLeanRuntime.Appendable.casesOn' does not depend on any axioms\n'LexLeanRuntime.Appendable.ctorIdx' does not depend on any axioms\n'LexLeanRuntime.Appendable.mk._flat_ctor' does not depend on any axioms\n'LexLeanRuntime.Appendable.mk.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Appendable.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Appendable.noConfusionType' does not depend on any axioms\n'LexLeanRuntime.Appendable.recOn' does not depend on any axioms\n'LexLeanRuntime.Decimal' does not depend on any axioms\n'LexLeanRuntime.Decimal.casesOn' does not depend on any axioms\n'LexLeanRuntime.Decimal.ctorIdx' does not depend on any axioms\n'LexLeanRuntime.Decimal.format' does not depend on any axioms\n'LexLeanRuntime.Decimal.mk._flat_ctor' does not depend on any axioms\n'LexLeanRuntime.Decimal.mk.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Decimal.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Decimal.noConfusionType' does not depend on any axioms\n'LexLeanRuntime.Decimal.parse' does not depend on any axioms\n'LexLeanRuntime.Decimal.recOn' does not depend on any axioms\n'LexLeanRuntime.Fixed' does not depend on any axioms\n'LexLeanRuntime.Fixed.bitAnd' does not depend on any axioms\n'LexLeanRuntime.Fixed.bitNot' does not depend on any axioms\n'LexLeanRuntime.Fixed.bitOr' does not depend on any axioms\n'LexLeanRuntime.Fixed.bitXor' does not depend on any axioms\n'LexLeanRuntime.Fixed.casesOn' does not depend on any axioms\n'LexLeanRuntime.Fixed.ctorIdx' does not depend on any axioms\n'LexLeanRuntime.Fixed.fromInt' does not depend on any axioms\n'LexLeanRuntime.Fixed.maximum' does not depend on any axioms\n'LexLeanRuntime.Fixed.minimum' does not depend on any axioms\n'LexLeanRuntime.Fixed.mk._flat_ctor' does not depend on any axioms\n'LexLeanRuntime.Fixed.mk.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Fixed.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Fixed.noConfusionType' does not depend on any axioms\n'LexLeanRuntime.Fixed.recOn' does not depend on any axioms\n'LexLeanRuntime.Fixed.shiftLeft' does not depend on any axioms\n'LexLeanRuntime.Fixed.shiftRight' does not depend on any axioms\n'LexLeanRuntime.Fixed.toToMathInt' does not depend on any axioms\n'LexLeanRuntime.Indexable' does not depend on any axioms\n'LexLeanRuntime.Indexable.casesOn' does not depend on any axioms\n'LexLeanRuntime.Indexable.ctorIdx' does not depend on any axioms\n'LexLeanRuntime.Indexable.index' does not depend on any axioms\n'LexLeanRuntime.Indexable.mk._flat_ctor' does not depend on any axioms\n'LexLeanRuntime.Indexable.mk.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Indexable.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Indexable.noConfusionType' does not depend on any axioms\n'LexLeanRuntime.Indexable.recOn' does not depend on any axioms\n'LexLeanRuntime.Lengthable' does not depend on any axioms\n'LexLeanRuntime.Lengthable.casesOn' does not depend on any axioms\n'LexLeanRuntime.Lengthable.ctorIdx' does not depend on any axioms\n'LexLeanRuntime.Lengthable.length' does not depend on any axioms\n'LexLeanRuntime.Lengthable.mk._flat_ctor' does not depend on any axioms\n'LexLeanRuntime.Lengthable.mk.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Lengthable.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Lengthable.noConfusionType' does not depend on any axioms\n'LexLeanRuntime.Lengthable.recOn' does not depend on any axioms\n'LexLeanRuntime.Quotient' does not depend on any axioms\n'LexLeanRuntime.Quotient.casesOn' does not depend on any axioms\n'LexLeanRuntime.Quotient.ctorIdx' does not depend on any axioms\n'LexLeanRuntime.Quotient.isZero' does not depend on any axioms\n'LexLeanRuntime.Quotient.mk._flat_ctor' does not depend on any axioms\n'LexLeanRuntime.Quotient.mk.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Quotient.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Quotient.noConfusionType' does not depend on any axioms\n'LexLeanRuntime.Quotient.quotient' does not depend on any axioms\n'LexLeanRuntime.Quotient.recOn' does not depend on any axioms\n'LexLeanRuntime.Quotient.remainder' does not depend on any axioms\n'LexLeanRuntime.Sliceable' does not depend on any axioms\n'LexLeanRuntime.Sliceable.casesOn' does not depend on any axioms\n'LexLeanRuntime.Sliceable.ctorIdx' does not depend on any axioms\n'LexLeanRuntime.Sliceable.mk._flat_ctor' does not depend on any axioms\n'LexLeanRuntime.Sliceable.mk.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Sliceable.noConfusion' does not depend on any axioms\n'LexLeanRuntime.Sliceable.noConfusionType' does not depend on any axioms\n'LexLeanRuntime.Sliceable.recOn' does not depend on any axioms\n'LexLeanRuntime.Sliceable.slice' does not depend on any axioms\n'LexLeanRuntime.ToMathInt' does not depend on any axioms\n'LexLeanRuntime.ToMathInt.casesOn' does not depend on any axioms\n'LexLeanRuntime.ToMathInt.ctorIdx' does not depend on any axioms\n'LexLeanRuntime.ToMathInt.mk._flat_ctor' does not depend on any axioms\n'LexLeanRuntime.ToMathInt.mk.noConfusion' does not depend on any axioms\n'LexLeanRuntime.ToMathInt.noConfusion' does not depend on any axioms\n'LexLeanRuntime.ToMathInt.noConfusionType' does not depend on any axioms\n'LexLeanRuntime.ToMathInt.recOn' does not depend on any axioms\n'LexLeanRuntime.ToMathInt.toInt' does not depend on any axioms\n'LexLeanRuntime.append' does not depend on any axioms\n'LexLeanRuntime.bitAnd' does not depend on any axioms\n'LexLeanRuntime.bitNot' does not depend on any axioms\n'LexLeanRuntime.bitOr' does not depend on any axioms\n'LexLeanRuntime.bitXor' does not depend on any axioms\n'LexLeanRuntime.checkedAdd' does not depend on any axioms\n'LexLeanRuntime.checkedAddInt64' does not depend on any axioms\n'LexLeanRuntime.checkedConvert' does not depend on any axioms\n'LexLeanRuntime.checkedFromInt' does not depend on any axioms\n'LexLeanRuntime.checkedMultiply' does not depend on any axioms\n'LexLeanRuntime.checkedMultiplyInt64' does not depend on any axioms\n'LexLeanRuntime.checkedMultiplyInt64.match_1' does not depend on any axioms\n'LexLeanRuntime.checkedNegate' does not depend on any axioms\n'LexLeanRuntime.checkedNegateInt64' does not depend on any axioms\n'LexLeanRuntime.checkedQuotient' does not depend on any axioms\n'LexLeanRuntime.checkedQuotientInt64' does not depend on any axioms\n'LexLeanRuntime.checkedSubtract' does not depend on any axioms\n'LexLeanRuntime.checkedSubtractInt64' does not depend on any axioms\n'LexLeanRuntime.compareBytes' depends on axioms: [propext]\n'LexLeanRuntime.divideMagnitudeInt64' does not depend on any axioms\n'LexLeanRuntime.divideMagnitudeInt64._f' does not depend on any axioms\n'LexLeanRuntime.divideMagnitudeInt64._sunfold' does not depend on any axioms\n'LexLeanRuntime.divideMagnitudeInt64._unsafe_rec' does not depend on any axioms\n'LexLeanRuntime.divideMagnitudeInt64.match_1' does not depend on any axioms\n'LexLeanRuntime.equal' does not depend on any axioms\n'LexLeanRuntime.formatDecimal' does not depend on any axioms\n'LexLeanRuntime.index' does not depend on any axioms\n'LexLeanRuntime.instAppendableByteArray' does not depend on any axioms\n'LexLeanRuntime.instAppendableList' does not depend on any axioms\n'LexLeanRuntime.instDecimalInt' depends on axioms: [propext, Classical.choice, Quot.sound]\n'LexLeanRuntime.instDecimalInt.match_1' does not depend on any axioms\n'LexLeanRuntime.instDecimalOfFixedOfToString' depends on axioms: [propext, Classical.choice, Quot.sound]\n'LexLeanRuntime.instFixedInt16' depends on axioms: [propext, Quot.sound]\n'LexLeanRuntime.instFixedInt32' depends on axioms: [propext, Quot.sound]\n'LexLeanRuntime.instFixedInt64' depends on axioms: [propext, Quot.sound]\n'LexLeanRuntime.instFixedInt8' depends on axioms: [propext, Quot.sound]\n'LexLeanRuntime.instFixedUInt16' depends on axioms: [propext, Quot.sound]\n'LexLeanRuntime.instFixedUInt32' depends on axioms: [propext, Quot.sound]\n'LexLeanRuntime.instFixedUInt64' depends on axioms: [propext, Quot.sound]\n'LexLeanRuntime.instFixedUInt8' depends on axioms: [propext, Quot.sound]\n'LexLeanRuntime.instIndexableByteArrayUInt8' does not depend on any axioms\n'LexLeanRuntime.instIndexableList' does not depend on any axioms\n'LexLeanRuntime.instLengthableByteArray' does not depend on any axioms\n'LexLeanRuntime.instLengthableList' does not depend on any axioms\n'LexLeanRuntime.instLengthableString' depends on axioms: [propext, Classical.choice, Quot.sound]\n'LexLeanRuntime.instQuotientInt' does not depend on any axioms\n'LexLeanRuntime.instQuotientNat' does not depend on any axioms\n'LexLeanRuntime.instSliceableByteArray' does not depend on any axioms\n'LexLeanRuntime.instSliceableList' does not depend on any axioms\n'LexLeanRuntime.instToMathIntInt' does not depend on any axioms\n'LexLeanRuntime.join' depends on axioms: [propext]\n'LexLeanRuntime.length' does not depend on any axioms\n'LexLeanRuntime.listIndex' does not depend on any axioms\n'LexLeanRuntime.listIndex._f' does not depend on any axioms\n'LexLeanRuntime.listIndex._sunfold' does not depend on any axioms\n'LexLeanRuntime.listIndex._unsafe_rec' does not depend on any axioms\n'LexLeanRuntime.listIndex.match_1' does not depend on any axioms\n'LexLeanRuntime.magnitudeInt64' does not depend on any axioms\n'LexLeanRuntime.multiply' does not depend on any axioms\n'LexLeanRuntime.multiplyMagnitudeInt64' does not depend on any axioms\n'LexLeanRuntime.multiplyMagnitudeInt64._f' does not depend on any axioms\n'LexLeanRuntime.multiplyMagnitudeInt64._sunfold' does not depend on any axioms\n'LexLeanRuntime.multiplyMagnitudeInt64._unsafe_rec' does not depend on any axioms\n'LexLeanRuntime.multiplyMagnitudeInt64.match_1' does not depend on any axioms\n'LexLeanRuntime.negate' does not depend on any axioms\n'LexLeanRuntime.parseDecimal' does not depend on any axioms\n'LexLeanRuntime.quotient' does not depend on any axioms\n'LexLeanRuntime.remainder' does not depend on any axioms\n'LexLeanRuntime.shiftLeft' does not depend on any axioms\n'LexLeanRuntime.shiftRight' does not depend on any axioms\n'LexLeanRuntime.signedMagnitudeInt64' does not depend on any axioms\n'LexLeanRuntime.slice' does not depend on any axioms\n'LexLeanRuntime.splitExact' depends on axioms: [propext, Classical.choice, Quot.sound]\n'LexLeanRuntime.subtract' does not depend on any axioms\n'LexLeanRuntime.utf8Decode' depends on axioms: [propext, Classical.choice, Quot.sound]\n'LexLeanRuntime.utf8Encode' does not depend on any axioms\n","stdout_sha256":"73fea1d9e9e9f0a2f1363b9f284eeeb9e434430e9fa910260b9526bad864641e","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Foundation.Arch.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Foundation.Arch","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Foundation.Arch.Component' does not depend on any axioms\n'StitchModel.Foundation.Arch.ComponentKind' does not depend on any axioms\n'StitchModel.Foundation.Arch.Concern' does not depend on any axioms\n'StitchModel.Foundation.Arch.Edge' does not depend on any axioms\n'StitchModel.Foundation.Arch.EdgeKind' does not depend on any axioms\n'StitchModel.Foundation.Arch.ModelKind' does not depend on any axioms\n'StitchModel.Foundation.Arch.Stakeholder' does not depend on any axioms\n'StitchModel.Foundation.Arch.StandardReference' does not depend on any axioms\n'StitchModel.Foundation.Arch.View' does not depend on any axioms\n'StitchModel.Foundation.Arch.Viewpoint' does not depend on any axioms\n","stdout_sha256":"d79996d03404fb03e5e28dbe1b3f45ddb53db82c0b979552da5b1b758c29247c","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Foundation.Bytes.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Foundation.Bytes","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Foundation.Bytes.BoundedBuffer' does not depend on any axioms\n'StitchModel.Foundation.Bytes.BufferError' does not depend on any axioms\n'StitchModel.Foundation.Bytes.ByteOrder' does not depend on any axioms\n'StitchModel.Foundation.Bytes.appendBytes' does not depend on any axioms\n'StitchModel.Foundation.Bytes.byteAt' does not depend on any axioms\n'StitchModel.Foundation.Bytes.byteLength' does not depend on any axioms\n'StitchModel.Foundation.Bytes.compareBytes' depends on axioms: [propext]\n'StitchModel.Foundation.Bytes.sliceBytes' does not depend on any axioms\n","stdout_sha256":"8c0ca489be52ea02191bcf6c91e33dd49f6148493d01c91f52e7ad73272f96ff","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Foundation.View.Text.V1.Model.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Foundation.View.Text.V1.Model","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Foundation.View.Text.V1.Model.AcceptanceVector' does not depend on any axioms\n'StitchModel.Foundation.View.Text.V1.Model.TextApplication' does not depend on any axioms\n'StitchModel.Foundation.View.Text.V1.Model.TextView' does not depend on any axioms\n'StitchModel.Foundation.View.Text.V1.Model.textApplicationProfile' does not depend on any axioms\n","stdout_sha256":"78d0d2c2c59344b97e31d8d878c58e7f2857e8d2071aeef5f65c101772f24d22","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Product.Architecture.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Product.Architecture","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Product.Architecture.admission' does not depend on any axioms\n'StitchModel.Product.Architecture.browser' does not depend on any axioms\n'StitchModel.Product.Architecture.browserAdmission' does not depend on any axioms\n'StitchModel.Product.Architecture.browserCompute' does not depend on any axioms\n'StitchModel.Product.Architecture.browserDiscovery' does not depend on any axioms\n'StitchModel.Product.Architecture.browserScheduler' does not depend on any axioms\n'StitchModel.Product.Architecture.browserStorage' does not depend on any axioms\n'StitchModel.Product.Architecture.browserTransport' does not depend on any axioms\n'StitchModel.Product.Architecture.browserVm' does not depend on any axioms\n'StitchModel.Product.Architecture.compute' does not depend on any axioms\n'StitchModel.Product.Architecture.computeAdmission' does not depend on any axioms\n'StitchModel.Product.Architecture.computeIdentity' does not depend on any axioms\n'StitchModel.Product.Architecture.computeStorage' does not depend on any axioms\n'StitchModel.Product.Architecture.computeTransport' does not depend on any axioms\n'StitchModel.Product.Architecture.cryptography' does not depend on any axioms\n'StitchModel.Product.Architecture.discovery' does not depend on any axioms\n'StitchModel.Product.Architecture.discoveryAdmission' does not depend on any axioms\n'StitchModel.Product.Architecture.discoveryAuthority' does not depend on any axioms\n'StitchModel.Product.Architecture.discoveryHost' does not depend on any axioms\n'StitchModel.Product.Architecture.identity' does not depend on any axioms\n'StitchModel.Product.Architecture.identityCryptography' does not depend on any axioms\n'StitchModel.Product.Architecture.legacy' does not depend on any axioms\n'StitchModel.Product.Architecture.nativeRouting' does not depend on any axioms\n'StitchModel.Product.Architecture.operator' does not depend on any axioms\n'StitchModel.Product.Architecture.peers' does not depend on any axioms\n'StitchModel.Product.Architecture.pointerAuthority' does not depend on any axioms\n'StitchModel.Product.Architecture.productView' does not depend on any axioms\n'StitchModel.Product.Architecture.productViewpoint' does not depend on any axioms\n'StitchModel.Product.Architecture.publicRelay' does not depend on any axioms\n'StitchModel.Product.Architecture.recoverability' does not depend on any axioms\n'StitchModel.Product.Architecture.relayTransport' does not depend on any axioms\n'StitchModel.Product.Architecture.runtimeHost' does not depend on any axioms\n'StitchModel.Product.Architecture.scheduler' does not depend on any axioms\n'StitchModel.Product.Architecture.schedulerAdmission' does not depend on any axioms\n'StitchModel.Product.Architecture.schedulerTransport' does not depend on any axioms\n'StitchModel.Product.Architecture.signaling' does not depend on any axioms\n'StitchModel.Product.Architecture.signalingTransport' does not depend on any axioms\n'StitchModel.Product.Architecture.staticBrowser' does not depend on any axioms\n'StitchModel.Product.Architecture.staticHost' does not depend on any axioms\n'StitchModel.Product.Architecture.staticVm' does not depend on any axioms\n'StitchModel.Product.Architecture.storage' does not depend on any axioms\n'StitchModel.Product.Architecture.storageAdmission' does not depend on any axioms\n'StitchModel.Product.Architecture.storageIdentity' does not depend on any axioms\n'StitchModel.Product.Architecture.storagePeers' does not depend on any axioms\n'StitchModel.Product.Architecture.storageTransport' does not depend on any axioms\n'StitchModel.Product.Architecture.transport' does not depend on any axioms\n'StitchModel.Product.Architecture.transportAdmission' does not depend on any axioms\n'StitchModel.Product.Architecture.transportPeers' does not depend on any axioms\n'StitchModel.Product.Architecture.transportSignaling' does not depend on any axioms\n'StitchModel.Product.Architecture.transportVm' does not depend on any axioms\n'StitchModel.Product.Architecture.vm' does not depend on any axioms\n'StitchModel.Product.Architecture.vmStorage' does not depend on any axioms\n'StitchModel.Product.Architecture.vmTransport' does not depend on any axioms\n","stdout_sha256":"bcdecf3894e5fa39a2ed2ccc7eadeceab8855bb09062e8f2cf71fe1068319deb","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Product.Experience.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Product.Experience","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Product.Experience.Action' does not depend on any axioms\n'StitchModel.Product.Experience.EvidenceStyle' does not depend on any axioms\n'StitchModel.Product.Experience.Facts' does not depend on any axioms\n'StitchModel.Product.Experience.Journey' does not depend on any axioms\n'StitchModel.Product.Experience.View' does not depend on any axioms\n'StitchModel.Product.Experience.actionAdmit' does not depend on any axioms\n'StitchModel.Product.Experience.actionAllowed' does not depend on any axioms\n'StitchModel.Product.Experience.actionBoot' does not depend on any axioms\n'StitchModel.Product.Experience.actionClear' does not depend on any axioms\n'StitchModel.Product.Experience.actionExecute' does not depend on any axioms\n'StitchModel.Product.Experience.actionExport' does not depend on any axioms\n'StitchModel.Product.Experience.actionJoin' does not depend on any axioms\n'StitchModel.Product.Experience.actionLoadPublication' does not depend on any axioms\n'StitchModel.Product.Experience.actionPin' does not depend on any axioms\n'StitchModel.Product.Experience.actionPlacementRepair' does not depend on any axioms\n'StitchModel.Product.Experience.actionPublish' does not depend on any axioms\n'StitchModel.Product.Experience.actionReconcile' does not depend on any axioms\n'StitchModel.Product.Experience.actionRecover' does not depend on any axioms\n'StitchModel.Product.Experience.actionRecoveryDownload' does not depend on any axioms\n'StitchModel.Product.Experience.actionRecoveryExport' does not depend on any axioms\n'StitchModel.Product.Experience.actionRecoveryFinish' does not depend on any axioms\n'StitchModel.Product.Experience.actionRecoveryImport' does not depend on any axioms\n'StitchModel.Product.Experience.actionRecoveryRestore' does not depend on any axioms\n'StitchModel.Product.Experience.actionRecoverySave' does not depend on any axioms\n'StitchModel.Product.Experience.actionRecoveryTrust' does not depend on any axioms\n'StitchModel.Product.Experience.actionRenew' does not depend on any axioms\n'StitchModel.Product.Experience.actionResume' does not depend on any axioms\n'StitchModel.Product.Experience.actionSaveAuthority' does not depend on any axioms\n'StitchModel.Product.Experience.actionSrv' does not depend on any axioms\n'StitchModel.Product.Experience.actionStart' does not depend on any axioms\n'StitchModel.Product.Experience.actionStore' does not depend on any axioms\n'StitchModel.Product.Experience.actionTxt' does not depend on any axioms\n'StitchModel.Product.Experience.actionVmCancel' does not depend on any axioms\n'StitchModel.Product.Experience.actionVmDestroy' does not depend on any axioms\n'StitchModel.Product.Experience.actionVmForget' does not depend on any axioms\n'StitchModel.Product.Experience.actionVmReconcile' does not depend on any axioms\n'StitchModel.Product.Experience.actionVmStop' does not depend on any axioms\n'StitchModel.Product.Experience.actions' does not depend on any axioms\n'StitchModel.Product.Experience.admissionInputVisible' does not depend on any axioms\n'StitchModel.Product.Experience.blockedPolicyCannotRepair' does not depend on any axioms\n'StitchModel.Product.Experience.budgetBlockNeverPermitsPublication' does not depend on any axioms\n'StitchModel.Product.Experience.computeDone' does not depend on any axioms\n'StitchModel.Product.Experience.computeEmpty' does not depend on any axioms\n'StitchModel.Product.Experience.computeReplay' does not depend on any axioms\n'StitchModel.Product.Experience.computeUnverified' does not depend on any axioms\n'StitchModel.Product.Experience.computeView' does not depend on any axioms\n'StitchModel.Product.Experience.disclosureLabel' does not depend on any axioms\n'StitchModel.Product.Experience.evidenceStyles' does not depend on any axioms\n'StitchModel.Product.Experience.executionAllowed' does not depend on any axioms\n'StitchModel.Product.Experience.executionLabel' does not depend on any axioms\n'StitchModel.Product.Experience.explanationInitiallyOpen' does not depend on any axioms\n'StitchModel.Product.Experience.explanationLabel' does not depend on any axioms\n'StitchModel.Product.Experience.focusNavigationTarget' does not depend on any axioms\n'StitchModel.Product.Experience.initialFacts' does not depend on any axioms\n'StitchModel.Product.Experience.initialMeshCannotJoinWithoutDisclosure' does not depend on any axioms\n'StitchModel.Product.Experience.initialPolicyCanBeExported' does not depend on any axioms\n'StitchModel.Product.Experience.initialVmCannotExecute' does not depend on any axioms\n'StitchModel.Product.Experience.integrityLabel' does not depend on any axioms\n'StitchModel.Product.Experience.joinAllowed' does not depend on any axioms\n'StitchModel.Product.Experience.journeyCompute' does not depend on any axioms\n'StitchModel.Product.Experience.journeyMesh' does not depend on any axioms\n'StitchModel.Product.Experience.journeyObjects' does not depend on any axioms\n'StitchModel.Product.Experience.journeyPointers' does not depend on any axioms\n'StitchModel.Product.Experience.journeyResources' does not depend on any axioms\n'StitchModel.Product.Experience.journeyVisible' does not depend on any axioms\n'StitchModel.Product.Experience.journeyVm' does not depend on any axioms\n'StitchModel.Product.Experience.journeys' does not depend on any axioms\n'StitchModel.Product.Experience.knownPublicationNeverOffersReconciliation' does not depend on any axioms\n'StitchModel.Product.Experience.meshConnected' does not depend on any axioms\n'StitchModel.Product.Experience.meshDisclosure' does not depend on any axioms\n'StitchModel.Product.Experience.meshReady' does not depend on any axioms\n'StitchModel.Product.Experience.meshSearching' does not depend on any axioms\n'StitchModel.Product.Experience.meshView' does not depend on any axioms\n'StitchModel.Product.Experience.navigationLabel' does not depend on any axioms\n'StitchModel.Product.Experience.navigationScrollBehavior' does not depend on any axioms\n'StitchModel.Product.Experience.objectsEmpty' does not depend on any axioms\n'StitchModel.Product.Experience.objectsLocal' does not depend on any axioms\n'StitchModel.Product.Experience.objectsPartial' does not depend on any axioms\n'StitchModel.Product.Experience.objectsPlaced' does not depend on any axioms\n'StitchModel.Product.Experience.objectsView' does not depend on any axioms\n'StitchModel.Product.Experience.placementRepairAllowed' does not depend on any axioms\n'StitchModel.Product.Experience.pointerLocal' does not depend on any axioms\n'StitchModel.Product.Experience.pointerPending' does not depend on any axioms\n'StitchModel.Product.Experience.pointerPinned' does not depend on any axioms\n'StitchModel.Product.Experience.pointerPublished' does not depend on any axioms\n'StitchModel.Product.Experience.pointerUnknown' does not depend on any axioms\n'StitchModel.Product.Experience.pointerUnpinned' does not depend on any axioms\n'StitchModel.Product.Experience.pointersView' does not depend on any axioms\n'StitchModel.Product.Experience.productTitle' does not depend on any axioms\n'StitchModel.Product.Experience.provenanceLabel' does not depend on any axioms\n'StitchModel.Product.Experience.publicationAllowed' does not depend on any axioms\n'StitchModel.Product.Experience.publicationSetupInitiallyOpen' does not depend on any axioms\n'StitchModel.Product.Experience.publicationSetupVisible' does not depend on any axioms\n'StitchModel.Product.Experience.reconciliationAllowed' does not depend on any axioms\n'StitchModel.Product.Experience.recoveryChecked' does not depend on any axioms\n'StitchModel.Product.Experience.recoveryChecking' does not depend on any axioms\n'StitchModel.Product.Experience.recoveryEmpty' does not depend on any axioms\n'StitchModel.Product.Experience.recoveryPolicyLabel' does not depend on any axioms\n'StitchModel.Product.Experience.recoveryPolicyVisible' does not depend on any axioms\n'StitchModel.Product.Experience.recoveryRestored' does not depend on any axioms\n'StitchModel.Product.Experience.recoveryTrusted' does not depend on any axioms\n'StitchModel.Product.Experience.recoveryView' does not depend on any axioms\n'StitchModel.Product.Experience.relayLabel' does not depend on any axioms\n'StitchModel.Product.Experience.resourcesActive' does not depend on any axioms\n'StitchModel.Product.Experience.resourcesBlocked' does not depend on any axioms\n'StitchModel.Product.Experience.resourcesView' does not depend on any axioms\n'StitchModel.Product.Experience.statusLivePolicy' does not depend on any axioms\n'StitchModel.Product.Experience.undisclosedNeverPermitsJoin' does not depend on any axioms\n'StitchModel.Product.Experience.unknownNeverPermitsPublication' does not depend on any axioms\n'StitchModel.Product.Experience.unknownPublicationDoesNotPermitNewCandidate' does not depend on any axioms\n'StitchModel.Product.Experience.unknownPublicationFacts' does not depend on any axioms\n'StitchModel.Product.Experience.unknownPublicationIsVisible' does not depend on any axioms\n'StitchModel.Product.Experience.unknownPublicationOffersReconciliation' does not depend on any axioms\n'StitchModel.Product.Experience.unreadyNeverPermitsGuestExecution' does not depend on any axioms\n'StitchModel.Product.Experience.unselectedObjectCannotRepair' does not depend on any axioms\n'StitchModel.Product.Experience.viewStyle' does not depend on any axioms\n'StitchModel.Product.Experience.vmBooting' does not depend on any axioms\n'StitchModel.Product.Experience.vmCommandVisible' does not depend on any axioms\n'StitchModel.Product.Experience.vmDestroyed' does not depend on any axioms\n'StitchModel.Product.Experience.vmFailed' does not depend on any axioms\n'StitchModel.Product.Experience.vmIdle' does not depend on any axioms\n'StitchModel.Product.Experience.vmQuarantined' does not depend on any axioms\n'StitchModel.Product.Experience.vmReady' does not depend on any axioms\n'StitchModel.Product.Experience.vmStopped' does not depend on any axioms\n'StitchModel.Product.Experience.vmTerminationPending' does not depend on any axioms\n'StitchModel.Product.Experience.vmView' does not depend on any axioms\n","stdout_sha256":"e63753856bd3d458986e69085edcb7ae7b3560a8f86644a2ebb11071e3dc52e9","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Product.Host.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Product.Host","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Product.Host.Capability' does not depend on any axioms\n'StitchModel.Product.Host.Effect' does not depend on any axioms\n'StitchModel.Product.Host.Grant' does not depend on any axioms\n'StitchModel.Product.Host.Observation' does not depend on any axioms\n'StitchModel.Product.Host.Outcome' does not depend on any axioms\n'StitchModel.Product.Host.Request' does not depend on any axioms\n'StitchModel.Product.Host.State' does not depend on any axioms\n'StitchModel.Product.Host.browserSupported' does not depend on any axioms\n'StitchModel.Product.Host.capabilityCode' does not depend on any axioms\n'StitchModel.Product.Host.finish' does not depend on any axioms\n'StitchModel.Product.Host.ledgerFilter' does not depend on any axioms\n'StitchModel.Product.Host.ledgerFilterSame' does not depend on any axioms\n'StitchModel.Product.Host.nativeRoutingRefused' does not depend on any axioms\n'StitchModel.Product.Host.observationCandidate' does not depend on any axioms\n'StitchModel.Product.Host.observationCannotRefundLedger' depends on axioms: [propext]\n'StitchModel.Product.Host.observationMatches' does not depend on any axioms\n'StitchModel.Product.Host.observe' does not depend on any axioms\n'StitchModel.Product.Host.outcomeCode' does not depend on any axioms\n'StitchModel.Product.Host.pendingMatches' does not depend on any axioms\n'StitchModel.Product.Host.positiveSessionFilterFact' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Product.Host.requestAllowed' does not depend on any axioms\n'StitchModel.Product.Host.requestDoesNotCreateObservation' does not depend on any axioms\n'StitchModel.Product.Host.requiresDisclosure' does not depend on any axioms\n'StitchModel.Product.Host.reserve' does not depend on any axioms\n'StitchModel.Product.Host.sessionFilter' does not depend on any axioms\n'StitchModel.Product.Host.sessionFilterLedger' does not depend on any axioms\n'StitchModel.Product.Host.sessionLessThanDifference' depends on axioms: [propext, Quot.sound]\n'StitchModel.Product.Host.staleSessionCannotComplete' depends on axioms: [propext, Classical.choice, Quot.sound]\n","stdout_sha256":"d24a06b47d4f3b226b11f23199cd808ca2035967f2b147fa93597bfccf65904f","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Product.Model.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Product.Model","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Product.Model.Asset' does not depend on any axioms\n'StitchModel.Product.Model.Assumption' does not depend on any axioms\n'StitchModel.Product.Model.CapabilityContract' does not depend on any axioms\n'StitchModel.Product.Model.Component' does not depend on any axioms\n'StitchModel.Product.Model.Dependency' does not depend on any axioms\n'StitchModel.Product.Model.Deployment' does not depend on any axioms\n'StitchModel.Product.Model.Model' does not depend on any axioms\n'StitchModel.Product.Model.assetAuthorityUi' does not depend on any axioms\n'StitchModel.Product.Model.assetBrowserAuthority' does not depend on any axioms\n'StitchModel.Product.Model.assetChannelFlow' does not depend on any axioms\n'StitchModel.Product.Model.assetDnsWire' does not depend on any axioms\n'StitchModel.Product.Model.assetFile0' does not depend on any axioms\n'StitchModel.Product.Model.assetFile1' does not depend on any axioms\n'StitchModel.Product.Model.assetFile10' does not depend on any axioms\n'StitchModel.Product.Model.assetFile11' does not depend on any axioms\n'StitchModel.Product.Model.assetFile12' does not depend on any axioms\n'StitchModel.Product.Model.assetFile13' does not depend on any axioms\n'StitchModel.Product.Model.assetFile14' does not depend on any axioms\n'StitchModel.Product.Model.assetFile15' does not depend on any axioms\n'StitchModel.Product.Model.assetFile16' does not depend on any axioms\n'StitchModel.Product.Model.assetFile17' does not depend on any axioms\n'StitchModel.Product.Model.assetFile2' does not depend on any axioms\n'StitchModel.Product.Model.assetFile3' does not depend on any axioms\n'StitchModel.Product.Model.assetFile4' does not depend on any axioms\n'StitchModel.Product.Model.assetFile5' does not depend on any axioms\n'StitchModel.Product.Model.assetFile6' does not depend on any axioms\n'StitchModel.Product.Model.assetFile7' does not depend on any axioms\n'StitchModel.Product.Model.assetFile8' does not depend on any axioms\n'StitchModel.Product.Model.assetFile9' does not depend on any axioms\n'StitchModel.Product.Model.assetIds' does not depend on any axioms\n'StitchModel.Product.Model.assetLifecycleEffects' does not depend on any axioms\n'StitchModel.Product.Model.assetProductExperience' does not depend on any axioms\n'StitchModel.Product.Model.assetRecovery' does not depend on any axioms\n'StitchModel.Product.Model.assetRecoveryUi' does not depend on any axioms\n'StitchModel.Product.Model.assetRelayFraming' does not depend on any axioms\n'StitchModel.Product.Model.assetRustConformance' does not depend on any axioms\n'StitchModel.Product.Model.assetSignaling' does not depend on any axioms\n'StitchModel.Product.Model.assetVmAdministration' does not depend on any axioms\n'StitchModel.Product.Model.assumptionArtifactConformance' does not depend on any axioms\n'StitchModel.Product.Model.assumptionBrowserSemantics' does not depend on any axioms\n'StitchModel.Product.Model.assumptionCryptographicSecurity' does not depend on any axioms\n'StitchModel.Product.Model.assumptionDisclosureConsent' does not depend on any axioms\n'StitchModel.Product.Model.assumptionFailureDomains' does not depend on any axioms\n'StitchModel.Product.Model.assumptionIds' does not depend on any axioms\n'StitchModel.Product.Model.assumptionNetworkAvailability' does not depend on any axioms\n'StitchModel.Product.Model.assumptionObserverAnchor' does not depend on any axioms\n'StitchModel.Product.Model.assumptionPeerAssertion' does not depend on any axioms\n'StitchModel.Product.Model.assumptionSerializedJournal' does not depend on any axioms\n'StitchModel.Product.Model.assumptionTimeSources' does not depend on any axioms\n'StitchModel.Product.Model.assumptionVmIsolation' does not depend on any axioms\n'StitchModel.Product.Model.capabilityArtifactFetch' does not depend on any axioms\n'StitchModel.Product.Model.capabilityContractIds' does not depend on any axioms\n'StitchModel.Product.Model.capabilityCrypto' does not depend on any axioms\n'StitchModel.Product.Model.capabilityDnsRead' does not depend on any axioms\n'StitchModel.Product.Model.capabilityDnsWrite' does not depend on any axioms\n'StitchModel.Product.Model.capabilityDom' does not depend on any axioms\n'StitchModel.Product.Model.capabilityLocalBroadcast' does not depend on any axioms\n'StitchModel.Product.Model.capabilityMonotonicClock' does not depend on any axioms\n'StitchModel.Product.Model.capabilityNativeRouting' does not depend on any axioms\n'StitchModel.Product.Model.capabilityOriginStorage' does not depend on any axioms\n'StitchModel.Product.Model.capabilityPeerChannel' does not depend on any axioms\n'StitchModel.Product.Model.capabilityPublicRelay' does not depend on any axioms\n'StitchModel.Product.Model.capabilityPublicSignaling' does not depend on any axioms\n'StitchModel.Product.Model.capabilitySessionStorage' does not depend on any axioms\n'StitchModel.Product.Model.capabilityVm' does not depend on any axioms\n'StitchModel.Product.Model.capabilityWallClock' does not depend on any axioms\n'StitchModel.Product.Model.capabilityWebLock' does not depend on any axioms\n'StitchModel.Product.Model.componentAdmission' does not depend on any axioms\n'StitchModel.Product.Model.componentAssetsClosed' does not depend on any axioms\n'StitchModel.Product.Model.componentBrowser' does not depend on any axioms\n'StitchModel.Product.Model.componentCompute' does not depend on any axioms\n'StitchModel.Product.Model.componentCryptography' does not depend on any axioms\n'StitchModel.Product.Model.componentDiscovery' does not depend on any axioms\n'StitchModel.Product.Model.componentIdentity' does not depend on any axioms\n'StitchModel.Product.Model.componentIds' does not depend on any axioms\n'StitchModel.Product.Model.componentLegacy' does not depend on any axioms\n'StitchModel.Product.Model.componentNativeRouting' does not depend on any axioms\n'StitchModel.Product.Model.componentPeers' does not depend on any axioms\n'StitchModel.Product.Model.componentPointerAuthority' does not depend on any axioms\n'StitchModel.Product.Model.componentPublicRelay' does not depend on any axioms\n'StitchModel.Product.Model.componentRuntimeHost' does not depend on any axioms\n'StitchModel.Product.Model.componentScheduler' does not depend on any axioms\n'StitchModel.Product.Model.componentSignaling' does not depend on any axioms\n'StitchModel.Product.Model.componentStaticHost' does not depend on any axioms\n'StitchModel.Product.Model.componentStorage' does not depend on any axioms\n'StitchModel.Product.Model.componentTransport' does not depend on any axioms\n'StitchModel.Product.Model.componentVm' does not depend on any axioms\n'StitchModel.Product.Model.contractsClosed' does not depend on any axioms\n'StitchModel.Product.Model.dependenciesClosed' does not depend on any axioms\n'StitchModel.Product.Model.dependencyBrowserApis' does not depend on any axioms\n'StitchModel.Product.Model.dependencyCloudflareDns' does not depend on any axioms\n'StitchModel.Product.Model.dependencyCloudflareStun' does not depend on any axioms\n'StitchModel.Product.Model.dependencyCloudflareWriter' does not depend on any axioms\n'StitchModel.Product.Model.dependencyGoogleStun' does not depend on any axioms\n'StitchModel.Product.Model.dependencyIds' does not depend on any axioms\n'StitchModel.Product.Model.dependencyNtfyRelay' does not depend on any axioms\n'StitchModel.Product.Model.dependencyNtfySignaling' does not depend on any axioms\n'StitchModel.Product.Model.dependencyPrismCode' does not depend on any axioms\n'StitchModel.Product.Model.dependencyPrismSdk' does not depend on any axioms\n'StitchModel.Product.Model.dependencyStaticOrigin' does not depend on any axioms\n'StitchModel.Product.Model.dependencyVmAssets' does not depend on any axioms\n'StitchModel.Product.Model.deploymentBrowserSession' does not depend on any axioms\n'StitchModel.Product.Model.deploymentIds' does not depend on any axioms\n'StitchModel.Product.Model.deploymentPureProbe' does not depend on any axioms\n'StitchModel.Product.Model.deploymentsClosed' does not depend on any axioms\n'StitchModel.Product.Model.member' does not depend on any axioms\n'StitchModel.Product.Model.members' does not depend on any axioms\n'StitchModel.Product.Model.product' does not depend on any axioms\n'StitchModel.Product.Model.productAssetsRedistributable' does not depend on any axioms\n'StitchModel.Product.Model.productGraphIsClosed' does not depend on any axioms\n'StitchModel.Product.Model.redistributionClosed' does not depend on any axioms\n'StitchModel.Product.Model.unique' does not depend on any axioms\n'StitchModel.Product.Model.valid' does not depend on any axioms\n'StitchModel.Product.Model.vendorDistributionMaterialsRecorded' does not depend on any axioms\n","stdout_sha256":"5f737cd828f6be074af17846a2ef1d515c66be60c0210acbc3f19c02cdafd258","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Authority.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Authority","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Authority.State' does not depend on any axioms\n'StitchModel.Stitch.Authority.anchorChronologyAllowed' does not depend on any axioms\n'StitchModel.Stitch.Authority.anchorSaveAllowed' does not depend on any axioms\n'StitchModel.Stitch.Authority.changedAnchorCannotMigrate' does not depend on any axioms\n'StitchModel.Stitch.Authority.controlAllowed' does not depend on any axioms\n'StitchModel.Stitch.Authority.journalRemovalAllowed' does not depend on any axioms\n'StitchModel.Stitch.Authority.maySign' does not depend on any axioms\n'StitchModel.Stitch.Authority.migrate' does not depend on any axioms\n'StitchModel.Stitch.Authority.migrationAllowed' does not depend on any axioms\n'StitchModel.Stitch.Authority.publicationAllowed' does not depend on any axioms\n'StitchModel.Stitch.Authority.retiredAuthorityCannotPublish' does not depend on any axioms\n'StitchModel.Stitch.Authority.revocationAllowed' does not depend on any axioms\n'StitchModel.Stitch.Authority.revocationBlocksSigning' does not depend on any axioms\n'StitchModel.Stitch.Authority.revoke' does not depend on any axioms\n'StitchModel.Stitch.Authority.rotate' does not depend on any axioms\n'StitchModel.Stitch.Authority.rotateCreatesNextGeneration' does not depend on any axioms\n'StitchModel.Stitch.Authority.rotationAllowed' does not depend on any axioms\n'StitchModel.Stitch.Authority.sameKeyRollbackRefused' does not depend on any axioms\n'StitchModel.Stitch.Authority.signingAllowed' does not depend on any axioms\n'StitchModel.Stitch.Authority.staleMigrationPreservesState' does not depend on any axioms\n'StitchModel.Stitch.Authority.uncertainJournalCannotBeRemoved' does not depend on any axioms\n'StitchModel.Stitch.Authority.unconfirmedRotationRefused' does not depend on any axioms\n","stdout_sha256":"ac9f5c2ff6d092dee2b9c3b0243db18f2791a4bf0d3bf667648ba3e84d05cc84","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Budget.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Budget","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Budget.Budget' does not depend on any axioms\n'StitchModel.Stitch.Budget.Ledger' does not depend on any axioms\n'StitchModel.Stitch.Budget.Reservation' does not depend on any axioms\n'StitchModel.Stitch.Budget.Resources' does not depend on any axioms\n'StitchModel.Stitch.Budget.Selection' does not depend on any axioms\n'StitchModel.Stitch.Budget.SettlementObservation' does not depend on any axioms\n'StitchModel.Stitch.Budget.SettlementOutcome' does not depend on any axioms\n'StitchModel.Stitch.Budget.addResources' does not depend on any axioms\n'StitchModel.Stitch.Budget.admitAction' does not depend on any axioms\n'StitchModel.Stitch.Budget.boolAndFalse' does not depend on any axioms\n'StitchModel.Stitch.Budget.boolFalseAnd' does not depend on any axioms\n'StitchModel.Stitch.Budget.boolImpliesTruth' does not depend on any axioms\n'StitchModel.Stitch.Budget.boolNotTrue' does not depend on any axioms\n'StitchModel.Stitch.Budget.budgetValid' does not depend on any axioms\n'StitchModel.Stitch.Budget.chargeComparisonObserved' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.chargeFourConjunctionFact' does not depend on any axioms\n'StitchModel.Stitch.Budget.chargedAt' does not depend on any axioms\n'StitchModel.Stitch.Budget.chooseBool' does not depend on any axioms\n'StitchModel.Stitch.Budget.chooseBoolFalse' does not depend on any axioms\n'StitchModel.Stitch.Budget.chooseBoolTrue' does not depend on any axioms\n'StitchModel.Stitch.Budget.chooseNat' does not depend on any axioms\n'StitchModel.Stitch.Budget.chooseNatFalse' does not depend on any axioms\n'StitchModel.Stitch.Budget.chooseNatTrue' does not depend on any axioms\n'StitchModel.Stitch.Budget.clockRollbackRefused' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Budget.headChargedAt' does not depend on any axioms\n'StitchModel.Stitch.Budget.ledgerBudget' does not depend on any axioms\n'StitchModel.Stitch.Budget.ledgerValid' does not depend on any axioms\n'StitchModel.Stitch.Budget.ledgerValiditySelect' does not depend on any axioms\n'StitchModel.Stitch.Budget.outcomeKnown' does not depend on any axioms\n'StitchModel.Stitch.Budget.recordSettlement' does not depend on any axioms\n'StitchModel.Stitch.Budget.recordSettlementFrom' does not depend on any axioms\n'StitchModel.Stitch.Budget.recordedIdCannotBeReservedAgain' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.reservationCandidate' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationCandidateClock' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationCandidateGuarantee' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.reservationCandidateListGuarantee' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.reservationCandidateNumericGuarantee' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.Budget.reservationConjunctionClosure' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationCostValid' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationEpochReflexive' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.reservationFreshCostValidity' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationLedgerClockSelect' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationLedgerParts' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.reservationListAdmissionFact' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationNumericValidity' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationPreservesLimit' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Budget.reservationSelectNat' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationSelectedClockFact' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.reservationSelectedSafety' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationTrueAnd' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationUnused' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationValidityOrder' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservationsValid' does not depend on any axioms\n'StitchModel.Stitch.Budget.reserveAction' does not depend on any axioms\n'StitchModel.Stitch.Budget.reserveAllowed' does not depend on any axioms\n'StitchModel.Stitch.Budget.reserveAmount' does not depend on any axioms\n'StitchModel.Stitch.Budget.reserveLedger' does not depend on any axioms\n'StitchModel.Stitch.Budget.reserveLedgerAllowed' does not depend on any axioms\n'StitchModel.Stitch.Budget.reserveLedgerClockFact' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.reserveLedgerPreservesValidity' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.reserveLedgerPreservesValidityFact' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.Budget.reservedAt' does not depend on any axioms\n'StitchModel.Stitch.Budget.reservedTotal' does not depend on any axioms\n'StitchModel.Stitch.Budget.resourceAt' does not depend on any axioms\n'StitchModel.Stitch.Budget.resourceAtBound' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Budget.resourceAtChargeConstraint' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.resourcesAtMost' does not depend on any axioms\n'StitchModel.Stitch.Budget.resourcesWithin' does not depend on any axioms\n'StitchModel.Stitch.Budget.sameResources' does not depend on any axioms\n'StitchModel.Stitch.Budget.scalarAccounting' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.scalarAccountingStep' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.scalarAdditionCancellation' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Budget.scalarAdditionMonotone' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.scalarBoolToBound' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.scalarBoundToBool' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.scalarChargeObservation' does not depend on any axioms\n'StitchModel.Stitch.Budget.scalarChargeRejected' does not depend on any axioms\n'StitchModel.Stitch.Budget.scalarChargeSafe' does not depend on any axioms\n'StitchModel.Stitch.Budget.scalarCheckAdditionCancellation' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Budget.scalarCheckComparisonCongruence' does not depend on any axioms\n'StitchModel.Stitch.Budget.scalarCheckReflected' does not depend on any axioms\n'StitchModel.Stitch.Budget.scalarConsChargeCheck' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Budget.scalarFreshChargeCheck' does not depend on any axioms\n'StitchModel.Stitch.Budget.scalarFreshChargeGate' does not depend on any axioms\n'StitchModel.Stitch.Budget.scalarSameConsequent' does not depend on any axioms\n'StitchModel.Stitch.Budget.scalarSettlementFact' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.scalarSettlementSafety' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.scalarStepChargeGuarantee' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.scalarStepChargeSafe' does not depend on any axioms\n'StitchModel.Stitch.Budget.scalarTrueConsequent' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.scalarTrueConsequentObserved' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.selectBool' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectBoolFromBool' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectBoolFromValue' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectBoth' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectLedger' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectNat' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectNatFromBool' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectRemaining' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectedAdmissionSafety' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectedRecordCeiling' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectedRecordCharge' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectedRecordChargeExpanded' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectedRecordCostValidity' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectedRecordEpoch' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectedRecordId' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectedSettlementRecord' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectionFromBool' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectionValue' does not depend on any axioms\n'StitchModel.Stitch.Budget.selectionValueFromBool' does not depend on any axioms\n'StitchModel.Stitch.Budget.settleLedger' does not depend on any axioms\n'StitchModel.Stitch.Budget.settleLedgerAllowed' does not depend on any axioms\n'StitchModel.Stitch.Budget.settleLedgerClockFact' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settleLedgerPreservesValidity' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.settleLedgerPreservesValidityFact' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.settleReserved' does not depend on any axioms\n'StitchModel.Stitch.Budget.settleSpent' does not depend on any axioms\n'StitchModel.Stitch.Budget.settledHeadCannotBeChargedAgain' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settledSelectionChargeStep' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementAllowed' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementCandidate' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementCandidateClock' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementCandidateGuarantee' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.settlementCandidateListBoolean' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settlementCandidateListGuarantee' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settlementCandidateNumericBoolean' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.settlementCandidateNumericGuarantee' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.Budget.settlementCandidateNumericTransferFact' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.Budget.settlementCannotIncreaseLedgerCharge' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.Budget.settlementCannotIncreaseLedgerChargeFact' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.Budget.settlementClockRollbackRefused' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Budget.settlementDoesNotIncreaseCharge' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Budget.settlementFromPreservesReservationValidity' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settlementFromPreservesUnusedIds' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settlementImplicationObserved' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementImplies' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementListDomainGate' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settlementListGateBooleanFact' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementListGateFact' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementNumericDomainGate' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settlementNumericGateBooleanFact' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementNumericGateFact' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementOldReservationsFact' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settlementPreservesReservationValidity' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settlementPreservesUnusedIds' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settlementRecorded' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementReservationValidityFact' depends on axioms: [propext]\n'StitchModel.Stitch.Budget.settlementValidityProjection' does not depend on any axioms\n'StitchModel.Stitch.Budget.settlementValidityStep' does not depend on any axioms\n'StitchModel.Stitch.Budget.spentAt' does not depend on any axioms\n'StitchModel.Stitch.Budget.spentTotal' does not depend on any axioms\n'StitchModel.Stitch.Budget.staleEpochCannotSettle' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Budget.unknownOutcomeRetainsLedger' does not depend on any axioms\n'StitchModel.Stitch.Budget.unknownSettlementRetainsReservation' does not depend on any axioms\n'StitchModel.Stitch.Budget.updateSettlementRecord' does not depend on any axioms\n'StitchModel.Stitch.Budget.vectorReservationPreservesBudget' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Budget.zeroResources' does not depend on any axioms\n","stdout_sha256":"2a7cf4c5ead0cc23678c85edfe882855bf746425124dae52af83c2c639ed1855","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.ChannelFlow.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.ChannelFlow","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.ChannelFlow.append' does not depend on any axioms\n'StitchModel.Stitch.ChannelFlow.appendAllowed' does not depend on any axioms\n'StitchModel.Stitch.ChannelFlow.queueAllowed' does not depend on any axioms\n'StitchModel.Stitch.ChannelFlow.sendAllowed' does not depend on any axioms\n'StitchModel.Stitch.ChannelFlow.staleCannotSend' does not depend on any axioms\n","stdout_sha256":"991b29e7df0b802696351d778e795fe61b2812a84102dfe42a8d77fdb49199a9","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Compute.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Compute","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Compute.Checkpoint' does not depend on any axioms\n'StitchModel.Stitch.Compute.CheckpointCommitments' does not depend on any axioms\n'StitchModel.Stitch.Compute.CheckpointDigestInput' does not depend on any axioms\n'StitchModel.Stitch.Compute.CheckpointDigestObservation' does not depend on any axioms\n'StitchModel.Stitch.Compute.InputDigestInput' does not depend on any axioms\n'StitchModel.Stitch.Compute.InputDigestObservation' does not depend on any axioms\n'StitchModel.Stitch.Compute.Instruction' does not depend on any axioms\n'StitchModel.Stitch.Compute.Job' does not depend on any axioms\n'StitchModel.Stitch.Compute.JobCommitments' does not depend on any axioms\n'StitchModel.Stitch.Compute.JobDigestInput' does not depend on any axioms\n'StitchModel.Stitch.Compute.JobDigestObservation' does not depend on any axioms\n'StitchModel.Stitch.Compute.Program' does not depend on any axioms\n'StitchModel.Stitch.Compute.ProgramDigestInput' does not depend on any axioms\n'StitchModel.Stitch.Compute.ProgramDigestObservation' does not depend on any axioms\n'StitchModel.Stitch.Compute.StateDigestInput' does not depend on any axioms\n'StitchModel.Stitch.Compute.StateDigestObservation' does not depend on any axioms\n'StitchModel.Stitch.Compute.TypedInstruction' does not depend on any axioms\n'StitchModel.Stitch.Compute.Word' does not depend on any axioms\n'StitchModel.Stitch.Compute.acceptedCheckpointIsSemanticReplay' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Compute.advanceCheckpoint' does not depend on any axioms\n'StitchModel.Stitch.Compute.appendProgram' does not depend on any axioms\n'StitchModel.Stitch.Compute.appendTypedProgram' does not depend on any axioms\n'StitchModel.Stitch.Compute.arithmeticWidth' does not depend on any axioms\n'StitchModel.Stitch.Compute.binaryLength' does not depend on any axioms\n'StitchModel.Stitch.Compute.binaryLengthAcc' does not depend on any axioms\n'StitchModel.Stitch.Compute.bitwiseAcc' does not depend on any axioms\n'StitchModel.Stitch.Compute.byteWidth' does not depend on any axioms\n'StitchModel.Stitch.Compute.checkpointCommitted' does not depend on any axioms\n'StitchModel.Stitch.Compute.checkpointLinkAllowed' does not depend on any axioms\n'StitchModel.Stitch.Compute.checkpointMatchesJob' does not depend on any axioms\n'StitchModel.Stitch.Compute.checkpointStrictlyAdvances' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Compute.checkpointSuccessor' does not depend on any axioms\n'StitchModel.Stitch.Compute.checkpointTransitionNeverRollsBack' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Compute.committedCheckpointAllowed' does not depend on any axioms\n'StitchModel.Stitch.Compute.committedCheckpointReplays' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Compute.committedCheckpointSuccessor' does not depend on any axioms\n'StitchModel.Stitch.Compute.concatCapacityCannotTruncate' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Compute.concatIsBigEndianAppend' does not depend on any axioms\n'StitchModel.Stitch.Compute.concatPreservesDeclaredWidth' does not depend on any axioms\n'StitchModel.Stitch.Compute.concatWords' does not depend on any axioms\n'StitchModel.Stitch.Compute.execute' does not depend on any axioms\n'StitchModel.Stitch.Compute.inputCommitted' does not depend on any axioms\n'StitchModel.Stitch.Compute.instructionAllowed' does not depend on any axioms\n'StitchModel.Stitch.Compute.instructionCount' does not depend on any axioms\n'StitchModel.Stitch.Compute.instructionWellFormed' does not depend on any axioms\n'StitchModel.Stitch.Compute.instructionWork' does not depend on any axioms\n'StitchModel.Stitch.Compute.instructionsAllowed' does not depend on any axioms\n'StitchModel.Stitch.Compute.instructionsWellFormed' does not depend on any axioms\n'StitchModel.Stitch.Compute.jobAllowed' does not depend on any axioms\n'StitchModel.Stitch.Compute.jobCommitted' does not depend on any axioms\n'StitchModel.Stitch.Compute.mismatchedStateValueRejected' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Compute.natBitwise' does not depend on any axioms\n'StitchModel.Stitch.Compute.naturalPower' does not depend on any axioms\n'StitchModel.Stitch.Compute.normalize' does not depend on any axioms\n'StitchModel.Stitch.Compute.operandWidth' does not depend on any axioms\n'StitchModel.Stitch.Compute.powerRetainsExponentBitsAboveU64' does not depend on any axioms\n'StitchModel.Stitch.Compute.powerWork' does not depend on any axioms\n'StitchModel.Stitch.Compute.powerWorkAcc' does not depend on any axioms\n'StitchModel.Stitch.Compute.programAllowed' does not depend on any axioms\n'StitchModel.Stitch.Compute.programCommitted' does not depend on any axioms\n'StitchModel.Stitch.Compute.replayedValue' does not depend on any axioms\n'StitchModel.Stitch.Compute.resumeEqualsUninterrupted' depends on axioms: [propext]\n'StitchModel.Stitch.Compute.ringModulus' does not depend on any axioms\n'StitchModel.Stitch.Compute.ringPow' does not depend on any axioms\n'StitchModel.Stitch.Compute.ringStep' does not depend on any axioms\n'StitchModel.Stitch.Compute.sameInstruction' does not depend on any axioms\n'StitchModel.Stitch.Compute.sameInstructions' does not depend on any axioms\n'StitchModel.Stitch.Compute.semanticTamperingRefused' does not depend on any axioms\n'StitchModel.Stitch.Compute.stateCommitted' does not depend on any axioms\n'StitchModel.Stitch.Compute.supportedWidth' does not depend on any axioms\n'StitchModel.Stitch.Compute.takeSteps' does not depend on any axioms\n'StitchModel.Stitch.Compute.typedAdmissionBoundsDeclaredWidth' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Compute.typedAdmissionBoundsResultWidth' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Compute.typedExecute' does not depend on any axioms\n'StitchModel.Stitch.Compute.typedInstructionAdmission' does not depend on any axioms\n'StitchModel.Stitch.Compute.typedInstructionAllowed' does not depend on any axioms\n'StitchModel.Stitch.Compute.typedInstructionWork' does not depend on any axioms\n'StitchModel.Stitch.Compute.typedProgramAllowed' does not depend on any axioms\n'StitchModel.Stitch.Compute.typedProgramWork' does not depend on any axioms\n'StitchModel.Stitch.Compute.typedProgramWorkAcc' does not depend on any axioms\n'StitchModel.Stitch.Compute.typedResultBits' does not depend on any axioms\n'StitchModel.Stitch.Compute.typedResumeEqualsUninterrupted' depends on axioms: [propext]\n'StitchModel.Stitch.Compute.typedStep' does not depend on any axioms\n'StitchModel.Stitch.Compute.unsupportedWidthCannotCommit' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Compute.wordAllowed' does not depend on any axioms\n'StitchModel.Stitch.Compute.zeroExponentCostsNoMultiplications' depends on axioms: [propext]\n'StitchModel.Stitch.Compute.zeroExponentIsRingUnit' depends on axioms: [propext]\n","stdout_sha256":"eff4b2135cc5c17bfa34ae1e31298188bba47a153eab75db7064f0d710e9087d","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Custody.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Custody","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Custody.FragmentIntegrityObservation' does not depend on any axioms\n'StitchModel.Stitch.Custody.PhysicalCopy' does not depend on any axioms\n'StitchModel.Stitch.Custody.Placement' does not depend on any axioms\n'StitchModel.Stitch.Custody.Receipt' does not depend on any axioms\n'StitchModel.Stitch.Custody.Transfer' does not depend on any axioms\n'StitchModel.Stitch.Custody.TransferPhase' does not depend on any axioms\n'StitchModel.Stitch.Custody.acknowledgeTransfer' does not depend on any axioms\n'StitchModel.Stitch.Custody.activationAllowed' does not depend on any axioms\n'StitchModel.Stitch.Custody.activeCount' does not depend on any axioms\n'StitchModel.Stitch.Custody.activeFirstPreservationFact' does not depend on any axioms\n'StitchModel.Stitch.Custody.activeIndexedPreservationFact' does not depend on any axioms\n'StitchModel.Stitch.Custody.activeRetirementPreservationFact' does not depend on any axioms\n'StitchModel.Stitch.Custody.activeThreshold' does not depend on any axioms\n'StitchModel.Stitch.Custody.booleanSelfPreservationFact' does not depend on any axioms\n'StitchModel.Stitch.Custody.choosePlacement' does not depend on any axioms\n'StitchModel.Stitch.Custody.chooseTruth' does not depend on any axioms\n'StitchModel.Stitch.Custody.commitAllowed' does not depend on any axioms\n'StitchModel.Stitch.Custody.commitTransfer' does not depend on any axioms\n'StitchModel.Stitch.Custody.committedMigrationPreservesRecovery' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.Custody.committedMigrationPreservesRecoveryFact' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.Custody.committedPhase' does not depend on any axioms\n'StitchModel.Stitch.Custody.committedPlacement0' does not depend on any axioms\n'StitchModel.Stitch.Custody.committedPlacement1' does not depend on any axioms\n'StitchModel.Stitch.Custody.committedPlacement2' does not depend on any axioms\n'StitchModel.Stitch.Custody.conjunctionPreservationFact' does not depend on any axioms\n'StitchModel.Stitch.Custody.distinctFirstPreservationFact' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Custody.distinctHolders' does not depend on any axioms\n'StitchModel.Stitch.Custody.distinctIndexedPreservationFact' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Custody.expiredReceiptDoesNotCountAsLive' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Custody.expiredReservationCannotActivate' does not depend on any axioms\n'StitchModel.Stitch.Custody.failTransfer' does not depend on any axioms\n'StitchModel.Stitch.Custody.fallbackPreservationFact' does not depend on any axioms\n'StitchModel.Stitch.Custody.fragmentBound' does not depend on any axioms\n'StitchModel.Stitch.Custody.fragmentIntegrityAccepted' does not depend on any axioms\n'StitchModel.Stitch.Custody.indexedCopyLive' does not depend on any axioms\n'StitchModel.Stitch.Custody.indexedCopyLiveOne' does not depend on any axioms\n'StitchModel.Stitch.Custody.indexedCopyLiveTwo' does not depend on any axioms\n'StitchModel.Stitch.Custody.indexedCopyLiveZero' does not depend on any axioms\n'StitchModel.Stitch.Custody.indexedMigrationPreservesRecovery' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.Custody.indexedMigrationPreservesRecoveryFact' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.Custody.installReceipt' does not depend on any axioms\n'StitchModel.Stitch.Custody.liveCount' does not depend on any axioms\n'StitchModel.Stitch.Custody.liveGate0Preservation' does not depend on any axioms\n'StitchModel.Stitch.Custody.liveGate1Preservation' does not depend on any axioms\n'StitchModel.Stitch.Custody.liveGate2Preservation' does not depend on any axioms\n'StitchModel.Stitch.Custody.liveMigrationGate0Fact' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.liveMigrationGate1Fact' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.liveMigrationGate2Fact' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.liveRecoveryOfChoice' does not depend on any axioms\n'StitchModel.Stitch.Custody.liveRecoveryOfSelection' does not depend on any axioms\n'StitchModel.Stitch.Custody.migrate' does not depend on any axioms\n'StitchModel.Stitch.Custody.migrationAllowed' does not depend on any axioms\n'StitchModel.Stitch.Custody.migrationBase' does not depend on any axioms\n'StitchModel.Stitch.Custody.migrationGate0' does not depend on any axioms\n'StitchModel.Stitch.Custody.migrationGate1' does not depend on any axioms\n'StitchModel.Stitch.Custody.migrationGate2' does not depend on any axioms\n'StitchModel.Stitch.Custody.physicalBytes' does not depend on any axioms\n'StitchModel.Stitch.Custody.physicalCopyLive' does not depend on any axioms\n'StitchModel.Stitch.Custody.prepareCompletion' does not depend on any axioms\n'StitchModel.Stitch.Custody.receiptBound' does not depend on any axioms\n'StitchModel.Stitch.Custody.receiptLive' does not depend on any axioms\n'StitchModel.Stitch.Custody.recordCompletion' does not depend on any axioms\n'StitchModel.Stitch.Custody.recoverable' does not depend on any axioms\n'StitchModel.Stitch.Custody.recoverableAt' does not depend on any axioms\n'StitchModel.Stitch.Custody.recoveryOfChoice' does not depend on any axioms\n'StitchModel.Stitch.Custody.recoveryOfSelection' does not depend on any axioms\n'StitchModel.Stitch.Custody.replaceFirst' does not depend on any axioms\n'StitchModel.Stitch.Custody.replaceIndex' does not depend on any axioms\n'StitchModel.Stitch.Custody.replacedRouteCannotActivate' does not depend on any axioms\n'StitchModel.Stitch.Custody.requestRecorded' does not depend on any axioms\n'StitchModel.Stitch.Custody.requestUnused' does not depend on any axioms\n'StitchModel.Stitch.Custody.requestWellFormed' does not depend on any axioms\n'StitchModel.Stitch.Custody.requestedPhase' does not depend on any axioms\n'StitchModel.Stitch.Custody.retireAllowed' does not depend on any axioms\n'StitchModel.Stitch.Custody.retireFirst' does not depend on any axioms\n'StitchModel.Stitch.Custody.retirementPreservesRecovery' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.retirementPreservesRecoveryFact' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.retirementPreservesThreshold' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Custody.sameRequest' does not depend on any axioms\n'StitchModel.Stitch.Custody.selectPlacement' does not depend on any axioms\n'StitchModel.Stitch.Custody.selectTruth' does not depend on any axioms\n'StitchModel.Stitch.Custody.selectionOfTruth' does not depend on any axioms\n'StitchModel.Stitch.Custody.sourceLive' does not depend on any axioms\n'StitchModel.Stitch.Custody.sourcePlaced' does not depend on any axioms\n'StitchModel.Stitch.Custody.staticGate0Preservation' does not depend on any axioms\n'StitchModel.Stitch.Custody.staticGate1Preservation' does not depend on any axioms\n'StitchModel.Stitch.Custody.staticGate2Preservation' does not depend on any axioms\n'StitchModel.Stitch.Custody.staticMigrationGate0Fact' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.staticMigrationGate1Fact' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.staticMigrationGate2Fact' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.typedMigrationPreservesLiveRecoveryAtObservationTime' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.typedMigrationPreservesLiveRecoveryAtObservationTimeFact' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.typedMigrationPreservesRecovery' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.typedMigrationPreservesRecoveryFact' depends on axioms: [propext]\n'StitchModel.Stitch.Custody.unacknowledgedCannotCommit' does not depend on any axioms\n'StitchModel.Stitch.Custody.uncommittedCannotRetire' does not depend on any axioms\n","stdout_sha256":"bab17e1c6cb721b73415a6a03a4951357d3c0c468c8d08ffe6e0f77e6a5fd570","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Effects.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Effects","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Effects.C1Progress' does not depend on any axioms\n'StitchModel.Stitch.Effects.DnsCandidate' does not depend on any axioms\n'StitchModel.Stitch.Effects.DnsDecision' does not depend on any axioms\n'StitchModel.Stitch.Effects.DnsPhase' does not depend on any axioms\n'StitchModel.Stitch.Effects.DnsPublication' does not depend on any axioms\n'StitchModel.Stitch.Effects.DnsRead' does not depend on any axioms\n'StitchModel.Stitch.Effects.DnsScope' does not depend on any axioms\n'StitchModel.Stitch.Effects.DnsWriteResult' does not depend on any axioms\n'StitchModel.Stitch.Effects.Transport' does not depend on any axioms\n'StitchModel.Stitch.Effects.TransportCallback' does not depend on any axioms\n'StitchModel.Stitch.Effects.Vm' does not depend on any axioms\n'StitchModel.Stitch.Effects.VmPhase' does not depend on any axioms\n'StitchModel.Stitch.Effects.authorityMayCreate' does not depend on any axioms\n'StitchModel.Stitch.Effects.bootingCannotBootAgain' does not depend on any axioms\n'StitchModel.Stitch.Effects.bootingCannotExecute' does not depend on any axioms\n'StitchModel.Stitch.Effects.c1ConnectionQualified' does not depend on any axioms\n'StitchModel.Stitch.Effects.c1DirectSuccess' does not depend on any axioms\n'StitchModel.Stitch.Effects.c1InWindow' does not depend on any axioms\n'StitchModel.Stitch.Effects.c1ObserveProbe' does not depend on any axioms\n'StitchModel.Stitch.Effects.c1ProbeAccepted' does not depend on any axioms\n'StitchModel.Stitch.Effects.closedTransportCannotSend' does not depend on any axioms\n'StitchModel.Stitch.Effects.closingAdvancesGeneration' does not depend on any axioms\n'StitchModel.Stitch.Effects.dnsBeginWrite' does not depend on any axioms\n'StitchModel.Stitch.Effects.dnsDecisionWrites' does not depend on any axioms\n'StitchModel.Stitch.Effects.dnsFinishWrite' does not depend on any axioms\n'StitchModel.Stitch.Effects.dnsMayReconcile' does not depend on any axioms\n'StitchModel.Stitch.Effects.dnsMayWritePhase' does not depend on any axioms\n'StitchModel.Stitch.Effects.dnsReadDecision' does not depend on any axioms\n'StitchModel.Stitch.Effects.dnsReconciled' does not depend on any axioms\n'StitchModel.Stitch.Effects.dnsRequestAllowed' does not depend on any axioms\n'StitchModel.Stitch.Effects.dnsScopeMatches' does not depend on any axioms\n'StitchModel.Stitch.Effects.dnsSelectGatedRead' does not depend on any axioms\n'StitchModel.Stitch.Effects.dnsSelectRead' does not depend on any axioms\n'StitchModel.Stitch.Effects.existingAuthorityNeverRotates' does not depend on any axioms\n'StitchModel.Stitch.Effects.expiredConnectionCannotQualify' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Effects.failedVmCanRetry' does not depend on any axioms\n'StitchModel.Stitch.Effects.fewerThanTenCannotQualify' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Effects.foreignCandidateCannotFinish' does not depend on any axioms\n'StitchModel.Stitch.Effects.journalMayClaim' does not depend on any axioms\n'StitchModel.Stitch.Effects.journalMayFinish' does not depend on any axioms\n'StitchModel.Stitch.Effects.reconnectCannotReviveCapturedCallback' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Effects.staleTransportGenerationCannotCallback' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Effects.staleVmCannotResurrectReadiness' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Effects.staleVmGenerationCannotCallback' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Effects.transportCanSend' does not depend on any axioms\n'StitchModel.Stitch.Effects.transportChannelCallbackAllowed' does not depend on any axioms\n'StitchModel.Stitch.Effects.transportClose' does not depend on any axioms\n'StitchModel.Stitch.Effects.transportOpen' does not depend on any axioms\n'StitchModel.Stitch.Effects.transportPeerAllocationAllowed' does not depend on any axioms\n'StitchModel.Stitch.Effects.transportPeerCallbackAllowed' does not depend on any axioms\n'StitchModel.Stitch.Effects.transportSessionMatches' does not depend on any axioms\n'StitchModel.Stitch.Effects.transportSignalAllowed' does not depend on any axioms\n'StitchModel.Stitch.Effects.unknownCannotAuthorizeWrite' does not depend on any axioms\n'StitchModel.Stitch.Effects.unknownGatedReadNeverWrites' does not depend on any axioms\n'StitchModel.Stitch.Effects.unknownJournalCannotClaim' does not depend on any axioms\n'StitchModel.Stitch.Effects.unknownOffersReconciliation' does not depend on any axioms\n'StitchModel.Stitch.Effects.unknownReadNeverWrites' does not depend on any axioms\n'StitchModel.Stitch.Effects.unresolvedDnsReadCannotWrite' depends on axioms: [propext]\n'StitchModel.Stitch.Effects.vmCallbackAllowed' does not depend on any axioms\n'StitchModel.Stitch.Effects.vmCanBoot' does not depend on any axioms\n'StitchModel.Stitch.Effects.vmCanExecute' does not depend on any axioms\n'StitchModel.Stitch.Effects.vmFail' does not depend on any axioms\n'StitchModel.Stitch.Effects.vmFailAllowed' does not depend on any axioms\n'StitchModel.Stitch.Effects.vmGenerationFilter' does not depend on any axioms\n'StitchModel.Stitch.Effects.vmIsBooting' does not depend on any axioms\n'StitchModel.Stitch.Effects.vmObserveReady' does not depend on any axioms\n'StitchModel.Stitch.Effects.vmOldGenerationDifference' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Effects.vmPositiveGenerationFilterFact' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Effects.vmReadyCandidate' does not depend on any axioms\n'StitchModel.Stitch.Effects.vmStart' does not depend on any axioms\n","stdout_sha256":"7ced0557a27f50dd7ef495af771fef61daeb6445a502375389ff2b09e3bb0474","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Encoding.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Encoding","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Encoding.Dependency' does not depend on any axioms\n'StitchModel.Stitch.Encoding.DependencyKind' does not depend on any axioms\n'StitchModel.Stitch.Encoding.Encoding' does not depend on any axioms\n'StitchModel.Stitch.Encoding.RecoveryObservation' does not depend on any axioms\n'StitchModel.Stitch.Encoding.dependenciesReady' does not depend on any axioms\n'StitchModel.Stitch.Encoding.exactRecovery' does not depend on any axioms\n'StitchModel.Stitch.Encoding.externalBasisNotFree' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Encoding.rawDecode' does not depend on any axioms\n'StitchModel.Stitch.Encoding.rawRecoveryExact' does not depend on any axioms\n'StitchModel.Stitch.Encoding.selfContainedBytes' does not depend on any axioms\n'StitchModel.Stitch.Encoding.totalRecoveryBytes' does not depend on any axioms\n","stdout_sha256":"78b53f7e3cf7174490f655c792714845d5baee9f754f6bc7f6f4b08d12a006e0","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Evidence.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Evidence","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Evidence.ClaimKind' does not depend on any axioms\n'StitchModel.Stitch.Evidence.Evidence' does not depend on any axioms\n'StitchModel.Stitch.Evidence.EvidenceKind' does not depend on any axioms\n'StitchModel.Stitch.Evidence.HostAssumptions' does not depend on any axioms\n'StitchModel.Stitch.Evidence.HostEffect' does not depend on any axioms\n'StitchModel.Stitch.Evidence.Scope' does not depend on any axioms\n'StitchModel.Stitch.Evidence.cannotExtendEvidenceHorizon' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Evidence.claimCode' does not depend on any axioms\n'StitchModel.Stitch.Evidence.dependenciesUnchanged' does not depend on any axioms\n'StitchModel.Stitch.Evidence.dependencyKindCode' does not depend on any axioms\n'StitchModel.Stitch.Evidence.effectCode' does not depend on any axioms\n'StitchModel.Stitch.Evidence.effectMember' does not depend on any axioms\n'StitchModel.Stitch.Evidence.effectsCovered' does not depend on any axioms\n'StitchModel.Stitch.Evidence.expiredEvidenceCannotBeReused' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Evidence.kindCode' does not depend on any axioms\n'StitchModel.Stitch.Evidence.positiveEvidenceKind' does not depend on any axioms\n'StitchModel.Stitch.Evidence.pureEffectAllowed' does not depend on any axioms\n'StitchModel.Stitch.Evidence.sameAssumptions' does not depend on any axioms\n'StitchModel.Stitch.Evidence.sameDependency' does not depend on any axioms\n'StitchModel.Stitch.Evidence.scopeReusable' does not depend on any axioms\n","stdout_sha256":"7b94a5775d8ae8c13a0ad00edb33d1fa04c7344f8256fbcab72b2975b116f3eb","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Fragments.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Fragments","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Fragments.Bit' does not depend on any axioms\n'StitchModel.Stitch.Fragments.BitBlocks' does not depend on any axioms\n'StitchModel.Stitch.Fragments.BitPair' does not depend on any axioms\n'StitchModel.Stitch.Fragments.Blocks' does not depend on any axioms\n'StitchModel.Stitch.Fragments.Fragment' does not depend on any axioms\n'StitchModel.Stitch.Fragments.PairSelection' does not depend on any axioms\n'StitchModel.Stitch.Fragments.decodePair' does not depend on any axioms\n'StitchModel.Stitch.Fragments.duplicateIndexCannotRecover' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Fragments.encodeForPair' does not depend on any axioms\n'StitchModel.Stitch.Fragments.encodePair' does not depend on any axioms\n'StitchModel.Stitch.Fragments.everyCompatiblePairRecoversFiniteBlocks' depends on axioms: [propext]\n'StitchModel.Stitch.Fragments.leftParity' does not depend on any axioms\n'StitchModel.Stitch.Fragments.leftParityBitExact' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Fragments.leftParityInvolutive' depends on axioms: [propext]\n'StitchModel.Stitch.Fragments.pairAllowed' does not depend on any axioms\n'StitchModel.Stitch.Fragments.recoverLeftParity' does not depend on any axioms\n'StitchModel.Stitch.Fragments.recoverRightParity' does not depend on any axioms\n'StitchModel.Stitch.Fragments.rightParity' does not depend on any axioms\n'StitchModel.Stitch.Fragments.rightParityBitExact' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Fragments.rightParityInvolutive' depends on axioms: [propext]\n'StitchModel.Stitch.Fragments.xorBit' does not depend on any axioms\n'StitchModel.Stitch.Fragments.xorCell' does not depend on any axioms\n","stdout_sha256":"39b8e41327c5f844239f262330a2d170d221603bf0142e73fd7e3b5fd64ebf97","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Identity.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Identity","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Identity.Digest' does not depend on any axioms\n'StitchModel.Stitch.Identity.DigestObservation' does not depend on any axioms\n'StitchModel.Stitch.Identity.Object' does not depend on any axioms\n'StitchModel.Stitch.Identity.digestAccepted' does not depend on any axioms\n'StitchModel.Stitch.Identity.digestWellFormed' does not depend on any axioms\n'StitchModel.Stitch.Identity.fullDigestReflexive' depends on axioms: [propext]\n'StitchModel.Stitch.Identity.sameDigest' does not depend on any axioms\n","stdout_sha256":"fe98638b6008f340c69c6153591a61d3ce966cd643c539d83e03c4e1568e33da","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Observation.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Observation","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Observation.PeerObservation' does not depend on any axioms\n'StitchModel.Stitch.Observation.Reachability' does not depend on any axioms\n'StitchModel.Stitch.Observation.acceptObservation' does not depend on any axioms\n'StitchModel.Stitch.Observation.acceptedObservationIsFresh' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Observation.expiredObservationRejected' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Observation.futureObservationRejected' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Observation.observationFresh' does not depend on any axioms\n'StitchModel.Stitch.Observation.reachableObservation' does not depend on any axioms\n'StitchModel.Stitch.Observation.updateObservation' does not depend on any axioms\n","stdout_sha256":"7fcaf19825c005110f5b1d141231b6b01becaedb07bb8849dc726e41aa47f79c","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Pointer.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Pointer","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Pointer.Authority' does not depend on any axioms\n'StitchModel.Stitch.Pointer.Pointer' does not depend on any axioms\n'StitchModel.Stitch.Pointer.acceptPointer' does not depend on any axioms\n'StitchModel.Stitch.Pointer.differentRetainedHeadRestoreRefused' depends on axioms: [propext]\n'StitchModel.Stitch.Pointer.expiredRestoreRefused' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Pointer.restoreAllowed' does not depend on any axioms\n'StitchModel.Stitch.Pointer.restoreDifferentHeadGuard' does not depend on any axioms\n'StitchModel.Stitch.Pointer.rollbackRefused' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Pointer.successorAllowed' does not depend on any axioms\n'StitchModel.Stitch.Pointer.successorStrictlyAdvances' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Pointer.unacceptedRestoreRefused' does not depend on any axioms\n'StitchModel.Stitch.Pointer.wrongAuthorityRefused' does not depend on any axioms\n","stdout_sha256":"b75348a1c47daad5129f4b20c8bc4d97ecee6348b30c2a901d133d10e7afe605","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Recovery.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Recovery","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Recovery.Limits' does not depend on any axioms\n'StitchModel.Stitch.Recovery.State' does not depend on any axioms\n'StitchModel.Stitch.Recovery.acceptedCandidateWithinBounds' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.Recovery.admitted' does not depend on any axioms\n'StitchModel.Stitch.Recovery.anchorAllowed' does not depend on any axioms\n'StitchModel.Stitch.Recovery.commit' does not depend on any axioms\n'StitchModel.Stitch.Recovery.progressAllowed' does not depend on any axioms\n'StitchModel.Stitch.Recovery.rollbackProgressRefused' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Recovery.staleGenerationRefused' depends on axioms: [propext, Quot.sound]\n'StitchModel.Stitch.Recovery.unverifiedImportPreservesState' does not depend on any axioms\n","stdout_sha256":"b399659c8c7fcbb309ca911acdf55473e07d926a514d85f8100322a82bb2bac5","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Relay.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Relay","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Relay.Assembly' does not depend on any axioms\n'StitchModel.Stitch.Relay.Capacity' does not depend on any axioms\n'StitchModel.Stitch.Relay.Frame' does not depend on any axioms\n'StitchModel.Stitch.Relay.Identity' does not depend on any axioms\n'StitchModel.Stitch.Relay.Limits' does not depend on any axioms\n'StitchModel.Stitch.Relay.admissionAllowed' does not depend on any axioms\n'StitchModel.Stitch.Relay.admitCapacity' does not depend on any axioms\n'StitchModel.Stitch.Relay.append' does not depend on any axioms\n'StitchModel.Stitch.Relay.appendAllowed' does not depend on any axioms\n'StitchModel.Stitch.Relay.assemblyCurrent' does not depend on any axioms\n'StitchModel.Stitch.Relay.beginVerification' does not depend on any axioms\n'StitchModel.Stitch.Relay.closedSessionCannotPublish' does not depend on any axioms\n'StitchModel.Stitch.Relay.deliveryAllowed' does not depend on any axioms\n'StitchModel.Stitch.Relay.duplicateDoesNotAdvanceAssembly' does not depend on any axioms\n'StitchModel.Stitch.Relay.effectAllowed' does not depend on any axioms\n'StitchModel.Stitch.Relay.effectFalseGuard' does not depend on any axioms\n'StitchModel.Stitch.Relay.frameAllowed' does not depend on any axioms\n'StitchModel.Stitch.Relay.limits' does not depend on any axioms\n'StitchModel.Stitch.Relay.ready' does not depend on any axioms\n'StitchModel.Stitch.Relay.release' does not depend on any axioms\n'StitchModel.Stitch.Relay.sameIdentity' does not depend on any axioms\n'StitchModel.Stitch.Relay.signalLifetime' does not depend on any axioms\n'StitchModel.Stitch.Relay.unverifiedMessageCannotDeliver' does not depend on any axioms\n'StitchModel.Stitch.Relay.warmLifetime' does not depend on any axioms\n'StitchModel.Stitch.Relay.withdrawnConsentCannotPublish' depends on axioms: [propext]\n","stdout_sha256":"110952dbd1a70d2be18b0c847664d6a4283940148d9c95982b2ffa2f2190b6eb","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Signaling.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.Signaling","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.Signaling.admissionAllowed' does not depend on any axioms\n'StitchModel.Stitch.Signaling.unverifiedCannotAdmit' does not depend on any axioms\n","stdout_sha256":"adb0a3dbb25ab4b88e6836564ce119804614e2ebdb5a2ad76fba0af1a1ddf5b7","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.System.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.System","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.System.Action' does not depend on any axioms\n'StitchModel.Stitch.System.ActionKind' does not depend on any axioms\n'StitchModel.Stitch.System.State' does not depend on any axioms\n'StitchModel.Stitch.System.admitAction' does not depend on any axioms\n'StitchModel.Stitch.System.applyMigration' does not depend on any axioms\n'StitchModel.Stitch.System.choosePlacement' does not depend on any axioms\n'StitchModel.Stitch.System.clockAdvanceFact' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.System.clockViewGrouping' does not depend on any axioms\n'StitchModel.Stitch.System.completeMigrationAllowed' does not depend on any axioms\n'StitchModel.Stitch.System.completionBudget' does not depend on any axioms\n'StitchModel.Stitch.System.completionClock' does not depend on any axioms\n'StitchModel.Stitch.System.completionHistory' does not depend on any axioms\n'StitchModel.Stitch.System.completionLedger' does not depend on any axioms\n'StitchModel.Stitch.System.completionLedgerValidityFact' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.System.completionSafetyGuard' does not depend on any axioms\n'StitchModel.Stitch.System.completionSelectionReserved' does not depend on any axioms\n'StitchModel.Stitch.System.completionTime' does not depend on any axioms\n'StitchModel.Stitch.System.guardedProductPreservationFact' does not depend on any axioms\n'StitchModel.Stitch.System.historyPreservedFact' does not depend on any axioms\n'StitchModel.Stitch.System.ledgerClockView' depends on axioms: [propext]\n'StitchModel.Stitch.System.ledgerHistory' does not depend on any axioms\n'StitchModel.Stitch.System.ledgerPlacementValid' does not depend on any axioms\n'StitchModel.Stitch.System.ledgerPlacementValiditySelect' does not depend on any axioms\n'StitchModel.Stitch.System.ledgerTime' does not depend on any axioms\n'StitchModel.Stitch.System.migrationCandidateValidity' does not depend on any axioms\n'StitchModel.Stitch.System.migrationCandidateValidityFact' depends on axioms: [propext, Classical.choice, Quot.sound]\n'StitchModel.Stitch.System.migrationCompletionDoesNotRefundBudget' does not depend on any axioms\n'StitchModel.Stitch.System.migrationPreservesProductInvariant' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.System.migrationPreservesProductInvariantFact' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.System.migrationRequestDoesNotEstablishCustody' does not depend on any axioms\n'StitchModel.Stitch.System.migrationRequestPreservesProductInvariant' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.System.migrationRequestPreservesProductInvariantFact' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.System.productValiditySelect' does not depend on any axioms\n'StitchModel.Stitch.System.requestAction' does not depend on any axioms\n'StitchModel.Stitch.System.requestAdmissionProductFact' does not depend on any axioms\n'StitchModel.Stitch.System.requestDoesNotChangeObjectCustody' does not depend on any axioms\n'StitchModel.Stitch.System.requestDoesNotCreateEvidence' does not depend on any axioms\n'StitchModel.Stitch.System.requestMigration' does not depend on any axioms\n'StitchModel.Stitch.System.requestMigrationAllowed' does not depend on any axioms\n'StitchModel.Stitch.System.requestMigrationCandidateValidityFact' depends on axioms: [propext,\n Classical.choice,\n Quot.sound]\n'StitchModel.Stitch.System.reservationActive' does not depend on any axioms\n'StitchModel.Stitch.System.reservationClock' does not depend on any axioms\n'StitchModel.Stitch.System.settleAction' does not depend on any axioms\n'StitchModel.Stitch.System.settleActionAllowed' does not depend on any axioms\n'StitchModel.Stitch.System.settlementDoesNotEstablishCustody' does not depend on any axioms\n'StitchModel.Stitch.System.valid' does not depend on any axioms\n'StitchModel.Stitch.System.validAt' does not depend on any axioms\n'StitchModel.Stitch.System.weakenAdmissionFact' does not depend on any axioms\n","stdout_sha256":"a30ba99cd1c07140cc78be37d487c0ddbb506643e8659a2b28c6ad119c9d24e0","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.VmAdministration.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.Stitch.VmAdministration","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.Stitch.VmAdministration.administrationAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.allocationAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.commandAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.ethernetAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.filesystemAllocationLimit' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.filesystemFileLimit' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.filesystemMetadataLimit' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.forgetAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.metadataAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.networkChangeAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.networkSharingAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.observationAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.outputLimit' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.resultReadAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.retainedInstanceCannotReconfigure' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.retainedOutputLimit' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.runtimeLimitMs' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.shareAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.staticAddressAllowed' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.terminationRequired' does not depend on any axioms\n'StitchModel.Stitch.VmAdministration.unconfiguredCannotShareEthernet' does not depend on any axioms\n","stdout_sha256":"652029325c63f565314f71e432899950374685d7cd3d88d4a5540d533dd2d46e","tool":"lean"},{"argv":["env","lean","$STAGING/audit/LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.StitchApp.lean"],"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","exit_code":0,"module":"LexLeanAudit.A6629359d26d7d175e5e1766d87d3065a.StitchModel.StitchApp","stderr":"\n","stderr_sha256":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","stdout":"'StitchModel.StitchApp.application' does not depend on any axioms\n'StitchModel.StitchApp.budgetProbe' depends on axioms: [propext, Quot.sound]\n'StitchModel.StitchApp.byteNat' depends on axioms: [propext, Quot.sound]\n'StitchModel.StitchApp.custodyProbe' depends on axioms: [propext, Quot.sound]\n'StitchModel.StitchApp.decimalBytes' does not depend on any axioms\n'StitchModel.StitchApp.decimalDigit' does not depend on any axioms\n'StitchModel.StitchApp.dispatch' depends on axioms: [propext, Quot.sound]\n'StitchModel.StitchApp.flag' depends on axioms: [propext, Quot.sound]\n'StitchModel.StitchApp.flagsCanonical' depends on axioms: [propext, Quot.sound]\n'StitchModel.StitchApp.pairProbe' depends on axioms: [propext, Quot.sound]\n'StitchModel.StitchApp.pointerProbe' depends on axioms: [propext, Quot.sound]\n'StitchModel.StitchApp.ringProbe' depends on axioms: [propext, Quot.sound]\n'StitchModel.StitchApp.unsignedBE' depends on axioms: [propext, Quot.sound]\n'StitchModel.StitchApp.verdict' does not depend on any axioms\n","stdout_sha256":"86e7905b31c13b952e4afc9cbc79ad9c2b12e60a0cc6dec3a37537a0404f53a8","tool":"lean"}],"semantic_id":"6629359d26d7d175e5e1766d87d3065a47b78791613ff4f16789889eedee0bdc","source_id":"405f944b887ec154055f62947986ca89c2dbb7114d3fc9d014e880b32253b445","spec":"lexlean/attestation/2","status":"verified","toolchain":{"lake":{"executable_sha256":"60330ab6f07dce20f3fa9ebb08e8b984ea9549eac172afeb15d9d2227060e2b3","version_output":"Lake version 5.0.0-src+f054605 (Lean version 4.32.1)"},"lean":{"executable_sha256":"e8baaa71855a616dc351028f3ad2200051b0671f423a1696a100e809302d5550","version_output":"Lean (version 4.32.1, x86_64-unknown-linux-gnu, commit f054605aea4b840552cca2e725580bffd1e1b704, Release)"},"leanchecker":{"executable_sha256":"c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f","version_output":"leanchecker bin/leanchecker sha256:c7c51e296d28dd443ed60f9414feef41253ede89dea76dbb2adde29768c3ed5f\nuncaught exception: Could not find any oleans for: LexLeanIdentityProbe\n"}}} diff --git a/product/source-build-manifest.json b/product/source-build-manifest.json new file mode 100644 index 0000000..340b855 --- /dev/null +++ b/product/source-build-manifest.json @@ -0,0 +1 @@ +{"build_id":"3620ec55cbea22062aaabf69fede3f08fd24d378cd0969c306c62a60aee7103e","compiler":{"semantics_id":"5262e5b4c8b5668ae7066ad686757a6bb7f80c941d515fb9d586894fbc7de69a","version":"0.3.0"},"inputs":[{"byte_length":2684,"kind":"lexicon","path":"embedded","sha256":"3bc0fb09d706ffa7d5a1363302ea87c049acc7c7dcafde63c62682620c11be9b"},{"byte_length":14885,"kind":"lexicon","path":"embedded","sha256":"e0db021e01b91d651c43921d66f6b0023c8efbf17cac2ec53192ce5305e4e1ac"},{"byte_length":36197,"kind":"lexicon","path":"embedded","sha256":"827317cae68c162f3a96c8a8de4e53ab348e7d3724fd2b834fa85ecde1a1b392"},{"byte_length":7146,"kind":"lexicon","path":"language/prism.arch","sha256":"a5b1aa879a00c8f86100410c1ec1af4e2e983838f30e6dc82b3e989b0df65e2c"},{"byte_length":3521,"kind":"lexicon","path":"language/stitch.domain","sha256":"ab5577ce01864b402913437b961ba451f72c4183cc27a601a5b1fc5c066a126f"},{"byte_length":2327,"kind":"lock","path":"lexlean.lock","sha256":"b4ad976755fbf8fecba998843d238c57da3bf291bbb142f3cf86f9e125acc3fb"},{"byte_length":1224,"kind":"project-config","path":"lexlean.toml","sha256":"48c90de5fb9896bb45b03cc11692ccd1c26c99fadcc0ec4d7c6c2f481da6f56f"},{"byte_length":2351,"kind":"source","path":"src/Foundation/Arch.lex.tex","sha256":"54fdc8eb15c46707e445ff99814d6cbd1731967f801bf064a6c1f4cc01c45394"},{"byte_length":1494,"kind":"source","path":"src/Foundation/Bytes.lex.tex","sha256":"ce16e5b439128db3231979381f4599d3ff0617f62c2bf00c348bba35393abcd6"},{"byte_length":1739,"kind":"source","path":"src/Foundation/View/Text/V1/Model.lex.tex","sha256":"db124343ad8fe1295bc8eb305c7f59f83cf6ad76d46a5cabea500fe66f3ad5dc"},{"byte_length":15268,"kind":"source","path":"src/Product/Architecture.lex.tex","sha256":"d5cc5fd4e64070bddd5c0edc8cb3a318a0965b5e1574efe9a9dfa483b12e8d6d"},{"byte_length":44528,"kind":"source","path":"src/Product/Experience.lex.tex","sha256":"6f2625fdce3d3d51899cabc17ce3d57ec0a9381dd3bf3e6477da6ae3ccfb84bd"},{"byte_length":11971,"kind":"source","path":"src/Product/Host.lex.tex","sha256":"3bb2a621868dc683e776c9b65c58cc60cc2b89e5d007d54c4c152bedd4878871"},{"byte_length":53400,"kind":"source","path":"src/Product/Model.lex.tex","sha256":"281fcf4954a28d3afa3fd86fda167541207ef572f16cb3a853aa1fb43216ebed"},{"byte_length":6036,"kind":"source","path":"src/Stitch/Authority.lex.tex","sha256":"10afc7af1503f08fe7806dbab24d93f565f34370e3b7d18135f48297e64ee573"},{"byte_length":70247,"kind":"source","path":"src/Stitch/Budget.lex.tex","sha256":"581ae188297e3e03e69869a3cfbcdae9554706e007cbeb238d97c8ad30229911"},{"byte_length":1357,"kind":"source","path":"src/Stitch/ChannelFlow.lex.tex","sha256":"7f4356ddd38fc94b32a2d6af237ce7382c34bdc7db43c8e8d6ab94cd94fc3e63"},{"byte_length":36095,"kind":"source","path":"src/Stitch/Compute.lex.tex","sha256":"ef0f1b8dcf15a8ff26a206b7bd8fa51736bb54ae14e7b6e71a4296deeb4528b7"},{"byte_length":47114,"kind":"source","path":"src/Stitch/Custody.lex.tex","sha256":"e9084ba97058adfd3017e634215af1dee12d89c4ff0d409a4271f05387d8d663"},{"byte_length":23294,"kind":"source","path":"src/Stitch/Effects.lex.tex","sha256":"7ccc2c30cca7df663541ceece0c85226f921160f56f4ec681703a8d5b589263b"},{"byte_length":3347,"kind":"source","path":"src/Stitch/Encoding.lex.tex","sha256":"75b412ab0ed56dea3aa41cc77705fb6233991ea1c2e600a7cf509c3b84e5a95f"},{"byte_length":10541,"kind":"source","path":"src/Stitch/Evidence.lex.tex","sha256":"39011e1cf70295427f716d328b1ab754242d3667f0e70a8a48dffa735465c79e"},{"byte_length":8988,"kind":"source","path":"src/Stitch/Fragments.lex.tex","sha256":"5cd8d0602cbe501ae4ffc5c18dde17fc6e5766d930ac1d9277545d1ef8d88b83"},{"byte_length":2491,"kind":"source","path":"src/Stitch/Identity.lex.tex","sha256":"c4c159234e1623b8f339e86cf47da55c89d197bf21fe334bd893f575ba053870"},{"byte_length":3301,"kind":"source","path":"src/Stitch/Observation.lex.tex","sha256":"fe3205a68576d8c7d82f86b45b78f8b6c8b49a873f00c448cccb2eb459749ae8"},{"byte_length":5712,"kind":"source","path":"src/Stitch/Pointer.lex.tex","sha256":"10239748c402cdadfc36b150a7a103dfe5124d81fa27bb276575810470c89c46"},{"byte_length":3632,"kind":"source","path":"src/Stitch/Recovery.lex.tex","sha256":"4a29e91526ffd1c5aa9fcfc8d990ca1b89d5129813742d9ae55e688eeb6a9121"},{"byte_length":9250,"kind":"source","path":"src/Stitch/Relay.lex.tex","sha256":"26a3b5c7f8af3cb058800716a5b73111adbe0188436ae1ad87e1a0e6ce118a03"},{"byte_length":880,"kind":"source","path":"src/Stitch/Signaling.lex.tex","sha256":"97bdfb5160e41a4ed3ab30788f2e3a558836f622c237e4bd3496536212b330c9"},{"byte_length":23022,"kind":"source","path":"src/Stitch/System.lex.tex","sha256":"b05a639514a2c56f40b8e960c6cf31023aec8b20d1c18c5ed68a0a936a9d7119"},{"byte_length":3568,"kind":"source","path":"src/Stitch/VmAdministration.lex.tex","sha256":"4c27a3a3d1b3650aa78d8fe22b6f07a7335d7e9ec58969ad50f7ad9294f30f81"},{"byte_length":11886,"kind":"source","path":"src/StitchApp.lex.tex","sha256":"ffd8a4b6b9072b27b06d67d61e1c11d085a6b82e84be4610f27f3805d87f675b"}],"language":"1.2","lean_toolchain":"leanprover/lean4:v4.32.1","modules":[{"lean_module":"StitchModel.Foundation.Arch","module":"Foundation.Arch","source_path":"src/Foundation/Arch.lex.tex"},{"lean_module":"StitchModel.Foundation.Bytes","module":"Foundation.Bytes","source_path":"src/Foundation/Bytes.lex.tex"},{"lean_module":"StitchModel.Foundation.View.Text.V1.Model","module":"Foundation.View.Text.V1.Model","source_path":"src/Foundation/View/Text/V1/Model.lex.tex"},{"lean_module":"StitchModel.Product.Architecture","module":"Product.Architecture","source_path":"src/Product/Architecture.lex.tex"},{"lean_module":"StitchModel.Product.Experience","module":"Product.Experience","source_path":"src/Product/Experience.lex.tex"},{"lean_module":"StitchModel.Product.Host","module":"Product.Host","source_path":"src/Product/Host.lex.tex"},{"lean_module":"StitchModel.Product.Model","module":"Product.Model","source_path":"src/Product/Model.lex.tex"},{"lean_module":"StitchModel.Stitch.Authority","module":"Stitch.Authority","source_path":"src/Stitch/Authority.lex.tex"},{"lean_module":"StitchModel.Stitch.Budget","module":"Stitch.Budget","source_path":"src/Stitch/Budget.lex.tex"},{"lean_module":"StitchModel.Stitch.ChannelFlow","module":"Stitch.ChannelFlow","source_path":"src/Stitch/ChannelFlow.lex.tex"},{"lean_module":"StitchModel.Stitch.Compute","module":"Stitch.Compute","source_path":"src/Stitch/Compute.lex.tex"},{"lean_module":"StitchModel.Stitch.Custody","module":"Stitch.Custody","source_path":"src/Stitch/Custody.lex.tex"},{"lean_module":"StitchModel.Stitch.Effects","module":"Stitch.Effects","source_path":"src/Stitch/Effects.lex.tex"},{"lean_module":"StitchModel.Stitch.Encoding","module":"Stitch.Encoding","source_path":"src/Stitch/Encoding.lex.tex"},{"lean_module":"StitchModel.Stitch.Evidence","module":"Stitch.Evidence","source_path":"src/Stitch/Evidence.lex.tex"},{"lean_module":"StitchModel.Stitch.Fragments","module":"Stitch.Fragments","source_path":"src/Stitch/Fragments.lex.tex"},{"lean_module":"StitchModel.Stitch.Identity","module":"Stitch.Identity","source_path":"src/Stitch/Identity.lex.tex"},{"lean_module":"StitchModel.Stitch.Observation","module":"Stitch.Observation","source_path":"src/Stitch/Observation.lex.tex"},{"lean_module":"StitchModel.Stitch.Pointer","module":"Stitch.Pointer","source_path":"src/Stitch/Pointer.lex.tex"},{"lean_module":"StitchModel.Stitch.Recovery","module":"Stitch.Recovery","source_path":"src/Stitch/Recovery.lex.tex"},{"lean_module":"StitchModel.Stitch.Relay","module":"Stitch.Relay","source_path":"src/Stitch/Relay.lex.tex"},{"lean_module":"StitchModel.Stitch.Signaling","module":"Stitch.Signaling","source_path":"src/Stitch/Signaling.lex.tex"},{"lean_module":"StitchModel.Stitch.System","module":"Stitch.System","source_path":"src/Stitch/System.lex.tex"},{"lean_module":"StitchModel.Stitch.VmAdministration","module":"Stitch.VmAdministration","source_path":"src/Stitch/VmAdministration.lex.tex"},{"lean_module":"StitchModel.StitchApp","module":"StitchApp","source_path":"src/StitchApp.lex.tex"}],"outputs":[{"byte_length":13923,"kind":"coverage","path":"coverage/StitchModel/Foundation/Arch.coverage.json","sha256":"253309961fca50c936a49270516fdea7cd0da0dbd03c77f9b3183ebdc7e0d016"},{"byte_length":13478,"kind":"coverage","path":"coverage/StitchModel/Foundation/Bytes.coverage.json","sha256":"46ff4dce511790c7f04eea93f2b0b8895832aaf6f7068721ab6304fa924b7e57"},{"byte_length":14472,"kind":"coverage","path":"coverage/StitchModel/Foundation/View/Text/V1/Model.coverage.json","sha256":"3d5deaf65fdc1d3d7ddf172567e440f9b25c1788dd5a3bd1740223e10e12d0c8"},{"byte_length":26981,"kind":"coverage","path":"coverage/StitchModel/Product/Architecture.coverage.json","sha256":"c8941328111ddbcd9baa9a974dee8a4e737c2e17ff3f4856735ad4202a205379"},{"byte_length":45802,"kind":"coverage","path":"coverage/StitchModel/Product/Experience.coverage.json","sha256":"cc643b0ccd8f8c7993ecc23def29b4936603d61a30b6937f493cb79150bd3854"},{"byte_length":20558,"kind":"coverage","path":"coverage/StitchModel/Product/Host.coverage.json","sha256":"7998010e27f9fe0782dab81a1a3c01048d46e29a750bf9f70d322cb8e885a63f"},{"byte_length":42161,"kind":"coverage","path":"coverage/StitchModel/Product/Model.coverage.json","sha256":"62312f1ebbd567e14347b5d26c0f298de90b3965f9209f9ca0feeeea20dcb79d"},{"byte_length":17241,"kind":"coverage","path":"coverage/StitchModel/Stitch/Authority.coverage.json","sha256":"f8f2c6e0960ada72d02d7af22d4199fda45a46818d8496238804fcb5463dc396"},{"byte_length":54946,"kind":"coverage","path":"coverage/StitchModel/Stitch/Budget.coverage.json","sha256":"3f0a00f31dcaa23685159a0ce8b34eede8de3166f9d9e523bacf63ab7aebf210"},{"byte_length":12810,"kind":"coverage","path":"coverage/StitchModel/Stitch/ChannelFlow.coverage.json","sha256":"257d423c217317eafc692711c63b201eec60ebdbed359dbfc57ed98c1fe041a2"},{"byte_length":35858,"kind":"coverage","path":"coverage/StitchModel/Stitch/Compute.coverage.json","sha256":"fc96551ff01984aed5ff1168612b6660eb1d30d0d307a95e798746442ccbde5d"},{"byte_length":39280,"kind":"coverage","path":"coverage/StitchModel/Stitch/Custody.coverage.json","sha256":"48a215abca8ea81ad394f040182ed1539cb27de27cd062bceb6c094679c821a9"},{"byte_length":30210,"kind":"coverage","path":"coverage/StitchModel/Stitch/Effects.coverage.json","sha256":"1b63e20e0de372f5b9218cfbb94a726a19ca63e6d832b79da172d3146aa2716a"},{"byte_length":15192,"kind":"coverage","path":"coverage/StitchModel/Stitch/Encoding.coverage.json","sha256":"4f5b4b699453b707185b5a9e4962371b81480dd7690652ceaa6960606cd8bb16"},{"byte_length":18625,"kind":"coverage","path":"coverage/StitchModel/Stitch/Evidence.coverage.json","sha256":"0457c5f0364861015d416678bb9fef52b8302d9d15d2f9ebe5ebab7108bc3ff1"},{"byte_length":19226,"kind":"coverage","path":"coverage/StitchModel/Stitch/Fragments.coverage.json","sha256":"3d51768c36f5c14e4aeb2cdcd43d8fcc636d8bec49d028278d6de5b3754a591d"},{"byte_length":13139,"kind":"coverage","path":"coverage/StitchModel/Stitch/Identity.coverage.json","sha256":"004b8315b1c6c0356c15d15ace190aa45715031f191ee412955ab16aebe796a1"},{"byte_length":13887,"kind":"coverage","path":"coverage/StitchModel/Stitch/Observation.coverage.json","sha256":"9df570390c4a82964b6345b60318b85394113e993d5d85b878d5b20afb6e3f25"},{"byte_length":15395,"kind":"coverage","path":"coverage/StitchModel/Stitch/Pointer.coverage.json","sha256":"128d38fca219ffbd64f48814178256162c8e40f0b4ffdb2d53d995b4fe48d187"},{"byte_length":13951,"kind":"coverage","path":"coverage/StitchModel/Stitch/Recovery.coverage.json","sha256":"c05c00ac095f79020a777c4e3f32dc04252b74725a7933931a0a5fa3efc66b81"},{"byte_length":17787,"kind":"coverage","path":"coverage/StitchModel/Stitch/Relay.coverage.json","sha256":"bc6ec0107e5da8d13d177f6b9fed52de2a649ee854cd1422bca1a5fc04a1f22d"},{"byte_length":11851,"kind":"coverage","path":"coverage/StitchModel/Stitch/Signaling.coverage.json","sha256":"981e0c6391717031441214ff9cb9fd2949c5f0e7136ac8252bc5d96913a03fbe"},{"byte_length":32838,"kind":"coverage","path":"coverage/StitchModel/Stitch/System.coverage.json","sha256":"efe112ada4c2064ee8b0749921a67c156d021e10ff6213805ddb938c4f9b6a0a"},{"byte_length":17449,"kind":"coverage","path":"coverage/StitchModel/Stitch/VmAdministration.coverage.json","sha256":"145f87e7a7856ed9945b90edb460bccb55213e2a98f19a5bd31c3ed2328c2c2a"},{"byte_length":24758,"kind":"coverage","path":"coverage/StitchModel/StitchApp.coverage.json","sha256":"6c7bce7a63bb3018266563bd087fa7e43819d19e9275c36480392d3512fd9907"},{"byte_length":1213,"kind":"lean","path":"modules/StitchModel/Foundation/Arch.lean","sha256":"145af2c29196e286de0fff938a17a61915bb6faac2759141272ce74fa246d608"},{"byte_length":1210,"kind":"lean","path":"modules/StitchModel/Foundation/Bytes.lean","sha256":"2376718e1fbece860ef4b9a3ae24ec668e5045db118dfd4c7a7a2c7b7d2e4b39"},{"byte_length":1144,"kind":"lean","path":"modules/StitchModel/Foundation/View/Text/V1/Model.lean","sha256":"70473365be15858a0c870172c27ac142f096afe1aee2432eaab2d828af1d55bf"},{"byte_length":14702,"kind":"lean","path":"modules/StitchModel/Product/Architecture.lean","sha256":"c4808cbb1a1eccf8b593155d5b9dc1b5e26c3c24526239bb7adac25b46fce773"},{"byte_length":38316,"kind":"lean","path":"modules/StitchModel/Product/Experience.lean","sha256":"b65d9cd5ab4036cb7efc3ec1d73ecd6901d7c8209b3d11ee9be07cea1a4f8992"},{"byte_length":26725,"kind":"lean","path":"modules/StitchModel/Product/Host.lean","sha256":"4feb419016272af67eae5597304d117b4b1a2c7acd759b85493abb067dd0c768"},{"byte_length":47917,"kind":"lean","path":"modules/StitchModel/Product/Model.lean","sha256":"774ba21f8a8678b2d862486bd0212cdc326a594e526e4a326f5476480284c263"},{"byte_length":5228,"kind":"lean","path":"modules/StitchModel/Stitch/Authority.lean","sha256":"a89ebf120a05fa48a03a46c55bfbff5d2ab30554a7020a6aee491e88072f6f54"},{"byte_length":136179,"kind":"lean","path":"modules/StitchModel/Stitch/Budget.lean","sha256":"01f469628c84e8cf66aa9497ed0e82d3f547ae695c7f2a61efb7c8b8bb64fcd7"},{"byte_length":1336,"kind":"lean","path":"modules/StitchModel/Stitch/ChannelFlow.lean","sha256":"88ff390c120c789e97f5d56b117d6634806e45f758436be08dc2cc88b5c470b9"},{"byte_length":65970,"kind":"lean","path":"modules/StitchModel/Stitch/Compute.lean","sha256":"5e59cbb806a08a0f18a3ac4061704621c435815022d9d8b15896e28104cca191"},{"byte_length":57563,"kind":"lean","path":"modules/StitchModel/Stitch/Custody.lean","sha256":"784e463ef8b1f7b3f6d7d6aace5f8750911e20436e020e855c2e9cdbee466765"},{"byte_length":50394,"kind":"lean","path":"modules/StitchModel/Stitch/Effects.lean","sha256":"fabf1fbd169c1c9c4043224b2ac253b0c78967e45889389e6d7f5cf90862f1c8"},{"byte_length":5338,"kind":"lean","path":"modules/StitchModel/Stitch/Encoding.lean","sha256":"c2b2a20927f3f039298791f30abd4a9cc992b6eaf29334b0b81b3d1f68d98bad"},{"byte_length":14357,"kind":"lean","path":"modules/StitchModel/Stitch/Evidence.lean","sha256":"1c6d4247e09a311388b0adf319aa5c59c3807386a2b93527e0120c275a3bad02"},{"byte_length":13931,"kind":"lean","path":"modules/StitchModel/Stitch/Fragments.lean","sha256":"556d72531877ee3eb23acf6321b1aadfcc33c1eaaa4b1f3d227c032265aa90fb"},{"byte_length":4784,"kind":"lean","path":"modules/StitchModel/Stitch/Identity.lean","sha256":"633907978f9b550c37af80d6b4c975a895e4a9cd09e512d6d0540ba04683dedf"},{"byte_length":11298,"kind":"lean","path":"modules/StitchModel/Stitch/Observation.lean","sha256":"4b4ec280f91782403b0c83591f097c8894fc3f70d4545fc60659431c88b6431c"},{"byte_length":13603,"kind":"lean","path":"modules/StitchModel/Stitch/Pointer.lean","sha256":"77deec698881364e8739668f427208ce787f376e920a44cc0c2733cb9e04a0ce"},{"byte_length":11694,"kind":"lean","path":"modules/StitchModel/Stitch/Recovery.lean","sha256":"71b64b56354ea7f9a02de2f9489fc407e8daf02d26c5773d31a64278240c281a"},{"byte_length":7539,"kind":"lean","path":"modules/StitchModel/Stitch/Relay.lean","sha256":"948fe7db4bbe2046c574e5883a17648573f2533bbb5f2a475a278610c6114eda"},{"byte_length":788,"kind":"lean","path":"modules/StitchModel/Stitch/Signaling.lean","sha256":"44713b2e8c2beb9b66658a3ce638f5e7e94285b596cb87458278e2a6925633fb"},{"byte_length":26153,"kind":"lean","path":"modules/StitchModel/Stitch/System.lean","sha256":"b5f20f50ccf11fb0b6f403f4f4b2d43f628c7564c6d7630d7d3c956aec7f1ebf"},{"byte_length":3009,"kind":"lean","path":"modules/StitchModel/Stitch/VmAdministration.lean","sha256":"41fc36c73deb14bbf0cb0412802fa2b17dc96bcb7f44f81e525448495c2d1772"},{"byte_length":32856,"kind":"lean","path":"modules/StitchModel/StitchApp.lean","sha256":"ccb080862681bb34a67c86fa0d9ec1618969a5de6b097c3e246519d32ec8f47e"},{"byte_length":11889,"kind":"lexicon-closure","path":"lexicons/Foundation.Arch.closure.json","sha256":"121b5934a000351e5c4e39c0c5bb9b6fb23001f37f8c1c039ca38473592bb9ef"},{"byte_length":11890,"kind":"lexicon-closure","path":"lexicons/Foundation.Bytes.closure.json","sha256":"7f502a073cedf91a0dc2cb794a186aff8474fead1fcf21106ea2ebbd651d660e"},{"byte_length":11903,"kind":"lexicon-closure","path":"lexicons/Foundation.View.Text.V1.Model.closure.json","sha256":"45dba9b9bdce509a7760ca8f1d4b8170ad8ce4e51629e1e3474ef2e5a2e37b2b"},{"byte_length":11894,"kind":"lexicon-closure","path":"lexicons/Product.Architecture.closure.json","sha256":"4d0946f0d67234617826cd15fd821ea8cd32b92b6ce996c54d42e6a04ef45726"},{"byte_length":11331,"kind":"lexicon-closure","path":"lexicons/Product.Experience.closure.json","sha256":"4a342abe13cc30d1e4b0c3ba5fead341de94ed53921f4edd5ada3cb4c8e7e11d"},{"byte_length":11325,"kind":"lexicon-closure","path":"lexicons/Product.Host.closure.json","sha256":"1f78c77cc5030e8e2f4ce3fe0dda248833be5a9b4d6009dc8383d6bb86bc1896"},{"byte_length":11326,"kind":"lexicon-closure","path":"lexicons/Product.Model.closure.json","sha256":"2cd31c692f8d3a48e2c641c1149169307a40658139254ac40e8b155d92be000c"},{"byte_length":11329,"kind":"lexicon-closure","path":"lexicons/Stitch.Authority.closure.json","sha256":"d219bb2916d54f34aeb66711ac69de63adb38e403e2e0d7f838d076c53971895"},{"byte_length":11326,"kind":"lexicon-closure","path":"lexicons/Stitch.Budget.closure.json","sha256":"3c3988f6be0cb9eb790826befaaa89dd73d2a74ff72feab5deef637f18340f0c"},{"byte_length":11331,"kind":"lexicon-closure","path":"lexicons/Stitch.ChannelFlow.closure.json","sha256":"ad720177987c39d7dd8f40e47f26d9b7900ac6da4c9d456761cc4979862b5cee"},{"byte_length":11327,"kind":"lexicon-closure","path":"lexicons/Stitch.Compute.closure.json","sha256":"06b7cc10c8d42e21eb6e501109cb74a118affdd8238a88931c6120d9a0766eee"},{"byte_length":11327,"kind":"lexicon-closure","path":"lexicons/Stitch.Custody.closure.json","sha256":"b7fe5d92221e76374369911927d1bf4199ae0d3e5a4ba941cf101a034647cb25"},{"byte_length":11327,"kind":"lexicon-closure","path":"lexicons/Stitch.Effects.closure.json","sha256":"a1537fdd1fa3f15c1ef42f0c0b1b9a50fee89ed935c74354079d0aa36a22e378"},{"byte_length":11328,"kind":"lexicon-closure","path":"lexicons/Stitch.Encoding.closure.json","sha256":"d4685c2870e98633ba5516663192d9d53c112f9716900cce7b795a0000317c8e"},{"byte_length":11328,"kind":"lexicon-closure","path":"lexicons/Stitch.Evidence.closure.json","sha256":"85874b40765253298434b65c51a000dab3596d5dbad5b202b1181ebf7a077d73"},{"byte_length":11329,"kind":"lexicon-closure","path":"lexicons/Stitch.Fragments.closure.json","sha256":"6fce6de8c32d4c23d83b5ea8f93f58abed2f21cf0119b24e506805437fc965f2"},{"byte_length":11328,"kind":"lexicon-closure","path":"lexicons/Stitch.Identity.closure.json","sha256":"fa936927c90b23841f9c9e6c0baea593636f49971ec5e88b04351ceb588f3a80"},{"byte_length":11331,"kind":"lexicon-closure","path":"lexicons/Stitch.Observation.closure.json","sha256":"561f9cd0302434b3e5f814b6735b04a1521a7f5136e61bed485b1c1617a7005e"},{"byte_length":11327,"kind":"lexicon-closure","path":"lexicons/Stitch.Pointer.closure.json","sha256":"60468a862ff4e7c44967a0e61b220e30a860169bfdc9eaaa1ef266f601093318"},{"byte_length":11328,"kind":"lexicon-closure","path":"lexicons/Stitch.Recovery.closure.json","sha256":"1f58d973e6be78258641899545d184a711c0b0e247e4d4ad3e7b76db9733e67c"},{"byte_length":11325,"kind":"lexicon-closure","path":"lexicons/Stitch.Relay.closure.json","sha256":"34d6778aa3f92ef189c0e6d5fa1ac642762654ea33a4affd836997bf57996e66"},{"byte_length":11329,"kind":"lexicon-closure","path":"lexicons/Stitch.Signaling.closure.json","sha256":"c5e938cf9a50f9104c4d2aad11cf08159636ef7f34ee186c6af4e824d60f1c86"},{"byte_length":11326,"kind":"lexicon-closure","path":"lexicons/Stitch.System.closure.json","sha256":"747e847d37ca4b275cc10bbe6f91909832b1b7c391ac14216a1061fd2748ee9a"},{"byte_length":11336,"kind":"lexicon-closure","path":"lexicons/Stitch.VmAdministration.closure.json","sha256":"b283548ebd018072b126b427c6579a5629715f5caa038b4236bf2d954657d947"},{"byte_length":12598,"kind":"lexicon-closure","path":"lexicons/StitchApp.closure.json","sha256":"bcade18b5ae34e3444bc842a1e10dbc1a4435bca56dc8adc7f9310b4451ce757"},{"byte_length":4256,"kind":"map","path":"maps/StitchModel/Foundation/Arch.map.json","sha256":"f4c345d71360f6b906afdb8d41610416033439c7df1da00b1daffc733a1170c3"},{"byte_length":3609,"kind":"map","path":"maps/StitchModel/Foundation/Bytes.map.json","sha256":"c35524708d27ac191cf393f4ff135ed2b812585933f7e54a0484296a9b906a9b"},{"byte_length":2395,"kind":"map","path":"maps/StitchModel/Foundation/View/Text/V1/Model.map.json","sha256":"1aa03afc8e92efecf02ebbefa5796947c6271a6d72e8cf8979384dea97b7b9cb"},{"byte_length":18364,"kind":"map","path":"maps/StitchModel/Product/Architecture.map.json","sha256":"148f318ec7aacb3219877827f06f31eb9405ba54dd97b8aa5fa6edaa3df5d6e9"},{"byte_length":42797,"kind":"map","path":"maps/StitchModel/Product/Experience.map.json","sha256":"2e268c6037120aee5d0b396304599a9847524fff2b8d4dc7df12b180dbb988c2"},{"byte_length":10128,"kind":"map","path":"maps/StitchModel/Product/Host.map.json","sha256":"0128c72773b4be44f783bb9ac7ccaffb98a5cbd02aa74c4133709df0f98343b0"},{"byte_length":38727,"kind":"map","path":"maps/StitchModel/Product/Model.map.json","sha256":"cddd982d2e43e5df28058c80d57983b0ed4d0105b30ad5ef434cbea51b1d8eb6"},{"byte_length":8126,"kind":"map","path":"maps/StitchModel/Stitch/Authority.map.json","sha256":"35a7f00874bbde684f37d6102d4d5ff8b5a23903e9359cb73d537975e0f8c5dc"},{"byte_length":53140,"kind":"map","path":"maps/StitchModel/Stitch/Budget.map.json","sha256":"4a5da96920182c494efab815adc08792f9ca7a19f661997bc594530209d31117"},{"byte_length":2669,"kind":"map","path":"maps/StitchModel/Stitch/ChannelFlow.map.json","sha256":"83c6a98dfdf8dc087259254a17056bb157ac01ad52d7cda4ebd02d76c09e2f79"},{"byte_length":29738,"kind":"map","path":"maps/StitchModel/Stitch/Compute.map.json","sha256":"f2a81da21246c38674bd59a011a9c5fcf62b87166ac61ea3dcae03bcbacb0c06"},{"byte_length":32756,"kind":"map","path":"maps/StitchModel/Stitch/Custody.map.json","sha256":"b45509fbaaf5797a1d0d5bd28de664bbbec2568c14ab15375cf82fe38f842cc2"},{"byte_length":24002,"kind":"map","path":"maps/StitchModel/Stitch/Effects.map.json","sha256":"c11b641f9f56eac1104865afb9c7f8cc81751d6309450a946ad4cc9a383092e9"},{"byte_length":4592,"kind":"map","path":"maps/StitchModel/Stitch/Encoding.map.json","sha256":"0cc9dcdaba62c704cbd668a43f6402055695961e4a4e85c71ab1317fa3bff2f4"},{"byte_length":7522,"kind":"map","path":"maps/StitchModel/Stitch/Evidence.map.json","sha256":"08953ec8025a87d7db411ffdc9a70c7b4977d8c722d48875c3c0539085876452"},{"byte_length":8153,"kind":"map","path":"maps/StitchModel/Stitch/Fragments.map.json","sha256":"b4b18ed1093e7681674d35eb89ba274f04e99e3f331bf36b973ba1fab9f22a60"},{"byte_length":3297,"kind":"map","path":"maps/StitchModel/Stitch/Identity.map.json","sha256":"0305407ee0e86d8496b0e35c228976e7c9f678d53f11ec4659fc89553b6ff945"},{"byte_length":3959,"kind":"map","path":"maps/StitchModel/Stitch/Observation.map.json","sha256":"01cc28e43aa8542a20e43b85df587d60724e2716c611fe75394f616cd82b2fa6"},{"byte_length":4923,"kind":"map","path":"maps/StitchModel/Stitch/Pointer.map.json","sha256":"d46adeceb5b100e4af5d7b21214ee7330f2798c99c01e9506d56a905755f291f"},{"byte_length":4273,"kind":"map","path":"maps/StitchModel/Stitch/Recovery.map.json","sha256":"e3ebd94aacf38ce4fe61b7e013f376215f6ec860e867fe3adeff72fb4189800d"},{"byte_length":9099,"kind":"map","path":"maps/StitchModel/Stitch/Relay.map.json","sha256":"6afafcb7c6f77663e30c220267fa88ee263b29985e9ac260122b1eb525dd0c87"},{"byte_length":1706,"kind":"map","path":"maps/StitchModel/Stitch/Signaling.map.json","sha256":"7ec8c7078fb93156eef1f8bab71348fa85c3a64e0280c5f312e0fabc7c969afa"},{"byte_length":16726,"kind":"map","path":"maps/StitchModel/Stitch/System.map.json","sha256":"4555bb2cfcb54748b7a2d89aca4cbd0e4ae33406420950e75cecaf562f2f5e66"},{"byte_length":7838,"kind":"map","path":"maps/StitchModel/Stitch/VmAdministration.map.json","sha256":"66d9f595a6a2b1aa117a66a66b9ad49c4cbd48d2dc7df324a543b31d44967c0f"},{"byte_length":5558,"kind":"map","path":"maps/StitchModel/StitchApp.map.json","sha256":"3be2797fe9a9fd3d3764c650189c1d11a557144211f73331ae52e37301dc7cf1"},{"byte_length":2904,"kind":"tex","path":"modules/StitchModel/Foundation/Arch.tex","sha256":"fa3e3182d9d5fc5ea22dba4de33e860aeb09f1ef0e19ec924f0b3d5b964c7257"},{"byte_length":2411,"kind":"tex","path":"modules/StitchModel/Foundation/Bytes.tex","sha256":"fe6e59cb58d9eed864aef062f756000d515534ffa248765fb6385335833bd60b"},{"byte_length":2293,"kind":"tex","path":"modules/StitchModel/Foundation/View/Text/V1/Model.tex","sha256":"3b141dfda1c664d6283350a6b8f47acec969f181f66f42e7fba774679dedc591"},{"byte_length":22400,"kind":"tex","path":"modules/StitchModel/Product/Architecture.tex","sha256":"f6785c698c8d68d2aa23c855024146e37b882d6e785e99350ee676833f05c896"},{"byte_length":58721,"kind":"tex","path":"modules/StitchModel/Product/Experience.tex","sha256":"9aedffbb36d45a6384a0c27743529d2960b60509b313c7c85d4e394424f43f34"},{"byte_length":14237,"kind":"tex","path":"modules/StitchModel/Product/Host.tex","sha256":"bddac32df1d8ee33386c79970a742a212b7ff26c8ff7846e37cacabd4ece7f0c"},{"byte_length":66292,"kind":"tex","path":"modules/StitchModel/Product/Model.tex","sha256":"3c015c9ea7a1f352d571c509636230c20a25380eab0831379edd5657f4cb0372"},{"byte_length":8749,"kind":"tex","path":"modules/StitchModel/Stitch/Authority.tex","sha256":"7ddde7e38ac4a361bf8a5bb250ac16ec58f8daeb477c02b79c289db728057d49"},{"byte_length":72932,"kind":"tex","path":"modules/StitchModel/Stitch/Budget.tex","sha256":"de267c621802d99f99079026a76ecd443cb737d81d05ee4c52aec10d0367f698"},{"byte_length":2177,"kind":"tex","path":"modules/StitchModel/Stitch/ChannelFlow.tex","sha256":"affdf490a72c98c34ebeb9cf8abe9b444b4377b6267f2b54889dc565fd65466b"},{"byte_length":44939,"kind":"tex","path":"modules/StitchModel/Stitch/Compute.tex","sha256":"586072ae82a56c29c58d2ff510546eb8bd883fc6df5419a1dcafb04fea2acd7b"},{"byte_length":54582,"kind":"tex","path":"modules/StitchModel/Stitch/Custody.tex","sha256":"8f3c8254811ca22240d4c158d58cfb8015dd1136c9a7bcb618e91823469dfbc5"},{"byte_length":29995,"kind":"tex","path":"modules/StitchModel/Stitch/Effects.tex","sha256":"ff4003135665c5926a84069574f8681a8e57ff83b404420c8c09cc9b4d07886d"},{"byte_length":4594,"kind":"tex","path":"modules/StitchModel/Stitch/Encoding.tex","sha256":"d94f1d53609a2ce7200299a99bf1c9578fb7e22273912797fbde55fbfa88196c"},{"byte_length":13395,"kind":"tex","path":"modules/StitchModel/Stitch/Evidence.tex","sha256":"7187305141df657b7315f393013667ac04674bf4242fcc976083f9dd755a72a3"},{"byte_length":7494,"kind":"tex","path":"modules/StitchModel/Stitch/Fragments.tex","sha256":"b64ace4d5d43bec4c4d0015e11e43b6754223cd3ed20eca7370d66b6a6b895c0"},{"byte_length":3117,"kind":"tex","path":"modules/StitchModel/Stitch/Identity.tex","sha256":"5a4bfa83020c9373122da82aaef40f65073434fe21d4e21292e1f38af903453d"},{"byte_length":4154,"kind":"tex","path":"modules/StitchModel/Stitch/Observation.tex","sha256":"d787ff34779abccdc2b9435768063e213d904f5a63f12a5f8eb94400e74ac3b7"},{"byte_length":6751,"kind":"tex","path":"modules/StitchModel/Stitch/Pointer.tex","sha256":"2f8be39e8442b896efa3e45d9326adce3b0b08833c5f2ddfa82d53b802b4d39a"},{"byte_length":4574,"kind":"tex","path":"modules/StitchModel/Stitch/Recovery.tex","sha256":"cdb643fe7ca7bde1a63b5f9afb3d51a5208215effe4b70506eceee4b2f08ddcc"},{"byte_length":12083,"kind":"tex","path":"modules/StitchModel/Stitch/Relay.tex","sha256":"4a5197ad593047c09504565af4e9f1fd62d308440fc66b8111bc0509fdeab775"},{"byte_length":1027,"kind":"tex","path":"modules/StitchModel/Stitch/Signaling.tex","sha256":"57c4f9d8021e498d2c8814d1c32b412208aa6086c471d757fc79e16611b5410c"},{"byte_length":26861,"kind":"tex","path":"modules/StitchModel/Stitch/System.tex","sha256":"66846e57a3a7dce4a05812e989398fb29c825dcfa68c94185e490bbaeded9ada"},{"byte_length":6503,"kind":"tex","path":"modules/StitchModel/Stitch/VmAdministration.tex","sha256":"a8bdd0398b65cc97e9d59278ac4a2ce86e3b616eab9a505bf109c6bd701647b5"},{"byte_length":17064,"kind":"tex","path":"modules/StitchModel/StitchApp.tex","sha256":"8d35554fc3002e168d6f0b91d475f7de448882d108fc47041c847618f0d98946"}],"project":"stitch-recoverable-service","selection":["Foundation.Arch","Foundation.Bytes","Foundation.View.Text.V1.Model","Product.Architecture","Product.Experience","Product.Host","Product.Model","Stitch.Authority","Stitch.Budget","Stitch.ChannelFlow","Stitch.Compute","Stitch.Custody","Stitch.Effects","Stitch.Encoding","Stitch.Evidence","Stitch.Fragments","Stitch.Identity","Stitch.Observation","Stitch.Pointer","Stitch.Recovery","Stitch.Relay","Stitch.Signaling","Stitch.System","Stitch.VmAdministration","StitchApp"],"semantic_id":"6629359d26d7d175e5e1766d87d3065a47b78791613ff4f16789889eedee0bdc","source_id":"405f944b887ec154055f62947986ca89c2dbb7114d3fc9d014e880b32253b445","spec":"lexlean/build-manifest/1"} diff --git a/product/source-verification.json b/product/source-verification.json new file mode 100644 index 0000000..4a9ecbb --- /dev/null +++ b/product/source-verification.json @@ -0,0 +1,284 @@ +{ + "format": "Stitch exact-source verification summary", + "version": 1, + "assurance": "Summary of actual pinned LexLean/Lean/leanchecker/axiom verification; not a native Prism artifact certificate or whole-host guarantee", + "attestation_id": "f85d00e01268644324d3a86938d5270228a14dc7d1ca2a6eaaf0c8fd8011512c", + "attestation_sha256": "cf5469e565e352f3152e631df86645feb3741bb1866f5e495fbbca5bfcf845e9", + "source_id": "405f944b887ec154055f62947986ca89c2dbb7114d3fc9d014e880b32253b445", + "semantic_id": "6629359d26d7d175e5e1766d87d3065a47b78791613ff4f16789889eedee0bdc", + "build_id": "3620ec55cbea22062aaabf69fede3f08fd24d378cd0969c306c62a60aee7103e", + "status": "verified", + "module_count": 25, + "declaration_audits": 1324, + "successful_processes": 85, + "processes_by_tool": { + "lean": 57, + "leanchecker": 28 + }, + "sources": [ + { + "path": "app/lake-manifest.json", + "sha256": "1107bc06d0f0bf1716fbc980995e4895f608331a17863d16bb1ff631d70924f6" + }, + { + "path": "app/lakefile.toml", + "sha256": "f93d661ae8380e42c7954c0a90166abb296ac100af42b403d7af0ac7e6b50094" + }, + { + "path": "app/language/prism.arch/entries/arch-component-kind.toml", + "sha256": "bb54f236dd64badfc74d57ee43a0f4d886786b9270edb07347f062541bec613e" + }, + { + "path": "app/language/prism.arch/entries/arch-component.toml", + "sha256": "ef7345b3d4cb74e68c5da598895f13cd887cca2d2247058a1fd062adc2597c50" + }, + { + "path": "app/language/prism.arch/entries/arch-concern.toml", + "sha256": "e2b1b3f560e85d0fb51f75b19b1c18b9f5f83f48eaf952b6c9a9a75ae73f3248" + }, + { + "path": "app/language/prism.arch/entries/arch-edge-kind.toml", + "sha256": "333c549f1db8311e47c74e391839649e20ba45495f6c40843348a45588db444f" + }, + { + "path": "app/language/prism.arch/entries/arch-edge.toml", + "sha256": "3a9d18d8e28a3a3b50be9d1315037fd2c426d56cfc8e2f6115a4b0785e6a5840" + }, + { + "path": "app/language/prism.arch/entries/arch-model-kind.toml", + "sha256": "ccb283501e64ab83914728371e1e2fdf8301837bc502804c4bd18c1d49128ada" + }, + { + "path": "app/language/prism.arch/entries/arch-stakeholder.toml", + "sha256": "f8e4bc507df3cf0e384d6c9a92912500ddca2004be3cfeede0f3cc3d38a04ec7" + }, + { + "path": "app/language/prism.arch/entries/arch-standard-reference.toml", + "sha256": "07e3dcf71b75ee0dcfe8441894e5ad3744f042577c502619b3bedb787c86ca1b" + }, + { + "path": "app/language/prism.arch/entries/arch-text-application-model.toml", + "sha256": "6d92d1a7d29d4516dde60bd9539e758b1076dfbf889860e3e435f289c504b9d1" + }, + { + "path": "app/language/prism.arch/entries/arch-view-class.toml", + "sha256": "ef9465462b1adcf5c36b10b2669f03057d5215bbfd10e863db58e81727408fdb" + }, + { + "path": "app/language/prism.arch/entries/arch-view.toml", + "sha256": "2bee3378b0f94165eb8f023279eaab32ec70c5e112e3c06bce7237a1498e0e31" + }, + { + "path": "app/language/prism.arch/entries/arch-viewpoint-class.toml", + "sha256": "c1efce0dd43342b471433ae8a89d7cc46876d54ef3200aed8e08e817f36795cf" + }, + { + "path": "app/language/prism.arch/entries/arch-viewpoint.toml", + "sha256": "a6f53b7f4c58950d7230fb6445a35a80e3a93772fb024b5e7c09381c10cd466c" + }, + { + "path": "app/language/prism.arch/entries/holo-flat-validation-input.toml", + "sha256": "e3a0cf83efd144e1aa3ed6ce5b67ea3bed1df1c4f198c71655c817b65b1d0108" + }, + { + "path": "app/language/prism.arch/entries/holo-normalized-model.toml", + "sha256": "5f7f66774560717cfa55842e30e8fc1b097e1e038b0eba6da6ea3312b583080e" + }, + { + "path": "app/language/prism.arch/entries/holo-standards-profile.toml", + "sha256": "1cf436bcdcc986f4ffcb41db1f31eba74aab4e534a867b4dc5d6d6cf7523417d" + }, + { + "path": "app/language/prism.arch/entries/prism-bounded-byte-buffer.toml", + "sha256": "9b8f6d61f42389a8e63bfbac674ec1b3061f5f004adda8279158df549ee7c902" + }, + { + "path": "app/language/prism.arch/entries/prism-browser-system-model.toml", + "sha256": "3ba45fd6754e84290033a4f18ebc06f5338c8e8affd5e58ee95b07e572fcf42b" + }, + { + "path": "app/language/prism.arch/entries/prism-production-system-model.toml", + "sha256": "91df8207b685a56ba0f0032ed06e875f707202789d21aa3cb6e8b31b4855fb34" + }, + { + "path": "app/language/prism.arch/entries/prism-unicode-text-codec.toml", + "sha256": "7c296475b0a97eccee73eb522af93359eaf185b04571e280b01d394b20f9e1e1" + }, + { + "path": "app/language/prism.arch/lexicon.toml", + "sha256": "14c95df8b512edacacdb1788b58ae90cf573b4e3f1dca0e41074bfde5a380c9f" + }, + { + "path": "app/language/stitch.domain/entries/stitch-budget.toml", + "sha256": "0bba5b43f718ceefbe562a5f08ad29c8724071ccf4464c4bf91860288428d8f9" + }, + { + "path": "app/language/stitch.domain/entries/stitch-checkpoint.toml", + "sha256": "4d52a393476ad8e6944092fba2255b733a2980ca1c200e8e897d6b08e8e1a62a" + }, + { + "path": "app/language/stitch.domain/entries/stitch-encoding.toml", + "sha256": "7e1624765b469c5519fc07888d480477aaf20ab0d14adc2ace1b394939fff543" + }, + { + "path": "app/language/stitch.domain/entries/stitch-evidence.toml", + "sha256": "7bbbe2db8b2970c5b9943e499d1f67ee0e965d9330556f7ab9b428da8c6b6fba" + }, + { + "path": "app/language/stitch.domain/entries/stitch-fragment.toml", + "sha256": "6ecf049cdb84d7b134022012e38c5e1a114471f3b0330fd22aa6e39a1e5af8b1" + }, + { + "path": "app/language/stitch.domain/entries/stitch-object.toml", + "sha256": "9713cff899bf01e9cddbd9599e3ea70395d089b3296c79ffa5cdc1c364329714" + }, + { + "path": "app/language/stitch.domain/entries/stitch-observation.toml", + "sha256": "3ee41f31ef11a0d4fc1b54674c9bd0a55870bd7ec29354b5e189a35ca0cc3579" + }, + { + "path": "app/language/stitch.domain/entries/stitch-placement.toml", + "sha256": "2dfa9c8901fa29b87f33aff74305a72dac70a2f79ca9a480d6790d03cf51b0b2" + }, + { + "path": "app/language/stitch.domain/entries/stitch-pointer.toml", + "sha256": "fbe10dae37ae4a6ef039a7ec38585da18a434b4f8266ab285a4c85b35d3df23b" + }, + { + "path": "app/language/stitch.domain/entries/stitch-service-model.toml", + "sha256": "4277ffc608483787cffbd79f05cfbd7ede7db687549ee0c5ce7b4dbe8bd422d9" + }, + { + "path": "app/language/stitch.domain/lexicon.toml", + "sha256": "6b9d7544b96a6c0bbeacb5dd9972377ffa4f9ef23dffc92eb191bd90e39cc98d" + }, + { + "path": "app/lean-toolchain", + "sha256": "8e3538e0ab5f81a3ee04927d8838c8c674e0e112838b4b3ce87ec218143276af" + }, + { + "path": "app/lexlean.lock", + "sha256": "b4ad976755fbf8fecba998843d238c57da3bf291bbb142f3cf86f9e125acc3fb" + }, + { + "path": "app/lexlean.toml", + "sha256": "48c90de5fb9896bb45b03cc11692ccd1c26c99fadcc0ec4d7c6c2f481da6f56f" + }, + { + "path": "app/prism.toml", + "sha256": "5445be94ddceff0efdf9492eab20e7746ba7b3533ae4853607c7b72a185b18c9" + }, + { + "path": "app/prismpm.toml", + "sha256": "9469bbd2a7dd5d844f0e2d0b83b931b4a988f24d21e03f5ee9433fcab1ebe02e" + }, + { + "path": "app/src/Foundation/Arch.lex.tex", + "sha256": "54fdc8eb15c46707e445ff99814d6cbd1731967f801bf064a6c1f4cc01c45394" + }, + { + "path": "app/src/Foundation/Bytes.lex.tex", + "sha256": "ce16e5b439128db3231979381f4599d3ff0617f62c2bf00c348bba35393abcd6" + }, + { + "path": "app/src/Foundation/View/Text/V1/Model.lex.tex", + "sha256": "db124343ad8fe1295bc8eb305c7f59f83cf6ad76d46a5cabea500fe66f3ad5dc" + }, + { + "path": "app/src/Product/Architecture.lex.tex", + "sha256": "d5cc5fd4e64070bddd5c0edc8cb3a318a0965b5e1574efe9a9dfa483b12e8d6d" + }, + { + "path": "app/src/Product/Experience.lex.tex", + "sha256": "6f2625fdce3d3d51899cabc17ce3d57ec0a9381dd3bf3e6477da6ae3ccfb84bd" + }, + { + "path": "app/src/Product/Host.lex.tex", + "sha256": "3bb2a621868dc683e776c9b65c58cc60cc2b89e5d007d54c4c152bedd4878871" + }, + { + "path": "app/src/Product/Model.lex.tex", + "sha256": "281fcf4954a28d3afa3fd86fda167541207ef572f16cb3a853aa1fb43216ebed" + }, + { + "path": "app/src/Stitch/Authority.lex.tex", + "sha256": "10afc7af1503f08fe7806dbab24d93f565f34370e3b7d18135f48297e64ee573" + }, + { + "path": "app/src/Stitch/Budget.lex.tex", + "sha256": "581ae188297e3e03e69869a3cfbcdae9554706e007cbeb238d97c8ad30229911" + }, + { + "path": "app/src/Stitch/ChannelFlow.lex.tex", + "sha256": "7f4356ddd38fc94b32a2d6af237ce7382c34bdc7db43c8e8d6ab94cd94fc3e63" + }, + { + "path": "app/src/Stitch/Compute.lex.tex", + "sha256": "ef0f1b8dcf15a8ff26a206b7bd8fa51736bb54ae14e7b6e71a4296deeb4528b7" + }, + { + "path": "app/src/Stitch/Custody.lex.tex", + "sha256": "e9084ba97058adfd3017e634215af1dee12d89c4ff0d409a4271f05387d8d663" + }, + { + "path": "app/src/Stitch/Effects.lex.tex", + "sha256": "7ccc2c30cca7df663541ceece0c85226f921160f56f4ec681703a8d5b589263b" + }, + { + "path": "app/src/Stitch/Encoding.lex.tex", + "sha256": "75b412ab0ed56dea3aa41cc77705fb6233991ea1c2e600a7cf509c3b84e5a95f" + }, + { + "path": "app/src/Stitch/Evidence.lex.tex", + "sha256": "39011e1cf70295427f716d328b1ab754242d3667f0e70a8a48dffa735465c79e" + }, + { + "path": "app/src/Stitch/Fragments.lex.tex", + "sha256": "5cd8d0602cbe501ae4ffc5c18dde17fc6e5766d930ac1d9277545d1ef8d88b83" + }, + { + "path": "app/src/Stitch/Identity.lex.tex", + "sha256": "c4c159234e1623b8f339e86cf47da55c89d197bf21fe334bd893f575ba053870" + }, + { + "path": "app/src/Stitch/Observation.lex.tex", + "sha256": "fe3205a68576d8c7d82f86b45b78f8b6c8b49a873f00c448cccb2eb459749ae8" + }, + { + "path": "app/src/Stitch/Pointer.lex.tex", + "sha256": "10239748c402cdadfc36b150a7a103dfe5124d81fa27bb276575810470c89c46" + }, + { + "path": "app/src/Stitch/Recovery.lex.tex", + "sha256": "4a29e91526ffd1c5aa9fcfc8d990ca1b89d5129813742d9ae55e688eeb6a9121" + }, + { + "path": "app/src/Stitch/Relay.lex.tex", + "sha256": "26a3b5c7f8af3cb058800716a5b73111adbe0188436ae1ad87e1a0e6ce118a03" + }, + { + "path": "app/src/Stitch/Signaling.lex.tex", + "sha256": "97bdfb5160e41a4ed3ab30788f2e3a558836f622c237e4bd3496536212b330c9" + }, + { + "path": "app/src/Stitch/System.lex.tex", + "sha256": "b05a639514a2c56f40b8e960c6cf31023aec8b20d1c18c5ed68a0a936a9d7119" + }, + { + "path": "app/src/Stitch/VmAdministration.lex.tex", + "sha256": "4c27a3a3d1b3650aa78d8fe22b6f07a7335d7e9ec58969ad50f7ad9294f30f81" + }, + { + "path": "app/src/StitchApp.lex.tex", + "sha256": "ffd8a4b6b9072b27b06d67d61e1c11d085a6b82e84be4610f27f3805d87f675b" + } + ], + "not_covered": [ + "Native Prism/Holo and guest artifact build", + "Browser/provider/VM correctness and physical network trials", + "Licensing and release qualification", + "Handwritten host-code representation correspondence beyond named runtime tests" + ], + "attestation_path": "product/source-attestation.json", + "build_manifest_path": "product/source-build-manifest.json" +} diff --git a/scripts/check-model-sdk.sh b/scripts/check-model-sdk.sh new file mode 100755 index 0000000..58e89c3 --- /dev/null +++ b/scripts/check-model-sdk.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# Run only inside the immutable SDK selected by prismpm.lock. +# --prepare is an authoring writer, never a release gate. It writes the source +# lock and canonical formatting. Axiom policies still require prism-code axioms. +set -eu +cd "$(dirname "$0")/.." +mode=${1:---check} +case "$mode" in --check|--prepare) ;; *) echo 'usage: scripts/check-model-sdk.sh [--check|--prepare]' >&2; exit 64;; esac +for tool in lexlean prismpm; do + command -v "$tool" >/dev/null 2>&1 || { echo "required pinned SDK executable missing: $tool" >&2; exit 69; } +done +[ -f /opt/prismpm/share/standards.lock ] || { echo 'not running in the PrismPM SDK' >&2; exit 69; } +cmp standards.lock /opt/prismpm/share/standards.lock || { echo 'SDK standards lock differs from repository lock' >&2; exit 2; } +prismpm lock check +if [ "$mode" = --prepare ]; then + (cd app && lexlean lock && lexlean fmt --all && lexlean lock && lexlean check) + echo 'Authoring output only. Audit exact axioms with prism-code@0.7.2 axioms --write --project app; review source and lock changes; regenerate JS bindings; then run --check.' + exit 0 +fi +node scripts/check-model.mjs --check +(cd app && lexlean fmt --check && lexlean lock --check) +# The pinned template uses this single owner for source checking, Lean/kernel +# replay, exact axiom audit, generated native code, holo and acceptance vectors. +# A preceding lexlean verify would repeat its proof gate. +prismpm --project app verify diff --git a/scripts/check-model-tests.mjs b/scripts/check-model-tests.mjs new file mode 100644 index 0000000..89ca225 --- /dev/null +++ b/scripts/check-model-tests.mjs @@ -0,0 +1,291 @@ +/** Implementation conformance and planted-defect checks, not a Lean substitute. */ +import { test } from 'node:test'; +import assert from 'node:assert/strict'; +import { cpSync, mkdtempSync, readFileSync, writeFileSync, rmSync } from 'node:fs'; +import { spawnSync } from 'node:child_process'; +import { tmpdir } from 'node:os'; +import { resolve, dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { model, budgetReserveAllowed, budgetSettlementAllowed, pointerSuccessorAllowed, custodyCommitAllowed, checkpointLinkAllowed, modelSourceDigest } from '../src/layer1-uor/generated-model.js'; +const root=resolve(dirname(fileURLToPath(import.meta.url)),'..'); +const call=(name,...args)=>model['Stitch.'+name](...args); +const digest=Object.fromEntries(Array.from({length:8},(_,i)=>['w'+i,BigInt(i)])); +const initialReceipt=index=>({requestRoot:digest,manifestRoot:digest,fragmentRoot:digest,holderId:index,index,observedAt:0,leaseUntil:100,identityAuthenticated:true}); +const placement={manifestRoot:digest,revision:0,holder0:0,holder1:1,holder2:2,active0:true,active1:true,active2:true,receipt0:initialReceipt(0),receipt1:initialReceipt(1),receipt2:initialReceipt(2)}; +test('source binding metadata is explicit and rejects inexact Nat or Boolean inputs',()=>{ + assert.match(modelSourceDigest,/^sha256:[0-9a-f]{64}$/); + for(const value of [-1,1.5,NaN,Infinity,Number.MAX_SAFE_INTEGER+1,'1'])assert.throws(()=>budgetReserveAllowed(value,0,0,1,0,0,1),TypeError); + assert.throws(()=>budgetSettlementAllowed(1,1,1,1),TypeError); + assert.equal(budgetReserveAllowed(2n**64n-1n,0n,1n,2n**64n-1n,0n,0n,1n),false); +}); +test('every selected recovery pair agrees on the complete finite-stream corpus',()=>{ + const end={tag:'End',fields:[]}; + for(let length=0;length<=5;length++)for(let value=0;value<4**length;value++){ + let blocks=end,v=value; + for(let i=0;i>=2;} + for(const tag of ['Systematic','LeftParity','RightParity']){ + const selection={tag,fields:[]}; + assert.deepEqual(call('Fragments.decodePair',call('Fragments.encodeForPair',blocks,selection),selection),blocks); + } + } +}); +test('source budgets preserve charge and recovery transitions preserve valid custody',()=>{ + for(let spent=0;spent<=4;spent++)for(let reserved=0;reserved<=4;reserved++)for(let ceiling=0;ceiling<=5;ceiling++)for(let actual=0;actual<=6;actual++)for(const known of [true,false]){ + const afterSpent=call('Budget.settleSpent',spent,reserved,ceiling,actual,known),afterReserved=call('Budget.settleReserved',reserved,ceiling,actual,known); + assert.ok(afterSpent+afterReserved<=BigInt(spent+reserved)); + if(!known)assert.equal(afterReserved,BigInt(reserved)); + } + for(let active=0;active<8;active++){ + const p={...placement,active0:Boolean(active&1),active1:Boolean(active&2),active2:Boolean(active&4)}; + if(!call('Custody.recoverable',p))continue; + for(let index=0;index<=3;index++)for(let target=0;target<=3;target++)for(const committed of [true,false])assert.equal(call('Custody.recoverable',call('Custody.replaceIndex',p,index,target,committed)),true); + assert.equal(call('Custody.recoverable',call('Custody.retireFirst',p)),true); + } + assert.equal(call('Custody.physicalBytes',[{index:0,holder:0,byteLength:7,retained:true,superseded:true,externalRelay:false,manifestRoot:digest,fragmentRoot:digest,receipt:initialReceipt(0)},{index:1,holder:1,byteLength:9,retained:true,superseded:false,externalRelay:true,manifestRoot:digest,fragmentRoot:digest,receipt:initialReceipt(1)}]),16n); +}); +test('full-byte equality and every external-observation admission flag fail closed',()=>{ + const base={objectRoot:digest,representationRoot:digest,recoveredBytes:Uint8Array.of(0,1,255),expectedBytes:Uint8Array.of(0,1,255),decoderBound:true,dependenciesPresent:true}; + assert.equal(call('Encoding.exactRecovery',base),true); + assert.equal(call('Encoding.exactRecovery',{...base,expectedBytes:Uint8Array.of(0,1,254)}),false); + assert.equal(call('Encoding.exactRecovery',{...base,dependenciesPresent:false}),false); + assert.equal(custodyCommitAllowed(...Array(8).fill(true)),true); + for(let i=0;i<8;i++){const flags=Array(8).fill(true);flags[i]=false;assert.equal(custodyCommitAllowed(...flags),false);} + for(let i=0;i<3;i++){const flags=[true,true,true];flags[i]=false;assert.equal(pointerSuccessorAllowed(4,5,...flags,0,10,1),false);} + assert.equal(checkpointLinkAllowed(true,true,true,true,true,true,1,1,2),false); +}); + +test('the complete source checkpoint verifier replays values rather than trusting a replay flag',()=>{ + const job={jobRoot:digest,inputRoot:digest,initialValue:255,program:{programRoot:digest,modelRoot:digest,bits:8,instructions:[{opcode:4,argument:1},{opcode:2,argument:0}]}}; + const checkpoint={jobRoot:digest,programRoot:digest,inputRoot:digest,modelRoot:digest,step:2,priorRoot:digest,stateRoot:digest,checkpointRoot:digest,value:1}; + assert.equal(call('Compute.checkpointMatchesJob',job,checkpoint),true); + assert.equal(call('Compute.checkpointMatchesJob',job,{...checkpoint,value:2}),false); + assert.equal(call('Compute.checkpointMatchesJob',job,{...checkpoint,step:3}),false); + assert.equal(call('Compute.jobAllowed',job,2),true); + assert.equal(call('Compute.jobAllowed',job,1),false); +}); + +const rootAt=n=>Object.fromEntries(Array.from({length:8},(_,i)=>['w'+i,BigInt(n+i)])); +const resources=(transferBytes=0,storageBytes=0,computeWork=0,refreshRequests=0)=>({transferBytes,storageBytes,computeWork,refreshRequests}); +function migrationFixture(){ + const receipt={requestRoot:rootAt(10),manifestRoot:digest,fragmentRoot:rootAt(20),holderId:3,index:0,observedAt:10,leaseUntil:50,identityAuthenticated:true}; + const transfer={requestRoot:receipt.requestRoot,manifestRoot:receipt.manifestRoot,fragmentRoot:receipt.fragmentRoot,sourceHolder:0,targetHolder:3,index:0,placementRevision:0,phase:{tag:'Requested',fields:[]},receipt}; + const fragment={manifestRoot:digest,encodingRoot:rootAt(30),index:0,payloadRoot:receipt.fragmentRoot,payload:Uint8Array.of(1,2),byteLength:2}; + const custodyPlacement={...placement,receipt0:{...initialReceipt(0),fragmentRoot:rootAt(20)},receipt1:{...initialReceipt(1),fragmentRoot:rootAt(21)},receipt2:{...initialReceipt(2),fragmentRoot:rootAt(22)}}; + const state={objects:[],encodings:[],placement:custodyPlacement,peers:[],pointers:[],jobs:[],checkpoints:[],ledger:{budget:{epoch:0,start:0,end:100,last:0,limit:resources(100,100,100,100),spent:resources(),reserved:resources()},reservations:[]},evidence:[],transfers:[]}; + const integrity={fragmentRoot:receipt.fragmentRoot,encodingRoot:fragment.encodingRoot,index:fragment.index,payload:fragment.payload,digest:{expected:receipt.fragmentRoot,observed:receipt.fragmentRoot,domainMatches:true,canonicalSerializationMatches:true}}; + return {state,transfer,receipt,fragment,integrity,cost:resources(2,2,0,1)}; +} +test('generic action reservation and settlement preserve product validity and the nested ledger semantics',()=>{ + const fixture=migrationFixture(),unknown={actionId:rootAt(60),epoch:0,actual:resources(),outcome:{tag:'Unknown',fields:[]}}; + const state=call('System.settleAction',fixture.state,unknown,0); + for(const kind of ['Place','Repair','Refresh','Checkpoint','Reencode','PublishPointer'])for(let flags=0;flags<8;flags++)for(const now of [0,10,99,100])for(const cost of [resources(),resources(2,3,4,1),resources(101)]){ + const action={actionId:rootAt(60),kind:{tag:kind,fields:[]},cost,preconditionsChecked:Boolean(flags&1),dependenciesPresent:Boolean(flags&2),authorizationChecked:Boolean(flags&4)}; + const admitted=call('Custody.recoverableAt',state.placement,now)&&call('Budget.reserveLedgerAllowed',state.ledger,action.actionId,cost,now)&&action.preconditionsChecked&&action.dependenciesPresent&&action.authorizationChecked; + const expected={...state,ledger:admitted?call('Budget.reserveLedger',state.ledger,action.actionId,cost,now):state.ledger}; + const requested=call('System.requestAction',state,action,now); + assert.deepEqual(requested,expected); + assert.equal(call('System.valid',requested),true); + if(!admitted)continue; + for(const settlementTime of [0,10,99,100])for(const outcome of ['Known','Unknown'])for(const actual of [resources(),cost,resources(102)]){ + const observation={actionId:action.actionId,epoch:0,actual,outcome:{tag:outcome,fields:[]}}; + const allowed=call('Custody.recoverableAt',requested.placement,settlementTime)&&call('Budget.settleLedgerAllowed',requested.ledger,observation,settlementTime); + const expectedSettlement={...requested,ledger:allowed?call('Budget.settleLedger',requested.ledger,observation,settlementTime):requested.ledger}; + const settled=call('System.settleAction',requested,observation,settlementTime); + assert.deepEqual(settled,expectedSettlement); + assert.equal(call('System.valid',settled),true); + assert.deepEqual(settled.placement,state.placement); + } + } +}); +test('typed migration reserves before effects and consumes an exact requested transfer only once',()=>{ + const {state,transfer,receipt,fragment,integrity,cost}=migrationFixture(); + assert.equal(call('System.completeMigrationAllowed',state,transfer,receipt,fragment,integrity,20),false); + assert.equal(call('System.completeMigrationAllowed',{...state,transfers:[transfer]},transfer,receipt,fragment,integrity,20),false); + assert.deepEqual(call('System.applyMigration',state,transfer,receipt,fragment,integrity,20),call('System.requestMigration',state,transfer,resources(101),10)); + const requested=call('System.requestMigration',state,transfer,cost,10); + assert.equal(call('System.valid',requested),true); + assert.deepEqual(requested.placement,call('Custody.replaceIndex',state.placement,3,0,false)); + assert.deepEqual(requested.ledger.budget.reserved,resources(2n,2n,0n,1n)); + assert.equal(requested.transfers.length,1); + assert.equal(call('System.requestMigrationAllowed',requested,transfer,cost,10),false); + const prematurelySettled=call('System.settleAction',requested,{actionId:transfer.requestRoot,epoch:0,actual:resources(),outcome:{tag:'Known',fields:[]}},11); + assert.equal(call('System.completeMigrationAllowed',prematurelySettled,transfer,receipt,fragment,integrity,20),false); + const completed=call('System.applyMigration',requested,transfer,receipt,fragment,integrity,20); + assert.equal(completed.placement.holder0,3n); + assert.equal(completed.placement.revision,1n); + assert.equal(completed.transfers[0].phase.tag,'Committed'); + assert.equal(call('System.valid',completed),true); + assert.deepEqual(completed.ledger.budget.reserved,requested.ledger.budget.reserved); + assert.deepEqual(completed.ledger.budget.spent,requested.ledger.budget.spent); + assert.equal(completed.ledger.budget.last,20n); + assert.deepEqual(completed.evidence,requested.evidence); + assert.equal(call('System.completeMigrationAllowed',completed,transfer,receipt,fragment,integrity,21),false); + assert.deepEqual(call('System.applyMigration',completed,transfer,receipt,fragment,integrity,21),completed); + assert.equal(call('System.requestMigrationAllowed',completed,transfer,cost,22),false); + const next={...transfer,requestRoot:rootAt(90),sourceHolder:3,targetHolder:4,placementRevision:1}; + assert.equal(call('System.requestMigrationAllowed',completed,next,cost,19),false); + assert.equal(call('System.requestMigrationAllowed',completed,next,cost,21),true); + const observation={actionId:transfer.requestRoot,epoch:0,actual:resources(1,1,0,1),outcome:{tag:'Known',fields:[]}}; + const settled=call('System.settleAction',completed,observation,21); + assert.equal(call('Budget.ledgerValid',settled.ledger),true); + assert.equal(call('System.valid',settled),true); + assert.deepEqual(settled.ledger.budget.reserved,resources(0n,0n,0n,0n)); + assert.deepEqual(settled.ledger.budget.spent,resources(1n,1n,0n,1n)); + assert.equal(call('System.settleActionAllowed',settled,observation,22),false); + assert.equal(call('System.requestMigrationAllowed',settled,transfer,cost,22),false); + assert.equal(call('System.settleActionAllowed',completed,{...observation,outcome:{tag:'Unknown',fields:[]}},21),false); + assert.deepEqual(call('System.settleAction',completed,{...observation,outcome:{tag:'Unknown',fields:[]}},21),completed); + +}); +test('typed migration refuses mismatched requests, receipts, fragments, expired leases and stale placement revisions',()=>{ + const {state,transfer,receipt,fragment,integrity,cost}=migrationFixture(); + const requested=call('System.requestMigration',state,transfer,cost,10); + for(const field of ['requestRoot','manifestRoot','fragmentRoot']){ + assert.equal(call('System.completeMigrationAllowed',requested,{...transfer,[field]:rootAt(99)},receipt,fragment,integrity,20),false,field); + assert.equal(call('System.completeMigrationAllowed',requested,transfer,{...receipt,[field]:rootAt(99)},fragment,integrity,20),false,field); + } + for(const [field,value] of [['sourceHolder',9],['targetHolder',9],['index',1],['placementRevision',1]])assert.equal(call('System.completeMigrationAllowed',requested,{...transfer,[field]:value},receipt,fragment,integrity,20),false,field); + for(const [field,value] of [['holderId',9],['index',1],['observedAt',21],['leaseUntil',20],['identityAuthenticated',false]])assert.equal(call('System.completeMigrationAllowed',requested,transfer,{...receipt,[field]:value},fragment,integrity,20),false,field); + for(const [field,value] of [['manifestRoot',rootAt(99)],['payloadRoot',rootAt(99)],['index',1]])assert.equal(call('System.completeMigrationAllowed',requested,transfer,receipt,{...fragment,[field]:value},integrity,20),false,field); + assert.equal(call('System.completeMigrationAllowed',requested,transfer,{...receipt,observedAt:0},fragment,integrity,9),false); + assert.equal(call('System.completeMigrationAllowed',requested,transfer,receipt,fragment,integrity,50),false); + assert.equal(call('System.completeMigrationAllowed',{...requested,placement:{...requested.placement,receipt0:{...requested.placement.receipt0,fragmentRoot:rootAt(99)}}},transfer,receipt,fragment,integrity,20),false); + for(const bad of [ + {...integrity,fragmentRoot:rootAt(99)}, {...integrity,encodingRoot:rootAt(99)}, {...integrity,index:1}, {...integrity,payload:Uint8Array.of(9,9)}, + {...integrity,digest:{...integrity.digest,observed:rootAt(99)}}, {...integrity,digest:{...integrity.digest,domainMatches:false}}, {...integrity,digest:{...integrity.digest,canonicalSerializationMatches:false}} + ])assert.equal(call('System.completeMigrationAllowed',requested,transfer,receipt,fragment,bad,20),false); + const stale={...requested,placement:{...requested.placement,revision:2}}; + assert.equal(call('System.completeMigrationAllowed',stale,transfer,receipt,fragment,integrity,20),false); + for(const phase of ['Acknowledged','Committed','Failed','Uncertain']){ + assert.equal(call('System.requestMigrationAllowed',state,{...transfer,phase:{tag:phase,fields:[]}},cost,10),false); + assert.equal(call('System.completeMigrationAllowed',requested,{...transfer,phase:{tag:phase,fields:[]}},receipt,fragment,integrity,20),false); + } + assert.equal(call('System.requestMigrationAllowed',state,{...transfer,targetHolder:1},cost,10),false); + assert.equal(call('System.requestMigrationAllowed',state,{...transfer,sourceHolder:8},cost,10),false); + assert.equal(call('System.requestMigrationAllowed',state,{...transfer,placementRevision:1},cost,10),false); + assert.equal(call('System.requestMigrationAllowed',state,transfer,resources(101),10),false); + for(const field of ['requestRoot','manifestRoot','fragmentRoot'])assert.equal(call('System.requestMigrationAllowed',state,{...transfer,[field]:{...rootAt(0),w0:2n**32n}},cost,10),false); +}); +test('typed migration preserves every recoverable active mask and rejects unknown or uncertain outcomes',()=>{ + for(let active=0;active<8;active++)for(let index=0;index<3;index++){ + const f=migrationFixture(),p={...f.state.placement,active0:Boolean(active&1),active1:Boolean(active&2),active2:Boolean(active&4)}; + if(!call('Custody.recoverable',p))continue; + const fragmentRoot=rootAt(20+index); + const state={...f.state,placement:p},transfer={...f.transfer,index,sourceHolder:index,fragmentRoot},receipt={...f.receipt,index,fragmentRoot},fragment={...f.fragment,index,payloadRoot:fragmentRoot},integrity={...f.integrity,index,fragmentRoot,digest:{...f.integrity.digest,expected:fragmentRoot,observed:fragmentRoot}}; + const requested=call('System.requestMigration',state,transfer,f.cost,10); + const after=call('System.applyMigration',requested,transfer,receipt,fragment,integrity,20); + assert.equal(call('System.valid',after),true); + if(p['active'+index])assert.equal(after.placement['holder'+index],3n); + else assert.equal(requested.transfers.length,0); + const uncertain=call('Custody.failTransfer',transfer,true); + assert.equal(uncertain.phase.tag,'Uncertain'); + assert.equal(call('Custody.migrationAllowed',p,uncertain,20),false); + } +}); + +test('observations require fresh observer-relative authenticated sequences, and timeout never becomes reachability',()=>{ + const current={observer:1,peer:2,failureDomain:3,observedAt:1,expires:10,sequence:0,reachability:{tag:'Unknown',fields:[]},authenticated:true}; + const candidate={...current,observedAt:10,expires:20,sequence:1,reachability:{tag:'Reachable',fields:[]}}; + assert.equal(call('Observation.acceptObservation',current,candidate,15),true); + for(const [field,value] of [['observer',9],['peer',9],['sequence',0],['observedAt',16],['expires',15],['authenticated',false]])assert.equal(call('Observation.acceptObservation',current,{...candidate,[field]:value},15),false,field); + assert.equal(call('Observation.acceptObservation',{...current,observedAt:12},candidate,15),false); + for(const tag of ['Unknown','Reachable','TimedOut','Conflicting']){ + const observation={...candidate,reachability:{tag,fields:[]}}; + assert.equal(call('Observation.reachableObservation',observation,1,15),tag==='Reachable'); + assert.equal(call('Observation.reachableObservation',observation,9,15),false); + assert.equal(call('Observation.reachableObservation',observation,1,20),false); + } + assert.equal(call('Observation.reachableObservation',{...candidate,authenticated:false},1,15),false); + const kept=call('Observation.updateObservation',current,current,15); + assert.deepEqual(call('Observation.updateObservation',current,{...candidate,expires:15},15),kept); +}); +test('per-copy leases expire at the boundary and expired/superseded retained bytes still count physically',()=>{ + const p={...placement,receipt0:{...initialReceipt(0),leaseUntil:20},receipt1:{...initialReceipt(1),leaseUntil:30},receipt2:{...initialReceipt(2),leaseUntil:40}}; + assert.equal(call('Custody.liveCount',p,19),3n); + assert.equal(call('Custody.liveCount',p,20),2n); + assert.equal(call('Custody.recoverableAt',p,29),true); + assert.equal(call('Custody.recoverableAt',p,30),false); + assert.equal(call('Custody.recoverable',p),true); + const inactiveDuplicate={...placement,active2:false,holder2:0,receipt2:{...initialReceipt(2),holderId:0}}; + assert.equal(call('Custody.recoverableAt',inactiveDuplicate,20),true); + const collocated={...placement,holder1:0,holder2:0,receipt1:{...initialReceipt(1),holderId:0},receipt2:{...initialReceipt(2),holderId:0}}; + assert.equal(call('Custody.recoverableAt',collocated,20),false); + for(const [field,value] of [['manifestRoot',rootAt(99)],['index',2],['holderId',9],['observedAt',21],['identityAuthenticated',false]]){ + const bad={...placement,active2:false,receipt1:{...initialReceipt(1),[field]:value}}; + assert.equal(call('Custody.recoverableAt',bad,20),false,field); + } + const copy={index:0,holder:0,byteLength:7,retained:true,superseded:false,externalRelay:false,manifestRoot:digest,fragmentRoot:digest,receipt:{...initialReceipt(0),leaseUntil:20}}; + assert.equal(call('Custody.physicalCopyLive',copy,19),true); + assert.equal(call('Custody.physicalCopyLive',copy,20),false); + assert.equal(call('Custody.physicalCopyLive',{...copy,superseded:true},19),false); + assert.equal(call('Custody.physicalBytes',[copy,{...copy,superseded:true}]),14n); + const f=migrationFixture(),state={...f.state,placement:{...f.state.placement,active2:false}}; + const requested=call('System.requestMigration',state,f.transfer,f.cost,10); + const completed=call('System.applyMigration',requested,f.transfer,f.receipt,f.fragment,f.integrity,20); + assert.equal(completed.placement.receipt0.leaseUntil,50n); + assert.equal(completed.placement.receipt0.holderId,3n); + assert.equal(call('System.validAt',completed,49),true); + assert.equal(call('System.validAt',completed,50),false); + assert.equal(call('System.requestMigrationAllowed',{...state,placement:p},f.transfer,f.cost,30),false); +}); +function evidenceFixture(){ + const assumptions=Object.fromEntries(['digestCollisionResistance','signatureUnforgeability','authorizedKeyBinding','receiptAuthentication','storageRetentionForLease','independentFailureDomains','monotonicElapsedClock','releasedRuntimeMatchesModel'].map(name=>[name,true])); + const dependencies=[{root:rootAt(70),kind:{tag:'Decoder',fields:[]},byteLength:4,present:true,integrityChecked:true},{root:rootAt(80),kind:{tag:'Basis',fields:[]},byteLength:7,present:true,integrityChecked:true}]; + const bindings={claim:{tag:'Reconstruction',fields:[]},kind:{tag:'KernelChecked',fields:[]},modelRoot:rootAt(1),artifactRoot:rootAt(2),subjectRoot:rootAt(3),assumptionsRoot:rootAt(4),dependencyRoot:rootAt(5),assumptions,dependencies}; + const hostEffects=[{tag:'ReadClock',fields:[]},{tag:'HashBytes',fields:[]}]; + const evidence={...bindings,hostEffects,observedAt:10,validUntil:100,horizon:60,failureBound:1}; + const requested={...bindings,hostEffects:[{tag:'HashBytes',fields:[]}],horizon:20,failures:1}; + return {evidence,requested}; +} +test('typed evidence reuse binds exact claim, evidence kind, identities, named assumptions and dependency snapshots',()=>{ + const {evidence,requested}=evidenceFixture(); + assert.equal(call('Evidence.scopeReusable',evidence,requested,20),true); + for(const name of ['modelRoot','artifactRoot','subjectRoot','assumptionsRoot','dependencyRoot']){ + assert.equal(call('Evidence.scopeReusable',evidence,{...requested,[name]:rootAt(99)},20),false,name); + assert.equal(call('Evidence.scopeReusable',{...evidence,[name]:{...rootAt(0),w0:2n**32n}},requested,20),false,name); + } + for(const tag of ['Integrity','Authorization','PureExecution','Availability','Durability','Confidentiality'])assert.equal(call('Evidence.scopeReusable',evidence,{...requested,claim:{tag,fields:[]}},20),false); + for(const tag of ['Specified','KernelChecked','ImplementationTested','IndependentlyReplayed','FieldMeasured','Refuted','Untested']){ + const kind={tag,fields:[]}; + assert.equal(call('Evidence.scopeReusable',{...evidence,kind},{...requested,kind},20),['KernelChecked','ImplementationTested','IndependentlyReplayed','FieldMeasured'].includes(tag)); + if(tag!=='KernelChecked')assert.equal(call('Evidence.scopeReusable',evidence,{...requested,kind},20),false); + } + for(const name of Object.keys(evidence.assumptions))assert.equal(call('Evidence.scopeReusable',evidence,{...requested,assumptions:{...requested.assumptions,[name]:false}},20),false,name); + for(const [field,value] of [['root',rootAt(99)],['kind',{tag:'Residual',fields:[]}],['byteLength',5],['present',false],['integrityChecked',false]]){ + const dependencies=[{...requested.dependencies[0],[field]:value},requested.dependencies[1]]; + assert.equal(call('Evidence.scopeReusable',evidence,{...requested,dependencies},20),false,field); + } + assert.equal(call('Evidence.scopeReusable',evidence,{...requested,dependencies:[]},20),false); + assert.equal(call('Evidence.scopeReusable',evidence,{...requested,dependencies:[...requested.dependencies].reverse()},20),false); +}); +test('evidence horizons cannot roll forward and host effects cannot expand during reuse',()=>{ + const {evidence,requested}=evidenceFixture(); + assert.equal(call('Evidence.scopeReusable',evidence,{...requested,horizon:50},20),true); + assert.equal(call('Evidence.scopeReusable',evidence,{...requested,horizon:51},20),false); + assert.equal(call('Evidence.scopeReusable',evidence,{...requested,horizon:20},51),false); + assert.equal(call('Evidence.scopeReusable',evidence,requested,9),false); + assert.equal(call('Evidence.scopeReusable',evidence,{...requested,horizon:0},100),false); + assert.equal(call('Evidence.scopeReusable',{...evidence,validUntil:30},requested,20),false); + assert.equal(call('Evidence.scopeReusable',evidence,{...requested,failures:2},20),false); + assert.equal(call('Evidence.scopeReusable',evidence,{...requested,hostEffects:[]},20),true); + assert.equal(call('Evidence.scopeReusable',evidence,{...requested,hostEffects:[{tag:'SendFragment',fields:[]}]},20),false); + assert.equal(call('Evidence.scopeReusable',{...evidence,hostEffects:[]},requested,20),false); + for(const tag of ['ReadClock','SendFragment','PersistFragment','ReadDNS','WriteDNS','ReceivePeer','RunVM','FetchDependency','VerifySignature','HashBytes'])assert.equal(call('Evidence.pureEffectAllowed',{tag,fields:[]}),false); +}); + +function defect(mutator,pattern,mode='--write'){ + const dir=mkdtempSync(join(tmpdir(),'stitch-model-defect-')); + try{ + for(const path of ['scripts/check-model.mjs','app/src','app/language','src/layer1-uor/generated-model.js','src/layer4-compute/replay.js','src/layer1-uor/index.js','src/layer1-uor/contracts.js','src/layer1-uor/custody.js'])cpSync(resolve(root,path),resolve(dir,path),{recursive:true}); + const file=resolve(dir,'app/src/Stitch/Budget.lex.tex');const original=readFileSync(file,'utf8');writeFileSync(file,mutator(original)); + const result=spawnSync(process.execPath,['scripts/check-model.mjs',mode],{cwd:dir,encoding:'utf8'}); + assert.notEqual(result.status,0);assert.match(result.stderr,pattern); + }finally{rmSync(dir,{recursive:true,force:true});} +} +test('planted unsupported syntax, unbound variables, primitive arity and stale outputs are rejected',()=>{ + defect(s=>s.replace('(prim subtract reserved ceiling : Nat)','(prim unknown reserved ceiling : Nat)'),/unsupported primitive/); + defect(s=>s.replace('(prim subtract reserved ceiling : Nat)','(prim subtract reserved ceiling 1 : Nat)'),/unsupported primitive/); + defect(s=>s.replace('(reserved + cost)','(missing + cost)'),/unbound variable/); + defect(s=>s.replace('(reserveAllowed spent reserved cost limit now last end)','(missing spent reserved cost limit now last end)'),/unknown function\/arity/); + defect(s=>s.replace('(reserved + cost)','(reserved + (cost + 1))'),/stale source bindings/,'--check'); +}); diff --git a/scripts/check-model.mjs b/scripts/check-model.mjs new file mode 100644 index 0000000..a201223 --- /dev/null +++ b/scripts/check-model.mjs @@ -0,0 +1,301 @@ +#!/usr/bin/env node +/** + * Reproduce the handwritten host's small pure bindings from the LexLean source. + * This is a strict subset translator, NOT LexLean, Lean, PrismPM, a proof checker, + * or a replacement for the pinned SDK gate. Unsupported syntax is an error. + */ +import { readFileSync, writeFileSync, readdirSync, mkdirSync } from 'node:fs'; +import { createHash } from 'node:crypto'; +import { dirname, resolve, relative } from 'node:path'; +import { fileURLToPath } from 'node:url'; +const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'); +const output = resolve(root, 'src/layer1-uor/generated-model.js'); +const sourceRoot = resolve(root, 'app/src/Stitch'); +// Product.Experience intentionally uses this same declared subset for browser journeys. +const selectedSources = [...readdirSync(sourceRoot).filter(x=>x.endsWith('.lex.tex')).sort().map(x=>resolve(sourceRoot,x)), resolve(root,'app/src/Product/Experience.lex.tex')]; +const modes = new Set(process.argv.slice(2)); +if ([...modes].some(x => !['--write', '--check', '--inventory'].includes(x)) || modes.has('--write') && modes.has('--check')) throw Error('usage: node scripts/check-model.mjs [--write|--check] [--inventory]'); +const hash = value => createHash('sha256').update(value).digest('hex'); +function lex(text) { + const tokens = []; let i = 0; + while (i < text.length) { + const rest = text.slice(i); let m; + if ((m = /^\s+/.exec(rest))) { i += m[0].length; continue; } + if ((m = /^"(?:[^"\\]|\\["\\/bfnrt]|\\u[0-9a-fA-F]{4})*"/.exec(rest))) { tokens.push(m[0]); i += m[0].length; continue; } + if ((m = /^(?:<->|::|:=|<=\?|<\?|=\?|&&|\|\||->|<=|\/\\|[(){}\[\],:+|=<>;]|[0-9]+|[A-Za-z_][A-Za-z0-9_'.-]*)/.exec(rest))) { tokens.push(m[0]); i += m[0].length; continue; } + throw Error(`unsupported token at ${i}: ${JSON.stringify(rest.slice(0, 40))}`); + } + return tokens; +} +function split(tokens, sep) { + const out = []; let start = 0; const stack = []; + const close = {')':'(',']':'[','}':'{'}; + for (let i = 0; i < tokens.length; i++) { + const t = tokens[i]; + if (['(', '[', '{'].includes(t)) stack.push(t); + else if (Object.hasOwn(close,t)) { if (stack.pop() !== close[t]) throw Error('unbalanced source delimiters'); } + else if (t === sep && !stack.length) { out.push(tokens.slice(start,i)); start=i+1; } + } + if (stack.length) throw Error('unbalanced source delimiters'); + out.push(tokens.slice(start)); return out; +} +function fields(tokens) { + if (tokens[0] !== '{' || tokens.at(-1) !== '}') throw Error('expected declaration record'); + const result = Object.create(null); + for (const part of split(tokens.slice(1,-1), ',')) { + if (part.length < 3 || part[1] !== ':' || Object.hasOwn(result,part[0])) throw Error(`bad/duplicate field ${part.join(' ')}`); + result[part[0]] = part.slice(2); + } + return result; +} +function list(tokens) { if (tokens[0] !== '[' || tokens.at(-1) !== ']') throw Error('expected array'); return tokens.length === 2 ? [] : split(tokens.slice(1,-1),','); } +function single(tokens) { if (tokens?.length !== 1) throw Error(`expected atom: ${tokens?.join(' ')}`); return tokens[0]; } +function member(tokens) { if (tokens.length === 1) return tokens[0]; if (tokens.length === 3 && tokens[1] === '::') return `${tokens[0]}::${tokens[2]}`; throw Error('invalid member'); } +function type(tokens) { + if (tokens[0] === '(' && tokens.at(-1) === ')') { const inner=tokens.slice(1,-1); if (['List','Option'].includes(inner[0])) return { kind:inner[0],element:type(inner.slice(1)) }; throw Error(`unsupported type ${tokens.join(' ')}`); } + return {kind:member(tokens)}; +} +function parameters(tokens) { + return list(tokens).map(xs => { if (xs[1]!==':') throw Error('invalid parameter'); return {name:xs[0],type:type(xs.slice(2))}; }); +} +class TermParser { + constructor(tokens) { this.tokens=tokens; this.i=0; } + peek() { return this.tokens[this.i]; } + take(want) { const got=this.tokens[this.i++]; if (want!==undefined && got!==want) throw Error(`expected ${want}; found ${got} at ${this.i-1}`); return got; } + name() { const a=this.take(); return this.peek()==='::' ? (this.take(), a+'::'+this.take()) : a; } + term() { + const t=this.take(); + if (/^\d+$/.test(t)) return {k:'nat',value:t}; + if (t==='true'||t==='false') return {k:'bool',value:t==='true'}; + if (t?.startsWith('"')) return {k:'string',value:JSON.parse(t)}; + if (t==='(') { + const first=this.peek(); let out; + if (first==='if') { this.take(); const cond=this.term(); this.take('then'); const yes=this.term(); this.take('else'); const no=this.term(); out={k:'if',cond,yes,no}; } + else if (first==='let') { this.take(); const name=this.take(); this.take(':'); const ty=[]; while(this.peek()!==':=') ty.push(this.take()); this.take(':='); const value=this.term(); this.take(';'); const body=this.term(); out={k:'let',name,type:type(ty),value,body}; } + else if (first==='project') { this.take(); out={k:'project',value:this.term(),field:this.take()}; } + else if (first==='record') { + this.take(); const name=this.name(); this.take('{'); const values=Object.create(null); + while(this.peek()!=='}') { const key=this.take(); this.take(':='); if(Object.hasOwn(values,key)) throw Error('duplicate record assignment'); values[key]=this.term(); if(this.peek()!=='}') this.take(','); } + this.take('}'); out={k:'record',name,values}; + } + else if (first==='prim') { this.take(); const operation=this.take(),args=[]; while(this.peek()!==':') args.push(this.term()); this.take(':'); const ty=[]; let depth=0; while(this.peek()!==')'||depth) { const t=this.take(); if(t==='(')depth++; if(t===')')depth--; ty.push(t); if(this.i>this.tokens.length)throw Error('unclosed primitive'); } out={k:'prim',operation,args,type:type(ty)}; } + else if (first==='match') { + this.take(); const value=this.term(),branches=[]; + while(this.peek()==='|') { this.take(); const constructor=this.name(),binders=[]; while(this.peek()!=='=>') { if(this.peek()==='='&&this.tokens[this.i+1]==='>')break; binders.push(this.take()); if(this.i>this.tokens.length)throw Error('bad match'); } + if(this.peek()==='=>')this.take();else {this.take('=');this.take('>');} branches.push({constructor,binders,body:this.term()}); } + out={k:'match',value,branches}; + } + else if (first==='ctor') { this.take(); const name=this.name(),args=[]; while(this.peek()!==')')args.push(this.term()); out={k:'ctor',name,args}; } + else if (first==='cons') { this.take(); out={k:'cons',head:this.term(),tail:this.term()}; } + else if (first==='nil') { this.take(); const ty=[]; while(this.peek()!==')')ty.push(this.take()); out={k:'nil',type:type(ty)}; } + else if (first==='not') { this.take(); out={k:'not',value:this.term()}; } + else { + const left=this.term(); + if (['+','=?','<=?','tokens.length)throw Error('unclosed declaration'); }while(depth); + let f; try { f=fields(tokens.slice(start,i)); } catch(e) { throw Error(module+' '+tokens.slice(start,start+6).join(' ')+': '+e.message); } const name=single(f.name),id=`${module}.${name}`; + const allowed={definition:['name','parameters','result','body','axioms','recursive_argument','executable','production'],theorem:['name','parameters','statement','proof','axioms'],structure:['name','type_parameters','parameters','fields'],inductive:['name','type_parameters','parameters','constructors']}[kind]; + for(const key of Object.keys(f))if(!allowed.includes(key))throw Error(`${id}: unsupported declaration field ${key}`); + if(kind==='definition') { if(defs[id])throw Error('duplicate definition'); defs[id]={module,name,params:parameters(f.parameters),result:type(f.result),body:new TermParser(f.body).finish()}; } + if(kind==='structure')types[id]={kind,fields:list(f.fields).map(x=>{const ff=fields(x);return{name:single(ff.name),type:type(ff.type)};})}; + if(kind==='inductive')types[id]={kind,constructors:list(f.constructors).map(x=>{const ff=fields(x);return{name:single(ff.name),fields:list(ff.fields).map(type)};})}; + if(kind==='theorem') { if(!f.proof||!f.statement)throw Error('theorem without proof');theorems.push({id,proof:single(f.proof.slice(0,1)),source:relative(root,sourcePath),status:'source-obligation-not-kernel-checked'}); } + } + sources.push({path:relative(root,sourcePath),sha256:hash(text)}); +} +function qualify(module,name) { return name.includes('::') ? name.replace('::','.') : `${module}.${name}`; } +const primitiveArity={subtract:2,multiply:2,quotient:3,remainder:3,equal:2}; +const prims=new Set(Object.keys(primitiveArity)); +function visit(ast,mod,locals) { + if(!ast||typeof ast!=='object')throw Error('invalid AST'); + switch(ast.k) { + case 'nat':case 'bool':case 'string':case 'nil':return; + case 'var':if(!locals.has(ast.name))throw Error(`${mod}: unbound variable ${ast.name}`);return; + case 'call': {const id=qualify(mod,ast.name); if(!defs[id]||defs[id].params.length!==ast.args.length)throw Error(`${mod}: unknown function/arity ${ast.name}`);ast.args.forEach(x=>visit(x,mod,locals));return;} + case 'prim':if(!prims.has(ast.operation)||primitiveArity[ast.operation]!==ast.args.length||!(ast.operation==='equal'?ast.type.kind==='Bool':ast.type.kind==='Nat'))throw Error(`unsupported primitive ${ast.operation}`);ast.args.forEach(x=>visit(x,mod,locals));return; + case 'record': {const shape=types[qualify(mod,ast.name)];if(!shape||shape.kind!=='structure'||shape.fields.map(x=>x.name).sort().join(',')!==Object.keys(ast.values).sort().join(','))throw Error('unknown record or wrong record fields');Object.values(ast.values).forEach(x=>visit(x,mod,locals));return;} + case 'project':case 'not':visit(ast.value,mod,locals);return; + case 'binary':visit(ast.left,mod,locals);visit(ast.right,mod,locals);return; + case 'if':visit(ast.cond,mod,locals);visit(ast.yes,mod,locals);visit(ast.no,mod,locals);return; + case 'let':visit(ast.value,mod,locals);visit(ast.body,mod,new Set([...locals,ast.name]));return; + case 'ctor': {const i=ast.name.lastIndexOf('.'),owner=qualify(mod,ast.name.slice(0,i)),name=ast.name.slice(i+1);const constructor=types[owner]?.constructors?.find(x=>x.name===name);if(!constructor||constructor.fields.length!==ast.args.length)throw Error('unknown constructor or wrong constructor arity');ast.args.forEach(x=>visit(x,mod,locals));return;} + case 'cons':visit(ast.head,mod,locals);visit(ast.tail,mod,locals);return; + case 'match':visit(ast.value,mod,locals);ast.branches.forEach(b=>visit(b.body,mod,new Set([...locals,...b.binders])));return; + default:throw Error(`unsupported AST ${ast.k}`); + } +} +for(const d of Object.values(defs))visit(d.body,d.module,new Set(d.params.map(x=>x.name))); +const aliases={budgetReserveAllowed:'Stitch.Budget.reserveAllowed',budgetSettlementAllowed:'Stitch.Budget.settlementAllowed',pointerSuccessorAllowed:'Stitch.Pointer.successorAllowed',checkpointLinkAllowed:'Stitch.Compute.checkpointLinkAllowed',custodyCommitAllowed:'Stitch.Custody.commitAllowed',custodyRetireAllowed:'Stitch.Custody.retireAllowed',custodyPairAllowed:'Stitch.Fragments.pairAllowed'}; +for(const [name,id] of Object.entries(aliases))if(!defs[id])throw Error(`missing public binding ${name}`); +const bindingSources = []; +function gather(dir) { for (const e of readdirSync(dir,{withFileTypes:true}).sort((a,b)=>a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) { const p=resolve(dir,e.name); if(e.isDirectory())gather(p); else bindingSources.push({path:relative(root,p),sha256:hash(readFileSync(p))}); } } +gather(resolve(root,'app/src')); gather(resolve(root,'app/language')); +const sourceDigest='sha256:'+hash(bindingSources.map(x=>x.path+'\0'+x.sha256+'\n').join('')); +// Execution compatibility is narrower than exact project-source provenance. +// Canonical reachable LexLean declarations exclude proofs and layout. The +// interpreter and complete transitive JS adapter modules remain byte-bound: +// compatibility is conservative for handwritten adapter edits, never guessed. +const interpreter = `const qualify = (module, name) => name.includes('::') ? name.replace('::','.') : module+'.'+name; +function natural(value) { + if(typeof value==='bigint'&&value>=0n)return value; + if(typeof value==='number'&&Number.isSafeInteger(value)&&value>=0)return BigInt(value); + throw new TypeError('model Nat must be a non-negative BigInt or safe integer'); +} +function coerce(value,type,module) { + if(type.kind==='Nat')return natural(value); + if(type.kind==='Bool') {if(typeof value!=='boolean')throw new TypeError('model Bool required');return value;} + if(type.kind==='Bytes') {if(!(value instanceof Uint8Array))throw new TypeError('model Bytes required');return value.slice();} + if(type.kind==='String') {if(typeof value!=='string')throw new TypeError('model String required');return value;} + if(type.kind==='List') {if(!Array.isArray(value))throw new TypeError('model List required');return value.map(x=>coerce(x,type.element,module));} + const id=qualify(module,type.kind),shape=types[id]; + if(!shape)throw new TypeError('unknown model type '+id); + if(shape.kind==='structure') {if(!value||typeof value!=='object'||Object.keys(value).sort().join(',')!==shape.fields.map(x=>x.name).sort().join(','))throw new TypeError('exact model record fields required for '+id);return Object.fromEntries(shape.fields.map(f=>[f.name,coerce(value[f.name],f.type,id.slice(0,id.lastIndexOf('.')))]));} + const constructor=shape.constructors.find(x=>x.name===value?.tag); + if(!constructor||!Array.isArray(value.fields)||value.fields.length!==constructor.fields.length)throw new TypeError('model constructor required for '+id); + return {tag:value.tag,fields:value.fields.map((v,i)=>coerce(v,constructor.fields[i],id.slice(0,id.lastIndexOf('.'))))}; +} +const tailCall = Symbol("source-tail-call"); +function evaluate(ast,env,module,tail=false) { + switch(ast.k) { + case 'nat':return BigInt(ast.value); + case 'bool':case 'string':return ast.value; + case 'var':if(!Object.hasOwn(env,ast.name))throw Error('unbound model variable');return env[ast.name]; + case 'if':return evaluate(evaluate(ast.cond,env,module)?ast.yes:ast.no,env,module,tail); + case 'not':return !evaluate(ast.value,env,module); + case 'project':return evaluate(ast.value,env,module)[ast.field]; + case 'let':return evaluate(ast.body,{...env,[ast.name]:evaluate(ast.value,env,module)},module,tail); + case 'record':return Object.fromEntries(Object.entries(ast.values).map(([k,v])=>[k,evaluate(v,env,module)])); + case 'call': {const id=qualify(module,ast.name),args=ast.args.map(x=>evaluate(x,env,module));return tail?{[tailCall]:true,id,args}:invoke(id,args);} + case 'nil':return []; + case 'cons':return [evaluate(ast.head,env,module),...evaluate(ast.tail,env,module)]; + case 'ctor':return {tag:ast.name.split('.').at(-1),fields:ast.args.map(x=>evaluate(x,env,module))}; + case 'match': { + const value=evaluate(ast.value,env,module);let tag,fields; + if(Array.isArray(value)){tag=value.length?'cons':'nil';fields=value.length?[value[0],value.slice(1)]:[];}else if(typeof value==='bigint'){tag=value===0n?'zero':'succ';fields=value===0n?[]:[value-1n];}else if(typeof value==='boolean'){tag=value?'true':'false';fields=[];}else {tag=value.tag;fields=value.fields;} + const b=ast.branches.find(x=>x.constructor.split('.').at(-1)===tag); + if(!b||b.binders.length!==fields.length)throw Error('nonexhaustive model match');return evaluate(b.body,{...env,...Object.fromEntries(b.binders.map((n,i)=>[n,fields[i]]))},module,tail); + } + case 'binary': { + const left=evaluate(ast.left,env,module); + if(ast.op==='&&')return left&&evaluate(ast.right,env,module); + if(ast.op==='||')return left||evaluate(ast.right,env,module); + const right=evaluate(ast.right,env,module); + switch(ast.op){case '+':return left+right;case '=?':return left===right;case '<=?':return left<=right;case 'evaluate(x,env,module)); + switch(ast.operation){case 'subtract':return a[0]>=a[1]?a[0]-a[1]:0n;case 'multiply':return a[0]*a[1];case 'quotient':return a[1]===0n?a[2]:a[0]/a[1];case 'remainder':return a[1]===0n?a[2]:a[0]%a[1];case 'equal':return a[0].length===a[1].length&&a[0].every((x,i)=>x===a[1][i]);default:throw Error('unsupported model primitive');} + } + default:throw Error('unsupported model node '+ast.k); + } +} +function invoke(id,args) {for(;;){const d=definitions[id];if(!d||d.params.length!==args.length)throw Error('unknown model function/arity '+id);const result=evaluate(d.body,Object.fromEntries(d.params.map((p,i)=>[p.name,args[i]])),d.module,true);if(!result?.[tailCall])return result;id=result.id;args=result.args;}} +export const model=Object.freeze(Object.fromEntries(Object.entries(definitions).map(([id,d])=>[id,(...args)=>{if(args.length!==d.params.length)throw new TypeError('model arity '+id);return invoke(id,args.map((v,i)=>coerce(v,d.params[i].type,d.module)));}]))); +`; +function canonical(value) { + if (Array.isArray(value)) return value.map(canonical); + if (value && typeof value === 'object') return Object.fromEntries(Object.keys(value).sort().map(key => [key, canonical(value[key])])); + return value; +} +const adapterSources = [], adapterTexts = new Map(); +function gatherAdapter(path) { + const full = resolve(root, path), normalized = relative(root, full); + if (!normalized.startsWith('src/') || !normalized.endsWith('.js')) throw Error('unsupported execution adapter dependency '+path); + if (full === output || adapterTexts.has(normalized)) return; + const text = readFileSync(full, 'utf8'); + adapterTexts.set(normalized, text); + adapterSources.push({ path: normalized, sha256: hash(text) }); + if (/\bimport\s*\(/.test(text)) throw Error('dynamic execution adapter import is not supported'); + for (const match of text.matchAll(/\b(?:import|export)\s+[^;]*?\bfrom\s+['"]([^'"]+)['"]/g)) { + if (!match[1].startsWith('.')) throw Error('external execution adapter import is not supported'); + gatherAdapter(relative(root, resolve(dirname(full), match[1]))); + } +} +gatherAdapter('src/layer4-compute/replay.js'); +adapterSources.sort((a,b)=>a.path < b.path ? -1 : a.path > b.path ? 1 : 0); +const replayAdapter = adapterTexts.get('src/layer4-compute/replay.js'); +const executionRoots = new Set(); +const directCalls = [...replayAdapter.matchAll(/\bmodel\[['"]([^'"]+)['"]\]/g)]; +if ([...replayAdapter.matchAll(/\bmodel\s*\[/g)].length !== directCalls.length) throw Error('dynamic execution model access is not supported'); +for (const match of directCalls) executionRoots.add(match[1]); +for (const match of replayAdapter.matchAll(/import\s*\{([^}]+)\}\s*from\s*['"][^'"]*generated-model\.js['"]/g)) { + for (const name of match[1].split(',').map(x=>x.trim())) { + if (Object.hasOwn(aliases,name)) executionRoots.add(aliases[name]); + else if (!['model','modelSourceDigest','modelExecutionDigest'].includes(name)) throw Error('unsupported execution model import '+name); + } +} +if (!executionRoots.size) throw Error('missing execution model roots'); +const executionDefinitions = {}, executionTypes = {}; +function includeType(type, module) { + if (type.element) includeType(type.element,module); + if (['Nat','Bool','Bytes','String','List','Option'].includes(type.kind)) return; + const id=qualify(module,type.kind), shape=types[id]; + if (!shape) throw Error('unknown execution type '+id); + if (executionTypes[id]) return; + executionTypes[id]=shape; + const owner=id.slice(0,id.lastIndexOf('.')); + if (shape.fields) shape.fields.forEach(field=>includeType(field.type,owner)); + if (shape.constructors) shape.constructors.forEach(c=>c.fields.forEach(field=>includeType(field,owner))); +} +function includeDefinition(id) { + if (executionDefinitions[id]) return; + const definition=defs[id]; + if (!definition) throw Error('unknown execution definition '+id); + executionDefinitions[id]=definition; + definition.params.forEach(p=>includeType(p.type,definition.module)); + includeType(definition.result,definition.module); + function walk(node) { + if (!node || typeof node!=='object') return; + if (node.k==='call') includeDefinition(qualify(definition.module,node.name)); + if (node.type) includeType(node.type,definition.module); + if (node.k==='record') includeType({kind:node.name},definition.module); + if (node.k==='ctor') includeType({kind:node.name.slice(0,node.name.lastIndexOf('.'))},definition.module); + Object.values(node).forEach(value=>Array.isArray(value)?value.forEach(walk):walk(value)); + } + walk(definition.body); +} +[...executionRoots].sort().forEach(includeDefinition); +const executionIdentity = canonical({ schema:'stitch/execution-semantics/1', + roots:[...executionRoots].sort(), definitions:executionDefinitions, types:executionTypes, + interpreterSha256:hash(interpreter), adapterSources }); +const executionDigest='sha256:'+hash('stitch/execution-semantics/v1\0'+JSON.stringify(executionIdentity)); +const inventory={schema:'stitch/source-bindings/1',verification:'source-derived, not kernel-checked',sourceDigest,executionDigest,executionIdentity,generatorSha256:hash(readFileSync(fileURLToPath(import.meta.url))),bindingSources,sources,theorems,definitions:Object.keys(defs).sort(),aliases}; +const generated=`/** GENERATED by scripts/check-model.mjs. DO NOT EDIT. + * Exact BigInt evaluation of a declared subset of the project LexLean source. + * This is NOT a Prism compiler, proof certificate, or whole-runtime certification. + */ +const definitions = ${JSON.stringify(defs,null,2)}; +const types = ${JSON.stringify(types,null,2)}; +export const modelSourceDigest = ${JSON.stringify(sourceDigest)}; +export const modelExecutionDigest = ${JSON.stringify(executionDigest)}; +export const MODEL_SOURCE = Object.freeze(${JSON.stringify(inventory,null,2)}); +${interpreter} +${Object.entries(aliases).map(([name,id])=>`export const ${name} = model[${JSON.stringify(id)}];`).join('\n')} +`; +if(modes.has('--write')) {mkdirSync(dirname(output),{recursive:true});writeFileSync(output,generated);} +else if(readFileSync(output,'utf8')!==generated)throw Error('stale source bindings: run node scripts/check-model.mjs --write, then review'); +if(modes.has('--inventory'))console.log(JSON.stringify(inventory,null,2)); +else console.log(`model bindings: ${sources.length} selected domain/experience modules, ${Object.keys(defs).length} definitions, ${theorems.length} unverified theorem obligations; ${modes.has('--write')?'written':'fresh'}`); diff --git a/scripts/check-product.mjs b/scripts/check-product.mjs new file mode 100644 index 0000000..7408fe9 --- /dev/null +++ b/scripts/check-product.mjs @@ -0,0 +1,130 @@ +#!/usr/bin/env node +/** Project-owned contract register. NOT a Prism compiler, schema, receipt or certificate. */ +import { readFileSync, writeFileSync, readdirSync, lstatSync } from 'node:fs'; +import { resolve, dirname, relative } from 'node:path'; +import { createHash } from 'node:crypto'; +import { fileURLToPath } from 'node:url'; +const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'); +const hash = bytes => createHash('sha256').update(bytes).digest('hex'); +const rowTypes = new Set(['Component','Assumption','CapabilityContract','Dependency','Deployment','Asset']); +const fail = message => { throw Error(`product register: ${message}`); }; +function lex(source) { + const out = []; let rest=source; + while(rest.length) { + const m=/^(?:\s+|"(?:[^"\\]|\\["\\/bfnrt]|\\u[0-9a-fA-F]{4})*"|:=|::|[(){}:,]|[0-9]+|[A-Za-z_][A-Za-z0-9_.]*)/.exec(rest); + if(!m)fail('unsupported literal source'); + rest=rest.slice(m[0].length); if(!/^\s/.test(m[0]))out.push(m[0]); + } + return out; +} +class Literal { + constructor(tokens){this.tokens=tokens;this.i=0;} + take(want){const x=this.tokens[this.i++];if(want!==undefined&&x!==want)fail(`expected ${want}, got ${x}`);return x;} + name(){const n=this.take();return this.tokens[this.i]==='::'?(this.take(),n+'::'+this.take()):n;} + value(){ + const token=this.take(); + if(token?.startsWith('"'))return JSON.parse(token); + if(token==='true'||token==='false')return token==='true'; + if(/^\d+$/.test(token??''))return Number(token); + if(token!=='(')fail(`unsupported literal ${token}`); + const kind=this.take();let value; + if(kind==='nil'){this.name();value=[];} + else if(kind==='cons'){const head=this.value(),tail=this.value();if(!Array.isArray(tail))fail('non-list tail');value=[head,...tail];} + else if(kind==='ctor'){value={constructor:this.name()};} + else if(kind==='record'){ + const type=this.name(),fields={};this.take('{'); + while(this.tokens[this.i]!=='}'){ + const name=this.take();this.take(':=');if(Object.hasOwn(fields,name))fail('duplicate field');fields[name]=this.value(); + if(this.tokens[this.i]!=='}')this.take(','); + } + this.take('}');value={type,fields}; + } else fail(`unsupported literal form ${kind}`); + this.take(')');return value; + } +} +export function literalRows(source, types=rowTypes) { + const regex=/definition\{\s*name: ([A-Za-z_][A-Za-z0-9_]*),\s*parameters: \[\],\s*result: ([A-Za-z_.:]+),\s*body: /g; + const rows=[];let m; + while((m=regex.exec(source))){ + if(!types.has(m[2]))continue; + const start=regex.lastIndex;let depth=0,quoted=false,escaped=false,end=start; + for(;ende.isDirectory()?walk(resolve(directory,e.name)):[resolve(directory,e.name)]);} +function bytes(path,base=root){ + if(!/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)*$/.test(path)||path.split('/').some(x=>x==='.'||x==='..'))fail(`unsafe path ${path}`); + const full=resolve(base,path),stat=lstatSync(full);if(!stat.isFile()||stat.isSymbolicLink())fail(`not a regular artifact ${path}`);return readFileSync(full); +} +const unique=(rows,key,label)=>{const ids=rows.map(x=>x[key]);if(ids.some(x=>typeof x!=='string'||!x)||new Set(ids).size!==ids.length)fail(`duplicate or empty ${label}`);return new Set(ids);}; +export function readProduct(base=root){ + const source=readFileSync(resolve(base,'app/src/Product/Model.lex.tex'),'utf8'); + const rows=literalRows(source),typed=type=>rows.filter(r=>r.type===type); + const architecture=literalRows(readFileSync(resolve(base,'app/src/Product/Architecture.lex.tex'),'utf8'),new Set(['Foundation.Arch::Component','Foundation.Arch::Edge','Foundation.Arch::Stakeholder','Foundation.Arch::Concern','Foundation.Arch::Viewpoint','Foundation.Arch::View'])); + const hostSource=readFileSync(resolve(base,'app/src/Product/Host.lex.tex'),'utf8'); + const capabilityBlock=/name: Capability,[\s\S]*?constructors: \[([\s\S]*?)\n \]\s*\}/.exec(hostSource)?.[1]??fail('missing Host.Capability'); + return {components:typed('Component'),assumptions:typed('Assumption'),capabilities:typed('CapabilityContract'),dependencies:typed('Dependency'),deployments:typed('Deployment'),assets:typed('Asset'),architecture,hostCapabilities:[...capabilityBlock.matchAll(/name: (\w+), fields: \[\]/g)].map(m=>m[1])}; +} +export function validateProduct(p,base=root){ + const components=unique(p.components,'id','component'),assumptions=unique(p.assumptions,'id','assumption'),caps=unique(p.capabilities,'id','capability'),assets=unique(p.assets,'path','asset'); + unique(p.dependencies,'id','dependency');unique(p.deployments,'id','deployment'); + const host=new Set(p.hostCapabilities); + if(host.size!==p.capabilities.length||new Set(p.capabilities.map(c=>c.capability)).size!==host.size)fail('host capability coverage'); + const modelModules=new Set(walk(resolve(base,'app/src')).filter(x=>x.endsWith('.lex.tex')).map(x=>/^\\begin\{lexlean\}\{([^}]+)\}/.exec(readFileSync(x,'utf8'))?.[1])); + for(const c of p.components){ + for(const path of c.implementation){if(!assets.has(path))fail(`unregistered component asset ${path}`);bytes(path,base);} + for(const model of c.models)if(!modelModules.has(model))fail(`unknown model ${model}`); + } + for(const c of p.capabilities){ + if(!components.has(c.owner))fail(`unknown capability owner ${c.owner}`); + if(!host.has(c.capability))fail(`unknown host capability ${c.capability}`); + for(const a of c.assumptions)if(!assumptions.has(a))fail(`unknown assumption ${a}`); + if(!c.preconditions.length||!c.failures.length||!c.proofScope)fail(`incomplete capability ${c.id}`); + bytes(c.source,base); + } + for(const d of p.dependencies)if(!components.has(d.consumer))fail(`unknown dependency consumer ${d.consumer}`); + for(const d of p.deployments){bytes(d.entry,base);for(const cap of d.requiredCapabilities)if(!caps.has(cap))fail(`unknown deployment capability ${cap}`);} + for(const asset of p.assets)bytes(asset.path,base); + const runtime=['index.html',...walk(resolve(base,'src')).filter(x=>x.endsWith('.js')).map(x=>relative(base,x)),...walk(resolve(base,'v86')).map(x=>relative(base,x)),...walk(resolve(base,'images')).map(x=>relative(base,x))]; + for(const path of runtime)if(!assets.has(path))fail(`unmodeled browser artifact ${path}`); + const arch=p.architecture.filter(x=>x.type==='Foundation.Arch::Component'); + if(arch.length!==components.size||new Set(arch.map(x=>x.name)).size!==components.size||arch.some(x=>!components.has(x.name)))fail('architecture component coverage'); + for(const type of new Set(p.architecture.map(x=>x.type))){ + const rows=p.architecture.filter(x=>x.type===type).sort((a,b)=>a.declaration.localeCompare(b.declaration,'en')); + rows.forEach((row,i)=>{if(row.index!==i)fail(`noncanonical architecture index ${row.declaration}`);}); + } + for(const e of p.architecture.filter(x=>x.type==='Foundation.Arch::Edge'))if(!arch.some(x=>x.index===e.fromIndex)||!arch.some(x=>x.index===e.toIndex))fail('dangling architecture edge'); + const native=p.capabilities.find(x=>x.capability==='NativeRouting');if(!native||native.enabledByDefault||!native.proofScope.startsWith('Unsupported'))fail('native routing overclaim'); + const relay=p.capabilities.find(x=>x.capability==='PublicRelay');if(!relay||relay.enabledByDefault||!relay.assumptions.includes('disclosureConsent'))fail('relay consent boundary'); + const distribution=JSON.parse(bytes('vendor/distribution.json',base)); + for(const asset of p.assets.filter(a=>a.redistributionCleared && /^(v86|images)\//.test(a.path))){ + const evidence=distribution.assets[asset.path]; + if(!evidence || hash(bytes(asset.path,base))!==evidence.sha256)fail(`distribution identity mismatch ${asset.path}`); + if(!evidence.materials?.length)fail(`missing distribution materials ${asset.path}`); + for(const material of evidence.materials)if(hash(bytes(material.path,base))!==material.sha256)fail(`distribution material mismatch ${material.path}`); + } + return true; +} +export function productRegister(base=root){ + const p=readProduct(base);validateProduct(p,base); + const formal=walk(resolve(base,'app/src')).filter(x=>x.endsWith('.lex.tex')).map(x=>relative(base,x)); + const sourcePaths=[...new Set([...formal,...walk(resolve(base,'app/language')).filter(x=>x.endsWith('.toml')).map(x=>relative(base,x)),'app/lexlean.toml','app/prismpm.toml','app/prism.toml','package.json','package-lock.json','prismpm.lock','standards.lock','vendor/distribution.json'])].sort(); + const sources=sourcePaths.map(path=>({path,sha256:hash(bytes(path,base))})); + const artifacts=p.assets.map(a=>{const data=bytes(a.path,base);return {...a,bytes:data.length,sha256:hash(data)};}).sort((a,b)=>a.path.localeCompare(b.path,'en')); + return {format:'Stitch project-owned product contract register',version:1,assurance:'Source contracts and local byte inventory, not a Prism receipt or whole-browser proof',reference:{repository:'https://github.com/UOR-Foundation/PrismPM',revision:'fe5b8b73a94134c316329a8d1b09ebc97b555c5f',specSections:['2','11'],foundationArchUpstreamBytes:8959,foundationArchUpstreamSha256:'9a79e4912d33b1736d7451ab726ed0a83d958b8d9c70091a749fbc70acd48cdc',foundationArch:'Type-only subset; source types preserved, title localized to available glossary, examples omitted',sdk:'Existing prismpm.lock; no dependency or profile upgrade'},releaseBlockers:artifacts.filter(a=>!a.redistributionCleared).map(a=>({path:a.path,reason:a.licenseStatus})),...p,assets:artifacts,sources,sourceDigest:'sha256:'+hash(JSON.stringify(sources))}; +} +export function run(args=process.argv.slice(2)){ + if(args.length>1||args.length===1&&!['--write','--check'].includes(args[0]))fail('usage: node scripts/check-product.mjs [--write|--check]'); + const output=resolve(root,'product/contracts.json'),expected=JSON.stringify(productRegister(),null,2)+'\n'; + if(args[0]==='--write'){writeFileSync(output,expected);process.stdout.write('Wrote project-owned product register; no verification claim.\n');} + else {if(readFileSync(output,'utf8')!==expected)fail('stale product/contracts.json; run node scripts/check-product.mjs --write');process.stdout.write('Product graph, architecture, source binding and local artifact inventory match.\n');} +} +if(process.argv[1]&&resolve(process.argv[1])===fileURLToPath(import.meta.url))run(); diff --git a/scripts/check-source-evidence.mjs b/scripts/check-source-evidence.mjs new file mode 100644 index 0000000..70ca36b --- /dev/null +++ b/scripts/check-source-evidence.mjs @@ -0,0 +1,143 @@ +#!/usr/bin/env node +/** Check retained proof inputs, not the proof or the native acceptance gate. */ +import assert from 'node:assert/strict'; +import { createHash } from 'node:crypto'; +import { lstatSync, readFileSync, readdirSync } from 'node:fs'; +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const hash = bytes => createHash('sha256').update(bytes).digest('hex'); +const projectRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..'); + +/** Discover current compiler inputs, including additions outside an old summary. */ +export function discoverSourceInputs(root, manifest) { + // LexLean discovers .lex.tex modules; a lexicon reads lexicon.toml and entries/. + assert.ok(lstatSync(resolve(root, 'app')).isDirectory(), 'app is not a nonsymlink directory'); + const inputs = ['app/lake-manifest.json', 'app/lakefile.toml', 'app/lean-toolchain', 'app/lexlean.lock', 'app/lexlean.toml', 'app/prism.toml', 'app/prismpm.toml']; + function walk(path, includes = () => true) { + assert.ok(lstatSync(resolve(root, path)).isDirectory(), `input root is not a nonsymlink directory: ${path}`); + for (const name of readdirSync(resolve(root, path)).sort()) { + const child = `${path}/${name}`, stat = lstatSync(resolve(root, child)); + assert.ok(!stat.isSymbolicLink(), `source input is a symlink: ${child}`); + if (stat.isDirectory()) walk(child, includes); + else if (includes(child)) { assert.ok(stat.isFile(), `source input is not a file: ${child}`); inputs.push(child); } + } + } + walk('app/src', path => path.endsWith('.lex.tex')); + for (const input of manifest.inputs.filter(input => input.kind === 'lexicon' && input.path !== 'embedded')) { + assert.ok(/^language\/[A-Za-z0-9_./-]+$/.test(input.path) && input.path.split('/').every(part => part && part !== '.' && part !== '..'), 'invalid lexicon input path'); + // Reject a symlink in any lexicon directory component, not just its files. + const parts = `app/${input.path}`.split('/'); + for (let i = 1; i <= parts.length; i++) { + assert.ok(lstatSync(resolve(root, ...parts.slice(0, i))).isDirectory(), 'lexicon root is not a nonsymlink directory'); + } + inputs.push(`app/${input.path}/lexicon.toml`); + if (lstatSync(resolve(root, `app/${input.path}/entries`), { throwIfNoEntry: false })) walk(`app/${input.path}/entries`); + } + return inputs.sort().map(path => { + assert.ok(lstatSync(resolve(root, path)).isFile(), `input is not a nonsymlink file: ${path}`); + return { path, sha256: hash(readFileSync(resolve(root, path))) }; + }); +} + +/** Validate supplied records before retention, or check the retained files. */ +export function validateSourceEvidence(root, summary, attestationBytes, manifestBytes) { + const read = path => readFileSync(resolve(root, path)); + const json = path => JSON.parse(read(path)); + const attestation = JSON.parse(attestationBytes), manifest = JSON.parse(manifestBytes); + assert.equal(summary.version, 1, 'unsupported source summary'); + assert.equal(attestation.spec, 'lexlean/attestation/2', 'unsupported attestation'); + assert.equal(manifest.spec, 'lexlean/build-manifest/1', 'unsupported build manifest'); + assert.equal(summary.attestation_path, 'product/source-attestation.json'); + assert.equal(summary.build_manifest_path, 'product/source-build-manifest.json'); + assert.equal(hash(attestationBytes), summary.attestation_sha256, 'attestation bytes differ'); + assert.deepEqual({ byte_length: manifestBytes.length, sha256: hash(manifestBytes) }, attestation.build_manifest, 'build manifest bytes differ'); + assert.equal(summary.status, 'verified', 'source summary is not verified'); + assert.equal(attestation.status, 'verified', 'attestation is not verified'); + for (const key of ['attestation_id', 'source_id', 'semantic_id', 'build_id']) { + assert.match(summary[key], /^[0-9a-f]{64}$/, `invalid ${key}`); + assert.equal(summary[key], attestation[key], `${key} differs`); + if (key !== 'attestation_id') assert.equal(summary[key], manifest[key], `${key} differs from manifest`); + } + + const current = discoverSourceInputs(root, manifest); + assert.deepEqual(summary.sources, current, 'retained source evidence is stale or incomplete'); + const inputPaths = new Set(current.map(input => input.path)); + const sourceInputs = manifest.inputs.filter(input => input.kind === 'source'); + const modules = current.filter(input => input.path.startsWith('app/src/') && input.path.endsWith('.lex.tex')).map(input => input.path); + assert.deepEqual(sourceInputs.map(input => `app/${input.path}`).sort(), modules, 'manifest source closure differs'); + assert.deepEqual(manifest.modules.map(module => `app/${module.source_path}`).sort(), modules, 'manifest module closure differs'); + for (const input of manifest.inputs.filter(input => ['source', 'lock', 'project-config'].includes(input.kind))) { + assert.ok(inputPaths.has(`app/${input.path}`), `undeclared manifest input: ${input.path}`); + const bytes = read(`app/${input.path}`); + assert.equal(hash(bytes), input.sha256, `manifest input differs: ${input.path}`); + assert.equal(bytes.length, input.byte_length, `manifest length differs: ${input.path}`); + } + // LexLean tree-digest v1: domain + NUL, then bytewise-sorted framed paths + // and file bytes. Do not trust a freshly generated summary to bind old proof + // to a changed lexicon: the manifest itself must bind its current tree. + for (const input of manifest.inputs.filter(input => input.kind === 'lexicon' && input.path !== 'embedded')) { + const prefix = `app/${input.path}/`; + const files = current.map(input => input.path).filter(path => path.startsWith(prefix)) + .sort((a, b) => Buffer.compare(Buffer.from(a), Buffer.from(b))); + const digest = createHash('sha256').update('lexlean-tree-v1\0'); + let byteLength = 0; + for (const path of files) { + const name = Buffer.from(path.slice(prefix.length)), bytes = read(path); + const pathLength = Buffer.alloc(4), size = Buffer.alloc(8); + pathLength.writeUInt32BE(name.length); + size.writeBigUInt64BE(BigInt(bytes.length)); + digest.update(pathLength).update(name).update(size).update(bytes); + byteLength += bytes.length; + } + assert.equal(digest.digest('hex'), input.sha256, `manifest lexicon differs: ${input.path}`); + assert.equal(byteLength, input.byte_length, `manifest lexicon length differs: ${input.path}`); + } + assert.deepEqual(manifest.inputs.filter(input => input.kind === 'lock').map(input => input.path), ['lexlean.lock'], 'manifest lock closure differs'); + assert.deepEqual(manifest.inputs.filter(input => input.kind === 'project-config').map(input => input.path), ['lexlean.toml'], 'manifest config closure differs'); + assert.ok(manifest.inputs.every(input => ['source', 'lock', 'project-config', 'lexicon'].includes(input.kind)), 'unsupported manifest input kind'); + for (const input of attestation.lake_workspace) { + assert.ok(inputPaths.has(`app/${input.path}`), `undeclared workspace input: ${input.path}`); + assert.equal(hash(read(`app/${input.path}`)), input.sha256, `workspace input differs: ${input.path}`); + } + assert.deepEqual(attestation.lake_workspace.map(input => input.path).sort(), ['lake-manifest.json', 'lakefile.toml', 'lean-toolchain'], 'workspace input closure differs'); + assert.ok(modules.length > 0 && attestation.declarations.length > 0 && attestation.processes.length > 0, 'empty proof evidence'); + assert.equal(summary.module_count, modules.length); + assert.equal(summary.declaration_audits, attestation.declarations.length); + assert.equal(summary.successful_processes, attestation.processes.length); + for (const declaration of attestation.declarations) assert.equal(declaration.result, 'ok', `failed declaration: ${declaration.name}`); + const counts = {}; + for (const process of attestation.processes) { + assert.equal(process.exit_code, 0, `failed process: ${process.module}`); + assert.ok(['lean', 'leanchecker'].includes(process.tool), 'unexpected proof process'); + assert.equal(hash(process.stdout), process.stdout_sha256, 'stdout digest differs'); + assert.equal(hash(process.stderr), process.stderr_sha256, 'stderr digest differs'); + assert.equal(process.executable_sha256, attestation.toolchain[process.tool].executable_sha256, 'process tool identity differs'); + counts[process.tool] = (counts[process.tool] ?? 0) + 1; + } + assert.deepEqual(summary.processes_by_tool, counts); + assert.ok(counts.lean > 0 && counts.leanchecker > 0, 'both proof tools are required'); + + const lock = json('prismpm.lock'); + const architecture = { x86_64: 'amd64', aarch64: 'arm64' }[attestation.host.arch]; + assert.ok(architecture && attestation.host.os === 'linux', 'unsupported evidence host'); + const platform = lock.platforms.find(platform => platform.platform === `linux/${architecture}`); + assert.ok(platform, 'evidence platform absent from pinned SDK'); + for (const [id, identity] of [['lexlean', attestation.lexlean], ['lean', attestation.toolchain.lean], ['leanchecker', attestation.toolchain.leanchecker]]) { + assert.equal(platform.inventory.find(item => item.id === id)?.digest, `sha256:${identity.executable_sha256}`, `proof tool differs from pinned SDK: ${id}`); + } + assert.equal(manifest.compiler.semantics_id, attestation.lexlean.compiler_semantics); + assert.equal(manifest.compiler.version, attestation.lexlean.version); + return summary; +} + +export function checkSourceEvidence(root = projectRoot) { + const read = path => readFileSync(resolve(root, path)); + return validateSourceEvidence(root, JSON.parse(read('product/source-verification.json')), + read('product/source-attestation.json'), read('product/source-build-manifest.json')); +} + +if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) { + const summary = checkSourceEvidence(); + console.log(`Retained source evidence matches ${summary.module_count} modules and pinned proof tools. Native Prism acceptance remains separate.`); +} diff --git a/scripts/compute-budget-model-tests.mjs b/scripts/compute-budget-model-tests.mjs new file mode 100644 index 0000000..828bdec --- /dev/null +++ b/scripts/compute-budget-model-tests.mjs @@ -0,0 +1,262 @@ +/** Source-subset conformance tests, not cryptographic validation or kernel proofs. + * Digest fixtures are typed host observations; no claim is made that these tokens + * are real hashes of the records. Canonical wire hashing stays a host obligation. + */ +import { test } from 'node:test'; +import assert from 'node:assert/strict'; +import { model } from '../src/layer1-uor/generated-model.js'; +const call = (name, ...args) => model['Stitch.' + name](...args); +const root = n => Object.fromEntries(Array.from({ length: 8 }, (_, i) => ['w' + i, BigInt(n + i)])); +const changeRoot = r => ({ ...r, w7: r.w7 + 1n }); +const digest = expected => ({ expected: structuredClone(expected), observed: structuredClone(expected), domainMatches: true, canonicalSerializationMatches: true }); +const observed = (input, expected) => ({ input: structuredClone(input), digest: digest(expected) }); +const resources = (transferBytes = 0n, storageBytes = 0n, computeWork = 0n, refreshRequests = 0n) => ({ transferBytes: BigInt(transferBytes), storageBytes: BigInt(storageBytes), computeWork: BigInt(computeWork), refreshRequests: BigInt(refreshRequests) }); +const zero = resources(); +const clone = x => structuredClone(x); +const supported = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17]; +function independentStep(op, x, y, bits) { + const m = 1n << BigInt(bits), mask = m - 1n; + const value = [() => -x, () => ~x, () => x + 1n, () => x - 1n, + () => x + y, () => x - y, () => x * y, () => x ^ y, + () => x & y, () => x | y, () => BigInt(x <= y), () => BigInt(x < y), + () => BigInt(x >= y), () => BigInt(x > y), null, + () => y === 0n ? 0n : x / y, () => y === 0n ? 0n : x % y, () => { let result = 1n; for (const bit of y.toString(2)) { result = result * result & mask; if (bit === '1') result = result * x & mask; } return result; }][op](); + return value & mask; +} +function replay(job, step) { + let value = job.initialValue; + for (const instruction of job.program.instructions.slice(0, Number(step))) value = independentStep(Number(instruction.opcode), value, instruction.argument, job.program.bits); + return value; +} +function jobCommitments(job) { + return { + program: observed({ version: 1n, modelRoot: job.program.modelRoot, bits: job.program.bits, instructions: clone(job.program.instructions) }, job.program.programRoot), + input: observed({ version: 1n, bits: job.program.bits, value: job.initialValue }, job.inputRoot), + job: observed({ version: 1n, programRoot: job.program.programRoot, inputRoot: job.inputRoot, modelRoot: job.program.modelRoot, initialValue: job.initialValue }, job.jobRoot) + }; +} +function checkpointCommitments(job, checkpoint) { + const { jobRoot, programRoot, inputRoot, modelRoot, step, priorRoot, stateRoot, value } = checkpoint; + return { + state: observed({ version: 1n, jobRoot, programRoot, inputRoot, modelRoot, bits: job.program.bits, step, value }, stateRoot), + checkpoint: observed({ version: 1n, jobRoot, programRoot, inputRoot, modelRoot, step, priorRoot, stateRoot, value }, checkpoint.checkpointRoot) + }; +} +function fixture() { + const job = { jobRoot: root(10), program: { programRoot: root(20), modelRoot: root(30), bits: 8n, instructions: [{ opcode: 4n, argument: 1n }, { opcode: 7n, argument: 3n }, { opcode: 2n, argument: 0n }] }, inputRoot: root(40), initialValue: 255n }; + const checkpoint = (step, previous, identity) => ({ jobRoot: job.jobRoot, programRoot: job.program.programRoot, inputRoot: job.inputRoot, modelRoot: job.program.modelRoot, step, priorRoot: previous, stateRoot: root(identity), checkpointRoot: root(identity + 10), value: replay(job, step) }); + const current = checkpoint(0n, root(50), 60), candidate = checkpoint(2n, current.checkpointRoot, 80); + return { job, current, candidate, jc: jobCommitments(job), cc: checkpointCommitments(job, current), nc: checkpointCommitments(job, candidate), expectedModelRoot: job.program.modelRoot }; +} +const accepted = f => call('Compute.committedCheckpointAllowed', f.job, f.candidate, f.jc, f.nc, 3n, f.expectedModelRoot); +const advance = f => call('Compute.advanceCheckpoint', f.job, f.current, f.candidate, f.jc, f.cc, f.nc, 3n, f.expectedModelRoot); + +test('full semantic admission rejects noncanonical operands, unsupported programs and out-of-ring inputs', () => { + const { job } = fixture(); + assert.equal(call('Compute.jobAllowed', job, 3), true); + assert.equal(call('Compute.jobAllowed', job, 2), false); + assert.equal(call('Compute.jobAllowed', { ...job, initialValue: 256n }, 3), false); + for (const bits of [0, 7, 24, 256]) assert.equal(call('Compute.jobAllowed', { ...job, program: { ...job.program, bits } }, 3), false); + for (const opcode of [14, 18, 99]) assert.equal(call('Compute.programAllowed', { ...job.program, instructions: [{ opcode, argument: 0 }] }, 3), false); + for (const opcode of supported) { + const good = { opcode, argument: opcode < 4 ? 0 : 255 }; + assert.equal(call('Compute.programAllowed', { ...job.program, instructions: [good] }, 1), true); + assert.equal(call('Compute.programAllowed', { ...job.program, instructions: [{ ...good, argument: opcode < 4 ? 1 : 256 }] }, 1), false); + } + for (const field of ['programRoot', 'modelRoot']) assert.equal(call('Compute.programAllowed', { ...job.program, [field]: { ...root(0), w3: 1n << 32n } }, 3), false); +}); + +test('all supported operations agree with an independent ring interpreter at every supported width', () => { + for (const bits of [8, 16, 32, 64, 128]) { + const m = 1n << BigInt(bits), values = [0n, 1n, m / 2n, m - 1n]; + for (const opcode of supported) for (const value of values) for (const argument of values) { + const instruction = { opcode, argument: opcode < 4 ? 0n : argument }; + assert.equal(call('Compute.ringStep', instruction, value, m), independentStep(opcode, value, instruction.argument, bits)); + } + } +}); + +test('every exact typed commitment input and digest observation field is bound', () => { + const base = fixture(); + assert.equal(accepted(base), true); + for (const container of ['jc', 'nc']) for (const name of Object.keys(base[container])) { + const input = base[container][name].input; + for (const field of Object.keys(input)) { + const f = clone(base), value = f[container][name].input[field]; + f[container][name].input[field] = typeof value === 'bigint' ? value + 1n : Array.isArray(value) + ? [...value, { opcode: 2n, argument: 0n }] : changeRoot(value); + assert.equal(accepted(f), false, `${container}.${name}.input.${field}`); + } + for (const side of ['expected', 'observed']) for (let word = 0; word < 8; word++) { + const f = clone(base); + f[container][name].digest[side]['w' + word] += 1n; + assert.equal(accepted(f), false, `${container}.${name}.digest.${side}.w${word}`); + } + for (const flag of ['domainMatches', 'canonicalSerializationMatches']) { + const f = clone(base); f[container][name].digest[flag] = false; + assert.equal(accepted(f), false, `${container}.${name}.${flag}`); + } + const f = clone(base), alien = root(900); + f[container][name].digest.expected = alien; + f[container][name].digest.observed = alien; + assert.equal(accepted(f), false, `${container}.${name}: mutually matching hashes cannot replace the expected root`); + } + const wrongModel = clone(base); wrongModel.expectedModelRoot = root(999); + assert.equal(accepted(wrongModel), false); + for (const field of ['bits', 'instructions']) { + const f = clone(base); + f.job.program[field] = field === 'bits' ? 16n : [{ opcode: 2n, argument: 0n }]; + assert.equal(accepted(f), false, `changed program ${field} under unchanged observed commitment`); + } + const changedInput = clone(base); changedInput.job.initialValue = 254n; + assert.equal(accepted(changedInput), false); +}); + +test('a self-consistent host commitment to a forged state still fails semantic replay', () => { + const f = fixture(); + f.candidate.value = 7n; + f.candidate.stateRoot = root(300); + f.candidate.checkpointRoot = root(320); + f.nc = checkpointCommitments(f.job, f.candidate); + assert.equal(call('Compute.stateCommitted', f.job, f.candidate, f.nc.state), true); + assert.equal(call('Compute.checkpointCommitted', f.candidate, f.nc.checkpoint), true); + assert.equal(accepted(f), false); + assert.deepEqual(advance(f), f.current); + const unsupported = fixture(); + unsupported.job.program.instructions[0].opcode = 14n; + unsupported.jc = jobCommitments(unsupported.job); + assert.equal(accepted(unsupported), false); +}); + +test('committed checkpoint transitions require both admitted endpoints and the exact retained predecessor', () => { + const f = fixture(); + assert.deepEqual(advance(f), f.candidate); + for (const mutation of [ + x => { x.candidate.priorRoot = root(999); x.nc = checkpointCommitments(x.job, x.candidate); }, + x => { x.candidate.step = x.current.step; x.candidate.value = x.current.value; x.nc = checkpointCommitments(x.job, x.candidate); }, + x => { x.candidate.step = 4n; x.nc = checkpointCommitments(x.job, x.candidate); }, + x => { x.current.value = 2n; x.cc = checkpointCommitments(x.job, x.current); }, + x => { x.cc.checkpoint.input.value += 1n; } + ]) { + const bad = clone(f); mutation(bad); + assert.deepEqual(advance(bad), bad.current); + } + for (let cut = 0; cut <= 3; cut++) { + const prefix = f.job.program.instructions.slice(0, cut), suffix = f.job.program.instructions.slice(cut), modulus = 256n; + assert.equal(call('Compute.execute', [...prefix, ...suffix], f.job.initialValue, modulus), call('Compute.execute', suffix, call('Compute.execute', prefix, f.job.initialValue, modulus), modulus)); + } +}); + +function ledger(limit = resources(20, 20, 20, 20), epoch = 7n) { + return { budget: { epoch, start: 0n, end: 100n, last: 0n, limit, spent: zero, reserved: zero }, reservations: [] }; +} +const settlement = (actionId, actual, epoch = 7n, tag = 'Known') => ({ actionId, epoch, actual, outcome: { tag, fields: [] } }); +const charge = l => Object.fromEntries(Object.keys(zero).map(k => [k, l.budget.spent[k] + l.budget.reserved[k]])); + +test('ledger reservation IDs are immutable, epoch-bound and charged in independent resource dimensions', () => { + const empty = ledger(), id = root(1), cost = resources(8, 5, 3, 1); + assert.equal(call('Budget.ledgerValid', empty), true); + const a = call('Budget.reserveLedger', empty, id, cost, 10); + assert.equal(call('Budget.ledgerValid', a), true); + assert.deepEqual(a.budget.reserved, cost); + assert.equal(a.reservations.length, 1); + assert.equal(a.reservations[0].epoch, empty.budget.epoch); + assert.deepEqual(call('Budget.reserveLedger', a, id, resources(1), 11), a); + for (const now of [9, 100]) assert.deepEqual(call('Budget.reserveLedger', a, root(2), cost, now), a); + for (const dimension of Object.keys(zero)) { + const tooMuch = { ...zero, [dimension]: 21n }; + assert.deepEqual(call('Budget.reserveLedger', a, root(2), tooMuch, 11), a); + } + assert.deepEqual(call('Budget.reserveLedger', a, { ...id, w0: 1n << 32n }, cost, 11), a); +}); + +test('settlement consumes only its recorded ceiling, retains tombstones and cannot be replayed', () => { + const idA = root(10), idB = root(20), aCost = resources(8, 5, 3, 2), bCost = resources(4, 9, 1, 1); + const a = call('Budget.reserveLedger', ledger(), idA, aCost, 10); + const both = call('Budget.reserveLedger', a, idB, bCost, 11); + const actual = resources(6, 2, 1, 0), obs = settlement(idA, actual); + const after = call('Budget.settleLedger', both, obs, 12); + assert.equal(call('Budget.ledgerValid', after), true); + assert.deepEqual(after.budget.spent, actual); + assert.deepEqual(after.budget.reserved, bCost); + assert.equal(after.reservations.length, 2); + assert.equal(after.reservations.find(x => call('Identity.sameDigest', x.actionId, idA)).settled, true); + assert.deepEqual(call('Budget.settleLedger', after, obs, 13), after); + assert.deepEqual(call('Budget.reserveLedger', after, idA, aCost, 13), after); + for (const observation of [ + settlement(idA, zero, 6n), settlement(idA, zero, 8n), settlement(root(999), zero), + settlement(idA, zero, 7n, 'Unknown'), settlement(idA, resources(9)), + settlement(idA, resources(0, 6)), settlement(idA, resources(0, 0, 4)), settlement(idA, resources(0, 0, 0, 3)) + ]) assert.deepEqual(call('Budget.settleLedger', both, observation, 12), both); + for (const now of [10, 100]) assert.deepEqual(call('Budget.settleLedger', both, obs, now), both); + const final = call('Budget.settleLedger', after, settlement(idB, bCost), 14); + assert.equal(call('Budget.ledgerValid', final), true); + assert.deepEqual(final.budget.reserved, zero); + assert.deepEqual(final.budget.spent, resources(10, 11, 2, 1)); +}); + +test('unattributed pooled reserves and forged reservation histories fail closed', () => { + const original = call('Budget.reserveLedger', ledger(), root(1), resources(5, 4, 3, 2), 10); + const invalid = []; + let x = clone(original); x.budget.reserved.transferBytes += 1n; invalid.push(x); + x = clone(original); x.budget.spent.computeWork += 1n; invalid.push(x); + x = clone(original); x.reservations = []; invalid.push(x); + x = clone(original); x.reservations.push(clone(x.reservations[0])); invalid.push(x); + x = clone(original); x.reservations[0].epoch += 1n; invalid.push(x); + x = clone(original); x.reservations[0].actual = resources(1); invalid.push(x); + x = clone(original); x.reservations[0].actionId.w0 = 1n << 32n; invalid.push(x); + x = clone(original); x.reservations[0].settled = true; x.reservations[0].actual = resources(6); x.budget.reserved = zero; x.budget.spent = resources(6); invalid.push(x); + for (const bad of invalid) { + assert.equal(call('Budget.ledgerValid', bad), false); + assert.deepEqual(call('Budget.reserveLedger', bad, root(2), resources(1), 11), bad); + assert.deepEqual(call('Budget.settleLedger', bad, settlement(root(1), zero), 11), bad); + } + const newEpoch = ledger(undefined, 8n); + const reused = call('Budget.reserveLedger', newEpoch, root(1), resources(5), 10); + assert.deepEqual(call('Budget.settleLedger', reused, settlement(root(1), resources(1), 7n), 11), reused); +}); + +test('finite ledger traces preserve limits and settlement never increases any charge dimension', () => { + for (let ceiling = 0; ceiling <= 4; ceiling++) for (let actual = 0; actual <= 5; actual++) for (const tag of ['Known', 'Unknown']) { + const before = call('Budget.reserveLedger', ledger(resources(4, 4, 4, 4)), root(1), resources(ceiling, ceiling, ceiling, ceiling), 1); + const obs = settlement(root(1), resources(actual, actual, actual, actual), 7n, tag); + const after = call('Budget.settleLedger', before, obs, 2); + assert.equal(call('Budget.ledgerValid', after), true); + for (const k of Object.keys(zero)) assert.ok(charge(after)[k] <= charge(before)[k]); + if (tag === 'Unknown' || actual > ceiling) assert.deepEqual(after, before); + else assert.deepEqual(after.budget.spent, resources(actual, actual, actual, actual)); + } + for (let a = 0; a <= 3; a++) for (let b = 0; b <= 3; b++) { + const initial = ledger(resources(3, 3, 3, 3)); + const one = call('Budget.reserveLedger', initial, root(1), resources(a, a, a, a), 1); + const two = call('Budget.reserveLedger', one, root(2), resources(b, b, b, b), 2); + assert.equal(call('Budget.ledgerValid', two), true); + for (const k of Object.keys(zero)) assert.ok(charge(two)[k] <= 3n); + assert.equal(two.reservations.length, a + b <= 3 ? 2 : 1); + } +}); + +test('structural settlement equals an independent first-match update on the complete short journal corpus', () => { + const same = (a, b) => Object.keys(a).every(k => a[k] === b[k]); + const reference = (records, observation) => { + let consumed = false; + return records.map(record => { + if (consumed || !same(record.actionId, observation.actionId)) return clone(record); + consumed = true; + return { ...clone(record), actual: clone(observation.actual), settled: true }; + }); + }; + // Include duplicates and already settled entries: this checks the internal + // traversal's exact first-match semantics, independently of ledger admission. + for (let length = 0; length <= 4; length++) for (let pattern = 0; pattern < 3 ** length; pattern++) for (let settled = 0; settled < 2 ** length; settled++) { + let digits = pattern; + const records = Array.from({ length }, (_, i) => { + const actionId = root(digits % 3); digits = Math.floor(digits / 3); + return { actionId, epoch: 7n, ceiling: resources(8, 6, 4, 2), actual: resources(i, i, i, i), settled: Boolean(settled & (1 << i)) }; + }); + for (let selected = 0; selected < 4; selected++) { + const observation = settlement(root(selected), resources(3, 2, 1, 0)); + assert.deepEqual(call('Budget.recordSettlement', records, observation), reference(records, observation)); + } + } +}); diff --git a/scripts/retain-source-evidence.mjs b/scripts/retain-source-evidence.mjs new file mode 100644 index 0000000..c078b3e --- /dev/null +++ b/scripts/retain-source-evidence.mjs @@ -0,0 +1,85 @@ +#!/usr/bin/env node +/** Retain actual source-verifier records. Never runs or replaces a native gate. */ +import assert from 'node:assert/strict'; +import { createHash } from 'node:crypto'; +import { lstatSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs'; +import { dirname, join, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { discoverSourceInputs, validateSourceEvidence } from './check-source-evidence.mjs'; + +const projectRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..'); +const hash = bytes => createHash('sha256').update(bytes).digest('hex'); + +/** Inputs are the unmodified files emitted by the actual pinned verifier. */ +export function retainSourceEvidence(attestationPath, manifestPath, root = projectRoot) { + function readRecord(path) { + assert.ok(lstatSync(path).isFile(), `evidence is not a nonsymlink file: ${path}`); + return readFileSync(path); + } + const attestationBytes = readRecord(attestationPath), manifestBytes = readRecord(manifestPath); + const attestation = JSON.parse(attestationBytes), manifest = JSON.parse(manifestBytes); + const sources = discoverSourceInputs(root, manifest); + const counts = {}; + for (const process of attestation.processes) counts[process.tool] = (counts[process.tool] ?? 0) + 1; + const summary = { + format: 'Stitch exact-source verification summary', + version: 1, + assurance: 'Summary of actual pinned LexLean/Lean/leanchecker/axiom verification; not a native Prism artifact certificate or whole-host guarantee', + attestation_id: attestation.attestation_id, + attestation_sha256: hash(attestationBytes), + source_id: attestation.source_id, + semantic_id: attestation.semantic_id, + build_id: attestation.build_id, + status: attestation.status, + module_count: manifest.modules.length, + declaration_audits: attestation.declarations.length, + successful_processes: attestation.processes.length, + processes_by_tool: counts, + sources, + not_covered: [ + 'Native Prism/Holo and guest artifact build', + 'Browser/provider/VM correctness and physical network trials', + 'Licensing and release qualification', + 'Handwritten host-code representation correspondence beyond named runtime tests', + ], + attestation_path: 'product/source-attestation.json', + build_manifest_path: 'product/source-build-manifest.json', + }; + // Validate everything before touching any destination, including on first use + // when there is no previous summary. Retention does not establish provenance + // of arbitrary supplied JSON; use only records from the real verifier run. + validateSourceEvidence(root, summary, attestationBytes, manifestBytes); + const product = resolve(root, 'product'); + assert.ok(lstatSync(product).isDirectory(), 'product is not a nonsymlink directory'); + const records = [ + ['source-attestation.json', attestationBytes], + ['source-build-manifest.json', manifestBytes], + ['source-verification.json', Buffer.from(`${JSON.stringify(summary, null, 2)}\n`)], + ]; + for (const [name] of records) { + const existing = lstatSync(join(product, name), { throwIfNoEntry: false }); + assert.ok(!existing || existing.isFile(), `destination is not a nonsymlink file: product/${name}`); + } + const stage = mkdtempSync(join(product, '.source-evidence-')); + try { + for (const [name, bytes] of records) writeFileSync(join(stage, name), bytes, { flag: 'wx' }); + // Detect a changed source or SDK pin while preparing the files. Replace the + // summary last: an interrupted multi-file replacement must fail closed. + validateSourceEvidence(root, summary, attestationBytes, manifestBytes); + for (const [name] of records) renameSync(join(stage, name), join(product, name)); + } finally { + rmSync(stage, { recursive: true, force: true }); + } + return summary; +} + +if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) { + const args = process.argv.slice(2); + if (args.length !== 2 || args.some(arg => arg.startsWith('--'))) { + console.error('usage: node scripts/retain-source-evidence.mjs '); + process.exitCode = 64; + } else { + const summary = retainSourceEvidence(resolve(args[0]), resolve(args[1])); + console.log(`Retained actual source evidence for ${summary.module_count} modules. Native Prism acceptance remains separate.`); + } +} diff --git a/scripts/verify-custody.py b/scripts/verify-custody.py new file mode 100644 index 0000000..afaa460 --- /dev/null +++ b/scripts/verify-custody.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python3 +"""Independent stdlib implementation of Stitch's raw custody commitments. + +No JavaScript/Prism runtime or network is used. --write-fixtures is for deliberate +fixture regeneration; the default only verifies the checked-in vectors and all +three recovery pairs, then tests malformed encodings. This establishes agreement +on this bounded corpus, not whole-browser formal correspondence or durability. +""" +import argparse +import copy +import hashlib +import json +import pathlib +import struct + +ROOT = pathlib.Path(__file__).resolve().parents[1] +FIXTURE = ROOT / 'tests/fixtures/custody-vectors.json' +MAX_BYTES = 16 * 1024 * 1024 + + +def digest(payload, domain): + frame = ('stitch/' + domain + '/v1\0').encode('ascii') + struct.pack('>Q', len(payload)) + payload + return 'sha256:' + hashlib.sha256(frame).hexdigest() + + +def canonical(value): + # Fixture/model record keys are ASCII. ensure_ascii=False matches compact + # JSON UTF-8, not an escaped representation of non-ASCII content. + return json.dumps(value, ensure_ascii=False, sort_keys=True, separators=(',', ':'), allow_nan=False).encode('utf-8') + + +def fragment_digest(encoding, index, data): + return digest(bytes.fromhex(encoding[7:]) + struct.pack('>I', index) + data, 'fragment') + + +def split(data): + n = (len(data) + 1) // 2 + left = data[:n] + right = data[n:] + bytes(n - len(data[n:])) + return [left, right, bytes(a ^ b for a, b in zip(left, right))] + + +def create(data): + assert len(data) <= MAX_BYTES + shards = split(data) + encoding = digest(data, 'encoding') + body = { + 'version': 1, + 'object': {'digestAlgorithm': 'sha256', 'contentDigest': digest(data, 'object'), 'byteLength': len(data)}, + 'encoding': {'format': 'raw', 'encodingDigest': encoding, 'byteLength': len(data), 'dependencies': []}, + 'fragments': {'scheme': 'xor-2-of-3', 'threshold': 2, 'count': 3, 'byteLength': len(shards[0]), + 'digests': [fragment_digest(encoding, i, b) for i, b in enumerate(shards)]}, + } + return dict(body, manifestDigest=digest(canonical(body), 'manifest')), shards + + +def keys(value, expected): + assert type(value) is dict and set(value) == set(expected) + + +def is_digest(value): + assert type(value) is str and len(value) == 71 and value.startswith('sha256:') + assert all(c in '0123456789abcdef' for c in value[7:]) + + +def verify_manifest(m): + keys(m, ['version', 'object', 'encoding', 'fragments', 'manifestDigest']) + keys(m['object'], ['digestAlgorithm', 'contentDigest', 'byteLength']) + keys(m['encoding'], ['format', 'encodingDigest', 'byteLength', 'dependencies']) + keys(m['fragments'], ['scheme', 'threshold', 'count', 'byteLength', 'digests']) + assert type(m['version']) is int and m['version'] == 1 + assert m['object']['digestAlgorithm'] == 'sha256' and m['encoding']['format'] == 'raw' + n = m['object']['byteLength'] + assert type(n) is int and 0 <= n <= MAX_BYTES + assert type(m['encoding']['byteLength']) is int and m['encoding']['byteLength'] == n + assert m['encoding']['dependencies'] == [] and type(m['encoding']['dependencies']) is list + f = m['fragments'] + assert f['scheme'] == 'xor-2-of-3' and type(f['threshold']) is int and f['threshold'] == 2 + assert type(f['count']) is int and f['count'] == 3 + assert type(f['byteLength']) is int and f['byteLength'] == (n + 1) // 2 + assert type(f['digests']) is list and len(f['digests']) == 3 + for d in [m['manifestDigest'], m['object']['contentDigest'], m['encoding']['encodingDigest'], *f['digests']]: + is_digest(d) + body = {k: v for k, v in m.items() if k != 'manifestDigest'} + assert digest(canonical(body), 'manifest') == m['manifestDigest'] + + +def recover(m, supplied): + verify_manifest(m) + assert 2 <= len(supplied) <= 3 + assert len({i for i, _ in supplied}) == len(supplied) + shards = [None] * 3 + for index, data in supplied: + assert type(index) is int and 0 <= index < 3 and type(data) is bytes + assert len(data) == m['fragments']['byteLength'] + assert fragment_digest(m['encoding']['encodingDigest'], index, data) == m['fragments']['digests'][index] + shards[index] = data + if shards[0] is None: + shards[0] = bytes(a ^ b for a, b in zip(shards[1], shards[2])) + if shards[1] is None: + shards[1] = bytes(a ^ b for a, b in zip(shards[0], shards[2])) + n = m['object']['byteLength'] + if n % 2: + assert shards[1][-1] == 0 + data = (shards[0] + shards[1])[:n] + recreated, _ = create(data) + assert recreated == m + return data + + +def fixture_data(): + corpus = [('empty', b''), ('one-zero', b'\0'), ('odd', bytes([0, 1, 2, 254, 255])), + ('even', bytes([0, 1, 2, 3, 254, 255])), ('utf8', 'Stitch \u2603 \U0001f9f5'.encode()), + ('all-bytes', bytes(range(256)))] + vectors = [] + for name, data in corpus: + manifest, shards = create(data) + vectors.append({'name': name, 'objectHex': data.hex(), 'manifest': manifest, + 'fragments': [{'index': i, 'hex': b.hex()} for i, b in enumerate(shards)]}) + manifest, shards = create(bytes([1, 2, 3])) + invalid = [] + + def add(name, expected, m=None, supplied=None): + m = copy.deepcopy(manifest) if m is None else m + supplied = [(0, shards[0]), (1, shards[1])] if supplied is None else supplied + invalid.append({'name': name, 'expectedError': expected, 'manifest': m, + 'fragments': [{'index': i, 'hex': b.hex()} for i, b in supplied]}) + + add('duplicate-index', 'DuplicateFragment', supplied=[(0, shards[0]), (0, shards[0])]) + add('missing-fragment', 'InsufficientFragments', supplied=[(0, shards[0])]) + truncated = copy.deepcopy(manifest) + truncated['object']['contentDigest'] = truncated['object']['contentDigest'][:24] + add('truncated-object-digest', 'InvalidDigest', truncated) + dependencies = copy.deepcopy(manifest) + dependencies['encoding']['dependencies'] = ['sha256:' + 'a' * 64] + add('undeclared-external-basis', 'InvalidSchema', dependencies) + add('forged-fragment', 'FragmentDigestMismatch', supplied=[(0, bytes([shards[0][0] ^ 1, shards[0][1]])), (1, shards[1])]) + absent = copy.deepcopy(manifest) + absent['fragments']['digests'][2] = 'sha256:' + '0' * 64 + absent['manifestDigest'] = digest(canonical({k: v for k, v in absent.items() if k != 'manifestDigest'}), 'manifest') + add('inconsistent-absent-fragment', 'InvalidParity', absent) + padding = copy.deepcopy(manifest) + bad_shards = [shards[0], bytes([shards[1][0], 7]), bytes([shards[2][0], shards[2][1] ^ 7])] + padding['fragments']['digests'] = [fragment_digest(padding['encoding']['encodingDigest'], i, b) for i, b in enumerate(bad_shards)] + padding['manifestDigest'] = digest(canonical({k: v for k, v in padding.items() if k != 'manifestDigest'}), 'manifest') + add('nonzero-padding', 'InvalidPadding', padding, [(0, bad_shards[0]), (1, bad_shards[1])]) + wrong_object = copy.deepcopy(manifest) + wrong_object['object']['contentDigest'] = 'sha256:' + '0' * 64 + wrong_object['manifestDigest'] = digest(canonical({k: v for k, v in wrong_object.items() if k != 'manifestDigest'}), 'manifest') + add('object-does-not-match', 'ObjectDigestMismatch', wrong_object) + wrong_encoding = copy.deepcopy(manifest) + wrong_encoding['encoding']['encodingDigest'] = 'sha256:' + '0' * 64 + wrong_encoding['fragments']['digests'] = [fragment_digest(wrong_encoding['encoding']['encodingDigest'], i, b) for i, b in enumerate(shards)] + wrong_encoding['manifestDigest'] = digest(canonical({k: v for k, v in wrong_encoding.items() if k != 'manifestDigest'}), 'manifest') + add('encoding-does-not-match', 'EncodingDigestMismatch', wrong_encoding) + return {'version': 1, 'hashFrame': 'UTF8(stitch//v1\\0)||uint64be(length)||payload', + 'vectors': vectors, 'invalidVectors': invalid} + + +def must_reject(action): + try: + action() + except (AssertionError, KeyError, ValueError, TypeError, IndexError): + return + raise AssertionError('Malformed input was accepted') + + +def main(): + args = argparse.ArgumentParser() + args.add_argument('--write-fixtures', action='store_true') + options = args.parse_args() + generated = fixture_data() + if options.write_fixtures: + FIXTURE.parent.mkdir(parents=True, exist_ok=True) + FIXTURE.write_text(json.dumps(generated, ensure_ascii=False, indent=2) + '\n') + fixture = json.loads(FIXTURE.read_text()) + assert fixture == generated, 'Checked-in commitments differ from independent Python implementation' + pairs = [(0, 1), (0, 2), (1, 2)] + for v in fixture['vectors']: + data = bytes.fromhex(v['objectHex']) + shards = [bytes.fromhex(f['hex']) for f in v['fragments']] + for a, b in pairs: + assert recover(v['manifest'], [(a, shards[a]), (b, shards[b])]) == data + must_reject(lambda: recover(v['manifest'], [(0, shards[0]), (0, shards[0])])) + bad = copy.deepcopy(v['manifest']) + bad['object']['contentDigest'] = bad['object']['contentDigest'][:-1] + must_reject(lambda: verify_manifest(bad)) + for v in fixture['invalidVectors']: + supplied = [(f['index'], bytes.fromhex(f['hex'])) for f in v['fragments']] + must_reject(lambda: recover(v['manifest'], supplied)) + m, shards = create(bytes([1, 2, 3])) + bad = copy.deepcopy(m) + bad['fragments']['digests'][2] = digest(b'incorrect', 'fragment') + body = {k: v for k, v in bad.items() if k != 'manifestDigest'} + bad['manifestDigest'] = digest(canonical(body), 'manifest') + must_reject(lambda: recover(bad, [(0, shards[0]), (1, shards[1])])) + print(f"Independent Python custody verification: {len(fixture['vectors'])} valid vectors, {len(pairs) * len(fixture['vectors'])} recovery pairs, {len(fixture['invalidVectors'])} shared invalid vectors rejected") + + +if __name__ == '__main__': + main() diff --git a/src/authority-ui.js b/src/authority-ui.js new file mode 100644 index 0000000..e171fdf --- /dev/null +++ b/src/authority-ui.js @@ -0,0 +1,113 @@ +/** Contextual origin-local administration. No network or automatic trust changes. */ +import { model } from './layer1-uor/generated-model.js'; +import { parseCanonicalJson } from './layer1-uor/custody.js'; +const controls = { inspectAuthorityStorageBtn: 0, rotateAuthorityBtn: 1, revokeAuthorityBtn: 2, + saveTrustedAnchorBtn: 3, restoreTrustedAnchorBtn: 4, migrateTrustedAnchorBtn: 5, + revokeTrustedAnchorBtn: 6, persistAuthorityStorageBtn: 7, exportAuthorityJournalBtn: 8, compactAuthorityJournalBtn: 9 }; +export function installAuthorityControls({ document, store, pointerObserver, onAuthorityChanged = () => {}, onChange = () => {}, + download = text => { + const url = URL.createObjectURL(new Blob([text], { type: 'application/json' })); + const link = document.createElement('a'); link.href = url; link.download = 'stitch-public-authority-journal.json'; link.click(); + setTimeout(() => URL.revokeObjectURL(url), 1000); + } }) { + const get = id => document.getElementById(id), panel = get('authorityLifecyclePanel'); + let busy = false, version = 0, status = null, trust = null; + const scope = () => [get('dnsQueryInput').value.trim(), get('pointerAuthorityInput').value.trim()]; + const message = text => { get('authorityLifecycleStatus').textContent = text; onChange(); }; + function invalidate() { version++; get('authorityLifecycleConsent').checked = false; get('authorityAnchorConsent').checked = false; } + for (const id of ['dnsQueryInput','pointerAuthorityInput','authorityExpectedKey','authorityAnchorKey','authorityAnchorDigest','pointerJsonInput']) get(id).addEventListener('input', invalidate); + panel.addEventListener('toggle', () => { if (!panel.open) invalidate(); }); + function allowed(id) { + let hasHead = false; + try { hasHead = !!pointerObserver().head; } catch {} + return model['Stitch.Authority.controlAllowed'](controls[id], busy, !!status, status?.status === 'active', hasHead, !!trust); + } + function render() { + for (const id of Object.keys(controls)) get(id).disabled = !allowed(id); + get('authoritySignerControls').hidden = !status; + get('authorityTrustControls').hidden = !trust; + panel.setAttribute('aria-busy', String(busy)); + } + async function refresh() { + const current = scope().join(':'); + status = await store.authorityStatus(); + const saved = scope()[0] ? await store.trustedAnchor(scope()[0]) : null; + if (current === scope().join(':')) trust = saved; + get('authoritySavedSummary').textContent = status + ? `Saved signer ${status.publicKey}; generation ${status.generation}; ${status.status}. Rotation never transfers trust.` : 'No saved signer. Missing storage does not prove that an earlier provider effect never happened.'; + get('authorityTrustSummary').textContent = trust + ? `Saved trust for ${trust.name}: ${trust.publicKey}, exact head ${trust.head.pointerDigest}; ${trust.status}.` : 'No saved trust anchor for this name. Independently confirm the current admitted head before saving it.'; + render(); + } + async function run(id, work) { + if (busy) return; + if (!allowed(id)) { message('This action requires the current saved signer, admitted head or saved trust anchor. Inspect storage and the exact scope first.'); return; } + busy = true; render(); + const start = ++version, captured = scope().join(':'), current = () => start === version && captured === scope().join(':') && panel.open; + try { await work(current); } + catch (error) { message(`Refused or interrupted: ${error.message}. Retained keys, anchors and unknown journals are not reset.`); } + finally { busy = false; get('authorityLifecycleConsent').checked = false; get('authorityAnchorConsent').checked = false; + try { await refresh(); } catch (error) { message(`Storage inspection failed: ${error.message}. Nothing was reset.`); } render(); } + } + function signerRequest(current) { + return { expectedPublicKey: get('authorityExpectedKey').value.trim(), confirmed: get('authorityLifecycleConsent').checked, scopeStillCurrent: current }; + } + const handlers = { + inspectAuthorityStorageBtn: async () => { + const result = await store.inspectStorage(); + message(`Origin storage: ${result.usageBytes ?? 'unknown'} bytes used / ${result.quotaBytes ?? 'unknown'} quota; persistent ${result.persistent ?? 'unknown'}; ${result.journalEntries} publication records, ${result.unknownEntries} unresolved. Estimates and persistence permission are not backups.`); + }, + rotateAuthorityBtn: async current => { + const next = await store.rotateAuthority(signerRequest(current)); + await onAuthorityChanged(next); + message(`New saved signer ${next.publicKey}. The former key is retired locally. No trust pin or DNS record changed. Independently distribute and accept the new key before using it for a name.`); + }, + revokeAuthorityBtn: async current => { + const next = await store.revokeAuthority(signerRequest(current)); + await onAuthorityChanged(next); + message(`Saved signer ${next.publicKey} revoked locally. Unknown publications remain reconcilable. This cannot revoke signatures, remote copies or key handles held by other origin scripts.`); + }, + saveTrustedAnchorBtn: async current => { + const observer = pointerObserver(); + await store.saveTrustedAnchor({ candidate: observer.head, expectedAuthorityKey: get('authorityAnchorKey').value.trim(), + expectedPointerDigest: get('authorityAnchorDigest').value.trim(), confirmed: get('authorityAnchorConsent').checked, scopeStillCurrent: current }); + message('Exact current head and independently confirmed key saved locally. Later admitted successors update this saved head transactionally. Keep an independent recent anchor outside this origin.'); + }, + restoreTrustedAnchorBtn: async current => { + const observer = pointerObserver(), saved = await store.trustedAnchor(observer.name); + if (!saved) throw Error('No saved anchor for this name.'); + await observer.restoreFromTrustedAnchor({ expectedDigest: saved.head.pointerDigest, scopeStillCurrent: current }); + message('Saved exact head restored into this same pinned observer. A different retained head is never replaced. No DNS or signing effect occurred.'); + }, + migrateTrustedAnchorBtn: async current => { + const [name] = scope(), prior = await store.trustedAnchor(name); + if (!prior) throw Error('Save the independently accepted original anchor first.'); + await store.migrateTrustedAnchor({ name, expectedAuthorityKey: prior.publicKey, expectedPointerDigest: prior.head.pointerDigest, + newAuthorityKey: get('authorityAnchorKey').value.trim(), newPointerDigest: get('authorityAnchorDigest').value.trim(), + candidate: parseCanonicalJson(get('pointerJsonInput').value, { maxBytes: 4096 }), confirmed: get('authorityAnchorConsent').checked, scopeStillCurrent: current }); + message('Independently confirmed replacement anchor saved. The old live observer and visible pin are unchanged. Enter the replacement key above and explicitly restore the saved head. Old-scope unknown publications remain reconcilable.'); + }, + revokeTrustedAnchorBtn: async current => { + const [name] = scope(), prior = await store.trustedAnchor(name); + if (!prior || !current() || !get('authorityAnchorConsent').checked || get('authorityAnchorKey').value.trim() !== prior.publicKey + || get('authorityAnchorDigest').value.trim() !== prior.head.pointerDigest) throw Error('Confirm the exact saved key and digest before revoking trust.'); + await store.revokeTrustedAnchor({ name, expectedAuthorityKey: prior.publicKey, expectedPointerDigest: prior.head.pointerDigest, confirmed: true, scopeStillCurrent: current }); + message('Saved trust revoked for this name. Admission and new publication with this pin are blocked. Migration needs an independently accepted replacement key. Existing unknown writes are retained.'); + }, + persistAuthorityStorageBtn: async () => { + const granted = await store.requestPersistence({ confirmed: true }); + message(granted ? 'Browser granted origin persistence. Clearing, device loss and browser policy can still lose keys and journals; keep independent public evidence.' : 'Browser did not grant persistence. No data was deleted; save independent evidence and monitor available quota.'); + }, + exportAuthorityJournalBtn: async () => { download(await store.exportPublicJournal()); message('Public keys, exact anchors and publication journal exported. No private keys or tokens. This evidence has no automatic journal-import path; do not treat it as permission to repeat a write.'); }, + compactAuthorityJournalBtn: async current => { + if (!get('authorityLifecycleConsent').checked) throw Error('Confirm removal of definitely refused, identity-free journal records.'); + message(`Removed ${await store.compactRefusedJournal({ confirmed: true, scopeStillCurrent: current })} definitely refused publication records without provider identities. Unknown records, published heads and key/trust history remain retained.`); + }, + }; + for (const [id, handler] of Object.entries(handlers)) get(id).addEventListener('click', () => run(id, handler)); + for (const id of ['dnsQueryInput', 'pointerAuthorityInput']) get(id).addEventListener('input', () => { + invalidate(); trust = null; render(); if (panel.open && !busy) refresh().catch(error => message(`Storage unavailable: ${error.message}. No data was reset.`)); + }); + panel.addEventListener('toggle', () => { if (panel.open && !busy) refresh().catch(error => message(`Storage unavailable: ${error.message}. No data was reset.`)); }); + return Object.freeze({ refresh, render }); +} diff --git a/src/layer1-uor/browser-authority.js b/src/layer1-uor/browser-authority.js new file mode 100644 index 0000000..fad7000 --- /dev/null +++ b/src/layer1-uor/browser-authority.js @@ -0,0 +1,314 @@ +/** Origin-local authority operations. Not a key backup or global revocation service. */ +import { generateAuthority, signPointer, verifyPointer, admitPointer } from './pointer.js'; +import { canonicalBytes } from './custody.js'; +import { identifier, natural, digest } from './contracts.js'; +import { model } from './generated-model.js'; +const policy = (name, ...args) => model[`Stitch.Effects.${name}`](...args); +const lifecycle = (name, ...args) => model[`Stitch.Authority.${name}`](...args); +const keyValid = key => typeof key === 'string' && /^[a-f0-9]{64}$/.test(key); +const insist = (condition, message) => { if (!condition) throw Error(message); }; +const generation = value => value?.version === 1 ? 0 : value?.generation; +const active = value => value?.version === 1 || value?.status === 'active'; +const authorityState = value => ({ generation: value ? generation(value) : 0, present: !!value, revoked: !!value && !active(value) }); +function validateAuthority(value) { + if (value == null) return null; + insist((value.version === 1 || value.version === 2) && keyValid(value.publicKey), 'Stored authority invalid; it was not replaced.'); + if (value.version === 2) { + natural(value.generation); natural(value.updatedAtMs); + insist(['active', 'revoked'].includes(value.status) && Array.isArray(value.history) && value.history.length <= 64, + 'Stored authority lifecycle invalid; it was not replaced.'); + const seen = new Set([value.publicKey]); + value.history.forEach((entry, index) => { + insist(keyValid(entry.publicKey) && !seen.has(entry.publicKey) && entry.generation === index, + 'Stored authority history invalid; it was not replaced.'); + seen.add(entry.publicKey); natural(entry.revokedAtMs); + }); + insist(value.generation === value.history.length, 'Stored authority generation invalid.'); + } + if (active(value)) insist(value.privateKey?.type === 'private' && value.privateKey.extractable === false + && value.privateKey.algorithm?.name === 'Ed25519' && value.privateKey.usages.includes('sign'), 'Stored signing key invalid; it was not replaced.'); + else insist(value.privateKey === null, 'Revoked authority retains an unexpected key.'); + return value; +} +function validateTrust(value) { + if (value == null) return null; + insist(value.version === 1 && ['active', 'revoked'].includes(value.status) && keyValid(value.publicKey) + && value.head?.authorityKey === value.publicKey && value.head?.name === value.name, 'Stored trust anchor invalid; it was not replaced.'); + identifier(value.name); natural(value.generation); digest(value.head.pointerDigest); + insist(Array.isArray(value.history) && value.history.length === value.generation && value.generation <= 64, 'Stored trust history invalid.'); + for (const entry of value.history) { insist(keyValid(entry.publicKey) && ['active','revoked'].includes(entry.status), 'Stored trust history invalid.'); digest(entry.pointerDigest); } + return value; +} +export class BrowserAuthorityStore { + constructor({ indexedDB = globalThis.indexedDB, locks = globalThis.navigator?.locks, + storage = globalThis.navigator?.storage, clock = Date.now, database = 'stitch-authority-v1' } = {}) { + this.indexedDB = indexedDB; this.database = database; this.locks = locks; this.storage = storage; this.clock = clock; + } + exclusiveAuthority(work) { + if (!this.locks?.request) throw Error('Web Locks unavailable; safe cross-tab authority operations are blocked.'); + return this.locks.request(`stitch-authority:${this.database}`, { mode: 'exclusive' }, work); + } + exclusivePublication(scope, work) { + // One origin lifecycle lock excludes revoke/rotate while a dispatch is in + // flight. No timer takeover. Unknown intent survives owner termination. + return this.exclusiveAuthority(() => this.locks.request(`stitch-dns:${this.database}:${scope}`, { mode: 'exclusive' }, work)); + } + async open() { + if (!this.indexedDB) throw Error('Browser storage unavailable; no persistent authority or publication was created.'); + return new Promise((resolve, reject) => { + const request = this.indexedDB.open(this.database, 1); let blocked = false; + request.onupgradeneeded = () => request.result.createObjectStore('records'); + request.onerror = () => reject(request.error); + request.onblocked = () => { blocked = true; reject(Error('Browser storage upgrade blocked; close other Stitch tabs.')); }; + request.onsuccess = () => { if (blocked) request.result.close(); else { request.result.onversionchange = () => request.result.close(); resolve(request.result); } }; + }); + } + async transactionMany(keys, change) { + const db = await this.open(); + try { + return await new Promise((resolve, reject) => { + const tx = db.transaction('records', 'readwrite', { durability: 'strict' }); + const store = tx.objectStore('records'), values = new Map(); let result, remaining = keys.length; + tx.oncomplete = () => resolve(result); + tx.onabort = () => reject(tx.error || Error('Browser storage transaction aborted; prior data retained.')); + tx.onerror = () => {}; // Abort is the commit boundary, not request success. + for (const key of keys) { + const read = store.get(key); + read.onsuccess = () => { + values.set(key, read.result); + if (--remaining) return; + try { + const update = change(values); result = update.result; + for (const [key, value] of update.writes ?? []) { insist(keys.includes(key), 'Unscoped browser transaction.'); store.put(value, key); } + for (const key of update.deletes ?? []) { insist(keys.includes(key), 'Unscoped browser transaction.'); store.delete(key); } + } catch (error) { tx.abort(); reject(error); } + }; + } + }); + } finally { db.close(); } + } + transaction(key, change) { + return this.transactionMany([key], values => { + const update = change(values.get(key)); + return { result: update.result, writes: update.write === undefined ? [] : [[key, update.write]], deletes: update.delete ? [key] : [] }; + }); + } + async records() { + const db = await this.open(); + try { + return await new Promise((resolve, reject) => { + const tx = db.transaction('records', 'readonly'), values = []; + tx.oncomplete = () => resolve(values); tx.onabort = () => reject(tx.error || Error('Browser storage scan aborted.')); tx.onerror = () => {}; + const cursor = tx.objectStore('records').openCursor(); + cursor.onsuccess = () => { if (cursor.result) { values.push([cursor.result.key, cursor.result.value]); cursor.result.continue(); } }; + }); + } finally { db.close(); } + } + read(key) { return this.transaction(key, value => ({ result: value ?? null })); } + async authorityStatus() { + const value = validateAuthority(await this.read('authority')); + return value ? { publicKey: value.publicKey, generation: generation(value), status: active(value) ? 'active' : 'revoked', history: (value.history ?? []).map(entry => ({ publicKey: entry.publicKey, generation: entry.generation, revokedAtMs: entry.revokedAtMs })) } : null; + } + async restoreAuthority() { + const value = validateAuthority(await this.read('authority')); + if (!value) return null; + insist(active(value), 'Saved authority revoked locally. Explicit rotation is required; setup cannot replace it.'); + const challenge = new TextEncoder().encode('stitch/authority-storage-check/v1'); + const publicKey = await crypto.subtle.importKey('raw', Uint8Array.from(value.publicKey.match(/../g), x => parseInt(x, 16)), 'Ed25519', false, ['verify']); + const signature = await crypto.subtle.sign('Ed25519', value.privateKey, challenge); + insist(await crypto.subtle.verify('Ed25519', publicKey, signature, challenge), 'Stored authority key mismatch; it was not replaced.'); + return value; + } + async setupAuthority() { + return this.exclusiveAuthority(async () => { + const existing = await this.restoreAuthority(); + if (!policy('authorityMayCreate', !!existing, true)) return existing; + const created = { version: 1, ...await generateAuthority() }; + await this.transaction('authority', value => ({ result: null, write: value ?? created })); + return this.restoreAuthority(); + }); + } + async signPointer(body, expectedPublicKey) { + body = structuredClone(body); + return this.exclusiveAuthority(async () => { + const authority = await this.restoreAuthority(); + insist(lifecycle('maySign', authorityState(authority), authority?.publicKey === expectedPublicKey, + body.authorityKey === expectedPublicKey), 'Saved authority changed, missing or revoked; no pointer signed.'); + return signPointer(body, authority.privateKey); + }); + } + rotateAuthority({ expectedPublicKey, confirmed = false, scopeStillCurrent = () => true, nowMs = Date.now() }) { + return this.exclusiveAuthority(async () => { + natural(nowMs); + // Generation happens only for an explicit operation. Commit CAS still + // preserves the prior key on quota/abort and never changes a trust pin. + insist(confirmed === true && keyValid(expectedPublicKey), 'Confirm the exact authority to rotate.'); + const pair = await generateAuthority(); + await this.transaction('authority', prior => { + validateAuthority(prior); + insist(lifecycle('rotationAllowed', confirmed && scopeStillCurrent() === true, !!prior, prior?.publicKey === expectedPublicKey, + (prior?.history?.length ?? 0) < 64), 'Authority changed or lifecycle history full; rotation refused.'); + const next = lifecycle('rotate', authorityState(prior), confirmed, true, true); + const history = [...(prior.history ?? []), { publicKey: prior.publicKey, generation: generation(prior), revokedAtMs: nowMs }]; + return { result: null, write: { version: 2, ...pair, status: next.revoked ? 'revoked' : 'active', generation: Number(next.generation), history, updatedAtMs: nowMs } }; + }); + return this.authorityStatus(); + }); + } + revokeAuthority({ expectedPublicKey, confirmed = false, scopeStillCurrent = () => true, nowMs = Date.now() }) { + return this.exclusiveAuthority(() => this.transaction('authority', prior => { + validateAuthority(prior); natural(nowMs); + insist(lifecycle('revocationAllowed', confirmed === true && scopeStillCurrent() === true, !!prior, prior?.publicKey === expectedPublicKey), 'Confirm the exact saved authority to revoke.'); + const next = lifecycle('revoke', authorityState(prior), confirmed, true); + const write = { ...prior, version: 2, status: next.revoked ? 'revoked' : 'active', generation: Number(next.generation), privateKey: null, + history: prior.history ?? [], updatedAtMs: nowMs }; + return { write, result: { publicKey: write.publicKey, status: write.status, generation: write.generation } }; + })); + } + async trustedAnchor(name) { identifier(name); return validateTrust(await this.read(`trust:${name}`)); } + async assertTrustedAuthority(name, publicKey) { + const trust = await this.trustedAnchor(name); + insist(!trust || trust.status === 'active' && trust.publicKey === publicKey, 'This name has a different or revoked saved trust anchor; explicit migration is required.'); + return trust; + } + async saveTrustedAnchor({ candidate, expectedAuthorityKey, expectedPointerDigest, confirmed = false, scopeStillCurrent = () => true, nowMs }) { + return this.exclusiveAuthority(async () => { + candidate = structuredClone(candidate); if (nowMs !== undefined) natural(nowMs); digest(expectedPointerDigest); + insist(confirmed === true && keyValid(expectedAuthorityKey), 'Independently confirm the exact anchor key and digest.'); + await verifyPointer(candidate, expectedAuthorityKey); + insist(candidate.pointerDigest === expectedPointerDigest && candidate.validFromMs <= (nowMs ?? this.clock()) && (nowMs ?? this.clock()) < candidate.validUntilMs, + 'Trust anchor digest or validity mismatch.'); + const key = `trust:${candidate.name}`; + return this.transaction(key, prior => { + validateTrust(prior); + const now = nowMs ?? this.clock(); natural(now); + insist(candidate.validFromMs <= now && now < candidate.validUntilMs, 'Trust anchor expired before storage commit.'); + insist(lifecycle('anchorSaveAllowed', confirmed, scopeStillCurrent() === true, !prior, + prior?.status === 'active' && prior?.publicKey === expectedAuthorityKey && prior?.head.pointerDigest === expectedPointerDigest), 'A different saved anchor exists; explicit migration is required.'); + const write = prior ?? { version: 1, name: candidate.name, publicKey: expectedAuthorityKey, head: candidate, status: 'active', generation: 0, history: [] }; + return { write, result: write }; + }); + }); + } + async migrateTrustedAnchor({ name, expectedAuthorityKey, expectedPointerDigest, newAuthorityKey, newPointerDigest, + candidate, confirmed = false, scopeStillCurrent = () => true, nowMs }) { + return this.exclusiveAuthority(async () => { + identifier(name); if (nowMs !== undefined) natural(nowMs); digest(expectedPointerDigest); digest(newPointerDigest); candidate = structuredClone(candidate); + insist(confirmed === true && keyValid(newAuthorityKey), 'Independently confirm the replacement authority and exact anchor.'); + await verifyPointer(candidate, newAuthorityKey); + insist(candidate.name === name && candidate.pointerDigest === newPointerDigest && candidate.validFromMs <= (nowMs ?? this.clock()) && (nowMs ?? this.clock()) < candidate.validUntilMs, + 'Replacement anchor scope, digest or validity mismatch.'); + return this.transaction(`trust:${name}`, prior => { + validateTrust(prior); + const now = nowMs ?? this.clock(); natural(now); + insist(candidate.validFromMs <= now && now < candidate.validUntilMs, 'Replacement anchor expired before storage commit.'); + insist(lifecycle('migrationAllowed', confirmed, scopeStillCurrent() === true, !!prior, + prior?.publicKey === expectedAuthorityKey && prior?.head.pointerDigest === expectedPointerDigest, + (prior?.history?.length ?? 0) < 64), 'Trust anchor changed or history full; migration refused.'); + insist(lifecycle('anchorChronologyAllowed', prior.publicKey === newAuthorityKey, candidate.revision < prior.head.revision, + candidate.revision === prior.head.revision, candidate.pointerDigest === prior.head.pointerDigest, + candidate.revision === prior.head.revision + 1, candidate.previousDigest === prior.head.pointerDigest), + 'Same-key anchor rollback, fork or wrong adjacent predecessor refused.'); + insist(!prior.history.some(entry => entry.publicKey === newAuthorityKey && entry.publicKey !== prior.publicKey) && !(prior.status === 'revoked' && prior.publicKey === newAuthorityKey), 'A retired trust key cannot be reactivated; use an independently accepted new key.'); + const next = lifecycle('migrate', { generation: prior.generation, present: true, revoked: prior.status === 'revoked' }, confirmed, true, true, true); + const write = { version: 1, name, publicKey: newAuthorityKey, head: candidate, status: next.revoked ? 'revoked' : 'active', generation: Number(next.generation), + history: [...prior.history, { publicKey: prior.publicKey, pointerDigest: prior.head.pointerDigest, status: prior.status }] }; + return { write, result: write }; + }); + }); + } + async retainTrustedHead({ name, expectedPointerDigest, candidate, nowMs = Date.now() }) { + return this.exclusiveAuthority(async () => { + candidate = structuredClone(candidate); + const prior = await this.trustedAnchor(name); + insist(prior?.status === 'active', 'Saved trust anchor missing or revoked.'); + await verifyPointer(candidate, prior.publicKey); + if (candidate.pointerDigest !== prior.head.pointerDigest) await admitPointer(prior.head, candidate, { + name, trustedAuthorityKey: prior.publicKey, nowMs }); + return this.transaction(`trust:${name}`, current => { + validateTrust(current); + insist(current?.status === 'active' && current.publicKey === prior.publicKey + && current.head.pointerDigest === prior.head.pointerDigest + && (current.head.pointerDigest === expectedPointerDigest || current.head.pointerDigest === candidate.pointerDigest), + 'Saved trust head changed; restore its exact anchor before succession.'); + const write = { ...current, head: candidate }; return { write, result: write }; + }); + }); + } + async revokeTrustedAnchor({ name, expectedAuthorityKey, expectedPointerDigest, confirmed = false, scopeStillCurrent = () => true }) { + identifier(name); + return this.exclusiveAuthority(() => this.transaction(`trust:${name}`, prior => { + validateTrust(prior); + insist(lifecycle('revocationAllowed', confirmed === true && scopeStillCurrent() === true, !!prior, + prior?.publicKey === expectedAuthorityKey && prior?.head.pointerDigest === expectedPointerDigest), 'Saved anchor changed; revocation refused.'); + const write = { ...prior, status: 'revoked' }; return { write, result: write }; + })); + } + readPublication(scope) { return this.read(`dns:${scope}`); } + claimPublication(scope, pending) { + return this.transactionMany([`dns:${scope}`, 'authority', `trust:${pending.candidate?.name}`], values => { + const prior = values.get(`dns:${scope}`), authority = validateAuthority(values.get('authority')); + const trust = validateTrust(values.get(`trust:${pending.candidate?.name}`)); + if (!policy('journalMayClaim', prior?.outcome === 'unknown')) return { result: { prior, writer: false } }; + const publicKey = pending.candidate?.authorityKey; + const retired = authority && ((!active(authority) && authority.publicKey === publicKey) || authority.history?.some(x => x.publicKey === publicKey)); + insist(lifecycle('publicationAllowed', !!retired, !trust || trust.status === 'active' && trust.publicKey === publicKey), 'Writer key or saved trust revoked/changed; only existing unknown reconciliation is allowed.'); + const owner = crypto.randomUUID(), write = { ...pending, owner }; + insist(write.outcome === 'unknown' && write.candidate && write.pointerDigest === write.candidate.pointerDigest, 'Invalid write-ahead intent.'); + return { writes: [[`dns:${scope}`, write]], result: { prior, writer: true, owner } }; + }); + } + finishPublication(scope, expectedDigest, owner, next) { + return this.transaction(`dns:${scope}`, prior => { + const allowed = policy('journalMayFinish', prior?.pointerDigest === expectedDigest, prior?.owner === owner, next.outcome === 'published'); + if (prior?.outcome === 'published' && next.outcome !== 'published') throw Error('Published journal cannot be downgraded by an older observation.'); + insist(allowed, 'Publication journal changed; refresh and reconcile the retained candidate.'); + return { write: { ...next, owner: prior.owner }, result: null }; + }); + } + async inspectStorage() { + const [estimate, persistent, rows] = await Promise.all([this.storage?.estimate?.() ?? {}, this.storage?.persisted?.() ?? null, this.records()]); + return { usageBytes: Number.isFinite(estimate.usage) ? estimate.usage : null, quotaBytes: Number.isFinite(estimate.quota) ? estimate.quota : null, + persistent, journalEntries: rows.filter(([key]) => key.startsWith('dns:')).length, + unknownEntries: rows.filter(([key, value]) => key.startsWith('dns:') && value?.outcome === 'unknown').length, + assurance: 'Origin-wide estimates and persistence permission do not guarantee retention or provide a backup.' }; + } + async requestPersistence({ confirmed = false } = {}) { + insist(confirmed === true, 'Explicit storage persistence request required.'); + insist(this.storage?.persist, 'Browser storage persistence request unavailable.'); + return this.storage.persist(); + } + async exportPublicJournal() { + const rows = await this.records(), publications = [], anchors = []; + let authority = null; + for (const [key, value] of rows) { + if (key === 'authority') { validateAuthority(value); authority = { publicKey: value.publicKey, generation: generation(value), status: active(value) ? 'active' : 'revoked', history: (value.history ?? []).map(entry => ({ publicKey: entry.publicKey, generation: entry.generation, revokedAtMs: entry.revokedAtMs })) }; } + if (key.startsWith('trust:')) { validateTrust(value); await verifyPointer(value.head, value.publicKey); anchors.push({ version: 1, name: value.name, publicKey: value.publicKey, head: value.head, status: value.status, generation: value.generation, history: value.history.map(entry => ({ publicKey: entry.publicKey, pointerDigest: entry.pointerDigest, status: entry.status })) }); } + if (key.startsWith('dns:')) { + const scope = JSON.parse(key.slice(4)); + insist(Array.isArray(scope) && /^[a-f0-9]{32}$/.test(scope[0]) && keyValid(scope[2]), 'Invalid journal scope.'); identifier(scope[1]); digest(value.pointerDigest); + insist(value.recordId == null || typeof value.recordId === 'string' && /^[A-Za-z0-9_-]{1,128}$/.test(value.recordId), 'Invalid provider identity.'); + insist(scope.length === 3 && ['unknown','published','refused'].includes(value.outcome), 'Corrupt publication journal; export refused.'); + const entry = { scope, outcome: value.outcome, pointerDigest: value.pointerDigest, recordId: value.recordId ?? null }; + if (value.outcome === 'unknown') { await verifyPointer(value.candidate, scope[2]); entry.candidate = value.candidate; } + publications.push(entry); + } + } + return new TextDecoder().decode(canonicalBytes({ version: 1, kind: 'stitch-public-authority-journal', authority, anchors, publications, + warning: 'Public evidence only. No signing keys, tokens or automatic journal import. Preserve unknown candidates and provider identities independently before clearing browser data.' })); + } + async compactRefusedJournal({ confirmed = false, scopeStillCurrent = () => true } = {}) { + insist(confirmed === true, 'Explicit refused-journal cleanup required.'); + return this.exclusiveAuthority(async () => { + let removed = 0; + for (const [key] of await this.records()) { + if (!key.startsWith('dns:')) continue; + removed += await this.transaction(key, prior => { + const allowed = lifecycle('journalRemovalAllowed', confirmed && scopeStillCurrent() === true, prior?.outcome === 'refused', prior?.recordId == null); + return { delete: allowed, result: allowed ? 1 : 0 }; + }); + } + return removed; + }); + } +} diff --git a/src/layer1-uor/contracts.js b/src/layer1-uor/contracts.js new file mode 100644 index 0000000..d91259a --- /dev/null +++ b/src/layer1-uor/contracts.js @@ -0,0 +1,28 @@ +/** Shared runtime limits and closed-record validation. Limits are resource policy, not theorems. */ +export class ContractError extends Error { + constructor(code, message = code) { super(message); this.name = 'ContractError'; this.code = code; } +} +export const refuse = (code, message) => { throw new ContractError(code, message); }; +export function record(value, keys) { + if (!value || typeof value !== 'object' || Array.isArray(value) || + ![Object.prototype, null].includes(Object.getPrototypeOf(value)) || + Object.keys(value).sort().join('|') !== [...keys].sort().join('|')) refuse('invalid-record'); + return value; +} +export function natural(value, maximum = Number.MAX_SAFE_INTEGER) { + if (!Number.isSafeInteger(value) || value < 0 || value > maximum) refuse('invalid-integer'); + return value; +} +export function identifier(value) { + if (typeof value !== 'string' || !/^[a-zA-Z0-9._:-]{1,128}$/.test(value)) refuse('invalid-identifier'); + return value; +} +export function digest(value) { + if (typeof value !== 'string' || !/^sha256:[0-9a-f]{64}$/.test(value)) refuse('invalid-digest'); + return value; +} +export function hexValue(value, bits) { + if (typeof value !== 'string' || !/^0x(?:0|[1-9a-f][0-9a-f]*)$/.test(value) || value.length > 34 || + BigInt(value) >= 1n << BigInt(bits)) refuse('invalid-ring-value'); + return value; +} diff --git a/src/layer1-uor/custody.js b/src/layer1-uor/custody.js new file mode 100644 index 0000000..3a3e43b --- /dev/null +++ b/src/layer1-uor/custody.js @@ -0,0 +1,375 @@ +/** + * Layer 1 object custody commitments. Browser-compatible, dependency-free WebCrypto. + * + * This is a reference realization, not a proof of browser or network behavior. + * Digests establish byte integrity under SHA-256's security assumptions; they do + * not establish authorization, confidentiality, availability, or retention. + * + * Hash frame (all lengths unsigned, big endian): + * UTF8("stitch/" + domain + "/v1\0") || uint64(payload.length) || payload + * Fragment payload: raw32(encodingDigest) || uint32(index) || fragmentBytes. + * Manifest payload: canonicalBytes(manifest without manifestDigest). + * Canonical JSON follows RFC 8785: sorted UTF-16 keys, ECMAScript finite + * binary64 serialization, unchanged Unicode strings, and UTF-8 output. + * Application schemas and explicit resource budgets remain separate contracts. + */ + +export const CUSTODY_LIMITS = Object.freeze({ + maxObjectBytes: 16 * 1024 * 1024, + maxManifestBytes: 16 * 1024, + maxCanonicalBytes: 64 * 1024, + maxDepth: 16, + maxEntries: 4096, + maxStringLength: 4096, + maxRequests: 256, + maxCopies: 64, +}); + +export class CustodyError extends Error { + constructor(code, message = code) { + super(message); + this.name = 'CustodyError'; + this.code = code; + } +} + +const fail = (code, message) => { throw new CustodyError(code, message); }; +const utf8 = new TextEncoder(); +const DIGEST = /^sha256:[0-9a-f]{64}$/; + +/** Snapshot caller-owned bytes before any asynchronous operation. */ +export function copyBytes(value, maxBytes = CUSTODY_LIMITS.maxObjectBytes) { + if (!(value instanceof Uint8Array)) fail('InvalidBytes', 'Expected Uint8Array'); + if (!Number.isSafeInteger(maxBytes) || maxBytes < 0 || value.byteLength > maxBytes) { + fail('SizeLimit', 'Byte sequence exceeds its size limit'); + } + return new Uint8Array(value); +} + +function validString(value, maxLength = CUSTODY_LIMITS.maxStringLength) { + if (value.length > maxLength) fail('SizeLimit', 'String too long'); + for (let i = 0; i < value.length; i++) { + const c = value.charCodeAt(i); + // RFC 7493 §2.1 (the JCS input domain) also excludes Unicode noncharacters. + if ((c >= 0xfdd0 && c <= 0xfdef) || c === 0xfffe || c === 0xffff) { + fail('InvalidCanonicalValue', 'Unicode noncharacter'); + } + if (c >= 0xd800 && c <= 0xdbff) { + const next = value.charCodeAt(++i); + if (!(next >= 0xdc00 && next <= 0xdfff)) fail('InvalidCanonicalValue', 'Lone surrogate'); + const point = 0x10000 + ((c - 0xd800) << 10) + next - 0xdc00; + if ((point & 0xffff) >= 0xfffe) fail('InvalidCanonicalValue', 'Unicode noncharacter'); + } else if (c >= 0xdc00 && c <= 0xdfff) { + fail('InvalidCanonicalValue', 'Lone surrogate'); + } + } +} + +/** + * Canonical UTF-8 bytes. Rejects cycles, getters, symbols, sparse/extended arrays, + * nonfinite numbers, hidden properties, and non-JSON prototypes before coercion. + * Number serialization is the ECMAScript algorithm required by RFC 8785 §3.2.2.3. + * The caller must supply an already valid value; use parseCanonicalJson on wire JSON + * so duplicate properties are rejected before a normal JSON parser can erase them. + */ +export function canonicalBytes(value, { + maxBytes = CUSTODY_LIMITS.maxCanonicalBytes, + maxDepth = CUSTODY_LIMITS.maxDepth, + maxEntries = CUSTODY_LIMITS.maxEntries, + maxStringLength = CUSTODY_LIMITS.maxStringLength, +} = {}) { + for (const limit of [maxBytes, maxDepth, maxEntries, maxStringLength]) { + if (!Number.isSafeInteger(limit) || limit < 0) fail('SizeLimit', 'Invalid JSON resource bound'); + } + const seen = new Set(); + let entries = 0; + let outputLength = 0; + const append = value => { + outputLength += value.length; + if (outputLength > maxBytes) fail('SizeLimit', 'Canonical record too large'); + return value; + }; + function encode(v, depth) { + if (depth > maxDepth) fail('SizeLimit', 'Canonical record too deep'); + if (++entries > maxEntries) fail('SizeLimit', 'Too many canonical values'); + if (v === null) return append('null'); + if (typeof v === 'boolean') return append(v ? 'true' : 'false'); + if (typeof v === 'number') { + if (!Number.isFinite(v)) fail('InvalidCanonicalValue', 'Expected finite IEEE 754 number'); + return append(JSON.stringify(v)); + } + if (typeof v === 'string') { + validString(v, maxStringLength); + return append(JSON.stringify(v)); + } + if (typeof v !== 'object' || seen.has(v)) fail('InvalidCanonicalValue', 'Non-JSON value or cycle'); + const array = Array.isArray(v); + const proto = Object.getPrototypeOf(v); + if (array ? proto !== Array.prototype : proto !== Object.prototype && proto !== null) { + fail('InvalidCanonicalValue', 'Expected a plain JSON value'); + } + const keys = Reflect.ownKeys(v); + // Check count before enumerating or allocating any output for a large array. + if (keys.length > maxEntries + (array ? 1 : 0)) fail('SizeLimit', 'Too many keys'); + if (keys.some(k => typeof k !== 'string')) fail('InvalidCanonicalValue', 'Symbol key'); + const descriptors = Object.getOwnPropertyDescriptors(v); + for (const key of keys) { + const d = descriptors[key]; + if (!Object.hasOwn(d, 'value') || (!d.enumerable && !(array && key === 'length'))) { + fail('InvalidCanonicalValue', 'Accessors and hidden fields are not canonical'); + } + } + seen.add(v); + let result; + if (array) { + if (v.length > maxEntries || keys.length !== v.length + 1) { + fail('InvalidCanonicalValue', 'Sparse or extended array'); + } + const items = []; + for (let i = 0; i < v.length; i++) { + if (!Object.hasOwn(descriptors, String(i))) fail('InvalidCanonicalValue', 'Sparse array'); + items.push(encode(descriptors[String(i)].value, depth + 1)); + } + result = append('[') + items.join(',') + append(']'); + append(','.repeat(Math.max(0, items.length - 1))); + } else { + const items = []; + for (const key of keys.sort()) { + validString(key, maxStringLength); + const name = append(JSON.stringify(key)); + items.push(name + append(':') + encode(descriptors[key].value, depth + 1)); + } + result = append('{') + items.join(',') + append('}'); + append(','.repeat(Math.max(0, items.length - 1))); + } + seen.delete(v); + return result; + } + const result = utf8.encode(encode(value, 0)); + if (result.length > maxBytes) fail('SizeLimit', 'Canonical UTF-8 record too large'); + return result; +} + +/** + * Parse JSON without losing duplicate names, including escape-equivalent names. + * RFC 8785 §3.1 and §5 require validation before signature processing. This + * parser preserves strings without normalization, rejects nonfinite numbers and + * malformed UTF-8, and creates only data properties (including __proto__). + * Limits are deployment resource policies, not changes to the JCS data model. + */ +export function parseCanonicalJson(input, { + maxBytes = CUSTODY_LIMITS.maxCanonicalBytes, + maxDepth = CUSTODY_LIMITS.maxDepth, + maxEntries = CUSTODY_LIMITS.maxEntries, + maxStringLength = CUSTODY_LIMITS.maxStringLength, +} = {}) { + for (const value of [maxBytes, maxDepth, maxEntries, maxStringLength]) { + if (!Number.isSafeInteger(value) || value < 0) fail('SizeLimit', 'Invalid JSON resource bound'); + } + let text; + if (input instanceof Uint8Array) { + if (input.byteLength > maxBytes) fail('SizeLimit', 'JSON input too large'); + try { text = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(input); } + catch { fail('InvalidCanonicalValue', 'Malformed JSON UTF-8'); } + } else if (typeof input === 'string') { + // Check code units before allocating UTF-8; its byte count is at least this. + if (input.length > maxBytes || utf8.encode(input).length > maxBytes) fail('SizeLimit', 'JSON input too large'); + text = input; + } else fail('InvalidCanonicalValue', 'Expected JSON text or UTF-8 bytes'); + let at = 0, entries = 0; + const invalid = () => fail('InvalidCanonicalValue', `Invalid JSON at offset ${at}`); + const ws = () => { while (at < text.length && /[\x20\t\r\n]/.test(text[at])) at++; }; + function string() { + const start = at++; + while (at < text.length) { + const c = text.charCodeAt(at++); + if (c === 34) { + let value; + try { value = JSON.parse(text.slice(start, at)); } catch { invalid(); } + validString(value, maxStringLength); + return value; + } + if (c < 32) invalid(); + if (c === 92) { + const escape = text[at++]; + if (escape === 'u') { + if (!/^[0-9a-fA-F]{4}$/.test(text.slice(at, at + 4))) invalid(); + at += 4; + } else if (!['"', '\\', '/', 'b', 'f', 'n', 'r', 't'].includes(escape)) invalid(); + } + } + invalid(); + } + const number = /-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?/y; + function value(depth) { + if (depth > maxDepth || ++entries > maxEntries) fail('SizeLimit', 'JSON structure exceeds resource bound'); + ws(); + const token = text[at]; + if (token === '"') return string(); + if (token === '{' || token === '[') { + at++; ws(); + const array = token === '[', close = array ? ']' : '}', result = array ? [] : Object.create(null); + const names = new Set(); + if (text[at] === close) { at++; return result; } + for (;;) { + ws(); + if (array) result.push(value(depth + 1)); + else { + if (text[at] !== '"') invalid(); + const key = string(); + if (names.has(key)) fail('InvalidCanonicalValue', 'Duplicate JSON property'); + names.add(key); ws(); + if (text[at++] !== ':') invalid(); + result[key] = value(depth + 1); + } + ws(); + if (text[at] === close) { at++; return result; } + if (text[at++] !== ',') invalid(); + } + } + for (const [literal, parsed] of [['true', true], ['false', false], ['null', null]]) { + if (text.startsWith(literal, at)) { at += literal.length; return parsed; } + } + number.lastIndex = at; + const match = number.exec(text); + if (!match) invalid(); + at = number.lastIndex; + const parsed = Number(match[0]); + if (!Number.isFinite(parsed)) fail('InvalidCanonicalValue', 'Expected finite IEEE 754 number'); + return parsed; + } + const result = value(0); + ws(); + if (at !== text.length) invalid(); + return result; +} + +function uint64(value) { + const bytes = new Uint8Array(8); + new DataView(bytes.buffer).setBigUint64(0, BigInt(value), false); + return bytes; +} + +/** Domain-separated digest. Domain must be a short lowercase ASCII name. */ +export async function sha256Bytes(bytes, domain) { + if (typeof domain !== 'string' || !/^[a-z][a-z0-9-]{0,31}$/.test(domain)) { + fail('InvalidSchema', 'Invalid digest domain'); + } + const payload = copyBytes(bytes, CUSTODY_LIMITS.maxObjectBytes + 36); + if (!globalThis.crypto?.subtle) fail('CryptoUnavailable', 'WebCrypto requires a supported secure context'); + const prefix = utf8.encode(`stitch/${domain}/v1\0`); + const framed = new Uint8Array(prefix.length + 8 + payload.length); + framed.set(prefix); + framed.set(uint64(payload.length), prefix.length); + framed.set(payload, prefix.length + 8); + const digest = new Uint8Array(await globalThis.crypto.subtle.digest('SHA-256', framed)); + return 'sha256:' + Array.from(digest, b => b.toString(16).padStart(2, '0')).join(''); +} + +export function assertDigest(value) { + if (typeof value !== 'string' || !DIGEST.test(value)) fail('InvalidDigest', 'Expected full lowercase SHA-256 digest'); + return value; +} + +export async function commitObject(bytes) { + const snapshot = copyBytes(bytes); + return Object.freeze({ + digestAlgorithm: 'sha256', + contentDigest: await sha256Bytes(snapshot, 'object'), + byteLength: snapshot.length, + }); +} + +export async function fragmentDigest(encodingDigest, index, bytes) { + assertDigest(encodingDigest); + if (!Number.isInteger(index) || index < 0 || index > 2) fail('InvalidSchema', 'Invalid fragment index'); + const snapshot = copyBytes(bytes, Math.ceil(CUSTODY_LIMITS.maxObjectBytes / 2)); + const payload = new Uint8Array(36 + snapshot.length); + for (let i = 0; i < 32; i++) payload[i] = parseInt(encodingDigest.slice(7 + i * 2, 9 + i * 2), 16); + new DataView(payload.buffer).setUint32(32, index, false); + payload.set(snapshot, 36); + return sha256Bytes(payload, 'fragment'); +} + +export function exactKeys(value, expected, name = 'record') { + if (value === null || typeof value !== 'object' || Array.isArray(value)) fail('InvalidSchema', `${name} must be a record`); + const actual = Object.keys(value).sort(); + const wanted = [...expected].sort(); + if (actual.length !== wanted.length || actual.some((k, i) => k !== wanted[i])) { + fail('InvalidSchema', `${name} has missing or unknown fields`); + } +} + +export function deepFreeze(value) { + if (value && typeof value === 'object') { + for (const v of Object.values(value)) deepFreeze(v); + Object.freeze(value); + } + return value; +} + +/** Snapshot strict records without executing accessors. */ +export function snapshotRecord(record, maxBytes = CUSTODY_LIMITS.maxCanonicalBytes) { + const bytes = canonicalBytes(record); + if (bytes.length > maxBytes) fail('SizeLimit', 'Record exceeds its size limit'); + return JSON.parse(new TextDecoder().decode(bytes)); +} + +export function manifestBody(manifest) { + return { version: manifest.version, object: manifest.object, encoding: manifest.encoding, fragments: manifest.fragments }; +} + +/** + * Verify schema and complete manifest commitment; returns an immutable snapshot. + * This alone does not prove that its declared fragments encode its object. + * recoverObject establishes that relationship from actual fragment bytes. + */ +export async function verifyManifest(manifest) { + const m = snapshotRecord(manifest, CUSTODY_LIMITS.maxManifestBytes); + exactKeys(m, ['version', 'object', 'encoding', 'fragments', 'manifestDigest'], 'manifest'); + exactKeys(m.object, ['digestAlgorithm', 'contentDigest', 'byteLength'], 'object'); + exactKeys(m.encoding, ['format', 'encodingDigest', 'byteLength', 'dependencies'], 'encoding'); + exactKeys(m.fragments, ['scheme', 'threshold', 'count', 'byteLength', 'digests'], 'fragments'); + if (m.version !== 1 || m.object.digestAlgorithm !== 'sha256' || m.encoding.format !== 'raw' + || m.fragments.scheme !== 'xor-2-of-3' || m.fragments.threshold !== 2 || m.fragments.count !== 3) { + fail('InvalidSchema', 'Unsupported custody version or encoding'); + } + const length = m.object.byteLength; + if (!Number.isSafeInteger(length) || length < 0 || length > CUSTODY_LIMITS.maxObjectBytes) { + fail('SizeLimit', 'Invalid object length'); + } + if (m.encoding.byteLength !== length || m.fragments.byteLength !== Math.ceil(length / 2)) { + fail('InvalidSchema', 'Inconsistent encoding or fragment lengths'); + } + if (!Array.isArray(m.encoding.dependencies) || m.encoding.dependencies.length !== 0) { + fail('InvalidSchema', 'Raw encoding must be self-contained'); + } + if (!Array.isArray(m.fragments.digests) || m.fragments.digests.length !== 3) { + fail('InvalidSchema', 'Expected exactly three fragment digests'); + } + [m.object.contentDigest, m.encoding.encodingDigest, m.manifestDigest, ...m.fragments.digests].forEach(assertDigest); + const actual = await sha256Bytes(canonicalBytes(manifestBody(m)), 'manifest'); + if (actual !== m.manifestDigest) fail('ManifestDigestMismatch', 'Manifest commitment does not match'); + return deepFreeze(m); +} + +/** Verify one fragment's full binding; does not establish coding consistency. */ +export async function verifyFragment(manifest, fragment) { + // Read descriptors first so untrusted accessor fields are not executed. + if (!fragment || typeof fragment !== 'object' || Array.isArray(fragment) + || ![Object.prototype, null].includes(Object.getPrototypeOf(fragment))) fail('InvalidSchema', 'Invalid fragment'); + const descriptors = Object.getOwnPropertyDescriptors(fragment); + if (Reflect.ownKeys(fragment).length !== 2 || !descriptors.index?.enumerable || !descriptors.bytes?.enumerable + || !Object.hasOwn(descriptors.index, 'value') || !Object.hasOwn(descriptors.bytes, 'value')) { + fail('InvalidSchema', 'Fragment requires only index and bytes'); + } + const index = descriptors.index.value; + if (!Number.isInteger(index) || index < 0 || index > 2) fail('InvalidSchema', 'Invalid fragment index'); + const bytes = copyBytes(descriptors.bytes.value, Math.ceil(CUSTODY_LIMITS.maxObjectBytes / 2)); + const m = await verifyManifest(manifest); + if (bytes.length !== m.fragments.byteLength) fail('InvalidSchema', 'Incorrect fragment length'); + if (await fragmentDigest(m.encoding.encodingDigest, index, bytes) !== m.fragments.digests[index]) { + fail('FragmentDigestMismatch', 'Fragment is not committed by this manifest'); + } + return { index, bytes }; +} diff --git a/src/layer1-uor/effects.js b/src/layer1-uor/effects.js new file mode 100644 index 0000000..dd2522e --- /dev/null +++ b/src/layer1-uor/effects.js @@ -0,0 +1,122 @@ +/** Lifecycle refinement boundary. The source owns phase/identity admission; + * browsers, provider completeness, signatures and guest readiness remain host facts. + * These projections reuse live runtime state. They do not journal effects or refund work. + */ +import { model } from './generated-model.js'; +// JS string identity is UTF-16 code-unit identity. UTF-8 replacement of lone +// surrogates would collapse distinct signaling topics/peer IDs into one model ID. +const bytes = value => { + if (typeof value !== 'string') throw new TypeError('Lifecycle identity must be a string'); + const encoded = new Uint8Array(value.length * 2); + for (let index = 0; index < value.length; index++) { + const unit = value.charCodeAt(index); + encoded[index * 2] = unit >>> 8; encoded[index * 2 + 1] = unit & 255; + } + return encoded; +}; +const tag = value => ({ tag: value, fields: [] }); +const call = (name, ...args) => model[`Stitch.Effects.${name}`](...args); +const count = value => { + const number = Number(value); + if (!Number.isSafeInteger(number) || number < 0) throw new RangeError('Lifecycle generation exceeds host integer range'); + return number; +}; +export const transportState = node => ({ generation: node.generation, closed: node.closed, + channelKey: bytes(node.channelKey), localPeer: bytes(node.peerId) }); +export const captureTransport = (node, remotePeer = '') => ({ generation: node.generation, + channelKey: bytes(node.channelKey), localPeer: bytes(node.peerId), remotePeer: bytes(remotePeer) }); +export const transportCanSend = node => call('transportCanSend', transportState(node)); +export const transportSessionCurrent = (node, callback) => call('transportSessionMatches', transportState(node), callback); +export const transportPeerCurrent = (node, callback, remotePeer, entry) => call('transportPeerCallbackAllowed', + transportState(node), callback, bytes(remotePeer), node.peers.get(remotePeer) === entry); +export const transportChannelCurrent = (node, callback, remotePeer, entry, channel) => call('transportChannelCallbackAllowed', + transportState(node), callback, bytes(remotePeer), node.peers.get(remotePeer) === entry, entry.dc === channel); +export const transportSignalAllowed = (node, message) => !!message && typeof message.channelKey === 'string' + && typeof message.from === 'string' && message.from.length > 0 && (message.to == null || typeof message.to === 'string') + && call('transportSignalAllowed', transportState(node), bytes(message.channelKey), bytes(message.from), + bytes(message.to ?? ''), message.to == null); +export const transportPeerAllocationAllowed = node => call('transportPeerAllocationAllowed', transportState(node), node.peers.size, node.maxPeers); +export function closeTransport(node) { + const next = call('transportClose', transportState(node)); + node.generation = count(next.generation); node.closed = next.closed; +} +export function openTransport(node, channelKey) { + // channelKey is preserved as the real browser topic, never replaced by an invented ID. + const next = call('transportOpen', transportState(node), bytes(channelKey)); + node.closed = next.closed; node.channelKey = channelKey; +} +const dnsPhase = previous => tag(({ idle: 'Idle', published: 'Published', refused: 'Refused', unknown: 'Unknown' })[previous?.outcome ?? 'idle']); +const dnsScope = scope => ({ zoneId: bytes(scope.zoneId), name: bytes(scope.name), authorityKey: bytes(scope.trustedAuthorityKey) }); +const publication = (scope, previous) => ({ scope: dnsScope(scope), phase: dnsPhase(previous), + pointerDigest: bytes(previous?.pointerDigest ?? ''), recordId: bytes(previous?.recordId ?? ''), hasRecordId: !!previous?.recordId }); +const dnsCandidate = (scope, candidate) => ({ scope: dnsScope(scope), pointerDigest: bytes(candidate.pointerDigest), + previousDigest: bytes(candidate.previousDigest ?? ''), hasPrevious: candidate.previousDigest !== null, + revision: candidate.revision, validFrom: candidate.validFromMs, validUntil: candidate.validUntilMs }); +const dnsRead = (scope, candidate, remote, pointer) => ({ scope: dnsScope(scope), candidateDigest: bytes(candidate.pointerDigest), + complete: true, authenticated: !!pointer, recordPresent: !!remote, recordId: bytes(remote?.id ?? ''), + pointerDigest: bytes(pointer?.pointerDigest ?? ''), revision: pointer?.revision ?? 0 }); +export const dnsRequestAllowed = (scope, previous, candidate, busy) => call('dnsRequestAllowed', + publication(scope, previous), dnsCandidate(scope, candidate), busy); +export const dnsReadDecision = (scope, previous, candidate, remote, pointer, now) => call('dnsReadDecision', + publication(scope, previous), dnsCandidate(scope, candidate), dnsRead(scope, candidate, remote, pointer), now).tag; +export function dnsWriteState(scope, previous, candidate, remote, pointer, now) { + if (!['Create', 'Update'].includes(dnsReadDecision(scope, previous, candidate, remote, pointer, now))) throw Error('Model refused DNS write admission'); + const next = call('dnsBeginWrite', publication(scope, previous), dnsCandidate(scope, candidate), dnsRead(scope, candidate, remote, pointer), now); + if (next.phase.tag !== 'Unknown') throw Error('Model refused DNS write transition'); + return { outcome: 'unknown', pointerDigest: candidate.pointerDigest, candidate, recordId: remote?.id ?? null }; +} +export function dnsWriteOutcome(scope, pending, result) { + const next = call('dnsFinishWrite', publication(scope, pending), { scope: dnsScope(scope), + candidateDigest: bytes(pending.pointerDigest), recordId: bytes(typeof result?.id === 'string' ? result.id : ''), + recordIdValid: typeof result?.id === 'string' && /^[A-Za-z0-9_-]{1,128}$/.test(result.id), + acknowledged: result?.ok === true && result?.outcome === 'published', refused: result?.outcome === 'refused' }); + return ({ Published: 'published', Refused: 'refused', Unknown: 'unknown' })[next.phase.tag]; +} +export function dnsLifecycle(previous, busy = false) { + return { outcome: previous?.outcome ?? 'idle', recordId: previous?.recordId ?? null, pointerDigest: previous?.pointerDigest ?? null, + canPublish: !busy && call('dnsMayWritePhase', dnsPhase(previous)), + canReconcile: !busy && call('dnsMayReconcile', dnsPhase(previous)) }; +} +const vmState = node => ({ generation: node.bootGeneration, phase: tag(node.vmPhase) }); +export const vmCanBoot = node => call('vmCanBoot', vmState(node)); +export const vmIsBooting = node => call('vmIsBooting', vmState(node)); +export const vmCanExecute = node => call('vmCanExecute', vmState(node)); +export const vmCallbackCurrent = (node, generation, vm) => call('vmCallbackAllowed', vmState(node), generation, node.v86 === vm); +export const vmFailAllowed = (node, generation) => call('vmFailAllowed', vmState(node), generation); +function applyVm(node, next) { node.bootGeneration = count(next.generation); node.vmPhase = next.phase.tag; } +export const startVm = node => applyVm(node, call('vmStart', vmState(node))); +export const failVm = (node, generation) => applyVm(node, call('vmFail', vmState(node), generation)); +export const readyVm = (node, generation, vm, readinessObserved) => applyVm(node, + call('vmObserveReady', vmState(node), generation, node.v86 === vm, readinessObserved)); +const c1Progress = entry => ({ startedAt: Math.floor(entry.startedAtMs * 1000), + lastSequence: entry.lastHeartbeatSeq ?? 0, hasSequence: entry.lastHeartbeatSeq !== null, consecutive: entry.heartbeatsPassed }); +const c1Clock = (entry, nowMs) => Math.floor(entry.startedAtMs * 1000) + Math.ceil((nowMs - entry.startedAtMs) * 1000); +export function observeC1Probe(entry, sequence, nowMs, correlated) { + const next = call('c1ObserveProbe', c1Progress(entry), sequence, c1Clock(entry, nowMs), correlated); + entry.lastHeartbeatSeq = next.hasSequence ? count(next.lastSequence) : null; + entry.heartbeatsPassed = count(next.consecutive); +} +export const c1ConnectionQualified = (entry, nowMs) => call('c1ConnectionQualified', c1Progress(entry), c1Clock(entry, nowMs), entry.dc?.ordered === true); +export const c1DirectSuccess = (entry, nowMs, selectedPathObserved, usedRelay) => call('c1DirectSuccess', + c1Progress(entry), c1Clock(entry, nowMs), entry.dc?.ordered === true, selectedPathObserved, usedRelay); +export function c1SampleStructurallyValid(sample) { + return typeof sample.success === 'boolean' + && Number.isSafeInteger(sample.heartbeats_passed) && sample.heartbeats_passed >= 0 + && Number.isFinite(sample.qualification_elapsed_sec) && sample.qualification_elapsed_sec >= 0 + && (sample.ice_setup_sec === null || (Number.isFinite(sample.ice_setup_sec) && sample.ice_setup_sec >= 0 && sample.ice_setup_sec <= sample.qualification_elapsed_sec)) + && typeof sample.ordered_channel === 'boolean' && typeof sample.selected_path_observed === 'boolean' + && typeof sample.used_turn === 'boolean' && (!sample.success || c1SampleQualified(sample)); +} +export function c1SampleQualified(sample) { + if (!Number.isSafeInteger(sample.heartbeats_passed) || sample.heartbeats_passed < 0 + || !Number.isFinite(sample.qualification_elapsed_sec) || sample.qualification_elapsed_sec < 0 + || sample.qualification_elapsed_sec > 10 + || !Number.isFinite(sample.ice_setup_sec) || sample.ice_setup_sec < 0 || sample.ice_setup_sec > 10 + || sample.ice_setup_sec > sample.qualification_elapsed_sec + || typeof sample.ordered_channel !== 'boolean' || typeof sample.selected_path_observed !== 'boolean' + || typeof sample.used_turn !== 'boolean') return false; + const elapsed = Math.round(sample.qualification_elapsed_sec * 1000000); + if (!Number.isSafeInteger(elapsed)) return false; + return call('c1DirectSuccess', { startedAt: 0, lastSequence: 0, hasSequence: false, consecutive: sample.heartbeats_passed }, + elapsed, sample.ordered_channel, sample.selected_path_observed, sample.used_turn); +} diff --git a/src/layer1-uor/generated-model.js b/src/layer1-uor/generated-model.js new file mode 100644 index 0000000..a5edc3d --- /dev/null +++ b/src/layer1-uor/generated-model.js @@ -0,0 +1,49111 @@ +/** GENERATED by scripts/check-model.mjs. DO NOT EDIT. + * Exact BigInt evaluation of a declared subset of the project LexLean source. + * This is NOT a Prism compiler, proof certificate, or whole-runtime certification. + */ +const definitions = { + "Stitch.Authority.signingAllowed": { + "module": "Stitch.Authority", + "name": "signingAllowed", + "params": [ + { + "name": "active", + "type": { + "kind": "Bool" + } + }, + { + "name": "expectedKey", + "type": { + "kind": "Bool" + } + }, + { + "name": "bodyKey", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "active" + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "expectedKey" + }, + "right": { + "k": "var", + "name": "bodyKey" + } + } + } + }, + "Stitch.Authority.rotationAllowed": { + "module": "Stitch.Authority", + "name": "rotationAllowed", + "params": [ + { + "name": "confirmed", + "type": { + "kind": "Bool" + } + }, + { + "name": "exists", + "type": { + "kind": "Bool" + } + }, + { + "name": "sameKey", + "type": { + "kind": "Bool" + } + }, + { + "name": "historyCapacity", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "confirmed" + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "exists" + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "sameKey" + }, + "right": { + "k": "var", + "name": "historyCapacity" + } + } + } + } + }, + "Stitch.Authority.revocationAllowed": { + "module": "Stitch.Authority", + "name": "revocationAllowed", + "params": [ + { + "name": "confirmed", + "type": { + "kind": "Bool" + } + }, + { + "name": "exists", + "type": { + "kind": "Bool" + } + }, + { + "name": "sameScope", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "confirmed" + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "exists" + }, + "right": { + "k": "var", + "name": "sameScope" + } + } + } + }, + "Stitch.Authority.anchorSaveAllowed": { + "module": "Stitch.Authority", + "name": "anchorSaveAllowed", + "params": [ + { + "name": "confirmed", + "type": { + "kind": "Bool" + } + }, + { + "name": "scopeCurrent", + "type": { + "kind": "Bool" + } + }, + { + "name": "absent", + "type": { + "kind": "Bool" + } + }, + { + "name": "identical", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "confirmed" + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "scopeCurrent" + }, + "right": { + "k": "binary", + "op": "||", + "left": { + "k": "var", + "name": "absent" + }, + "right": { + "k": "var", + "name": "identical" + } + } + } + } + }, + "Stitch.Authority.migrationAllowed": { + "module": "Stitch.Authority", + "name": "migrationAllowed", + "params": [ + { + "name": "confirmed", + "type": { + "kind": "Bool" + } + }, + { + "name": "scopeCurrent", + "type": { + "kind": "Bool" + } + }, + { + "name": "exists", + "type": { + "kind": "Bool" + } + }, + { + "name": "samePrior", + "type": { + "kind": "Bool" + } + }, + { + "name": "historyCapacity", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "confirmed" + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "scopeCurrent" + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "exists" + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "samePrior" + }, + "right": { + "k": "var", + "name": "historyCapacity" + } + } + } + } + } + }, + "Stitch.Authority.anchorChronologyAllowed": { + "module": "Stitch.Authority", + "name": "anchorChronologyAllowed", + "params": [ + { + "name": "sameKey", + "type": { + "kind": "Bool" + } + }, + { + "name": "older", + "type": { + "kind": "Bool" + } + }, + { + "name": "sameRevision", + "type": { + "kind": "Bool" + } + }, + { + "name": "sameDigest", + "type": { + "kind": "Bool" + } + }, + { + "name": "adjacent", + "type": { + "kind": "Bool" + } + }, + { + "name": "predecessor", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "binary", + "op": "||", + "left": { + "k": "not", + "value": { + "k": "var", + "name": "sameKey" + } + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "not", + "value": { + "k": "var", + "name": "older" + } + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "binary", + "op": "||", + "left": { + "k": "not", + "value": { + "k": "var", + "name": "sameRevision" + } + }, + "right": { + "k": "var", + "name": "sameDigest" + } + }, + "right": { + "k": "binary", + "op": "||", + "left": { + "k": "not", + "value": { + "k": "var", + "name": "adjacent" + } + }, + "right": { + "k": "var", + "name": "predecessor" + } + } + } + } + } + }, + "Stitch.Authority.publicationAllowed": { + "module": "Stitch.Authority", + "name": "publicationAllowed", + "params": [ + { + "name": "retiredKey", + "type": { + "kind": "Bool" + } + }, + { + "name": "trustMatches", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "binary", + "op": "&&", + "left": { + "k": "not", + "value": { + "k": "var", + "name": "retiredKey" + } + }, + "right": { + "k": "var", + "name": "trustMatches" + } + } + }, + "Stitch.Authority.journalRemovalAllowed": { + "module": "Stitch.Authority", + "name": "journalRemovalAllowed", + "params": [ + { + "name": "confirmed", + "type": { + "kind": "Bool" + } + }, + { + "name": "definitelyRefused", + "type": { + "kind": "Bool" + } + }, + { + "name": "noProviderIdentity", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "confirmed" + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "definitelyRefused" + }, + "right": { + "k": "var", + "name": "noProviderIdentity" + } + } + } + }, + "Stitch.Authority.controlAllowed": { + "module": "Stitch.Authority", + "name": "controlAllowed", + "params": [ + { + "name": "action", + "type": { + "kind": "Nat" + } + }, + { + "name": "busy", + "type": { + "kind": "Bool" + } + }, + { + "name": "saved", + "type": { + "kind": "Bool" + } + }, + { + "name": "active", + "type": { + "kind": "Bool" + } + }, + { + "name": "hasHead", + "type": { + "kind": "Bool" + } + }, + { + "name": "hasTrust", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "binary", + "op": "&&", + "left": { + "k": "not", + "value": { + "k": "var", + "name": "busy" + } + }, + "right": { + "k": "if", + "cond": { + "k": "binary", + "op": "=?", + "left": { + "k": "var", + "name": "action" + }, + "right": { + "k": "nat", + "value": "1" + } + }, + "yes": { + "k": "var", + "name": "saved" + }, + "no": { + "k": "if", + "cond": { + "k": "binary", + "op": "=?", + "left": { + "k": "var", + "name": "action" + }, + "right": { + "k": "nat", + "value": "2" + } + }, + "yes": { + "k": "binary", + "op": "&&", + "left": { + "k": "var", + "name": "saved" + }, + "right": { + "k": "var", + "name": "active" + } + }, + "no": { + "k": "if", + "cond": { + "k": "binary", + "op": "=?", + "left": { + "k": "var", + "name": "action" + }, + "right": { + "k": "nat", + "value": "3" + } + }, + "yes": { + "k": "var", + "name": "hasHead" + }, + "no": { + "k": "if", + "cond": { + "k": "binary", + "op": "=?", + "left": { + "k": "var", + "name": "action" + }, + "right": { + "k": "nat", + "value": "4" + } + }, + "yes": { + "k": "var", + "name": "hasTrust" + }, + "no": { + "k": "if", + "cond": { + "k": "binary", + "op": "=?", + "left": { + "k": "var", + "name": "action" + }, + "right": { + "k": "nat", + "value": "5" + } + }, + "yes": { + "k": "var", + "name": "hasTrust" + }, + "no": { + "k": "if", + "cond": { + "k": "binary", + "op": "=?", + "left": { + "k": "var", + "name": "action" + }, + "right": { + "k": "nat", + "value": "6" + } + }, + "yes": { + "k": "var", + "name": "hasTrust" + }, + "no": { + "k": "bool", + "value": true + } + } + } + } + } + } + } + } + }, + "Stitch.Authority.rotate": { + "module": "Stitch.Authority", + "name": "rotate", + "params": [ + { + "name": "state", + "type": { + "kind": "State" + } + }, + { + "name": "confirmed", + "type": { + "kind": "Bool" + } + }, + { + "name": "sameKey", + "type": { + "kind": "Bool" + } + }, + { + "name": "historyCapacity", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "State" + }, + "body": { + "k": "if", + "cond": { + "k": "call", + "name": "rotationAllowed", + "args": [ + { + "k": "var", + "name": "confirmed" + }, + { + "k": "project", + "value": { + "k": "var", + "name": "state" + }, + "field": "present" + }, + { + "k": "var", + "name": "sameKey" + }, + { + "k": "var", + "name": "historyCapacity" + } + ] + }, + "yes": { + "k": "record", + "name": "State", + "values": { + "generation": { + "k": "binary", + "op": "+", + "left": { + "k": "project", + "value": { + "k": "var", + "name": "state" + }, + "field": "generation" + }, + "right": { + "k": "nat", + "value": "1" + } + }, + "present": { + "k": "bool", + "value": true + }, + "revoked": { + "k": "bool", + "value": false + } + } + }, + "no": { + "k": "var", + "name": "state" + } + } + }, + "Stitch.Authority.revoke": { + "module": "Stitch.Authority", + "name": "revoke", + "params": [ + { + "name": "state", + "type": { + "kind": "State" + } + }, + { + "name": "confirmed", + "type": { + "kind": "Bool" + } + }, + { + "name": "sameScope", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "State" + }, + "body": { + "k": "if", + "cond": { + "k": "call", + "name": "revocationAllowed", + "args": [ + { + "k": "var", + "name": "confirmed" + }, + { + "k": "project", + "value": { + "k": "var", + "name": "state" + }, + "field": "present" + }, + { + "k": "var", + "name": "sameScope" + } + ] + }, + "yes": { + "k": "record", + "name": "State", + "values": { + "generation": { + "k": "project", + "value": { + "k": "var", + "name": "state" + }, + "field": "generation" + }, + "present": { + "k": "bool", + "value": true + }, + "revoked": { + "k": "bool", + "value": true + } + } + }, + "no": { + "k": "var", + "name": "state" + } + } + }, + "Stitch.Authority.migrate": { + "module": "Stitch.Authority", + "name": "migrate", + "params": [ + { + "name": "state", + "type": { + "kind": "State" + } + }, + { + "name": "confirmed", + "type": { + "kind": "Bool" + } + }, + { + "name": "scopeCurrent", + "type": { + "kind": "Bool" + } + }, + { + "name": "samePrior", + "type": { + "kind": "Bool" + } + }, + { + "name": "historyCapacity", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "State" + }, + "body": { + "k": "if", + "cond": { + "k": "call", + "name": "migrationAllowed", + "args": [ + { + "k": "var", + "name": "confirmed" + }, + { + "k": "var", + "name": "scopeCurrent" + }, + { + "k": "project", + "value": { + "k": "var", + "name": "state" + }, + "field": "present" + }, + { + "k": "var", + "name": "samePrior" + }, + { + "k": "var", + "name": "historyCapacity" + } + ] + }, + "yes": { + "k": "record", + "name": "State", + "values": { + "generation": { + "k": "binary", + "op": "+", + "left": { + "k": "project", + "value": { + "k": "var", + "name": "state" + }, + "field": "generation" + }, + "right": { + "k": "nat", + "value": "1" + } + }, + "present": { + "k": "bool", + "value": true + }, + "revoked": { + "k": "bool", + "value": false + } + } + }, + "no": { + "k": "var", + "name": "state" + } + } + }, + "Stitch.Authority.maySign": { + "module": "Stitch.Authority", + "name": "maySign", + "params": [ + { + "name": "state", + "type": { + "kind": "State" + } + }, + { + "name": "expectedKey", + "type": { + "kind": "Bool" + } + }, + { + "name": "bodyKey", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "call", + "name": "signingAllowed", + "args": [ + { + "k": "binary", + "op": "&&", + "left": { + "k": "project", + "value": { + "k": "var", + "name": "state" + }, + "field": "present" + }, + "right": { + "k": "not", + "value": { + "k": "project", + "value": { + "k": "var", + "name": "state" + }, + "field": "revoked" + } + } + }, + { + "k": "var", + "name": "expectedKey" + }, + { + "k": "var", + "name": "bodyKey" + } + ] + } + }, + "Stitch.Budget.chooseBool": { + "module": "Stitch.Budget", + "name": "chooseBool", + "params": [ + { + "name": "condition", + "type": { + "kind": "Bool" + } + }, + { + "name": "whenTrue", + "type": { + "kind": "Bool" + } + }, + { + "name": "whenFalse", + "type": { + "kind": "Bool" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "if", + "cond": { + "k": "var", + "name": "condition" + }, + "yes": { + "k": "var", + "name": "whenTrue" + }, + "no": { + "k": "var", + "name": "whenFalse" + } + } + }, + "Stitch.Budget.chooseNat": { + "module": "Stitch.Budget", + "name": "chooseNat", + "params": [ + { + "name": "condition", + "type": { + "kind": "Bool" + } + }, + { + "name": "whenTrue", + "type": { + "kind": "Nat" + } + }, + { + "name": "whenFalse", + "type": { + "kind": "Nat" + } + } + ], + "result": { + "kind": "Nat" + }, + "body": { + "k": "if", + "cond": { + "k": "var", + "name": "condition" + }, + "yes": { + "k": "var", + "name": "whenTrue" + }, + "no": { + "k": "var", + "name": "whenFalse" + } + } + }, + "Stitch.Budget.reserveAllowed": { + "module": "Stitch.Budget", + "name": "reserveAllowed", + "params": [ + { + "name": "spent", + "type": { + "kind": "Nat" + } + }, + { + "name": "reserved", + "type": { + "kind": "Nat" + } + }, + { + "name": "cost", + "type": { + "kind": "Nat" + } + }, + { + "name": "limit", + "type": { + "kind": "Nat" + } + }, + { + "name": "now", + "type": { + "kind": "Nat" + } + }, + { + "name": "last", + "type": { + "kind": "Nat" + } + }, + { + "name": "end", + "type": { + "kind": "Nat" + } + } + ], + "result": { + "kind": "Bool" + }, + "body": { + "k": "binary", + "op": "&&", + "left": { + "k": "binary", + "op": "<=?", + "left": { + "k": "var", + "name": "last" + }, + "right": { + "k": "var", + "name": "now" + } + }, + "right": { + "k": "binary", + "op": "&&", + "left": { + "k": "binary", + "op": " name.includes('::') ? name.replace('::','.') : module+'.'+name; +function natural(value) { + if(typeof value==='bigint'&&value>=0n)return value; + if(typeof value==='number'&&Number.isSafeInteger(value)&&value>=0)return BigInt(value); + throw new TypeError('model Nat must be a non-negative BigInt or safe integer'); +} +function coerce(value,type,module) { + if(type.kind==='Nat')return natural(value); + if(type.kind==='Bool') {if(typeof value!=='boolean')throw new TypeError('model Bool required');return value;} + if(type.kind==='Bytes') {if(!(value instanceof Uint8Array))throw new TypeError('model Bytes required');return value.slice();} + if(type.kind==='String') {if(typeof value!=='string')throw new TypeError('model String required');return value;} + if(type.kind==='List') {if(!Array.isArray(value))throw new TypeError('model List required');return value.map(x=>coerce(x,type.element,module));} + const id=qualify(module,type.kind),shape=types[id]; + if(!shape)throw new TypeError('unknown model type '+id); + if(shape.kind==='structure') {if(!value||typeof value!=='object'||Object.keys(value).sort().join(',')!==shape.fields.map(x=>x.name).sort().join(','))throw new TypeError('exact model record fields required for '+id);return Object.fromEntries(shape.fields.map(f=>[f.name,coerce(value[f.name],f.type,id.slice(0,id.lastIndexOf('.')))]));} + const constructor=shape.constructors.find(x=>x.name===value?.tag); + if(!constructor||!Array.isArray(value.fields)||value.fields.length!==constructor.fields.length)throw new TypeError('model constructor required for '+id); + return {tag:value.tag,fields:value.fields.map((v,i)=>coerce(v,constructor.fields[i],id.slice(0,id.lastIndexOf('.'))))}; +} +const tailCall = Symbol("source-tail-call"); +function evaluate(ast,env,module,tail=false) { + switch(ast.k) { + case 'nat':return BigInt(ast.value); + case 'bool':case 'string':return ast.value; + case 'var':if(!Object.hasOwn(env,ast.name))throw Error('unbound model variable');return env[ast.name]; + case 'if':return evaluate(evaluate(ast.cond,env,module)?ast.yes:ast.no,env,module,tail); + case 'not':return !evaluate(ast.value,env,module); + case 'project':return evaluate(ast.value,env,module)[ast.field]; + case 'let':return evaluate(ast.body,{...env,[ast.name]:evaluate(ast.value,env,module)},module,tail); + case 'record':return Object.fromEntries(Object.entries(ast.values).map(([k,v])=>[k,evaluate(v,env,module)])); + case 'call': {const id=qualify(module,ast.name),args=ast.args.map(x=>evaluate(x,env,module));return tail?{[tailCall]:true,id,args}:invoke(id,args);} + case 'nil':return []; + case 'cons':return [evaluate(ast.head,env,module),...evaluate(ast.tail,env,module)]; + case 'ctor':return {tag:ast.name.split('.').at(-1),fields:ast.args.map(x=>evaluate(x,env,module))}; + case 'match': { + const value=evaluate(ast.value,env,module);let tag,fields; + if(Array.isArray(value)){tag=value.length?'cons':'nil';fields=value.length?[value[0],value.slice(1)]:[];}else if(typeof value==='bigint'){tag=value===0n?'zero':'succ';fields=value===0n?[]:[value-1n];}else if(typeof value==='boolean'){tag=value?'true':'false';fields=[];}else {tag=value.tag;fields=value.fields;} + const b=ast.branches.find(x=>x.constructor.split('.').at(-1)===tag); + if(!b||b.binders.length!==fields.length)throw Error('nonexhaustive model match');return evaluate(b.body,{...env,...Object.fromEntries(b.binders.map((n,i)=>[n,fields[i]]))},module,tail); + } + case 'binary': { + const left=evaluate(ast.left,env,module); + if(ast.op==='&&')return left&&evaluate(ast.right,env,module); + if(ast.op==='||')return left||evaluate(ast.right,env,module); + const right=evaluate(ast.right,env,module); + switch(ast.op){case '+':return left+right;case '=?':return left===right;case '<=?':return left<=right;case 'evaluate(x,env,module)); + switch(ast.operation){case 'subtract':return a[0]>=a[1]?a[0]-a[1]:0n;case 'multiply':return a[0]*a[1];case 'quotient':return a[1]===0n?a[2]:a[0]/a[1];case 'remainder':return a[1]===0n?a[2]:a[0]%a[1];case 'equal':return a[0].length===a[1].length&&a[0].every((x,i)=>x===a[1][i]);default:throw Error('unsupported model primitive');} + } + default:throw Error('unsupported model node '+ast.k); + } +} +function invoke(id,args) {for(;;){const d=definitions[id];if(!d||d.params.length!==args.length)throw Error('unknown model function/arity '+id);const result=evaluate(d.body,Object.fromEntries(d.params.map((p,i)=>[p.name,args[i]])),d.module,true);if(!result?.[tailCall])return result;id=result.id;args=result.args;}} +export const model=Object.freeze(Object.fromEntries(Object.entries(definitions).map(([id,d])=>[id,(...args)=>{if(args.length!==d.params.length)throw new TypeError('model arity '+id);return invoke(id,args.map((v,i)=>coerce(v,d.params[i].type,d.module)));}]))); + +export const budgetReserveAllowed = model["Stitch.Budget.reserveAllowed"]; +export const budgetSettlementAllowed = model["Stitch.Budget.settlementAllowed"]; +export const pointerSuccessorAllowed = model["Stitch.Pointer.successorAllowed"]; +export const checkpointLinkAllowed = model["Stitch.Compute.checkpointLinkAllowed"]; +export const custodyCommitAllowed = model["Stitch.Custody.commitAllowed"]; +export const custodyRetireAllowed = model["Stitch.Custody.retireAllowed"]; +export const custodyPairAllowed = model["Stitch.Fragments.pairAllowed"]; diff --git a/src/layer1-uor/index.js b/src/layer1-uor/index.js index 059533c..69b310f 100644 --- a/src/layer1-uor/index.js +++ b/src/layer1-uor/index.js @@ -97,6 +97,13 @@ export function applyPrimitiveOp(op, a, b = null) { const { bits, mask, value: x } = a; const y = b ? (b.value & mask) : 0n; + if (op === PrimitiveOp.CONCAT) { + if (!(b instanceof Datum)) throw new TypeError('CONCAT requires a second Datum'); + // UOR pipeline TermValue bytes are big-endian. Datum.toBytes remains its + // legacy little-endian coordinate wire format, not CONCAT's term encoding. + if (bits + b.bits > 128) throw new RangeError('CONCAT result exceeds Datum capacity (128 bits)'); + return new Datum(bits + b.bits, (x << BigInt(b.bits)) | b.value); + } switch (op) { case PrimitiveOp.NEG: return new Datum(bits, (-x) & mask); @@ -130,6 +137,15 @@ export function applyPrimitiveOp(op, a, b = null) { return new Datum(bits, y === 0n ? 0n : (x / y) & mask); case PrimitiveOp.MOD: return new Datum(bits, y === 0n ? 0n : (x % y) & mask); + case PrimitiveOp.POW: { + let result = 1n, base = x, exponent = y; + while (exponent > 0n) { + if (exponent & 1n) result = (result * base) & mask; + base = (base * base) & mask; + exponent >>= 1n; + } + return new Datum(bits, result); + } default: throw new Error(`Unsupported PrimitiveOp discriminant: ${op}`); } @@ -462,8 +478,8 @@ export class Trace { } /** - * Re-derive a Certified GroundingCertificate from a Trace via structural validation - * + fingerprint passthrough (matches `uor_foundation_verify::verify_trace`). + * Check structural trace well-formedness and preserve the legacy UOR grounding record. + * This does NOT replay the named program/input or certify execution. Use replay.js for that. * * @param {Trace} trace * @returns {{ ok: boolean, error?: string, certificate?: { fingerprint: ContentFingerprint, wittLevelBits: number, kind: number } }} @@ -494,6 +510,7 @@ export function verifyTrace(trace) { return { ok: true, + evidence: 'structure-only', certificate: { fingerprint: trace.fingerprint, wittLevelBits: trace.wittLevelBits, diff --git a/src/layer1-uor/pointer.js b/src/layer1-uor/pointer.js new file mode 100644 index 0000000..fd54416 --- /dev/null +++ b/src/layer1-uor/pointer.js @@ -0,0 +1,326 @@ +/** Single-writer pointer admission. The caller supplies an independently trusted authority key. */ +import { canonicalBytes, sha256Bytes, parseCanonicalJson } from './custody.js'; +import { record, natural, identifier, digest, refuse } from './contracts.js'; +import { model, pointerSuccessorAllowed } from './generated-model.js'; +import { acceptedRecoveryAnchor } from '../recovery.js'; +import { dnsRequestAllowed, dnsReadDecision, dnsWriteState, dnsWriteOutcome, dnsLifecycle } from './effects.js'; +const hex = bytes => Array.from(bytes, b => b.toString(16).padStart(2, '0')).join(''); +function unhex(value, length) { + if (typeof value !== 'string' || value.length !== length * 2 || !/^[0-9a-f]+$/.test(value)) refuse('invalid-key-or-signature'); + return Uint8Array.from(value.match(/../g), x => parseInt(x, 16)); +} +function validateBody(body) { + record(body, ['version', 'name', 'authorityKey', 'revision', 'previousDigest', 'objectRoot', 'validFromMs', 'validUntilMs']); + if (body.version !== 1) refuse('unsupported-pointer'); + identifier(body.name); unhex(body.authorityKey, 32); natural(body.revision); digest(body.objectRoot); + natural(body.validFromMs); natural(body.validUntilMs); + if (body.validUntilMs <= body.validFromMs) refuse('invalid-validity'); + if (body.previousDigest !== null) digest(body.previousDigest); + return body; +} +const snapshot = value => JSON.parse(new TextDecoder().decode(canonicalBytes(value))); +const signingBytes = body => canonicalBytes({ domain: 'stitch/pointer/v1', body }); +export async function generateAuthority() { + const keyPair = await globalThis.crypto.subtle.generateKey({ name: 'Ed25519' }, false, ['sign', 'verify']); + const publicKey = hex(new Uint8Array(await globalThis.crypto.subtle.exportKey('raw', keyPair.publicKey))); + return { publicKey, privateKey: keyPair.privateKey }; +} +export async function signPointer(body, privateKey) { + body = snapshot(body); + validateBody(body); + const signature = hex(new Uint8Array(await globalThis.crypto.subtle.sign('Ed25519', privateKey, signingBytes(body)))); + const pointer = { ...structuredClone(body), signature }; + return { ...pointer, pointerDigest: await sha256Bytes(canonicalBytes(pointer), 'pointer') }; +} +export async function verifyPointer(pointer, trustedAuthorityKey) { + pointer = snapshot(pointer); + record(pointer, ['version', 'name', 'authorityKey', 'revision', 'previousDigest', 'objectRoot', 'validFromMs', 'validUntilMs', 'signature', 'pointerDigest']); + const { signature, pointerDigest, ...body } = pointer; + validateBody(body); digest(pointerDigest); unhex(trustedAuthorityKey, 32); + if (body.authorityKey !== trustedAuthorityKey) refuse('wrong-authority'); + if (pointerDigest !== await sha256Bytes(canonicalBytes({ ...body, signature }), 'pointer')) refuse('pointer-integrity'); + const key = await globalThis.crypto.subtle.importKey('raw', unhex(trustedAuthorityKey, 32), { name: 'Ed25519' }, false, ['verify']); + if (!await globalThis.crypto.subtle.verify('Ed25519', key, unhex(signature, 64), signingBytes(body))) refuse('pointer-signature'); + return body; +} +/** Compare-and-swap against this observer's retained head, not global linearizability. */ +export async function admitPointer(current, candidate, { name, trustedAuthorityKey, nowMs }) { + candidate = snapshot(candidate); if (current !== null) current = snapshot(current); + identifier(name); natural(nowMs); + await verifyPointer(candidate, trustedAuthorityKey); + if (candidate.name !== name) refuse('pointer-name'); + if (!(candidate.validFromMs <= nowMs && nowMs < candidate.validUntilMs)) refuse('pointer-expired'); + if (current === null) { + if (candidate.revision !== 0 || candidate.previousDigest !== null) refuse('pointer-bootstrap'); + } else { + await verifyPointer(current, trustedAuthorityKey); + if (current.name !== name || current.revision === Number.MAX_SAFE_INTEGER || + !pointerSuccessorAllowed(current.revision, candidate.revision, candidate.previousDigest === current.pointerDigest, + true, true, candidate.validFromMs, candidate.validUntilMs, nowMs)) refuse('pointer-conflict'); + } + return structuredClone(candidate); +} + +/** Retained observer-local head; pinning a key is an explicit host decision. */ +export class PointerObserver { + #head = null; + #pending = Promise.resolve(); + constructor({ name, trustedAuthorityKey, clock = Date.now, admission = null, trustStore = null }) { + identifier(name); unhex(trustedAuthorityKey, 32); + // A recovery action can never repin or rename an existing observer. + Object.defineProperties(this, { name: { value: name, enumerable: true }, + trustedAuthorityKey: { value: trustedAuthorityKey, enumerable: true } }); + this.clock = clock; this.admission = admission; this.trustStore = trustStore; + } + get head() { return this.#head === null ? null : structuredClone(this.#head); } + /** Explicit local trust-bootstrap, never ordinary imported evidence admission. + * Both restoration and ordinary succession share the same serialized CAS. + * Only an empty head (or the exact already-retained head) is eligible. Even a + * newer accepted anchor cannot replace a different live head. + */ + restoreFromRecovery(vault, { expectedDigest, scopeStillCurrent = () => true }) { + const scope = { name: this.name, authorityKey: this.trustedAuthorityKey, expectedDigest }; + const work = this.#pending.then(async () => { + await this.trustStore?.assertTrustedAuthority(this.name, this.trustedAuthorityKey); + const anchor = acceptedRecoveryAnchor(vault, scope); + await verifyPointer(anchor, this.trustedAuthorityKey); + // Recheck acceptance and the wall clock after asynchronous crypto. A newer + // acceptance, changed UI scope or expiry cannot commit a stale operation. + const accepted = acceptedRecoveryAnchor(vault, scope); + const nowMs = this.clock(); natural(nowMs); + if (!model['Stitch.Pointer.restoreAllowed'](accepted.pointerDigest === anchor.pointerDigest, + anchor.name === this.name && anchor.authorityKey === this.trustedAuthorityKey && scopeStillCurrent() === true, + anchor.pointerDigest === expectedDigest, true, anchor.validFromMs, anchor.validUntilMs, nowMs, + this.#head !== null, this.#head?.pointerDigest === anchor.pointerDigest)) refuse('pointer-restore-conflict-or-stale'); + // Exact repetition is idempotent, including its storage reservation. + if (this.#head === null) { + const saved = await this.trustStore?.assertTrustedAuthority(this.name, this.trustedAuthorityKey); + if (saved && saved.head.pointerDigest !== anchor.pointerDigest) refuse('pointer-saved-anchor-changed'); + this.admission?.reserve('refresh', { storageBytes: canonicalBytes(anchor).length }); + this.#head = anchor; + } + return this.head; + }); + this.#pending = work.catch(() => {}); + return work; + } + /** Explicit restoration from operator-saved origin-local trust. Never repins + * this observer and never replaces a different retained head. */ + restoreFromTrustedAnchor({ expectedDigest, scopeStillCurrent = () => true }) { + const work = this.#pending.then(async () => { + if (!this.trustStore) refuse('pointer-trust-storage-unavailable'); + const anchor = await this.trustStore.assertTrustedAuthority(this.name, this.trustedAuthorityKey); + if (!anchor || anchor.head.pointerDigest !== expectedDigest) refuse('pointer-saved-anchor-changed'); + await verifyPointer(anchor.head, this.trustedAuthorityKey); + const current = await this.trustStore.assertTrustedAuthority(this.name, this.trustedAuthorityKey); + const now = this.clock(); natural(now); + if (!model['Stitch.Pointer.restoreAllowed'](current?.head.pointerDigest === expectedDigest, + scopeStillCurrent() === true, anchor.head.pointerDigest === expectedDigest, true, + anchor.head.validFromMs, anchor.head.validUntilMs, now, this.#head !== null, this.#head?.pointerDigest === expectedDigest)) refuse('pointer-restore-conflict-or-stale'); + if (this.#head === null) { + this.admission?.reserve('refresh', { storageBytes: canonicalBytes(anchor.head).length }); + this.#head = structuredClone(anchor.head); + } + return this.head; + }); + this.#pending = work.catch(() => {}); return work; + } + admit(candidate) { + // Snapshot synchronously and serialize compare-and-swap plus head retention. + try { candidate = snapshot(candidate); } catch (error) { return Promise.reject(error); } + const work = this.#pending.then(async () => { + const savedTrust = await this.trustStore?.assertTrustedAuthority(this.name, this.trustedAuthorityKey); + const admitted = await admitPointer(this.#head, candidate, { name: this.name, + trustedAuthorityKey: this.trustedAuthorityKey, nowMs: this.clock() }); + this.admission?.reserve('refresh', { storageBytes: canonicalBytes(admitted).length }); + if (savedTrust) await this.trustStore.retainTrustedHead({ name: this.name, expectedPointerDigest: this.#head?.pointerDigest ?? null, candidate: admitted, nowMs: this.clock() }); + this.#head = admitted; + return this.head; + }); + this.#pending = work.catch(() => {}); + return work; + } +} + +/** Full pointer JSON needs multiple DNS TXT strings; never truncate commitments. */ +export function pointerDnsText(pointer) { + const text = new TextDecoder().decode(canonicalBytes(pointer)); + return text.match(/.{1,200}/g).map(part => JSON.stringify(part)).join(' '); +} +export function parsePointerDnsText(text) { + if (typeof text !== 'string' || text.length > 4096) refuse('invalid-pointer-dns'); + const limits = { maxBytes: 4096, maxDepth: 8, maxEntries: 128, maxStringLength: 1024 }; + if (text.startsWith('{')) return structuredClone(parseCanonicalJson(text, limits)); + const chunks = text.match(/"(?:[^"\\]|\\.)*"/g); + if (!chunks || chunks.join(' ') !== text.trim()) refuse('invalid-pointer-dns'); + return structuredClone(parseCanonicalJson(chunks.map(part => parseCanonicalJson(part, limits)).join(''), limits)); +} + +/** DNS publication state scoped to destination and pinned authority. + * Optional origin-local journal provides conservative restart reconciliation. + * Reconciliation observes the provider; it is neither atomic CAS nor global order. + * Credentials are used for this call only and never retained in publication state. + */ +export class PointerPublisher { + #states = new Map(); + #busy = new Set(); + #journalBusy = false; + constructor({ resolver, clock = Date.now, journal = null }) { this.resolver = resolver; this.clock = clock; this.journal = journal; } + async restore(destination) { + const scope = JSON.stringify([String(destination.zoneId).toLowerCase(), destination.name, destination.trustedAuthorityKey]); + if (this.journal) { + const state = await this.journal.readPublication(scope); + if (state) this.#states.set(scope, state); + else this.#states.delete(scope); + } + return this.pending(destination); + } + async publish(request) { + if (!this.journal) return this.#publish(request); + if (this.#journalBusy) refuse('dns-publication-in-flight'); + request = { ...request, candidate: snapshot(request.candidate) }; + this.#journalBusy = true; + const scope = JSON.stringify([String(request.zoneId).toLowerCase(), request.name, request.trustedAuthorityKey]); + try { return await this.journal.exclusivePublication(scope, () => this.#publishJournal(request)); } + finally { this.#journalBusy = false; } + } + async #publishJournal(request) { + if (!this.journal) return this.#publish(request); + const { zoneId, name, trustedAuthorityKey } = request; + if (typeof zoneId !== 'string' || !/^[a-f0-9]{32}$/i.test(zoneId)) refuse('invalid-dns-destination'); + identifier(name); unhex(trustedAuthorityKey, 32); + if (typeof request.apiToken !== 'string' || !request.apiToken) refuse('invalid-dns-destination'); + const candidate = snapshot(request.candidate); + await verifyPointer(candidate, trustedAuthorityKey); + if (candidate.name !== name) refuse('pointer-name'); + const scope = JSON.stringify([zoneId.toLowerCase(), name, trustedAuthorityKey]); + // Reads and local admission do not claim an uncertain external effect. + // The Web Lock spans the read, write-ahead commit, dispatch and settlement. + const prior = await this.journal.readPublication(scope); + const effective = prior?.outcome === 'unknown' ? prior.candidate : candidate; + if (prior) this.#states.set(scope, prior); + else this.#states.delete(scope); + let claim = null; + const settle = async () => { + const next = this.#states.get(scope); + if (next && next.outcome !== 'unknown' && (claim?.writer || prior?.outcome === 'unknown')) { + await this.journal.finishPublication(scope, effective.pointerDigest, claim?.owner, next); + } + }; + let result; + try { + result = await this.#publish({ ...request, candidate: effective }, async pending => { + claim = await this.journal.claimPublication(scope, pending); + if (!claim.writer) throw Error('An earlier publication must be reconciled before dispatch.'); + }); + } catch (error) { + // A trusted adapter can prove it refused before dispatch. Persist that + // definite refusal using the claim owner; failed settlement stays unknown. + try { await settle(); } + catch { + await this.restore(request); + return { outcome: 'unknown', reason: 'Could not save the definite refusal. Reconcile the retained candidate before any further write.' }; + } + await this.restore(request); + throw error; + } + try { await settle(); } + catch { + await this.restore(request); + return { outcome: 'unknown', reason: 'Provider result could not be saved. Reconcile the retained exact candidate; do not repeat the write.' }; + } + if (claim?.writer || prior?.outcome === 'unknown') await this.restore(request); + return result; + } + + pending({ zoneId, name, trustedAuthorityKey }) { + const state = this.#states.get(JSON.stringify([String(zoneId).toLowerCase(), name, trustedAuthorityKey])); + return state?.outcome === 'unknown' ? structuredClone(state.candidate) : null; + } + status({ zoneId, name, trustedAuthorityKey }) { + const scope = JSON.stringify([String(zoneId).toLowerCase(), name, trustedAuthorityKey]); + return dnsLifecycle(this.#states.get(scope), this.#busy.has(scope)); + } + async #publish({ zoneId, apiToken, name, trustedAuthorityKey, candidate }, beforeWrite = async () => {}) { + // Snapshot all caller-controlled data before the first await. + candidate = snapshot(candidate); + if (typeof zoneId !== 'string' || !/^[a-f0-9]{32}$/i.test(zoneId) + || typeof apiToken !== 'string' || !apiToken) refuse('invalid-dns-destination'); + zoneId = zoneId.toLowerCase(); + identifier(name); unhex(trustedAuthorityKey, 32); + const scope = JSON.stringify([zoneId, name, trustedAuthorityKey]); + const destination = { zoneId, name, trustedAuthorityKey }; + const busy = this.#busy.has(scope), retained = this.#states.get(scope); + if (!dnsRequestAllowed(destination, retained, candidate, busy)) { + if (busy) refuse('dns-publication-in-flight'); + if (retained?.outcome === 'unknown') return { outcome: 'unknown', reason: 'Reconcile the earlier exact candidate before another publication.' }; + refuse('dns-publication-unresolved'); + } + this.#busy.add(scope); + try { + await verifyPointer(candidate, trustedAuthorityKey); + if (candidate.name !== name) refuse('pointer-name'); + const previous = this.#states.get(scope); + // Reserve retained publication-state capacity before any provider effect, + // so a successful/uncertain write cannot outlive an admission refusal. + this.resolver.admission?.reserve('refresh', { storageBytes: canonicalBytes(candidate).length + canonicalBytes(scope).length }); + let records; + try { records = await this.resolver.listCloudflareRecords({ zoneId, apiToken, name }); } + catch (error) { + if (previous?.outcome === 'unknown') return { outcome: 'unknown', reason: 'Provider reconciliation failed; retry a read without repeating the write.' }; + throw error; + } + // Defense in depth for adapters: never overwrite ambiguous or foreign rows. + if (!Array.isArray(records) || records.length > 1) refuse('dns-record-conflict'); + const remote = records[0]; + let recordId = null, pointer = null; + if (remote) { + if (remote.name !== name || remote.type !== 'TXT' || typeof remote.id !== 'string' + || !/^[A-Za-z0-9_-]{1,128}$/.test(remote.id)) refuse('dns-record-conflict'); + pointer = parsePointerDnsText(remote.content); + await verifyPointer(pointer, trustedAuthorityKey); + if (pointer.name !== name || (previous?.recordId && previous.recordId !== remote.id)) refuse('dns-record-conflict'); + recordId = remote.id; + } + const now = this.clock(); + const decision = dnsReadDecision(destination, previous, candidate, remote, pointer, now); + if (decision === 'Reconciled') { + this.#states.set(scope, { outcome: 'published', pointerDigest: candidate.pointerDigest, recordId }); + return { outcome: 'published', recordId, reconciled: true }; + } + if (decision === 'Wait') { + return { outcome: 'unknown', reason: 'The earlier write may have completed. Provider has not shown the exact candidate; retry reconciliation, not publication.' }; + } + if (decision === 'Refuse') { + if (!remote && previous?.recordId) refuse('dns-record-missing'); + if (!(candidate.validFromMs <= now && now < candidate.validUntilMs)) refuse('pointer-expired'); + refuse('dns-record-conflict'); + } + // Mark uncertain before dispatch. An adapter exception after this boundary + // cannot silently authorize another mutation, even if it lost the response. + const pending = dnsWriteState(destination, previous, candidate, remote, pointer, now); + await beforeWrite(pending); + this.#states.set(scope, pending); + let result; + try { + result = await this.resolver.writeCloudflareRecord({ zoneId, apiToken, recordId, type: 'TXT', name, + content: pointerDnsText(candidate), ttl: 60 }); + } catch (error) { + if (error.effectDispatched === false) { + // Built-in adapter refused before invoking fetch. Keep all resource + // charges, but an explicit later attempt is safe after local repair. + this.#states.set(scope, { ...pending, outcome: dnsWriteOutcome(destination, pending, { outcome: 'refused' }), candidate: undefined }); + } + throw error; + } + const outcome = dnsWriteOutcome(destination, pending, result); + this.#states.set(scope, { outcome, pointerDigest: candidate.pointerDigest, candidate: outcome === 'unknown' ? candidate : undefined, recordId: outcome === 'published' ? result.id : recordId }); + return { outcome, recordId: outcome === 'published' ? result.id : recordId, + reason: outcome === 'unknown' ? 'Publication completion is unknown. Retry to read the provider without repeating this write.' : undefined }; + } catch (error) { + if (this.#states.get(scope)?.outcome === 'unknown') return { outcome: 'unknown', + reason: 'The earlier write is unresolved and this read could not safely reconcile it. Check the provider record, then retry reconciliation; no write was repeated.' }; + throw error; + } finally { this.#busy.delete(scope); } + } +} diff --git a/src/layer2-schedulers/index.js b/src/layer2-schedulers/index.js index a8227ba..9e936da 100644 --- a/src/layer2-schedulers/index.js +++ b/src/layer2-schedulers/index.js @@ -9,6 +9,8 @@ * Zero upward dependencies. */ +import { budgetReserveAllowed } from '../layer1-uor/generated-model.js'; + const LN2 = Math.LN2; /** @@ -311,6 +313,10 @@ export class BudgetPacedSurvivalScheduler { static NAME = 'Budget-Paced-Survival'; constructor({ ttlSeconds = 60, durationSeconds = 600, maxRefreshBudget = 30, minFloorSeconds = 5 } = {}) { + if (![ttlSeconds, durationSeconds, minFloorSeconds].every(x => Number.isFinite(x) && x > 0) || + !Number.isSafeInteger(maxRefreshBudget) || maxRefreshBudget < 0) throw new RangeError('Invalid scheduler policy'); + this.epochStartSec = null; + this.lastObservedSec = 0; this.ttlSeconds = ttlSeconds; this.durationSeconds = durationSeconds; this.maxRefreshBudget = maxRefreshBudget; @@ -321,25 +327,46 @@ export class BudgetPacedSurvivalScheduler { } recordFailure(timestampSec) { + if (!Number.isFinite(timestampSec)) throw new RangeError('Invalid failure observation'); this.failureTimestamps.push(timestampSec); + if (this.failureTimestamps.length > 256) this.failureTimestamps.shift(); } markRefreshed(timestampSec) { + if (!Number.isFinite(timestampSec) || timestampSec < 0) throw new RangeError('Invalid elapsed time'); + if (this.epochStartSec === null) { + this.epochStartSec = timestampSec; + this.lastRefreshSec = timestampSec; + this.lastObservedSec = timestampSec; + this.refreshCount = 1; // Initial observation is not a network refresh. + return true; + } + if (timestampSec < this.lastObservedSec) return false; + const elapsedMs = Math.floor((timestampSec - this.epochStartSec) * 1000); + const lastMs = Math.floor((this.lastObservedSec - this.epochStartSec) * 1000); + if (!budgetReserveAllowed(this.refreshCount - 1, 0, 1, this.maxRefreshBudget, + elapsedMs, lastMs, Math.ceil(this.durationSeconds * 1000))) return false; this.lastRefreshSec = timestampSec; + this.lastObservedSec = timestampSec; this.refreshCount++; + return true; } evaluate(nowSec) { + if (!Number.isFinite(nowSec) || nowSec < this.lastObservedSec) throw new RangeError('Clock regression'); + if (this.epochStartSec === null) this.markRefreshed(nowSec); + this.lastObservedSec = nowSec; + const elapsedSeconds = nowSec - this.epochStartSec; const ageSeconds = Math.max(0, nowSec - this.lastRefreshSec); const shortFailures = this.failureTimestamps.slice(-4); const lambdaShort = estimatePoissonRate(shortFailures, 1 / this.ttlSeconds); const lambdaLong = estimatePoissonRate(this.failureTimestamps, 1 / this.ttlSeconds); - // Cauchy-Schwarz optimal refresh spacing under budget constraint: dt* proportional to (lambda_long / lambda_short)^(1/2) + // Candidate hazard pacing only; no general optimality claim for observed churn. const sqrtHazardRatio = Math.max(0.5, Math.min(2.5, Math.sqrt(lambdaShort / Math.max(1e-6, lambdaLong)))); const refreshesUsed = Math.max(0, this.refreshCount - 1); const budgetRemaining = Math.max(1, this.maxRefreshBudget - refreshesUsed); - const timeRemaining = Math.max(this.minFloorSeconds, this.durationSeconds - nowSec); + const timeRemaining = Math.max(this.minFloorSeconds, this.durationSeconds - elapsedSeconds); const nominalBudgetInterval = timeRemaining / budgetRemaining; const targetIntervalSeconds = Math.max( @@ -347,8 +374,12 @@ export class BudgetPacedSurvivalScheduler { Math.min(this.ttlSeconds * 0.9, nominalBudgetInterval / sqrtHazardRatio) ); const pAlive = computeSurvivalProbability(lambdaShort, ageSeconds); - const shouldRefresh = ageSeconds >= targetIntervalSeconds; + const exhausted = refreshesUsed >= this.maxRefreshBudget || elapsedSeconds >= this.durationSeconds; + const shouldRefresh = !exhausted && ageSeconds >= targetIntervalSeconds; return { + elapsedSeconds, + budgetRemaining: Math.max(0, this.maxRefreshBudget - refreshesUsed), + exhausted, ageSeconds, lambda: lambdaShort, pAlive, diff --git a/src/layer2-schedulers/policy.js b/src/layer2-schedulers/policy.js new file mode 100644 index 0000000..73de074 --- /dev/null +++ b/src/layer2-schedulers/policy.js @@ -0,0 +1,108 @@ +/** Conservative reservation ledger. Failed or ambiguous effects keep their reservation charged. */ +import { identifier, natural, record, refuse } from '../layer1-uor/contracts.js'; +import { snapshotRecord } from '../layer1-uor/custody.js'; +import { budgetReserveAllowed, budgetSettlementAllowed } from '../layer1-uor/generated-model.js'; +let runtimeEpoch = 0; // origin-local instance identity, never a distributed clock +const kinds = ['refresh', 'place', 'repair', 'checkpoint', 'retrieve']; +const measures = ['requests', 'transferBytes', 'storageBytes', 'computeSteps']; +function cost(value) { record(value, measures); for (const k of measures) natural(value[k]); return value; } +export const zeroCost = () => Object.fromEntries(measures.map(k => [k, 0])); +export function createBudget({ epoch, startMs, endMs, limit }) { + identifier(epoch); natural(startMs); natural(endMs); cost(limit); + if (endMs <= startMs) refuse('invalid-epoch'); + return { epoch, startMs, endMs, lastObservedMs: startMs, limit: { ...limit }, spent: zeroCost(), reservations: [] }; +} +function validate(state) { + record(state, ['epoch', 'startMs', 'endMs', 'lastObservedMs', 'limit', 'spent', 'reservations']); + identifier(state.epoch); natural(state.startMs); natural(state.endMs); natural(state.lastObservedMs); + cost(state.limit); cost(state.spent); + if (state.endMs <= state.startMs || state.lastObservedMs < state.startMs || !Array.isArray(state.reservations)) refuse('invalid-budget'); + const ids = new Set(); const totals = zeroCost(); + for (const r of state.reservations) { + record(r, ['id', 'kind', 'cost', 'status']); identifier(r.id); cost(r.cost); + if (ids.has(r.id) || !kinds.includes(r.kind) || !['reserved', 'settled'].includes(r.status)) refuse('invalid-reservation'); + ids.add(r.id); + for (const k of measures) totals[k] += r.cost[k]; + } + for (const k of measures) { + natural(totals[k]); + if (totals[k] !== state.spent[k] || state.spent[k] > state.limit[k]) refuse('invalid-budget'); + } +} +export function reserveAction(state, { id, kind, cost: requested }, nowMs) { + requested = snapshotRecord(requested); + validate(state); identifier(id); natural(nowMs); cost(requested); + if (!kinds.includes(kind)) refuse('unsupported-action'); + if (nowMs < state.lastObservedMs) refuse('clock-regression'); + if (nowMs >= state.endMs) refuse('epoch-expired'); + if (state.reservations.some(r => r.id === id)) refuse('duplicate-action'); + const spent = zeroCost(); + for (const k of measures) { + if (!budgetReserveAllowed(state.spent[k], 0, requested[k], state.limit[k], nowMs, state.lastObservedMs, state.endMs)) refuse('budget-exhausted'); + spent[k] = state.spent[k] + requested[k]; + } + return { ...structuredClone(state), lastObservedMs: nowMs, spent, + reservations: [...structuredClone(state.reservations), { id, kind, cost: { ...requested }, status: 'reserved' }] }; +} +/** Only a completed, exact local accounting receipt can release unused reservation. */ +export function settleAction(state, id, actualCost) { + actualCost = snapshotRecord(actualCost); + validate(state); identifier(id); cost(actualCost); + const reservation = state.reservations.find(r => r.id === id); + if (!reservation || reservation.status !== 'reserved') refuse('unknown-reservation'); + const spent = { ...state.spent }; + for (const k of measures) { + if (!budgetSettlementAllowed(reservation.cost[k], reservation.cost[k], actualCost[k], true)) refuse('reservation-exceeded'); + spent[k] -= reservation.cost[k] - actualCost[k]; + } + return { ...structuredClone(state), spent, reservations: state.reservations.map(r => r.id === id + ? { ...r, cost: { ...actualCost }, status: 'settled' } : structuredClone(r)) }; +} + +/** + * Local effect admission. Charges are cumulative ceilings in one explicit epoch, + * not measurements of TLS, ICE/STUN, browser memory, VM work, or host overhead. + * Failed/unknown effects stay charged. No automatic refund or epoch rollover. + */ +export class ResourceAdmission { + #state; + #sequence = 0; + constructor({ clock = () => Math.floor(performance.now()), durationMs = 600000, + limit = { requests: 4096, transferBytes: 16 * 1024 * 1024, + storageBytes: 16 * 1024 * 1024, computeSteps: 1000000 }, maxActions = 16384 } = {}) { + natural(durationMs); natural(maxActions, 65536); + this.clock = clock; + this.maxActions = maxActions; + const startMs = clock(); natural(startMs); + natural(startMs + durationMs); + this.#state = createBudget({ epoch: `runtime-${++runtimeEpoch}`, startMs, endMs: startMs + durationMs, limit }); + } + get state() { return structuredClone(this.#state); } + /** Read-only admission evidence for a correlated still-pending effect. */ + reservationCurrent(id, epoch) { + const now = this.clock(); + return Number.isSafeInteger(now) && now >= this.#state.lastObservedMs + && now < this.#state.endMs && this.#state.epoch === epoch + && this.#state.reservations.some(r => r.id === id && r.status === 'reserved'); + } + reserve(kind, requested = {}) { + if (this.#sequence >= this.maxActions) refuse('action-capacity'); + const amount = { ...zeroCost(), ...requested }; + const id = `effect-${this.#sequence + 1}`; + const next = reserveAction(this.#state, { id, kind, cost: amount }, this.clock()); + this.#state = next; + this.#sequence++; + return id; + } + run(kind, requested, effect) { + this.reserve(kind, requested); + return effect(); + } +} + +/** Exact UTF-8 application payload length, excluding lower-layer overhead. */ +export const wireBytes = value => new TextEncoder().encode(typeof value === 'string' ? value : JSON.stringify(value)).length; +export function reserveNetwork(admission, kind, payload, destinations = 1) { + natural(destinations); + if (destinations) admission.reserve(kind, { requests: destinations, transferBytes: wireBytes(payload) * destinations }); +} diff --git a/src/layer3-storage/custody.js b/src/layer3-storage/custody.js new file mode 100644 index 0000000..6c04d95 --- /dev/null +++ b/src/layer3-storage/custody.js @@ -0,0 +1,357 @@ +/** + * Layer 3 reference object recovery and placement transitions. + * + * No transport is performed here. An acknowledgement is an assertion by the + * named holder with bytes checked locally, not an authenticated storage receipt. + * Distinct holder strings do not establish distinct machines/failure domains. + * Placement summaries are conditional on truthful, currently reachable holders. + * State arguments are trusted local observations produced by these transitions, + * not signed transferable evidence. Schema guards do not authenticate history. + */ +import { + CUSTODY_LIMITS, CustodyError, canonicalBytes, sha256Bytes, commitObject, + fragmentDigest, verifyManifest, verifyFragment, copyBytes, + snapshotRecord, exactKeys, deepFreeze, +} from '../layer1-uor/custody.js'; +import { custodyCommitAllowed, custodyRetireAllowed, custodyPairAllowed } from '../layer1-uor/generated-model.js'; + +const fail = (code, message) => { throw new CustodyError(code, message); }; + +function split(bytes) { + const length = Math.ceil(bytes.length / 2); + const a = new Uint8Array(length), b = new Uint8Array(length), parity = new Uint8Array(length); + a.set(bytes.subarray(0, length)); + b.set(bytes.subarray(length)); + for (let i = 0; i < length; i++) parity[i] = a[i] ^ b[i]; + return [a, b, parity]; +} + +/** Raw, self-contained encoding only. The caller's bytes are never retained. */ +export async function createObject(bytes) { + const snapshot = copyBytes(bytes); + const shards = split(snapshot); + const object = await commitObject(snapshot); + const encodingDigest = await sha256Bytes(snapshot, 'encoding'); + const digests = await Promise.all(shards.map((b, i) => fragmentDigest(encodingDigest, i, b))); + const body = { + version: 1, + object, + encoding: { format: 'raw', encodingDigest, byteLength: snapshot.length, dependencies: [] }, + fragments: { scheme: 'xor-2-of-3', threshold: 2, count: 3, byteLength: shards[0].length, digests }, + }; + const manifest = deepFreeze({ ...body, manifestDigest: await sha256Bytes(canonicalBytes(body), 'manifest') }); + return { manifest, fragments: shards.map((b, index) => ({ index, bytes: b })) }; +} + +/** + * Any two distinct valid fragments recover the object. Every supplied fragment, + * the exact padding, all three regenerated fragment commitments, raw encoding, + * object bytes and complete manifest commitment are checked, even with 3 inputs. + * Refuses malformed/duplicate fragments rather than silently choosing a subset. + */ +export async function recoverObject(manifest, fragments) { + if (!Array.isArray(fragments) || Object.getPrototypeOf(fragments) !== Array.prototype + || fragments.length < 2 || fragments.length > 3) fail('InsufficientFragments', 'Supply two or three fragments'); + // Snapshot every fragment synchronously before the first await. Never retain + // mutable network buffers across asynchronous digest checks. + const inputs = []; + for (let i = 0; i < fragments.length; i++) { + const d = Object.getOwnPropertyDescriptor(fragments, String(i)); + if (!d || !Object.hasOwn(d, 'value')) fail('InvalidSchema', 'Sparse/accessor fragment list'); + const f = d.value; + if (!f || typeof f !== 'object' || Array.isArray(f) + || ![Object.prototype, null].includes(Object.getPrototypeOf(f))) fail('InvalidSchema', 'Invalid fragment'); + const descriptors = Object.getOwnPropertyDescriptors(f); + if (Reflect.ownKeys(f).length !== 2 || !descriptors.index?.enumerable || !descriptors.bytes?.enumerable + || !Object.hasOwn(descriptors.index, 'value') || !Object.hasOwn(descriptors.bytes, 'value')) { + fail('InvalidSchema', 'Fragment requires only index and bytes'); + } + const index = descriptors.index.value; + if (!Number.isInteger(index) || index < 0 || index > 2) fail('InvalidSchema', 'Invalid fragment index'); + if (inputs.some(v => v.index === index)) fail('DuplicateFragment', 'Fragment indices must be distinct'); + inputs.push({ index, bytes: copyBytes(descriptors.bytes.value, Math.ceil(CUSTODY_LIMITS.maxObjectBytes / 2)) }); + } + if (Reflect.ownKeys(fragments).length !== fragments.length + 1) fail('InvalidSchema', 'Extended fragment list'); + const m = await verifyManifest(manifest); + const checked = await Promise.all(inputs.map(f => verifyFragment(m, f))); + if (!custodyPairAllowed(checked[0].index, checked[1].index, true, true, m.encoding.dependencies.length === 0)) { + fail('InvalidTransition', 'Generated model refused the recovery pair'); + } + const shards = [null, null, null]; + for (const f of checked) shards[f.index] = f.bytes; + const n = m.fragments.byteLength; + if (!shards[0] || !shards[1]) { + const absent = shards[0] ? 1 : 0; + shards[absent] = new Uint8Array(n); + for (let i = 0; i < n; i++) shards[absent][i] = shards[1 - absent][i] ^ shards[2][i]; + } + if (m.object.byteLength % 2 === 1 && shards[1][n - 1] !== 0) fail('InvalidPadding', 'Nonzero XOR padding'); + const bytes = new Uint8Array(m.object.byteLength); + bytes.set(shards[0]); + bytes.set(shards[1].subarray(0, bytes.length - n), n); + const object = await commitObject(bytes); + if (object.contentDigest !== m.object.contentDigest) fail('ObjectDigestMismatch', 'Recovered object commitment does not match'); + if (await sha256Bytes(bytes, 'encoding') !== m.encoding.encodingDigest) { + fail('EncodingDigestMismatch', 'Recovered encoding commitment does not match'); + } + const regenerated = split(bytes); + for (let i = 0; i < 3; i++) { + if (await fragmentDigest(m.encoding.encodingDigest, i, regenerated[i]) !== m.fragments.digests[i]) { + fail('InvalidParity', 'Complete fragment manifest is inconsistent with recovered bytes'); + } + } + return bytes; +} + +function id(value) { + if (typeof value !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,127}$/.test(value)) { + fail('InvalidSchema', 'Holder and request IDs must be bounded ASCII identifiers'); + } +} + +function index(value) { + if (!Number.isInteger(value) || value < 0 || value > 2) fail('InvalidSchema', 'Invalid fragment index'); +} + +function clock(value) { + if (!Number.isSafeInteger(value) || value < 0) fail('InvalidSchema', 'Expected an explicit nonnegative integer clock observation'); +} + +function observeClock(s, nowMs) { + if (nowMs < s.lastObservedMs) fail('ClockRegression', 'Placement clock observation regressed'); + s.lastObservedMs = nowMs; +} + +const liveCommitted = (s, nowMs) => s.copies.filter(c => c.status === 'committed' + && s.requests.find(r => r.requestId === c.requestId).leaseExpiresAt > nowMs); + +function stateSnapshot(state) { + const s = snapshotRecord(state); + exactKeys(s, ['version', 'manifest', 'revision', 'lastObservedMs', 'copies', 'requests'], 'placement'); + clock(s.lastObservedMs); + if (s.version !== 1 || !Number.isSafeInteger(s.revision) || s.revision < 0 || s.revision >= Number.MAX_SAFE_INTEGER) { + fail('InvalidPlacement', 'Invalid placement version or revision'); + } + if (!Array.isArray(s.requests) || s.requests.length > CUSTODY_LIMITS.maxRequests + || !Array.isArray(s.copies) || s.copies.length > CUSTODY_LIMITS.maxCopies) { + fail('CapacityLimit', 'Placement state exceeds its bounded capacity'); + } + const requests = new Map(); + for (const r of s.requests) { + exactKeys(r, ['requestId', 'index', 'holder', 'fromRequestId', 'status', 'leaseExpiresAt'], 'request'); + id(r.requestId); id(r.holder); index(r.index); + clock(r.leaseExpiresAt); + if (r.fromRequestId !== null) id(r.fromRequestId); + if (!['requested', 'acknowledged', 'committed', 'failed', 'uncertain'].includes(r.status) + || requests.has(r.requestId)) fail('InvalidPlacement', 'Invalid or duplicate request'); + requests.set(r.requestId, r); + } + for (const r of s.requests) { + if (r.fromRequestId !== null) { + const old = requests.get(r.fromRequestId); + if (!old || old.status !== 'committed' || old.index !== r.index || old.holder === r.holder) { + fail('InvalidPlacement', 'Invalid migration predecessor'); + } + } + } + const copyKeys = new Set(), activeIndices = new Set(), activeHolders = new Set(); + for (const c of s.copies) { + exactKeys(c, ['index', 'holder', 'requestId', 'status'], 'copy'); + id(c.holder); id(c.requestId); index(c.index); + const r = requests.get(c.requestId); + if (!r || r.index !== c.index || r.holder !== c.holder + || !['acknowledged', 'committed', 'superseded'].includes(c.status) + || (c.status === 'acknowledged' && r.status !== 'acknowledged') + || (c.status === 'committed' && r.status !== 'committed') + || (c.status === 'superseded' && !['committed', 'failed', 'uncertain'].includes(r.status))) { + fail('InvalidPlacement', 'Copy is inconsistent with request history'); + } + const key = `${c.holder}\0${c.index}`; + if (copyKeys.has(key)) fail('InvalidPlacement', 'Duplicate physical copy assertion'); + copyKeys.add(key); + if (c.status === 'committed') { + if (activeIndices.has(c.index) || activeHolders.has(c.holder)) fail('HolderConflict', 'Active fragments require distinct holders'); + activeIndices.add(c.index); activeHolders.add(c.holder); + } + } + for (const r of s.requests) { + if (r.status === 'acknowledged' && !s.copies.some(c => c.requestId === r.requestId && c.status === 'acknowledged')) { + fail('InvalidPlacement', 'Acknowledged request has no copy assertion'); + } + } + return s; +} + +async function checkedState(state) { + const s = stateSnapshot(state); + s.manifest = await verifyManifest(s.manifest); + return s; +} + +function finish(s) { + s.revision++; + // Enforce the same aggregate bound on outputs as on inputs. + return deepFreeze(stateSnapshot(s)); +} + +export async function createPlacement(manifest) { + return deepFreeze({ version: 1, manifest: await verifyManifest(manifest), revision: 0, lastObservedMs: 0, copies: [], requests: [] }); +} + +async function request(state, parameters, migration) { + const p = snapshotRecord(parameters); + exactKeys(p, ['requestId', 'index', 'holder', 'leaseExpiresAt'], 'placement request'); + id(p.requestId); id(p.holder); index(p.index); + clock(p.leaseExpiresAt); + const s = await checkedState(state); + if (s.requests.length >= CUSTODY_LIMITS.maxRequests) fail('CapacityLimit', 'Request history is full'); + if (s.requests.some(r => r.requestId === p.requestId)) fail('RequestConflict', 'Request IDs cannot be reused'); + if (s.requests.some(r => r.index === p.index && ['requested', 'acknowledged'].includes(r.status))) { + fail('RequestConflict', 'Fragment already has a pending request'); + } + const active = s.copies.filter(c => c.status === 'committed'); + const old = active.find(c => c.index === p.index); + if (migration ? !old : !!old) fail('InvalidTransition', migration ? 'Migration needs a committed source' : 'Fragment already committed; request a migration'); + if (active.some(c => c.holder === p.holder) + || s.copies.some(c => c.index === p.index && c.holder === p.holder && c.status !== 'superseded')) { + fail('HolderConflict', 'Target already holds an active fragment or this copy'); + } + s.requests.push({ ...p, fromRequestId: old?.requestId ?? null, status: 'requested' }); + return finish(s); +} + +export const requestPlacement = (state, parameters) => request(state, parameters, false); +export const requestMigration = (state, parameters) => request(state, parameters, true); + +/** + * Receipt = {requestId,index,holder,manifestDigest,fragmentDigest,leaseExpiresAt,bytes}. + * Host must separately authenticate peers if that is part of its policy. Bytes + * here prove only that this caller supplied a valid fragment, not remote storage. + */ +export async function acknowledgePlacement(state, receipt, nowMs) { + clock(nowMs); + if (!receipt || typeof receipt !== 'object' || Array.isArray(receipt) + || ![Object.prototype, null].includes(Object.getPrototypeOf(receipt))) fail('InvalidSchema', 'Invalid acknowledgement'); + const d = Object.getOwnPropertyDescriptors(receipt); + const keys = ['requestId', 'index', 'holder', 'manifestDigest', 'fragmentDigest', 'leaseExpiresAt', 'bytes']; + if (Reflect.ownKeys(receipt).length !== keys.length || keys.some(k => !d[k]?.enumerable || !Object.hasOwn(d[k], 'value'))) { + fail('InvalidSchema', 'Acknowledgement has missing or unknown fields'); + } + const p = snapshotRecord(Object.fromEntries(keys.filter(k => k !== 'bytes').map(k => [k, d[k].value]))); + const bytes = copyBytes(d.bytes.value, Math.ceil(CUSTODY_LIMITS.maxObjectBytes / 2)); + const s = await checkedState(state); + observeClock(s, nowMs); + const r = s.requests.find(r => r.requestId === p.requestId); + if (!r || r.status !== 'requested') fail('InvalidTransition', 'Only a requested transfer can be acknowledged'); + if (r.leaseExpiresAt <= nowMs) fail('InvalidTransition', 'Acknowledgement lease has expired'); + if (p.index !== r.index || p.holder !== r.holder || p.manifestDigest !== s.manifest.manifestDigest + || p.fragmentDigest !== s.manifest.fragments.digests[r.index] || p.leaseExpiresAt !== r.leaseExpiresAt) { + fail('ReceiptMismatch', 'Acknowledgement is not bound to this request'); + } + await verifyFragment(s.manifest, { index: p.index, bytes }); + // A fresh checked receipt for the same physical holder/index renews that + // assertion, not an additional copy. Until this check the old assertion stays. + s.copies = s.copies.filter(c => !(c.index === r.index && c.holder === r.holder && c.status === 'superseded')); + if (s.copies.length >= CUSTODY_LIMITS.maxCopies) fail('CapacityLimit', 'Too many retained copies'); + r.status = 'acknowledged'; + s.copies.push({ index: r.index, holder: r.holder, requestId: r.requestId, status: 'acknowledged' }); + return finish(s); +} + +/** Commit only a checked acknowledgement; retain the source until this point. */ +export async function commitPlacement(state, requestId, nowMs) { + id(requestId); + clock(nowMs); + const s = await checkedState(state); + observeClock(s, nowMs); + const r = s.requests.find(r => r.requestId === requestId); + if (!r || r.status !== 'acknowledged') fail('InvalidTransition', 'Commit requires an acknowledged transfer'); + const active = s.copies.filter(c => c.status === 'committed'); + const old = active.find(c => c.index === r.index); + if ((old?.requestId ?? null) !== r.fromRequestId) fail('StaleRequest', 'Migration source changed or was lost'); + if (active.some(c => c.holder === r.holder && c.index !== r.index)) fail('HolderConflict', 'Target holder is already committed to another fragment'); + const target = s.copies.find(c => c.requestId === r.requestId && c.status === 'acknowledged'); + if (!target) fail('InvalidTransition', 'Acknowledged target missing'); + if (!custodyCommitAllowed(true, r.status === 'acknowledged', true, true, + target.holder === r.holder, r.leaseExpiresAt > nowMs, + (old?.requestId ?? null) === r.fromRequestId + && (!old || s.requests.find(v => v.requestId === old.requestId).leaseExpiresAt > nowMs), + !active.some(c => c.holder === r.holder && c.index !== r.index))) { + fail('InvalidTransition', 'Generated model refused an expired or unsafe commitment'); + } + if (old) old.status = 'superseded'; + target.status = 'committed'; + r.status = 'committed'; + return finish(s); +} + +/** A failed/uncertain action never removes the old committed source. */ +export async function failPlacement(state, requestId, outcome = 'failed') { + id(requestId); + if (!['failed', 'uncertain'].includes(outcome)) fail('InvalidSchema', 'Outcome must be failed or uncertain'); + const s = await checkedState(state); + const r = s.requests.find(r => r.requestId === requestId); + if (!r || !['requested', 'acknowledged'].includes(r.status)) fail('InvalidTransition', 'Transfer is not pending'); + r.status = outcome; + const copy = s.copies.find(c => c.requestId === requestId); + if (copy) copy.status = 'superseded'; // may still occupy storage; do not hide it + return finish(s); +} + +/** + * Record local observation of holder loss. It is not proof of global death or + * deletion. Supersedes reachable assertions while retaining possible physical + * copies for accounting. Expired leases use this same conservative transition. + */ +export async function observeHolderLoss(state, holder) { + id(holder); + const s = await checkedState(state); + for (const c of s.copies) if (c.holder === holder) c.status = 'superseded'; + for (const r of s.requests) { + if (r.holder === holder && ['requested', 'acknowledged'].includes(r.status)) r.status = 'uncertain'; + } + return finish(s); +} + +/** + * Host-observed release of a superseded copy, only after at least two active + * distinct-holder fragments remain. Does not issue or prove remote deletion. + */ +export async function retirePlacement(state, parameters, nowMs) { + clock(nowMs); + const p = snapshotRecord(parameters); + exactKeys(p, ['index', 'holder'], 'retirement'); + index(p.index); id(p.holder); + const s = await checkedState(state); + observeClock(s, nowMs); + const target = s.copies.find(c => c.index === p.index && c.holder === p.holder); + if (!target || target.status !== 'superseded') fail('InvalidTransition', 'Only superseded copies may be retired'); + const active = liveCommitted(s, nowMs); + const remaining = new Set(active.map(c => c.index)).size; + if (!custodyRetireAllowed(active.some(c => c.index === target.index), remaining, 2)) { + fail('UnsafeMigration', 'Retirement requires two live active fragments on distinct holders'); + } + s.copies = s.copies.filter(c => c !== target); + return finish(s); +} + +/** Summary of local assertions, not a network availability or durability proof. */ +export function placementStatus(state, nowMs) { + clock(nowMs); + const s = stateSnapshot(state); + if (nowMs < s.lastObservedMs) fail('ClockRegression', 'Placement clock observation regressed'); + const active = liveCommitted(s, nowMs); + return Object.freeze({ + committedFragments: active.length, + distinctHolders: new Set(active.map(c => c.holder)).size, + canRecoverFromCommitted: active.length >= 2, + toleratesOneHolderLoss: active.length === 3, + acknowledgedTransfers: s.requests.filter(r => r.status === 'acknowledged').length, + requestedTransfers: s.requests.filter(r => r.status === 'requested').length, + uncertainTransfers: s.requests.filter(r => r.status === 'uncertain').length, + assertedCopies: s.copies.length, + assertedStoredBytes: s.copies.length * s.manifest.fragments.byteLength, + evidence: 'digest-checked-peer-assertions', + conditions: 'exact-encoding-and-truthful-reachable-holders', + }); +} diff --git a/src/layer3-storage/index.js b/src/layer3-storage/index.js index 33131e6..a0edca8 100644 --- a/src/layer3-storage/index.js +++ b/src/layer3-storage/index.js @@ -10,6 +10,10 @@ import { mintContentAddress, Fnv1aHasher16 } from '../layer1-uor/index.js'; import { computeSurvivalProbability } from '../layer2-schedulers/index.js'; +import { ResourceAdmission, reserveNetwork, wireBytes } from '../layer2-schedulers/policy.js'; +import { CustodyError, verifyManifest, verifyFragment, copyBytes, snapshotRecord, exactKeys } from '../layer1-uor/custody.js'; +import { model } from '../layer1-uor/generated-model.js'; +import { createObject, recoverObject, createPlacement, requestPlacement, requestMigration, acknowledgePlacement, commitPlacement, failPlacement, observeHolderLoss, retirePlacement, placementStatus } from './custody.js'; /** * Split a Uint8Array payload into k = 2 even-length data shards + 1 XOR parity shard (n = 3). @@ -415,218 +419,579 @@ export function benchmarkStorageStrategies({ } /** - * Live Network-Backed UOR Content-Addressed Database (`LiveUorMeshDatabase`). - * Wires Layer 1 (UOR addressing) + Layer 2 (refresh scheduler) + Layer 3 (2-of-3 XOR parity) - * directly over Layer 5 (`WebRtcTransportNode` + warm relay ring-buffer) and syncs recovered - * objects into the in-browser v86 Linux VM `/mnt` 9p filesystem. + * Live SHA-256-bound object adapter. Distinct fragment placement is explicit; + * retrieval is separate and only returns fragments actually assigned here. + * Receipts are peer assertions, not authenticated retention guarantees. Local + * writer/recovery caches and an opted-in public relay are additional copies. */ export class LiveUorMeshDatabase { - /** - * @param {object} params - * @param {import('../layer5-transport/index.js').WebRtcTransportNode} params.transport - * @param {object} [params.scheduler] - Layer-2 scheduler instance - * @param {(ev: object) => void} [params.onUpdate] - * @param {object} [params.vmBridge] - Optional LinuxVmNode to mirror UOR blocks into `/mnt/` - */ - constructor({ transport, scheduler = null, onUpdate = () => {}, vmBridge = null }) { + constructor({ transport, scheduler = null, onUpdate = () => {}, vmBridge = null, admission = transport?.admission ?? new ResourceAdmission() }) { this.transport = transport; this.scheduler = scheduler; + this.admission = admission; this.onUpdate = onUpdate; this.vmBridge = vmBridge; - - /** - * addressHex -> { - * addressHex: string, - * fingerprintHex: string, - * originalLength: number, - * label: string, - * createdAtSec: number, - * shards: [Uint8Array | null, Uint8Array | null, Uint8Array | null], - * bytes: Uint8Array | null, - * verified: boolean, - * source: string - * } - */ this.objects = new Map(); + this.placements = new Map(); + this.pendingTransfers = new Map(); + this.pendingReleases = new Map(); + this.committedRoutes = new Map(); this.replicationsSent = 0; this.replicationsReceived = 0; this.warmRecoveries = 0; + this._sequence = 0; + this._mailbox = Promise.resolve(); + this._pendingWork = 0; + this.maxPendingWork = 256; + this.maxWireObjectBytes = 128 * 1024; + this.maxCachedBytes = 16 * 1024 * 1024; + this.maxObjects = 128; + this.releaseAckTimeoutMs = 15000; // local observation bound, never proof of remote deletion + this.demoPlacementLeaseMs = 60000; // declared host policy, not a retention guarantee + this.maxAcceptedLeaseMs = 120000; // bounded host policy for incoming assertions } - /** - * Handle incoming mesh messages from `WebRtcTransportNode`. - */ - async handleMeshMessage(fromPeerId, msg) { - if (!msg) return; - - if (msg.type === 'uor_shard') { - await this.ingestShardEnvelope(msg, `webrtc:${fromPeerId}`); - } else if (msg.type === 'uor_sync_req') { - // Newly joined peer requested all current UOR objects - for (const entry of this.objects.values()) { - if (!entry.bytes) continue; - const { shards } = encodeXorShards2of3(entry.bytes); - for (let sIdx = 0; sIdx < 3; sIdx++) { - this.transport.sendToPeer(fromPeerId, { - type: 'uor_shard', - addressHex: entry.addressHex, - fingerprintHex: entry.fingerprintHex, - originalLength: entry.originalLength, - label: entry.label, - shardIndex: sIdx, - shardBytes: Array.from(shards[sIdx]) - }); - this.replicationsSent++; - } - } + _enqueue(work) { + if (this._pendingWork >= this.maxPendingWork) return Promise.reject(new CustodyError('CapacityLimit', 'Ingress mailbox is full')); + this._pendingWork++; + const result = this._mailbox.then(work).finally(() => { this._pendingWork--; }); + this._mailbox = result.catch(() => {}); + return result; + } + + /** Useful to await all messages accepted by a fake transport in tests. */ + async flush() { await this._mailbox; } + + _reject(reason) { + this.onUpdate({ type: 'custody_rejected', reason: reason?.code || String(reason) }); + return false; + } + + _checkCapacity(key, addedBytes) { + if (!this.objects.has(key) && this.objects.size >= this.maxObjects) throw new CustodyError('CapacityLimit', 'Object cache is full'); + let stored = 0; + for (const pending of this.pendingTransfers.values()) stored += pending.bytes.length; + for (const e of this.objects.values()) { + stored += e.bytes?.length || 0; + for (const shard of e.shards) stored += shard?.length || 0; } + if (stored + addedBytes > this.maxCachedBytes) throw new CustodyError('CapacityLimit', 'Object byte cache is full'); } - async ingestShardEnvelope(env, sourceTag = 'remote') { - const { - addressHex, - fingerprintHex, - originalLength, - label = '', - shardIndex, - shardBytes - } = env; + _send(holder, packet) { + if (this.transport.admission !== this.admission) reserveNetwork(this.admission, 'place', packet); + return this.transport.sendToPeer(holder, packet); + } - if (!addressHex || typeof shardIndex !== 'number' || !Array.isArray(shardBytes)) { - return false; + _broadcast(packet) { + if (this.transport.admission !== this.admission) reserveNetwork(this.admission, 'retrieve', packet, (this.transport.openPeers?.() || []).length); + return this.transport.broadcast(packet); + } + + _publish(packet) { + if (this.transport.admission !== this.admission) reserveNetwork(this.admission, 'place', { ...packet, from: (this.transport.routingPeerId ?? this.transport.peerId), tsMs: Date.now() }); + return this.transport.publishWarmEnvelope(packet, { publicData: true }); + } + + _fetch(sinceWindow) { + if (this.transport.admission !== this.admission) this.admission.reserve('retrieve', { requests: 1, transferBytes: 2 * 1024 * 1024 }); + return this.transport.fetchWarmEnvelopes(sinceWindow, { publicData: true }); + } + + clearLocal() { + return this._enqueue(() => { + this.objects.clear(); this.placements.clear(); this.pendingTransfers.clear(); this.pendingReleases.clear(); this.committedRoutes.clear(); + // A wipe does not refund unknown remote effects or reset policy. + }); + } + + _label(label) { + if (typeof label !== 'string' || label.length > 256 || /[\u0000-\u001f\u007f/\\]/.test(label)) { + throw new CustodyError('InvalidSchema', 'Label must be bounded plain text without path separators'); } + return label; + } - let entry = this.objects.get(addressHex); + _packet(entry, index, bytes, { purpose = 'recovery', requestId = null, holder = null, leaseExpiresAt = 0 } = {}) { + return { + type: 'uor_shard', version: 1, manifest: entry.manifest, label: entry.label, + shardIndex: index, shardBytes: Array.from(bytes), purpose, requestId, holder, leaseExpiresAt, + }; + } + + _readPacket(env) { + if (!env || typeof env !== 'object' || Array.isArray(env) + || ![Object.prototype, null].includes(Object.getPrototypeOf(env))) throw new CustodyError('InvalidSchema'); + const d = Object.getOwnPropertyDescriptors(env); + const keys = ['type', 'version', 'manifest', 'label', 'shardIndex', 'shardBytes', 'purpose', 'requestId', 'holder', 'leaseExpiresAt']; + if (Reflect.ownKeys(env).length !== keys.length || keys.some(k => !d[k]?.enumerable || !Object.hasOwn(d[k], 'value'))) { + throw new CustodyError('InvalidSchema', 'Legacy or malformed fragment envelope'); + } + const p = snapshotRecord(Object.fromEntries(keys.filter(k => k !== 'shardBytes').map(k => [k, d[k].value]))); + if (p.type !== 'uor_shard' || p.version !== 1 || !['placement', 'recovery', 'public-relay'].includes(p.purpose) + || !Number.isInteger(p.shardIndex) || p.shardIndex < 0 || p.shardIndex > 2 + || !Number.isSafeInteger(p.leaseExpiresAt) || p.leaseExpiresAt < 0) throw new CustodyError('InvalidSchema'); + this._label(p.label); + const a = d.shardBytes.value; + if (!Array.isArray(a) || Object.getPrototypeOf(a) !== Array.prototype || a.length > this.maxWireObjectBytes / 2 + || Reflect.ownKeys(a).length !== a.length + 1) throw new CustodyError('SizeLimit', 'Invalid or oversized fragment bytes'); + const bytes = new Uint8Array(a.length); + for (let i = 0; i < a.length; i++) { + const byte = Object.getOwnPropertyDescriptor(a, String(i)); + if (!byte || !Object.hasOwn(byte, 'value') || !Number.isInteger(byte.value) || byte.value < 0 || byte.value > 255) { + throw new CustodyError('InvalidBytes', 'Wire bytes must be integers from zero through 255'); + } + bytes[i] = byte.value; + } + if (p.purpose === 'placement') { + if (typeof p.requestId !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,127}$/.test(p.requestId) + || p.holder !== (this.transport.routingPeerId ?? this.transport.peerId) || p.leaseExpiresAt <= Date.now() + || p.leaseExpiresAt > Date.now() + this.maxAcceptedLeaseMs) throw new CustodyError('InvalidSchema', 'Wrong holder or invalid lease claim'); + } else if (p.requestId !== null || p.leaseExpiresAt !== 0 + || (p.purpose === 'public-relay' ? p.holder !== 'public-relay' : p.holder !== null)) { + throw new CustodyError('InvalidSchema', 'Invalid retrieval metadata'); + } + return { ...p, bytes }; + } + + _snapshotEnvelope(env, publicData = false) { + // ntfy transport appends these two unauthenticated delivery metadata fields. + // They are never part of an object's commitment or used as peer authority. + if (publicData && env && (Object.hasOwn(env, 'from') || Object.hasOwn(env, 'tsMs'))) { + const d = Object.getOwnPropertyDescriptors(env); + if (!d.from?.enumerable || !d.tsMs?.enumerable || !Object.hasOwn(d.from, 'value') || !Object.hasOwn(d.tsMs, 'value') + || typeof d.from.value !== 'string' || d.from.value.length > 128 + || !Number.isSafeInteger(d.tsMs.value) || d.tsMs.value < 0) throw new CustodyError('InvalidSchema', 'Invalid relay metadata'); + const keys = Reflect.ownKeys(env).filter(k => k !== 'from' && k !== 'tsMs'); + if (keys.some(k => typeof k !== 'string' || !d[k].enumerable || !Object.hasOwn(d[k], 'value'))) throw new CustodyError('InvalidSchema'); + env = Object.fromEntries(keys.map(k => [k, d[k].value])); + } + const p = this._readPacket(env); + return this._packet(p, p.shardIndex, p.bytes, p); + } + + async _ingest(env, sourceTag, fromPeerId = null, publicData = false) { + const p = this._readPacket(env); + if (p.purpose === 'public-relay' && !publicData) throw new CustodyError('PublicDataRequired', 'Public relay access requires opt-in'); + if (p.purpose === 'placement' && !fromPeerId) throw new CustodyError('InvalidSchema', 'Placement must arrive through a peer channel'); + const manifest = await verifyManifest(p.manifest); + if (manifest.object.byteLength > this.maxWireObjectBytes) throw new CustodyError('SizeLimit', 'Object exceeds live wire limit'); + const f = await verifyFragment(manifest, { index: p.shardIndex, bytes: p.bytes }); + const key = manifest.object.contentDigest; + let entry = this.objects.get(key); + if (entry && entry.manifest.manifestDigest !== manifest.manifestDigest) throw new CustodyError('ManifestDigestMismatch', 'Conflicting manifest for object'); + const added = entry?.shards[f.index] ? 0 : f.bytes.length; + this._checkCapacity(key, added); if (!entry) { entry = { - addressHex, - fingerprintHex, - originalLength, - label, - createdAtSec: Math.floor(Date.now() / 1000), - shards: [null, null, null], - bytes: null, - verified: false, - source: sourceTag + addressHex: key, fingerprintHex: key, manifest, originalLength: manifest.object.byteLength, + label: p.label, createdAtSec: Math.floor(Date.now() / 1000), shards: [null, null, null], + heldIndices: new Set(), bytes: null, verified: false, source: sourceTag, }; - this.objects.set(addressHex, entry); - } - - entry.shards[shardIndex] = new Uint8Array(shardBytes); - this.replicationsReceived++; - - if (!entry.verified) { - const candidateBytes = decodeXorShards2of3(entry.originalLength, entry.shards); - if (candidateBytes) { - const { address, fingerprint } = mintContentAddress(candidateBytes, Fnv1aHasher16); - if (address.toHex() === addressHex && fingerprint.toHex() === fingerprintHex) { - entry.bytes = candidateBytes; - entry.verified = true; - entry.source = sourceTag; - // Regenerate all 3 parity shards now that object is verified - entry.shards = encodeXorShards2of3(candidateBytes).shards; - if (this.vmBridge) { - await this.vmBridge.mountUorObject(addressHex, candidateBytes, label); + } + if (!entry.shards[f.index]) { + this.admission.reserve('place', { storageBytes: f.bytes.length }); + this.objects.set(key, entry); + entry.shards[f.index] = f.bytes; + this.replicationsReceived++; + } + if (p.purpose === 'placement') { + entry.heldPlacements ??= new Map(); + const claimKey = `${fromPeerId}\0${f.index}`; + if (!entry.heldPlacements.has(claimKey) && entry.heldPlacements.size >= 256) throw new CustodyError('CapacityLimit', 'Holder claim history is full'); + entry.heldPlacements.set(claimKey, { requestId: p.requestId, index: f.index, status: 'held' }); + entry.heldIndices.add(f.index); + // The return channel associates the assertion with this connected peer; + // no application-authority or persistent-storage authentication is claimed. + this._send(fromPeerId, { + type: 'uor_shard_ack', version: 1, requestId: p.requestId, index: f.index, + holder: (this.transport.routingPeerId ?? this.transport.peerId), manifestDigest: manifest.manifestDigest, + fragmentDigest: manifest.fragments.digests[f.index], leaseExpiresAt: p.leaseExpiresAt, + }); + } + let newlyVerified = false; + if (!entry.verified && entry.shards.filter(Boolean).length >= 2) { + const available = entry.shards.flatMap((bytes, index) => bytes ? [{ index, bytes }] : []); + this.admission.reserve('retrieve', { storageBytes: manifest.object.byteLength }); + const recovered = await recoverObject(manifest, available); + this._checkCapacity(key, recovered.length); + entry.bytes = recovered; + entry.verified = true; + entry.source = sourceTag; + newlyVerified = true; + if (this.vmBridge) await this.vmBridge.mountUorObject(key, new Uint8Array(recovered), entry.label); + this.onUpdate({ type: 'object_verified', entry }); + } + this.onUpdate({ type: 'shard_ingested', addressHex: key, shardIndex: f.index, sourceTag }); + return newlyVerified; + } + + ingestShardEnvelope(env, sourceTag = 'remote', { publicData = false } = {}) { + try { env = this._snapshotEnvelope(env, publicData); } + catch (error) { return Promise.resolve(this._reject(error)); } + return this._enqueue(async () => { + try { return await this._ingest(env, sourceTag, null, publicData); } + catch (error) { return this._reject(error); } + }); + } + + handleMeshMessage(fromPeerId, msg) { + try { + const type = Object.getOwnPropertyDescriptor(msg ?? {}, 'type')?.value; + msg = type === 'uor_shard' ? this._snapshotEnvelope(msg) : snapshotRecord(msg); + } catch (error) { return Promise.resolve(this._reject(error)); } + return this._enqueue(async () => { + try { + if (!msg || typeof msg !== 'object') return false; + if (msg.type === 'uor_shard') return await this._ingest(msg, `webrtc:${fromPeerId}`, fromPeerId); + if (msg.type === 'uor_shard_ack') return await this._acknowledge(fromPeerId, msg); + if (msg.type === 'uor_shard_release') return await this._releaseHeld(fromPeerId, msg); + if (msg.type === 'uor_shard_release_ack') return await this._acknowledgeRelease(fromPeerId, msg); + if (msg.type === 'uor_sync_req') { + const p = snapshotRecord(msg); + exactKeys(p, ['type', 'version']); + if (p.version !== 1) throw new CustodyError('InvalidSchema'); + for (const entry of this.objects.values()) { + // Retrieval returns assigned fragments only, never regenerates and + // broadcasts all 3 fragments from a writer's full-object cache. + for (const index of entry.heldIndices) { + if (entry.shards[index] && this._send(fromPeerId, this._packet(entry, index, entry.shards[index]))) this.replicationsSent++; + } } - this.onUpdate({ type: 'object_verified', entry }); return true; } - } + return false; + } catch (error) { return this._reject(error); } + }); + } + + _openRoutes() { + const local = this.transport.routingPeerId ?? this.transport.peerId; + return new Map((this.transport.openPeers?.() || []).filter(p => typeof p.remoteId === 'string' + && /^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,127}$/.test(p.remoteId) && p.remoteId !== local) + .sort((a, b) => a.remoteId.localeCompare(b.remoteId)).slice(0, 64) + .map(p => [p.remoteId, p.dc ?? p.pc ?? p.remoteId])); + } + + _reservationCurrent(pending) { + return Boolean(this.admission.reservationCurrent?.(pending.reservationId, pending.epoch)) + && (pending.networkReservationIds ?? []).every(id => this.admission.reservationCurrent(id, pending.epoch)); + } + + _sendReserved(holder, packet, pending) { + const before = this.admission.state; + const sent = this._send(holder, packet); + if (!sent) return false; + const after = this.admission.state; + // The synchronous transport admission belongs to this exact dispatch. Bind + // its real frame/envelope reservation, not merely an unrelated spare budget. + const reservations = after.reservations.slice(before.reservations.length); + if (after.epoch !== pending.epoch || !reservations.some(r => r.status === 'reserved' + && r.cost.requests >= 1 && r.cost.transferBytes >= wireBytes(packet))) { + throw new CustodyError('StaleRequest', 'Transport did not retain this dispatch reservation'); } - this.onUpdate({ type: 'shard_ingested', addressHex, shardIndex, sourceTag }); - return false; + pending.networkReservationIds = reservations.map(r => r.id); + return true; } - /** - * Store a byte payload or UTF-8 string into the live distributed UOR mesh database, - * split into 2-of-3 XOR parity shards, replicate over WebRTC, and publish to warm relay buffer. - */ - async put(payload, { label = 'data', persistWarm = true } = {}) { - const bytes = payload instanceof Uint8Array - ? payload - : new TextEncoder().encode(String(payload)); - - const { address, fingerprint } = mintContentAddress(bytes, Fnv1aHasher16); - const addressHex = address.toHex(); - const fingerprintHex = fingerprint.toHex(); - const { originalLength, shards } = encodeXorShards2of3(bytes); - - const entry = { - addressHex, - fingerprintHex, - originalLength, - label, - createdAtSec: Math.floor(Date.now() / 1000), - shards, - bytes: new Uint8Array(bytes), - verified: true, - source: `local:${this.transport.peerId}` - }; - this.objects.set(addressHex, entry); + _activationCurrent(pending, state, nowMs) { + const request = state.requests.find(r => r.requestId === pending.requestId); + const routes = this._openRoutes(); + const source = request?.fromRequestId == null ? null : state.copies.find(c => c.requestId === request.fromRequestId && c.status === 'committed'); + const sourceCurrent = request?.fromRequestId == null || Boolean(source + && state.requests.find(r => r.requestId === source.requestId).leaseExpiresAt > nowMs + && routes.has(source.holder) && routes.get(source.holder) === this.committedRoutes.get(source.requestId)); + return model['Stitch.Custody.activationAllowed']( + sourceCurrent && state.manifest.manifestDigest === pending.manifestDigest && request?.holder === pending.holder + && request?.index === pending.index && request?.leaseExpiresAt === pending.leaseExpiresAt, + this._reservationCurrent(pending), pending.leaseExpiresAt > nowMs, + routes.has(pending.holder) && routes.get(pending.holder) === pending.route); + } + + /** Current local route/lease observations, never a durability guarantee. */ + placementSummary(addressHex, nowMs = Date.now()) { + const state = this.placements.get(addressHex); + if (!state) return null; + const status = placementStatus(state, nowMs), routes = this._openRoutes(); + const active = state.copies.filter(c => c.status === 'committed' + && state.requests.find(r => r.requestId === c.requestId).leaseExpiresAt > nowMs + && routes.get(c.holder) === this.committedRoutes.get(c.requestId) && routes.has(c.holder)); + return { ...status, leaseQualifiedFragments: status.committedFragments, + committedFragments: active.length, distinctHolders: new Set(active.map(c => c.holder)).size, + canRecoverFromCommitted: active.length >= 2, toleratesOneHolderLoss: active.length === 3, + pendingReleases: [...this.pendingReleases.values()].filter(p => p.addressHex === addressHex).length }; + } - if (this.vmBridge) { - await this.vmBridge.mountUorObject(addressHex, bytes, label); + async _abandonTransfer(pending) { + const state = this.placements.get(pending.addressHex); + const request = state?.requests.find(r => r.requestId === pending.requestId); + if (request && ['requested', 'acknowledged'].includes(request.status)) { + this.placements.set(pending.addressHex, await failPlacement(state, pending.requestId, 'uncertain')); } + this.pendingTransfers.delete(pending.requestId); + // Neither an absent ACK nor expiry establishes remote deletion or a refund. + } - // Replicate all 3 XOR parity shards across connected WebRTC peers - for (let sIdx = 0; sIdx < 3; sIdx++) { - const shardPacket = { - type: 'uor_shard', - addressHex, - fingerprintHex, - originalLength, - label, - shardIndex: sIdx, - shardBytes: Array.from(shards[sIdx]) - }; - const sent = this.transport.broadcast(shardPacket); - this.replicationsSent += sent; + async _acknowledge(fromPeerId, message) { + const ack = snapshotRecord(message); + exactKeys(ack, ['type', 'version', 'requestId', 'index', 'holder', 'manifestDigest', 'fragmentDigest', 'leaseExpiresAt']); + if (ack.version !== 1 || ack.holder !== fromPeerId) throw new CustodyError('ReceiptMismatch'); + const pending = this.pendingTransfers.get(ack.requestId); + if (!pending || pending.holder !== fromPeerId) throw new CustodyError('ReceiptMismatch', 'Unknown or replayed acknowledgement'); + let state = this.placements.get(pending.addressHex); + if (!this._activationCurrent(pending, state, Date.now())) { + await this._abandonTransfer(pending); + throw new CustodyError('StaleRequest', 'Placement route, lease or reservation is no longer current'); + } + const { type, version, ...receipt } = ack; + state = await acknowledgePlacement(state, { ...receipt, bytes: pending.bytes }, Date.now()); + this.placements.set(pending.addressHex, state); + // Crypto checks can yield past an epoch, route replacement or lease boundary. + if (!this._activationCurrent(pending, state, Date.now())) { + await this._abandonTransfer(pending); + throw new CustodyError('StaleRequest', 'Placement changed during receipt verification'); + } + const acknowledgedState = state; + try { state = await commitPlacement(state, ack.requestId, Date.now()); } + catch (error) { await this._abandonTransfer(pending); throw error; } + if (!this._activationCurrent(pending, acknowledgedState, Date.now())) { + // Do not publish a tentative state after an asynchronous boundary. + await this._abandonTransfer(pending); + throw new CustodyError('StaleRequest'); + } + this.placements.set(pending.addressHex, state); + this.committedRoutes.set(ack.requestId, pending.route); + this.pendingTransfers.delete(ack.requestId); + const entry = this.objects.get(pending.addressHex); + entry.placementStatus = this.placementSummary(pending.addressHex); + this.onUpdate({ type: 'placement_committed', entry, holder: fromPeerId, shardIndex: ack.index }); + await this._releaseSuperseded(entry); + return true; + } - // Also push shards 0 and 1 (sufficient for 2-of-3 reconstruction) to warm relay cache - // so state survives even if all browser tabs close simultaneously (0 live peers) - if (persistWarm && sIdx < 2 && bytes.length <= 2048) { - await this.transport.publishWarmEnvelope(shardPacket); - } + /** Release only the exact sender's retained assignment, never a newer claim. */ + async _releaseHeld(fromPeerId, message) { + exactKeys(message, ['type', 'version', 'releaseId', 'requestId', 'index', 'holder', 'manifestDigest']); + const { releaseId, requestId, index, holder, manifestDigest } = message; + if (message.version !== 1 || holder !== (this.transport.routingPeerId ?? this.transport.peerId) + || !Number.isInteger(index) || index < 0 || index > 2 + || ![releaseId, requestId].every(id => typeof id === 'string' && /^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,127}$/.test(id))) throw new CustodyError('InvalidSchema'); + const entry = [...this.objects.values()].find(e => e.manifest.manifestDigest === manifestDigest); + const claim = entry?.heldPlacements?.get(`${fromPeerId}\0${index}`); + if (!claim || claim.requestId !== requestId) throw new CustodyError('ReceiptMismatch', 'Release does not match the current assignment'); + claim.status = 'released'; // retained tombstone makes exact retries idempotent + if (![...entry.heldPlacements.values()].some(c => c.index === index && c.status === 'held')) { + entry.heldIndices.delete(index); + entry.shards[index] = null; } + this._send(fromPeerId, { ...message, type: 'uor_shard_release_ack' }); + this.onUpdate({ type: 'placement_released', entry, shardIndex: index }); + return true; + } - if (this.scheduler) { - this.scheduler.markRefreshed(Date.now() / 1000); + async _acknowledgeRelease(fromPeerId, message) { + exactKeys(message, ['type', 'version', 'releaseId', 'requestId', 'index', 'holder', 'manifestDigest']); + const pending = this.pendingReleases.get(message.releaseId); + if (!pending || message.version !== 1 || message.holder !== fromPeerId + || pending.holder !== fromPeerId || pending.requestId !== message.requestId || pending.index !== message.index + || pending.manifestDigest !== message.manifestDigest) throw new CustodyError('ReceiptMismatch'); + if (!this._reservationCurrent(pending) || pending.expiresAt <= Date.now() || this._openRoutes().get(fromPeerId) !== pending.route) throw new CustodyError('StaleRequest'); + if (!this.placements.get(pending.addressHex).copies.some(c => c.status === 'superseded' && c.requestId === pending.requestId + && c.holder === pending.holder && c.index === pending.index)) throw new CustodyError('StaleRequest'); + if (!this.placementSummary(pending.addressHex).canRecoverFromCommitted) throw new CustodyError('UnsafeMigration'); + const state = await retirePlacement(this.placements.get(pending.addressHex), { index: pending.index, holder: fromPeerId }, Date.now()); + if (!this._reservationCurrent(pending) || pending.expiresAt <= Date.now() || this._openRoutes().get(fromPeerId) !== pending.route + || !this.placementSummary(pending.addressHex).canRecoverFromCommitted) throw new CustodyError('StaleRequest'); + this.placements.set(pending.addressHex, state); + this.pendingReleases.delete(message.releaseId); + this.committedRoutes.delete(message.requestId); + const entry = this.objects.get(pending.addressHex); + entry.placementStatus = this.placementSummary(pending.addressHex); + this.onUpdate({ type: 'placement_retired', entry, holder: fromPeerId, shardIndex: pending.index }); + return true; + } + + async _releaseSuperseded(entry) { + if (!this.placementSummary(entry.addressHex)?.canRecoverFromCommitted) return; + const routes = this._openRoutes(), state = this.placements.get(entry.addressHex); + for (const [id, pending] of this.pendingReleases) { + if (!this._reservationCurrent(pending) || pending.expiresAt <= Date.now() || routes.get(pending.holder) !== pending.route) this.pendingReleases.delete(id); + } + for (const copy of state.copies.filter(c => c.status === 'superseded')) { + const replacement = state.copies.find(c => c.index === copy.index && c.status === 'committed'); + if (!replacement || state.requests.find(r => r.requestId === replacement.requestId).leaseExpiresAt <= Date.now() + || !routes.has(replacement.holder) || routes.get(replacement.holder) !== this.committedRoutes.get(replacement.requestId)) continue; + if (!routes.has(copy.holder) || state.requests.some(r => r.index === copy.index && r.holder === copy.holder + && ['requested', 'acknowledged'].includes(r.status)) + || [...this.pendingReleases.values()].some(p => p.addressHex === entry.addressHex && p.requestId === copy.requestId)) continue; + const releaseId = `release-${++this._sequence}`; + const packet = { type: 'uor_shard_release', version: 1, releaseId, requestId: copy.requestId, + index: copy.index, holder: copy.holder, manifestDigest: entry.manifest.manifestDigest }; + try { + const reservationId = this.admission.reserve('repair'); + const pending = { ...packet, addressHex: entry.addressHex, route: routes.get(copy.holder), + reservationId, epoch: this.admission.state.epoch, expiresAt: Date.now() + this.releaseAckTimeoutMs }; + this.pendingReleases.set(releaseId, pending); + if (!this._sendReserved(copy.holder, packet, pending)) this.pendingReleases.delete(releaseId); + } catch { this.pendingReleases.delete(releaseId); } } + } - this.onUpdate({ type: 'object_put', entry }); - return entry; + /** Explicit maintenance for one exact locally retained object, never a relay write. */ + repairPlacement(addressHex, { replaceHolder = null } = {}) { + return this._enqueue(async () => { + const entry = this.objects.get(addressHex); + if (!entry?.verified || !entry.bytes) throw new CustodyError('MissingObject', 'Repair needs exact verified bytes retained in this tab'); + if (replaceHolder !== null && (typeof replaceHolder !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,127}$/.test(replaceHolder))) throw new CustodyError('InvalidSchema'); + this.admission.reserve('repair', { storageBytes: 3 * Math.ceil(entry.bytes.length / 2) }); + const bundle = await createObject(entry.bytes); + if (bundle.manifest.manifestDigest !== entry.manifest.manifestDigest) throw new CustodyError('ManifestDigestMismatch'); + return this._repairPlacement(entry, bundle.fragments, replaceHolder); + }); } - get(addressHex) { - const entry = this.objects.get(addressHex); - if (!entry || !entry.verified || !entry.bytes) { - return { ok: false, bytes: null, text: null, entry: null }; + async _repairPlacement(entry, fragments, replaceHolder = null) { + const key = entry.addressHex, nowMs = Date.now(), routes = this._openRoutes(); + let state = this.placements.get(key) ?? await createPlacement(entry.manifest); + this.placements.set(key, state); + placementStatus(state, nowMs); // clock regression refuses before any dispatch + let replacementUnavailable = false; + for (const pending of [...this.pendingTransfers.values()].filter(p => p.addressHex === key)) { + if (!this._activationCurrent(pending, state, nowMs)) await this._abandonTransfer(pending); } - return { - ok: true, - bytes: entry.bytes, - text: new TextDecoder().decode(entry.bytes), - entry - }; + state = this.placements.get(key); + for (const copy of state.copies.filter(c => c.status === 'committed')) { + const request = state.requests.find(r => r.requestId === copy.requestId); + if (request.leaseExpiresAt <= nowMs || !routes.has(copy.holder) + || routes.get(copy.holder) !== this.committedRoutes.get(copy.requestId)) { + state = await observeHolderLoss(state, copy.holder); + this.placements.set(key, state); + } + } + for (let index = 0; index < 3; index++) { + const active = state.copies.filter(c => c.status === 'committed'); + const old = active.find(c => c.index === index); + if ((old && old.holder !== replaceHolder) || state.requests.some(r => r.index === index + && ['requested', 'acknowledged'].includes(r.status))) continue; + const occupied = new Set([...active.map(c => c.holder), ...state.requests.filter(r => + ['requested', 'acknowledged'].includes(r.status)).map(r => r.holder)]); + const holder = [...routes.keys()].find(id => !occupied.has(id)); + if (!holder) { if (old) replacementUnavailable = true; continue; } + const requestId = `placement-${++this._sequence}`, leaseExpiresAt = Date.now() + this.demoPlacementLeaseMs; + const parameters = { requestId, index, holder, leaseExpiresAt }; + state = await (old ? requestMigration : requestPlacement)(state, parameters); + this.placements.set(key, state); + let sent = false, outcome = 'failed'; + try { + this._checkCapacity(key, fragments[index].bytes.length); + const reservationId = this.admission.reserve('repair', { storageBytes: fragments[index].bytes.length }); + const pending = { addressHex: key, requestId, index, holder, leaseExpiresAt, + manifestDigest: entry.manifest.manifestDigest, bytes: fragments[index].bytes, + route: routes.get(holder), reservationId, epoch: this.admission.state.epoch }; + this.pendingTransfers.set(requestId, pending); + if (!this._activationCurrent(pending, state, Date.now())) throw new CustodyError('StaleRequest'); + sent = this._sendReserved(holder, this._packet(entry, index, fragments[index].bytes, { purpose: 'placement', requestId, holder, leaseExpiresAt }), pending); + } catch { outcome = 'uncertain'; } + if (sent) this.replicationsSent++; + else { + state = await failPlacement(state, requestId, outcome); + this.placements.set(key, state); + this.pendingTransfers.delete(requestId); + } + } + await this._releaseSuperseded(entry); + entry.placementStatus = this.placementSummary(key); + this.onUpdate({ type: 'placement_repair_requested', entry }); + return { ...entry.placementStatus, replacementUnavailable }; } - /** - * Request full shard synchronization from currently connected WebRTC peers - * AND poll the warm relay ring-buffer to recover objects after a 0-peer gap. - */ - async syncFromNetwork(sinceWindow = '30m') { - this.transport.broadcast({ type: 'uor_sync_req', from: this.transport.peerId }); - const envelopes = await this.transport.fetchWarmEnvelopes(sinceWindow); - let recovered = 0; - for (const env of envelopes) { - if (env && env.type === 'uor_shard') { - const newlyVerified = await this.ingestShardEnvelope(env, `warm-relay:${env.from || 'cache'}`); - if (newlyVerified) { - this.warmRecoveries++; - recovered++; + /** Defaults never transmit bytes to a public relay. */ + put(payload, { label = 'data', persistWarm = false, publicData = false } = {}) { + // Snapshot caller-owned bytes before queueing or yielding. + try { + if (typeof payload === 'string' && payload.length > this.maxWireObjectBytes) throw new CustodyError('SizeLimit'); + if (payload instanceof Uint8Array) payload = copyBytes(payload, this.maxWireObjectBytes); + } + catch (error) { return Promise.reject(error); } + return this._enqueue(async () => { + if (persistWarm && !publicData) throw new CustodyError('PublicDataRequired', 'Public warm relay needs explicit publicData:true'); + this._label(label); + if (typeof persistWarm !== 'boolean' || typeof publicData !== 'boolean') throw new CustodyError('InvalidSchema', 'Relay options must be explicit booleans'); + if (typeof payload === 'string' && payload.length > this.maxWireObjectBytes) throw new CustodyError('SizeLimit', 'Payload exceeds live wire limit'); + const bytes = payload instanceof Uint8Array ? copyBytes(payload, this.maxWireObjectBytes) + : typeof payload === 'string' ? new TextEncoder().encode(payload) : null; + if (!bytes) throw new CustodyError('InvalidBytes', 'Payload must be bytes or text'); + if (bytes.length > this.maxWireObjectBytes) throw new CustodyError('SizeLimit', 'Payload exceeds live wire limit'); + // Reserve the new local bytes and conservative fragment allocation ceiling + // before encoding or any placement/relay/VM effect. + this.admission.reserve('place', { storageBytes: bytes.length + 3 * Math.ceil(bytes.length / 2) }); + const { manifest, fragments } = await createObject(bytes); + const key = manifest.object.contentDigest; + const existing = this.objects.get(key); + if (existing && existing.manifest.manifestDigest !== manifest.manifestDigest) { + throw new CustodyError('ManifestDigestMismatch', 'Conflicting cached manifest for object'); + } + if (existing?.verified && this.placements.has(key)) { + this._checkCapacity(key, existing.bytes ? 0 : bytes.length); + existing.bytes = bytes; // the caller supplied a new complete checked copy + await this._repairPlacement(existing, fragments); + if (persistWarm) { + for (const f of fragments.slice(0, 2)) { + if (await this._publish(this._packet(existing, f.index, f.bytes, { purpose: 'public-relay', holder: 'public-relay' }))) existing.warmPublished = (existing.warmPublished || 0) + 1; + } } + return existing; } - } - return recovered; + this._checkCapacity(key, existing?.bytes ? 0 : bytes.length); + const entry = existing || { + addressHex: key, fingerprintHex: key, manifest, originalLength: bytes.length, label, + createdAtSec: Math.floor(Date.now() / 1000), shards: [null, null, null], heldIndices: new Set(), + bytes, verified: true, source: `local:${(this.transport.routingPeerId ?? this.transport.peerId)}`, warmPublished: 0, + }; + // A caller supplying complete bytes may promote a prior fragment/read + // cache. Preserve actually assigned fragments and begin explicit placement. + entry.bytes = bytes; + entry.verified = true; + entry.source = `local:${(this.transport.routingPeerId ?? this.transport.peerId)}`; + entry.warmPublished ??= 0; + this.objects.set(key, entry); + await this._repairPlacement(entry, fragments); + if (persistWarm) { + for (const f of fragments.slice(0, 2)) { + if (await this._publish(this._packet(entry, f.index, f.bytes, { purpose: 'public-relay', holder: 'public-relay' }))) entry.warmPublished++; + } + } + entry.placementStatus = this.placementSummary(key); + if (this.vmBridge) await this.vmBridge.mountUorObject(key, new Uint8Array(bytes), label); + // Storage writes are not discovery refreshes and do not advance its clock. + this.onUpdate({ type: 'object_put', entry }); + return entry; + }); + } + + get(addressHex) { + const entry = this.objects.get(addressHex); + if (!entry || !entry.verified || !entry.bytes) return { ok: false, bytes: null, text: null, entry: null }; + const bytes = new Uint8Array(entry.bytes); + return { ok: true, bytes, text: new TextDecoder().decode(bytes), entry }; + } + + /** Explicit retrieval may create read caches; placement state is separate. */ + syncFromNetwork(sinceWindow = '30m', { publicData = false } = {}) { + return this._enqueue(async () => { + this._broadcast({ type: 'uor_sync_req', version: 1 }); + if (!publicData) return 0; + const envelopes = await this._fetch(sinceWindow); + if (!Array.isArray(envelopes) || envelopes.length > this.maxObjects * 3) throw new CustodyError('CapacityLimit', 'Oversized relay result'); + let recovered = 0; + for (const env of envelopes) { + try { + if (env?.type === 'uor_shard' && await this._ingest(this._snapshotEnvelope(env, true), 'warm-relay:public', null, true)) { + this.warmRecoveries++; recovered++; + } + } catch (error) { this._reject(error); } + } + return recovered; + }); } } diff --git a/src/layer4-compute/index.js b/src/layer4-compute/index.js index 446225f..7e3f3d7 100644 --- a/src/layer4-compute/index.js +++ b/src/layer4-compute/index.js @@ -21,7 +21,13 @@ import { verifyTrace, Fnv1aHasher16 } from '../layer1-uor/index.js'; +import { createCheckpoint, verifyCheckpoint, demoProgram, identifyProgram, MAX_PROGRAM_STEPS } from './replay.js'; +import { validateStaticNetwork, networkChangeAllowed, networkSharingAllowed, shareAllowed, ethernetAllowed, commandAllowed, observationAllowed, administrationAllowed, forgetAllowed, validateCommand, vmLimits, VmBoundaryError, allocationAllowed, terminationRequired, installFilesystemControls, readBoundedVmFile } from './vm-administration.js'; +import { ResourceAdmission, reserveNetwork } from '../layer2-schedulers/policy.js'; +import { snapshotRecord } from '../layer1-uor/custody.js'; +import { record, identifier, natural, digest, refuse } from '../layer1-uor/contracts.js'; import { computeSurvivalProbability } from '../layer2-schedulers/index.js'; +import { vmCanBoot, vmIsBooting, vmCanExecute, vmCallbackCurrent, vmFailAllowed, startVm, failVm, readyVm } from '../layer1-uor/effects.js'; /** * Execute a full or partial sequence of UOR PrimitiveOp instructions on an initial Datum, @@ -64,7 +70,8 @@ export function finalizeAndVerifyExecution(datum, events) { return { datum, trace, - verified: verification.ok, + verified: verification.ok, // Legacy field means structure-only, not execution correctness. + verification: 'structure-only', certificate: verification.certificate ?? null }; } @@ -243,134 +250,464 @@ export function benchmarkComputeStrategies({ } /** - * In-Browser x86 Linux 5.6 VM Node (`v86` WebAssembly emulator) with: + * In-Browser x86 Linux 6.18.7 VM Node (`v86` WebAssembly emulator) with: * 1. 9p filesystem bridge (`/mnt`) synced with the Layer-3 UOR Database * 2. Virtual Ethernet NIC (`eth0`) bridged over Layer-5 WebRTC DataChannels * 3. Shell task execution producing UOR-addressed output artifacts */ export class LinuxVmNode { - constructor({ transport, screenContainer, onStatus = () => {} }) { + #network = null; + constructor({ transport, screenContainer, onStatus = () => {}, bootTimeoutMs = 60000, vmRuntimeMs = vmLimits.runtimeLimitMs, network = null }) { + if (!Number.isFinite(bootTimeoutMs) || bootTimeoutMs <= 0 || bootTimeoutMs > 2147483647) throw new Error('Invalid VM boot timeout'); + if (!Number.isFinite(vmRuntimeMs) || vmRuntimeMs < 1000 || vmRuntimeMs > vmLimits.runtimeLimitMs) throw new VmBoundaryError('vm-runtime-limit-invalid', 'Invalid VM runtime allowance (1000–300000ms).'); this.transport = transport; this.screenContainer = screenContainer; this.onStatus = onStatus; this.v86 = null; - this.booted = false; - this.booting = false; + this.vmPhase = 'Idle'; + this.bootTimeoutMs = bootTimeoutMs; + this.bootGeneration = 0; + this.vmRuntimeMs = vmRuntimeMs; + this.runtimeDeadline = null; + this.filesystemUsage = null; + this.boundaryReason = null; + this.boundaryStop = null; + this.bootPoll = null; + this.bootDeadline = null; + this.keyboardTail = Promise.resolve(); + this.bootProbe = null; + this.shareGeneration = 0; + this.objectSharing = false; + this.ethernetGeneration = 0; + this.ethernetSharing = false; + this.adminBlocked = false; + this.adminBusy = false; + this.terminationObservation = 'none'; + this.commandBusy = false; + this.commands = new Map(); + this.commandSequence = 0; + this.instanceId = globalThis.crypto.randomUUID(); this.ethFramesSent = 0; this.ethFramesReceived = 0; - this.ipAddress = `10.42.0.${(parseInt(this.transport.peerId.slice(-4), 36) % 250) + 2}`; + if (network !== null) this.setNetworkConfiguration(network.address, network.prefixLength); + } + + get networkConfiguration() { return this.#network; } + get ipAddress() { return this.#network?.address ?? null; } + setNetworkConfiguration(address, prefixLength) { + if (!networkChangeAllowed(this)) + throw new VmBoundaryError('vm-network-active', 'Destroy the current instance before changing its network configuration.'); + this.#network = address === null ? null : validateStaticNetwork(address, prefixLength); + if (this.#network === null) this.setEthernetSharing(false); + return this.#network; + } + + get booted() { return vmCanExecute(this); } + get booting() { return vmIsBooting(this); } + get lifecycle() { + return { phase: this.vmPhase.toLowerCase(), generation: this.bootGeneration, canBoot: !this.adminBlocked && !this.adminBusy && vmCanBoot(this), canExecute: vmCanExecute(this), instancePresent: !!this.v86, terminationObservation: this.terminationObservation, adminBusy: this.adminBusy, adminBlocked: this.adminBlocked, commandBusy: this.commandBusy, commandCapacity: this.commands.size < 128, + networkConfiguration: this.#network, canConfigureNetwork: networkChangeAllowed(this), runtimeAllowanceMs: this.vmRuntimeMs, filesystemUsage: this.filesystemUsage ? { ...this.filesystemUsage } : null, boundaryReason: this.boundaryReason, + canAdminister: administrationAllowed(this), ...this.commandLifecycle(this.lastCommandId) }; + } + + // The UI can inspect any retained handle without changing the latest command + // or inventing a second set of admission rules. + commandLifecycle(id) { + const command = this.commands.get(id); + return { + canCancelObservation: !!command && !command.cancelled && !this.adminBusy && !['completed', 'failed-before-dispatch', 'cancelled-before-dispatch'].includes(command.outcome) && (!command.dispatched || observationAllowed(this, command)), + canForgetCommand: forgetAllowed(this, command), + canReconcileCommand: !!command && (command.outcome === 'completed' || observationAllowed(this, command)) + }; + } + + setRuntimeAllowance(milliseconds) { + if (!Number.isFinite(milliseconds) || milliseconds < 1000 || milliseconds > vmLimits.runtimeLimitMs) + throw new VmBoundaryError('vm-runtime-limit-invalid', 'VM runtime allowance must be 1–300 seconds.'); + if (this.v86 || this.adminBusy) throw new VmBoundaryError('vm-runtime-active', 'Destroy the current instance before changing its runtime allowance.'); + this.vmRuntimeMs = milliseconds; + } + + clearBootTimers() { + if (this.bootPoll !== null) clearInterval(this.bootPoll); + if (this.bootDeadline !== null) clearTimeout(this.bootDeadline); + this.bootPoll = null; + this.bootDeadline = null; + } + + clearRuntimeDeadline() { + if (this.runtimeDeadline !== null) clearTimeout(this.runtimeDeadline); + this.runtimeDeadline = null; + } + + enforceBoundary(reason) { + if (this.boundaryStop || !this.v86) return this.boundaryStop; + this.boundaryReason = reason; + // administer synchronously fences grants and callbacks before its first await. + this.boundaryStop = this.stop(); + return this.boundaryStop; + } + + failBoot(generation, message) { + if (!vmFailAllowed(this, generation)) return; + // Invalidate listeners before cleanup, which may dispatch synchronous events. + failVm(this, generation); + this.clearBootTimers(); + this.clearRuntimeDeadline(); + const failed = this.v86; + this.objectSharing = false; + this.ethernetSharing = false; + if (!failed) { this.onStatus({ state: 'error', message }); return; } + // Retain the only handle while cleanup is pending or uncertain. Never allow + // a replacement VM to hide an emulator which may still be running. + this.adminBlocked = true; + this.adminBusy = true; + this.terminationObservation = 'pending'; + const cleaned = () => { + this.terminationObservation = 'destroyed'; + this.v86 = null; + this.adminBlocked = false; + this.adminBusy = false; + this.onStatus({ state: 'error', message }); + }; + const uncertain = error => { + this.terminationObservation = 'unknown'; + this.adminBusy = false; + this.onStatus({ state: 'error', message: `${message} Cleanup outcome unknown: ${error.message}. Instance retained; explicitly retry Destroy before Boot.` }); + }; + try { + if (typeof failed.destroy !== 'function') throw Error('VM destroy is unavailable'); + const result = failed.destroy(); + if (result && typeof result.then === 'function') Promise.resolve(result).then(cleaned, uncertain); + else cleaned(); + } catch (error) { uncertain(error); } + } + + sendGuestText(vm, generation, text) { + const send = this.keyboardTail.then(async () => { + if (this.v86 !== vm || this.bootGeneration !== generation || this.adminBlocked) + throw new VmBoundaryError('vm-keyboard-instance-unavailable', 'VM changed before keyboard dispatch; input was not sent.'); + const pending = vm.keyboard_send_text(text, 10); + // The shipped v86 method resolves after its last synthetic keystroke. + // Undefined-returning adapters do not supply this contract. + if (!pending || typeof pending.then !== 'function') + throw new VmBoundaryError('vm-keyboard-completion-unavailable', 'VM keyboard adapter did not provide typing completion; input outcome is unknown.'); + await pending; + if (this.v86 !== vm || this.bootGeneration !== generation || this.adminBlocked) + throw new VmBoundaryError('vm-keyboard-instance-unavailable', 'VM changed during keyboard dispatch; input outcome remains unknown.'); + }); + this.keyboardTail = send.catch(() => {}); + return send; } boot() { - if (this.v86 || this.booting) return; + if (this.adminBlocked || this.adminBusy || !vmCanBoot(this)) return; + const network = this.#network; + this.terminationObservation = 'none'; + this.boundaryReason = null; + this.boundaryStop = null; + this.filesystemUsage = null; + this.keyboardTail = Promise.resolve(); + this.bootProbe = null; + startVm(this); + const generation = this.bootGeneration; const V86Ctor = globalThis.V86 || globalThis.V86Starter; if (!V86Ctor) { - this.onStatus({ state: 'error', message: 'libv86.js not loaded' }); + this.failBoot(generation, 'libv86.js not loaded; retry Boot after the asset is available.'); return; } - this.booting = true; - this.onStatus({ state: 'booting', ip: this.ipAddress }); - - this.v86 = new V86Ctor({ - wasm_path: './v86/v86.wasm', - memory_size: 64 * 1024 * 1024, - vga_memory_size: 2 * 1024 * 1024, - screen_container: this.screenContainer, - bios: { url: './v86/seabios.bin' }, - vga_bios: { url: './v86/vgabios.bin' }, - bzimage: { url: './images/buildroot-bzimage.bin' }, - cmdline: 'tsc=reliable mitigations=off random.trust_cpu=on', - filesystem: {}, - net_device: { type: 'ne2k' }, - autostart: true - }); - - // Bridge outgoing Layer-2 Ethernet frames from Linux eth0 over WebRTC DataChannels - this.v86.add_listener('net0-send', frameBytes => { - this.ethFramesSent++; - this.transport.broadcast({ - type: 'eth_frame', - from: this.transport.peerId, - frame: Array.from(frameBytes) + this.onStatus({ state: 'booting', ip: network?.address ?? null, cidr: network?.cidr ?? null }); + try { + const vm = new V86Ctor({ + wasm_path: './v86/v86.wasm', + memory_size: 64 * 1024 * 1024, + vga_memory_size: 2 * 1024 * 1024, + screen_container: this.screenContainer, + bios: { url: './v86/seabios.bin' }, + vga_bios: { url: './v86/vgabios.bin' }, + bzimage: { url: './images/buildroot-bzimage.bin' }, + cmdline: 'console=tty0 console=ttyS0,115200 rdinit=/init nomodeset', + filesystem: {}, + net_device: { type: 'ne2k' }, + autostart: false }); - }); - - const checkInterval = setInterval(() => { - if (!this.v86) { - clearInterval(checkInterval); - return; - } - const text = Array.from(this.screenContainer.querySelectorAll('span')) - .map(s => s.innerText) - .join('') - .replace(/[\s\u00a0]+/g, ' ') - .trim(); - - if (text.includes('~%') || text.includes('# ')) { - clearInterval(checkInterval); - this.booted = true; - this.booting = false; - // Configure virtual Ethernet interface eth0 inside the Linux VM - const netInit = `ifconfig eth0 ${this.ipAddress} netmask 255.255.255.0 up 2>/dev/null\n`; - this.v86.keyboard_send_text(netInit, 10); - this.onStatus({ state: 'online', ip: this.ipAddress }); - } - }, 250); + this.v86 = vm; + const current = () => vmCallbackCurrent(this, generation, vm); + let vmStarted = false; + vm.add_listener('emulator-loaded', () => { + if (!current() || vmStarted) return; + try { + if (typeof vm.run !== 'function') throw new VmBoundaryError('vm-boundary-unavailable', 'VM run control is unavailable.'); + this.filesystemUsage = installFilesystemControls(vm, error => this.enforceBoundary(error.message)); + this.runtimeDeadline = setTimeout(() => { + if (current() && terminationRequired(false, true, false)) + this.enforceBoundary(`VM runtime allowance of ${this.vmRuntimeMs}ms elapsed. The whole VM is being stopped; guest effects remain unknown.`); + }, this.vmRuntimeMs); + vmStarted = true; + Promise.resolve(vm.run()).catch(error => this.failBoot(generation, `VM start failed: ${error.message}`)); + } catch (error) { this.failBoot(generation, error.message); } + }); + vm.add_listener('download-error', () => { + if (current()) this.failBoot(generation, 'VM asset download failed; retry Boot when assets are available.'); + }); + vm.add_listener('net0-send', frameBytes => { + if (!ethernetAllowed(this, current(), frameBytes)) return; + this.ethFramesSent++; + const grantGeneration = this.ethernetGeneration; + this.transport.broadcast({ type: 'eth_frame', from: this.transport.peerId, frame: Array.from(frameBytes) }, + { consentCurrent: () => grantGeneration === this.ethernetGeneration && ethernetAllowed(this, current(), frameBytes) }); + }); + if (!current()) return; + this.bootDeadline = setTimeout(() => { + if (current()) this.failBoot(generation, `VM readiness was not observed within ${this.bootTimeoutMs}ms; retry Boot explicitly.`); + }, this.bootTimeoutMs); + let pollBusy = false; + this.bootPoll = setInterval(async () => { + if (!current() || !this.booting || !vmStarted || pollBusy) return; + pollBusy = true; + try { + if (!this.bootProbe) { + const text = Array.from(this.screenContainer.querySelectorAll('span')) + .map(s => s.innerText).join('').replace(/[\s\u00a0]+/g, ' ').trim(); + // A prompt starts initialization; it never establishes readiness. + if (!(text.includes('~%') || /#(?:\s|$)/.test(text))) return; + const suffix = `${this.instanceId}_${generation}`; + const nonce = globalThis.crypto.randomUUID().replaceAll('-', ''); + const probe = this.bootProbe = { inputName: `boot_in_${suffix}`, responseName: `boot_ready_${suffix}`, nonce, typingCompleted: false }; + await vm.create_file(probe.inputName, new TextEncoder().encode(nonce)); + if (!current() || this.adminBlocked) return; + // A preexisting mount is normal for the shipped guest. If its init + // mount failed, retry only that setup step. The response can arrive + // only after the shell reads host input and writes back over 9p. + const setup = `mkdir -p /mnt; { grep -q '^host9p /mnt 9p ' /proc/mounts || mount -t 9p -o trans=virtio host9p /mnt; } && [ "$(cat /mnt/${probe.inputName})" = '${nonce}' ] && ${network ? `ifconfig eth0 ${network.address} netmask ${network.netmask} up` : 'true'} && printf '%s' '${nonce}' > /mnt/${probe.responseName}\n`; + await this.sendGuestText(vm, generation, setup); + probe.typingCompleted = true; + } + const probe = this.bootProbe; + const response = await readBoundedVmFile(vm, probe.responseName, 32); + const expected = new TextEncoder().encode(probe.nonce); + const exact = !!response && response.length === expected.length && response.every((byte, i) => byte === expected[i]); + if (current() && probe.typingCompleted && exact) { + this.clearBootTimers(); + readyVm(this, generation, vm, true); + this.onStatus({ state: 'online', ip: network?.address ?? null, cidr: network?.cidr ?? null }); + } + } catch (error) { + this.failBoot(generation, `VM boot failed: ${error.message}`); + } finally { pollBusy = false; } + }, 250); + } catch (error) { + this.failBoot(generation, `VM boot failed: ${error.message}`); + } } handleIncomingEthFrame(frameArray) { - if (!this.v86 || !this.booted || !Array.isArray(frameArray)) return; + if (!ethernetAllowed(this, !!this.v86, frameArray)) return false; this.ethFramesReceived++; this.v86.bus.send('net0-receive', new Uint8Array(frameArray)); } async mountUorObject(addressHex, bytes, label = '') { - if (!this.v86) return false; - const shortId = addressHex.replace('uor:ca:', '').slice(0, 12); - const filename = `uor_${shortId}.bin`; + const vm = this.v86, generation = this.bootGeneration, shareGeneration = this.shareGeneration; + if (!vm || !shareAllowed(this, true)) return false; + const current = () => shareAllowed(this, shareGeneration === this.shareGeneration && vmCallbackCurrent(this, generation, vm)); try { - await this.v86.create_file(filename, new Uint8Array(bytes)); + digest(addressHex); + if (!(bytes instanceof Uint8Array) || bytes.length > 16 * 1024 * 1024 || typeof label !== 'string') return false; + const snapshot = bytes.slice(), fullRoot = addressHex.slice('sha256:'.length); + const filename = `uor_sha256_${fullRoot}.bin`; + await vm.create_file(filename, snapshot); + if (!current()) return false; if (label) { - const safeLabel = label.replace(/[^a-zA-Z0-9._-]/g, '_'); - await this.v86.create_file(safeLabel, new Uint8Array(bytes)); + const safeLabel = label.replace(/[^a-zA-Z0-9._-]/g, '_').slice(0, 80); + // Labels are convenience aliases in a disjoint namespace, never object + // identity. Every alias retains the complete content digest. + await vm.create_file(`uor_label_${safeLabel}_sha256_${fullRoot}.bin`, snapshot.slice()); } - return true; + return current(); } catch { return false; } } /** - * Execute a shell command inside the booted Linux 5.6 VM, capture stdout via `/mnt/`, + * Execute a shell command inside the booted Linux 6.18.7 VM, capture stdout via `/mnt/`, * and return the resulting bytes so they can be stored and replicated as a UOR object. */ - async executeShellCommand(commandStr, timeoutMs = 6000) { - if (!this.v86 || !this.booted) { - throw new Error('Linux VM is not booted yet.'); - } - const runId = Math.random().toString(36).slice(2, 8); - const scriptName = `job_${runId}.sh`; - const outName = `out_${runId}.txt`; - const doneName = `done_${runId}.flag`; - - const scriptBody = `#!/bin/sh\n(${commandStr}) > /mnt/${outName} 2>&1\necho OK > /mnt/${doneName}\n`; - await this.v86.create_file(scriptName, new TextEncoder().encode(scriptBody)); - await this.v86.keyboard_send_text(`sh /mnt/${scriptName}\n`, 10); - - const t0 = performance.now(); - while (performance.now() - t0 < timeoutMs) { - try { - const doneBuf = await this.v86.read_file(doneName); - if (doneBuf && doneBuf.length > 0) { - const outBuf = await this.v86.read_file(outName); - return outBuf ? new Uint8Array(outBuf) : new Uint8Array(0); - } - } catch {} - await new Promise(r => setTimeout(r, 200)); + setObjectSharing(granted) { + if (typeof granted !== 'boolean') throw Error('Explicit Boolean grant required'); + this.shareGeneration++; + this.objectSharing = granted; + return granted; + } + + setEthernetSharing(granted) { + if (typeof granted !== 'boolean') throw Error('Explicit Boolean grant required'); + if (!networkSharingAllowed(granted, this.#network !== null)) + throw new VmBoundaryError('vm-network-required', 'Configure a unique static IPv4 address and compatible prefix before Boot to enable Ethernet sharing. Destroy any retained instance first.'); + this.ethernetGeneration++; + this.ethernetSharing = granted; + return granted; + } + + async administer(action) { + if (!['stop', 'destroy'].includes(action)) throw Error('Invalid VM administration action'); + if (!administrationAllowed(this)) return false; + const vm = this.v86; + this.adminBusy = true; + this.adminBlocked = true; + this.terminationObservation = 'pending'; + this.objectSharing = false; + this.ethernetSharing = false; + this.clearBootTimers(); + this.clearRuntimeDeadline(); + // Invalidate all pending callbacks BEFORE invoking a possibly reentrant host effect. + this.bootGeneration++; + this.vmPhase = 'Failed'; + for (const command of this.commands.values()) if (command.vm === vm && command.outcome !== 'completed') { + if (command.dispatched) { command.outcome = 'unknown'; command.termination = 'stop-pending'; } + else if (command.outcome === 'pending') command.outcome = 'cancelled-before-dispatch'; + command.interrupt?.(); } - throw new Error(`VM command timed out after ${timeoutMs}ms`); + try { + if (typeof vm[action] !== 'function') throw Error(`VM ${action} is unavailable`); + const pending = vm[action](); + try { this.onStatus({ state: 'stopping', message: `${this.boundaryReason ? this.boundaryReason + ' ' : ''}VM ${action} requested; awaiting emulator confirmation. Prior command evidence is unchanged.` }); } + catch { /* An observing UI callback must not prevent or abandon termination. */ } + await pending; + this.terminationObservation = action === 'stop' ? 'stopped' : 'destroyed'; + if (action === 'destroy') { + this.v86 = null; + this.vmPhase = 'Idle'; + this.adminBlocked = false; + } + for (const command of this.commands.values()) if (command.vm === vm && command.dispatched && command.outcome !== 'completed') command.termination = action === 'stop' ? 'vm-stopped' : 'vm-destroyed'; + try { this.onStatus({ state: 'offline', message: `${this.boundaryReason ? this.boundaryReason + ' ' : ''}${action === 'stop' ? 'VM stopped. Destroy before booting a fresh VM.' : 'VM destroyed. Guest effects are not rolled back.'}` }); } + catch { /* Observation callbacks cannot undo confirmed host termination. */ } + return true; + } catch (error) { + this.terminationObservation = 'unknown'; + for (const command of this.commands.values()) if (command.vm === vm && command.dispatched && command.outcome !== 'completed') command.termination = 'stop-unknown'; + this.onStatus({ state: 'error', message: `VM ${action} outcome unknown: ${error.message}. Grants revoked; instance retained for explicit destroy retry.` }); + return false; + } finally { this.adminBusy = false; } + } + + stop() { return this.administer('stop'); } + destroy() { return this.administer('destroy'); } + + async cancelCommand(id) { + const command = this.commands.get(id); + if (!command || command.cancelled || ['completed', 'failed-before-dispatch', 'cancelled-before-dispatch'].includes(command.outcome)) return false; + command.cancelled = true; + command.outcome = command.dispatched ? 'unknown' : 'cancelled-before-dispatch'; + command.interrupt?.(); + if (!command.dispatched) return true; + if (command.vm !== this.v86 || command.generation !== this.bootGeneration || this.adminBlocked) return false; + command.termination = 'stop-pending'; + if (terminationRequired(true, false, false)) + return await this.enforceBoundary('Command cancellation requested. Cancellation stops the whole VM, including other guest work. Prior effects are not rolled back.'); + return false; + } + + // Compatibility name retains the stronger whole-VM cancellation semantics. + cancelCommandObservation(id) { return this.cancelCommand(id); } + + forgetCommand(id) { + const command = this.commands.get(id); + if (!forgetAllowed(this, command)) return false; + // Explicit operator disposal only. Unknown effects remain observable. + this.commands.delete(id); + delete command.output; + command.vm = null; + if (this.lastCommandId === id) this.lastCommandId = [...this.commands.keys()].at(-1); + return true; + } + + commandEvidence(id) { + const command = this.commands.get(id); + return command ? { id, generation: command.generation, outcome: command.outcome, dispatched: command.dispatched, termination: command.termination ?? 'not-requested' } : null; + } + + async reconcileCommand(id) { + const command = this.commands.get(id); + if (!command) throw Error('Unknown VM command handle'); + if (command.outcome === 'completed') return command.output.slice(); + if (!observationAllowed(this, command)) throw Error('Command belongs to an unavailable VM instance; completion remains unknown.'); + if (command.reading) throw new VmBoundaryError('vm-observation-busy', 'This command result is already being observed.'); + command.reading = true; + try { + const observe = operation => command.interruption ? Promise.race([operation, command.interruption]) : operation; + const done = await observe(readBoundedVmFile(command.vm, command.doneName, 16)); + if (!observationAllowed(this, command)) throw Error('VM replaced during command observation; completion remains unknown.'); + if (!done?.length) return null; + const retained = [...this.commands.values()].reduce((sum, value) => sum + (value.output?.length ?? 0), 0); + const output = await observe(readBoundedVmFile(command.vm, command.outName, Math.max(0, Math.min(vmLimits.outputLimit, vmLimits.retainedOutputLimit - retained)))); + if (!observationAllowed(this, command)) throw Error('VM replaced during output read; completion remains unknown.'); + if (output === null) return null; + const retainedNow = [...this.commands.values()].reduce((sum, value) => sum + (value.output?.length ?? 0), 0); + if (!allocationAllowed(retainedNow, output.length, vmLimits.retainedOutputLimit)) + throw new VmBoundaryError('vm-output-limit', 'Retained output allowance reached.'); + command.output = output ?? new Uint8Array(0); + command.outcome = 'completed'; + return command.output.slice(); + } catch (error) { + if (['vm-output-limit', 'vm-boundary-unavailable'].includes(error.code)) { + command.outcome = 'unknown'; + await this.enforceBoundary(error.message); + } + throw error; + } finally { command.reading = false; } } + + async executeShellCommand(commandStr, timeoutMs = 6000) { + validateCommand(commandStr, timeoutMs); + if (!this.v86 || !commandAllowed(this)) throw Error('VM command refused: not ready, busy, quarantined, or command handle capacity reached.'); + this.commandBusy = true; + const vm = this.v86, generation = this.bootGeneration; + const id = `${this.instanceId}_${generation}_${++this.commandSequence}`; + const command = { id, vm, generation, dispatched: false, outcome: 'pending', cancelled: false, + outName: `out_${id}.txt`, doneName: `done_${id}.flag` }; + this.commands.set(id, command); + this.lastCommandId = id; + const failure = message => Object.assign(new Error(message), { commandId: id, outcome: command.outcome }); + command.interruption = new Promise((resolve, reject) => { + command.interrupt = () => reject(failure(command.dispatched + ? 'VM replaced or stopped during command observation; completion remains unknown.' : 'Command cancelled before shell dispatch.')); + }); + // A cancellation can arrive between host calls. Always observe its rejection. + command.interruption.catch(() => {}); + try { + const scriptName = `job_${id}.sh`; + const scriptBody = `#!/bin/sh\n(${commandStr}) > /mnt/${command.outName} 2>&1\necho OK > /mnt/${command.doneName}\n`; + await Promise.race([vm.create_file(scriptName, new TextEncoder().encode(scriptBody)), command.interruption]); + if (command.cancelled || this.v86 !== vm || this.bootGeneration !== generation || this.adminBlocked) { + command.outcome = 'cancelled-before-dispatch'; + throw failure('Command cancelled before shell dispatch.'); + } + // Even a throwing keyboard adapter may have dispatched input: retain unknown. + command.dispatched = true; + await Promise.race([this.sendGuestText(vm, generation, `sh /mnt/${scriptName}\n`), command.interruption]); + const t0 = performance.now(); + while (!command.cancelled && performance.now() - t0 < timeoutMs) { + if (!observationAllowed(this, command)) break; + const output = await this.reconcileCommand(id); + if (output !== null) return output; + await Promise.race([new Promise(resolve => setTimeout(resolve, 200)), command.interruption]); + } + command.outcome = 'unknown'; + throw failure(command.cancelled || this.adminBlocked + ? `Command observation ended; completion is unknown. VM termination: ${command.termination ?? 'stop-pending'}. Prior guest effects are not rolled back.` + : `VM command observation ended after ${timeoutMs}ms; completion is unknown and the guest command was not cancelled. Reconcile handle ${id}, or Cancel and stop VM; do not replay automatically. The VM runtime allowance continues independently.`); + } catch (error) { + if (error.code === 'vm-keyboard-completion-unavailable') await this.enforceBoundary(error.message); + if (command.outcome === 'pending') command.outcome = command.dispatched ? 'unknown' : 'failed-before-dispatch'; + error.commandId = id; error.outcome = command.outcome; + throw error; + } finally { this.commandBusy = false; } + } + } /** @@ -380,166 +717,157 @@ export class LinuxVmNode { * opened tab reading the warm cache) resumes execution from the last verified step! */ export class LiveDistributedComputeCoordinator { - constructor({ transport, liveDb, onJobUpdate = () => {} }) { + constructor({ transport, liveDb, onJobUpdate = () => {}, allowPublicRelay = false, maxJobs = 128, admission = liveDb?.admission ?? transport?.admission ?? new ResourceAdmission() }) { + natural(maxJobs, 4096); this.transport = transport; this.liveDb = liveDb; this.onJobUpdate = onJobUpdate; - /** @type {Map} */ + this.allowPublicRelay = allowPublicRelay; + this.maxJobs = maxJobs; + this.admission = admission; this.jobs = new Map(); + this.running = new Map(); + this.ingress = Promise.resolve(); + this.pendingIngress = 0; + this.maxPendingIngress = 128; + } + + async ownerIdentity() { + // Initialize the authenticated route before publishing an owner. Display labels + // may differ across peers and must not masquerade as reachability identities. + const session = this.transport.signaling; + await session?.identity?.(); + if (session !== this.transport.signaling) refuse('transport-session-changed'); + return this.transport.routingPeerId ?? this.transport.peerId; } async handleMeshMessage(fromPeerId, msg) { - if (!msg || msg.type !== 'compute_ckpt') return; - await this.ingestCheckpoint(msg, `webrtc:${fromPeerId}`); + if (!msg || msg.type !== 'compute_ckpt') return false; + return this.ingestCheckpoint(msg, `webrtc:${fromPeerId}`); } - async ingestCheckpoint(ckpt, sourceTag = 'remote') { - const existing = this.jobs.get(ckpt.jobId); - if (existing && existing.stepIndex >= ckpt.stepIndex && existing.status === 'completed') { - return; - } + ingestCheckpoint(packet, sourceTag = 'remote') { + // Serialize validation plus commit: two concurrent packets must not overwrite a newer head. + // Snapshot before queueing; later caller mutation cannot alter the admitted message. + if (this.pendingIngress >= this.maxPendingIngress) return Promise.resolve(false); + try { packet = snapshotRecord(packet); } catch { return Promise.resolve(false); } + this.pendingIngress++; + const task = this.ingress.then(() => this.acceptCheckpoint(packet, sourceTag)).finally(() => { this.pendingIngress--; }); + this.ingress = task.catch(() => {}); + return task; + } - const job = { - jobId: ckpt.jobId, - totalSteps: ckpt.totalSteps, - stepIndex: ckpt.stepIndex, - currentValueHex: ckpt.currentValueHex, - events: ckpt.events.map(e => new TraceEvent(e.stepIndex, e.op, { - isZero: () => false, - toHex: () => e.targetHex - })), - rawEvents: ckpt.events, - ownerPeerId: ckpt.ownerPeerId, - status: ckpt.status, - resultAddressHex: ckpt.resultAddressHex || null, - verified: ckpt.verified || false, - updatedAtMs: Date.now(), - sourceTag - }; - this.jobs.set(ckpt.jobId, job); - this.onJobUpdate(job); + async acceptCheckpoint(packet, sourceTag) { + try { + record(packet, ['type', 'jobId', 'program', 'checkpoint', 'ownerPeerId']); + if (packet.type !== 'compute_ckpt') refuse('unsupported-checkpoint'); + identifier(packet.jobId); identifier(packet.ownerPeerId); + const verification = await verifyCheckpoint(packet.program, packet.checkpoint, undefined, { admission: this.admission }); + const existing = this.jobs.get(packet.jobId); + if (existing) { + if (existing.checkpoint.jobId !== packet.checkpoint.jobId) refuse('job-conflict'); + if (packet.checkpoint.stepIndex <= existing.stepIndex) { + if (packet.checkpoint.stepIndex === existing.stepIndex && + packet.checkpoint.stateHex !== existing.currentValueHex) refuse('job-conflict'); + return false; + } + // Every accepted state is replayed independently. Missing network checkpoints are + // allowed, but a direct successor must bind the retained predecessor. + if (packet.checkpoint.stepIndex === existing.stepIndex + 1) { + await verifyCheckpoint(packet.program, packet.checkpoint, existing.checkpoint, { admission: this.admission }); + } + } else if (this.jobs.size >= this.maxJobs) refuse('job-capacity'); + this.admission.reserve('checkpoint', { storageBytes: new TextEncoder().encode(JSON.stringify(packet)).length }); + const job = { jobId: packet.jobId, program: structuredClone(packet.program), + checkpoint: structuredClone(packet.checkpoint), totalSteps: packet.program.instructions.length, + stepIndex: packet.checkpoint.stepIndex, currentValueHex: packet.checkpoint.stateHex, + ownerPeerId: packet.ownerPeerId, status: verification.complete ? 'completed' : 'running', + resultAddressHex: null, verified: true, verification: 'replayed', updatedAtMs: Date.now(), sourceTag }; + this.jobs.set(packet.jobId, job); + this.onJobUpdate(job); + return true; + } catch (error) { + this.onJobUpdate({ type: 'checkpoint_refused', code: error.code || 'invalid-checkpoint' }); + return false; + } } - /** - * Start or resume a multi-step UOR reduction job across the live network. - * Each step executes a Z/(2^64)Z ring operation, commits a checkpoint over WebRTC - * and to the warm relay cache, and pauses `stepDelayMs` so you can test closing the tab mid-job. - */ - async startOrResumeJob({ - jobId = 'job-' + Math.random().toString(36).slice(2, 7), - totalSteps = 12, - initialValue = 104729n, - stepDelayMs = 700 - } = {}) { - let job = this.jobs.get(jobId); - let step = job ? job.stepIndex : 0; - let curDatum = job ? Datum.w64(BigInt(job.currentValueHex)) : Datum.w64(BigInt(initialValue)); - let rawEvents = job ? [...job.rawEvents] : []; - - while (step < totalSteps) { - const op = step % 3 === 0 - ? PrimitiveOp.ADD - : step % 3 === 1 - ? PrimitiveOp.XOR - : PrimitiveOp.SUCC; - const arg = step % 3 === 0 - ? Datum.w64(BigInt((step + 1) * 257)) - : step % 3 === 1 - ? Datum.w64(0x9e3779b97f4a7c15n) - : null; - - curDatum = applyPrimitiveOp(op, curDatum, arg); - const { address } = mintContentAddress(curDatum.toBytes(), Fnv1aHasher16); - rawEvents.push({ - stepIndex: step, - op, - targetHex: address.toHex() - }); - step++; - - const isFinal = step >= totalSteps; - let resultAddressHex = null; - let verified = false; - - if (isFinal) { - const traceEvents = rawEvents.map(e => { - const hex = e.targetHex.replace('uor:ca:', ''); - return new TraceEvent(e.stepIndex, e.op, { - raw: BigInt('0x' + hex), - isZero: () => BigInt('0x' + hex) === 0n, - toHex: () => e.targetHex - }); - }); - const finalCheck = finalizeAndVerifyExecution(curDatum, traceEvents); - verified = finalCheck.verified; - - const stored = await this.liveDb.put( - JSON.stringify({ - jobId, - finalDatumHex: '0x' + curDatum.value.toString(16), - totalSteps, - verified, - certificateFingerprint: finalCheck.certificate?.fingerprint?.toHex() || null - }), - { label: `job_${jobId}_result.json`, persistWarm: true } - ); - resultAddressHex = stored.addressHex; - } + async startOrResumeJob({ jobId = 'job-' + crypto.randomUUID(), totalSteps = 12, + initialValue = 104729n, stepDelayMs = 700, program = null } = {}) { + identifier(jobId); natural(totalSteps, MAX_PROGRAM_STEPS); natural(stepDelayMs, 60000); + if (this.running.has(jobId)) return this.running.get(jobId); + const work = this.runJob({ jobId, totalSteps, initialValue, stepDelayMs, program }); + this.running.set(jobId, work); + try { return await work; } finally { this.running.delete(jobId); } + } - const ckptPacket = { - type: 'compute_ckpt', - jobId, - totalSteps, - stepIndex: step, - currentValueHex: '0x' + curDatum.value.toString(16), - events: rawEvents, - ownerPeerId: this.transport.peerId, - status: isFinal ? 'completed' : 'running', - resultAddressHex, - verified - }; - - await this.ingestCheckpoint(ckptPacket, `local:${this.transport.peerId}`); - this.transport.broadcast(ckptPacket); - if (step % 3 === 0 || isFinal) { - await this.transport.publishWarmEnvelope(ckptPacket); + async runJob({ jobId, totalSteps, initialValue, stepDelayMs, program }) { + const existing = this.jobs.get(jobId); + if (!existing && this.jobs.size >= this.maxJobs) refuse('job-capacity'); + program = structuredClone(existing?.program ?? program ?? demoProgram(totalSteps, initialValue)); + await identifyProgram(program); + let checkpoint = existing?.checkpoint ?? null; + let step = checkpoint?.stepIndex ?? 0; + if (checkpoint) await verifyCheckpoint(program, checkpoint, undefined, { admission: this.admission }); + // Empty jobs have a valid initial/final state and still emit a replayable checkpoint. + do { + if (step < program.instructions.length) step++; + else if (checkpoint !== null) break; + checkpoint = await createCheckpoint(program, step, checkpoint, { admission: this.admission }); + const packet = { type: 'compute_ckpt', jobId, program, checkpoint, ownerPeerId: await this.ownerIdentity() }; + if (!await this.ingestCheckpoint(packet, `local:${this.transport.peerId}`)) { + const head = this.jobs.get(jobId); + if (!head || head.checkpoint.jobId !== checkpoint.jobId || head.stepIndex < step) refuse('checkpoint-refused'); + checkpoint = head.checkpoint; step = head.stepIndex; + // An independently accepted newer head wins. Never publish our refused state. + continue; } - - if (!isFinal && stepDelayMs > 0) { - await new Promise(r => setTimeout(r, stepDelayMs)); + if (this.transport.admission !== this.admission) reserveNetwork(this.admission, 'checkpoint', packet, (this.transport.openPeers?.() || []).length); + this.transport.broadcast(packet); + // Explicit public-data opt-in. A relay is storage with an external retention policy. + if (this.allowPublicRelay && (step % 3 === 0 || step === program.instructions.length)) { + if (this.transport.admission !== this.admission) reserveNetwork(this.admission, 'checkpoint', { ...packet, from: this.transport.peerId, tsMs: Date.now() }); + await this.transport.publishWarmEnvelope(packet, { publicData: true, consentCurrent: () => this.allowPublicRelay }); } + if (step < program.instructions.length && stepDelayMs > 0) await new Promise(r => setTimeout(r, stepDelayMs)); + } while (step < program.instructions.length); + const job = this.jobs.get(jobId); + if (job?.status === 'completed') { + const stored = await this.liveDb.put(JSON.stringify({ jobId, program, checkpoint }), + { label: `job_${jobId}_result.json`, persistWarm: this.allowPublicRelay, publicData: this.allowPublicRelay }); + job.resultAddressHex = stored.addressHex; + this.onJobUpdate(job); } - - return this.jobs.get(jobId); + return job; } - /** - * Recover in-flight or completed jobs from the warm relay ring-buffer, - * and automatically take over any unfinished (`running`) job whose original owner died! - */ async syncAndTakeOverJobs(sinceWindow = '30m') { - const envelopes = await this.transport.fetchWarmEnvelopes(sinceWindow); - for (const env of envelopes) { - if (env && env.type === 'compute_ckpt') { - await this.ingestCheckpoint(env, `warm-relay:${env.ownerPeerId || 'cache'}`); + if (this.allowPublicRelay) { + if (this.transport.admission !== this.admission) this.admission.reserve('retrieve', { requests: 1, transferBytes: 2 * 1024 * 1024 }); + const envelopes = await this.transport.fetchWarmEnvelopes(sinceWindow, { publicData: true, consentCurrent: () => this.allowPublicRelay }); + if (!Array.isArray(envelopes) || envelopes.length > this.maxJobs * 4) refuse('job-capacity'); + for (const env of envelopes) { + if (env?.type !== 'compute_ckpt') continue; + // Transport delivery metadata is not authority or signed program state. + try { + const packet = snapshotRecord(env); + if (Object.hasOwn(packet, 'from') || Object.hasOwn(packet, 'tsMs')) { + identifier(packet.from); natural(packet.tsMs); + delete packet.from; delete packet.tsMs; + } + await this.ingestCheckpoint(packet, 'warm-relay'); + } catch { this.onJobUpdate({ type: 'checkpoint_refused', code: 'invalid-checkpoint' }); } } } - - const activePeerIds = new Set(this.transport.openPeers().map(p => p.remoteId)); + const ownIdentity = await this.ownerIdentity(); + const active = new Set(this.transport.openPeers().map(p => p.remoteId)); const resumed = []; for (const job of this.jobs.values()) { - if ( - job.status === 'running' && - job.stepIndex < job.totalSteps && - job.ownerPeerId !== this.transport.peerId && - !activePeerIds.has(job.ownerPeerId) - ) { + if (job.status === 'running' && job.ownerPeerId !== ownIdentity && !active.has(job.ownerPeerId)) { resumed.push(job.jobId); - this.startOrResumeJob({ - jobId: job.jobId, - totalSteps: job.totalSteps, - stepDelayMs: 400 - }); + // Reachability loss is an observation, not proof of death or exclusive ownership. + this.startOrResumeJob({ jobId: job.jobId, stepDelayMs: 0 }).catch(error => + this.onJobUpdate({ type: 'job_refused', code: error.code || 'host-effect-failed' })); } } return resumed; diff --git a/src/layer4-compute/replay.js b/src/layer4-compute/replay.js new file mode 100644 index 0000000..b0f3f7f --- /dev/null +++ b/src/layer4-compute/replay.js @@ -0,0 +1,158 @@ +/** Deterministic ring jobs. Replay proves agreement with this interpreter, not correctness of host effects. */ +import { PrimitiveOp } from '../layer1-uor/index.js'; +import { canonicalBytes, sha256Bytes } from '../layer1-uor/custody.js'; +import { record, natural, hexValue, digest, refuse } from '../layer1-uor/contracts.js'; + +import { checkpointLinkAllowed, model, modelExecutionDigest } from '../layer1-uor/generated-model.js'; +export const MAX_PROGRAM_STEPS = 1024; +// Local parsing/memory/work policy, not universal UOR/TermValue limits. +export const MAX_TERM_BITS = 32768; +export const MAX_PROGRAM_WORK = 1000000; +const unary = new Set([PrimitiveOp.NEG, PrimitiveOp.BNOT, PrimitiveOp.SUCC, PrimitiveOp.PRED]); +const binary = new Set([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17]); +const hex = value => '0x' + value.toString(16); +const hash = (value, domain) => sha256Bytes(canonicalBytes(value), domain); +const snapshot = value => JSON.parse(new TextDecoder().decode(canonicalBytes(value))); + +function byteWidth(bits) { + natural(bits, MAX_TERM_BITS); + if (bits % 8 !== 0) refuse('unsupported-width'); + return bits; +} +function termHex(value, bits) { + if (typeof value !== 'string' || value.length > 2 + Math.max(1, bits / 4) || !/^0x(?:0|[1-9a-f][0-9a-f]*)$/.test(value)) refuse('invalid-ring-value'); + if (BigInt(value) >> BigInt(bits)) refuse('invalid-ring-value'); + return value; +} +function planProgram(program) { + const typed = program?.version === 2; + record(program, typed ? ['version', 'bits', 'capacityBits', 'initialValueHex', 'instructions'] : ['version', 'bits', 'initialValueHex', 'instructions']); + if (typed) { + byteWidth(program.bits); byteWidth(program.capacityBits); + if (program.bits > program.capacityBits) refuse('term-capacity'); + termHex(program.initialValueHex, program.bits); + } else { + if (program.version !== 1 || ![8, 16, 32, 64, 128].includes(program.bits)) refuse('unsupported-program'); + hexValue(program.initialValueHex, program.bits); + } + if (!Array.isArray(program.instructions) || program.instructions.length > MAX_PROGRAM_STEPS) refuse('program-limit'); + const plan = []; let bits = program.bits, total = 0n; + for (const instruction of program.instructions) { + let argument = 0n, argumentBits = 0; + if (unary.has(instruction?.op)) record(instruction, ['op']); + else if (binary.has(instruction?.op) || typed && instruction?.op === PrimitiveOp.CONCAT) { + record(instruction, typed ? ['op', 'argHex', 'argBits'] : ['op', 'argHex']); + if (typed) { argumentBits = byteWidth(instruction.argBits); termHex(instruction.argHex, argumentBits); } + else { argumentBits = bits; hexValue(instruction.argHex, bits); } + argument = BigInt(instruction.argHex); + } else refuse('unsupported-operation'); + const source = typed ? { opcode: instruction.op, argument, argumentBits } : { opcode: instruction.op, argument }; + if (typed && !model['Stitch.Compute.typedInstructionAllowed'](source, bits, program.capacityBits)) refuse('invalid-typed-operation'); + const work = typed ? model['Stitch.Compute.typedInstructionWork'](source, bits) : model['Stitch.Compute.instructionWork'](source, bits); + total += work; + if (total > BigInt(MAX_PROGRAM_WORK)) refuse('program-work-limit'); + const nextBits = typed ? Number(model['Stitch.Compute.typedResultBits'](source, bits)) : bits; + plan.push({ source, bits, nextBits, work: Number(work) }); bits = nextBits; + } + return plan; +} +export function validateProgram(program) { planProgram(program); return program; } + +/** Deterministic abstract work units, not a wall-clock/BigInt implementation benchmark. */ +export function programWork(program, start = 0, end = program.instructions.length) { + const plan = planProgram(program); natural(start, plan.length); natural(end, plan.length); + if (start > end) refuse('invalid-step-range'); + return plan.slice(start, end).reduce((total, step) => total + step.work, 0); +} +function runPlan(program, plan, start, end, initial, admission) { + const computeSteps = plan.slice(start, end).reduce((total, step) => total + step.work, 0); + admission?.reserve('checkpoint', { computeSteps }); + let word = initial; + for (let i = start; i < end; i++) { + const step = plan[i]; + word = program.version === 2 ? model['Stitch.Compute.typedStep'](step.source, word) : { + bits: word.bits, + value: model['Stitch.Compute.ringStep'](step.source, word.value, 1n << BigInt(step.bits)) + }; + } + return word; +} + +export async function identifyProgram(program) { + validateProgram(program); + return hash(program, 'program'); +} + +export function replayProgram(program, endStep = program.instructions.length, admission = null) { + const plan = planProgram(program); natural(endStep, plan.length); + const word = runPlan(program, plan, 0, endStep, { bits: BigInt(program.bits), value: BigInt(program.initialValueHex) }, admission); + return { stepIndex: endStep, stateHex: hex(word.value), ...(program.version === 2 ? { stateBits: Number(word.bits) } : {}) }; +} + +export async function createCheckpoint(program, stepIndex, previous = null, { admission = null } = {}) { + program = snapshot(program); + if (previous !== null) previous = snapshot(previous); + const jobId = await identifyProgram(program); + if (previous !== null) { + await verifyCheckpoint(program, previous, undefined, { admission }); + if (previous.stepIndex >= stepIndex) refuse('checkpoint-order'); + } + const state = replayProgram(program, stepIndex, admission); + const body = { version: program.version, jobId, modelDigest: modelExecutionDigest, ...state, previousDigest: previous?.checkpointDigest ?? null }; + return { ...body, checkpointDigest: await hash(body, 'checkpoint') }; +} + +/** Full replay from identified input is required even when no predecessor was retained. + * modelDigest binds executable semantics and adapters, not unrelated proofs or + * product metadata. Exact whole-source provenance remains in MODEL_SOURCE. + * Legacy whole-source checkpoint roots are not implicitly accepted. + */ +export async function verifyCheckpoint(program, checkpoint, previous = undefined, { admission = null } = {}) { + program = snapshot(program); checkpoint = snapshot(checkpoint); + if (previous !== undefined && previous !== null) previous = snapshot(previous); + validateProgram(program); + record(checkpoint, ['version', 'jobId', 'modelDigest', 'stepIndex', 'stateHex', 'previousDigest', 'checkpointDigest', ...(program.version === 2 ? ['stateBits'] : [])]); + if (checkpoint.version !== program.version) refuse('unsupported-checkpoint'); + digest(checkpoint.jobId); digest(checkpoint.checkpointDigest); + if (checkpoint.modelDigest !== modelExecutionDigest) refuse('checkpoint-model'); + if (checkpoint.previousDigest !== null) digest(checkpoint.previousDigest); + natural(checkpoint.stepIndex, program.instructions.length); + if (program.version === 2) { byteWidth(checkpoint.stateBits); termHex(checkpoint.stateHex, checkpoint.stateBits); } + else hexValue(checkpoint.stateHex, program.bits); + if (checkpoint.jobId !== await identifyProgram(program)) refuse('program-mismatch'); + const { checkpointDigest, ...body } = checkpoint; + if (checkpointDigest !== await hash(body, 'checkpoint')) refuse('checkpoint-integrity'); + const replay = replayProgram(program, checkpoint.stepIndex, admission); + if (replay.stateHex !== checkpoint.stateHex || program.version === 2 && replay.stateBits !== checkpoint.stateBits) refuse('checkpoint-replay'); + if (previous === null && checkpoint.previousDigest !== null) refuse('checkpoint-predecessor'); + if (previous !== undefined && previous !== null) { + // Do not trust an unchecked predecessor supplied by a caller. + await verifyCheckpoint(program, previous, undefined, { admission }); + if (!checkpointLinkAllowed(true, true, true, true, checkpoint.previousDigest === previous.checkpointDigest, + true, previous.stepIndex, checkpoint.stepIndex, program.instructions.length)) { + refuse('checkpoint-predecessor'); + } + } + return { integrity: true, execution: 'replayed', predecessor: previous === undefined ? 'not-checked' : 'checked', + complete: checkpoint.stepIndex === program.instructions.length }; +} + +export async function resumeProgram(program, checkpoint, { admission = null } = {}) { + program = snapshot(program); checkpoint = snapshot(checkpoint); + await verifyCheckpoint(program, checkpoint, undefined, { admission }); + const plan = planProgram(program); + const word = runPlan(program, plan, checkpoint.stepIndex, program.instructions.length, + { bits: BigInt(program.version === 2 ? checkpoint.stateBits : program.bits), value: BigInt(checkpoint.stateHex) }, admission); + return { jobId: checkpoint.jobId, stateHex: hex(word.value), stepIndex: program.instructions.length, + ...(program.version === 2 ? { stateBits: Number(word.bits) } : {}), execution: 'replayed', effects: [] }; +} + +/** Existing demo workload, now carried in every checkpoint instead of inferred from labels. */ +export function demoProgram(totalSteps = 12, initialValue = 104729n) { + natural(totalSteps, MAX_PROGRAM_STEPS); + const program = { version: 1, bits: 64, initialValueHex: hex(BigInt(initialValue)), + instructions: Array.from({ length: totalSteps }, (_, step) => step % 3 === 0 + ? { op: PrimitiveOp.ADD, argHex: hex(BigInt((step + 1) * 257)) } + : step % 3 === 1 ? { op: PrimitiveOp.XOR, argHex: '0x9e3779b97f4a7c15' } : { op: PrimitiveOp.SUCC }) }; + return validateProgram(program); +} diff --git a/src/layer4-compute/vm-administration.js b/src/layer4-compute/vm-administration.js new file mode 100644 index 0000000..e0390d2 --- /dev/null +++ b/src/layer4-compute/vm-administration.js @@ -0,0 +1,138 @@ +/** Source-derived policy, with host identity/byte observations supplied explicitly. */ +import { model } from '../layer1-uor/generated-model.js'; +const call = (name, ...args) => model[`Stitch.VmAdministration.${name}`](...args); +export const shareAllowed = (node, current) => call('shareAllowed', node.objectSharing, current, node.adminBlocked); +export function validEthernet(frame) { + if (!(Array.isArray(frame) || frame instanceof Uint8Array) || frame.length < 14 || frame.length > 1518) return false; + for (let index = 0; index < frame.length; index++) { + const byte = frame[index]; + if (!Number.isInteger(byte) || byte < 0 || byte > 255) return false; + } + return true; +} +export const ethernetAllowed = (node, current, frame) => call('ethernetAllowed', node.ethernetSharing && networkSharingAllowed(true, Boolean(node.networkConfiguration)), node.booted, + current, !!node.transport && node.transport.closed !== true, validEthernet(frame), node.adminBlocked); +export const commandAllowed = node => call('commandAllowed', node.booted, node.commandBusy, node.adminBlocked, node.commands.size < 128); +export const observationAllowed = (node, command) => call('observationAllowed', node.bootGeneration, command.generation, + node.v86 === command.vm, command.dispatched, node.adminBlocked); +export const administrationAllowed = node => call('administrationAllowed', !!node.v86, node.adminBusy); +export function validateCommand(command, timeout) { + if (typeof command !== 'string' || !command.trim() || command.includes('\0') || new TextEncoder().encode(command).length > 16384) + throw Error('VM command must be nonempty, contain no NUL, and fit 16384 UTF-8 bytes.'); + if (!Number.isFinite(timeout) || timeout < 0 || timeout > 300000) throw Error('Invalid VM command observation timeout (0–300000ms).'); +} + +export const forgetAllowed = (node, command) => call('forgetAllowed', !!command, ['completed', 'failed-before-dispatch', 'cancelled-before-dispatch'].includes(command?.outcome), node.commandBusy); + +export class VmBoundaryError extends Error { + constructor(code, message) { super(message); this.name = 'VmBoundaryError'; this.code = code; } +} +export const vmLimits = Object.freeze(Object.fromEntries([ + 'filesystemAllocationLimit', 'filesystemFileLimit', 'filesystemMetadataLimit', 'outputLimit', 'retainedOutputLimit', 'runtimeLimitMs' +].map(name => [name, Number(call(name))]))); +export const allocationAllowed = (used, requested, limit) => call('allocationAllowed', used, requested, limit); +export const terminationRequired = (cancelled, expired, exceeded) => call('terminationRequired', cancelled, expired, exceeded); + +/** + * Adapter for the bundled v86 local 9p implementation, not a generic sandbox. + * It is installed before the emulator starts. Cumulative allocation charging is + * intentionally conservative: shrinking/unlinking never refunds the instance. + * In particular fs.total_size is only statfs information and is NOT a quota. + */ +export function installFilesystemControls(vm, onViolation) { + const fs = vm.fs9p; + const methods = ['SearchPath', 'GetInode', 'Read', 'ChangeSize', 'CreateBinaryFile', 'CreateTextFile', + 'CreateInode', 'FillDirectory', 'link_under_dir']; + if (!fs || !Array.isArray(fs.inodes) || !fs.inodedata || !Array.isArray(fs.mounts) || fs.mounts.length || + methods.some(name => typeof fs[name] !== 'function')) { + throw new VmBoundaryError('vm-boundary-unavailable', 'Required bundled v86 filesystem controls are unavailable; guest execution refused.'); + } + const state = { allocatedBytes: 0, createdInodes: fs.inodes.length, linkedEntries: 0, exceeded: false }; + const violate = message => { + const error = new VmBoundaryError('vm-filesystem-limit', message); + if (!state.exceeded) { state.exceeded = true; onViolation(error); } + throw error; + }; + const validSize = size => Number.isSafeInteger(size) && size >= 0; + const reserve = size => { + if (state.exceeded) violate('Guest filesystem is quarantined after a resource limit.'); + if (!validSize(size) || size > vmLimits.filesystemFileLimit || + !allocationAllowed(state.allocatedBytes, size, vmLimits.filesystemAllocationLimit)) { + violate('Guest 9p allocation refused before allocation: 16 MiB per buffer, 64 MiB cumulative per VM. Stop requested; guest effects remain unknown.'); + } + state.allocatedBytes += size; + }; + for (const data of Object.values(fs.inodedata)) reserve(data.byteLength); + for (const name of ['ChangeSize', 'CreateBinaryFile', 'CreateTextFile']) { + const original = fs[name]; + fs[name] = function (...args) { + reserve(name === 'ChangeSize' ? args[1] : args[2]?.length); + return original.apply(this, args); + }; + } + const createInode = fs.CreateInode; + fs.CreateInode = function (...args) { + if (state.exceeded || !call('metadataAllowed', state.createdInodes, vmLimits.filesystemMetadataLimit)) + violate('Guest 9p inode limit reached. Stop requested; guest effects remain unknown.'); + state.createdInodes++; + return createInode.apply(this, args); + }; + const link = fs.link_under_dir; + fs.link_under_dir = function (...args) { + if (state.exceeded || typeof args[2] !== 'string' || new TextEncoder().encode(args[2]).length > 255 || + !call('metadataAllowed', state.linkedEntries, vmLimits.filesystemMetadataLimit)) + violate('Guest 9p directory-entry limit reached. Stop requested; guest effects remain unknown.'); + state.linkedEntries++; + return link.apply(this, args); + }; + const fillDirectory = fs.FillDirectory; + fs.FillDirectory = function (id) { + const inode = this.GetInode(id); + let size = 0; + for (const name of inode.direntries.keys()) size += 24 + new TextEncoder().encode(name).length; + reserve(size); + return fillDirectory.call(this, id); + }; + // This value makes the guest's statfs report match the configured allowance, + // but the wrappers above, rather than statfs, enforce allocation admission. + fs.total_size = vmLimits.filesystemAllocationLimit; + return state; +} + +/** Never ask read_file() to allocate a guest-selected file length. */ +export async function readBoundedVmFile(vm, name, limit) { + const fs = vm.fs9p; + if (!fs || ['SearchPath', 'GetInode', 'Read'].some(key => typeof fs[key] !== 'function')) + throw new VmBoundaryError('vm-boundary-unavailable', 'Bounded v86 file reads are unavailable.'); + const path = fs.SearchPath(name); + if (path.id === -1) return null; + const inode = fs.GetInode(path.id), size = inode?.size; + if (!Number.isSafeInteger(size) || size < 0 || + !call('resultReadAllowed', size, limit, (inode?.mode & 0xf000) === 0x8000)) + throw new VmBoundaryError('vm-output-limit', `Guest result must be a regular file of at most ${limit} bytes; unbounded read refused.`); + // Capture a bounded range even if the guest changes its file while Read awaits. + const bytes = await fs.Read(path.id, 0, size); + if (bytes !== null && bytes !== undefined && (!(bytes instanceof Uint8Array) || bytes.length > size)) + throw new VmBoundaryError('vm-boundary-unavailable', 'v86 returned an invalid bounded file range.'); + return bytes ? bytes.slice() : new Uint8Array(0); +} + +// Parsing and subnet arithmetic are host observations; admission is source-owned. +// Canonical decimal input avoids shell syntax, ambiguous octal, NaN and coercion. +export function validateStaticNetwork(address, prefixLength) { + if (typeof address !== 'string' || !/^(0|[1-9][0-9]{0,2})(\.(0|[1-9][0-9]{0,2})){3}$/.test(address) || + !Number.isInteger(prefixLength) || prefixLength < 0 || prefixLength > 32) + throw new VmBoundaryError('vm-network-invalid', 'Enter a canonical IPv4 host address and prefix length 0–32.'); + const octets = address.split('.').map(Number); + if (octets.some(value => value > 255)) + throw new VmBoundaryError('vm-network-invalid', 'IPv4 octets must be 0–255.'); + const numeric = octets.reduce((value, octet) => value * 256 + octet, 0); + const size = 2 ** (32 - prefixLength), hostPart = numeric % size; + if (!call('staticAddressAllowed', octets[0], prefixLength, hostPart, size - 1)) + throw new VmBoundaryError('vm-network-invalid', 'Use a unicast host address, not unspecified, loopback, multicast, reserved, or the subnet network/broadcast address.'); + const mask = 2 ** 32 - size; + const netmask = [24, 16, 8, 0].map(shift => Math.floor(mask / 2 ** shift) % 256).join('.'); + return Object.freeze({ address, prefixLength, netmask, cidr: `${address}/${prefixLength}` }); +} +export const networkChangeAllowed = node => call('networkChangeAllowed', !!node.v86, Boolean(node.adminBusy || node.adminBlocked), node.booting); +export const networkSharingAllowed = (granted, configured) => call('networkSharingAllowed', granted, configured); diff --git a/src/layer5-transport/channel-flow.js b/src/layer5-transport/channel-flow.js new file mode 100644 index 0000000..1373cb6 --- /dev/null +++ b/src/layer5-transport/channel-flow.js @@ -0,0 +1,162 @@ +/** Reliable ordered DataChannel application adapter. Browser SCTP/DTLS owns + * transport integrity. Application commitments remain the object authority. + * Local queue acceptance and SCTP submission are NOT peer acknowledgements. */ +import { model } from '../layer1-uor/generated-model.js'; +import { refuse } from '../layer1-uor/contracts.js'; +import { parseCanonicalJson } from '../layer1-uor/custody.js'; +const call = (name, ...args) => model[`Stitch.ChannelFlow.${name}`](...args); +const encoder = new TextEncoder(); +const HEADER = 16, MAGIC = 0x53544331; +export const CHANNEL_PROTOCOL = 'stitch.channel/1'; +export const CHANNEL_LIMITS = Object.freeze({ message: 524288, queuedBytes: 2097152, queuedMessages: 64, + buffered: 1048576, low: 524288, frame: 65536, age: 30000, assemblies: 16 }); +const jsonLimits = { maxBytes: CHANNEL_LIMITS.message, maxEntries: CHANNEL_LIMITS.message, maxStringLength: CHANNEL_LIMITS.message }; +export function channelMaximum(pc) { + // RFC8841 absent max-message-size default is 64KiB. Zero/unbounded is limited + // by our explicit scheduling quantum, not by a smaller logical message cap. + const value = pc?.sctp?.maxMessageSize; + if (value === undefined || value === null) return CHANNEL_LIMITS.frame; + if (value === 0 || value === Infinity) return CHANNEL_LIMITS.frame; + if (!Number.isSafeInteger(value) || value < 1) refuse('channel-negotiated-size'); + return Math.min(value, CHANNEL_LIMITS.frame); +} +export class ChannelFlow { + constructor({ channel, pc, current = () => true, admission, onMessage = () => {}, onResult = () => {}, + onSent = () => {}, pool = { queued: 0, messages: 0, receiving: 0, assemblies: 0 }, clock = () => performance.now() }) { + Object.assign(this, { channel, pc, current, admission, onMessage, onResult, onSent, pool, clock }); + this.queue = []; this.sequence = 0; this.receivedSequence = 0; this.assembly = null; this.disposed = false; this.timer = null; + channel.binaryType = 'arraybuffer'; channel.bufferedAmountLowThreshold = CHANNEL_LIMITS.low; + channel.onbufferedamountlow = () => this.drain(); + } + result(value) { try { this.onResult(value); } catch { /* Observers cannot retain queue reservations. */ } } + get state() { return { queued: this.queue.length, retained: this.queue.reduce((n, q) => n + q.bytes.length, 0), + receiving: this.assembly?.total ?? 0, disposed: this.disposed }; } + schedule() { + clearTimeout(this.timer); this.timer = null; + if (this.disposed) return; + const times = this.queue.map(q => q.started + CHANNEL_LIMITS.age); + if (this.assembly) times.push(this.assembly.started + CHANNEL_LIMITS.age); + if (!times.length) return; + this.timer = setTimeout(() => { + if (!this.current()) return this.dispose('generation-changed'); + if (this.clock() >= Math.min(...times)) this.fail('channel-timeout'); else this.schedule(); + }, Math.max(1, Math.min(...times) - this.clock())); + this.timer.unref?.(); + } + enqueue(value, { onSubmitted = () => {}, consentCurrent = () => true } = {}) { + if (this.disposed || !this.current() || !consentCurrent() || this.channel.readyState !== 'open') return false; + const raw = JSON.stringify(value); + if (typeof raw !== 'string') refuse('channel-envelope'); + const bytes = encoder.encode(raw); + if (!call('queueAllowed', this.pool.messages, this.pool.queued, bytes.length)) refuse('channel-queue-capacity'); + const snapshot = parseCanonicalJson(raw, jsonLimits); + const maximum = channelMaximum(this.pc), framed = bytes.length > maximum; + if (framed && this.channel.protocol !== undefined && this.channel.protocol !== CHANNEL_PROTOCOL) refuse('channel-peer-framing-unsupported'); + if (framed && (this.channel.ordered === false || this.channel.maxRetransmits != null || this.channel.maxPacketLifeTime != null)) refuse('channel-framing-requires-reliable-ordered'); + if (framed && maximum <= HEADER) refuse('channel-framing-size-unsupported'); + if (framed && this.sequence === 0xffffffff) refuse('channel-sequence-exhausted'); + const frames = framed ? Math.ceil(bytes.length / (maximum - HEADER)) : 1; + // Atomic resource charge includes every wire header; no refunds after failure. + this.admission?.reserve('place', { requests: frames, transferBytes: bytes.length + (framed ? HEADER * frames : 0) }); + const state = this.admission?.state; + const budget = state ? { endMs: state.endMs, lastObservedMs: state.lastObservedMs } : null; + const job = { consentCurrent, budget, raw: framed ? null : raw, bytes, maximum, framed, id: framed ? ++this.sequence : 0, + offset: 0, submitted: 0, started: this.clock(), onSubmitted: () => onSubmitted(snapshot), attempted: false }; + this.queue.push(job); this.pool.queued += bytes.length; this.pool.messages++; + this.schedule(); this.drain(); return true; + } + release(job) { this.pool.queued -= job.bytes.length; this.pool.messages--; } + drain() { + if (this.disposed) return; + if (!this.current()) return this.dispose('generation-changed'); + if (this.channel.readyState !== 'open') return this.dispose('channel-not-open'); + try { + while (this.queue.length) { + const job = this.queue[0]; + if (!job.consentCurrent()) return this.fail('channel-consent-withdrawn'); + if (job.budget && this.admission?.clock) { + const now = this.admission.clock(); + if (now < job.budget.lastObservedMs || now >= job.budget.endMs) return this.fail('channel-budget-expired'); + } + if (this.clock() - job.started >= CHANNEL_LIMITS.age) return this.fail('channel-timeout'); + const remaining = job.bytes.length - job.offset; + const length = job.framed ? Math.min(remaining, job.maximum - HEADER) : remaining; + const wireLength = length + (job.framed ? HEADER : 0); + const buffered = this.channel.bufferedAmount ?? 0; + if (!Number.isSafeInteger(buffered) || buffered < 0) return this.fail('channel-buffer-invalid'); + const maximum = channelMaximum(this.pc); + if (wireLength > maximum) return this.fail('channel-negotiated-size-changed'); + if (!call('sendAllowed', this.current(), this.channel.readyState === 'open', buffered, wireLength, maximum)) break; + let wire = job.raw; + if (job.framed) { + wire = new ArrayBuffer(wireLength); const view = new DataView(wire); + [MAGIC, job.id, job.bytes.length, job.offset].forEach((v, i) => view.setUint32(i * 4, v)); + new Uint8Array(wire, HEADER).set(job.bytes.subarray(job.offset, job.offset + length)); + } + // send() success only proves browser acceptance. A throw may leave the + // remote outcome unknown; never automatically replay a partially sent job. + job.attempted = true; this.channel.send(wire); job.attempted = false; job.offset += length; job.submitted++; + this.onSent(wireLength); + if (job.offset === job.bytes.length) { + this.queue.shift(); this.release(job); job.onSubmitted(); + this.result({ outcome: 'submitted', frames: job.submitted, bytes: job.bytes.length, delivered: false }); + } + } + this.schedule(); + } catch (error) { this.fail(error.code || 'channel-send-unknown'); } + } + receive(data) { + if (this.disposed || !this.current()) return; + try { + const length = typeof data === 'string' ? encoder.encode(data).length : data?.byteLength; + if (!Number.isSafeInteger(length) || length > CHANNEL_LIMITS.message) refuse('channel-wire-size'); + this.admission?.reserve('retrieve', { transferBytes: length, computeSteps: length }); + if (typeof data === 'string') { + if (this.assembly) refuse('channel-interleaved-message'); + this.onMessage(parseCanonicalJson(data, jsonLimits)); return; + } + if (this.channel.protocol !== undefined && this.channel.protocol !== CHANNEL_PROTOCOL) refuse('channel-peer-framing-unsupported'); + if (this.channel.ordered === false || this.channel.maxRetransmits != null || this.channel.maxPacketLifeTime != null) refuse('channel-framing-requires-reliable-ordered'); + if (!(data instanceof ArrayBuffer) || length <= HEADER || length > CHANNEL_LIMITS.frame) refuse('channel-frame'); + const view = new DataView(data), [magic, id, total, offset] = Array.from({ length: 4 }, (_, i) => view.getUint32(i * 4)); + if (magic !== MAGIC || !id || !total || total > CHANNEL_LIMITS.message) refuse('channel-frame'); + if (!this.assembly) { + if (offset !== 0 || id !== this.receivedSequence + 1) refuse('channel-frame-order'); + if (this.pool.assemblies >= CHANNEL_LIMITS.assemblies || this.pool.receiving + total > CHANNEL_LIMITS.queuedBytes) refuse('channel-receive-capacity'); + this.admission?.reserve('retrieve', { storageBytes: total }); + this.assembly = { id, total, received: 0, bytes: new Uint8Array(total), started: this.clock() }; + this.pool.receiving += total; this.pool.assemblies++; + } + const a = this.assembly, payload = new Uint8Array(data, HEADER); + if (a.id !== id || a.total !== total || this.clock() - a.started >= CHANNEL_LIMITS.age + || !call('appendAllowed', a.received, offset, payload.length, total)) refuse('channel-frame-order'); + a.bytes.set(payload, offset); a.received = Number(call('append', a.received, offset, payload.length, total)); + if (a.received === total) { + const raw = new TextDecoder('utf-8', { fatal: true }).decode(a.bytes); + const msg = parseCanonicalJson(raw, jsonLimits); + this.receivedSequence = id; this.releaseAssembly(); + if (this.current()) this.onMessage(msg); + } + this.schedule(); + } catch (error) { + // Invalid standalone JSON is ignored as before; binary/partial protocol + // failures poison the stream rather than silently lose a logical message. + if (typeof data !== 'string' || this.assembly) this.fail(error.code || 'channel-frame-invalid'); + } + } + releaseAssembly() { + if (!this.assembly) return; + this.pool.receiving -= this.assembly.total; this.pool.assemblies--; this.assembly = null; + } + fail(reason) { this.dispose(reason); this.channel.close?.(); } + dispose(reason = 'channel-closed') { + if (this.disposed) return; + this.disposed = true; clearTimeout(this.timer); this.timer = null; + const jobs = this.queue.splice(0); + for (const job of jobs) { this.release(job); this.result({ outcome: job.submitted ? 'partial' : job.attempted ? 'unknown' : 'cancelled', reason, + frames: job.submitted, bytes: job.bytes.length, delivered: false }); } + if (this.assembly) this.result({ outcome: 'incomplete-receive', reason, bytes: this.assembly.received, expected: this.assembly.total }); + this.releaseAssembly(); + this.result({ outcome: 'closed', reason, delivered: false }); + } +} diff --git a/src/layer5-transport/dns-wire.js b/src/layer5-transport/dns-wire.js new file mode 100644 index 0000000..2ca0b0d --- /dev/null +++ b/src/layer5-transport/dns-wire.js @@ -0,0 +1,131 @@ +/** RFC8484 application/dns-message client boundary. DNSSEC validation and TLS, + * HTTP negotiation/cache storage remain resolver/browser responsibilities. */ +import { refuse } from '../layer1-uor/contracts.js'; +import { wireBytes } from '../layer2-schedulers/policy.js'; +const types = Object.freeze({ A:1, NS:2, CNAME:5, SOA:6, PTR:12, MX:15, TXT:16, AAAA:28, SRV:33, DS:43, RRSIG:46, DNSKEY:48, TLSA:52, SVCB:64, HTTPS:65, ANY:255, CAA:257 }); +const enc = new TextEncoder(), dec = new TextDecoder('utf-8', {fatal:true,ignoreBOM:true}); +export function dnsQueryName(input) { + if (typeof input !== 'string' || !input || /[\s/@:#?%\\]/.test(input)) refuse('dns-invalid-name'); + if (input === '.') return '.'; + let name = input.endsWith('.') ? input.slice(0,-1) : input; + if (/[^\x00-\x7f]/.test(name)) { + try { name = new URL('https://'+name).hostname; } catch { refuse('dns-invalid-name'); } + } + name=name.toLowerCase(); + if (name.length>253 || name.split('.').some(label=>!label || label.length>63 || !/^[a-z0-9_-]+$/.test(label))) refuse('dns-invalid-name'); + return name; +} +export function dnsTypeCode(type) { + const value = types[String(type).toUpperCase()] ?? (/^\d+$/.test(String(type)) ? Number(type) : 0); + if (!Number.isSafeInteger(value) || value<1 || value>65535) refuse('dns-query-type'); + return value; +} +export function encodeDnsQuery(name, type='TXT') { + name=dnsQueryName(name);type=dnsTypeCode(type); + const labels=name==='.'?[]:name.split('.'), size=12+labels.reduce((n,l)=>n+1+l.length,1)+4; + const bytes=new Uint8Array(size), view=new DataView(bytes.buffer); + view.setUint16(2,0x0100);view.setUint16(4,1); // ID0 improves DoH cache reuse; recursion desired. + let at=12; + for(const label of labels){bytes[at++]=label.length;bytes.set(enc.encode(label),at);at+=label.length;} + bytes[at++]=0;view.setUint16(at,type);view.setUint16(at+2,1); + return {bytes,name,type,id:0}; +} +const hex = bytes => Array.from(bytes,b=>b.toString(16).padStart(2,'0')).join(''); +const labelText = bytes => Array.from(bytes,b=>b>=33&&b<=126&&b!==46&&b!==92?String.fromCharCode(b):'\\'+String(b).padStart(3,'0')).join('').toLowerCase(); +const txtText = bytes => { try{return JSON.stringify(dec.decode(bytes));}catch{return '"'+Array.from(bytes,b=>b>=32&&b<=126&&b!==34&&b!==92?String.fromCharCode(b):'\\'+String(b).padStart(3,'0')).join('')+'"';} }; +export function decodeDnsResponse(input, expected, {ageSeconds=0}={}) { + if (!(input instanceof Uint8Array)||input.length<12||input.length>65535) refuse('dns-message-size'); + if (!Number.isSafeInteger(ageSeconds)||ageSeconds<0) refuse('dns-http-age'); + const bytes=new Uint8Array(input), view=new DataView(bytes.buffer), length=bytes.length; + const need=(at,n,end=length)=>{if(at<0||at+n>end)refuse('dns-message-truncated');}; + const u16=at=>{need(at,2);return view.getUint16(at);}, u32=at=>{need(at,4);return view.getUint32(at);}; + function nameAt(start,end=length,allowCompression=true){ + let at=start,next=null,wireLength=1;const parts=[],seen=new Set(); + for(;;){ + need(at,1,next===null?end:length);if(seen.has(at))refuse('dns-compression-cycle');seen.add(at); + const n=bytes[at]; + if((n&0xc0)===0xc0){if(!allowCompression)refuse('dns-name-compression-forbidden');need(at,2,next===null?end:length);const target=((n&63)<<8)|bytes[at+1];if(target<12||target>=at)refuse('dns-compression-pointer');if(next===null)next=at+2;at=target;continue;} + if(n&0xc0)refuse('dns-label-kind');at++; + if(n===0)return {name:parts.length?parts.join('.'):'.',next:next??at}; + need(at,n,next===null?end:length);wireLength+=n+1;if(wireLength>255)refuse('dns-name-size'); + parts.push(labelText(bytes.subarray(at,at+n)));at+=n; + } + } + const id=u16(0),flags=u16(2),qd=u16(4),counts=[u16(6),u16(8),u16(10)]; + if(id!==(expected.id??0)||!(flags&0x8000)||(flags&0x7800)||(flags&0x0040)||qd!==1)refuse('dns-response-header'); + if(flags&0x0200)refuse('dns-response-truncated'); + let at=12;const question=nameAt(at);at=question.next;need(at,4); + if(question.name!==dnsQueryName(expected.name)||u16(at)!==dnsTypeCode(expected.type)||u16(at+2)!==1)refuse('dns-question-mismatch');at+=4; + function record(){ + const owner=nameAt(at);at=owner.next;need(at,10); + const type=u16(at),klass=u16(at+2),wireTtl=u32(at+4),size=u16(at+8);at+=10; + const start=at,end=at+size;need(at,size); + const r={name:owner.name,type,class:klass,TTL:wireTtl>0x7fffffff?0:wireTtl,rdata:new Uint8Array(bytes.subarray(start,end))}; + const exact=p=>{if(p!==end)refuse('dns-rdata-length');}; + if(type===16){const strings=[];let p=start;while(pn+p.length,0),joined=new Uint8Array(total);let offset=0;for(const part of strings){joined.set(part,offset);offset+=part.length;}r.text=dec.decode(joined);}catch{r.text=null;}} + else if([2,3,4,5,7,8,9,12].includes(type)){const n=nameAt(start,end);exact(n.next);r.data=n.name;} + else if(type===33){need(start,6,end);const target=nameAt(start+6,end,false);exact(target.next);r.srv={priority:u16(start),weight:u16(start+2),port:u16(start+4),target:target.name};r.data=`${r.srv.priority} ${r.srv.weight} ${r.srv.port} ${r.srv.target}`;} + else if(type===6){const primary=nameAt(start,end),mailbox=nameAt(primary.next,end);need(mailbox.next,20,end);exact(mailbox.next+20);r.soa={primary:primary.name,mailbox:mailbox.name,serial:u32(mailbox.next),refresh:u32(mailbox.next+4),retry:u32(mailbox.next+8),expire:u32(mailbox.next+12),minimum:u32(mailbox.next+16)};r.data=Object.values(r.soa).join(' ');} + else if(type===14){const first=nameAt(start,end),second=nameAt(first.next,end);exact(second.next);r.data=first.name+' '+second.name;} + else if(type===15){need(start,2,end);const exchange=nameAt(start+2,end);exact(exchange.next);r.data=`${u16(start)} ${exchange.name}`;} + else if(type===1){if(size!==4)refuse('dns-rdata-length');r.data=Array.from(r.rdata).join('.');} + else if(type===28){if(size!==16)refuse('dns-rdata-length');r.data=Array.from({length:8},(_,i)=>u16(start+i*2).toString(16)).join(':');} + else if(type===41){if(owner.name!=='.')refuse('dns-opt-owner');r.extendedRcode=wireTtl>>>24;r.ednsVersion=(wireTtl>>>16)&255;let p=start;while(p{const records=[];for(let i=0;ir.type===41); + if([...answers,...authority].some(r=>r.type===41))refuse('dns-opt-section'); + if(opts.length>1||opts.some(r=>r.ednsVersion!==0))refuse('dns-edns-version'); + const status=(flags&15)|((opts[0]?.extendedRcode??0)<<4); + if(status!==0&&status!==3)refuse('dns-response-status',`DNS response code ${status}`); + let terminal=question.name;const chain=[],visited=new Set([terminal]); + if(![5,255].includes(dnsTypeCode(expected.type))){for(;;){ + const aliases=answers.filter(r=>r.class===1&&r.name===terminal&&r.type===5); + if(!aliases.length)break;const targets=new Set(aliases.map(r=>r.data));if(targets.size!==1)refuse('dns-cname-conflict'); + if(answers.some(r=>r.class===1&&r.name===terminal&&r.type!==5&&r.type!==46))refuse('dns-cname-conflict'); + terminal=aliases[0].data;if(visited.has(terminal))refuse('dns-cname-cycle');visited.add(terminal);chain.push(...aliases); + }} + const type=dnsTypeCode(expected.type),selected=status===3?[]:answers.filter(r=>r.class===1&&r.name===terminal&&(type===255||r.type===type)); + const relevant=selected.length?[...chain,...selected]:authority.filter(r=>r.class===1&&r.type===6&&(r.name==='.'||terminal===r.name||terminal.endsWith('.'+r.name))); + const lifetimeRecords=selected.length?relevant:[...chain,...relevant]; + const ttl=relevant.length?Math.min(...lifetimeRecords.map(r=>r.type===6?Math.min(r.TTL,r.soa.minimum):r.TTL)):0; + return {status,question:{name:question.name,type},answers,authority,additional,selected, + ttlSeconds:Math.max(0,ttl-ageSeconds),negative:status===3||!selected.length, + authenticatedData:!!(flags&0x20),dnssecValidatedByClient:false}; +} +export async function readBoundedDnsBytes(response,maximum=65535){ + const advertised=response.headers?.get?.('content-length'); + if(advertised!==null&&advertised!==undefined&&(!/^\d+$/.test(advertised)||Number(advertised)>maximum))refuse('response-limit'); + if(!response.body?.getReader){const bytes=new Uint8Array(await response.arrayBuffer());if(bytes.length>maximum)refuse('response-limit');return bytes;} + const reader=response.body.getReader(),parts=[];let size=0; + try{for(;;){const {value,done}=await reader.read();if(done)break;size+=value.byteLength;if(size>maximum)refuse('response-limit');parts.push(value);}const result=new Uint8Array(size);let at=0;for(const p of parts){result.set(p,at);at+=p.length;}return result;} + finally{await reader.cancel().catch(()=>{});reader.releaseLock();} +} +export async function queryDnsMessage({name,type='TXT',endpoint='https://cloudflare-dns.com/dns-query',method='POST',fetchImpl=globalThis.fetch?.bind(globalThis),admission}){ + if(!fetchImpl)refuse('dns-fetch-unavailable'); + if(method!=='GET'&&method!=='POST')refuse('dns-http-method'); + const query=encodeDnsQuery(name,type);let url; + // Configured URI template has one variable, dns. Literal HTTPS URLs are also + // supported and expanded with that query parameter for GET. + let configured=String(endpoint),template=/\{(?:[?&+])?dns\}/g; + if(method==='POST')configured=configured.replace(template,''); + else {const encoded=btoa(String.fromCharCode(...query.bytes)).replace(/\+/g,'-').replace(/\//g,'_').replace(/=+$/,''); + if(template.test(configured)){template.lastIndex=0;configured=configured.replace(template,part=>part==='\{?dns\}'?'?dns='+encoded:part==='\{&dns\}'?'&dns='+encoded:encoded);} + else {try{url=new URL(configured);url.searchParams.set('dns',encoded);configured=url.href;}catch{refuse('dns-endpoint');}} + } + try{url=new URL(configured);}catch{refuse('dns-endpoint');} + if(url.protocol!=='https:'||url.username||url.password||url.hash||/[{}]/.test(configured))refuse('dns-endpoint'); + if(method==='POST')url.searchParams.delete('dns'); + admission?.reserve('retrieve',{requests:1,transferBytes:wireBytes(url.href)+(method==='POST'?query.bytes.length:0)+65535}); + const start=performance.now(); + const response=await fetchImpl(url.href,{method,headers:{accept:'application/dns-message',...(method==='POST'?{'content-type':'application/dns-message'}:{})},...(method==='POST'?{body:query.bytes}:{}),credentials:'omit',referrerPolicy:'no-referrer',redirect:'error'}); + if(!response.ok)refuse('dns-http-status',`DoH HTTP ${response.status}`); + if(response.headers?.get?.('content-type')?.split(';')[0].trim().toLowerCase()!=='application/dns-message')refuse('dns-media-type'); + const observedAge=response.headers?.get?.('age');const age=observedAge??'0';if(!/^\d+$/.test(age)||!Number.isSafeInteger(Number(age)))refuse('dns-http-age'); + const result=decodeDnsResponse(await readBoundedDnsBytes(response),query,{ageSeconds:Number(age)}); + if(response.type==='cors'&&observedAge===null)result.ttlSeconds=0; + return {...result,httpAgeObserved:observedAge!==null,rttMs:Number((performance.now()-start).toFixed(1)),httpAgeSeconds:Number(age),endpoint:url.origin+url.pathname}; +} diff --git a/src/layer5-transport/index.js b/src/layer5-transport/index.js index 65f7eb9..f7af5d8 100644 --- a/src/layer5-transport/index.js +++ b/src/layer5-transport/index.js @@ -1,15 +1,72 @@ +import { SignalSession } from './signaling.js'; /** * @file src/layer5-transport/index.js * @description Layer 5: Live Multi-Peer WebRTC DataChannel Mesh, Warm Relay Ring-Buffer, * Layer-2 Ethernet Frame Bridge (for v86 Linux VMs), and RFC 8484 DoH + Lightweight DNS TXT Writer. */ +import { ResourceAdmission, wireBytes } from '../layer2-schedulers/policy.js'; +import { refuse } from '../layer1-uor/contracts.js'; +import { parseCanonicalJson } from '../layer1-uor/custody.js'; +import { queryDnsMessage } from './dns-wire.js'; +import { captureTransport, transportCanSend, transportSessionCurrent, transportPeerCurrent, transportChannelCurrent, + transportSignalAllowed, transportPeerAllocationAllowed, closeTransport, openTransport, + observeC1Probe, c1ConnectionQualified, c1DirectSuccess, c1SampleQualified, c1SampleStructurallyValid } from '../layer1-uor/effects.js'; + +import { ChannelFlow, CHANNEL_PROTOCOL } from './channel-flow.js'; + +import { RELAY_EVENT_BYTES, RELAY_LIMITS, RelayReassembler, snapshotRelayMessage, frameRelayMessage, + newRelaySession, relayCapacity, relayAdmissionAllowed, relayEffectAllowed } from './relay-framing.js'; + +/** Bounded application response body, not a bound on browser/network overhead. */ +export async function readBoundedText(response, maxBytes) { + const advertised = response.headers?.get?.('content-length'); + if (advertised && Number(advertised) > maxBytes) refuse('response-limit'); + if (!response.body?.getReader) { + const text = await response.text(); + if (wireBytes(text) > maxBytes) refuse('response-limit'); + return text; + } + const reader = response.body.getReader(), decoder = new TextDecoder(); + let total = 0, text = ''; + try { + for (;;) { + const { done, value } = await reader.read(); + if (done) break; + total += value.byteLength; + if (total > maxBytes) refuse('response-limit'); + text += decoder.decode(value, { stream: true }); + } + return text + decoder.decode(); + } finally { await reader.cancel().catch(() => {}); reader.releaseLock(); } +} + const DEFAULT_DOH_ENDPOINT = 'https://cloudflare-dns.com/dns-query'; const DEFAULT_ICE_SERVERS = [ { urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:stun.cloudflare.com:3478' } ]; +// Snapshot a bounded, ordinary RTCIceServer list before asynchronous connection +// setup. An explicit empty list supports a host-only local mesh. Credentials are +// passed only to the browser's RTC implementation, never emitted as events. +function iceServerConfiguration(servers) { + if (!Array.isArray(servers) || servers.length > 16) throw new TypeError('Invalid ICE server configuration'); + return servers.map(server => { + if (!server || typeof server !== 'object' || Array.isArray(server) + || Object.keys(server).some(key => !['urls', 'username', 'credential'].includes(key))) throw new TypeError('Invalid ICE server configuration'); + const urls = typeof server.urls === 'string' ? [server.urls] : server.urls; + if (!Array.isArray(urls) || urls.length < 1 || urls.length > 16 + || urls.some(url => typeof url !== 'string' || url.length > 2048 || !/^(stun|stuns|turn|turns):[^\s]+$/.test(url))) throw new TypeError('Invalid ICE server configuration'); + const result = { urls: [...urls] }; + for (const key of ['username', 'credential']) if (server[key] !== undefined) { + if (typeof server[key] !== 'string' || server[key].length > 2048) throw new TypeError('Invalid ICE server configuration'); + result[key] = server[key]; + } + return result; + }); +} + export function parsePointerTxt(rawTxt) { const cleaned = String(rawTxt).replace(/^"+|"+$/g, '').trim(); const out = {}; @@ -113,43 +170,109 @@ export async function verifyPointerTxt(rawTxt, publicKeyOrB64Url) { }; } +const DNS_TYPES = Object.freeze({ A: 1, NS: 2, CNAME: 5, SOA: 6, PTR: 12, MX: 15, TXT: 16, AAAA: 28, SRV: 33, DS: 43, RRSIG: 46, DNSKEY: 48, TLSA: 52, SVCB: 64, HTTPS: 65, ANY: 255, CAA: 257 }); +const dnsName = value => { + if (typeof value !== 'string' || value.length === 0 || value.length > 254 || /[^A-Za-z0-9_.-]/.test(value)) refuse('dns-invalid-name'); + if (value === '.') return '.'; + const name = value.endsWith('.') ? value.slice(0, -1) : value; + if (name.length > 253 || name.split('.').some(label => label.length === 0 || label.length > 63)) refuse('dns-invalid-name'); + return name.toLowerCase(); +}; export function parseSrvRecord(srvData) { - const parts = String(srvData).trim().split(/\s+/); - if (parts.length < 4) return null; - return { - priority: Number(parts[0]), - weight: Number(parts[1]), - port: Number(parts[2]), - target: parts[3].replace(/\.$/, '') - }; + if (typeof srvData !== 'string') return null; + const parts = srvData.trim().split(/\s+/); + if (parts.length !== 4 || parts.slice(0, 3).some(part => !/^\d+$/.test(part) || Number(part) > 65535)) return null; + let target; + try { target = dnsName(parts[3]); } catch { return null; } + // RFC2782 root target means the service is unavailable, not an empty host. + if (target !== '.' && target.split('.').some(label => !/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(label))) return null; + return { priority: Number(parts[0]), weight: Number(parts[1]), port: Number(parts[2]), target }; +} + +/** Validate and associate the provider's JSON projection. This does not decode + * RFC8484 DNS wire messages or establish DNSSEC authentication/cache semantics. + */ +export function associateDnsJson(body, name, typeCode) { + const query = dnsName(name); + if (!body || typeof body !== 'object' || !Number.isSafeInteger(body.Status) || body.Status !== 0) refuse('dns-response-status'); + if (body.TC !== undefined && body.TC !== false) refuse('dns-response-truncated'); + if (body.Question !== undefined && (!Array.isArray(body.Question) || body.Question.length !== 1 + || dnsName(body.Question[0]?.name) !== query || body.Question[0]?.type !== typeCode)) refuse('dns-question-mismatch'); + if (body.Answer !== undefined && !Array.isArray(body.Answer)) refuse('dns-invalid-answer'); + const answers = body.Answer ?? []; + for (const answer of answers) { + if (!answer || typeof answer !== 'object' || !Number.isSafeInteger(answer.type) || answer.type < 1 || answer.type > 65535 + || !Number.isSafeInteger(answer.TTL) || answer.TTL < 0 || answer.TTL > 2147483647 || typeof answer.data !== 'string' + || (answer.class !== undefined && answer.class !== 1) || (answer.Class !== undefined && answer.Class !== 1)) refuse('dns-invalid-answer'); + dnsName(answer.name); + } + let terminal = query; + const path = new Set([query]), chain = []; + if (typeCode !== DNS_TYPES.CNAME) { + for (;;) { + const aliases = answers.filter(answer => answer.type === DNS_TYPES.CNAME && dnsName(answer.name) === terminal); + if (aliases.length === 0) break; + const targets = new Set(aliases.map(answer => dnsName(answer.data))); + if (targets.size !== 1 || aliases.length !== 1) refuse('dns-cname-conflict'); + terminal = [...targets][0]; + if (path.has(terminal)) refuse('dns-cname-cycle'); + path.add(terminal); chain.push(aliases[0]); + } + } + const selected = answers.filter(answer => dnsName(answer.name) === terminal && (typeCode === DNS_TYPES.ANY || answer.type === typeCode)); + // Do not turn unrelated owners/types or an alias/data conflict into evidence + // of absence. Additional-section processing is a separate DNS wire concern. + if (answers.some(answer => !chain.includes(answer) && !selected.includes(answer))) refuse('dns-answer-mismatch'); + return { selected, ttlSeconds: answers.length ? Math.min(...answers.map(answer => answer.TTL)) : 0 }; } /** - * RFC 8484 DNS-over-HTTPS Resolver + Lightweight Public Dynamic DNS TXT Writer. + * RFC8484 DNS-message lookup + scoped Cloudflare TXT writer. + * Explicit format:"json" retains the separate provider-specific legacy API. */ export class DohResolver { constructor(options = {}) { this.endpoint = options.endpoint ?? DEFAULT_DOH_ENDPOINT; + this.format = options.format ?? "wire"; + this.method = options.method ?? "POST"; + if (!["wire", "json"].includes(this.format)) refuse("dns-query-format"); this.fetchImpl = options.fetchImpl ?? globalThis.fetch?.bind(globalThis); this.history = []; + this.admission = options.admission ?? new ResourceAdmission(); + this.maxResponseBytes = 128 * 1024; } async resolve(name, type = 'SRV') { + if (this.format === 'wire') { + const result = await queryDnsMessage({ name, type, endpoint: this.endpoint, + method: this.method, fetchImpl: this.fetchImpl, admission: this.admission }); + const record = { name, type, status: result.status, ttl_seconds: result.ttlSeconds, + rtt_ms: result.rttMs, cache_hit_inferred: false, http_age_seconds: result.httpAgeSeconds, + negative: result.negative, authenticated_data: result.authenticatedData, + dnssec_validated_by_client: false, + rawRecords: result.selected.map(r => r.text ?? r.data), + records: result.selected.map(r => r.srv ?? (r.type === 16 ? parsePointerTxt(r.text ?? r.data) : r.data)) }; + this.history.push(record); if (this.history.length > 128) this.history.shift(); + return record; + } if (!this.fetchImpl) { throw new Error('fetch is not available in this runtime'); } + const queryName = dnsName(name); + const typeName = typeof type === 'string' ? type.toUpperCase() : type; + const typeCode = DNS_TYPES[typeName] ?? (/^\d+$/.test(String(typeName)) ? Number(typeName) : 0); + if (!Number.isSafeInteger(typeCode) || typeCode < 1 || typeCode > 65535) refuse('dns-query-type'); const t0 = performance.now(); - const url = `${this.endpoint}?name=${encodeURIComponent(name)}&type=${encodeURIComponent(type)}`; + const url = `${this.endpoint}?name=${encodeURIComponent(queryName)}&type=${encodeURIComponent(typeCode)}`; + this.admission.reserve('retrieve', { requests: 1, transferBytes: wireBytes(url) + this.maxResponseBytes }); const res = await this.fetchImpl(url, { headers: { accept: 'application/dns-json' } }); if (!res.ok) { throw new Error(`HTTP ${res.status}`); } - const body = await res.json(); + const body = res.body?.getReader || res.text + ? JSON.parse(await readBoundedText(res, this.maxResponseBytes)) : await res.json(); const rttMs = Number((performance.now() - t0).toFixed(1)); - const answers = Array.isArray(body.Answer) ? body.Answer : []; - const ttlSeconds = answers.length > 0 - ? Math.min(...answers.map(a => Number(a.TTL) || 30)) - : 0; + const { selected: answers, ttlSeconds } = associateDnsJson(body, queryName, typeCode); const prev = this.history.length > 0 ? this.history[this.history.length - 1] : null; const cacheHitInferred = Boolean( @@ -157,21 +280,23 @@ export class DohResolver { ); const parsedRecords = answers.map(a => { - if (type === 'SRV') return parseSrvRecord(a.data); - if (type === 'TXT') return parsePointerTxt(a.data); + if (typeCode === DNS_TYPES.SRV) { const record = parseSrvRecord(a.data); if (!record) refuse('dns-invalid-srv'); return record; } + if (typeCode === DNS_TYPES.TXT) return parsePointerTxt(a.data); return a.data; }).filter(Boolean); const record = { name, type, - status: body.Status ?? 0, + status: body.Status, ttl_seconds: ttlSeconds, rtt_ms: rttMs, cache_hit_inferred: cacheHitInferred, + rawRecords: answers.map(a => a.data), records: parsedRecords }; this.history.push(record); + if (this.history.length > 128) this.history.shift(); return record; } @@ -186,11 +311,32 @@ export class DohResolver { async writeDuckDnsTxt({ subdomain, token, txtValue }) { if (!this.fetchImpl) throw new Error('fetch unavailable'); const url = `https://www.duckdns.org/update?domains=${encodeURIComponent(subdomain)}&token=${encodeURIComponent(token)}&txt=${encodeURIComponent(txtValue)}`; + this.admission.reserve('refresh', { requests: 1, transferBytes: wireBytes(url) + this.maxResponseBytes }); const res = await this.fetchImpl(url); - const text = (await res.text()).trim(); + const text = (await readBoundedText(res, this.maxResponseBytes)).trim(); return { ok: text === 'OK', response: text, fqdn: `${subdomain}.duckdns.org` }; } + /** Exact scoped lookup. An incomplete listing is never evidence of absence. */ + async listCloudflareRecords({ zoneId, apiToken, name, apiBase = 'https://api.cloudflare.com/client/v4' }) { + if (!this.fetchImpl) throw new Error('fetch unavailable'); + const url = `${apiBase}/zones/${encodeURIComponent(zoneId)}/dns_records?type=TXT&name=${encodeURIComponent(name)}&match=all&page=1&per_page=100`; + this.admission.reserve('retrieve', { requests: 1, transferBytes: wireBytes(url) + this.maxResponseBytes }); + const res = await this.fetchImpl(url, { headers: { authorization: `Bearer ${apiToken}` } }); + const json = JSON.parse(await readBoundedText(res, this.maxResponseBytes)); + if (!res.ok || json?.success !== true || !Array.isArray(json.result)) refuse('dns-lookup-failed'); + const info = json.result_info; + if (!info || info.page !== 1 || !Number.isSafeInteger(info.total_count) || info.total_count < 0 + || !Number.isSafeInteger(info.total_pages) || info.total_pages < 0 || info.total_pages > 1 + || info.count !== json.result.length || info.total_count !== json.result.length) refuse('dns-listing-incomplete'); + if (json.result.length > 1) refuse('dns-record-conflict'); + for (const record of json.result) { + if (record.type !== 'TXT' || record.name !== name || typeof record.content !== 'string' + || typeof record.id !== 'string' || !/^[A-Za-z0-9_-]{1,128}$/.test(record.id)) refuse('dns-record-conflict'); + } + return json.result.map(({ id, name, type, content }) => ({ id, name, type, content })); + } + /** * Objective O2 & Claim C2: Publish or update a low-TTL Cloudflare DNS SRV or TXT record * (supports epoch-prefixed subdomains `._stitch._udp.` to bypass local cache opacity). @@ -216,42 +362,55 @@ export class DohResolver { ttl = 60, apiBase = 'https://api.cloudflare.com/client/v4' }) { - if (!this.fetchImpl) throw new Error('fetch unavailable'); - const url = recordId - ? `${apiBase}/zones/${encodeURIComponent(zoneId)}/dns_records/${encodeURIComponent(recordId)}` - : `${apiBase}/zones/${encodeURIComponent(zoneId)}/dns_records`; - const body = { - type, - name, - ttl: Math.max(30, Number(ttl) || 60) - }; - if (type === 'SRV' && srvData) { - body.data = { - priority: Number(srvData.priority ?? 10), - weight: Number(srvData.weight ?? 10), - port: Number(srvData.port ?? 443), - target: String(srvData.target) + let url, body; + try { + if (!this.fetchImpl) throw new Error('fetch unavailable'); + url = recordId + ? `${apiBase}/zones/${encodeURIComponent(zoneId)}/dns_records/${encodeURIComponent(recordId)}` + : `${apiBase}/zones/${encodeURIComponent(zoneId)}/dns_records`; + body = { + type, + name, + ttl: Math.max(30, Number(ttl) || 60) }; - } else { - body.content = String(content); + if (type === 'SRV' && srvData) { + body.data = { + priority: Number(srvData.priority ?? 10), + weight: Number(srvData.weight ?? 10), + port: Number(srvData.port ?? 443), + target: String(srvData.target) + }; + } else { + body.content = String(content); + } + this.admission.reserve('refresh', { requests: 1, transferBytes: wireBytes(url) + wireBytes(body) + this.maxResponseBytes }); + } catch (cause) { + const error = new Error(cause.message, { cause }); + error.code = cause.code; + // A host adapter fact, set only before fetch invocation. No provider + // failure, timeout or lost response is classified as definite non-dispatch. + error.effectDispatched = false; + throw error; + } + // Only pre-dispatch validation/admission errors throw. Once attempted, a lost + // or malformed response is uncertainty, never evidence that no write occurred. + try { + const res = await this.fetchImpl(url, { + method: recordId ? 'PUT' : 'POST', + headers: { authorization: `Bearer ${apiToken}`, 'content-type': 'application/json' }, + body: JSON.stringify(body) + }); + const json = res.body?.getReader || res.text + ? JSON.parse(await readBoundedText(res, this.maxResponseBytes)) : await res.json(); + if (json?.success === false && [400, 401, 403, 404, 422].includes(res.status)) return { ok: false, outcome: 'refused', errors: json.errors || [] }; + if (json?.success === false) return { ok: false, outcome: 'unknown' }; + if (!res.ok || json?.success !== true || typeof json?.result?.id !== 'string' + || !/^[A-Za-z0-9_-]{1,128}$/.test(json.result.id) + || (recordId && json.result.id !== recordId)) return { ok: false, outcome: 'unknown' }; + return { ok: true, outcome: 'published', id: json.result.id, name, type, ttl: body.ttl, errors: [] }; + } catch { + return { ok: false, outcome: 'unknown' }; } - const res = await this.fetchImpl(url, { - method: recordId ? 'PUT' : 'POST', - headers: { - authorization: `Bearer ${apiToken}`, - 'content-type': 'application/json' - }, - body: JSON.stringify(body) - }); - const json = await res.json(); - return { - ok: Boolean(json?.success), - id: json?.result?.id || recordId, - name, - type, - ttl: body.ttl, - errors: json?.errors || [] - }; } /** @@ -305,7 +464,7 @@ export class DohResolver { * Objective O5: Pre-registered JSONL Experiment Trial Logger for C1-C8 falsification runs. */ export class ExperimentTrialLogger { - constructor({ contractVersion = '1.0.0' } = {}) { + constructor({ contractVersion = '1.1.0' } = {}) { this.contractVersion = contractVersion; this.entries = []; } @@ -322,26 +481,27 @@ export class ExperimentTrialLogger { } summarizeC1(networkPairClass = null) { - const c1 = this.entries.filter( - e => e.claim_id === 'C1' && (!networkPairClass || e.network_pair_class === networkPairClass) + const rows = this.entries.filter( + e => e.claim_id === 'C1' && e.contract_version === '1.1.0' && (!networkPairClass || e.network_pair_class === networkPairClass) ); + const c1 = rows.filter(c1SampleStructurallyValid), invalidSamples = rows.length - c1.length; if (c1.length === 0) { - return { trials: 0, direct_success_rate: 0, median_ice_setup_sec: 0, c1_status: 'UNTESTED' }; + return { trials: 0, invalid_samples: invalidSamples, direct_success_rate: 0, median_ice_setup_sec: null, + c1_status: invalidSamples ? 'INSUFFICIENT_EVIDENCE' : 'UNTESTED' }; } - const successes = c1.filter(e => e.success && !e.used_turn).length; + const successes = c1.filter(e => e.success === true && c1SampleQualified(e)).length; const directSuccessRate = Number((successes / c1.length).toFixed(3)); - const sortedIce = c1 - .filter(e => typeof e.ice_setup_sec === 'number') - .map(e => e.ice_setup_sec) - .sort((a, b) => a - b); - const medianIce = sortedIce.length > 0 ? sortedIce[Math.floor(sortedIce.length / 2)] : 0; - const c1Status = c1.length < 30 - ? 'INCOMPLETE_N_LT_30' - : (directSuccessRate >= 0.60 && medianIce <= 10.0 ? 'VERIFIED' : 'REFUTED'); + const sortedIce = c1.map(e => e.ice_setup_sec === null ? Infinity : e.ice_setup_sec).sort((a, b) => a - b); + const middle = Math.floor(sortedIce.length / 2); + const median = sortedIce.length % 2 ? sortedIce[middle] : (sortedIce[middle - 1] + sortedIce[middle]) / 2; + const medianIce = Number.isFinite(median) ? Number(median.toFixed(2)) : null; + const c1Status = c1.length < 30 ? invalidSamples ? 'INSUFFICIENT_EVIDENCE' : 'INCOMPLETE_N_LT_30' + : (directSuccessRate >= 0.60 && medianIce !== null && medianIce <= 10.0 ? 'THRESHOLDS_MET' : 'THRESHOLDS_NOT_MET'); return { trials: c1.length, + invalid_samples: invalidSamples, direct_success_rate: directSuccessRate, - median_ice_setup_sec: Number(medianIce.toFixed(2)), + median_ice_setup_sec: medianIce, c1_status: c1Status }; } @@ -351,21 +511,51 @@ export class ExperimentTrialLogger { } } +/** Local identities must fit the same strict JSON profile used on the wire. + * Validate before closing a previous live session or allocating a provider. + */ +function validateTransportIdentity(peerId, channelKey) { + if (typeof peerId !== 'string' || typeof channelKey !== 'string') throw new TypeError('Transport identities must be strings'); + if (peerId.length === 0 || peerId.length > 128) refuse('relay-peer-identity'); + snapshotRelayMessage({ kind: 'announce', from: peerId, channelKey }); +} + /** * Multi-Peer WebRTC DataChannel Mesh + Warm Relay Cache (`ntfy.sh` ring buffer). * Supports N concurrent peers, binary/JSON replication, and raw Ethernet frame bridging for v86. */ export class WebRtcTransportNode { constructor(options = {}) { + this.admission = options.admission ?? new ResourceAdmission(); + this.channelPool = { queued: 0, messages: 0, receiving: 0, assemblies: 0 }; + this.relayPending = new Map(); + this.relayVerificationPool = new Map(); + this.relaySession = null; + this.signalAssembler = null; + this.warmPollBusy = null; + this.publicRelayConsent = options.publicRelayConsent ?? (() => true); + if (typeof this.publicRelayConsent !== 'function') throw new TypeError('Relay consent must be a callback'); + this.maxRelayResponseBytes = 2 * 1024 * 1024; + this.maxDataMessageBytes = 512 * 1024; + this.maxPeers = 64; this.peerId = options.peerId || ('node-' + Math.random().toString(36).slice(2, 8)); this.channelKey = options.channelKey ?? 'syntra-uor-bus-01'; + validateTransportIdentity(this.peerId, this.channelKey); + this.signaling = new SignalSession(this.channelKey, { maxPeers: this.maxPeers }); + this.signalSigning = new Map(); + this.signalTail = Promise.resolve(); this.heartbeatIntervalMs = options.heartbeatIntervalMs ?? 5000; + this.iceServers = iceServerConfiguration(options.iceServers ?? DEFAULT_ICE_SERVERS); + this.publicSignaling = options.publicSignaling ?? true; + if (typeof this.publicSignaling !== 'boolean') throw new TypeError('Public signaling requires an explicit Boolean'); this.networkPairClass = options.networkPairClass ?? 'declared-pair'; this.trialLogger = options.trialLogger ?? null; this.onEvent = options.onEvent ?? (() => {}); /** @type {Map} */ this.peers = new Map(); + this.generation = 0; + this.closed = false; this.bc = null; this.ws = null; this.hbTimer = null; @@ -375,6 +565,13 @@ export class WebRtcTransportNode { this.bytesReceived = 0; } + // Display labels are not authenticated routing identities. + get routingPeerId() { return this.signaling.id ?? this.peerId; } + + get lifecycle() { + return { generation: this.generation, closed: this.closed, canConnect: true, canSend: transportCanSend(this) }; + } + emit(type, data = {}) { this.onEvent({ type, @@ -404,12 +601,22 @@ export class WebRtcTransportNode { } getOrCreatePeer(remoteId, initiator = false) { + if (this.closed) refuse('transport-closed'); let entry = this.peers.get(remoteId); if (entry && entry.pc && entry.pc.connectionState !== 'closed' && entry.pc.connectionState !== 'failed') { return entry; } - const pc = new RTCPeerConnection({ iceServers: DEFAULT_ICE_SERVERS }); + if (entry) { + const previousSession = captureTransport(this); + this.disposePeer(remoteId, entry, 'peer-replaced'); + if (!transportSessionCurrent(this, previousSession)) refuse('transport-session-changed'); + // Disposal observers may have installed a replacement synchronously. + if (this.peers.has(remoteId)) return this.getOrCreatePeer(remoteId, initiator); + } + if (!transportPeerAllocationAllowed(this)) refuse('peer-capacity'); + this.admission.reserve('refresh', { requests: 1 }); + const pc = new RTCPeerConnection({ iceServers: this.iceServers }); entry = { pc, dc: null, @@ -419,11 +626,23 @@ export class WebRtcTransportNode { iceSetupSec: null, usedTurn: false, heartbeatsPassed: 0, + lastHeartbeatSeq: null, + pendingHeartbeats: new Map(), + c1Deadline: null, + statsDeadline: null, + c1Finalizing: false, c1Logged: false }; this.peers.set(remoteId, entry); + const callback = captureTransport(this, remoteId); + const current = () => transportPeerCurrent(this, callback, remoteId, entry); + entry.c1Deadline = setTimeout(() => { + if (current()) this.finishConnectionTrial(remoteId, entry, performance.now(), false, false, 'heartbeat-deadline'); + }, 10000); + entry.c1Deadline?.unref?.(); pc.onicecandidate = e => { + if (!current()) return; if (e.candidate) { const raw = e.candidate.candidate || ''; const candidateType = raw.includes(' typ relay ') @@ -433,69 +652,97 @@ export class WebRtcTransportNode { : 'host'; if (candidateType === 'relay') entry.usedTurn = true; this.emit('ice_candidate', { remoteId, candidateType }); + if (!current()) return; this.sendSignal({ kind: 'ice', to: remoteId, candidate: e.candidate }); } }; pc.oniceconnectionstatechange = () => { + if (!current()) return; const state = pc.iceConnectionState || 'closed'; this.emit('ice_state', { remoteId, state }); + if (!current()) return; if (state === 'disconnected' || state === 'failed' || state === 'closed') { - if (!entry.c1Logged && this.trialLogger) { - entry.c1Logged = true; - this.trialLogger.logTrial('C1', { - remote_peer: remoteId, - network_pair_class: this.networkPairClass, - success: false, - used_turn: entry.usedTurn, - ice_setup_sec: entry.iceSetupSec ?? Number(((performance.now() - entry.startedAtMs) / 1000).toFixed(2)), - heartbeats_passed: entry.heartbeatsPassed, - reason: `ice_${state}` - }); - } - this.peers.delete(remoteId); - this.emit('peer_disconnected', { remoteId, state }); + this.disposePeer(remoteId, entry, `ice_${state}`, true); + if (transportSessionCurrent(this, callback) && !this.peers.has(remoteId)) this.emit('peer_disconnected', { remoteId, state }); } }; pc.ondatachannel = e => { + if (!current()) { e.channel.close(); return; } this.bindDataChannel(remoteId, e.channel); }; if (initiator) { - const dc = pc.createDataChannel('uor-mesh', { ordered: true }); + const dc = pc.createDataChannel('uor-mesh', { ordered: true, protocol: CHANNEL_PROTOCOL }); this.bindDataChannel(remoteId, dc); } return entry; } + disposePeer(remoteId, entry, reason, recordTrial = false) { + if (entry.disposed) return; + // Fence callbacks before any close/dispose observer can run synchronously. + // A late cleanup owns only its captured entry, never a newer replacement. + if (this.peers.get(remoteId) === entry) this.peers.delete(remoteId); + entry.disposed = true; + if (entry.c1Deadline != null) clearTimeout(entry.c1Deadline); + if (entry.statsDeadline != null) clearTimeout(entry.statsDeadline); + entry.c1Deadline = entry.statsDeadline = null; + entry.pendingHeartbeats?.clear(); + try { + if (recordTrial) this.finishConnectionTrial(remoteId, entry, performance.now(), false, false, reason); + } finally { + entry.c1Logged = true; + try { entry.flow?.dispose(reason); } + finally { + try { entry.dc?.close(); } + finally { entry.pc?.close(); } + } + } + } + bindDataChannel(remoteId, channel) { const entry = this.peers.get(remoteId); - if (entry) entry.dc = channel; + if (!entry || this.closed) { channel.close(); return; } + entry.flow?.dispose('channel-replaced'); + entry.dc = channel; + entry.pendingHeartbeats ??= new Map(); + entry.pendingHeartbeats.clear(); + entry.lastHeartbeatSeq = null; + entry.heartbeatsPassed = 0; + const callback = captureTransport(this, remoteId); + const current = () => transportChannelCurrent(this, callback, remoteId, entry, channel); + const flow = new ChannelFlow({ channel, pc: entry.pc, current, admission: this.admission, pool: this.channelPool, + onMessage: msg => { if (current()) this.handleDataMessage(remoteId, msg); }, + onSent: bytes => { this.bytesSent += bytes; }, + onResult: result => { this.emit('channel_send_result', { remoteId, generation: callback.generation, ...result }); } }); + entry.flow = flow; channel.onopen = () => { + if (!current()) return; + flow.drain(); if (entry && entry.iceSetupSec === null) { - entry.iceSetupSec = Number(((performance.now() - entry.startedAtMs) / 1000).toFixed(2)); + entry.iceSetupSec = (performance.now() - entry.startedAtMs) / 1000; } this.emit('channel_open', { remoteId, label: channel.label, iceSetupSec: entry?.iceSetupSec ?? 0 }); - this.startHeartbeat(); + if (current()) this.startHeartbeat(); }; channel.onclose = () => { - this.peers.delete(remoteId); - this.emit('channel_close', { remoteId }); + if (!current()) return; + this.disposePeer(remoteId, entry, 'channel-closed', true); + if (transportSessionCurrent(this, callback) && !this.peers.has(remoteId)) this.emit('channel_close', { remoteId }); }; + channel.onerror = () => { if (current()) flow.fail('channel-error-unknown'); }; + channel.onmessage = e => { - const rawLen = typeof e.data === 'string' ? e.data.length : (e.data?.byteLength || 0); + if (!current()) return; + const rawLen = typeof e.data === 'string' ? wireBytes(e.data) : (e.data?.byteLength || 0); this.bytesReceived += rawLen; - try { - const msg = JSON.parse(e.data); - this.handleDataMessage(remoteId, msg); - } catch { - // Ignore malformed frame - } + flow.receive(e.data); }; } @@ -504,20 +751,26 @@ export class WebRtcTransportNode { const entry = this.peers.get(remoteId); if (entry) entry.lastSeenSec = nowMs / 1000; + if (!msg || typeof msg !== 'object') return; if (msg.type === 'ping') { - this.sendToPeer(remoteId, { - type: 'pong', - seq: msg.seq, - sentAtMs: msg.sentAtMs, - from: this.peerId - }); + if (msg.from !== remoteId || !Number.isSafeInteger(msg.seq) || msg.seq < 0 || !Number.isFinite(msg.sentAtMs)) return; + this.sendToPeer(remoteId, { type: 'pong', seq: msg.seq, sentAtMs: msg.sentAtMs, from: this.routingPeerId }); this.recordHeartbeat(remoteId, nowMs, null); } else if (msg.type === 'pong') { - const rttMs = msg.sentAtMs ? nowMs - msg.sentAtMs : null; - if (entry && rttMs !== null) entry.rttMs = rttMs; - this.recordHeartbeat(remoteId, nowMs, rttMs); + const probe = entry?.pendingHeartbeats.get(msg.seq), observedAt = performance.now(); + const correlated = !!probe && msg.from === remoteId && probe.sentAtMs === msg.sentAtMs + && probe.generation === this.generation && probe.channel === entry.dc && probe.monotonicAt <= observedAt; + if (probe) entry.pendingHeartbeats.delete(msg.seq); + if (correlated) { + const rttMs = observedAt - probe.monotonicAt; + entry.rttMs = rttMs; + observeC1Probe(entry, msg.seq, observedAt, true); + this.recordHeartbeat(remoteId, nowMs, rttMs); + if (!entry.c1Logged && !entry.c1Finalizing && c1ConnectionQualified(entry, observedAt)) { + this.observeConnectionPath(remoteId, entry, observedAt); + } + } } else { - // Forward application payload (uor_shard, uor_sync_req, compute_task, compute_ckpt, eth_frame) this.emit('mesh_message', { from: remoteId, msg }); } } @@ -526,37 +779,70 @@ export class WebRtcTransportNode { const nowSec = nowMs / 1000; this.heartbeatTimestampsSec.push(nowSec); if (this.heartbeatTimestampsSec.length > 64) this.heartbeatTimestampsSec.shift(); - const entry = this.peers.get(remoteId); - if (entry) { - entry.heartbeatsPassed++; - if (!entry.c1Logged && entry.heartbeatsPassed >= 10) { - entry.c1Logged = true; - const c1Payload = { - remote_peer: remoteId, - network_pair_class: this.networkPairClass, - success: (entry.iceSetupSec ?? 0) <= 10.0 && !entry.usedTurn, - used_turn: entry.usedTurn, - ice_setup_sec: entry.iceSetupSec ?? 0, - heartbeats_passed: entry.heartbeatsPassed - }; - if (this.trialLogger) this.trialLogger.logTrial('C1', c1Payload); - this.emit('c1_trial_complete', c1Payload); - } + this.emit('heartbeat', { remoteId, count: this.heartbeatTimestampsSec.length, rttMs, timestampSec: nowSec }); + } + + rememberHeartbeatProbe(entry, payload) { + if (!(entry.pendingHeartbeats instanceof Map) || payload.type !== 'ping' || !Number.isSafeInteger(payload.seq) || payload.seq < 0 || !Number.isFinite(payload.sentAtMs)) return; + entry.pendingHeartbeats.set(payload.seq, { sentAtMs: payload.sentAtMs, monotonicAt: performance.now(), generation: this.generation, channel: entry.dc }); + while (entry.pendingHeartbeats.size > 64) entry.pendingHeartbeats.delete(entry.pendingHeartbeats.keys().next().value); + } + + finishConnectionTrial(remoteId, entry, observedAt, selectedPathObserved, usedRelay, reason) { + if (entry.c1Logged) return; + entry.c1Logged = true; + if (entry.c1Deadline !== null) clearTimeout(entry.c1Deadline); + if (entry.statsDeadline !== null) clearTimeout(entry.statsDeadline); + entry.c1Deadline = entry.statsDeadline = null; + const payload = { remote_peer: remoteId, network_pair_class: this.networkPairClass, + success: c1DirectSuccess(entry, observedAt, selectedPathObserved, usedRelay), + connection_qualified: c1ConnectionQualified(entry, observedAt), selected_path_observed: selectedPathObserved, + ordered_channel: entry.dc?.ordered === true, used_turn: usedRelay, + ice_setup_sec: entry.iceSetupSec, + qualification_elapsed_sec: (observedAt - entry.startedAtMs) / 1000, + heartbeats_passed: entry.heartbeatsPassed, reason }; + this.trialLogger?.logTrial('C1', payload); + this.emit('c1_trial_complete', payload); + } + + async observeConnectionPath(remoteId, entry, qualifiedAt) { + entry.c1Finalizing = true; + if (entry.c1Deadline !== null) clearTimeout(entry.c1Deadline); + entry.c1Deadline = null; + const callback = captureTransport(this, remoteId); + const current = () => transportPeerCurrent(this, callback, remoteId, entry) && !entry.c1Logged; + // Local RTC stats observation adds no traffic. A bounded missing observation + // cannot turn an unobserved path into a direct-connect success. + entry.statsDeadline = setTimeout(() => { + if (current()) this.finishConnectionTrial(remoteId, entry, qualifiedAt, false, false, 'selected-path-unobserved'); + }, 1000); + entry.statsDeadline?.unref?.(); + try { + const reports = await entry.pc.getStats(); + if (!current()) return; + const rows = [...reports.values()]; + const selected = new Set(rows.filter(row => row.type === 'transport' && typeof row.selectedCandidatePairId === 'string').map(row => row.selectedCandidatePairId)); + const pair = selected.size === 1 ? reports.get([...selected][0]) : null; + const local = pair && reports.get(pair.localCandidateId), remote = pair && reports.get(pair.remoteCandidateId); + const validType = value => ['host', 'srflx', 'prflx', 'relay'].includes(value); + const observed = pair?.type === 'candidate-pair' && pair.state === 'succeeded' + && local?.type === 'local-candidate' && remote?.type === 'remote-candidate' + && validType(local.candidateType) && validType(remote.candidateType); + const relay = observed && (local.candidateType === 'relay' || remote.candidateType === 'relay'); + this.finishConnectionTrial(remoteId, entry, qualifiedAt, observed, relay, observed ? relay ? 'relay-path-observed' : 'direct-path-observed' : 'selected-path-unobserved'); + } catch { + if (current()) this.finishConnectionTrial(remoteId, entry, qualifiedAt, false, false, 'selected-path-unobserved'); } - this.emit('heartbeat', { - remoteId, - count: this.heartbeatTimestampsSec.length, - rttMs, - timestampSec: nowSec - }); } startHeartbeat() { - if (this.hbTimer) return; + if (this.closed || this.hbTimer) return; + const callback = captureTransport(this); this.hbTimer = setInterval(() => { + if (!transportSessionCurrent(this, callback)) return; this.seq++; const now = Date.now(); - this.broadcast({ type: 'ping', seq: this.seq, sentAtMs: now, from: this.peerId }); + this.broadcast({ type: 'ping', seq: this.seq, sentAtMs: now, from: this.routingPeerId }); }, this.heartbeatIntervalMs); } @@ -567,125 +853,265 @@ export class WebRtcTransportNode { } } - sendToPeer(remoteId, payloadObj) { + sendToPeer(remoteId, payloadObj, options = {}) { const entry = this.peers.get(remoteId); if (!entry || !entry.dc || entry.dc.readyState !== 'open') return false; - const raw = JSON.stringify(payloadObj); - entry.dc.send(raw); - this.bytesSent += raw.length; - return true; + if (!entry.flow) this.bindDataChannel(remoteId, entry.dc); + return entry.flow.enqueue(payloadObj, { ...options, onSubmitted: snapshot => this.rememberHeartbeatProbe(entry, snapshot) }); } - broadcast(payloadObj) { - const raw = JSON.stringify(payloadObj); - let sentCount = 0; - for (const { dc } of this.openPeers()) { - try { - dc.send(raw); - this.bytesSent += raw.length; - sentCount++; - } catch {} + /** Count means accepted into bounded local queues, never delivered. */ + broadcast(payloadObj, options = {}) { + let accepted = 0; + for (const { remoteId } of this.openPeers()) { + try { if (this.sendToPeer(remoteId, payloadObj, options)) accepted++; } + catch (error) { this.emit('policy_refused', { remoteId, code: error.code || 'channel-send-refused' }); } } - return sentCount; + return accepted; } - /** - * Publish a state/shard envelope into the public warm relay ring-buffer (`ntfy.sh`) - * so newly opened browsers can recover state even after a 0-peer gap (all tabs closed). - */ - async publishWarmEnvelope(envelopeObj) { - if (typeof fetch === 'undefined') return false; + /** Queue is an in-flight memory bound, not a second resource ledger. */ + _queueRelay(snapshot, scope, consentCurrent, localBroadcast = null) { + const callback = captureTransport(this); + if (!transportSessionCurrent(this, callback) || !consentCurrent()) refuse('relay-not-authorized'); + const retained = [...this.relayPending.values()].reduce((sum, job) => sum + job.snapshot.byteLength, 0); + if (!relayAdmissionAllowed(relayCapacity(this.relayPending.size, retained), snapshot.byteLength)) refuse('relay-outbound-capacity'); + this.relaySession ??= newRelaySession(); + const job = { snapshot, scope, callback, session: this.relaySession, channelKey: this.channelKey, + consentCurrent, localBroadcast, + fetchImpl: scope === 'signal' && !this.publicSignaling ? null : globalThis.fetch?.bind(globalThis), + controller: new AbortController(), timedOut: false, + url: `https://ntfy.sh/${scope === 'warm' ? this.warmCacheTopic() : this.signalTopic()}` }; + this.relayPending.set(job, job); + job.deadline = setTimeout(() => { job.timedOut = true; job.controller.abort(); }, RELAY_LIMITS.requestTimeout); + job.deadline.unref?.(); + job.completion = this._dispatchRelay(job).finally(() => { clearTimeout(job.deadline); this.relayPending.delete(job); }); + return job.completion; + } + + async _dispatchRelay(job) { + const current = () => relayEffectAllowed(this, job.callback.generation, + !job.controller.signal.aborted && this.relaySession === job.session && transportSessionCurrent(this, job.callback), job.consentCurrent()); + let planned = 0, attempted = 0, acknowledged = 0, httpStatus = null, outcome = 'cancelled'; try { - const raw = JSON.stringify({ ...envelopeObj, from: this.peerId, tsMs: Date.now() }); - this.bytesSent += raw.length; - const res = await fetch(`https://ntfy.sh/${this.warmCacheTopic()}`, { - method: 'POST', - body: raw - }); - return res.ok; - } catch { + const framed = job.fetchImpl ? await frameRelayMessage(job.snapshot, { + channelKey: job.channelKey, session: job.session, scope: job.scope }) : { frames: [], bytes: 0 }; + planned = framed.frames.length; + if (!current()) { outcome = job.timedOut ? 'timeout' : 'cancelled'; return false; } + const local = !!job.localBroadcast && this.bc === job.localBroadcast; + // One atomic reservation includes every serialized frame's metadata and + // every actual destination. A failed/partial batch never receives a refund. + const requests = planned + (local ? 1 : 0); + if (!requests) { outcome = 'unavailable'; return false; } + this.admission.reserve(job.scope === 'warm' ? 'place' : 'refresh', { requests, + transferBytes: framed.bytes + (local ? job.snapshot.byteLength : 0) }); + if (local && current() && this.bc === job.localBroadcast) { + job.localBroadcast.postMessage(JSON.parse(job.snapshot.raw)); + this.bytesSent += job.snapshot.byteLength; + } + for (const body of framed.frames) { + if (!current()) { outcome = acknowledged ? 'partial' : (job.timedOut ? 'timeout' : 'cancelled'); return false; } + attempted++; + this.bytesSent += wireBytes(body); + let response; + try { + response = await job.fetchImpl(job.url, { method: 'POST', body, signal: job.controller.signal, + headers: { 'Content-Type': 'text/plain; charset=utf-8', Cache: job.scope === 'signal' ? 'no' : 'yes' } }); + } catch { + outcome = acknowledged ? 'partial' : 'unknown'; return false; + } + httpStatus = response.status ?? null; + if (!response.ok) { outcome = acknowledged ? 'partial' : 'refused'; return false; } + acknowledged++; + } + if (!current()) { outcome = acknowledged ? 'partial' : (job.timedOut ? 'timeout' : 'cancelled'); return false; } + outcome = planned ? 'acknowledged' : 'local-only'; + return planned > 0 && acknowledged === planned; + } catch (error) { + outcome = acknowledged ? 'partial' : 'refused'; + if (transportSessionCurrent(this, job.callback)) this.emit('policy_refused', { code: error.code || 'relay-failed' }); return false; + } finally { + // HTTP acknowledgement is not recipient delivery or a retention receipt. + if (transportSessionCurrent(this, job.callback)) this.emit('relay_publish_result', { + scope: job.scope, outcome, planned, attempted, acknowledged, httpStatus, timedOut: job.timedOut }); } } - /** - * Poll the warm relay ring-buffer (`?poll=1&since=30m`) to recover shards/checkpoints - * that were published before all previous browsers closed. + /** All frames must be HTTP-acknowledged. This is not a durability receipt. */ + async publishWarmEnvelope(envelopeObj, { publicData = false, consentCurrent = () => publicData } = {}) { + if (publicData !== true || !consentCurrent() || !this.publicRelayConsent() || !transportCanSend(this) || typeof fetch === 'undefined') return false; + try { + const snapshot = snapshotRelayMessage({ ...envelopeObj, from: this.peerId, tsMs: Date.now() }); + return await this._queueRelay(snapshot, 'warm', () => publicData === true && consentCurrent() && this.publicRelayConsent()); + } catch (error) { + this.emit('policy_refused', { code: error.code || 'relay-failed' }); + return false; + } + } + + /** One bounded poll snapshot. Incomplete messages are never exposed, and are + * released at the end of this poll. A later poll may recover a complete copy. + * The 30-minute application window does not promise provider retention. */ - async fetchWarmEnvelopes(sinceWindow = '30m') { - if (typeof fetch === 'undefined') return []; + async fetchWarmEnvelopes(sinceWindow = '30m', { publicData = false, consentCurrent = () => publicData } = {}) { + if (publicData !== true || !consentCurrent() || !this.publicRelayConsent() || !transportCanSend(this) || typeof fetch === 'undefined') return []; + if (this.warmPollBusy) { this.emit('policy_refused', { code: 'relay-poll-busy' }); return []; } + const token = { controller: new AbortController() }, callback = captureTransport(this); + const current = () => !token.controller.signal.aborted && transportSessionCurrent(this, callback) && publicData === true && consentCurrent() && this.publicRelayConsent(); + const assembler = new RelayReassembler({ channelKey: this.channelKey, scope: 'warm', admission: this.admission, + current, consentCurrent, chargeIngress: false, verificationPool: this.relayVerificationPool }); + token.assembler = assembler; + token.deadline = setTimeout(() => token.controller.abort(), RELAY_LIMITS.requestTimeout); + token.deadline.unref?.(); + this.warmPollBusy = token; try { - const res = await fetch(`https://ntfy.sh/${this.warmCacheTopic()}/json?poll=1&since=${encodeURIComponent(sinceWindow)}`); - if (!res.ok) return []; - const text = await res.text(); - const lines = text.split('\n').filter(Boolean); + if (typeof sinceWindow !== 'string' || !/^(?:[1-9][0-9]{0,5}[smh]|all)$/.test(sinceWindow)) refuse('relay-poll-window'); + const url = `https://ntfy.sh/${this.warmCacheTopic()}/json?poll=1&since=${encodeURIComponent(sinceWindow)}`; + this.admission.reserve('retrieve', { requests: 1, transferBytes: wireBytes(url) + this.maxRelayResponseBytes }); + if (!current()) return []; + const res = await fetch(url, { signal: token.controller.signal }); + if (!current() || !res.ok) return []; + const text = await readBoundedText(res, this.maxRelayResponseBytes); const envelopes = []; - for (const line of lines) { + let offset = 0, refused = 0; + while (offset < text.length && current()) { + let end = text.indexOf('\n', offset); + if (end < 0) end = text.length; + const line = text.slice(offset, end); offset = end + 1; + if (!line) continue; try { + if (line.length > RELAY_EVENT_BYTES || wireBytes(line) > RELAY_EVENT_BYTES) refuse('relay-event-limit'); const outer = JSON.parse(line); - if (outer.event === 'message' && outer.message) { - const inner = JSON.parse(outer.message); - envelopes.push(inner); - } - } catch {} + if (outer.event !== 'message' || typeof outer.message !== 'string' || outer.attachment) continue; + const envelope = await assembler.accept(outer.message); + if (envelope) envelopes.push(envelope); + } catch { refused++; } } + if (!current()) return []; + this.emit('relay_poll_result', { completed: envelopes.length, refused, incomplete: assembler.state.entries }); return envelopes; - } catch { + } catch (error) { + if (transportSessionCurrent(this, callback)) this.emit('policy_refused', { code: error.code || 'relay-poll-failed' }); return []; + } finally { + clearTimeout(token.deadline); assembler.dispose(); + if (this.warmPollBusy === token) this.warmPollBusy = null; } } connect(channelKey = this.channelKey) { - this.channelKey = channelKey; - if (this.bc) this.bc.close(); - if (this.ws) this.ws.close(); + validateTransportIdentity(this.peerId, channelKey); + // Invalidate callbacks before closing: close events may run synchronously. + // Rejoining the same topic is also a new signaling session. + this.close(); + openTransport(this, channelKey); + this.signaling = new SignalSession(channelKey, { maxPeers: this.maxPeers }); + const callback = captureTransport(this); + const current = () => transportSessionCurrent(this, callback); + this.signalAssembler = new RelayReassembler({ channelKey: this.channelKey, scope: 'signal', + admission: this.admission, current, verificationPool: this.relayVerificationPool }); + const signalAssembler = this.signalAssembler; + const receive = msg => { + if (!current()) return; + this.handleSignal(msg).catch(error => { + if (current()) this.emit('signal_error', { code: error.code || 'signaling-failed' }); + }); + }; if (typeof BroadcastChannel !== 'undefined') { this.bc = new BroadcastChannel(`uor:${this.channelKey}`); this.bc.onmessage = e => { - if (e.data && e.data.from !== this.peerId) this.handleSignal(e.data); + if (current() && e.data && e.data.from !== this.peerId) receive(e.data); }; + // Same-origin peers must not wait for the public signaling provider to + // become reachable. Public discovery still announces when its socket opens. + this.sendSignal({ kind: 'announce' }); } - if (typeof WebSocket !== 'undefined') { + if (this.publicSignaling && typeof WebSocket !== 'undefined') { const topic = this.signalTopic(); try { + this.admission.reserve('refresh', { requests: 1 }); this.ws = new WebSocket(`wss://ntfy.sh/${topic}/ws`); this.ws.onopen = () => { + if (!current()) return; this.emit('signaling_ready', { topic, channelKey: this.channelKey }); + if (!current()) return; this.sendSignal({ kind: 'announce' }); }; - this.ws.onmessage = e => { + this.ws.onmessage = async e => { + if (!current()) return; try { + if (typeof e.data !== 'string' || e.data.length > RELAY_EVENT_BYTES || wireBytes(e.data) > RELAY_EVENT_BYTES) return; const env = JSON.parse(e.data); - if (env.event !== 'message' || !env.message) return; - const msg = JSON.parse(env.message); - if (msg && msg.from !== this.peerId) this.handleSignal(msg); - } catch {} + if (env.event !== 'message' || typeof env.message !== 'string' || env.attachment) return; + const msg = await signalAssembler.accept(env.message); + if (current() && msg && msg.from !== this.peerId) receive(msg); + } catch (error) { + if (current()) this.emit('relay_frame_refused', { scope: 'signal', code: error.code || 'relay-frame' }); + } }; } catch { this.sendSignal({ kind: 'announce' }); } - } else { + } else if (!this.bc) { this.sendSignal({ kind: 'announce' }); } } - sendSignal(payload) { - const frame = { ...payload, from: this.peerId, channelKey: this.channelKey }; - if (this.bc) this.bc.postMessage(frame); - if (typeof fetch !== 'undefined') { - fetch(`https://ntfy.sh/${this.signalTopic()}`, { - method: 'POST', - body: JSON.stringify(frame) - }).catch(() => {}); + /** True means locally queued, not published or delivered. Result events + * distinguish local-only, HTTP acknowledgements, partial and unknown batches. + */ + sendSignal(payload) { return this.enqueueSignal(payload) !== null; } + + enqueueSignal(payload) { + if (!transportCanSend(this)) return null; + try { + // Snapshot caller-owned browser records before asynchronous cryptography. + const input = snapshotRelayMessage(payload); + const retained = [...this.signalSigning.values()].reduce((n, job) => n + job.bytes, 0) + + [...this.relayPending.values()].reduce((n, job) => n + job.snapshot.byteLength, 0); + if (this.signalSigning.size + this.relayPending.size >= RELAY_LIMITS.entries + || retained + input.byteLength > RELAY_LIMITS.retainedBytes) refuse('signal-queue-limit'); + if (!this.bc && typeof fetch === 'undefined') return null; + const callback = captureTransport(this), session = this.signaling; + const job = { bytes: input.byteLength, completion: null }; + this.signalSigning.set(job, job); + job.completion = this.signalTail.then(async () => { + const signed = await session.sign(JSON.parse(input.raw)); + if (!transportSessionCurrent(this, callback) || session !== this.signaling) return null; + this.signalSigning.delete(job); + return await this._queueRelay(snapshotRelayMessage(signed), 'signal', () => true, this.bc); + }).catch(error => { + if (transportSessionCurrent(this, callback)) this.emit('policy_refused', { code: error.code || error.message || 'signal-failed' }); + return null; + }).finally(() => this.signalSigning.delete(job)); + this.signalTail = job.completion; + return job.completion; + } catch (error) { + this.emit('policy_refused', { code: error.code || 'relay-failed' }); + return null; } } async handleSignal(msg) { - if (msg.to && msg.to !== this.peerId) return; + const session = this.signaling, invocation = captureTransport(this); + return session.receive(msg, async authenticated => { + if (!authenticated || !transportSessionCurrent(this, invocation) || this.signaling !== session) return; + if (authenticated.reply) await this.enqueueSignal(authenticated.reply); + if (!transportSessionCurrent(this, invocation) || this.signaling !== session) return; + if (!authenticated.message) return; + msg = { ...authenticated.message, to: this.peerId }; + if (!msg || msg.channelKey !== this.channelKey || typeof msg.from !== 'string' || msg.from.length === 0 || msg.from.length > 128) return; + try { + parseCanonicalJson(JSON.stringify(msg.from), { maxBytes: 1024, maxDepth: 0, maxEntries: 1, maxStringLength: 128 }); + if (msg.to != null) parseCanonicalJson(JSON.stringify(msg.to), { maxBytes: 1024, maxDepth: 0, maxEntries: 1, maxStringLength: 128 }); + } catch { return; } + if (!transportSignalAllowed(this, msg)) return; const remoteId = msg.from; - if (!remoteId || remoteId === this.peerId) return; + const callback = captureTransport(this, remoteId); + const current = entry => transportPeerCurrent(this, callback, remoteId, entry); const existing = this.peers.get(remoteId); if (existing && existing.dc && existing.dc.readyState === 'open') { @@ -693,18 +1119,27 @@ export class WebRtcTransportNode { } if (msg.kind === 'announce') { + // Both authenticated handshake endpoints discover each other. Only one + // key may offer/create the application channel: two crossing channels + // make each ondatachannel replace the other's still-live receive flow. + if (this.routingPeerId >= remoteId || existing?.pc.localDescription) return; const entry = this.getOrCreatePeer(remoteId, true); const offer = await entry.pc.createOffer(); + if (!current(entry)) return; await entry.pc.setLocalDescription(offer); + if (!current(entry)) return; this.sendSignal({ kind: 'offer', to: remoteId, sdp: entry.pc.localDescription }); } else if (msg.kind === 'offer') { - if (existing && existing.pc.signalingState === 'have-local-offer' && this.peerId < remoteId) { + if (existing && existing.pc.signalingState === 'have-local-offer' && (this.routingPeerId) < remoteId) { return; // Deterministic glare resolution } const entry = this.getOrCreatePeer(remoteId, false); await entry.pc.setRemoteDescription(new RTCSessionDescription(msg.sdp)); + if (!current(entry)) return; const answer = await entry.pc.createAnswer(); + if (!current(entry)) return; await entry.pc.setLocalDescription(answer); + if (!current(entry)) return; this.sendSignal({ kind: 'answer', to: remoteId, sdp: entry.pc.localDescription }); } else if (msg.kind === 'answer') { if (existing && existing.pc.signalingState === 'have-local-offer') { @@ -717,16 +1152,28 @@ export class WebRtcTransportNode { } catch {} } } + }); } close() { + closeTransport(this); + const broadcast = this.bc, socket = this.ws; + this.bc = null; this.ws = null; + this.signaling?.close(); + this.signalSigning?.clear(); + this.signalTail = Promise.resolve(); + this.relaySession = null; + for (const job of this.relayPending.values()) job.controller.abort(); + this.warmPollBusy?.controller.abort(); + this.warmPollBusy?.assembler.dispose(); + this.signalAssembler?.dispose(); + this.signalAssembler = null; this.stopHeartbeat(); - for (const { dc, pc } of this.peers.values()) { - if (dc) dc.close(); - if (pc) pc.close(); - } + const peers = [...this.peers.entries()]; this.peers.clear(); - if (this.bc) this.bc.close(); - if (this.ws) this.ws.close(); + for (const [remoteId, entry] of peers) this.disposePeer(remoteId, entry, 'transport-closed'); + // Close only captured providers: disposal observers may reconnect. + if (broadcast) broadcast.close(); + if (socket) socket.close(); } } diff --git a/src/layer5-transport/relay-framing.js b/src/layer5-transport/relay-framing.js new file mode 100644 index 0000000..b8e6d85 --- /dev/null +++ b/src/layer5-transport/relay-framing.js @@ -0,0 +1,262 @@ +/** Stitch application framing over ntfy's bounded text-message API. + * No attachment URLs are followed. SHA-256 binds reconstructed bytes, not a + * publisher identity, availability, durable retention, or delivery to a peer. + */ +import { model } from '../layer1-uor/generated-model.js'; +import { parseCanonicalJson, sha256Bytes } from '../layer1-uor/custody.js'; +import { natural, record, refuse } from '../layer1-uor/contracts.js'; +import { wireBytes } from '../layer2-schedulers/policy.js'; + +const call = (name, ...args) => model[`Stitch.Relay.${name}`](...args); +const utf8 = new TextEncoder(); +const ascii = value => utf8.encode(value); +const limits = call('limits'); +export const RELAY_LIMITS = Object.freeze(Object.fromEntries(Object.entries(limits).map(([key, value]) => [key, Number(value)]))); +export const RELAY_LIFETIMES = Object.freeze({ signal: Number(call('signalLifetime')), warm: Number(call('warmLifetime')) }); +export const RELAY_EVENT_BYTES = 16 * 1024; +const KEYS = ['v', 'p', 'c', 's', 'm', 't', 'b', 'n', 'i', 'x']; +const JSON_LIMITS = Object.freeze({ maxBytes: RELAY_LIMITS.messageBytes, maxDepth: 32, + maxEntries: Math.floor(RELAY_LIMITS.messageBytes / 2) + 1, maxStringLength: RELAY_LIMITS.messageBytes }); +const hexDigest = value => typeof value === 'string' && /^sha256:[0-9a-f]{64}$/.test(value); +const validPurpose = value => typeof value === 'string' && Object.hasOwn(RELAY_LIFETIMES, value); +const purpose = value => { if (!validPurpose(value)) refuse('relay-purpose'); return value; }; +const objectEnvelope = value => value && typeof value === 'object' && !Array.isArray(value); + +export const relayCapacity = (entries = 0, retainedBytes = 0, tombstones = 0) => ({ entries, retainedBytes, tombstones }); +export const relayAdmissionAllowed = (capacity, bytes) => call('admissionAllowed', limits, capacity, bytes); +export const relayEffectAllowed = (node, capturedGeneration, sessionMatches, consentCurrent) => + call('effectAllowed', node.closed, node.generation, capturedGeneration, sessionMatches, consentCurrent); + +export function newRelaySession() { + if (!globalThis.crypto?.getRandomValues) refuse('relay-crypto-unavailable'); + return Array.from(globalThis.crypto.getRandomValues(new Uint8Array(16)), byte => byte.toString(16).padStart(2, '0')).join(''); +} + +/** JSON is snapshotted before any await; a digest never binds a mutable object. */ +export function snapshotRelayMessage(value) { + const raw = JSON.stringify(value); + if (typeof raw !== 'string') refuse('relay-envelope'); + const bytes = utf8.encode(raw); + if (!bytes.length || bytes.length > RELAY_LIMITS.messageBytes) refuse('relay-message-limit'); + if (!objectEnvelope(parseCanonicalJson(raw, JSON_LIMITS))) refuse('relay-envelope'); + return Object.freeze({ raw, byteLength: bytes.length }); +} + +export async function relayChannel(channelKey) { + if (typeof channelKey !== 'string') refuse('relay-channel'); + // JSON escapes lone UTF-16 surrogates, preserving exact browser topic identity. + const raw = JSON.stringify(channelKey); + if (wireBytes(raw) > RELAY_LIMITS.messageBytes) refuse('relay-channel-limit'); + return sha256Bytes(utf8.encode(raw), 'relay-channel'); +} + +export function encodeBase64Url(bytes) { + let binary = ''; + for (const byte of bytes) binary += String.fromCharCode(byte); + return btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); +} + +export function decodeBase64Url(value) { + if (typeof value !== 'string' || !/^[A-Za-z0-9_-]+$/.test(value) || value.length % 4 === 1 + || value.length > Math.ceil(RELAY_LIMITS.chunkBytes * 4 / 3)) refuse('relay-base64'); + let binary; + try { binary = atob(value.replace(/-/g, '+').replace(/_/g, '/') + '='.repeat((4 - value.length % 4) % 4)); } + catch { refuse('relay-base64'); } + const bytes = Uint8Array.from(binary, character => character.charCodeAt(0)); + // Reject nonzero pad bits, padding and alternate encodings (RFC4648 section3.5). + if (encodeBase64Url(bytes) !== value) refuse('relay-base64'); + return bytes; +} + +export async function frameRelayMessage(snapshot, { channelKey, session, scope, createdAtMs = Date.now() }) { + purpose(scope); natural(createdAtMs); + if (!/^[0-9a-f]{32}$/.test(session)) refuse('relay-session'); + const { raw } = snapshot; + const bytes = utf8.encode(raw); + if (typeof raw !== 'string' || bytes.length !== snapshot.byteLength + || !bytes.length || bytes.length > RELAY_LIMITS.messageBytes) refuse('relay-message-limit'); + // The caller owns this immutable snapshot until framing completes. + const [channel, digest] = await Promise.all([relayChannel(channelKey), sha256Bytes(bytes, 'relay-message')]); + const count = Math.ceil(bytes.length / RELAY_LIMITS.chunkBytes); + if (count > RELAY_LIMITS.frames) refuse('relay-frame-limit'); + const frames = []; + for (let index = 0; index < count; index++) { + const frame = { v: 'stitch/1', p: scope, c: channel, s: session, m: digest, t: createdAtMs, + b: bytes.length, n: count, i: index, + x: encodeBase64Url(bytes.subarray(index * RELAY_LIMITS.chunkBytes, (index + 1) * RELAY_LIMITS.chunkBytes)) }; + const serialized = JSON.stringify(frame); + if (wireBytes(serialized) > RELAY_LIMITS.wireBytes) refuse('relay-wire-limit'); + frames.push(serialized); + } + return { frames, digest, bytes: frames.reduce((sum, frame) => sum + wireBytes(frame), 0) }; +} + +const identity = frame => ({ channel: ascii(frame.c), session: ascii(frame.s), digest: ascii(frame.m), purpose: ascii(frame.p), + created: frame.t, messageBytes: frame.b, frames: frame.n }); +const frameState = (frame, payloadBytes, length) => ({ identity: identity(frame), index: frame.i, payloadBytes, wireBytes: length }); +const keyOf = frame => `${frame.p}:${frame.c}:${frame.s}:${frame.m}`; + +/** Bounded session-local assembler. Active payload buffers, pending inputs and + * completed/rejected tombstones all have independent, explicit ceilings. + * Cleanup uses the local monotonic clock, never a sender-controlled extension. + */ +export class RelayReassembler { + #entries = new Map(); + #tombstones = new Map(); + #capacity = relayCapacity(); + #pendingInputs = 0; + #lastNow = 0; + #generation = 0; + #disposed = false; + #timer = null; + constructor({ channelKey, scope, admission, clock = () => Math.floor(performance.now()), wallClock = Date.now, + current = () => true, consentCurrent = () => true, chargeIngress = true, automaticCleanup = true, verificationPool = new Map() } = {}) { + this.scope = purpose(scope); this.channelKey = channelKey; + this.channel = relayChannel(channelKey); + // A constructor's rejected promise must not become an unhandled rejection. + this.channel.catch(() => {}); + this.admission = admission; + this.clock = clock; this.wallClock = wallClock; + this.current = current; this.consentCurrent = consentCurrent; + this.chargeIngress = chargeIngress; this.automaticCleanup = automaticCleanup; + this.verificationPool = verificationPool; + } + get state() { + this.#prune(this.#now()); + return { entries: Number(this.#capacity.entries), retainedBytes: Number(this.#capacity.retainedBytes), + tombstones: this.#tombstones.size, pendingInputs: this.#pendingInputs, disposed: this.#disposed }; + } + #now() { + const now = this.clock(); natural(now); + if (now < this.#lastNow) refuse('relay-clock-regression'); + this.#lastNow = now; return now; + } + #schedule(now) { + if (this.#timer !== null) clearTimeout(this.#timer); + this.#timer = null; + if (!this.automaticCleanup || this.#disposed) return; + const deadlines = [...this.#entries.values()].filter(entry => !entry.cancelled).map(entry => Math.min(entry.started + RELAY_LIMITS.assemblyAge, entry.expires)) + .concat([...this.#tombstones.values()]); + if (!deadlines.length) return; + this.#timer = setTimeout(() => { + this.#timer = null; + try { this.#prune(this.#now()); } catch { this.dispose(); } + }, Math.max(1, Math.min(...deadlines) - now)); + this.#timer.unref?.(); + } + #retire(key, entry, now) { + if (this.#entries.get(key) !== entry) return; + // A pending host digest still owns the immutable input buffer. Cancellation + // may fence delivery, but cannot release its resident-memory reservation. + if (entry.verificationPending) { entry.cancelled = true; this.#schedule(now); return; } + this.#entries.delete(key); + entry.buffer = null; entry.seen = null; + this.#capacity = call('release', this.#capacity, entry.header.b); + this.#tombstones.set(key, entry.expires); + this.#schedule(now); + } + #prune(now) { + for (const [key, entry] of this.#entries) { + if (now >= entry.started + RELAY_LIMITS.assemblyAge || now >= entry.expires) this.#retire(key, entry, now); + } + for (const [key, expires] of this.#tombstones) if (now >= expires) this.#tombstones.delete(key); + this.#capacity = { ...this.#capacity, tombstones: this.#tombstones.size }; + this.#schedule(now); + } + dispose() { + this.#disposed = true; this.#generation++; + if (this.#timer !== null) clearTimeout(this.#timer); + this.#timer = null; + for (const [key, entry] of this.#entries) this.#retire(key, entry, this.#lastNow); + this.#tombstones.clear(); + this.#capacity = { ...this.#capacity, tombstones: 0 }; + } + /** Returns one complete verified logical envelope, or null. Refusals throw a + * bounded machine-readable error; a corrupt assembly is tombstoned, not retried. + */ + async accept(raw) { + if (this.#disposed || !this.current() || !this.consentCurrent()) return null; + if (typeof raw !== 'string' || raw.length > RELAY_LIMITS.wireBytes) refuse('relay-wire-limit'); + const length = wireBytes(raw); + if (length > RELAY_LIMITS.wireBytes) refuse('relay-wire-limit'); + if (this.#pendingInputs >= RELAY_LIMITS.frames) refuse('relay-input-capacity'); + this.admission?.reserve('retrieve', { computeSteps: 1, ...(this.chargeIngress ? { transferBytes: length } : {}) }); + this.#pendingInputs++; + const generation = this.#generation; + try { + const frame = parseCanonicalJson(raw, { maxBytes: RELAY_LIMITS.wireBytes, maxDepth: 2, maxEntries: 16, + maxStringLength: RELAY_LIMITS.wireBytes }); + record(frame, KEYS); + if (frame.v !== 'stitch/1' || frame.p !== this.scope || !hexDigest(frame.c) || !hexDigest(frame.m) + || typeof frame.s !== 'string' || !/^[0-9a-f]{32}$/.test(frame.s)) refuse('relay-frame'); + for (const field of ['t', 'b', 'n', 'i']) natural(frame[field]); + // Reject count/length before decoding or allocating message-sized buffers. + if (!frame.b || frame.b > RELAY_LIMITS.messageBytes || !frame.n || frame.n > RELAY_LIMITS.frames + || frame.i >= frame.n) refuse('relay-frame-limit'); + const chunk = decodeBase64Url(frame.x); + const state = frameState(frame, chunk.length, length); + const channel = await this.channel; + if (this.#disposed || generation !== this.#generation || !this.current() || !this.consentCurrent()) return null; + const now = this.#now(), wallNow = this.wallClock(); natural(wallNow); + this.#prune(now); + if (!call('frameAllowed', limits, state, ascii(channel), ascii(this.scope), wallNow, RELAY_LIFETIMES[this.scope])) refuse('relay-frame'); + const key = keyOf(frame); + if (this.#tombstones.has(key)) return null; + let entry = this.#entries.get(key); + if (entry && !call('sameIdentity', entry.state.identity, state.identity)) { + this.#retire(key, entry, now); refuse('relay-mixed-message'); + } + if (!entry) { + // Include verification work retained by older transport generations. + const older = [...this.verificationPool.values()].filter(item => item.owner !== this); + const capacity = relayCapacity(Number(this.#capacity.entries) + older.length, + Number(this.#capacity.retainedBytes) + older.reduce((sum, item) => sum + item.bytes, 0), this.#tombstones.size); + if (!relayAdmissionAllowed(capacity, frame.b)) refuse('relay-reassembly-capacity'); + this.admission?.reserve('retrieve', { storageBytes: frame.b, computeSteps: frame.b + frame.n }); + const expires = now + Math.min(RELAY_LIFETIMES[this.scope], Math.max(0, frame.t + RELAY_LIFETIMES[this.scope] - wallNow)); + entry = { header: { b: frame.b }, cancelled: false, verificationPending: false, buffer: new Uint8Array(frame.b), seen: new Uint8Array(frame.n), started: now, expires, + state: { identity: state.identity, receivedFrames: 0, receivedBytes: 0, started: now, last: now, verifying: false } }; + this.#entries.set(key, entry); + this.#capacity = call('admitCapacity', limits, this.#capacity, frame.b); + } + if (entry.cancelled) return null; + const offset = frame.i * RELAY_LIMITS.chunkBytes; + if (entry.seen[frame.i]) { + if (chunk.some((byte, index) => entry.buffer[offset + index] !== byte)) { + this.#retire(key, entry, now); refuse('relay-conflicting-duplicate'); + } + return null; + } + if (!call('appendAllowed', limits, entry.state, state, now, false)) refuse('relay-assembly-state'); + entry.buffer.set(chunk, offset); entry.seen[frame.i] = 1; + entry.state = call('append', limits, entry.state, state, now, false); + this.#schedule(now); + if (!call('ready', entry.state)) return null; + entry.state = call('beginVerification', entry.state); + const bytes = entry.buffer; + let result = null; + try { + const pendingBytes = [...this.verificationPool.values()].reduce((sum, item) => sum + item.bytes, 0); + if (!relayAdmissionAllowed(relayCapacity(this.verificationPool.size, pendingBytes), frame.b)) refuse('relay-verification-capacity'); + entry.verificationPending = true; + this.verificationPool.set(entry, { owner: this, bytes: frame.b }); + const digestVerified = await sha256Bytes(bytes, 'relay-message') === frame.m; + if (!digestVerified) refuse('relay-integrity'); + const decoded = new TextDecoder('utf-8', { fatal: true }).decode(bytes); + const envelope = parseCanonicalJson(decoded, JSON_LIMITS); + const envelopeValid = objectEnvelope(envelope) && typeof envelope.from === 'string' && envelope.from.length > 0 && envelope.from.length <= 128 + && (this.scope !== 'signal' || envelope.channelKey === this.channelKey); + const stillCurrent = !entry.cancelled && !this.#disposed && generation === this.#generation && this.#entries.get(key) === entry && this.current(); + const currentConsent = this.consentCurrent(); + const finishedAt = this.#now(); + if (finishedAt >= entry.started + RELAY_LIMITS.assemblyAge || finishedAt >= entry.expires) return null; + if (call('deliveryAllowed', entry.state, digestVerified, true, !!envelopeValid, stillCurrent, currentConsent)) result = envelope; + else if (!envelopeValid) refuse('relay-envelope'); + return result; + } finally { + entry.verificationPending = false; this.verificationPool.delete(entry); + this.#retire(key, entry, this.#now()); + } + } finally { this.#pendingInputs--; } + } +} diff --git a/src/layer5-transport/signaling.js b/src/layer5-transport/signaling.js new file mode 100644 index 0000000..47c5ca8 --- /dev/null +++ b/src/layer5-transport/signaling.js @@ -0,0 +1,126 @@ +/** Authenticated, session-bound signaling. Key ownership is not human identity. + * Discovery is public; a key is bound to one remote incarnation until reconnect. + */ +import { canonicalBytes, exactKeys } from '../layer1-uor/custody.js'; +import { model } from '../layer1-uor/generated-model.js'; +const PROFILE = 'stitch.signal/1'; +const b64 = bytes => btoa(String.fromCharCode(...bytes)).replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/, ''); +function bytes(value, length) { + if (typeof value !== 'string' || !/^[A-Za-z0-9_-]+$/.test(value)) throw Error('signal-encoding'); + const out = Uint8Array.from(atob(value.replaceAll('-', '+').replaceAll('_', '/')), c => c.charCodeAt(0)); + if (out.length !== length || b64(out) !== value) throw Error('signal-encoding'); + return out; +} +const token = () => b64(crypto.getRandomValues(new Uint8Array(24))); +const encode = value => canonicalBytes(value, { maxBytes: 524288, maxStringLength: 524288 }); +const snapshot = value => JSON.parse(new TextDecoder().decode(encode(value))); +const allowed = new Set(['announce', 'hello', 'ready', 'offer', 'answer', 'ice']); +async function keyId(raw) { return 'key-' + b64(new Uint8Array(await crypto.subtle.digest('SHA-256', raw))); } + +export class SignalSession { + constructor(channelKey, { maxPeers = 64, maxVerifications = 8 } = {}) { + this.channelKey = channelKey; + this.session = token(); + this.maxPeers = maxPeers; + this.maxVerifications = maxVerifications; + this.active = true; + this.verifying = 0; + this.queuedBytes = 0; + this.receiveTail = Promise.resolve(); + this.sequence = 0; + this.peers = new Map(); + this.pending = new Map(); + // Lazy key generation avoids unhandled promises on unused transport nodes. + this.identityPromise = null; + } + identity() { + return this.identityPromise ??= (async () => { + const pair = await crypto.subtle.generateKey({ name: 'Ed25519' }, false, ['sign', 'verify']); + const raw = new Uint8Array(await crypto.subtle.exportKey('raw', pair.publicKey)); + this.id = await keyId(raw); + return { ...pair, publicKeyText: b64(raw), id: this.id }; + })(); + } + close() { this.active = false; this.peers.clear(); this.pending.clear(); } + async sign(payload) { + const copy = snapshot(payload); + if (!allowed.has(copy.kind)) throw Error('signal-kind'); + const identity = await this.identity(); + if (!this.active || this.sequence === Number.MAX_SAFE_INTEGER) throw Error('signal-closed'); + const to = copy.to ?? null; + const targetSession = copy.targetSession ?? (to ? this.peers.get(to)?.session : null); + if (copy.kind !== 'announce' && (!to || !targetSession)) throw Error('signal-unbound-peer'); + delete copy.to; delete copy.targetSession; + const body = { profile: PROFILE, channelKey: this.channelKey, from: identity.id, + publicKey: identity.publicKeyText, session: this.session, sequence: ++this.sequence, + to, targetSession, payload: copy }; + const signature = b64(new Uint8Array(await crypto.subtle.sign('Ed25519', identity.privateKey, encode(body)))); + if (!this.active) throw Error('signal-closed'); + return { ...body, signature }; + } + receive(input, consume = null) { + // One bounded FIFO owns verification AND its RTC continuation. Crypto + // completion order must never masquerade as wire replay/reordering. + if (!this.active || this.verifying >= this.maxVerifications) return Promise.resolve(null); + let m, size; + try { + const serialized = encode(input); size = serialized.byteLength; + if (this.queuedBytes + size > 2097152) return Promise.resolve(null); + m = JSON.parse(new TextDecoder().decode(serialized)); + } catch { return Promise.resolve(null); } + this.verifying++; this.queuedBytes += size; + const work = this.receiveTail.then(async () => { + const result = this.active ? await this.verifyReceived(m) : null; + if (consume) await consume(result); + return result; + }).finally(() => { this.verifying--; this.queuedBytes -= size; }); + this.receiveTail = work.catch(() => {}); + return work; + } + async verifyReceived(m) { + try { + exactKeys(m, ['profile','channelKey','from','publicKey','session','sequence','to','targetSession','payload','signature']); + if (m.profile !== PROFILE || m.channelKey !== this.channelKey || !allowed.has(m.payload?.kind) + || !Number.isSafeInteger(m.sequence) || m.sequence < 1) return null; + bytes(m.session, 24); + const kind = m.payload.kind; + const identity = await this.identity(); + if (m.from === identity.id) return null; + if (kind === 'announce' ? m.to !== null || m.targetSession !== null + : m.to !== identity.id || m.targetSession !== this.session) return null; + const raw = bytes(m.publicKey, 32), signature = bytes(m.signature, 64); + if (await keyId(raw) !== m.from) return null; + const key = await crypto.subtle.importKey('raw', raw, 'Ed25519', false, ['verify']); + const { signature: _, ...body } = m; + const verified = await crypto.subtle.verify('Ed25519', key, signature, encode(body)); + if (!this.active || !verified) return null; + // FIFO verification commits replay state before the next admission. + // Never evict a replay record during the live session. + let peer = this.peers.get(m.from); + if (peer && peer.session !== m.session) return null; + if (peer && m.sequence <= peer.sequence) return null; + if (kind === 'announce') { + if (peer || this.pending.has(m.from) || this.pending.size + this.peers.size >= this.maxPeers) return null; + this.pending.set(m.from, { session: m.session, sequence: m.sequence }); + return { reply: { kind: 'hello', to: m.from, targetSession: m.session } }; + } + if (kind === 'ready') { + const challenge = this.pending.get(m.from); + if (!challenge || challenge.session !== m.session || m.sequence <= challenge.sequence) return null; + } + const handshake = kind === 'hello' || kind === 'ready'; + if (!model['Stitch.Signaling.admissionAllowed'](true, this.active, true, !!peer || handshake, + BigInt(m.sequence), BigInt(peer?.sequence ?? 0))) return null; + if (!peer) { + if (!handshake || this.peers.size + this.pending.size - Number(this.pending.has(m.from)) >= this.maxPeers) return null; + peer = { session: m.session, sequence: 0 }; this.peers.set(m.from, peer); + } + peer.sequence = m.sequence; + this.pending.delete(m.from); + const message = { ...m.payload, from: m.from, channelKey: m.channelKey, to: m.to }; + // No sender-controlled routing fields can override authenticated fields. + if (handshake) message.kind = 'announce'; + return { message, reply: kind === 'hello' ? { kind: 'ready', to: m.from } : null }; + } catch { return null; } + } +} diff --git a/src/product-experience.js b/src/product-experience.js new file mode 100644 index 0000000..a018667 --- /dev/null +++ b/src/product-experience.js @@ -0,0 +1,148 @@ +/** + * Handwritten DOM adapter for source-projected Product.Experience declarations. + * This reads existing runtime observations. It does not keep a second effect, + * custody, publication or resource ledger, and is not a host certificate. + */ +import { model, MODEL_SOURCE } from './layer1-uor/generated-model.js'; + +const project = (name, ...args) => model[`Product.Experience.${name}`](...args); +export const operatorJourneys = Object.freeze(project('journeys')); +export const operatorActions = Object.freeze(project('actions')); +export const experienceProvenance = Object.freeze({ + source: 'app/src/Product/Experience.lex.tex', + sourceSha256: MODEL_SOURCE.sources.find(s => s.path === 'app/src/Product/Experience.lex.tex').sha256, + assurance: 'Project-owned source projection and handwritten DOM adapter; not whole-host certification', +}); + +export function experienceFacts(observations = {}) { + // Reject undeclared or inexact observations through the same source evaluator. + const facts = { ...project('initialFacts'), ...observations }; + project('actionAllowed', 15, facts); + return facts; +} +export const experienceView = (journey, facts) => project(`${journey}View`, facts); +export const experienceActionAllowed = (control, facts) => { + const action = operatorActions.find(a => a.control === control); + return Boolean(action && project('actionAllowed', action.code, facts)); +}; +export const integrityLabel = verified => project('integrityLabel', verified); +export const executionLabel = replayed => project('executionLabel', replayed); + +/** Native buttons retain Enter/Space semantics; navigation never changes the + * mesh-key URL hash or browser history. Focus moves only on explicit navigation, + * never on asynchronous status updates. Scrolling is nonanimated, including for + * reduced-motion users. Model text always enters the DOM via textContent. + */ +export function createOperatorExperience({ document, snapshot, onRefused = () => {} }) { + const get = id => document.getElementById(id); + const styles = new Map(project('evidenceStyles').map(s => [s.id, s.color])); + const facts = () => experienceFacts(snapshot()); + let selected = operatorJourneys[0].id; + const previousViews = new Map(); + const nav = get('operatorJourneyNav'); + nav.setAttribute('aria-label', project('navigationLabel')); + const buttons = new Map(); + const descriptions = new Map(operatorActions.map(action => { + const control = get(action.control); + return [action.control, control.getAttribute?.('aria-describedby') || control.attributes?.['aria-describedby'] || '']; + })); + function report(control, message) { + const action = operatorActions.find(a => a.control === control); + if (action) get(`${action.journey}ActionStatus`).textContent = message; + } + function navigate(journey) { + selected = journey.id; + render(); + const target = get(journey.target); + // Selected context is source-owned. Existing inputs and domain state are retained. + if (project('focusNavigationTarget')) target.focus({ preventScroll: true }); + target.scrollIntoView({ behavior: project('navigationScrollBehavior'), block: 'start' }); + } + nav.replaceChildren(...operatorJourneys.map(journey => { + const button = document.createElement('button'); + button.type = 'button'; button.className = 'secondary'; + button.textContent = journey.title; + button.setAttribute('aria-controls', journey.target); + button.addEventListener('click', () => navigate(journey)); + buttons.set(journey.id, button); + const target = get(journey.target); + target.tabIndex = -1; + target.setAttribute('aria-labelledby', `${journey.id}Title`); + get(`${journey.id}Title`).textContent = journey.title; + get(`${journey.id}ExplanationLabel`).textContent = project('explanationLabel'); + const evidence = get(`${journey.id}Evidence`); + evidence.setAttribute('role', 'status'); + evidence.setAttribute('aria-live', project('statusLivePolicy')); + evidence.setAttribute('aria-atomic', 'true'); + return button; + })); + get('reviewResourcePolicyBtn').textContent = project('recoveryPolicyLabel'); + get('reviewResourcePolicyBtn').addEventListener('click', () => navigate(operatorJourneys.find(j => j.id === 'resources'))); + get('productTitle').textContent = project('productTitle'); + get('meshDisclosureText').textContent = project('disclosureLabel'); + get('relayDisclosureText').textContent = project('relayLabel'); + get('experienceProvenance').textContent = project('provenanceLabel'); + get('experienceProvenance').setAttribute('data-model-source-sha256', experienceProvenance.sourceSha256); + function render() { + const observation = facts(); + for (const [index, journey] of operatorJourneys.entries()) { + const view = experienceView(journey.id, observation); + const evidence = get(`${journey.id}Evidence`); + const text = `${view.title}. ${view.evidence}.`; + get(journey.target).hidden = !project('journeyVisible', operatorJourneys.findIndex(j => j.id === selected), index); + get(`${journey.id}Explanation`).textContent = view.detail; + if (previousViews.get(journey.id) !== view.id) { + get(`${journey.id}ExplanationPanel`).open = project('explanationInitiallyOpen', observation, index); + previousViews.set(journey.id, view.id); + } + // Avoid repeating unchanged polite announcements on each scheduler tick. + if (evidence.textContent !== text) evidence.textContent = text; + evidence.setAttribute('data-experience-state', view.id); + const tone = project('viewStyle', observation, index); + evidence.setAttribute('data-evidence-style', tone); + evidence.style.color = styles.get(tone); + evidence.style.borderInlineStartColor = styles.get(tone); + buttons.get(journey.id).setAttribute('aria-current', journey.id === selected ? 'location' : 'false'); + if (journey.id === selected) { + get('operatorJourneySummary').textContent = journey.summary; + get('operatorNextActions').textContent = operatorActions.filter(a => a.journey === selected && + project('actionAllowed', a.code, observation)).map(a => a.label).join(' · ') || view.detail; + } + } + const recovery = project('recoveryView', observation); + get('recoveryEvidence').textContent = `${recovery.title}. ${recovery.evidence}. ${recovery.detail}`; + get('reviewResourcePolicyBtn').hidden = !project('recoveryPolicyVisible', observation); + get('pointerPublicationSetup').hidden = !project('publicationSetupVisible', observation); + get('pointerAdmissionControls').hidden = !project('admissionInputVisible', observation); + if (project('publicationSetupInitiallyOpen', observation)) get('pointerPublicationSetup').open = true; + get('vmCommandControls').hidden = !project('vmCommandVisible', observation); + // Keep experimental output contextual even if it was opened on an earlier visit. + if (selected !== 'resources') get('metricsLabSection').style.display = 'none'; + for (const action of operatorActions) { + const control = get(action.control); + control.textContent = action.label; + control.title = action.help; + control.setAttribute('aria-describedby', [...new Set(`${descriptions.get(action.control)} ${action.journey}Evidence ${action.journey}ActionStatus`.trim().split(/\s+/))].join(' ')); + control.disabled = !project('actionAllowed', action.code, observation); + // A separate control makes reconciliation explicit, not a renamed write. + if (action.id === 'publish') control.hidden = observation.publicationUnknown; + if (action.id === 'reconcile') control.hidden = !observation.publicationUnknown; + } + return observation; + } + function allow(control) { + const observation = render(); + if (experienceActionAllowed(control, observation)) return true; + const action = operatorActions.find(a => a.control === control); + const message = action ? `${action.label}: ${action.help}` : 'Unknown operator action refused.'; + report(control, message); + onRefused(message); + return false; + } + render(); + return Object.freeze({ facts, render, allow, report, navigate: id => { + const journey = operatorJourneys.find(j => j.id === id); + if (!journey) throw new TypeError('Unknown operator journey'); + navigate(journey); + } }); +} diff --git a/src/recovery-ui.js b/src/recovery-ui.js new file mode 100644 index 0000000..c112e0f --- /dev/null +++ b/src/recovery-ui.js @@ -0,0 +1,170 @@ +/** Explicit local recovery journey. Never invokes a mesh, VM or DNS adapter. */ +import { RecoveryVault, RECOVERY_LIMITS, recoveryObject, exportRecoveryBundle } from './recovery.js'; +import { resumeProgram, programWork } from './layer4-compute/replay.js'; +export function installRecoveryControls({ document, liveDb, computeCoord, pointerObservers, pointerObserver, bindModelAction, onChange = () => {} }) { + const get = id => document.getElementById(id); + const vault = new RecoveryVault(); + let busy = false, restoreGeneration = 0; + const status = message => { get('recoveryStatus').textContent = message; }; + const download = (bytes, name, type) => { + const url = URL.createObjectURL(new Blob([bytes], { type })); + const link = document.createElement('a'); link.href = url; link.download = name; link.click(); + setTimeout(() => URL.revokeObjectURL(url), 0); + }; + function replaceChoices(id, choices, empty) { + const control = get(id), previous = control.value; + if (!choices.length) { + const option = document.createElement('option'); option.value = ''; option.textContent = empty; option.disabled = true; + choices = [option]; + } + control.replaceChildren(...choices); + if (choices.some(option => option.value === previous)) control.value = previous; + } + const liveScope = () => ({ name: get('dnsQueryInput').value.trim(), authorityKey: get('pointerAuthorityInput').value.trim() }); + function selectedAcceptance(state = vault.snapshot()) { + const supplied = state.bundle.anchors.find(a => a.name === get('recoveryAnchors').value); + return state.acceptedAnchors.find(a => a.pointerDigest === supplied?.pointerDigest && + a.authorityKey === get('recoveryAuthority').value.trim() && a.pointerDigest === get('recoveryDigest').value.trim()); + } + function render() { + const snapshot = vault.snapshot(); + replaceChoices('recoveryObjects', snapshot.bundle.objects.map(o => { + const option = document.createElement('option'); option.value = o.manifest.object.contentDigest; + option.textContent = `${o.manifest.object.byteLength} bytes · ${option.value}`; return option; + }), 'No objects imported'); + replaceChoices('recoveryJobs', snapshot.bundle.jobs.map(j => { + const option = document.createElement('option'); option.value = j.checkpoint.jobId; + option.textContent = `${j.checkpoint.stepIndex}/${j.program.instructions.length} steps · ${option.value}`; return option; + }), 'No jobs imported'); + replaceChoices('recoveryAnchors', snapshot.bundle.anchors.map(a => { + const option = document.createElement('option'); option.value = a.name; + option.textContent = `${a.name} · revision ${a.revision} · ${snapshot.acceptedAnchors.some(x => x.pointerDigest === a.pointerDigest) ? 'operator-accepted' : 'untrusted supplied evidence'}`; + return option; + }), 'No anchors imported'); + } + function bind(id, action) { + bindModelAction(id, async () => { + if (busy) return; + busy = true; + get('recoveryControls').setAttribute('aria-busy', 'true'); + status('Recovery operation in progress. No mesh, VM or DNS effects are started by these controls.'); + onChange(); + const controls = [...get('recoveryControls').querySelectorAll('button')]; controls.forEach(c => { c.disabled = true; }); + try { await action(); render(); } + catch (error) { status(`Refused; retained recovery evidence unchanged: ${error.code || error.message}`); } + finally { busy = false; get('recoveryControls').setAttribute('aria-busy', 'false'); onChange(); } + }); + } + const options = () => ({ wireBytes: Number(get('recoveryByteLimit').value), replaySteps: Number(get('recoveryStepLimit').value) }); + get('recoveryByteLimit').value = RECOVERY_LIMITS.wireBytes; + get('recoveryStepLimit').value = RECOVERY_LIMITS.replaySteps; + let exportSelectionInitialized = false; + function refreshExportSelection() { + const previous = new Map([...get('recoveryExportSelection').selectedOptions].map(option => [option.value, true])); + const rows = [ + ...[...liveDb.objects.entries()].filter(([, e]) => e.verified && e.bytes).map(([key, e]) => ({ key: `object:${key}`, label: `Object ${e.label || key} (${e.bytes.length} bytes)` })), + ...[...computeCoord.jobs.entries()].map(([key, j]) => ({ key: `job:${key}`, label: `Job ${key} (${j.stepIndex}/${j.totalSteps})` })), + ...[...pointerObservers.entries()].filter(([, o]) => o.head).map(([key, o]) => ({ key: `anchor:${key}`, label: `Pointer ${o.head.name} revision ${o.head.revision}` })), + ]; + get('recoveryExportSelection').replaceChildren(...rows.map(row => { + const option = document.createElement('option'); option.value = row.key; option.textContent = row.label; + option.selected = exportSelectionInitialized ? previous.has(row.key) : rows.length <= RECOVERY_LIMITS.entries; return option; + })); + exportSelectionInitialized = true; + } + get('recoveryControls').addEventListener('toggle', () => { + if (get('recoveryControls').open && !busy) refreshExportSelection(); + // Closing cancels an in-flight commit, never an already retained head. + if (!get('recoveryControls').open) restoreGeneration++; + }); + bind('exportRecoveryBtn', async () => { + const selected = new Set([...get('recoveryExportSelection').selectedOptions].map(o => o.value)); + if (selected.size === 0 || selected.size > RECOVERY_LIMITS.entries) throw Error('Choose between 1 and 32 live evidence entries.'); + const objects = [...liveDb.objects.entries()].filter(([key]) => selected.delete(`object:${key}`)).map(([, e]) => { + if (!e.verified || !e.bytes) throw Error('Selected object no longer complete. Reopen the recovery panel.'); + return new Uint8Array(e.bytes); + }); + const jobs = [...computeCoord.jobs.entries()].filter(([key]) => selected.delete(`job:${key}`)) + .map(([, j]) => structuredClone({ program: j.program, checkpoint: j.checkpoint })); + const anchors = [...pointerObservers.entries()].filter(([key]) => selected.delete(`anchor:${key}`)).map(([, o]) => { + if (!o.head) throw Error('Selected observer head is no longer retained.'); return o.head; + }); + if (selected.size) throw Error('Selected evidence changed. Reopen the recovery panel and select again.'); + const bundle = { version: 1, objects: [], jobs, anchors }; + for (const bytes of objects) bundle.objects.push(await recoveryObject(bytes)); + const wire = await exportRecoveryBundle(bundle, options()); + download(wire, 'stitch-recovery.json', 'application/json'); + status('Verified evidence exported. Store the downloaded file independently. No private keys, trust decisions, grants or pending writes are included.'); + }); + bind('importRecoveryBtn', async () => { + const file = get('recoveryFile').files[0]; const bounds = options(); + if (!file) throw Error('Choose a recovery file first.'); + if (!Number.isSafeInteger(bounds.wireBytes) || file.size > bounds.wireBytes || file.size > RECOVERY_LIMITS.wireBytes) throw Error('File exceeds chosen wire allowance.'); + const bytes = new Uint8Array(await file.arrayBuffer()); + await vault.import(bytes, bounds); + get('recoveryAnchorConsent').checked = false; + status('Object integrity and pure checkpoints checked. Evidence restored to this session-only recovery vault; supplied anchors remain untrusted. No mesh, VM or DNS effects ran.'); + }); + bind('exportRecoveredBtn', async () => { + download(await vault.export(), 'stitch-recovered-evidence.json', 'application/json'); + status('Recovery evidence exported. Operator trust decisions are not transferable through this file.'); + }); + bind('downloadRecoveredObjectBtn', async () => { + const root = get('recoveryObjects').value; + download(await vault.objectBytes(root), `${root.replace(':', '-')}.bin`, 'application/octet-stream'); + status('Verified object downloaded locally. It was not mounted in the VM or published to peers.'); + }); + bind('resumeRecoveredJobBtn', async () => { + const job = vault.snapshot().bundle.jobs.find(j => j.checkpoint.jobId === get('recoveryJobs').value); + if (!job) throw Error('Choose an imported job.'); + const limit = options().replaySteps; + if (!Number.isSafeInteger(limit) || limit < programWork(job.program) || limit > RECOVERY_LIMITS.replaySteps) throw Error('Replay work allowance is too small or invalid.'); + const result = await resumeProgram(job.program, job.checkpoint); + status(`Pure local replay finished at step ${result.stepIndex}: ${result.stateHex}. No external effects ran; result remains volatile.`); + }); + bind('acceptRecoveryAnchorBtn', async () => { + await vault.acceptRecentAnchor({ name: get('recoveryAnchors').value, authorityKey: get('recoveryAuthority').value.trim(), + expectedDigest: get('recoveryDigest').value.trim(), nowMs: Date.now(), operatorAccepted: get('recoveryAnchorConsent').checked }); + get('recoveryAnchorConsent').checked = false; + status('Exact recent anchor accepted in this vault. To resume succession, separately restore it into the same independently pinned live name and writer scope. No live head changed yet.'); + }); + bind('restoreRecoveryAnchorBtn', async () => { + const anchor = selectedAcceptance(); + const scope = liveScope(), generation = restoreGeneration; + if (!anchor || anchor.name !== scope.name || anchor.authorityKey !== scope.authorityKey) throw Error('Choose the accepted exact anchor and independently pin its same live name and writer first.'); + // The factory uses the already pinned live fields. No key/name is copied from + // the imported bundle. Never clear or replace an existing observer. + const observer = pointerObserver(); + const restored = await observer.restoreFromRecovery(vault, { expectedDigest: anchor.pointerDigest, + scopeStillCurrent: () => generation === restoreGeneration && liveScope().name === scope.name && + liveScope().authorityKey === scope.authorityKey && selectedAcceptance()?.pointerDigest === anchor.pointerDigest }); + status(`Live observer restored locally at revision ${restored.revision} for ${restored.name}. Admit only its exact next successor. No DNS write, mesh or VM effect ran; this is not proof of globally latest state.`); + }); + render(); + const facts = () => { + const state = vault.snapshot(), accepted = selectedAcceptance(state), scope = liveScope(); + const head = pointerObservers.get(`${scope.name}:${scope.authorityKey}`)?.head; + const matches = Boolean(accepted && accepted.name === scope.name && accepted.authorityKey === scope.authorityKey); + const valid = matches && accepted.validFromMs <= Date.now() && Date.now() < accepted.validUntilMs; + const scopeText = `Live scope: ${scope.name || '(no name)'} / writer ${scope.authorityKey || '(not pinned)'}. ${head ? `Retained revision ${head.revision}.` : 'No retained head.'}`; + if (get('recoveryLiveScope').textContent !== scopeText) get('recoveryLiveScope').textContent = scopeText; + return { recoveryBusy: busy, recoveryFileSelected: Boolean(get('recoveryFile').files[0]), + recoveryHasEvidence: state.entries > 0, recoveryHasObjects: state.bundle.objects.length > 0, + recoveryHasJobs: state.bundle.jobs.length > 0, recoveryHasAnchors: state.bundle.anchors.length > 0, + recoveryAnchorConsent: get('recoveryAnchorConsent').checked, recoveryAcceptedAnchor: Boolean(accepted), + recoveryCanRestoreAnchor: Boolean(valid && (!head || head.pointerDigest === accepted.pointerDigest)), + recoveryRestoredAnchor: Boolean(matches && head?.pointerDigest === accepted.pointerDigest) }; + }; + get('recoveryFile').addEventListener('change', onChange); + get('recoveryAnchorConsent').addEventListener('change', onChange); + for (const id of ['recoveryAnchors', 'recoveryAuthority', 'recoveryDigest']) { + get(id).addEventListener(id === 'recoveryAnchors' ? 'change' : 'input', () => { + // An acceptance belongs to the exact supplied anchor/key/digest, not later edits. + restoreGeneration++; get('recoveryAnchorConsent').checked = false; onChange(); + }); + } + for (const id of ['dnsQueryInput', 'pointerAuthorityInput']) { + get(id).addEventListener('input', () => { restoreGeneration++; onChange(); }); + } + return { facts }; +} diff --git a/src/recovery.js b/src/recovery.js new file mode 100644 index 0000000..1d29241 --- /dev/null +++ b/src/recovery.js @@ -0,0 +1,175 @@ +/** Bounded recovery evidence, never a transport, key backup or effect journal. + * Imported anchors remain supplied evidence until separately accepted against an + * independently obtained exact digest. All state lives only in this session. + */ +import { canonicalBytes, parseCanonicalJson, exactKeys, deepFreeze, sha256Bytes } from './layer1-uor/custody.js'; +import { createObject, recoverObject } from './layer3-storage/custody.js'; +import { verifyCheckpoint, programWork } from './layer4-compute/replay.js'; +import { verifyPointer } from './layer1-uor/pointer.js'; +import { model } from './layer1-uor/generated-model.js'; +const project = (name, ...args) => model[`Stitch.Recovery.${name}`](...args); +export const RECOVERY_LIMITS = Object.freeze({ wireBytes: 32 * (2 * 131072 + 65536), entries: 32, objectBytes: 131072, replaySteps: 32 * 1024 }); +const reject = reason => { throw new Error(`recovery-${reason}`); }; +const text = bytes => new TextDecoder().decode(bytes); +const hex = bytes => Array.from(bytes, b => b.toString(16).padStart(2, '0')).join(''); +function limits(options = {}) { + const result = { ...RECOVERY_LIMITS, ...options }; + exactKeys(result, Object.keys(RECOVERY_LIMITS), 'recovery limits'); + for (const key of Object.keys(result)) { + if (!Number.isSafeInteger(result[key]) || result[key] < 0 || result[key] > RECOVERY_LIMITS[key]) reject('limit-policy'); + } + return result; +} +const codec = bounds => ({ maxBytes: bounds.wireBytes, maxEntries: 32 * 8192, maxDepth: 16, maxStringLength: 131072 }); +const encode = (value, bounds = RECOVERY_LIMITS) => canonicalBytes(value, codec(bounds)); +const empty = () => ({ version: 1, objects: [], jobs: [], anchors: [] }); +function decodeHex(value) { + if (typeof value !== 'string' || value.length > RECOVERY_LIMITS.objectBytes || value.length % 2 || !/^[0-9a-f]*$/.test(value)) reject('fragment-hex'); + return Uint8Array.from(value.match(/../g) ?? [], b => parseInt(b, 16)); +} +function unique(rows, key) { + const seen = new Set(); + for (const row of rows) { const id = key(row); if (seen.has(id)) reject('duplicate'); seen.add(id); } +} +/** Canonical wire input only, rejecting alternate encodings and duplicate fields. */ +export async function verifyRecoveryBundle(wire, options = {}) { + const bounds = limits(options); + const bundle = parseCanonicalJson(wire, codec(bounds)); + const encoded = encode(bundle, bounds); + const original = typeof wire === 'string' ? wire : text(wire); + if (text(encoded) !== original) reject('noncanonical'); + exactKeys(bundle, ['version', 'objects', 'jobs', 'anchors'], 'recovery bundle'); + if (bundle.version !== 1 || ![bundle.objects, bundle.jobs, bundle.anchors].every(Array.isArray)) reject('schema'); + const entries = bundle.objects.length + bundle.jobs.length + bundle.anchors.length; + if (entries > bounds.entries) reject('entry-limit'); + let replaySteps = 0; + // Preflight aggregate replay before hashing or executing any program. + for (const job of bundle.jobs) { + exactKeys(job, ['program', 'checkpoint'], 'recovery job'); + if (!Number.isSafeInteger(job.checkpoint?.stepIndex) || job.checkpoint.stepIndex < 0) reject('step'); + replaySteps += programWork(job.program, 0, job.checkpoint.stepIndex); + if (replaySteps > bounds.replaySteps) reject('replay-limit'); + } + const objects = []; + for (const object of bundle.objects) { + exactKeys(object, ['manifest', 'fragments'], 'recovery object'); + if (!Array.isArray(object.fragments) || object.fragments.length < 2 || object.fragments.length > 3) reject('partial-object'); + if (object.manifest?.object?.byteLength > bounds.objectBytes) reject('object-limit'); + const fragments = object.fragments.map(fragment => { + exactKeys(fragment, ['index', 'hex'], 'recovery fragment'); + return { index: fragment.index, bytes: decodeHex(fragment.hex) }; + }); + const bytes = await recoverObject(object.manifest, fragments); + objects.push({ root: object.manifest.object.contentDigest, bytes }); + } + for (const job of bundle.jobs) await verifyCheckpoint(job.program, job.checkpoint); + for (const anchor of bundle.anchors) { + // This verifies only internal signature consistency, NOT trusted authority. + await verifyPointer(anchor, anchor.authorityKey); + } + unique(bundle.objects, o => o.manifest.object.contentDigest); + unique(bundle.jobs, j => j.checkpoint.jobId); + unique(bundle.anchors, a => a.name); + return { bundle: deepFreeze(bundle), objects, cost: { wireBytes: encoded.length, entries, replaySteps } }; +} +/** Snapshot caller-owned evidence before any await. Keys and unknown fields fail. */ +export async function exportRecoveryBundle(evidence, options = {}) { + const wire = text(encode(evidence, limits(options))); + await verifyRecoveryBundle(wire, options); + return wire; +} +export async function recoveryObject(bytes) { + if (!(bytes instanceof Uint8Array) || bytes.length > RECOVERY_LIMITS.objectBytes) reject('object-limit'); + const object = await createObject(bytes); + return { manifest: object.manifest, fragments: object.fragments.slice(0, 2).map(f => ({ index: f.index, hex: hex(f.bytes) })) }; +} +/** A separately held evidence vault, not a live mesh/VM adapter. Merge validates + * the entire candidate before one synchronous assignment. A concurrent anchor + * acceptance invalidates an in-flight import rather than losing that decision. + */ +export class RecoveryVault { + #state = { root: new Uint8Array(), generation: 0, wireBytes: 0, entries: 0, replaySteps: 0 }; + #bundle = empty(); + #accepted = new Map(); + #limits; + constructor(options = {}) { this.#limits = limits(options); } + snapshot() { return { bundle: structuredClone(this.#bundle), acceptedAnchors: [...this.#accepted.values()].map(a => structuredClone(a)), ...structuredClone(this.#state), durability: 'session-only', effects: [] }; } + async import(wire, options = this.#limits) { + const bounds = limits(options); + for (const key of Object.keys(bounds)) bounds[key] = Math.min(bounds[key], this.#limits[key]); + // Copy wire before awaiting any verification. + if (wire instanceof Uint8Array) wire = new Uint8Array(wire); + const generation = this.#state.generation; + if (!Number.isSafeInteger(generation + 1)) reject('generation-limit'); + const incoming = await verifyRecoveryBundle(wire, bounds); + const merged = structuredClone(this.#bundle); + for (const [field, key] of [['objects', o => o.manifest.object.contentDigest], ['jobs', j => j.checkpoint.jobId], ['anchors', a => a.name]]) { + const retained = new Map(merged[field].map(row => [key(row), row])); + for (const row of incoming.bundle[field]) { + const old = retained.get(key(row)); + if (old && text(encode(old)) !== text(encode(row))) { + if (field === 'objects') reject('conflict'); + if (field === 'jobs') { + const before = old.checkpoint, after = row.checkpoint; + if (!project('progressAllowed', before.stepIndex, after.stepIndex, + text(encode(old.program)) === text(encode(row.program)), + after.stepIndex !== before.stepIndex + 1 || after.previousDigest === before.checkpointDigest)) reject('conflict-or-rollback'); + } else { + if (!project('progressAllowed', old.revision, row.revision, old.authorityKey === row.authorityKey, + row.revision !== old.revision + 1 || row.previousDigest === old.pointerDigest)) reject('conflict-or-rollback'); + } + merged[field][merged[field].indexOf(old)] = row; + retained.set(key(row), row); + } + if (!old) { merged[field].push(row); retained.set(key(row), row); } + } + } + // Prior immutable entries were already checked. Do not replay all history. + const encoded = encode(merged, bounds); + const cost = { wireBytes: encoded.length, entries: merged.objects.length + merged.jobs.length + merged.anchors.length, + replaySteps: merged.jobs.reduce((n, j) => n + programWork(j.program, 0, j.checkpoint.stepIndex), 0) }; + const candidate = { ...cost, generation, root: new TextEncoder().encode(await sha256Bytes(encoded, 'recovery')) }; + const next = project('commit', bounds, this.#state, candidate, true); + if (Number(next.generation) === this.#state.generation) reject('stale-or-capacity'); + this.#bundle = deepFreeze(merged); + this.#state = { root: next.root, generation: Number(next.generation), wireBytes: Number(next.wireBytes), entries: Number(next.entries), replaySteps: Number(next.replaySteps) }; + return this.snapshot(); + } + async export() { return exportRecoveryBundle(this.#bundle, this.#limits); } + async objectBytes(root) { + const object = this.#bundle.objects.find(o => o.manifest.object.contentDigest === root); + if (!object) reject('missing-object'); + return recoverObject(object.manifest, object.fragments.map(f => ({ index: f.index, bytes: decodeHex(f.hex) }))); + } + acceptedAnchor({ name, authorityKey, expectedDigest }) { + const anchor = this.#accepted.get(name); + if (!anchor || anchor.authorityKey !== authorityKey || anchor.pointerDigest !== expectedDigest) reject('anchor-not-accepted'); + return structuredClone(anchor); + } + /** The expected digest/key MUST come from a source the operator trusts as + * recent, separately from this bundle. No supplied timestamp proves recency. + */ + async acceptRecentAnchor({ name, authorityKey, expectedDigest, nowMs, operatorAccepted }) { + const generation = this.#state.generation; + if (!Number.isSafeInteger(generation + 1)) reject('generation-limit'); + const anchor = this.#bundle.anchors.find(a => a.name === name); + if (!anchor || operatorAccepted !== true || !Number.isSafeInteger(nowMs) || nowMs < 0) reject('anchor-consent'); + await verifyPointer(anchor, authorityKey); + const retained = this.#accepted.get(name); + if (!project('anchorAllowed', new TextEncoder().encode(anchor.pointerDigest), new TextEncoder().encode(expectedDigest), anchor.validFromMs, anchor.validUntilMs, nowMs, + retained?.revision ?? 0, anchor.revision, retained ? (retained.authorityKey === anchor.authorityKey && + (retained.pointerDigest === anchor.pointerDigest || (anchor.revision > retained.revision && (anchor.revision !== retained.revision + 1 || anchor.previousDigest === retained.pointerDigest)))) : true)) reject('anchor-stale-or-untrusted'); + if (generation !== this.#state.generation) reject('stale-operation'); + this.#accepted.set(name, structuredClone(anchor)); + this.#state = { ...this.#state, generation: generation + 1 }; + return structuredClone(anchor); + } +} + +/** Read only a separately accepted exact scope, with a private-field brand check. + * The observer calls this intrinsic, not a caller-supplied vault-shaped method. + * Snapshots and imported bundle rows cannot manufacture accepted provenance. + */ +export function acceptedRecoveryAnchor(vault, { name, authorityKey, expectedDigest }) { + return RecoveryVault.prototype.acceptedAnchor.call(vault, { name, authorityKey, expectedDigest }); +} diff --git a/standards.lock b/standards.lock new file mode 100644 index 0000000..085afdb --- /dev/null +++ b/standards.lock @@ -0,0 +1 @@ +{"authorities":[{"canonical_id":"asyncapi/spec","edition":"3.1.0","id":"ASYNCAPI-3-1-0","issuer":"AsyncAPI Initiative","name":"AsyncAPI Specification 3.1.0","oracle_ids":["asyncapi-3.1-schema"],"realized_by":["AU-01","SY-04"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"b3fac5bb522771428ea57b16129b273cd3ea0180","sha256":"7b9de4debb0f6050bf5c4d6284694876c0cf6ec6bcd72fb250d2b58d66538989","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/asyncapi/spec/tar.gz/b3fac5bb522771428ea57b16129b273cd3ea0180"},"source_role":"normative","statement":"AsyncAPI 3.1.0 owns the generated asynchronous interface document semantics.","supersession":"explicit-lock-update-only"},{"canonical_id":"asyncapi/website","edition":"20a31a0396b4","id":"ASYNCAPI-WEBSITE-20A31A03","issuer":"AsyncAPI Initiative","name":"AsyncAPI website ADEO case-study schemas","oracle_ids":["asyncapi-3.1-schema"],"realized_by":["AU-01","AU-06"],"retrieval_date":"2026-09-08","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"20a31a0396b41dd24b1bac877ab7ce3f58037c28","sha256":"6dbd4685b6e4ccbc3847a0d11acd3f7f770b4e7c83d10da5d147383395dea24b","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/asyncapi/website/tar.gz/20a31a0396b41dd24b1bac877ab7ce3f58037c28"},"source_role":"informative","statement":"The pinned AsyncAPI website source publishes the two external Avro schemas referenced by the official ADEO AsyncAPI example; it is fixture input, not a normative extension of AsyncAPI 3.1.0.","supersession":"explicit-lock-update-only"},{"canonical_id":"BLAKE3-team/BLAKE3/test_vectors/test_vectors.json","edition":"1.5.5","id":"BLAKE3-VECTORS-1-5-5","issuer":"BLAKE3 team","name":"BLAKE3 immutable digest vectors","oracle_ids":[],"realized_by":["HO-14"],"retrieval_date":"2026-10-04","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"CC0-1.0","media_type":"application/json","redistribution":"redistributable","revision":"81f772a4cd70dc0325047a6a737d2f6f4b92180e","sha256":"dcb91ea8accc77e6d6e632af7cdc1a99a9f3ae78cf648da595c7d064db32f624","signature":"not-published-or-not-relied-upon","url":"https://raw.githubusercontent.com/BLAKE3-team/BLAKE3/81f772a4cd70dc0325047a6a737d2f6f4b92180e/test_vectors/test_vectors.json"},"source_role":"normative","statement":"All 35 upstream digest vectors qualify hash, keyed-hash, derive-key, extended output and the archive content-identity adapter; not cryptographic proof or durable storage.","supersession":"explicit-lock-update-only"},{"canonical_id":"cloudevents/spec","edition":"1.0.2","id":"CLOUDEVENTS-1-0-2","issuer":"Cloud Native Computing Foundation","name":"CloudEvents 1.0.2","oracle_ids":["cloudevents-1.0-json"],"realized_by":["AU-01","SY-04"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"fc1f6f31f5f011a72183f1bcea20c987cb683ade","sha256":"b9e35734ccddc3baae04b4a18c8539e3d9f4148bbcdf48cd7b65751ee3d62614","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/cloudevents/spec/tar.gz/fc1f6f31f5f011a72183f1bcea20c987cb683ade"},"source_role":"normative","statement":"CloudEvents 1.0.2 owns the event envelope projected by Prism systems.","supersession":"explicit-lock-update-only"},{"canonical_id":"cloudevents/sdk-go","edition":"2.16.2","id":"CLOUDEVENTS-SDK-GO-2-16-2","issuer":"Cloud Native Computing Foundation","name":"CloudEvents Go SDK 2.16.2","oracle_ids":["cloudevents-1.0-json"],"realized_by":["AU-06","SY-04"],"retrieval_date":"2026-09-06","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"af3e8599b3316ab6b4b73ff69aa8ec0efddbb5bb","sha256":"542bd94a70070c58ab96c5fe49affb04af6dc371b7ea6d0ad6d09337e4b3836a","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/cloudevents/sdk-go/tar.gz/af3e8599b3316ab6b4b73ff69aa8ec0efddbb5bb"},"source_role":"normative","statement":"The exact official CloudEvents Go SDK supplies the executable CloudEvents event-validation behavior and its upstream tests.","supersession":"explicit-lock-update-only"},{"canonical_id":"compose-spec/compose-spec","edition":"fee041b381ff","id":"COMPOSE-FEE041B3","issuer":"Compose Specification maintainers","name":"Compose Specification snapshot","oracle_ids":["compose-fee041b3"],"realized_by":["AU-01","DP-02"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"fee041b381ffd4aad263410980bdce0cdf4beb7d","sha256":"09916fd41b9a36b404c3b99b75c43f771624a8cab74d33d794a237d49d34be81","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/compose-spec/compose-spec/tar.gz/fee041b381ffd4aad263410980bdce0cdf4beb7d"},"source_role":"normative","statement":"The pinned Compose Specification defines the generated local multi-service target.","supersession":"explicit-lock-update-only"},{"canonical_id":"devcontainers/spec","edition":"c95ffeed1d05","id":"DEVCONTAINER-C95FFEED","issuer":"Dev Container Specification maintainers","name":"Development Container Specification snapshot","oracle_ids":["devcontainer-c95ffeed"],"realized_by":["AU-01","TM-02"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"MIT","media_type":"application/gzip","redistribution":"redistributable","revision":"c95ffeed1d059abfe9ffbe79762dc2fa4e7c2421","sha256":"1b97d24f6b6cf0b65ea6d737a12812e802e6a443c306312ae43d90715bc08074","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/devcontainers/spec/tar.gz/c95ffeed1d059abfe9ffbe79762dc2fa4e7c2421"},"source_role":"normative","statement":"The pinned Development Container Specification defines the common SDK environment contract.","supersession":"explicit-lock-update-only"},{"canonical_id":"RFC 7636","edition":"September 2015","id":"IETF-RFC-7636","issuer":"IETF","name":"Proof Key for Code Exchange by OAuth Public Clients","oracle_ids":[],"realized_by":["ST-17"],"retrieval_date":"2026-09-28","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"LicenseRef-IETF-Trust-2015","media_type":"text/plain","redistribution":"redistributable","revision":"RFC7636-2015","sha256":"1972e5d81cbaba7066cfd46374207bc2b4546b085ed5dd9b034e79e023e0ca31","signature":"not-published-or-not-relied-upon","url":"https://www.rfc-editor.org/rfc/rfc7636.txt"},"source_role":"normative","statement":"Sections 4.1-4.2 and Appendix B define the ST-17 S256 client primitive and imported example, not complete OAuth or mailbox authentication.","supersession":"explicit-lock-update-only"},{"canonical_id":"in-toto/attestation","edition":"1.0","id":"INTOTO-STATEMENT-1-0","issuer":"in-toto project","name":"in-toto Attestation Statement 1.0","oracle_ids":["in-toto-statement-1.0","slsa-provenance-1.2"],"realized_by":["AU-01","SC-02"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"ee16c68a11dfcfbdc891600cacd767896fe6e724","sha256":"9e2c92fbb11eef640de5d98dce6a82ed6a93af3b141e02b9f164e6de4ac952ed","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/in-toto/attestation/tar.gz/ee16c68a11dfcfbdc891600cacd767896fe6e724"},"source_role":"normative","statement":"in-toto Statement 1.0 owns the validation and build attestation envelope.","supersession":"explicit-lock-update-only"},{"canonical_id":"ISO/PAS 19450:2015","edition":"2015","id":"ISO-19450-2015","issuer":"ISO","name":"ISO/PAS 19450:2015","oracle_ids":[],"realized_by":["FT-11","HO-18","ST-18"],"retrieval_date":"2026-10-22","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"ISO-controlled-document","media_type":"text/html","redistribution":"citation-only","revision":null,"sha256":null,"signature":"not-published","url":"https://www.iso.org/standard/62274.html"},"source_role":"binding-only","statement":"The lawful scope is a reviewed Object-Process Methodology design-view interpretation, not certification or an executable oracle.","supersession":"explicit-lock-update-only"},{"canonical_id":"ISO/IEC 25010:2023","edition":"2023","id":"ISO-25010-2023","issuer":"ISO/IEC","name":"ISO/IEC 25010:2023","oracle_ids":[],"realized_by":["FT-05","ST-05"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"ISO-controlled-document","media_type":"text/html","redistribution":"citation-only","revision":null,"sha256":null,"signature":"not-published","url":"https://www.iso.org/standard/78176.html"},"source_role":"binding-only","statement":"The lawful scope is a reviewed quality-model interpretation, not certification or an executable oracle.","supersession":"explicit-lock-update-only"},{"canonical_id":"ISO/IEC 27005:2022","edition":"2022","id":"ISO-27005-2022","issuer":"ISO/IEC","name":"ISO/IEC 27005:2022","oracle_ids":[],"realized_by":["FT-04","ST-04"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"ISO-controlled-document","media_type":"text/html","redistribution":"citation-only","revision":null,"sha256":null,"signature":"not-published","url":"https://www.iso.org/standard/80585.html"},"source_role":"binding-only","statement":"The lawful scope is a reviewed risk-management interpretation, not certification or an executable oracle.","supersession":"explicit-lock-update-only"},{"canonical_id":"ISO/IEC 27034-1:2011","edition":"2011-cor1-2014","id":"ISO-27034-1-2011","issuer":"ISO/IEC","name":"ISO/IEC 27034-1:2011 / Cor 1:2014","oracle_ids":[],"realized_by":["FT-02","ST-02"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"ISO-controlled-document","media_type":"text/html","redistribution":"citation-only","revision":null,"sha256":null,"signature":"not-published","url":"https://www.iso.org/standard/44378.html"},"source_role":"binding-only","statement":"The lawful scope is a reviewed application-security interpretation, not certification or an executable oracle.","supersession":"explicit-lock-update-only"},{"canonical_id":"ISO/IEC 27034-5:2017","edition":"2017","id":"ISO-27034-5-2017","issuer":"ISO/IEC","name":"ISO/IEC 27034-5:2017","oracle_ids":[],"realized_by":["FT-03","ST-03"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"ISO-controlled-document","media_type":"text/html","redistribution":"citation-only","revision":null,"sha256":null,"signature":"not-published","url":"https://www.iso.org/standard/55585.html"},"source_role":"binding-only","statement":"The lawful scope is a reviewed control-data interpretation, not certification or an executable oracle.","supersession":"explicit-lock-update-only"},{"canonical_id":"ISO/IEC/IEEE 42010:2022","edition":"2022","id":"ISO-42010-2022","issuer":"ISO/IEC/IEEE","name":"ISO/IEC/IEEE 42010:2022","oracle_ids":[],"realized_by":["FT-01","FT-12","FT-13","ST-01","ST-19"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"ISO-controlled-document","media_type":"text/html","redistribution":"citation-only","revision":null,"sha256":null,"signature":"not-published","url":"https://www.iso.org/standard/74393.html"},"source_role":"binding-only","statement":"The lawful scope is a reviewed architecture-description interpretation, not certification or an executable oracle.","supersession":"explicit-lock-update-only"},{"canonical_id":"json-schema-org/JSON-Schema-Test-Suite","edition":"2020-12@c9510e3b","id":"JSON-SCHEMA-2020-12","issuer":"JSON Schema organization","name":"JSON Schema 2020-12 test suite","oracle_ids":["json-schema-2020-12","openapi-3.2-schema","osv-schema-snapshot"],"realized_by":["AU-05","SY-04"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"MIT","media_type":"application/gzip","redistribution":"redistributable","revision":"c9510e3bf8a896c3cba4e08509cf752b4f30dff8","sha256":"cf0e16252ef08add662b9db2b7f0f099644cdaffd1c429b1ce9212cebf086aba","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/json-schema-org/JSON-Schema-Test-Suite/tar.gz/c9510e3bf8a896c3cba4e08509cf752b4f30dff8"},"source_role":"normative","statement":"The official corpus defines the finite JSON Schema 2020-12 behavior tested by the imported validator.","supersession":"explicit-lock-update-only"},{"canonical_id":"kubernetes/kubernetes","edition":"1.36.4","id":"KUBERNETES-1-36-4","issuer":"Cloud Native Computing Foundation","name":"Kubernetes 1.36.4","oracle_ids":["kubernetes-1.36.4"],"realized_by":["AU-01","DP-03"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"bb826b1d48562f110659e64e8ec444327433db95","sha256":"edde021b39188a92163596c3887372bc4164467927b426dd75c586ff927fa182","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/kubernetes/kubernetes/tar.gz/bb826b1d48562f110659e64e8ec444327433db95"},"source_role":"normative","statement":"Kubernetes 1.36.4 owns the orchestrated target API and admission semantics.","supersession":"explicit-lock-update-only"},{"canonical_id":"leanprover/lean4/src/lake","edition":"4.32.1","id":"LAKE-4-32-1","issuer":"Lean FRO","name":"Lake 4.32.1","oracle_ids":[],"realized_by":["VR-03"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"f054605aea4b840552cca2e725580bffd1e1b704","sha256":"6dec8667fbf57ba480a18a8b0c353b2ee157346b2630b211ccbefeedf20545f8","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/leanprover/lean4/tar.gz/f054605aea4b840552cca2e725580bffd1e1b704"},"source_role":"normative","statement":"Lake resolves the pinned generated Lean workspace.","supersession":"explicit-lock-update-only"},{"canonical_id":"leanprover/lean4","edition":"4.32.1","id":"LEAN-REL-4-32-1","issuer":"Lean FRO","name":"Lean 4.32.1 source release","oracle_ids":[],"realized_by":["VR-01","VR-02"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"f054605aea4b840552cca2e725580bffd1e1b704","sha256":"6dec8667fbf57ba480a18a8b0c353b2ee157346b2630b211ccbefeedf20545f8","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/leanprover/lean4/tar.gz/f054605aea4b840552cca2e725580bffd1e1b704"},"source_role":"normative","statement":"Lean 4.32.1 supplies the kernel and elaborator for generated Prism declarations.","supersession":"explicit-lock-update-only"},{"canonical_id":"leanprover/lean4/leanchecker","edition":"4.32.1","id":"LEANCHECKER-4-32-1","issuer":"Lean FRO","name":"leanchecker 4.32.1","oracle_ids":[],"realized_by":["VR-04"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"f054605aea4b840552cca2e725580bffd1e1b704","sha256":"6dec8667fbf57ba480a18a8b0c353b2ee157346b2630b211ccbefeedf20545f8","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/leanprover/lean4/tar.gz/f054605aea4b840552cca2e725580bffd1e1b704"},"source_role":"normative","statement":"leanchecker independently replays compiled module environments through the Lean kernel.","supersession":"explicit-lock-update-only"},{"canonical_id":"opencontainers/distribution-spec","edition":"1.1.1","id":"OCI-DISTRIBUTION-1-1-1","issuer":"Open Container Initiative","name":"OCI Distribution Specification 1.1.1","oracle_ids":["oci-distribution-1.1.1-conformance"],"realized_by":["AU-01","OC-04","OC-05"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":{"algorithm":"openpgp","fingerprint":"22A718B2224DE2BB0D9C84926E0FF28C767A8BEE","license":"public-key-material-published-for-verification","owner":"sudo-bmitch","path":"standards/trust/github-sudo-bmitch-openpgp-6e0ff28c767a8bee.asc","redistribution":"verification-use","sha256":"e33e1416f08d6ee24f1c66f3895be7d919ff58c0d4318f2934ec4743f75f0a7e","source_record_id":"2155637","source_url":"https://api.github.com/users/sudo-bmitch/gpg_keys"},"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"a139cc423184af6078077b9b7ee336eddbd03f8f","sha256":"e69fbe28c2eb4b2ef5a12c76b21c32d959ee97a646afe7704577b14c295641d2","signature":"signed-tag-object:b5c693e819628420cc04ba7d9263628276d8ca0f","url":"https://codeload.github.com/opencontainers/distribution-spec/tar.gz/a139cc423184af6078077b9b7ee336eddbd03f8f"},"source_role":"normative","statement":"OCI Distribution 1.1 defines registry push, pull, content discovery, and referrers behavior.","supersession":"explicit-lock-update-only"},{"canonical_id":"opencontainers/image-spec","edition":"1.1.1","id":"OCI-IMAGE-1-1-1","issuer":"Open Container Initiative","name":"OCI Image Format 1.1.1","oracle_ids":["oci-layout-1.1"],"realized_by":["AU-01","OC-01"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":{"algorithm":"openpgp","fingerprint":"22A718B2224DE2BB0D9C84926E0FF28C767A8BEE","license":"public-key-material-published-for-verification","owner":"sudo-bmitch","path":"standards/trust/github-sudo-bmitch-openpgp-6e0ff28c767a8bee.asc","redistribution":"verification-use","sha256":"e33e1416f08d6ee24f1c66f3895be7d919ff58c0d4318f2934ec4743f75f0a7e","source_record_id":"2155637","source_url":"https://api.github.com/users/sudo-bmitch/gpg_keys"},"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"147f9c13cedb47a0c4d9a11a222961073d585877","sha256":"f632804ca432d6df5c0fad506d003ebdb99f57fff22c4559cb4163e1e240a7f4","signature":"signed-tag-object:de7a13cc5ce022e0486d22211e80eb36f9d4a218","url":"https://codeload.github.com/opencontainers/image-spec/tar.gz/147f9c13cedb47a0c4d9a11a222961073d585877"},"source_role":"normative","statement":"OCI 1.1 defines the descriptors, manifests, indexes, artifact types, subjects, and annotations used by Prism releases.","supersession":"explicit-lock-update-only"},{"canonical_id":"opencontainers/runtime-spec","edition":"1.3.0","id":"OCI-RUNTIME-1-3-0","issuer":"Open Container Initiative","name":"OCI Runtime Specification 1.3.0","oracle_ids":["oci-runtime-1.3.0-schema"],"realized_by":["AU-01","LC-03"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":{"algorithm":"openpgp","fingerprint":"C020EA876CE4E06C7AB95AEF49524C6F9F638F1A","license":"public-key-material-published-for-verification","owner":"AkihiroSuda","path":"standards/trust/github-akihirosuda-openpgp-49524c6f9f638f1a.asc","redistribution":"verification-use","sha256":"cf122ae443d3fcad8b90fe30277d3c37e008c60d56c9658a44848bdb6f2078d4","source_record_id":"5228653","source_url":"https://api.github.com/users/AkihiroSuda/gpg_keys"},"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"92249139eea7161e13745abd4cb6d0ea02a3227a","sha256":"fbed724a4bbdce2260eea9a4d6dcf534a5e2446e581ed1b8bf27abe536cee17a","signature":"signed-tag-object:0eaca84ca040a452ebf87480b3f7bedf79d46f46","url":"https://codeload.github.com/opencontainers/runtime-spec/tar.gz/92249139eea7161e13745abd4cb6d0ea02a3227a"},"source_role":"normative","statement":"OCI Runtime 1.3.0 defines the container runtime boundary used by local execution.","supersession":"explicit-lock-update-only"},{"canonical_id":"openid/connect","edition":"1.0-errata1","id":"OIDC-1-0-ERRATA1","issuer":"OpenID Foundation","name":"OpenID Connect Core 1.0 Errata Set 1","oracle_ids":["oidc-core-1.0-profile"],"realized_by":["AU-01","SY-05"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"OpenID-Foundation-Specification-License","media_type":"application/gzip","redistribution":"citation-only","revision":"a173cb87c85c9b8d1bc11e2b8a84ed9271e97d6d","sha256":"2da00079757a1e699cc7072df23f262dbedb360b4677fde2eb4f875fb480c8af","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/openid/connect/tar.gz/a173cb87c85c9b8d1bc11e2b8a84ed9271e97d6d"},"source_role":"normative","statement":"OpenID Connect Core defines the issuer, audience, subject, token, and role-validation boundary.","supersession":"explicit-lock-update-only"},{"canonical_id":"OMG UML 2.5.1 formal/17-12-05","edition":"2.5.1","id":"OMG-UML-2-5-1","issuer":"OMG","name":"OMG Unified Modeling Language 2.5.1","oracle_ids":[],"realized_by":["FT-11","HO-18","ST-18"],"retrieval_date":"2026-10-22","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"OMG-specification-license","media_type":"text/html","redistribution":"citation-only","revision":null,"sha256":null,"signature":"not-published","url":"https://www.omg.org/spec/UML/2.5.1"},"source_role":"binding-only","statement":"The lawful scope is a reviewed UML component, sequence and state machine design-view interpretation, not certification or an executable oracle.","supersession":"explicit-lock-update-only"},{"canonical_id":"OAI/OpenAPI-Specification","edition":"3.2.0","id":"OPENAPI-3-2-0","issuer":"OpenAPI Initiative","name":"OpenAPI Specification 3.2.0","oracle_ids":["openapi-3.2-schema"],"realized_by":["AU-01","SY-04"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"99710bcb26cbe4be646565eebeb04348f02374b5","sha256":"0b4ae65636d0335ec9fd758d11cb2cb6097ace0490c1eaefaa951c723494e788","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/OAI/OpenAPI-Specification/tar.gz/99710bcb26cbe4be646565eebeb04348f02374b5"},"source_role":"normative","statement":"OpenAPI 3.2.0 owns the generated HTTP interface document semantics.","supersession":"explicit-lock-update-only"},{"canonical_id":"spec.openapis.org/oas/3.2/schema/2025-11-23","edition":"3.2@2025-11-23","id":"OPENAPI-SCHEMA-3-2-2025-11-23","issuer":"OpenAPI Initiative","name":"OpenAPI 3.2 schema iteration 2025-11-23","oracle_ids":["openapi-3.2-schema"],"realized_by":["AU-01","SY-04"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/schema+json","redistribution":"redistributable","revision":"2025-11-23","sha256":"7d48f01f37eeae4799041b371ad5f533f9f533fd2b0caa1011a8ba27c5b48b70","signature":"not-published-or-not-relied-upon","url":"https://spec.openapis.org/oas/3.2/schema/2025-11-23"},"source_role":"informative","statement":"The dated OAI schema is an official informative finite validator; OpenAPI 3.2.0 prose remains normative if they disagree.","supersession":"explicit-lock-update-only"},{"canonical_id":"openid/conformance-suite","edition":"3e09b13b896f","id":"OPENID-CONFORMANCE-SUITE-3E09B13B","issuer":"OpenID Foundation","name":"OpenID Foundation Conformance Suite","oracle_ids":["oidc-core-1.0-profile"],"realized_by":["AU-06","SY-05"],"retrieval_date":"2026-09-06","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"MIT","media_type":"application/gzip","redistribution":"redistributable","revision":"3e09b13b896fce95d78c2c0f931feee9614e9452","sha256":"d33d7eb40b6db0080a48563fe6e8d1073393d18fe9f4afcb3de83f1679197bbb","signature":"not-published-or-not-relied-upon","url":"https://gitlab.com/openid/conformance-suite/-/archive/3e09b13b896fce95d78c2c0f931feee9614e9452/conformance-suite-3e09b13b896fce95d78c2c0f931feee9614e9452.tar.gz"},"source_role":"normative","statement":"The exact official OpenID Foundation implementation supplies executable OIDC Core signature, time, and discovery condition tests.","supersession":"explicit-lock-update-only"},{"canonical_id":"gs://osv-vulnerabilities/crates.io/all.zip","edition":"gcs-generation-1792096384043606","id":"OSV-CRATES-DB-G1792096384043606","issuer":"OpenSSF OSV project","name":"OSV crates.io vulnerability database snapshot","oracle_ids":[],"realized_by":["AU-05","SC-04"],"retrieval_date":"2026-10-16","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"record-level upstream provenance; no aggregate relicensing claim","media_type":"application/zip","redistribution":"citation-only","revision":"1792096384043606","sha256":"5ebac98116c0148f8a2b72615cbd3e60c3c5e937786e2427714546f8fc686f5b","signature":"gcs-generation-and-acquired-sha256","url":"https://osv-vulnerabilities.storage.googleapis.com/crates.io/all.zip?generation=1792096384043606"},"source_role":"informative","statement":"This immutable crates.io snapshot bounds offline vulnerability facts; it does not establish current status after its acquisition time.","supersession":"explicit-lock-update-only"},{"canonical_id":"gs://osv-vulnerabilities/Debian/all.zip","edition":"gcs-generation-1792130564825991","id":"OSV-DEBIAN-DB-G1792130564825991","issuer":"OpenSSF OSV project","name":"OSV Debian vulnerability database snapshot","oracle_ids":[],"realized_by":["AU-05","SC-04"],"retrieval_date":"2026-10-16","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"record-level upstream provenance; no aggregate relicensing claim","media_type":"application/zip","redistribution":"citation-only","revision":"1792130564825991","sha256":"019d7daaca77666111070f333fb1e5d047ad40d50ba852391018979d08005bb9","signature":"gcs-generation-and-acquired-sha256","url":"https://osv-vulnerabilities.storage.googleapis.com/Debian/all.zip?generation=1792130564825991"},"source_role":"informative","statement":"This immutable Debian snapshot bounds offline vulnerability facts for image packages; it does not establish current status after its acquisition time.","supersession":"explicit-lock-update-only"},{"canonical_id":"gs://osv-vulnerabilities/Go/all.zip","edition":"gcs-generation-1792097294361139","id":"OSV-GO-DB-G1792097294361139","issuer":"OpenSSF OSV project","name":"OSV Go vulnerability database snapshot","oracle_ids":[],"realized_by":["AU-05","SC-04"],"retrieval_date":"2026-10-16","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"record-level upstream provenance; no aggregate relicensing claim","media_type":"application/zip","redistribution":"citation-only","revision":"1792097294361139","sha256":"3f3c63ba77efa8a7f0c47f572c69692eb538c26a5ff70b6e84926078e10ad914","signature":"gcs-generation-and-acquired-sha256","url":"https://osv-vulnerabilities.storage.googleapis.com/Go/all.zip?generation=1792097294361139"},"source_role":"informative","statement":"This immutable Go snapshot bounds offline vulnerability facts for statically linked image packages; it does not establish current status after its acquisition time.","supersession":"explicit-lock-update-only"},{"canonical_id":"gs://osv-vulnerabilities/npm/all.zip","edition":"gcs-generation-1792124305700257","id":"OSV-NPM-DB-G1792124305700257","issuer":"OpenSSF OSV project","name":"OSV npm vulnerability database snapshot","oracle_ids":[],"realized_by":["AU-05","SC-04"],"retrieval_date":"2026-10-16","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"record-level upstream provenance; no aggregate relicensing claim","media_type":"application/zip","redistribution":"citation-only","revision":"1792124305700257","sha256":"c242de6ea6f70b5491ca1e536ac7533e719349cea740db2f8d59d25ee729c0cd","signature":"gcs-generation-and-acquired-sha256","url":"https://osv-vulnerabilities.storage.googleapis.com/npm/all.zip?generation=1792124305700257"},"source_role":"informative","statement":"This immutable npm snapshot bounds offline vulnerability facts for JavaScript image packages; it does not establish current status after its acquisition time.","supersession":"explicit-lock-update-only"},{"canonical_id":"ossf/osv-schema","edition":"b388a18021a3","id":"OSV-SCHEMA-B388","issuer":"OpenSSF OSV project","name":"OSV schema snapshot","oracle_ids":["osv-schema-snapshot"],"realized_by":["AU-05","SC-04"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"b388a18021a32b55da40c31eaef9fd4ce780447d","sha256":"02fe51837bbb67fcd250151332ad1abc078f789e6d396585a4ae933e0c61c0e7","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/ossf/osv-schema/tar.gz/b388a18021a32b55da40c31eaef9fd4ce780447d"},"source_role":"normative","statement":"The locked OSV schema owns vulnerability-exchange validation; database freshness is separate evidence.","supersession":"explicit-lock-update-only"},{"canonical_id":"gs://osv-vulnerabilities/Ubuntu/all.zip","edition":"gcs-generation-1791997399062112","id":"OSV-UBUNTU-DB-G1791997399062112","issuer":"OpenSSF OSV project","name":"OSV Ubuntu vulnerability database snapshot","oracle_ids":[],"realized_by":["AU-05","SC-04"],"retrieval_date":"2026-10-16","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"record-level upstream provenance; no aggregate relicensing claim","media_type":"application/zip","redistribution":"citation-only","revision":"1791997399062112","sha256":"9c4f5e08e3a7490c90c78ac85f72004d5715c8b1641e9d5ed9e65a6438dd986d","signature":"gcs-generation-and-acquired-sha256","url":"https://osv-vulnerabilities.storage.googleapis.com/Ubuntu/all.zip?generation=1791997399062112"},"source_role":"informative","statement":"This immutable Ubuntu snapshot bounds offline vulnerability facts for image packages; it does not establish current status after its acquisition time.","supersession":"explicit-lock-update-only"},{"canonical_id":"open-telemetry/opentelemetry-collector-releases","edition":"0.136.0","id":"OTEL-COLLECTOR-0-136-0","issuer":"Cloud Native Computing Foundation","name":"OpenTelemetry Collector release 0.136.0","oracle_ids":["otel-collector-0.136.0"],"realized_by":["AU-05","OP-01"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":{"algorithm":"ssh","fingerprint":"SHA256:SfMATR1dMO6TOjDSjfAKOBWYCV85WAUwF/VVQeSsZwM","license":"public-key-material-published-for-verification","owner":"songy23","path":"standards/trust/github-songy23-ssh-sfmatr1d.pub","redistribution":"verification-use","sha256":"c0f83ab885c007561550bda8d540e620b2ac4e36af0a4b48cd320854a3cf2ea4","source_record_id":"276780","source_url":"https://api.github.com/users/songy23/ssh_signing_keys"},"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"ff8d64f8bbdb45270cde7289bf39218514bbfd2d","sha256":"b844833e8c72e2661275c911d79885a49a3171be9563a7c8b4827b202582b207","signature":"signed-tag-object:36cf70a10c3a65106781469e0557cef6b56aa507","url":"https://codeload.github.com/open-telemetry/opentelemetry-collector-releases/tar.gz/ff8d64f8bbdb45270cde7289bf39218514bbfd2d"},"source_role":"normative","statement":"The unmodified Collector validates and receives the modeled OpenTelemetry signals.","supersession":"explicit-lock-update-only"},{"canonical_id":"open-telemetry/semantic-conventions","edition":"1.37.0","id":"OTEL-SEMCONV-1-37-0","issuer":"Cloud Native Computing Foundation","name":"OpenTelemetry semantic conventions 1.37.0","oracle_ids":["otel-collector-0.136.0"],"realized_by":["AU-01","OP-01"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"aec6e9d3e86754683dab7c707655d69d953b2768","sha256":"ff1e16f3cbf9f23a40b917bc15593cb542434412552d27a0fc1bbbd833cfe60e","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/open-telemetry/semantic-conventions/tar.gz/aec6e9d3e86754683dab7c707655d69d953b2768"},"source_role":"normative","statement":"Semantic conventions 1.37.0 own the emitted resource and signal attribute names.","supersession":"explicit-lock-update-only"},{"canonical_id":"open-telemetry/opentelemetry-specification","edition":"1.60.0","id":"OTEL-SPEC-1-60-0","issuer":"Cloud Native Computing Foundation","name":"OpenTelemetry specification 1.60.0","oracle_ids":["otel-collector-0.136.0"],"realized_by":["AU-01","OP-01"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"29ae8c7710d2ea52e21a5ff81fb1cd657bcd3306","sha256":"92eb9f83837e0c28909b0bc1fc128001e263be0b8f0317e31323073d957aebe7","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/open-telemetry/opentelemetry-specification/tar.gz/29ae8c7710d2ea52e21a5ff81fb1cd657bcd3306"},"source_role":"normative","statement":"OpenTelemetry 1.60.0 defines projected telemetry signal and protocol semantics.","supersession":"explicit-lock-update-only"},{"canonical_id":"leanprover/lean4/print-axioms","edition":"4.32.1","id":"PRINT-AXIOMS-4-32-1","issuer":"Lean FRO","name":"Lean 4.32.1 axiom reporting","oracle_ids":[],"realized_by":["VR-05"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"f054605aea4b840552cca2e725580bffd1e1b704","sha256":"6dec8667fbf57ba480a18a8b0c353b2ee157346b2630b211ccbefeedf20545f8","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/leanprover/lean4/tar.gz/f054605aea4b840552cca2e725580bffd1e1b704"},"source_role":"normative","statement":"Lean reports the transitive axioms used by generated theorems.","supersession":"explicit-lock-update-only"},{"canonical_id":"sigstore/cosign","edition":"3.1.3","id":"SIGSTORE-COSIGN-3-1-3","issuer":"Sigstore project","name":"Sigstore Cosign 3.1.3","oracle_ids":["sigstore-cosign-3.1.3"],"realized_by":["AU-05","SC-03"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":{"algorithm":"ssh","fingerprint":"SHA256:ZJmEJziSaDOAh945+gfnh55LtM2wipvfyF5gBXYDueU","license":"public-key-material-published-for-verification","owner":"Hayden-IO","path":"standards/trust/github-hayden-io-ssh-zjmejzisa.pub","redistribution":"verification-use","sha256":"929c5c98f56be683921c84a1ccd542d0d8df3e75657c3711d5557da35267b637","source_record_id":"682831","source_url":"https://api.github.com/users/Hayden-IO/ssh_signing_keys"},"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"11926fa5bbbbde47e88fc006b625a17769b743b2","sha256":"3a718446bac51466efff6853639e1ca108b456ecbf07cd92938f548715d22d6b","signature":"signed-tag-object:2f3a85b04907df5b770eb049d7e4d08d4b018d86","url":"https://codeload.github.com/sigstore/cosign/tar.gz/11926fa5bbbbde47e88fc006b625a17769b743b2"},"source_role":"normative","statement":"Cosign 3.1.3 is the pinned Sigstore bundle and identity verifier.","supersession":"explicit-lock-update-only"},{"canonical_id":"slsa-framework/slsa","edition":"1.2","id":"SLSA-1-2","issuer":"OpenSSF SLSA project","name":"SLSA specification 1.2","oracle_ids":["slsa-provenance-1.2"],"realized_by":["AU-01","SC-02"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"CC-BY-4.0","media_type":"application/gzip","redistribution":"redistributable","revision":"19e4e2f005f871270c4f555fc47afecfb37f3efe","sha256":"1e96506a5e8489bb675020f46d3783b8b8484254440b934a8843c0c0a75a0b8e","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/slsa-framework/slsa/tar.gz/19e4e2f005f871270c4f555fc47afecfb37f3efe"},"source_role":"normative","statement":"SLSA 1.2 defines provenance fields and limits on build-level claims.","supersession":"explicit-lock-update-only"},{"canonical_id":"slsa-framework/slsa-verifier","edition":"2.7.1","id":"SLSA-VERIFIER-2-7-1","issuer":"OpenSSF SLSA project","name":"SLSA verifier 2.7.1","oracle_ids":["slsa-provenance-1.2"],"realized_by":["AU-05","SC-02"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Apache-2.0","media_type":"application/gzip","redistribution":"redistributable","revision":"ea584f4502babc6f60d9bc799dbbb13c1caa9ee6","sha256":"c1ed640d3f775d09549488d120f7d02694c1bbf5bf885c302a7916660c62056d","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/slsa-framework/slsa-verifier/tar.gz/ea584f4502babc6f60d9bc799dbbb13c1caa9ee6"},"source_role":"informative","statement":"The pinned upstream verifier supplies the official corpus and reference policy; the offline SDK oracle uses pinned Cosign trust verification plus explicit SLSA v1 subject, builder, and source checks because upstream 2.7.1 cannot accept a trusted-root file.","supersession":"explicit-lock-update-only"},{"canonical_id":"spdx/spdx-3-model","edition":"3.0.1","id":"SPDX-3-0-1","issuer":"SPDX Project","name":"SPDX model 3.0.1","oracle_ids":["spdx-3.0.1-model"],"realized_by":["AU-01","SC-01"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"CC-BY-3.0","media_type":"application/gzip","redistribution":"redistributable","revision":"a745f63e8643d5ae0f0851fcfa6836085308f80b","sha256":"ff322ecc07bff0ec705f5e51c28002bc4d996de949cda0aedf456da4614eaaf7","signature":"not-published-or-not-relied-upon","url":"https://codeload.github.com/spdx/spdx-3-model/tar.gz/a745f63e8643d5ae0f0851fcfa6836085308f80b"},"source_role":"normative","statement":"SPDX 3.0.1 owns the software and system BOM model.","supersession":"explicit-lock-update-only"},{"canonical_id":"spdx.org/schema/3.0.1/spdx-json-schema.json","edition":"3.0.1","id":"SPDX-SCHEMA-3-0-1","issuer":"SPDX Project","name":"SPDX 3.0.1 JSON Schema","oracle_ids":["spdx-3.0.1-model"],"realized_by":["AU-06","SC-01"],"retrieval_date":"2026-09-06","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"CC-BY-3.0","media_type":"application/schema+json","redistribution":"redistributable","revision":"3.0.1","sha256":"582c64e809d5b3ef9bd0c4de13a32391b47b0284a3e8d199569fb96f649234b1","signature":"not-published-or-not-relied-upon","url":"https://spdx.org/schema/3.0.1/spdx-json-schema.json"},"source_role":"normative","statement":"The published SPDX 3.0.1 JSON Schema defines the executable JSON serialization boundary for the official model.","supersession":"explicit-lock-update-only"},{"canonical_id":"UCD","edition":"17.0.0","id":"UNICODE-17-0-0","issuer":"Unicode Consortium","name":"Unicode Character Database 17.0.0","oracle_ids":["unicode-normalization-17.0.0"],"realized_by":["AU-01","SY-05"],"retrieval_date":"2026-09-05","schema":"prismpm/authority-binding/1","signature_trust_root":null,"source":{"license":"Unicode-3.0","media_type":"application/zip","redistribution":"redistributable","revision":"17.0.0","sha256":"2066d1909b2ea93916ce092da1c0ee4808ea3ef8407c94b4f14f5b7eb263d28e","signature":"not-published","url":"https://www.unicode.org/Public/17.0.0/ucd/UCD.zip"},"source_role":"normative","statement":"Unicode 17.0.0 defines the NFC and scalar-count text boundary.","supersession":"explicit-lock-update-only"}],"lock_id":"sha256:a97bce8f4583a2f35ae7c1a0e8f3b644b0fb93356ac8465e3e9eca493a14466f","oracles":[{"arguments":["{input}"],"authority_ids":["ASYNCAPI-3-1-0","ASYNCAPI-WEBSITE-20A31A03"],"corpus":{"path":"standards/oracles/asyncapi-spec-b3fac5bb","sha256":"6bec0a3910568ff84f28b8fd9c2f63e3fcde7986bebf3e24b1f4649c150d735b"},"covers":["all 24 complete AsyncAPI 3.1.0 documents and all 89 embedded specification examples; unchanged upstream validation source uses parser 3.6.0 with a separately Prism-owned compatible dependency lock, not an upstream-lock replay or upstream-reviewed dependency update; original sources and historical lock remain intact; the ADEO example's two external Avro schemas are byte-locked to the pinned website source; submitted documents use the exact parser"],"does_not_cover":["the upstream repository publishes no negative fixture corpus; planted invalid-document rejection is separate evidence, while broker delivery behavior and prose-only interoperability remain outside this oracle"],"edition":"3.1.0","executable":"asyncapi-parser","expected_exits":["0=pass","4=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"asyncapi-3.1-schema","input_media_types":["application/vnd.aai.asyncapi+json;version=3.1.0"],"memory_bytes":268435456,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":1048576,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":30000,"trusted_root":null,"upstream_payload_sha256":"7b9de4debb0f6050bf5c4d6284694876c0cf6ec6bcd72fb250d2b58d66538989","wrapper_sha256":"849b552ffa8ef7330511173b4fbd03d77f01ef0e7115abf64394d9160add5caf"},{"arguments":["{input}"],"authority_ids":["CLOUDEVENTS-1-0-2","CLOUDEVENTS-SDK-GO-2-16-2"],"corpus":{"path":"standards/oracles/cloudevents-sdk-go-2.16.2","sha256":"38480c5a48f73d20b8aa0db8366e22ae4ab34c245a370a11b8862cfbdeb5c6d1"},"covers":["all 45 top-level official CloudEvents Go SDK event tests plus direct CloudEvents 1.0 JSON decoding, required attributes, type validation, and negative mutations through that SDK"],"does_not_cover":["transport delivery guarantees, broker-specific bindings, and consumer application behavior"],"edition":"1.0.2+sdk-go-2.16.2","executable":"cloudevents-validator","expected_exits":["0=pass","1=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"cloudevents-1.0-json","input_media_types":["application/cloudevents+json"],"memory_bytes":268435456,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":1048576,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":60000,"trusted_root":null,"upstream_payload_sha256":"542bd94a70070c58ab96c5fe49affb04af6dc371b7ea6d0ad6d09337e4b3836a","wrapper_sha256":"6f78669abd8fa0d56568a281b34e2d668506aec6eaa2001f62e937f870a6a07b"},{"arguments":["compose","-f","{input}","config","--quiet"],"authority_ids":["COMPOSE-FEE041B3"],"corpus":null,"covers":["Docker Compose parsing and normalization with the pinned CLI and a fixed non-secret sandbox directory for modeled secret-file references"],"does_not_cover":["service lifecycle, fixture execution, providers, and other implementations require separate deployment evidence"],"edition":"fee041b381ff","executable":"docker","expected_exits":["0=pass","nonzero=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"compose-fee041b3","input_media_types":["application/vnd.docker.compose.project+yaml"],"memory_bytes":536870912,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":4194304,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":60000,"trusted_root":null,"upstream_payload_sha256":"09916fd41b9a36b404c3b99b75c43f771624a8cab74d33d794a237d49d34be81","wrapper_sha256":"08a1ef2aec1e5ed35fe9162312a476b68b72b2133344738f645521a4276494e9"},{"arguments":["{input}"],"authority_ids":["DEVCONTAINER-C95FFEED"],"corpus":null,"covers":["the pinned official Development Container base schema"],"does_not_cover":["container startup, editor-specific extensions, and untested container engines require a separate runtime fixture"],"edition":"c95ffeed1d05","executable":"devcontainer-validator","expected_exits":["0=pass","nonzero=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"devcontainer-c95ffeed","input_media_types":["application/json"],"memory_bytes":536870912,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":4194304,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":120000,"trusted_root":null,"upstream_payload_sha256":"a0883c0405ff433db188849d458fb20b9c0d73e0ba1a6e44c1d83f3b485408dd","wrapper_sha256":"08a1ef2aec1e5ed35fe9162312a476b68b72b2133344738f645521a4276494e9"},{"arguments":["{input}"],"authority_ids":["INTOTO-STATEMENT-1-0"],"corpus":{"path":"standards/oracles/in-toto-attestation-ee16c68a","sha256":"6cbad548e30d2e227d1cea0ee23bb09c06c506c27094ccd8f55137d0bef17371"},"covers":["strict JSON decoding into the exact generated Go protobuf published for in-toto Statement 1.0, including declared field wire types and unknown-field rejection"],"does_not_cover":["the upstream protobuf explicitly leaves validation of all field semantics to consumers; required-field presence, Statement type value, digest policy, subject agreement, predicate truth, and signer trust are Prism policy or separate verification"],"edition":"1.0@ee16c68a","executable":"intoto-statement-validator","expected_exits":["0=protobuf shape accepted","1=invalid","2=invocation error"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"in-toto-statement-1.0","input_media_types":["application/vnd.in-toto+json"],"memory_bytes":268435456,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":1048576,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":30000,"trusted_root":null,"upstream_payload_sha256":"9e2c92fbb11eef640de5d98dce6a82ed6a93af3b141e02b9f164e6de4ac952ed","wrapper_sha256":"7437d6043e1efab4fd5e54835e0ed7e2c45be664e9974053eea95d1c6e6d546d"},{"arguments":["oracle","json-schema","{input}"],"authority_ids":["JSON-SCHEMA-2020-12"],"corpus":{"path":"standards/corpora/json-schema-2020-12","sha256":"8f63dc2d12ed947bfa4ae4cabab2d5926ecc06d86d054b6a3a4f3454446b5551"},"covers":["selected JSON Schema 2020-12 instance validity and all cases in the 46 mandatory upstream draft2020-12 files using pinned jsonschema 0.50.1"],"does_not_cover":["the upstream optional directory, application semantics, and requirements absent from a schema are outside this finite profile"],"edition":"2020-12@c9510e3b","executable":"prismpm","expected_exits":["0=pass","4=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"json-schema-2020-12","input_media_types":["application/schema+json","application/json"],"memory_bytes":268435456,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":1048576,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":30000,"trusted_root":null,"upstream_payload_sha256":"cf0e16252ef08add662b9db2b7f0f099644cdaffd1c429b1ce9212cebf086aba","wrapper_sha256":"6f78669abd8fa0d56568a281b34e2d668506aec6eaa2001f62e937f870a6a07b"},{"arguments":["{input}"],"authority_ids":["KUBERNETES-1-36-4"],"corpus":null,"covers":["Kubernetes 1.36.4 YAML decoding, generic List collection traversal, GVK selection, and locked official OpenAPI validation of every resource"],"does_not_cover":["server admission, rollout, managed-provider extensions, and future Kubernetes minors; those are deployment evidence"],"edition":"1.36.4","executable":"kubernetes-validator","expected_exits":["0=pass","nonzero=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"kubernetes-1.36.4","input_media_types":["application/yaml"],"memory_bytes":536870912,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":4194304,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":120000,"trusted_root":null,"upstream_payload_sha256":"dcede2063da1d7ad62ecb5af8adb6d7fabd0b52385a7fa0048afb491dac90450","wrapper_sha256":"3c2555117a2fe092fc9260dc2672edaac415d36bd16e1edbbe32af847f92e737"},{"arguments":["{subject}"],"authority_ids":["OCI-DISTRIBUTION-1-1-1"],"corpus":{"path":"standards/oracles/oci-distribution-1.1.1","sha256":"c3b22a1cef1975004c948e04005f02c013c02f9698c04da07998e9e13e875acc"},"covers":["all 79 official OCI Distribution 1.1.1 JUnit cases across pull, push, content discovery, and content management, each passed at least once by the unmodified upstream harness against complementary isolated configurations of the exact pinned Zot and Distribution reference subjects"],"does_not_cover":["authentication profiles, public registry availability, provider policy, and registry implementations other than the exact tested subjects"],"edition":"1.1.1@a139cc42","executable":"oci-distribution-conformance","expected_exits":["0=pass","1=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"oci-distribution-1.1.1-conformance","input_media_types":["application/vnd.oci.distribution.registry.v1"],"memory_bytes":536870912,"network":"isolated-subject","normalization":"prismpm/oracle-diagnostics/1","output_bytes":8388608,"output_schema":"prismpm/validation-result/1","subject":"ghcr.io/project-zot/zot@sha256:cd2aea942f428630bcb4190542be6abd35e14177aab84fc7ccad0dca8ecb363d","supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":300000,"trusted_root":null,"upstream_payload_sha256":"e69fbe28c2eb4b2ef5a12c76b21c32d959ee97a646afe7704577b14c295641d2","wrapper_sha256":"6f78669abd8fa0d56568a281b34e2d668506aec6eaa2001f62e937f870a6a07b"},{"arguments":["-test.v"],"authority_ids":["OCI-IMAGE-1-1-1"],"corpus":{"path":"standards/oracles/oci-image-1.1.1","sha256":"6c00d78efd45b6a3acc798497851b21585867042cbdc63dbe0c105825b8dac91"},"covers":["all official OCI Image 1.1.1 schema and specification example tests for configuration, descriptor, image index, image layout, manifest, artifact type, subject, and backwards compatibility, plus independent ORAS resolution failures"],"does_not_cover":["registry transport and OCI Runtime behavior are owned by their separate registered conformance oracles"],"edition":"1.1.1@147f9c13","executable":"oci-image-schema-conformance","expected_exits":["0=pass","nonzero=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"oci-layout-1.1","input_media_types":["application/vnd.oci.image.layout.v1+json"],"memory_bytes":268435456,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":1048576,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":60000,"trusted_root":null,"upstream_payload_sha256":"f632804ca432d6df5c0fad506d003ebdb99f57fff22c4559cb4163e1e240a7f4","wrapper_sha256":"6f78669abd8fa0d56568a281b34e2d668506aec6eaa2001f62e937f870a6a07b"},{"arguments":["{input}"],"authority_ids":["OCI-RUNTIME-1-3-0"],"corpus":{"path":"standards/oracles/oci-runtime-1.3.0","sha256":"9bf0da1272040438e13ce349a39a1dd036c3432f82e2cec5b17d2aa7db316e8a"},"covers":["all 19 good and bad config, features, and state fixtures shipped with the OCI Runtime 1.3.0 schemas"],"does_not_cover":["runtime lifecycle behavior beyond the separately executed unmodified container-engine positive and negative probes"],"edition":"1.3.0@92249139","executable":"oci-runtime-validate","expected_exits":["0=pass","1=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"oci-runtime-1.3.0-schema","input_media_types":["application/vnd.oci.runtime.config.v1+json","application/vnd.oci.runtime.features.v1+json","application/vnd.oci.runtime.state.v1+json"],"memory_bytes":268435456,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":1048576,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":30000,"trusted_root":null,"upstream_payload_sha256":"fbed724a4bbdce2260eea9a4d6dcf534a5e2446e581ed1b8bf27abe536cee17a","wrapper_sha256":"6f78669abd8fa0d56568a281b34e2d668506aec6eaa2001f62e937f870a6a07b"},{"arguments":["--official-selection"],"authority_ids":["OIDC-1-0-ERRATA1","OPENID-CONFORMANCE-SUITE-3E09B13B"],"corpus":{"path":"standards/oracles/openid-conformance-suite-3e09b13b","sha256":"a35012f67dccd4296ab0e380eb86a0e053dbbf6bf52522aca3ed961c83812197"},"covers":["the exact upstream OpenID Conformance Suite unit conditions for valid and invalid ID-token signatures, request-object expiration boundaries, and discovery issuer presence, syntax, and equality"],"does_not_cover":["provider certification profiles, browser flows, external endpoints, and OpenID specifications outside the selected OIDC Core conditions"],"edition":"1.0-errata1+conformance-suite-3e09b13b","executable":"openid-conformance","expected_exits":["0=all selected official conditions pass","nonzero=condition or harness failure"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"oidc-core-1.0-profile","input_media_types":["application/vnd.openid.conformance-suite.selection.v1+json"],"memory_bytes":1073741824,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":4194304,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":120000,"trusted_root":null,"upstream_payload_sha256":"d33d7eb40b6db0080a48563fe6e8d1073393d18fe9f4afcb3de83f1679197bbb","wrapper_sha256":"6f78669abd8fa0d56568a281b34e2d668506aec6eaa2001f62e937f870a6a07b"},{"arguments":["oracle","openapi","{input}"],"authority_ids":["OPENAPI-3-2-0","OPENAPI-SCHEMA-3-2-2025-11-23","JSON-SCHEMA-2020-12"],"corpus":null,"covers":["official OpenAPI 3.2 JSON Schema instance validity"],"does_not_cover":["server behavior and prose-only interoperability"],"edition":"3.2.0","executable":"prismpm","expected_exits":["0=pass","4=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"openapi-3.2-schema","input_media_types":["application/vnd.oai.openapi+json;version=3.2.0"],"memory_bytes":268435456,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":1048576,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":30000,"trusted_root":null,"upstream_payload_sha256":"7d48f01f37eeae4799041b371ad5f533f9f533fd2b0caa1011a8ba27c5b48b70","wrapper_sha256":"08a1ef2aec1e5ed35fe9162312a476b68b72b2133344738f645521a4276494e9"},{"arguments":["oracle","osv","{input}"],"authority_ids":["OSV-SCHEMA-B388","JSON-SCHEMA-2020-12"],"corpus":null,"covers":["OSV records in the submitted vulnerability collection against the pinned upstream schema"],"does_not_cover":["agreement with the locked advisory snapshot and vulnerabilities published after that snapshot are separate evidence"],"edition":"b388a18021a3","executable":"prismpm","expected_exits":["0=pass","4=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"osv-schema-snapshot","input_media_types":["application/vnd.osv+json"],"memory_bytes":268435456,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":1048576,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":30000,"trusted_root":null,"upstream_payload_sha256":"02fe51837bbb67fcd250151332ad1abc078f789e6d396585a4ae933e0c61c0e7","wrapper_sha256":"08a1ef2aec1e5ed35fe9162312a476b68b72b2133344738f645521a4276494e9"},{"arguments":["validate","--config","{input}"],"authority_ids":["OTEL-SPEC-1-60-0","OTEL-SEMCONV-1-37-0","OTEL-COLLECTOR-0-136-0"],"corpus":{"path":"standards/corpora/opentelemetry-0.136.0","sha256":"90cdf6a86d9f2f7c9b60f66c9be7c296b394dfef57ac5e28d78965565252f223"},"covers":["OpenTelemetry Collector configuration loading and unmodified Collector receipt/export of the declared OTLP trace, metric, and log signals"],"does_not_cover":["unbounded availability, network losslessness, and external exporter provider behavior"],"edition":"0.136.0","executable":"otelcol-contrib","expected_exits":["0=pass","nonzero=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"otel-collector-0.136.0","input_media_types":["application/yaml"],"memory_bytes":536870912,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":4194304,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":60000,"trusted_root":null,"upstream_payload_sha256":"b844833e8c72e2661275c911d79885a49a3171be9563a7c8b4827b202582b207","wrapper_sha256":"6f78669abd8fa0d56568a281b34e2d668506aec6eaa2001f62e937f870a6a07b"},{"arguments":["verify-blob","--bundle","{bundle}","--trusted-root","{trusted-root}","--certificate-identity","{identity}","--certificate-oidc-issuer","{issuer}","{subject}"],"authority_ids":["SIGSTORE-COSIGN-3-1-3"],"corpus":null,"covers":["bundle signature, certificate identity, issuer, and transparency policy under an explicitly supplied pinned Sigstore trusted root"],"does_not_cover":["subject semantics and undeclared builder authorization"],"edition":"3.1.3","executable":"cosign","expected_exits":["0=pass","nonzero=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"sigstore-cosign-3.1.3","input_media_types":["application/octet-stream"],"memory_bytes":536870912,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":4194304,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":120000,"trusted_root":{"path":"standards/trust/sigstore-trusted-root-cosign-3.1.3.json","role":"sigstore-verification-root","sha256":"844a1c6de3986c9f02070266b25e0d1a2fa99ceccc89f6b9ad90aae47b62a16e"},"upstream_payload_sha256":"3a718446bac51466efff6853639e1ca108b456ecbf07cd92938f548715d22d6b","wrapper_sha256":"08a1ef2aec1e5ed35fe9162312a476b68b72b2133344738f645521a4276494e9"},{"arguments":["--provenance","{provenance}","--trusted-root","{trusted-root}","--source-uri","{source-uri}","--certificate-identity","{identity}","--certificate-oidc-issuer","{issuer}","{subject}"],"authority_ids":["SLSA-1-2","SLSA-VERIFIER-2-7-1","INTOTO-STATEMENT-1-0"],"corpus":null,"covers":["SLSA v1 provenance subject, source, builder/signing workflow identity, issuer, and embedded transparency evidence under an explicit pinned trust policy"],"does_not_cover":["the complete slsa-verifier 2.7.1 policy surface and a higher SLSA build level than the hosted platform evidence establishes"],"edition":"1.2","executable":"slsa-validator","expected_exits":["0=pass","nonzero=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"slsa-provenance-1.2","input_media_types":["application/vnd.in-toto+json"],"memory_bytes":536870912,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":4194304,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":120000,"trusted_root":{"path":"standards/trust/sigstore-trusted-root-cosign-3.1.3.json","role":"sigstore-verification-root","sha256":"844a1c6de3986c9f02070266b25e0d1a2fa99ceccc89f6b9ad90aae47b62a16e"},"upstream_payload_sha256":"c1ed640d3f775d09549488d120f7d02694c1bbf5bf885c302a7916660c62056d","wrapper_sha256":"08a1ef2aec1e5ed35fe9162312a476b68b72b2133344738f645521a4276494e9"},{"arguments":["/opt/prismpm/share/standards/oracles/spdx-json-schema-3.0.1/spdx-json-schema.json","{input}"],"authority_ids":["SPDX-3-0-1","SPDX-SCHEMA-3-0-1"],"corpus":{"path":"standards/oracles/spdx-3.0.1-model","sha256":"8db53aa63cfc7565f79e057a4da362d4144c546d56320a51b838befe8371b17d"},"covers":["the complete published SPDX 3.0.1 JSON schema over the official model plus positive and planted-invalid core/software documents"],"does_not_cover":["truth of submitted checksums and facts omitted by an upstream package manager or image scanner"],"edition":"3.0.1","executable":"spdx-validator","expected_exits":["0=pass","1=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"spdx-3.0.1-model","input_media_types":["application/spdx+json;version=3.0.1"],"memory_bytes":268435456,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":1048576,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":30000,"trusted_root":null,"upstream_payload_sha256":"ff322ecc07bff0ec705f5e51c28002bc4d996de949cda0aedf456da4614eaaf7","wrapper_sha256":"6f78669abd8fa0d56568a281b34e2d668506aec6eaa2001f62e937f870a6a07b"},{"arguments":["oracle","unicode-normalization","{input}"],"authority_ids":["UNICODE-17-0-0"],"corpus":{"path":"standards/corpora/unicode-17.0.0","sha256":"1885ce2b3409b4f2b4a569c378d243f4a75e22fc10d59a69a69a1cacc16dda9e"},"covers":["every normalization assertion in the official Unicode 17.0.0 NormalizationTest.txt corpus and the UTF-8 scalar boundary"],"does_not_cover":["Unicode properties other than normalization and scalar-safe text handling"],"edition":"17.0.0","executable":"prismpm","expected_exits":["0=pass","4=invalid"],"failure_mapping":{"invalid":"PP5404","unavailable-or-untrusted":"PP5403"},"id":"unicode-normalization-17.0.0","input_media_types":["text/plain;profile=unicode-normalization-test"],"memory_bytes":268435456,"network":"deny","normalization":"prismpm/oracle-diagnostics/1","output_bytes":1048576,"output_schema":"prismpm/validation-result/1","subject":null,"supported_platforms":["linux/amd64","linux/arm64"],"timeout_ms":30000,"trusted_root":null,"upstream_payload_sha256":"2066d1909b2ea93916ce092da1c0ee4808ea3ef8407c94b4f14f5b7eb263d28e","wrapper_sha256":"6f78669abd8fa0d56568a281b34e2d668506aec6eaa2001f62e937f870a6a07b"}],"schema":"prismpm/standards-lock/1"} \ No newline at end of file diff --git a/tests/authenticated-signaling.test.js b/tests/authenticated-signaling.test.js new file mode 100644 index 0000000..ebf8c31 --- /dev/null +++ b/tests/authenticated-signaling.test.js @@ -0,0 +1,134 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { SignalSession } from '../src/layer5-transport/signaling.js'; +import { WebRtcTransportNode } from '../src/layer5-transport/index.js'; + +async function pair() { + const a = new SignalSession('mesh'), b = new SignalSession('mesh'); + const challenge = await b.receive(await a.sign({ kind: 'announce' })); + const response = await a.receive(await b.sign(challenge.reply)); + const joined = await b.receive(await a.sign(response.reply)); + assert.equal(joined.message.kind, 'announce'); + return { a, b }; +} + +test('public discovery requires signed session challenge before SDP admission', async () => { + const a = new SignalSession('mesh'), b = new SignalSession('mesh'); + const announce = await a.sign({ kind: 'announce' }); + const result = await b.receive(announce); + assert.equal(result.message, undefined); + assert.equal(result.reply.kind, 'hello'); + assert.equal(await b.receive({kind:'offer',from:a.id,channelKey:'mesh',sdp:{}}), null); + assert.equal(await b.receive(await a.sign({kind:'offer',to:(await b.identity()).id,targetSession:b.session,sdp:{type:'offer'}})), null); +}); + +test('signed SDP binds key/channel/destination/session and rejects concurrent replay', async () => { + const {a,b} = await pair(); + const offer = await a.sign({kind:'offer',to:b.id,sdp:{type:'offer',sdp:'signed'}}); + const results = await Promise.all([b.receive(offer),b.receive(offer)]); + assert.equal(results.filter(Boolean).length,1); + assert.equal(results.find(Boolean).message.sdp.sdp,'signed'); + for (const change of [{from:'key-forged'},{channelKey:'other'},{targetSession:a.session},{payload:{kind:'offer',sdp:{sdp:'injected'}}}]) { + assert.equal(await b.receive({...offer,...change}), null); + } +}); + +test('new key cannot impersonate bound key; reconnect invalidates old directed envelopes', async () => { + const {a,b} = await pair(), attacker = new SignalSession('mesh'); + const forged = await attacker.sign({kind:'offer',to:b.id,targetSession:b.session,sdp:{}}); + assert.equal(await b.receive({...forged,from:a.id}),null); + const old = await a.sign({kind:'offer',to:b.id,sdp:{}}); + b.close(); const fresh = new SignalSession('mesh'); + assert.equal(await b.receive(old),null); + assert.equal(await fresh.receive(old),null); +}); + +test('bounded discovery and authentication do not evict anti-replay records', async () => { + const b = new SignalSession('mesh',{maxPeers:1}); + const a = new SignalSession('mesh'), c = new SignalSession('mesh'); + assert.ok(await b.receive(await a.sign({kind:'announce'}))); + assert.equal(await b.receive(await c.sign({kind:'announce'})),null); + assert.equal(b.pending.size,1); +}); + +test('live transport rejects unsigned SDP before allocating RTC peers', async () => { + const node = new WebRtcTransportNode({channelKey:'mesh'}); + await node.handleSignal({kind:'offer',from:'claimed-victim',channelKey:'mesh',sdp:{}}); + assert.equal(node.peers.size,0); + node.close(); +}); + +test('two transport nodes negotiate using only authenticated relay envelopes', async t => { + let dataChannelsCreated = 0; + class Peer { + signalingState = 'stable'; connectionState = 'new'; + createDataChannel() { dataChannelsCreated++; return { readyState:'connecting',close(){} }; } + async createOffer() { return {type:'offer',sdp:'offer'}; } + async createAnswer() { return {type:'answer',sdp:'answer'}; } + async setLocalDescription(sdp) { this.localDescription=sdp; this.signalingState=sdp.type==='offer'?'have-local-offer':'stable'; } + async setRemoteDescription(sdp) { this.remoteDescription=sdp; this.signalingState=sdp.type==='offer'?'have-remote-offer':'stable'; } + close() {} + } + for (const [name,value] of Object.entries({RTCPeerConnection:Peer,RTCSessionDescription:class {constructor(sdp){Object.assign(this,sdp);}}})) { + const old=Object.getOwnPropertyDescriptor(globalThis,name); + Object.defineProperty(globalThis,name,{value,configurable:true,writable:true}); + t.after(()=>old?Object.defineProperty(globalThis,name,old):delete globalThis[name]); + } + const a=new WebRtcTransportNode({channelKey:'mesh'}),b=new WebRtcTransportNode({channelKey:'mesh'}), queue=[]; + t.after(()=>{a.close();b.close();}); + for(const [node,other] of [[a,b],[b,a]]) t.mock.method(node,'_queueRelay',async snapshot=>{queue.push([other,JSON.parse(snapshot.raw)]);return true;}); + a.sendSignal({kind:'announce'}); + for(let step=0;step<20;step++) { + await Promise.all([a,b].flatMap(n=>[...n.signalSigning.values()].map(j=>j.completion))); + if(!queue.length)break; + const [node,message]=queue.shift(); await node.handleSignal(message); + } + assert.equal(queue.length,0); + assert.equal(dataChannelsCreated,1, 'a pair must negotiate exactly one application channel, not crossing channels'); + assert.equal(a.peers.size,1);assert.equal(b.peers.size,1); + assert.ok(a.peers.get(b.signaling.id).pc.remoteDescription); + assert.ok(b.peers.get(a.signaling.id).pc.remoteDescription); + const before=a.peers.get(b.signaling.id).pc.remoteDescription; + await a.handleSignal({kind:'offer',from:b.signaling.id,channelKey:'mesh',sdp:{type:'offer',sdp:'evil'}}); + assert.equal(a.peers.get(b.signaling.id).pc.remoteDescription,before); +}); + +test('storage placement uses authenticated route identity rather than display label', async t => { + const {LiveUorMeshDatabase}=await import('../src/layer3-storage/index.js'); + const {createObject}=await import('../src/layer3-storage/custody.js'); + const node=new WebRtcTransportNode({peerId:'friendly-label',channelKey:'mesh'}); + t.after(()=>node.close()); + await node.signaling.identity(); + assert.notEqual(node.routingPeerId,node.peerId); + const db=new LiveUorMeshDatabase({transport:node}); + const bundle=await createObject(new Uint8Array([1,2,3])); + const packet=db._packet({manifest:bundle.manifest,label:'sample'},0,bundle.fragments[0].bytes, + {purpose:'placement',requestId:'request-1',holder:node.routingPeerId,leaseExpiresAt:Date.now()+10000}); + assert.equal(db._readPacket(packet).holder,node.routingPeerId); + assert.throws(()=>db._readPacket({...packet,holder:node.peerId})); +}); + +test('distinct offer and ICE remain in arrival order across delayed verification and RTC application', async t => { + const {a,b}=await pair(); + const offer=await a.sign({kind:'offer',to:b.id,sdp:{type:'offer',sdp:'ordered'}}); + const ice=await a.sign({kind:'ice',to:b.id,candidate:{candidate:'ordered'}}); + let releaseVerify,releaseApply,enteredVerify,enteredApply; + const verifyGate=new Promise(r=>releaseVerify=r), applyGate=new Promise(r=>releaseApply=r); + const verifying=new Promise(r=>enteredVerify=r), applying=new Promise(r=>enteredApply=r); + const original=crypto.subtle.verify.bind(crypto.subtle);let calls=0; + t.mock.method(crypto.subtle,'verify',async(...args)=>{ + if(++calls===1){enteredVerify();await verifyGate;} + return original(...args); + }); + const order=[]; + const first=b.receive(offer,async result=>{order.push(result.message.kind);enteredApply();await applyGate;}); + await verifying; + const second=b.receive(ice,result=>{order.push(result.message.kind);}); + await Promise.resolve();assert.equal(calls,1); + releaseVerify();await applying; + await Promise.resolve();assert.equal(calls,1);assert.deepEqual(order,['offer']); + releaseApply();const results=await Promise.all([first,second]); + assert.ok(results.every(Boolean));assert.deepEqual(order,['offer','ice']); + assert.equal(await b.receive(offer),null);assert.equal(await b.receive(ice),null); + assert.equal(b.verifying,0);assert.equal(b.queuedBytes,0); +}); diff --git a/tests/authority-ui.test.js b/tests/authority-ui.test.js new file mode 100644 index 0000000..eed56bd --- /dev/null +++ b/tests/authority-ui.test.js @@ -0,0 +1,78 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { installAuthorityControls } from '../src/authority-ui.js'; +import { SyntheticAuthorityStore } from './helpers/transactional-authority.js'; +import { generateAuthority, signPointer, PointerObserver } from '../src/layer1-uor/pointer.js'; +const name = 'state.example.test'; +async function pointer(authority) { return signPointer({ version:1, name, authorityKey: authority.publicKey, revision:0, previousDigest:null, + objectRoot:`sha256:${'d'.repeat(64)}`, validFromMs:0, validUntilMs:Number.MAX_SAFE_INTEGER }, authority.privateKey); } +async function setup() { + const store = new SyntheticAuthorityStore(), authority = await store.setupAuthority(), head = await pointer(authority); + const elements = new Map(), pins = new Map(), changed = [], downloads = []; + function element() { return { value:'', checked:false, open:true, textContent:'', hidden:false, disabled:false, attributes:{}, listeners:{}, + setAttribute(key,value) { this.attributes[key] = value; }, addEventListener(type,handler) { (this.listeners[type] ??= []).push(handler); }, + async emit(type) { for (const handler of this.listeners[type] ?? []) await handler(); } }; } + const document = { getElementById(id) { if (!elements.has(id)) elements.set(id,element()); return elements.get(id); } }; + const get = id => document.getElementById(id); + get('dnsQueryInput').value = name; get('pointerAuthorityInput').value = authority.publicKey; + const observer = () => { + const key = `${get('dnsQueryInput').value}:${get('pointerAuthorityInput').value}`; + if (!pins.has(key)) pins.set(key,new PointerObserver({ name:get('dnsQueryInput').value, trustedAuthorityKey:get('pointerAuthorityInput').value, clock:()=>5, trustStore:store })); + return pins.get(key); + }; + await observer().admit(head); + const ui = installAuthorityControls({ document, store, pointerObserver:observer, onAuthorityChanged:status=>changed.push(status), download:text=>downloads.push(text) }); + await ui.refresh(); + return { store, authority, head, ui, observer, get, changed, downloads, click:id=>get(id).emit('click') }; +} +test('rotation is contextual, exact-key confirmed and leaves visible pin and observer unchanged', async () => { + const t = await setup(), old = t.observer(); + await t.click('rotateAuthorityBtn'); assert.equal((await t.store.authorityStatus()).publicKey,t.authority.publicKey); + t.get('authorityExpectedKey').value = t.authority.publicKey; t.get('authorityLifecycleConsent').checked = true; + await t.click('rotateAuthorityBtn'); + assert.equal(t.changed.length,1); assert.notEqual(t.changed[0].publicKey,t.authority.publicKey); + assert.equal(t.get('pointerAuthorityInput').value,t.authority.publicKey); assert.equal(old.head.pointerDigest,t.head.pointerDigest); + assert.equal(t.get('authorityLifecycleConsent').checked,false); assert.match(t.get('authorityLifecycleStatus').textContent,/No trust pin or DNS record changed/); +}); +test('closing a pending lifecycle operation cancels commit; repeated click cannot repeat it', async () => { + const t = await setup(); let release, reached; + const gate = new Promise(r=>release=r), entered = new Promise(r=>reached=r); + const rotate = t.store.rotateAuthority.bind(t.store); let calls = 0; + t.store.rotateAuthority = async args => { calls++; reached(); await gate; return rotate(args); }; + t.get('authorityExpectedKey').value = t.authority.publicKey; t.get('authorityLifecycleConsent').checked = true; + const operation = t.click('rotateAuthorityBtn'); await entered; + assert.equal(t.get('authorityLifecyclePanel').attributes['aria-busy'],'true'); + await t.click('rotateAuthorityBtn'); assert.equal(calls,1); + t.get('authorityLifecyclePanel').open = false; await t.get('authorityLifecyclePanel').emit('toggle'); + release(); await operation; + assert.equal(t.get('authorityLifecyclePanel').attributes['aria-busy'],'false'); + assert.equal((await t.store.authorityStatus()).publicKey,t.authority.publicKey); + assert.match(t.get('authorityLifecycleStatus').textContent,/Refused or interrupted/); + t.get('authorityLifecyclePanel').open=true; await t.get('authorityLifecyclePanel').emit('toggle'); + assert.equal(calls,1); +}); +test('saving, migrating and restoring trust are separate explicit actions', async () => { + const t = await setup(); + t.get('authorityAnchorKey').value=t.authority.publicKey; t.get('authorityAnchorDigest').value=t.head.pointerDigest; t.get('authorityAnchorConsent').checked=true; + await t.click('saveTrustedAnchorBtn'); assert.equal((await t.store.trustedAnchor(name)).publicKey,t.authority.publicKey); + const replacement = await generateAuthority(), next = await pointer(replacement); + t.get('authorityAnchorKey').value=replacement.publicKey; t.get('authorityAnchorDigest').value=next.pointerDigest; + t.get('pointerJsonInput').value=JSON.stringify(next); t.get('authorityAnchorConsent').checked=true; + await t.click('migrateTrustedAnchorBtn'); + assert.equal((await t.store.trustedAnchor(name)).publicKey,replacement.publicKey); + assert.equal(t.get('pointerAuthorityInput').value,t.authority.publicKey); assert.equal(t.observer().head.pointerDigest,t.head.pointerDigest); + t.get('pointerAuthorityInput').value=replacement.publicKey; await t.get('pointerAuthorityInput').emit('input'); + await t.ui.refresh(); assert.equal(t.observer().head,null); + await t.click('restoreTrustedAnchorBtn'); assert.equal(t.observer().head.pointerDigest,next.pointerDigest); +}); +test('changing scope or anchor input clears consent, failed storage does not reset evidence, journal export is public', async () => { + const t = await setup(); + for (const id of ['dnsQueryInput','pointerAuthorityInput','authorityExpectedKey','authorityAnchorKey','authorityAnchorDigest','pointerJsonInput']) { + t.get('authorityAnchorConsent').checked=true; t.get('authorityLifecycleConsent').checked=true; + await t.get(id).emit('input'); assert.equal(t.get('authorityAnchorConsent').checked,false); assert.equal(t.get('authorityLifecycleConsent').checked,false); + } + await t.click('exportAuthorityJournalBtn'); assert.equal(t.downloads.length,1); assert.equal(t.downloads[0].includes('privateKey'),false); + t.store.fail = true; await t.click('inspectAuthorityStorageBtn'); t.store.fail = false; + assert.equal((await t.store.authorityStatus()).publicKey,t.authority.publicKey); + assert.match(t.get('authorityLifecycleStatus').textContent,/Nothing was reset|not reset/); +}); diff --git a/tests/browser-authority-lifecycle.test.js b/tests/browser-authority-lifecycle.test.js new file mode 100644 index 0000000..059a350 --- /dev/null +++ b/tests/browser-authority-lifecycle.test.js @@ -0,0 +1,198 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { SyntheticAuthorityStore } from './helpers/transactional-authority.js'; +import { BrowserAuthorityStore } from '../src/layer1-uor/browser-authority.js'; +import { generateAuthority, signPointer, PointerObserver, PointerPublisher } from '../src/layer1-uor/pointer.js'; +import { model } from '../src/layer1-uor/generated-model.js'; +const name = 'state.example.test', zoneId = 'b'.repeat(32), objectRoot = `sha256:${'a'.repeat(64)}`; +async function pointer(authority, revision = 0, previousDigest = null) { + return signPointer({ version: 1, name, authorityKey: authority.publicKey, revision, previousDigest, + objectRoot, validFromMs: 0, validUntilMs: 100 }, authority.privateKey); +} +async function save(store, candidate) { + return store.saveTrustedAnchor({ candidate, expectedAuthorityKey: candidate.authorityKey, expectedPointerDigest: candidate.pointerDigest, confirmed: true, nowMs: 5 }); +} +function observer(store, publicKey) { return new PointerObserver({ name, trustedAuthorityKey: publicKey, clock: () => 5, trustStore: store }); } +function pending(candidate, recordId = null) { return { outcome: 'unknown', candidate, pointerDigest: candidate.pointerDigest, recordId }; } +function scope(candidate) { return JSON.stringify([zoneId, candidate.name, candidate.authorityKey]); } + +test('model refuses absent/changed/unconfirmed lifecycle decisions and any uncertain journal removal', () => { + const rule = (name, ...args) => model[`Stitch.Authority.${name}`](...args); + for (const op of ['rotationAllowed','revocationAllowed','migrationAllowed']) { + const count = op === 'rotationAllowed' ? 4 : op === 'migrationAllowed' ? 5 : 3; + assert.equal(rule(op, ...Array(count).fill(true)), true); + for (let n = 0; n < count; n++) { const args = Array(count).fill(true); args[n] = false; assert.equal(rule(op, ...args), false); } + } + assert.equal(rule('publicationAllowed', true, true), false); + assert.equal(rule('publicationAllowed', false, false), false); + for (const confirmed of [true, false]) for (const noIdentity of [true, false]) assert.equal(rule('journalRemovalAllowed', confirmed, false, noIdentity), false); +}); +test('explicit rotation retains tombstones, all journals and saved trust, never repins', async () => { + const store = new SyntheticAuthorityStore(), first = await store.setupAuthority(), p = await pointer(first); + await save(store, p); await store.claimPublication(scope(p), pending(p)); + const next = await store.rotateAuthority({ expectedPublicKey: first.publicKey, confirmed: true, nowMs: 10 }); + assert.notEqual(next.publicKey, first.publicKey); assert.equal(next.generation, 1); + assert.deepEqual(next.history, [{ publicKey: first.publicKey, generation: 0, revokedAtMs: 10 }]); + assert.equal((await store.restoreAuthority()).privateKey.extractable, false); + assert.equal((await store.setupAuthority()).publicKey, next.publicKey); + assert.equal((await store.trustedAnchor(name)).publicKey, first.publicKey); + assert.deepEqual((await store.readPublication(scope(p))).candidate, p); + const otherName = { ...p, name: 'other.example.test' }; + await assert.rejects(store.claimPublication(scope(otherName), pending(otherName)), /revoked\/changed/); + await assert.rejects(store.signPointer({ ...p }, first.publicKey), /changed/); +}); +test('revocation survives restart and refuses setup and saved signing without pretending to retract signatures', async () => { + const store = new SyntheticAuthorityStore(), first = await store.setupAuthority(), candidate = await pointer(first); + await store.revokeAuthority({ expectedPublicKey: first.publicKey, confirmed: true, nowMs: 10 }); + const restart = new SyntheticAuthorityStore(store.state); + assert.equal((await restart.authorityStatus()).status, 'revoked'); + await assert.rejects(restart.restoreAuthority(), /revoked/); await assert.rejects(restart.setupAuthority(), /revoked/); + await assert.rejects(restart.signPointer(candidate, first.publicKey), /revoked/); + assert.equal(store.state.records.get('authority').privateKey, null); + // Local revocation is intentionally not cryptographic erasure of old handles. + const { verifyPointer } = await import('../src/layer1-uor/pointer.js'); + await verifyPointer(candidate, first.publicKey); + const next = await restart.rotateAuthority({ expectedPublicKey: first.publicKey, confirmed: true }); + assert.notEqual(next.publicKey, first.publicKey); +}); +test('wrong exact key, no consent, stale UI and commit failure preserve authority and journals', async () => { + const store = new SyntheticAuthorityStore(), first = await store.setupAuthority(), candidate = await pointer(first); + await store.claimPublication(scope(candidate), pending(candidate)); + const before = structuredClone([...store.state.records]); + for (const args of [{ expectedPublicKey: first.publicKey }, { expectedPublicKey: 'f'.repeat(64), confirmed: true }, + { expectedPublicKey: first.publicKey, confirmed: true, scopeStillCurrent: () => false }]) { + await assert.rejects(store.rotateAuthority(args)); + await assert.rejects(store.revokeAuthority(args)); + } + store.fail = true; + await assert.rejects(store.rotateAuthority({ expectedPublicKey: first.publicKey, confirmed: true }), /quota/); + await assert.rejects(store.revokeAuthority({ expectedPublicKey: first.publicKey, confirmed: true }), /quota/); + store.fail = false; assert.deepEqual([...store.state.records], before); +}); +test('origin lock waits for dispatch, revocation then blocks new old-key writes but permits exact reconciliation', async () => { + const store = new SyntheticAuthorityStore(), authority = await store.setupAuthority(), candidate = await pointer(authority); + let release, entered; const gate = new Promise(r => release = r), reached = new Promise(r => entered = r); + let records = [], writes = 0; + const resolver = { async listCloudflareRecords() { return records; }, async writeCloudflareRecord(input) { + writes++; entered(); await gate; records = [{ ...input, id: 'record-one' }]; throw Error('lost acknowledgement'); + } }; + const publisher = () => new PointerPublisher({ journal: new SyntheticAuthorityStore(store.state), resolver, clock: () => 5 }); + const request = { zoneId, name, apiToken: 'not-exportable', trustedAuthorityKey: authority.publicKey, candidate }; + const first = publisher().publish(request); await reached; + let revoked = false; + const revocation = store.revokeAuthority({ expectedPublicKey: authority.publicKey, confirmed: true }).then(() => revoked = true); + await new Promise(r => setTimeout(r, 10)); assert.equal(revoked, false); + release(); assert.equal((await first).outcome, 'unknown'); await revocation; + assert.equal((await publisher().publish(request)).outcome, 'published'); assert.equal(writes, 1); + const next = await pointer(authority, 1, candidate.pointerDigest); + await assert.rejects(publisher().publish({ ...request, candidate: next }), /revoked\/changed/); + assert.equal(writes, 1); +}); +test('saved exact heads restore explicitly, advance transactionally and reject stale reload bootstrap', async () => { + const store = new SyntheticAuthorityStore(), authority = await generateAuthority(), first = await pointer(authority); + await save(store, first); + const live = observer(store, authority.publicKey); + assert.equal(live.head, null); + await live.restoreFromTrustedAnchor({ expectedDigest: first.pointerDigest }); + const next = await pointer(authority, 1, first.pointerDigest); + store.fail = true; await assert.rejects(live.admit(next)); store.fail = false; + assert.equal(live.head.pointerDigest, first.pointerDigest); + await live.admit(next); assert.equal((await store.trustedAnchor(name)).head.pointerDigest, next.pointerDigest); + const reloaded = observer(new SyntheticAuthorityStore(store.state), authority.publicKey); + await assert.rejects(reloaded.admit(first), /pointer-conflict|restore/); assert.equal(reloaded.head, null); + await assert.rejects(reloaded.restoreFromTrustedAnchor({ expectedDigest: first.pointerDigest }), /changed/); + await reloaded.restoreFromTrustedAnchor({ expectedDigest: next.pointerDigest }); + assert.equal(reloaded.head.pointerDigest, next.pointerDigest); +}); +test('migration requires exact independently accepted scope, refuses stale/canceled acceptance, never changes old observer', async () => { + const store = new SyntheticAuthorityStore(), old = await generateAuthority(), replacement = await generateAuthority(); + const a = await pointer(old), b = await pointer(replacement, 7, objectRoot); await save(store, a); + const live = observer(store, old.publicKey); await live.restoreFromTrustedAnchor({ expectedDigest: a.pointerDigest }); + const migration = { name, expectedAuthorityKey: old.publicKey, expectedPointerDigest: a.pointerDigest, + newAuthorityKey: replacement.publicKey, newPointerDigest: b.pointerDigest, candidate: b, confirmed: true, nowMs: 5 }; + for (const patch of [{ confirmed: false }, { newPointerDigest: objectRoot }, { expectedPointerDigest: objectRoot }, + { newAuthorityKey: old.publicKey }, { scopeStillCurrent: () => false }, { nowMs: 100 }]) await assert.rejects(store.migrateTrustedAnchor({ ...migration, ...patch })); + await store.migrateTrustedAnchor(migration); + assert.equal(live.trustedAuthorityKey, old.publicKey); assert.equal(live.head.pointerDigest, a.pointerDigest); + await assert.rejects(live.admit(await pointer(old, 1, a.pointerDigest)), /different or revoked/); + const newLive = observer(store, replacement.publicKey); + await assert.rejects(newLive.admit(b), /bootstrap/); + await newLive.restoreFromTrustedAnchor({ expectedDigest: b.pointerDigest }); + await newLive.admit(await pointer(replacement, 8, b.pointerDigest)); + await assert.rejects(store.migrateTrustedAnchor(migration), /changed/); +}); +test('local trust revocation blocks admission and new claims while retaining head, journal and migration path', async () => { + const store = new SyntheticAuthorityStore(), authority = await generateAuthority(), p = await pointer(authority); await save(store, p); + const live = observer(store, authority.publicKey); await live.restoreFromTrustedAnchor({ expectedDigest: p.pointerDigest }); + await store.claimPublication(scope(p), pending(p)); + await store.revokeTrustedAnchor({ name, expectedAuthorityKey: authority.publicKey, expectedPointerDigest: p.pointerDigest, confirmed: true }); + await assert.rejects(live.admit(await pointer(authority, 1, p.pointerDigest)), /revoked/); + await assert.rejects(observer(store, authority.publicKey).restoreFromTrustedAnchor({ expectedDigest: p.pointerDigest }), /revoked/); + const replacement = await generateAuthority(), next = await pointer(replacement); + await assert.rejects(store.migrateTrustedAnchor({ name, expectedAuthorityKey: authority.publicKey, expectedPointerDigest: p.pointerDigest, + newAuthorityKey: authority.publicKey, newPointerDigest: p.pointerDigest, candidate: p, confirmed: true, nowMs: 5 }), /retired/); + await store.migrateTrustedAnchor({ name, expectedAuthorityKey: authority.publicKey, expectedPointerDigest: p.pointerDigest, + newAuthorityKey: replacement.publicKey, newPointerDigest: next.pointerDigest, candidate: next, confirmed: true, nowMs: 5 }); + assert.deepEqual((await store.readPublication(scope(p))).candidate, p); +}); +test('anchor validity and UI scope are checked at transaction commit after crypto', async () => { + const store = new SyntheticAuthorityStore(), authority = await generateAuthority(), p = await pointer(authority); + let now = 5; store.clock = () => now; + const original = store.transaction.bind(store); + store.transaction = (key, work) => { if (key.startsWith('trust:')) now = 100; return original(key, work); }; + await assert.rejects(store.saveTrustedAnchor({ candidate: p, expectedAuthorityKey: authority.publicKey, expectedPointerDigest: p.pointerDigest, confirmed: true }), /expired/); + assert.equal(await store.trustedAnchor(name), null); +}); +test('quota inspection, explicit persistence and public export do not leak keys, tokens or mutation ownership', async () => { + const store = new SyntheticAuthorityStore(), a = await store.setupAuthority(), p = await pointer(a); await save(store, p); + await store.claimPublication(scope(p), pending(p)); + let asks = 0; store.storage = { estimate: async () => ({ usage: 100, quota: 900 }), persisted: async () => false, persist: async () => { asks++; return false; } }; + assert.deepEqual(await store.inspectStorage(), { usageBytes: 100, quotaBytes: 900, persistent: false, journalEntries: 1, unknownEntries: 1, + assurance: 'Origin-wide estimates and persistence permission do not guarantee retention or provide a backup.' }); + await assert.rejects(store.requestPersistence()); assert.equal(asks, 0); + assert.equal(await store.requestPersistence({ confirmed: true }), false); assert.equal(asks, 1); + const wire = await store.exportPublicJournal(), data = JSON.parse(wire); + assert.deepEqual(data.publications[0].candidate, p); assert.equal(data.authority.publicKey, a.publicKey); + for (const secret of ['privateKey','owner','not-exportable']) assert.equal(wire.includes(secret), false); + assert.equal(await new BrowserAuthorityStore({ indexedDB: null }).requestPersistence({ confirmed: true }).catch(() => 'unsupported'), 'unsupported'); +}); +test('compaction never removes unknown writes, published heads, provider identities or trust/key tombstones', async () => { + const store = new SyntheticAuthorityStore(), a = await store.setupAuthority(), p = await pointer(a); await save(store, p); + for (const [suffix, state] of [['unknown', pending(p)], ['published',{ outcome:'published', pointerDigest:p.pointerDigest, recordId:'record-one' }], + ['refused-update',{ outcome:'refused', pointerDigest:p.pointerDigest, recordId:'record-one' }], ['refused-create',{ outcome:'refused', pointerDigest:p.pointerDigest, recordId:null }]]) store.state.records.set(`dns:${suffix}`, state); + await assert.rejects(store.compactRefusedJournal()); + assert.equal(await store.compactRefusedJournal({ confirmed:true }), 1); + assert.equal(store.state.records.has('dns:refused-create'), false); + for (const key of ['authority',`trust:${name}`,'dns:unknown','dns:published','dns:refused-update']) assert.equal(store.state.records.has(key), true); +}); + +test('same-key reanchoring refuses rollback and forks and does not pretend missing intermediate links were checked', async () => { + const store = new SyntheticAuthorityStore(), authority = await generateAuthority(), first = await pointer(authority); await save(store, first); + const jump = await pointer(authority, 9, objectRoot); + const request = { name, expectedAuthorityKey:authority.publicKey, expectedPointerDigest:first.pointerDigest, + newAuthorityKey:authority.publicKey, newPointerDigest:jump.pointerDigest, candidate:jump, confirmed:true, nowMs:5 }; + await store.migrateTrustedAnchor(request); + assert.equal((await store.trustedAnchor(name)).head.pointerDigest,jump.pointerDigest); + await assert.rejects(store.migrateTrustedAnchor({ ...request, expectedPointerDigest:jump.pointerDigest, newPointerDigest:first.pointerDigest, candidate:first }), /rollback/); + const fork = await pointer(authority,9,first.pointerDigest); + await assert.rejects(store.migrateTrustedAnchor({ ...request, expectedPointerDigest:jump.pointerDigest, newPointerDigest:fork.pointerDigest, candidate:fork }), /fork/); + const adjacent = await pointer(authority,10,first.pointerDigest); + await assert.rejects(store.migrateTrustedAnchor({ ...request, expectedPointerDigest:jump.pointerDigest, newPointerDigest:adjacent.pointerDigest, candidate:adjacent }), /predecessor/); + await assert.rejects(store.retainTrustedHead({ name, expectedPointerDigest:jump.pointerDigest, candidate:{ ...jump, revision:0 }, nowMs:5 }), /integrity/); +}); + +test('saved trust revocation waits for a provider dispatch and never discards its unresolved candidate', async () => { + const store = new SyntheticAuthorityStore(), authority = await generateAuthority(), p = await pointer(authority); await save(store, p); + let reached, release, writes = 0; const entered = new Promise(r=>reached=r), gate = new Promise(r=>release=r); + const resolver = { async listCloudflareRecords() { return []; }, async writeCloudflareRecord() { writes++; reached(); await gate; throw Error('interrupted'); } }; + const publisher = new PointerPublisher({ journal:store, resolver, clock:()=>5 }); + const publication = publisher.publish({ zoneId, name, trustedAuthorityKey:authority.publicKey, candidate:p, apiToken:'never-export' }); + await entered; + let finished = false; + const revoke = store.revokeTrustedAnchor({ name, expectedAuthorityKey:authority.publicKey, expectedPointerDigest:p.pointerDigest, confirmed:true }).then(()=>finished=true); + await new Promise(r=>setTimeout(r,10)); assert.equal(finished,false); + release(); assert.equal((await publication).outcome,'unknown'); await revoke; + assert.deepEqual((await store.readPublication(scope(p))).candidate,p); assert.equal(writes,1); + assert.equal((await publisher.publish({ zoneId, name, trustedAuthorityKey:authority.publicKey, candidate:p, apiToken:'never-export' })).outcome,'unknown'); + assert.equal(writes,1); +}); diff --git a/tests/browser-authority.test.js b/tests/browser-authority.test.js new file mode 100644 index 0000000..ec59624 --- /dev/null +++ b/tests/browser-authority.test.js @@ -0,0 +1,136 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { SyntheticAuthorityStore } from './helpers/transactional-authority.js'; +import { BrowserAuthorityStore } from '../src/layer1-uor/browser-authority.js'; +import { generateAuthority, signPointer, PointerPublisher, pointerDnsText } from '../src/layer1-uor/pointer.js'; +async function fixture() { + const journal = new SyntheticAuthorityStore(), authority = await generateAuthority(); + const name = 'state.example.test', zoneId = 'a'.repeat(32); + const candidate = await signPointer({ version: 1, name, authorityKey: authority.publicKey, revision: 0, + previousDigest: null, objectRoot: `sha256:${'f'.repeat(64)}`, validFromMs: 0, validUntilMs: 100 }, authority.privateKey); + let records = [], writes = 0, mode = 'lost'; + const resolver = { + async listCloudflareRecords() { return structuredClone(records); }, + async writeCloudflareRecord(input) { + writes++; + const saved = await journal.readPublication(JSON.stringify([zoneId, name, authority.publicKey])); + assert.deepEqual(saved.candidate, candidate); assert.equal(saved.outcome, 'unknown'); + if (mode !== 'absent') records = [{ ...input, id: 'record-1' }]; + if (mode !== 'success') throw Error('lost response'); + return { outcome: 'published', ok: true, id: 'record-1' }; + } + }; + const args = { zoneId, name, trustedAuthorityKey: authority.publicKey, candidate, apiToken: 'never-save-this' }; + const publisher = () => new PointerPublisher({ resolver, journal: new SyntheticAuthorityStore(journal.state), clock: () => 5 }); + return { journal, authority, args, publisher, resolver, writes: () => writes, mode: value => mode = value, + rows: value => records = value }; +} +test('explicit setup persists nonextractable same authority; restore never creates or rotates', async () => { + const store = new SyntheticAuthorityStore(); + assert.equal(await store.restoreAuthority(), null); + const [a, b] = await Promise.all([store.setupAuthority(), store.setupAuthority()]); + assert.equal(a.publicKey, b.publicKey); assert.equal(a.privateKey.extractable, false); + assert.equal((await new SyntheticAuthorityStore(store.state).restoreAuthority()).publicKey, a.publicKey); + await assert.rejects(crypto.subtle.exportKey('pkcs8', a.privateKey)); + store.fail = true; await assert.rejects(store.setupAuthority()); store.fail = false; + assert.equal((await store.restoreAuthority()).publicKey, a.publicKey); +}); +test('unavailable or corrupt storage never substitutes a new signing authority', async () => { + await assert.rejects(new BrowserAuthorityStore({ indexedDB: null }).restoreAuthority()); + const store = new SyntheticAuthorityStore(); store.state.records.set('authority', { version: 1 }); + await assert.rejects(store.setupAuthority()); assert.deepEqual(store.state.records.get('authority'), { version: 1 }); +}); +test('lost result survives restart and exact read reconciles with no repeated mutation', async () => { + const f = await fixture(); assert.equal((await f.publisher().publish(f.args)).outcome, 'unknown'); + const restarted = f.publisher(); assert.deepEqual(await restarted.restore(f.args), f.args.candidate); + assert.equal((await restarted.publish(f.args)).outcome, 'published'); assert.equal(f.writes(), 1); + assert.equal(JSON.stringify([...f.journal.state.records]).includes('never-save-this'), false); +}); +test('absent observation after interruption cannot authorize retry, even for a new candidate', async () => { + const f = await fixture(); f.mode('absent'); await f.publisher().publish(f.args); + const next = await signPointer({ ...Object.fromEntries(Object.entries(f.args.candidate).filter(([k]) => !['signature','pointerDigest'].includes(k))), + revision: 1, previousDigest: f.args.candidate.pointerDigest }, f.authority.privateKey); + assert.equal((await f.publisher().publish({ ...f.args, candidate: next })).outcome, 'unknown'); + assert.equal(f.writes(), 1); +}); +test('concurrent tabs obtain one transactional mutation owner', async () => { + const f = await fixture(); f.mode('absent'); + const results = await Promise.all([f.publisher().publish(f.args), f.publisher().publish(f.args)]); + assert.deepEqual(results.map(x => x.outcome), ['unknown', 'unknown']); assert.equal(f.writes(), 1); +}); +test('claim commit failure prevents all provider mutation and preserves prior bytes', async () => { + const f = await fixture(); f.journal.fail = true; + const publisher = new PointerPublisher({ resolver: f.resolver, journal: f.journal, clock: () => 5 }); + await assert.rejects(publisher.publish(f.args)); assert.equal(f.writes(), 0); assert.equal(f.journal.state.records.size, 0); +}); +test('failure to commit exact post-read intent blocks dispatch and permits repaired explicit retry', async () => { + const f = await fixture(); f.journal.fail = 2; + const publisher = new PointerPublisher({ resolver: f.resolver, journal: f.journal, clock: () => 5 }); + await assert.rejects(publisher.publish(f.args), /quota/); assert.equal(f.writes(), 0); + assert.equal(await f.publisher().restore(f.args), null); + assert.equal((await f.publisher().publish(f.args)).outcome, 'unknown'); assert.equal(f.writes(), 1); +}); +test('completion persistence failure retains unknown and later reads reconcile', async () => { + const f = await fixture(); f.mode('success'); + // load prior, claim exact pending, adapter inspection read, then completion + f.journal.fail = 4; + const publisher = new PointerPublisher({ resolver: f.resolver, journal: f.journal, clock: () => 5 }); + assert.equal((await publisher.publish(f.args)).outcome, 'unknown'); + assert.equal((await f.publisher().publish(f.args)).outcome, 'published'); assert.equal(f.writes(), 1); +}); +test('missing Web Locks refuses publication instead of unsafe cross-tab fallback', async () => { + const f = await fixture(); + const store = new BrowserAuthorityStore({ locks: null }); + const publisher = new PointerPublisher({ resolver: f.resolver, journal: store }); + await assert.rejects(publisher.publish(f.args), /Web Locks/); assert.equal(f.writes(), 0); +}); +test('a suspended live writer holds the lock until completion; another tab cannot reconcile past it', async () => { + const f = await fixture(); let unblock, entered; + const reached = new Promise(resolve => entered = resolve), gate = new Promise(resolve => unblock = resolve); + const original = f.resolver.writeCloudflareRecord; + f.resolver.writeCloudflareRecord = async input => { entered(); await gate; return original(input); }; + const first = f.publisher().publish(f.args); await reached; + let secondDone = false; + const second = f.publisher().publish(f.args).then(value => { secondDone = true; return value; }); + await new Promise(resolve => setTimeout(resolve, 10)); + assert.equal(secondDone, false); assert.equal(f.writes(), 0); + unblock(); await first; assert.equal((await second).outcome, 'published'); assert.equal(f.writes(), 1); +}); +test('provider read failure leaves no unknown claim and repaired explicit retry writes once', async () => { + const f = await fixture(); const original = f.resolver.listCloudflareRecords; + f.resolver.listCloudflareRecords = async () => { throw Error('read unavailable'); }; + await assert.rejects(f.publisher().publish(f.args), /read unavailable/); + assert.equal(await f.publisher().restore(f.args), null); assert.equal(f.writes(), 0); + f.resolver.listCloudflareRecords = original; + assert.equal((await f.publisher().publish(f.args)).outcome, 'unknown'); assert.equal(f.writes(), 1); + assert.equal((await f.publisher().publish(f.args)).outcome, 'published'); assert.equal(f.writes(), 1); +}); +test('exhausted admission before provider read does not wedge publication after renewal', async () => { + const f = await fixture(); let exhausted = true, reads = 0; + f.resolver.admission = { reserve() { if (exhausted) throw Error('resource epoch exhausted'); } }; + const original = f.resolver.listCloudflareRecords; + f.resolver.listCloudflareRecords = async () => { reads++; return original(); }; + await assert.rejects(f.publisher().publish(f.args), /epoch exhausted/); + assert.equal(reads, 0); assert.equal(f.writes(), 0); assert.equal(await f.publisher().restore(f.args), null); + exhausted = false; + await f.publisher().publish(f.args); assert.equal(f.writes(), 1); + await f.publisher().publish(f.args); assert.equal(f.writes(), 1); +}); +test('provably undispatched adapter refusal settles owned claim and permits explicit repair', async () => { + const f = await fixture(); const original = f.resolver.writeCloudflareRecord; + f.resolver.writeCloudflareRecord = async () => { throw Object.assign(Error('local adapter refusal'), { effectDispatched: false }); }; + await assert.rejects(f.publisher().publish(f.args), /local adapter refusal/); + assert.equal(await f.publisher().restore(f.args), null); assert.equal(f.writes(), 0); + assert.equal([...f.journal.state.records.values()][0].outcome, 'refused'); + f.resolver.writeCloudflareRecord = original; + await f.publisher().publish(f.args); await f.publisher().publish(f.args); assert.equal(f.writes(), 1); +}); +test('failure to save definite undispatched refusal remains conservatively unknown', async () => { + const f = await fixture(); + f.resolver.writeCloudflareRecord = async () => { throw Object.assign(Error('local adapter refusal'), { effectDispatched: false }); }; + f.journal.fail = 3; // load, claim, then refusal settlement abort + const publisher = new PointerPublisher({ resolver: f.resolver, journal: f.journal, clock: () => 5 }); + assert.equal((await publisher.publish(f.args)).outcome, 'unknown'); + assert.deepEqual(await f.publisher().restore(f.args), f.args.candidate); + assert.equal((await f.publisher().publish(f.args)).outcome, 'unknown'); assert.equal(f.writes(), 0); +}); diff --git a/tests/browser-transport.test.js b/tests/browser-transport.test.js new file mode 100644 index 0000000..21d0297 --- /dev/null +++ b/tests/browser-transport.test.js @@ -0,0 +1,72 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { WebRtcTransportNode } from '../src/layer5-transport/index.js'; + +function replace(t, name, value) { + const prior = Object.getOwnPropertyDescriptor(globalThis, name); + Object.defineProperty(globalThis, name, { value, writable: true, configurable: true }); + t.after(() => prior ? Object.defineProperty(globalThis, name, prior) : delete globalThis[name]); +} + +test('explicit local-only ICE and caller configuration are snapshotted before browser allocation', t => { + const seen = []; + replace(t, 'RTCPeerConnection', class { + constructor(config) { seen.push(config); } + close() {} + }); + const input = [{ urls: ['turn:example.test:3478'], username: 'scoped-user', credential: 'test-only' }]; + const node = new WebRtcTransportNode({ iceServers: input }); + t.after(() => node.close()); + input[0].urls[0] = 'stun:changed.test'; input[0].credential = 'changed'; input.push({ urls: 'stun:new.test' }); + node.getOrCreatePeer('remote'); + assert.deepEqual(seen[0], { iceServers: [{ urls: ['turn:example.test:3478'], username: 'scoped-user', credential: 'test-only' }] }); + const local = new WebRtcTransportNode({ iceServers: [] }); + t.after(() => local.close()); local.getOrCreatePeer('remote'); + assert.deepEqual(seen[1], { iceServers: [] }); +}); + +test('malformed or excessive ICE configuration refuses before allocating peers', t => { + let calls = 0; + replace(t, 'RTCPeerConnection', class { constructor() { calls++; } }); + for (const iceServers of [{}, [{}], [{ urls: [] }], [{ urls: 'https://example.test' }], + [{ urls: 'stun:with space' }], [{ urls: 'stun:example.test', credential: {} }], + [{ urls: 'stun:example.test', unsupported: true }], Array(17).fill({ urls: 'stun:example.test' })]) { + assert.throws(() => new WebRtcTransportNode({ iceServers }), /Invalid ICE server configuration/); + } + assert.equal(calls, 0); +}); + +test('same-origin discovery announces without waiting for an unavailable public signaling socket', async t => { + const frames = [], sockets = []; + replace(t, 'BroadcastChannel', class { + postMessage(value) { frames.push(value); } + close() {} + }); + replace(t, 'WebSocket', class { + constructor() { sockets.push(this); } + close() {} + }); + t.mock.method(globalThis, 'fetch', async () => { throw Error('provider unreachable'); }); + const node = new WebRtcTransportNode({ iceServers: [] }); + t.after(() => node.close()); + node.connect(); + await node.signalTail; + assert.equal(sockets.length, 1); + assert.equal(frames.length, 1); + assert.equal(frames[0].payload.kind, 'announce'); + assert.equal(frames[0].from, node.routingPeerId); + assert.match(frames[0].signature, /^[A-Za-z0-9_-]+$/); +}); + +test('explicit local signaling mode cannot open provider sockets or POST, even while fetch exists', async t => { + let sockets = 0, fetches = 0; + const frames = []; + replace(t, 'BroadcastChannel', class { postMessage(frame) { frames.push(frame); } close() {} }); + replace(t, 'WebSocket', class { constructor() { sockets++; } close() {} }); + t.mock.method(globalThis, 'fetch', async () => { fetches++; throw Error('No provider access allowed'); }); + const node = new WebRtcTransportNode({ iceServers: [], publicSignaling: false }); + t.after(() => node.close()); + node.connect(); await node.signalTail; + assert.equal(sockets, 0); assert.equal(fetches, 0); assert.equal(frames.length, 1); + assert.equal(frames[0].payload.kind, 'announce'); +}); diff --git a/tests/browser/README.md b/tests/browser/README.md new file mode 100644 index 0000000..8b32588 --- /dev/null +++ b/tests/browser/README.md @@ -0,0 +1,62 @@ +# Native Chromium qualification + +Run with Node 22+ and Python 3: + +```sh +npm ci --ignore-scripts +npx playwright install --with-deps chromium --only-shell +npm run test:browser +``` + +`@playwright/test` is exactly pinned in the package lock. The browser job in +`.github/workflows/prism.yml` runs once per submitted revision, without retries, +with one worker, a five-minute suite bound and a ten-minute job bound. The test +server binds only loopback. Failures retain an HTML report, screenshots and +traces. `--list` validates discovery without attempting to start a browser. + +These are actual Chromium tests, not the Node synthetic fixtures: + +- The shipped page initializes its actual module graph and model-derived journey + controls. Navigation uses real focus and keyboard activation, preserves inputs + and mesh hash/history, and retains explicit disclosure guards. +- Real origin-local IndexedDB transactions serialize concurrent authority setup. + A nonextractable Ed25519 private CryptoKey survives reload and signs a pointer + that the shipped observer verifies. Reload alone does not pin its public key. +- Actual Web Locks serialize two tabs. Terminating the owner releases the lock + but preserves its unknown publication intent in IndexedDB. This test writes + no provider record and does not claim provider reconciliation evidence. +- Two actual pages use authenticated BroadcastChannel signaling, native host-only + ICE/RTCPeerConnection/SCTP and the shipped ChannelFlow. Large fragmented UTF-8 + payloads are digest-compared after delivery, a real storage fragment receives + its exact custody acknowledgment, and a remote pure-job checkpoint is replayed. + One remote holder remains partial, not fabricated recovery. A separate three-page + trial commits two distinct holders, clears the writer RAM and recovers the exact + object through actual peer fragment requests. These pages are not independent + physical failure domains. Reconnection rejects + an old authenticated incarnation. No fake RTC implementation is installed. +- The actual bundled v86 JavaScript, WASM, BIOS and kernel boot through the shipped + page. A guest shell command produces observed marker and Linux output, which + is retained and reconciled before explicit stop/destroy administration. +- Two actual production VMs use explicit distinct static IPv4 addresses and + exchange real ARP/ICMP over authenticated host-only RTC. Absent network + configuration refuses grants; default-denied ping, bilateral consent, + natural ARP recovery within three bounded probes, reverse ping and receiver + revocation are checked. No neighbor cache is flushed. Serial shell output, + peer identities, bounded frame headers and command outputs are retained. + The ordinary browser job runs this regression against the shipped image; + no candidate substitution or environment opt-in is required. + +All external HTTP and WebSocket destinations are aborted before provider +communication. The RTC test passes `iceServers: []` and `publicSignaling: false`; +this disables public signaling sockets and POSTs by construction, and no public +STUN/TURN is used. +Native DOM, WebCrypto, IndexedDB, Web Locks, BroadcastChannel and RTC APIs are not +replaced. Provider unavailability is intentional and not counted as successful +provider interoperability. No user credentials, paid operations or third-party +writes are used. + +A green run establishes only this Chromium/runner combination and these bounded +scenarios on its exact revision. It does not establish cross-device authority, +NAT traversal, public signaling/relay/DNS availability, provider writes, durable +remote custody, browser compatibility beyond Chromium or complete guest isolation. +Native Prism/Lean gates and vendor redistribution evidence remain independent. diff --git a/tests/browser/authority.spec.mjs b/tests/browser/authority.spec.mjs new file mode 100644 index 0000000..b972675 --- /dev/null +++ b/tests/browser/authority.spec.mjs @@ -0,0 +1,79 @@ +import { test, expect, harness } from './fixtures.mjs'; + +test('real IndexedDB serializes concurrent setup and persists nonextractable Ed25519 signing across reload', async ({ page, context }) => { + const second = await context.newPage(); + await Promise.all([harness(page), harness(second)]); + const database = `stitch-browser-${crypto.randomUUID()}`; + async function setup(target) { + return target.evaluate(async database => { + const { BrowserAuthorityStore } = await import('/src/layer1-uor/browser-authority.js'); + const store = new BrowserAuthorityStore({ database }); + const key = await store.setupAuthority(); + let exported = false; + try { await crypto.subtle.exportKey('pkcs8', key.privateKey); exported = true; } catch {} + return { key: key.publicKey, extractable: key.privateKey.extractable, exported }; + }, database); + } + const [first, other] = await Promise.all([setup(page), setup(second)]); + expect(first).toEqual(other); + expect(first).toEqual({ key: expect.stringMatching(/^[a-f0-9]{64}$/), extractable: false, exported: false }); + await page.reload(); + const result = await page.evaluate(async database => { + const { BrowserAuthorityStore } = await import('/src/layer1-uor/browser-authority.js'); + const { signPointer, PointerObserver } = await import('/src/layer1-uor/pointer.js'); + const authority = await new BrowserAuthorityStore({ database }).restoreAuthority(); + const name = 'browser.example.test', now = Date.now(); + const candidate = await signPointer({ version: 1, name, authorityKey: authority.publicKey, + revision: 0, previousDigest: null, objectRoot: `sha256:${'f'.repeat(64)}`, + validFromMs: now - 1000, validUntilMs: now + 60000 }, authority.privateKey); + const observer = new PointerObserver({ name, trustedAuthorityKey: authority.publicKey, clock: () => now }); + const admitted = await observer.admit(candidate); + return { key: authority.publicKey, digest: admitted.pointerDigest, expected: candidate.pointerDigest }; + }, database); + expect(result.key).toBe(first.key); + expect(result.digest).toBe(result.expected); +}); + +test('real cross-tab Web Lock blocks another owner and tab termination releases only the lock, not unknown intent', async ({ page, context }) => { + const second = await context.newPage(); + await Promise.all([harness(page), harness(second)]); + const database = `stitch-lock-${crypto.randomUUID()}`, scope = 'browser-scope'; + await page.evaluate(async ({ database, scope }) => { + const { BrowserAuthorityStore } = await import('/src/layer1-uor/browser-authority.js'); + const store = new BrowserAuthorityStore({ database }); + window.lockHeld = false; + window.owner = store.exclusivePublication(scope, async () => { + const candidate = { pointerDigest: 'sha256:' + 'a'.repeat(64) }; + await store.claimPublication(scope, { outcome: 'unknown', candidate, pointerDigest: candidate.pointerDigest }); + window.lockHeld = true; + await new Promise(() => {}); + }); + }, { database, scope }); + await expect.poll(() => page.evaluate(() => window.lockHeld)).toBe(true); + await second.evaluate(async ({ database, scope }) => { + const { BrowserAuthorityStore } = await import('/src/layer1-uor/browser-authority.js'); + const store = new BrowserAuthorityStore({ database }); + window.secondAcquired = false; + window.waiter = store.exclusivePublication(scope, async () => { + window.retained = await store.readPublication(scope); + window.secondAcquired = true; + }); + }, { database, scope }); + const lockNames = { authority: `stitch-authority:${database}`, publication: `stitch-dns:${database}:${scope}` }; + await expect.poll(() => second.evaluate(async names => { + const state = await navigator.locks.query(); + // Publication first owns the lifecycle lock, preventing rotation/revocation + // during dispatch. The waiter must stop there, before requesting its DNS lock. + return { + authorityHeld: state.held.filter(x => x.name === names.authority).length, + authorityPending: state.pending.filter(x => x.name === names.authority).length, + publicationHeld: state.held.filter(x => x.name === names.publication).length, + publicationPending: state.pending.filter(x => x.name === names.publication).length, + }; + }, lockNames)).toEqual({ authorityHeld: 1, authorityPending: 1, publicationHeld: 1, publicationPending: 0 }); + expect(await second.evaluate(() => window.secondAcquired)).toBe(false); + await page.close(); + await expect.poll(() => second.evaluate(() => window.secondAcquired)).toBe(true); + expect(await second.evaluate(() => window.retained.outcome)).toBe('unknown'); + expect(await second.evaluate(() => window.retained.candidate.pointerDigest)).toBe(`sha256:${'a'.repeat(64)}`); +}); diff --git a/tests/browser/fixtures.mjs b/tests/browser/fixtures.mjs new file mode 100644 index 0000000..9a6d5d8 --- /dev/null +++ b/tests/browser/fixtures.mjs @@ -0,0 +1,31 @@ +import { test as base, expect } from '@playwright/test'; + +// Prevent test bytes or credentials from ever reaching an external provider. +// Aborted provider traffic is NOT counted as provider interoperability evidence. +export const test = base.extend({ + context: async ({ context }, use) => { + await context.route('**/*', route => { + const url = new URL(route.request().url()); + return url.origin === 'http://127.0.0.1:8080' ? route.continue() : route.abort('blockedbyclient'); + }); + await context.routeWebSocket('**/*', socket => socket.close()); + await use(context); + }, + page: async ({ page }, use) => { + const failures = []; + page.on('pageerror', error => failures.push(error.message)); + await use(page); + expect(failures, 'uncaught browser JavaScript errors').toEqual([]); + }, +}); +export { expect }; + +export async function harness(page) { + await page.goto('/tests/browser/harness.html'); + return page; +} + +export async function selectJourney(page, name) { + await page.locator(`#operatorJourneyNav button[aria-controls="${name}Panel"]`).click(); + await expect(page.locator(`#${name}Panel`)).toBeVisible(); +} diff --git a/tests/browser/harness.html b/tests/browser/harness.html new file mode 100644 index 0000000..cbd8bcf --- /dev/null +++ b/tests/browser/harness.html @@ -0,0 +1,7 @@ + + + +Stitch native host qualification harness + +

Native browser qualification for the shipped Stitch runtime.

+ diff --git a/tests/browser/mesh.spec.mjs b/tests/browser/mesh.spec.mjs new file mode 100644 index 0000000..72ae555 --- /dev/null +++ b/tests/browser/mesh.spec.mjs @@ -0,0 +1,311 @@ +import { test, expect, harness } from './fixtures.mjs'; + +async function startNode(page, channelKey, label) { + await harness(page); + await page.evaluate(async ({ channelKey, label }) => { + const { WebRtcTransportNode } = await import('/src/layer5-transport/index.js'); + const { LiveUorMeshDatabase } = await import('/src/layer3-storage/index.js'); + const { LiveDistributedComputeCoordinator } = await import('/src/layer4-compute/index.js'); + const events = [], errors = []; + const transport = new WebRtcTransportNode({ peerId: label, channelKey, iceServers: [], publicSignaling: false, heartbeatIntervalMs: 250, + publicRelayConsent: () => false, + onEvent: event => { + events.push(event); + if (event.type === 'mesh_message') { + const work = event.msg.type === 'compute_ckpt' ? compute.handleMeshMessage(event.from, event.msg) + : event.msg.type.startsWith('uor_') ? db.handleMeshMessage(event.from, event.msg) : null; + work?.catch(error => errors.push(error.code || error.message)); + } + } }); + const db = new LiveUorMeshDatabase({ transport }); + const compute = new LiveDistributedComputeCoordinator({ transport, liveDb: db, allowPublicRelay: false }); + window.stitch = { transport, db, compute, events, errors }; + transport.connect(); + }, { channelKey, label }); +} + +async function attachHostDiagnostics(pages, testInfo) { + const snapshots = []; + for (const [index, page] of pages.entries()) { + if (page.isClosed()) { snapshots.push({ page: index, closed: true }); continue; } + try { + snapshots.push(await page.evaluate(index => { + const state = window.stitch; + if (!state) return { page: index, initialized: false }; + const { transport, events, errors } = state; + return { + page: index, routingPeerId: transport.routingPeerId, generation: transport.generation, + closed: transport.closed, bytesSent: transport.bytesSent, bytesReceived: transport.bytesReceived, + peers: [...transport.peers].map(([remoteId, peer]) => ({ + remoteId, connection: peer.pc.connectionState, signaling: peer.pc.signalingState, + ice: peer.pc.iceConnectionState, flow: peer.flow?.state, + channel: peer.dc && { id: peer.dc.id, state: peer.dc.readyState, protocol: peer.dc.protocol, + buffered: peer.dc.bufferedAmount, label: peer.dc.label }, + })), + events: events.slice(-32).map(({ type, code, reason, outcome, remoteId, from, frames, bytes }) => + ({ type, code, reason, outcome, remoteId, from, frames, bytes })), + errors: errors.slice(-32), + }; + }, index)); + } catch (error) { snapshots.push({ page: index, diagnosticError: error.message }); } + } + await testInfo.attach('mesh-host-diagnostics', { body: Buffer.from(JSON.stringify(snapshots, null, 2)), contentType: 'application/json' }); +} + +async function connected(page, count = 1) { + await expect.poll(() => page.evaluate(() => window.stitch.transport.openPeers().length), { timeout: 20_000 }).toBe(count); +} + +test('native authenticated local RTC carries fragmented bytes, custody receipts and replayed checkpoints; reconnect fences old sessions', async ({ page, context }, testInfo) => { + test.setTimeout(60_000); + const other = await context.newPage(); + const channel = `browser-${crypto.randomUUID()}`; + await startNode(page, channel, 'browser-a'); + await startNode(other, channel, 'browser-b'); + try { + await Promise.all([connected(page), connected(other)]); + const identities = await Promise.all([page, other].map(target => target.evaluate(() => { + const t = window.stitch.transport, peer = t.openPeers()[0]; + return { own: t.routingPeerId, remote: peer.remoteId, authenticated: t.signaling.peers.has(peer.remoteId), + ordered: peer.dc.ordered, protocol: peer.dc.protocol, iceServers: peer.pc.getConfiguration().iceServers }; + }))); + expect(identities[0].own).toBe(identities[1].remote); + expect(identities[1].own).toBe(identities[0].remote); + for (const identity of identities) { + expect(identity.own).toMatch(/^key-/); + expect(identity.authenticated).toBe(true); + expect(identity.ordered).toBe(true); + expect(identity.protocol).toBe('stitch.channel/1'); + expect(identity.iceServers).toEqual([]); + } + + // Larger than the negotiated/default 64KiB application frame bound. Native + // SCTP must carry all frames; equality is checked after real host delivery. + const sentDigest = await page.evaluate(async () => { + const value = 'é😀'.repeat(40_000); + const bytes = new TextEncoder().encode(value); + const digest = Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', bytes)), x => x.toString(16).padStart(2, '0')).join(''); + const t = window.stitch.transport; + if (!t.sendToPeer(t.openPeers()[0].remoteId, { type: 'browser_probe', value })) throw Error('Native channel refused the probe'); + return { digest, length: bytes.length }; + }); + await expect.poll(() => other.evaluate(() => window.stitch.events.filter(x => x.type === 'mesh_message' && x.msg.type === 'browser_probe').length)).toBe(1); + const received = await other.evaluate(async () => { + const packet = window.stitch.events.find(x => x.type === 'mesh_message' && x.msg.type === 'browser_probe'); + const bytes = new TextEncoder().encode(packet.msg.value); + return { digest: Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', bytes)), x => x.toString(16).padStart(2, '0')).join(''), length: bytes.length }; + }); + expect(received).toEqual(sentDigest); + expect(await page.evaluate(() => window.stitch.events.some(x => x.type === 'channel_send_result' && x.outcome === 'submitted' && x.frames > 1))).toBe(true); + + const address = await page.evaluate(async () => (await window.stitch.db.put('native-browser-custody-é😀', { label: 'native.txt' })).addressHex); + await expect.poll(() => page.evaluate(address => window.stitch.db.objects.get(address).placementStatus.committedFragments, address)).toBe(1); + const partial = await other.evaluate(address => { + const { db, transport } = window.stitch, object = db.objects.get(address); + return { fragments: object.shards.filter(Boolean).length, held: [...object.heldIndices], + verified: object.verified, readable: db.get(address).ok, source: object.source, + sender: transport.openPeers()[0].remoteId }; + }, address); + expect(partial.fragments).toBe(1); + expect(partial.held).toEqual([0]); + expect(partial.verified).toBe(false); + expect(partial.readable).toBe(false); + expect(partial.source).toBe(`webrtc:${partial.sender}`); + const status = await page.evaluate(address => window.stitch.db.objects.get(address).placementStatus, address); + expect(status.canRecoverFromCommitted).toBe(false); + expect(status.distinctHolders).toBe(1); + + const jobId = `browser-job-${crypto.randomUUID()}`; + const local = await page.evaluate(async jobId => { + const job = await window.stitch.compute.startOrResumeJob({ jobId, totalSteps: 3, stepDelayMs: 100 }); + return { value: job.currentValueHex, step: job.stepIndex }; + }, jobId); + await expect.poll(() => other.evaluate(jobId => window.stitch.compute.jobs.get(jobId)?.status, jobId)).toBe('completed'); + expect(await other.evaluate(jobId => { + const job = window.stitch.compute.jobs.get(jobId); + return { value: job.currentValueHex, step: job.stepIndex, verification: job.verification, source: job.sourceTag }; + }, jobId)).toEqual({ ...local, verification: 'replayed', source: `webrtc:${identities[0].own}` }); + + // Keep an authentic old envelope. A new local incarnation must reject it, + // even when the same peer display label and channel name are reused. + const stale = await page.evaluate(() => window.stitch.transport.signaling.sign({ kind: 'ice', to: window.stitch.transport.openPeers()[0].remoteId, candidate: { candidate: 'old-incarnation' } })); + await page.evaluate(() => window.stitch.transport.close()); + await other.evaluate(() => window.stitch.transport.close()); + expect(await page.evaluate(() => ({ peers: window.stitch.transport.peers.size, sent: window.stitch.transport.broadcast({ type: 'after_close' }) }))).toEqual({ peers: 0, sent: 0 }); + await other.evaluate(() => window.stitch.transport.connect()); + await page.evaluate(() => window.stitch.transport.connect()); + await Promise.all([connected(page), connected(other)]); + expect(await other.evaluate(stale => window.stitch.transport.signaling.receive(stale), stale)).toBeNull(); + const newId = await page.evaluate(() => window.stitch.transport.routingPeerId); + expect(newId).not.toBe(identities[0].own); + for (const target of [page, other]) { + expect(await target.evaluate(() => window.stitch.errors)).toEqual([]); + expect(await target.evaluate(() => window.stitch.events.filter(x => x.type === 'signal_error'))).toEqual([]); + } + } catch (error) { + await attachHostDiagnostics([page, other], testInfo).catch(() => {}); + throw error; + } finally { + for (const target of [page, other]) if (!target.isClosed()) await target.evaluate(() => window.stitch?.transport.close()); + } +}); + + +test('native two-holder custody restores exact object bytes after writer RAM is cleared', async ({ page, context }, testInfo) => { + test.setTimeout(50_000); + const holders = [await context.newPage(), await context.newPage()]; + const pages = [page, ...holders], channel = `recovery-${crypto.randomUUID()}`; + try { + for (const [index, target] of pages.entries()) await startNode(target, channel, `recovery-${index}`); + await Promise.all(pages.map(target => connected(target, 2))); + const payload = `native-two-holder-recovery-${crypto.randomUUID()}-` + 'é😀'.repeat(1000); + const address = await page.evaluate(async payload => (await window.stitch.db.put(payload, { label: 'recoverable.txt' })).addressHex, payload); + await expect.poll(() => page.evaluate(address => window.stitch.db.objects.get(address).placementStatus.committedFragments, address)).toBe(2); + expect(await page.evaluate(address => window.stitch.db.objects.get(address).placementStatus.canRecoverFromCommitted, address)).toBe(true); + const remoteFragments = await Promise.all(holders.map(target => target.evaluate(address => { + const object = window.stitch.db.objects.get(address); + return { held: [...object.heldIndices], verified: object.verified }; + }, address))); + expect(remoteFragments.flatMap(value => value.held).sort()).toEqual([0, 1]); + expect(remoteFragments.every(value => value.verified === false)).toBe(true); + + await page.evaluate(async () => { + await window.stitch.db.clearLocal(); + if (window.stitch.db.objects.size !== 0) throw Error('Local wipe did not clear writer objects'); + await window.stitch.db.syncFromNetwork('30m', { publicData: false }); + }); + await expect.poll(() => page.evaluate(address => window.stitch.db.get(address).ok, address)).toBe(true); + expect(await page.evaluate(address => { + const recovered = window.stitch.db.get(address); + return { text: recovered.text, address: recovered.entry.addressHex, source: recovered.entry.source }; + }, address)).toEqual({ text: payload, address, source: expect.stringMatching(/^webrtc:key-/) }); + for (const target of pages) expect(await target.evaluate(() => window.stitch.errors)).toEqual([]); + } catch (error) { + await attachHostDiagnostics(pages, testInfo).catch(() => {}); + throw error; + } finally { + for (const target of pages) if (!target.isClosed()) await target.evaluate(() => window.stitch?.transport.close()); + } +}); + +test('native compute retains a reachable authenticated owner and resumes its checkpoint only after owner tab closes', async ({ page, context }, testInfo) => { + test.setTimeout(60_000); + const receiver = await context.newPage(), pages = [page, receiver]; + const channel = `compute-owner-${crypto.randomUUID()}`, jobId = `failover-${crypto.randomUUID()}`; + try { + await startNode(page, channel, 'compute-owner-label'); + await startNode(receiver, channel, 'compute-receiver-label'); + await Promise.all(pages.map(target => connected(target))); + const owner = await page.evaluate(jobId => { + const { transport, compute, errors } = window.stitch; + // Six ADD3 steps from2 have the independent expected final value20 (0x14). + // The bounded inter-step delay leaves a genuine unfinished owner task, + // without pausing, replacing or mocking any coordinator/transport method. + const program = { version: 1, bits: 64, initialValueHex: '0x2', + instructions: Array.from({ length: 6 }, () => ({ op: 4, argHex: '0x3' })) }; + window.stitch.ownerWork = compute.startOrResumeJob({ jobId, program, stepDelayMs: 5000 }) + .catch(error => errors.push(error.code || error.message)); + return { key: transport.routingPeerId, label: transport.peerId }; + }, jobId); + expect(owner.key).toMatch(/^key-/); + expect(owner.key).not.toBe(owner.label); + await expect.poll(() => receiver.evaluate(jobId => { + const job = window.stitch.compute.jobs.get(jobId); + return !!job && job.status === 'running' && job.verification === 'replayed' && job.stepIndex > 0; + }, jobId)).toBe(true); + const reachable = await receiver.evaluate(async jobId => { + const { transport, compute } = window.stitch; + const resumed = await compute.syncAndTakeOverJobs(); + const job = compute.jobs.get(jobId); + return { resumed, runningLocally: compute.running.has(jobId), status: job.status, + owner: job.ownerPeerId, step: job.stepIndex, value: job.currentValueHex, + reachable: transport.openPeers().some(peer => peer.remoteId === job.ownerPeerId), source: job.sourceTag }; + }, jobId); + expect(reachable).toEqual({ resumed: [], runningLocally: false, status: 'running', owner: owner.key, + step: expect.any(Number), value: expect.any(String), reachable: true, source: `webrtc:${owner.key}` }); + expect(reachable.step).toBeLessThan(6); + expect(reachable.value).toBe(`0x${(2 + 3 * reachable.step).toString(16)}`); + + // Closing the actual page destroys its native RTC connection and owner task. + await page.close(); + await expect.poll(() => receiver.evaluate(ownerKey => { + const { transport, events } = window.stitch; + return transport.openPeers().length === 0 && transport.peers.size === 0 && events.some(event => + ['channel_close', 'peer_disconnected'].includes(event.type) && event.remoteId === ownerKey); + }, owner.key), { timeout: 20_000 }).toBe(true); + const result = await receiver.evaluate(async jobId => { + const { transport, compute, db } = window.stitch; + const retained = compute.jobs.get(jobId), step = retained.stepIndex, digest = retained.checkpoint.checkpointDigest; + const updates = []; + compute.onJobUpdate = job => { + if (job.jobId === jobId && job.sourceTag.startsWith('local:')) updates.push({ + step: job.stepIndex, previous: job.checkpoint.previousDigest, owner: job.ownerPeerId }); + }; + const resumed = await compute.syncAndTakeOverJobs(); + await compute.running.get(jobId); + const job = compute.jobs.get(jobId), stored = db.get(job.resultAddressHex); + return { resumed, retainedStep: step, retainedDigest: digest, updates, + receiverKey: transport.routingPeerId, owner: job.ownerPeerId, status: job.status, + verification: job.verification, step: job.stepIndex, value: job.currentValueHex, + stored: stored.ok && stored.entry.verified, result: stored.ok ? JSON.parse(stored.text) : null }; + }, jobId); + expect(result.retainedStep).toBeGreaterThan(0); + expect(result.retainedStep).toBeLessThan(6); + expect(result.resumed).toEqual([jobId]); + expect(result.receiverKey).toMatch(/^key-/); + expect(result.owner).toBe(result.receiverKey); + expect(result.owner).not.toBe(owner.key); + expect(result.updates[0]).toEqual({ step: result.retainedStep + 1, previous: result.retainedDigest, owner: result.receiverKey }); + expect(result).toMatchObject({ status: 'completed', verification: 'replayed', step: 6, value: '0x14', stored: true }); + expect(result.result.jobId).toBe(jobId); + expect(result.result.checkpoint).toMatchObject({ stepIndex: 6, stateHex: '0x14' }); + expect(await receiver.evaluate(() => window.stitch.errors)).toEqual([]); + } catch (error) { + await attachHostDiagnostics(pages, testInfo).catch(() => {}); + throw error; + } finally { + for (const target of pages) if (!target.isClosed()) await target.evaluate(() => window.stitch?.transport.close()); + } +}); + +test('native pre-join store repairs three distinct holders, replaces a departed holder and recovers after writer wipe', async ({ page, context }, testInfo) => { + test.setTimeout(90_000); + const channel = `placement-repair-${crypto.randomUUID()}`, pages = [page]; + try { + await startNode(page, channel, 'repair-writer'); + const payload = `retained-before-peers-${crypto.randomUUID()}-é😀`; + const address = await page.evaluate(async payload => (await window.stitch.db.put(payload)).addressHex, payload); + expect(await page.evaluate(address => window.stitch.db.placementSummary(address).committedFragments, address)).toBe(0); + const holders = []; + for (let i = 0; i < 3; i++) { + const holder = await context.newPage(); pages.push(holder); holders.push(holder); + await startNode(holder, channel, `repair-holder-${i}`); + } + await Promise.all(pages.map(target => connected(target, 3))); + await page.evaluate(address => window.stitch.db.repairPlacement(address), address); + await expect.poll(() => page.evaluate(address => window.stitch.db.placementSummary(address).committedFragments, address)).toBe(3); + const departedId = await holders[0].evaluate(() => window.stitch.transport.routingPeerId); + await holders[0].evaluate(() => window.stitch.transport.close()); + await connected(page, 2); + expect(await page.evaluate(address => window.stitch.db.placementSummary(address).committedFragments, address)).toBe(2); + const replacement = await context.newPage(); pages.push(replacement); + await startNode(replacement, channel, 'repair-replacement'); + await connected(page, 3); + await page.evaluate(address => window.stitch.db.repairPlacement(address), address); + await expect.poll(() => page.evaluate(address => window.stitch.db.placementSummary(address).committedFragments, address)).toBe(3); + expect(await page.evaluate(({ address, departedId }) => { + const { db } = window.stitch; + return { copies: db.placementSummary(address).assertedCopies, + departed: db.placements.get(address).copies.find(c => c.holder === departedId)?.status }; + }, { address, departedId })).toEqual({ copies: 4, departed: 'superseded' }); + await page.evaluate(async () => { await window.stitch.db.clearLocal(); await window.stitch.db.syncFromNetwork(); }); + await expect.poll(() => page.evaluate(address => window.stitch.db.get(address).ok, address)).toBe(true); + expect(await page.evaluate(address => window.stitch.db.get(address).text, address)).toBe(payload); + for (const target of pages) expect(await target.evaluate(() => window.stitch.errors)).toEqual([]); + } catch (error) { + await attachHostDiagnostics(pages, testInfo).catch(() => {}); + throw error; + } finally { + for (const target of pages) if (!target.isClosed()) await target.evaluate(() => window.stitch?.transport.close()); + } +}); diff --git a/tests/browser/playwright.config.mjs b/tests/browser/playwright.config.mjs new file mode 100644 index 0000000..1432fdb --- /dev/null +++ b/tests/browser/playwright.config.mjs @@ -0,0 +1,32 @@ +import { defineConfig, devices } from '@playwright/test'; + +export default defineConfig({ + testDir: '.', + testMatch: '*.spec.mjs', + fullyParallel: false, + workers: 1, + retries: 0, + forbidOnly: !!process.env.CI, + timeout: 30_000, + globalTimeout: 300_000, + expect: { timeout: 10_000 }, + reporter: [['list'], ['html', { outputFolder: new URL('../../verification-output/browser/report', import.meta.url).pathname, open: 'never' }]], + outputDir: new URL('../../verification-output/browser/results', import.meta.url).pathname, + use: { + ...devices['Desktop Chrome'], + baseURL: 'http://127.0.0.1:8080', + serviceWorkers: 'block', + actionTimeout: 10_000, + navigationTimeout: 15_000, + trace: 'retain-on-failure', + screenshot: 'only-on-failure', + }, + projects: [{ name: 'chromium', use: { browserName: 'chromium' } }], + webServer: { + command: 'python3 -m http.server 8080 --bind 127.0.0.1', + url: 'http://127.0.0.1:8080/tests/browser/harness.html', + cwd: new URL('../..', import.meta.url).pathname, + reuseExistingServer: false, + timeout: 15_000, + }, +}); diff --git a/tests/browser/product.spec.mjs b/tests/browser/product.spec.mjs new file mode 100644 index 0000000..00df99c --- /dev/null +++ b/tests/browser/product.spec.mjs @@ -0,0 +1,63 @@ +import { test, expect, selectJourney } from './fixtures.mjs'; + +test('shipped UI navigation preserves inputs, mesh hash and explicit disclosure guards', async ({ page }) => { + await page.goto('/#browser-qualification'); + const nav = page.locator('#operatorJourneyNav button'); + await expect(nav).toHaveCount(6); + await expect(page.locator('#meshPanel')).toBeVisible(); + await expect(page.locator('#reconnectBtn')).toBeDisabled(); + await expect(page.locator('#allowMeshSignalingInput')).not.toBeChecked(); + await expect(page.locator('#allowPublicRelayInput')).not.toBeChecked(); + await page.locator('#allowMeshSignalingInput').check(); + await expect(page.locator('#reconnectBtn')).toBeEnabled(); + // Consent alone never joins. No click of Join and no public traffic is allowed. + await expect(page.locator('#peerCountLabel')).toHaveText('0'); + await page.locator('#allowMeshSignalingInput').uncheck(); + await expect(page.locator('#reconnectBtn')).toBeDisabled(); + + const before = await page.evaluate(() => ({ hash: location.hash, history: history.length })); + for (const name of ['objects', 'compute', 'vm', 'pointers', 'resources', 'mesh']) { + await selectJourney(page, name); + await expect(page.locator(`#${name}Panel`)).toBeFocused(); + await expect(page.locator('#operatorJourneyNav [aria-current="location"]')).toHaveCount(1); + await expect(page.locator(`#${name}Evidence`)).not.toHaveText(''); + await expect(page.locator('section[id$="Panel"]:visible')).toHaveCount(1); + } + expect(await page.evaluate(() => ({ hash: location.hash, history: history.length }))).toEqual(before); + + await selectJourney(page, 'objects'); + await page.locator('#dbLabelInput').fill('retained-label.txt'); + await selectJourney(page, 'compute'); + await page.locator('#jobStepsInput').fill('3'); + await selectJourney(page, 'objects'); + await expect(page.locator('#dbLabelInput')).toHaveValue('retained-label.txt'); + await selectJourney(page, 'compute'); + await expect(page.locator('#jobStepsInput')).toHaveValue('3'); + // Keyboard navigation uses actual native button focus/activation. + await page.locator('#operatorJourneyNav button[aria-controls="vmPanel"]').focus(); + await page.keyboard.press('Enter'); + await expect(page.locator('#vmPanel')).toBeFocused(); + await expect(page.locator('#runVmCmdBtn')).toBeDisabled(); +}); + +test('saved UI authority survives reload without silently pinning or replacing a key', async ({ page }) => { + await page.goto('/'); + await selectJourney(page, 'pointers'); + await expect(page.locator('#authorityStorageStatus')).toContainText('No saved signing key'); + await page.locator('#authorityLifecyclePanel > summary').click(); + await page.locator('#saveAuthorityBtn').click(); + await expect(page.locator('#authorityStorageStatus')).toContainText('Saved'); + const key = await page.evaluate(async () => { + const { BrowserAuthorityStore } = await import('/src/layer1-uor/browser-authority.js'); + return (await new BrowserAuthorityStore().restoreAuthority()).publicKey; + }); + expect(key).toMatch(/^[a-f0-9]{64}$/); + await page.reload(); + await selectJourney(page, 'pointers'); + await expect(page.locator('#authorityStorageStatus')).toContainText('Saved signing key restored'); + await expect(page.locator('#pointerAuthorityInput')).toHaveValue(''); + expect(await page.evaluate(async () => { + const { BrowserAuthorityStore } = await import('/src/layer1-uor/browser-authority.js'); + return (await new BrowserAuthorityStore().restoreAuthority()).publicKey; + })).toBe(key); +}); diff --git a/tests/browser/vm-peer.spec.mjs b/tests/browser/vm-peer.spec.mjs new file mode 100644 index 0000000..b34e723 --- /dev/null +++ b/tests/browser/vm-peer.spec.mjs @@ -0,0 +1,116 @@ +import { test, expect, harness } from './fixtures.mjs'; + +test('production VMs exchange real Ethernet over native RTC only with bilateral grants', async ({ page, context }, testInfo) => { + test.setTimeout(200_000); + const other = await context.newPage(); + const pages = [page, other], channelKey = `guest-${crypto.randomUUID()}`; + try { + await Promise.all(pages.map(async (target, index) => { + await harness(target); + await target.evaluate(() => { const base = document.createElement('base'); base.href = '/'; document.head.append(base); }); + await target.addScriptTag({ url: '/v86/libv86.js' }); + await target.evaluate(async ({ channelKey, index }) => { + const { LinuxVmNode } = await import('/src/layer4-compute/index.js'); + const { WebRtcTransportNode } = await import('/src/layer5-transport/index.js'); + const screen = document.createElement('div'); + screen.innerHTML = '
'; + document.body.append(screen); + const offline = new LinuxVmNode({ screenContainer: screen }); + if (offline.networkConfiguration !== null || offline.ipAddress !== null) throw Error('Absent network must remain unconfigured'); + let refused = false; + try { offline.setEthernetSharing(true); } catch (error) { refused = error.code === 'vm-network-required'; } + if (!refused || offline.ethernetSharing) throw Error('Absent network must refuse Ethernet sharing'); + const state = window.guest = { statuses: [], serial: '', frames: 0, packets: [], commands: [], events: [] }; + const transport = state.transport = new WebRtcTransportNode({ peerId: `vm-peer-${index}`, channelKey, + iceServers: [], publicSignaling: false, publicRelayConsent: () => false, + onEvent: event => { + if (['policy_refused', 'channel_open', 'channel_send_result'].includes(event.type)) state.events.push(event); + if (event.type === 'mesh_message' && event.msg.type === 'eth_frame') { + state.frames++; + state.packets.push({ direction: 'received', from: event.from, advertisedFrom: event.msg.from, length: event.msg.frame.length, header: event.msg.frame.slice(0, 42) }); + state.vm.handleIncomingEthFrame(event.msg.frame); + } + } }); + const vm = state.vm = new LinuxVmNode({ transport, screenContainer: screen, vmRuntimeMs: 180_000, + network: { address: `10.42.0.${index + 2}`, prefixLength: 24 }, + onStatus: status => state.statuses.push(status) }); + transport.connect(); + vm.boot(); + vm.v86.add_listener('net0-send', bytes => state.packets.push({ direction: 'guest-send', length: bytes.length, header: Array.from(bytes.slice(0, 42)), granted: vm.ethernetSharing })); + vm.v86.add_listener('serial0-output-byte', byte => { state.serial = (state.serial + String.fromCharCode(byte)).slice(-65536); }); + }, { channelKey, index }); + await expect.poll(() => target.evaluate(() => window.guest.vm.booted), { timeout: 75_000 }).toBe(true); + await expect.poll(() => target.evaluate(() => window.guest.transport.openPeers().length), { timeout: 20_000 }).toBe(1); + })); + const addresses = await Promise.all(pages.map(p => p.evaluate(() => window.guest.vm.ipAddress))); + expect(addresses).toEqual(['10.42.0.2', '10.42.0.3']); + const identities = await Promise.all(pages.map(target => target.evaluate(() => { + const transport = window.guest.transport, peer = transport.openPeers()[0]; + return { own: transport.routingPeerId, remote: peer.remoteId, + authenticated: transport.signaling.peers.has(peer.remoteId), + iceServers: peer.pc.getConfiguration().iceServers, protocol: peer.dc.protocol }; + }))); + expect(identities[0].own).toBe(identities[1].remote); + expect(identities[1].own).toBe(identities[0].remote); + for (const identity of identities) { + expect(identity.own).toMatch(/^key-/); + expect(identity.authenticated).toBe(true); + expect(identity.iceServers).toEqual([]); + expect(identity.protocol).toBe('stitch.channel/1'); + } + const command = async (target, text) => target.evaluate(async text => { + const output = new TextDecoder().decode(await window.guest.vm.executeShellCommand(text, 20_000)); + window.guest.commands.push({ text, output }); return output; + }, text); + // The boot nonce already read host input and wrote back over 9p. Also inspect + // both real consoles and kernel identity instead of inferring them from boot. + expect(await command(page, 'uname -r; printf stderr_probe >&2')).toContain('6.18.7'); + await page.evaluate(() => window.guest.vm.v86.serial0_send("printf 'SERIAL_%s\\n' QUALIFIED\n")); + await expect.poll(() => page.evaluate(() => window.guest.serial.includes('SERIAL_QUALIFIED'))).toBe(true); + expect(await command(page, `ping -c 1 -W 2 ${addresses[1]}; echo ping_exit:$?`)).toContain('ping_exit:1'); + expect(await page.evaluate(() => window.guest.vm.ethFramesSent)).toBe(0); + await Promise.all(pages.map(p => p.evaluate(() => window.guest.vm.setEthernetSharing(true)))); + // A denied ping may leave ARP probes exhausted. Exercise normal guest + // recovery after the grant with at most three real probes, without flushing + // neighbor state, increasing a global timeout, or replaying any shell effect. + const recovered = []; + for (let attempt = 0; attempt < 3; attempt++) { + const output = await command(page, `ping -c 1 -W 3 ${addresses[1]}; result=$?; ip neigh; echo ping_exit:$result`); + recovered.push(output); + if (output.includes('ping_exit:0')) break; + } + expect(recovered.some(output => output.includes('ping_exit:0')), JSON.stringify(recovered)).toBe(true); + expect(await command(other, `ping -c 1 -W 3 ${addresses[0]}; echo ping_exit:$?`)).toContain('ping_exit:0'); + for (const target of pages) { + const counters = await target.evaluate(() => ({ sent: window.guest.vm.ethFramesSent, received: window.guest.vm.ethFramesReceived })); + expect(counters.sent).toBeGreaterThan(0); expect(counters.received).toBeGreaterThan(0); + const receivedLengths = await target.evaluate(() => window.guest.packets.filter(p => p.direction === 'received').map(p => p.length)); + expect(receivedLengths.length).toBeGreaterThan(0); + for (const length of receivedLengths) { expect(length).toBeGreaterThanOrEqual(14); expect(length).toBeLessThanOrEqual(1518); } + } + await other.evaluate(() => window.guest.vm.setEthernetSharing(false)); + const before = await other.evaluate(() => window.guest.vm.ethFramesReceived); + expect(await command(page, `ping -c 1 -W 2 ${addresses[1]}; echo ping_exit:$?`)).toContain('ping_exit:1'); + expect(await other.evaluate(() => window.guest.vm.ethFramesReceived)).toBe(before); + await page.evaluate(() => window.guest.vm.setEthernetSharing(false)); + // Exact configured budgets are unchanged, even though this test does not + // intentionally exhaust every limit (the source-derived boundary suite does). + expect(await page.evaluate(async () => { + const { vmLimits } = await import('/src/layer4-compute/vm-administration.js'); + return { limits: vmLimits, bytes: window.guest.vm.v86.fs9p.total_size }; + })).toMatchObject({ limits: { filesystemAllocationLimit: 67108864, filesystemMetadataLimit: 4096 }, bytes: 67108864 }); + } finally { + for (const [index, target] of pages.entries()) { + if (!target.isClosed()) { + await testInfo.attach(`vm-peer-${index}-state`, { body: Buffer.from(JSON.stringify(await target.evaluate(() => { + const g = window.guest; + return g ? { statuses: g.statuses, serial: g.serial, frames: g.frames, lifecycle: g.vm.lifecycle, + sent: g.vm.ethFramesSent, received: g.vm.ethFramesReceived, packets: g.packets, commands: g.commands, events: g.events, + routingId: g.transport.routingPeerId, peers: g.transport.openPeers().map(p => ({ remoteId: p.remoteId, state: p.dc.readyState, ice: p.pc.iceConnectionState })) } : null; + }), null, 2)), contentType: 'application/json' }); + await target.evaluate(async () => { if (window.guest) { await window.guest.vm.destroy(); window.guest.transport.close(); } }); + } + } + await other.close(); + } +}); diff --git a/tests/browser/vm.spec.mjs b/tests/browser/vm.spec.mjs new file mode 100644 index 0000000..70e91cc --- /dev/null +++ b/tests/browser/vm.spec.mjs @@ -0,0 +1,103 @@ +import { test, expect, selectJourney } from './fixtures.mjs'; + +test('bundled v86 boots the actual guest, captures shell bytes and stops/destroys through operator controls', async ({ page }, testInfo) => { + test.setTimeout(200_000); + const loaded = new Set(); + page.on('response', response => { + if (response.ok()) loaded.add(new URL(response.url()).pathname); + }); + await page.goto('/'); + await selectJourney(page, 'vm'); + await expect(page.locator('#bootVmBtn')).toBeEnabled(); + await expect(page.locator('#runVmCmdBtn')).toBeDisabled(); + await expect(page.locator('#vmNetworkPanel')).not.toHaveAttribute('open', ''); + await expect(page.locator('#vmIpv4Address')).not.toBeVisible(); + await page.evaluate(() => { + window.vmEvidenceTransitions = []; + new MutationObserver(records => { + for (const record of records) for (const node of record.removedNodes) window.vmEvidenceTransitions.push(node.textContent); + window.vmEvidenceTransitions.push(document.getElementById('vmEvidence').textContent); + }).observe(document.getElementById('vmEvidence'), { childList: true, subtree: true }); + }); + await page.locator('#vmLimitsPanel > summary').click(); + await expect(page.locator('#vmRuntimeSeconds')).toBeVisible(); + await page.locator('#vmRuntimeSeconds').fill('120'); + await page.locator('#vmNetworkPanel > summary').click(); + await page.locator('#vmIpv4Address').fill('10.42.0.2'); + await page.locator('#vmNetworkPanel > summary').click(); + await page.locator('#vmLimitsPanel > summary').click(); + await page.locator('#bootVmBtn').click(); + await expect(page.locator('#bootVmBtn')).toBeDisabled(); + await expect(page.locator('#vmStatusLabel')).toContainText('ONLINE', { timeout: 70_000 }); + for (const path of ['/v86/libv86.js', '/v86/v86.wasm', '/v86/seabios.bin', '/v86/vgabios.bin', '/images/buildroot-bzimage.bin']) expect(loaded.has(path), `${path} loaded successfully`).toBe(true); + await expect(page.locator('#vmShareObjects')).not.toBeChecked(); + await expect(page.locator('#vmShareEthernet')).not.toBeChecked(); + const marker = `stitch_native_guest_${crypto.randomUUID().replaceAll('-', '')}`; + await page.locator('#vmCmdInput').fill(`printf '${marker}\\n'; uname -s`); + await page.locator('#runVmCmdBtn').click(); + await expect(page.locator('#vmStdoutText')).toContainText(marker, { timeout: 20_000 }); + await expect(page.locator('#vmStdoutText')).toContainText('Linux'); + await expect(page.locator('#vmCommandOutcome')).toContainText('completed'); + await expect(page.locator('#vmCommandSelection option')).toHaveCount(1); + await expect(page.locator('#vmActionStatus')).toContainText('VM-DONE'); + await page.locator('#reconcileVmCommandBtn').click(); + await expect(page.locator('#vmCommandSelection option')).toHaveCount(1); + await expect(page.locator('#vmStdoutText')).toContainText(marker); + await testInfo.attach('candidate-ready-operator', { body: await page.screenshot({ fullPage: true }), contentType: 'image/png' }); + await page.locator('#vmShareObjects').check(); + await page.locator('#stopVmBtn').click(); + await expect(page.locator('#vmShareObjects')).not.toBeChecked(); + await expect(page.locator('#runVmCmdBtn')).toBeDisabled(); + await expect(page.locator('#bootVmBtn')).toBeDisabled(); + await expect(page.locator('#destroyVmBtn')).toBeEnabled(); + await expect(page.locator('#stopVmBtn')).toBeDisabled(); + await expect(page.locator('#vmEvidence')).toContainText('HOST-OBSERVED STOPPED'); + await testInfo.attach('stopped-reconciled-operator', { body: await page.screenshot({ fullPage: true }), contentType: 'image/png' }); + await page.locator('#destroyVmBtn').click(); + await expect(page.locator('#bootVmBtn')).toBeEnabled(); + await expect(page.locator('#destroyVmBtn')).toBeDisabled(); + await expect(page.locator('#vmEvidence')).toContainText('HOST-OBSERVED DESTROYED'); + await expect(page.locator('#vmIpv4Address')).toBeEnabled(); + await expect(page.locator('#vmPrefixLength')).toBeEnabled(); + await expect(page.locator('#vmRuntimeSeconds')).toBeEnabled(); + await expect(page.locator('#vmNetworkSummary')).not.toContainText('configuration locked'); + await expect(page.locator('#vmNetworkStatus')).toContainText('Applied at next boot.'); + // Restart a fresh actual guest; the previous command evidence remains selected. + await page.locator('#bootVmBtn').click(); + await expect(page.locator('#vmStatusLabel')).toContainText('ONLINE', { timeout: 70_000 }); + await page.locator('#vmShareEthernet').check(); + await page.locator('#vmCmdInput').fill('sleep 30; printf late_completion'); + await page.locator('#runVmCmdBtn').click(); + await expect(page.locator('#cancelVmObservationBtn')).toBeEnabled(); + // Wait until the genuine keyboard dispatch has completed; do not mistake a + // before-dispatch cancellation for proof of whole-emulator termination. + await expect(page.locator('#vmScreenContainer')).toContainText('sh /mnt/job_', { timeout: 10_000 }); + await page.locator('#cancelVmObservationBtn').click(); + await expect(page.locator('#vmCommandOutcome')).toContainText('vm-stopped'); + await expect(page.locator('#vmCommandOutcome')).toContainText('unknown'); + await expect(page.locator('#vmEvidence')).toContainText('HOST-OBSERVED STOPPED'); + await expect(page.locator('#stopVmBtn')).toBeDisabled(); + await expect(page.locator('#destroyVmBtn')).toBeEnabled(); + await testInfo.attach('cancelled-command-confirmed-stop', { body: await page.screenshot({ fullPage: true }), contentType: 'image/png' }); + await expect(page.locator('#vmShareEthernet')).not.toBeChecked(); + await expect(page.locator('#runVmCmdBtn')).toBeDisabled(); + await expect(page.locator('#bootVmBtn')).toBeDisabled(); + await page.locator('#destroyVmBtn').click(); + await expect(page.locator('#bootVmBtn')).toBeEnabled(); + await expect(page.locator('#vmCommandSelection option')).toHaveCount(2); + await expect(page.locator('#vmEvidence')).toContainText('HOST-OBSERVED DESTROYED'); + await expect(page.locator('#vmIpv4Address')).toBeEnabled(); + await expect(page.locator('#vmPrefixLength')).toBeEnabled(); + await expect(page.locator('#vmRuntimeSeconds')).toBeEnabled(); + await expect(page.locator('#vmNetworkSummary')).not.toContainText('configuration locked'); + await expect(page.locator('#vmNetworkStatus')).toContainText('Applied at next boot.'); + await expect(page.locator('#vmCommandOutcome')).toContainText('unknown'); + await testInfo.attach('destroyed-retained-unknown-command', { body: await page.screenshot({ fullPage: true }), contentType: 'image/png' }); + const transitions = await page.evaluate(() => window.vmEvidenceTransitions); + expect(transitions.some(text => text.includes('HOST TERMINATION PENDING'))).toBe(true); + await testInfo.attach('actual-termination-transitions', { body: Buffer.from(JSON.stringify(transitions)), contentType: 'application/json' }); + await page.locator('#vmCommandSelection').selectOption({ index: 0 }); + // Successful administration never erases resolved command evidence. + await expect(page.locator('#vmCommandOutcome')).toContainText('completed'); + await expect(page.locator('#vmStdoutText')).toContainText(marker); +}); diff --git a/tests/canonical-json.test.js b/tests/canonical-json.test.js new file mode 100644 index 0000000..195ba18 --- /dev/null +++ b/tests/canonical-json.test.js @@ -0,0 +1,94 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { canonicalBytes, parseCanonicalJson, CUSTODY_LIMITS } from '../src/layer1-uor/custody.js'; +const encoded = value => new TextDecoder().decode(canonicalBytes(value)); +const invalid = action => assert.throws(action, error => error.code === 'InvalidCanonicalValue'); + +// Numerical facts from RFC8785 AppendixB, not a reimplementation of the ECMAScript +// serialization algorithm. Every finite bit pattern listed by the RFC is covered. +const numbers = [ + ['0000000000000000','0'], ['8000000000000000','0'], + ['0000000000000001','5e-324'], ['8000000000000001','-5e-324'], + ['7fefffffffffffff','1.7976931348623157e+308'], ['ffefffffffffffff','-1.7976931348623157e+308'], + ['4340000000000000','9007199254740992'], ['c340000000000000','-9007199254740992'], + ['4430000000000000','295147905179352830000'], + ['44b52d02c7e14af5','9.999999999999997e+22'], ['44b52d02c7e14af6','1e+23'], + ['44b52d02c7e14af7','1.0000000000000001e+23'], + ['444b1ae4d6e2ef4e','999999999999999700000'], ['444b1ae4d6e2ef4f','999999999999999900000'], + ['444b1ae4d6e2ef50','1e+21'], ['3eb0c6f7a0b5ed8c','9.999999999999997e-7'], + ['3eb0c6f7a0b5ed8d','0.000001'], ['41b3de4355555553','333333333.3333332'], + ['41b3de4355555554','333333333.33333325'], ['41b3de4355555555','333333333.3333333'], + ['41b3de4355555556','333333333.3333334'], ['41b3de4355555557','333333333.33333343'], + ['becbf647612f3696','-0.0000033333333333333333'], ['43143ff3c1cb0959','1424953923781206.2'], +]; +test('RFC8785 Appendix B finite IEEE754 bit patterns and nonfinite rejection', () => { + for (const [hex, expected] of numbers) { + const value = Buffer.from(hex, 'hex').readDoubleBE(); + assert.equal(encoded(value), expected, hex); + assert.equal(encoded(parseCanonicalJson(expected)), expected, hex); + } + for (const hex of ['7fffffffffffffff', '7ff0000000000000', 'fff0000000000000']) + invalid(() => canonicalBytes(Buffer.from(hex, 'hex').readDoubleBE())); +}); +test('RFC8785 string escaping, UTF16 property ordering, recursive objects and arrays', () => { + const object = { '\u20ac':'Euro Sign', '\r':'Carriage Return', '\ufb33':'Hebrew Letter Dalet With Dagesh', + '1':'One', '\ud83d\ude00':'Emoji: Grinning Face', '\u0080':'Control', '\u00f6':'Latin Small Letter O With Diaeresis' }; + const ordered = ['\r', '1', '\u0080', '\u00f6', '\u20ac', '\ud83d\ude00', '\ufb33']; + assert.equal(encoded(object), '{' + ordered.map(k => JSON.stringify(k) + ':' + JSON.stringify(object[k])).join(',') + '}'); + assert.equal(encoded({ z:[{ b:1, a:2 },false], a:null }), '{"a":null,"z":[{"a":2,"b":1},false]}'); + assert.equal(encoded('\u0000\b\t\n\f\r\u001f"\\/€'), '"\\u0000\\b\\t\\n\\f\\r\\u001f\\"\\\\/€"'); + assert.notEqual(encoded('\u00e9'), encoded('e\u0301'), 'Unicode must not be normalized'); + assert.equal(encoded(-0), '0'); +}); +test('wire parser detects duplicate and escape-equivalent names before signature admission', () => { + for (const value of ['{"a":1,"a":2}', '{"a":1,"\\u0061":1}', '{"x":[{"nested":1,"nested":2}]}', + '{"__proto__":1,"__proto__":2}']) invalid(() => parseCanonicalJson(value)); + const parsed = parseCanonicalJson('{"__proto__":{"polluted":true},"constructor":3}'); + assert.equal(Object.getPrototypeOf(parsed), null); + assert.equal({}.polluted, undefined); + assert.equal(parsed.__proto__.polluted, true); + assert.equal(encoded(parsed), '{"__proto__":{"polluted":true},"constructor":3}'); +}); +test('wire parser refuses malformed JSON, Unicode and UTF8 without value coercion', () => { + for (const value of ['', 'undefined', 'NaN', 'Infinity', '1e999', '-1e999', '01', '+1', '1.', '1e', '[1,]', + '{"a":1,}', '{a:1}', 'null true', '/*x*/1', '\ufeff{}', '"\\ud800"', '"\\udfff"', '"\ud800"', + '"\\v"', '"\\uXX00"', '"unfinished', '"line\nfeed"', '{"a" 1}', '[,1]']) invalid(() => parseCanonicalJson(value)); + for (const bytes of [[0xc0,0xaf], [34,0xed,0xa0,0x80,34], [0xef,0xbb,0xbf,123,125]]) + invalid(() => parseCanonicalJson(Uint8Array.from(bytes))); + for (const value of [null, {}, 1]) invalid(() => parseCanonicalJson(value)); + assert.equal(encoded(parseCanonicalJson(' \n {"n":4.50,"s":"\\u0065\\u0301"}\t ')), '{"n":4.5,"s":"é"}'); +}); +test('parser bounds are explicit resource policies and run before uncontrolled allocation', () => { + const limit = action => assert.throws(action, e => e.code === 'SizeLimit'); + limit(() => parseCanonicalJson('"€"', {maxBytes:4})); + limit(() => parseCanonicalJson('[[null]]', {maxDepth:1})); + limit(() => parseCanonicalJson('[1,2,3]', {maxEntries:3})); + limit(() => parseCanonicalJson('"four"', {maxStringLength:3})); + limit(() => parseCanonicalJson('null', {maxBytes:Infinity})); + assert.equal(parseCanonicalJson('"longer"', {maxStringLength:10}), 'longer'); + assert.equal(parseCanonicalJson(' '.repeat(100) + 'null', {maxBytes:104}), null); + limit(() => canonicalBytes('a'.repeat(CUSTODY_LIMITS.maxStringLength + 1))); +}); +test('legacy safe-integer canonical values retain exact bytes; schema validation remains separate', () => { + const old = v => v === null || typeof v !== 'object' ? JSON.stringify(v) : Array.isArray(v) + ? '[' + v.map(old).join(',') + ']' : '{' + Object.keys(v).sort().map(k => JSON.stringify(k)+':'+old(v[k])).join(',') + '}'; + for (let i=0; i<1000; i++) { + const v={z:[i, -i || 0, Number.MAX_SAFE_INTEGER-i, true, null], a:{'😀':`row${i}`, 'é':'é', one:1}}; + assert.equal(encoded(v), old(v)); + } +}); + +test('RFC7493 I-JSON noncharacters are rejected in values and keys, raw and escaped', () => { + const points = [...Array.from({length:32}, (_,i)=>0xfdd0+i), ...Array.from({length:17},(_,i)=>[i*65536+65534,i*65536+65535]).flat()]; + for (const point of points) { + const s = String.fromCodePoint(point); + invalid(() => canonicalBytes(s)); invalid(() => canonicalBytes({[s]:1})); + invalid(() => parseCanonicalJson(JSON.stringify(s))); + invalid(() => parseCanonicalJson(JSON.stringify({[s]:1}))); + const escaped = s.split('').map(c=>'\\u'+c.charCodeAt(0).toString(16).padStart(4,'0')).join(''); + invalid(() => parseCanonicalJson('"'+escaped+'"')); + invalid(() => parseCanonicalJson('{"'+escaped+'":1}')); + } + for (const point of [0xfdd0-1, 0xfdef+1, 0xfffd, 0x1fffd, 0x10fffd]) + assert.equal(parseCanonicalJson(JSON.stringify(String.fromCodePoint(point))),String.fromCodePoint(point)); +}); diff --git a/tests/channel-flow.test.js b/tests/channel-flow.test.js new file mode 100644 index 0000000..462c286 --- /dev/null +++ b/tests/channel-flow.test.js @@ -0,0 +1,132 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { ChannelFlow, CHANNEL_LIMITS, channelMaximum } from '../src/layer5-transport/channel-flow.js'; +function fixture(t, maximum = 1024, options = {}) { + const sent = [], messages = [], results = [], charges = []; + const channel = { readyState: 'open', ordered: true, bufferedAmount: 0, + send(data) { sent.push(data); this.bufferedAmount += typeof data === 'string' ? new TextEncoder().encode(data).length : data.byteLength; }, + close() { this.readyState = 'closed'; } }; + const flow = new ChannelFlow({ channel, pc: { sctp: { maxMessageSize: maximum } }, + admission: { reserve(kind, values) { charges.push({ kind, ...values }); } }, + onMessage: value => messages.push(value), onResult: value => results.push(value), ...options }); + t.after(() => flow.dispose()); + return { flow, channel, sent, messages, results, charges }; +} +test('negotiated size, UTF8 wire accounting and complete 128KiB object JSON roundtrip', t => { + const sender = fixture(t, 1024), receiver = fixture(t, 1024); + const value = { type: 'uor_shard', bytes: Array.from({ length: 128 * 1024 }, (_, i) => i % 256) }; + assert.equal(sender.flow.enqueue(value), true); + assert.ok(sender.sent.length > 100); + assert.ok(sender.sent.every(frame => frame.byteLength <= 1024)); + for (const frame of sender.sent) receiver.flow.receive(frame); + assert.equal(JSON.stringify(receiver.messages), JSON.stringify([value])); + assert.equal(receiver.flow.state.receiving, 0); + assert.equal(sender.charges[0].transferBytes, sender.sent.reduce((n, f) => n + f.byteLength, 0)); + assert.equal(sender.results[0].outcome, 'submitted'); + assert.equal(sender.results[0].delivered, false); +}); +test('zero/unbounded negotiation, absent default, small limit and malformed negotiation', t => { + for (const value of [0, Infinity, undefined]) assert.equal(channelMaximum({ sctp: { maxMessageSize: value } }), 65536); + const { flow } = fixture(t, 16); + assert.throws(() => flow.enqueue({ long: 'x'.repeat(40) }), e => e.code === 'channel-framing-size-unsupported'); + assert.equal(flow.enqueue({ x: 1 }), true); + assert.throws(() => channelMaximum({ sctp: { maxMessageSize: -1 } })); +}); +test('bufferedAmountLow resumes FIFO queue without growing browser buffer beyond budget', t => { + const f = fixture(t, 1024); f.channel.bufferedAmount = CHANNEL_LIMITS.buffered; + assert.equal(f.flow.enqueue({ text: 'é😀' }), true); + assert.equal(f.flow.enqueue({ second: true }), true); + assert.equal(f.sent.length, 0); + f.channel.bufferedAmount = 0; f.channel.onbufferedamountlow(); + assert.deepEqual(f.sent.map(JSON.parse), [{ text: 'é😀' }, { second: true }]); + assert.equal(f.flow.state.retained, 0); + assert.equal(f.charges[0].transferBytes, new TextEncoder().encode(f.sent[0]).length); +}); +test('queue exhaustion refuses synchronously and disposal releases aggregate reservations', t => { + const pool = { queued: 0, messages: 0, receiving: 0, assemblies: 0 }; + const f = fixture(t, 65536, { pool }); f.channel.bufferedAmount = CHANNEL_LIMITS.buffered; + for (let i = 0; i < 64; i++) f.flow.enqueue({ i }); + assert.throws(() => f.flow.enqueue({ overflow: true }), e => e.code === 'channel-queue-capacity'); + f.flow.dispose('generation-changed'); assert.equal(pool.queued, 0); assert.equal(pool.messages, 0); + f.channel.bufferedAmount = 0; f.channel.onbufferedamountlow(); assert.equal(f.sent.length, 0); + assert.equal(f.results.filter(x => x.outcome === 'cancelled').length, 64); +}); +for (const failure of ['order', 'duplicate', 'corrupt', 'truncated', 'mixed']) test(`fragment ${failure} never exposes partial JSON`, t => { + const s = fixture(t, 64), r = fixture(t, 64); s.flow.enqueue({ text: 'x'.repeat(1000) }); + if (failure === 'order') r.flow.receive(s.sent[1]); + if (failure === 'duplicate') { r.flow.receive(s.sent[0]); r.flow.receive(s.sent[0]); } + if (failure === 'corrupt') { const bad = s.sent.at(-1).slice(0); new Uint8Array(bad)[16] = 0xff; for (const f of [...s.sent.slice(0, -1), bad]) r.flow.receive(f); } + if (failure === 'truncated') r.flow.receive(s.sent[0].slice(0, 14)); + if (failure === 'mixed') { r.flow.receive(s.sent[0]); r.flow.receive('{"other":true}'); } + assert.deepEqual(r.messages, []); assert.equal(r.flow.state.disposed, true); assert.equal(r.flow.state.receiving, 0); +}); +test('partial send failure and incomplete receive are classified, never replayed', t => { + const s = fixture(t, 64), r = fixture(t, 64); + const send = s.channel.send.bind(s.channel); let n = 0; + s.channel.send = data => { if (++n === 3) throw Error('host failure'); send(data); }; + s.flow.enqueue({ text: 'x'.repeat(1000) }); + assert.equal(s.results.find(x => x.outcome === 'partial').frames, 2); + r.flow.receive(s.sent[0]); r.flow.dispose('channel-closed'); + assert.ok(r.results.some(x => x.outcome === 'incomplete-receive')); + assert.equal(r.flow.state.receiving, 0); +}); +test('generation changes fence enqueue, buffered callbacks and incomplete receive', t => { + let current = true; + const s = fixture(t, 64, { current: () => current }), r = fixture(t, 64, { current: () => current }); + s.flow.enqueue({ text: 'x'.repeat(1000) }); r.flow.receive(s.sent[0]); + s.channel.bufferedAmount = CHANNEL_LIMITS.buffered; s.flow.enqueue({ later: true }); + const count = s.sent.length; current = false; + s.channel.bufferedAmount = 0; s.channel.onbufferedamountlow(); + for (const f of s.sent.slice(1)) r.flow.receive(f); + assert.equal(s.sent.length, count); assert.deepEqual(r.messages, []); + assert.equal(s.flow.enqueue({ stale: true }), false); +}); +test('incomplete assembly expires and closes poisoned stream', t => { + let now = 0, callback; + t.mock.method(globalThis, 'setTimeout', fn => { callback = fn; return { unref() {} }; }); + t.mock.method(globalThis, 'clearTimeout', () => {}); + const s = fixture(t, 64), r = fixture(t, 64, { clock: () => now }); + s.flow.enqueue({ text: 'x'.repeat(1000) }); r.flow.receive(s.sent[0]); + now = CHANNEL_LIMITS.age; callback(); + assert.equal(r.channel.readyState, 'closed'); assert.equal(r.flow.state.receiving, 0); +}); +test('binary frame replay after completion is refused and fresh flow starts at sequence one', t => { + const s = fixture(t, 64), r = fixture(t, 64), fresh = fixture(t, 64); + s.flow.enqueue({ text: 'x'.repeat(500) }); + for (const frame of s.sent) { r.flow.receive(frame); fresh.flow.receive(frame); } + r.flow.receive(s.sent[0]); + assert.equal(r.messages.length, 1); assert.equal(fresh.messages.length, 1); assert.equal(r.flow.state.disposed, true); +}); +test('unreliable and unordered channels refuse sends explicitly', t => { + const f = fixture(t, 64); f.channel.ordered = false; + assert.throws(() => f.flow.enqueue({ test: 'x'.repeat(100) }), e => e.code === 'channel-framing-requires-reliable-ordered'); +}); +test('queued consent and resource epoch expiration fence deferred sends', t => { + let consent = true, now = 1; + const f = fixture(t), g = fixture(t, 1024, { admission: { reserve() {}, clock: () => now, + get state() { return { lastObservedMs: 1, endMs: 10 }; } } }); + for (const x of [f, g]) x.channel.bufferedAmount = CHANNEL_LIMITS.buffered; + f.flow.enqueue({ eth_frame: [1] }, { consentCurrent: () => consent }); + g.flow.enqueue({ test: true }); consent = false; now = 11; + for (const x of [f, g]) { x.channel.bufferedAmount = 0; x.channel.onbufferedamountlow(); assert.equal(x.sent.length, 0); assert.equal(x.flow.state.disposed, true); } +}); +test('legacy peer without framing protocol retains small JSON, rejects oversize precisely', t => { + const f = fixture(t, 64); f.channel.protocol = ''; + assert.equal(f.flow.enqueue({ small: true }), true); + assert.throws(() => f.flow.enqueue({ big: 'x'.repeat(1000) }), e => e.code === 'channel-peer-framing-unsupported'); +}); +test('multiple fragmented messages retain ordering across UTF8 chunk boundaries', t => { + const s = fixture(t, 73), r = fixture(t, 73); + const values = [{ text: '😀é'.repeat(400) }, { type: 'eth_frame', frame: Array.from({ length: 1500 }, (_, i) => i % 256) }, { last: true }]; + for (const v of values) s.flow.enqueue(v); + for (const frame of s.sent) r.flow.receive(frame); + assert.equal(JSON.stringify(r.messages), JSON.stringify(values)); +}); +test('retained byte ceiling spans peers, even below message count ceiling', t => { + const pool = { queued: 0, messages: 0, receiving: 0, assemblies: 0 }, a = fixture(t, 65536, { pool }), b = fixture(t, 65536, { pool }); + a.channel.bufferedAmount = b.channel.bufferedAmount = CHANNEL_LIMITS.buffered; + const value = { text: 'x'.repeat(500000) }; + for (const f of [a, b, a, b]) f.flow.enqueue(value); + assert.throws(() => a.flow.enqueue(value), e => e.code === 'channel-queue-capacity'); + assert.equal(pool.messages, 4); a.flow.dispose(); b.flow.dispose(); assert.equal(pool.queued, 0); +}); diff --git a/tests/connection-measurement.test.js b/tests/connection-measurement.test.js new file mode 100644 index 0000000..7486e39 --- /dev/null +++ b/tests/connection-measurement.test.js @@ -0,0 +1,106 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { WebRtcTransportNode, ExperimentTrialLogger } from '../src/layer5-transport/index.js'; +import { c1SampleQualified } from '../src/layer1-uor/effects.js'; +function fixture(t, candidateType = 'host') { + let now = 0, timer = 1; + const timers = new Map(), events = [], sent = []; + t.mock.method(performance, 'now', () => now); + t.mock.method(globalThis, 'setTimeout', (fn, delay) => { const id = timer++; timers.set(id, { fn, delay }); return id; }); + t.mock.method(globalThis, 'clearTimeout', id => timers.delete(id)); + t.mock.method(globalThis, 'setInterval', () => 1000); + t.mock.method(globalThis, 'clearInterval', () => {}); + class Channel { ordered = true; readyState = 'open'; send(raw) { sent.push(JSON.parse(raw)); } close() { this.readyState = 'closed'; } } + class Peer { + connectionState = 'new'; + createDataChannel() { return new Channel(); } + close() {} + async getStats() { return new Map([ + ['transport', { type: 'transport', selectedCandidatePairId: 'pair' }], + ['pair', { type: 'candidate-pair', state: 'succeeded', localCandidateId: 'local', remoteCandidateId: 'remote' }], + ['local', { type: 'local-candidate', candidateType: 'host' }], + ['remote', { type: 'remote-candidate', candidateType }] + ]); } + } + const before = Object.getOwnPropertyDescriptor(globalThis, 'RTCPeerConnection'); + Object.defineProperty(globalThis, 'RTCPeerConnection', { value: Peer, configurable: true }); + t.after(() => before ? Object.defineProperty(globalThis, 'RTCPeerConnection', before) : delete globalThis.RTCPeerConnection); + const logger = new ExperimentTrialLogger(), node = new WebRtcTransportNode({ peerId: 'local', trialLogger: logger, onEvent: event => events.push(event) }); + const entry = node.getOrCreatePeer('remote', true); entry.dc.onopen(); + t.after(() => node.close()); + return { node, entry, logger, events, sent, timers, + at(value) { now = value; }, + probe(sequence, changes = {}) { + const ping = { type: 'ping', seq: sequence, sentAtMs: 123000 + sequence, from: 'local' }; + node.sendToPeer('remote', ping); + node.handleDataMessage('remote', { ...ping, type: 'pong', from: 'remote', ...changes }); + }, + deadline() { for (const item of [...timers.values()]) if (item.delay === 10000) item.fn(); } + }; +} +const settle = async () => { await Promise.resolve(); await Promise.resolve(); }; + +test('C1 source/runtime count only issued exact ordered probe echoes, not pings, duplicates or out-of-order responses', async t => { + const f = fixture(t); + for (let seq = 1; seq <= 12; seq++) { + f.node.handleDataMessage('remote', { type: 'pong', seq, sentAtMs: 1, from: 'remote' }); + f.node.handleDataMessage('remote', { type: 'ping', seq, sentAtMs: 1, from: 'remote' }); + } + assert.equal(f.entry.heartbeatsPassed, 0); + f.at(100); f.probe(1); assert.equal(f.entry.heartbeatsPassed, 1); + f.node.handleDataMessage('remote', { type: 'pong', seq: 1, sentAtMs: 123001, from: 'remote' }); + assert.equal(f.entry.heartbeatsPassed, 1); + f.at(200); f.probe(3); assert.equal(f.entry.heartbeatsPassed, 1, 'sequence gap resets consecutive run'); + f.at(300); f.probe(4); assert.equal(f.entry.heartbeatsPassed, 2); + f.at(400); f.probe(2); assert.equal(f.entry.heartbeatsPassed, 2, 'late old sequence cannot complete another heartbeat'); + f.at(500); f.probe(5, { from: 'someone-else' }); assert.equal(f.entry.heartbeatsPassed, 2); + f.at(600); f.probe(6, { sentAtMs: 7 }); assert.equal(f.entry.heartbeatsPassed, 2); + assert.equal(f.logger.entries.length, 0); +}); + +test('ten consecutive correlated heartbeats inside the frozen window require selected direct path evidence', async t => { + const f = fixture(t); + for (let sequence = 1; sequence <= 10; sequence++) { f.at(sequence * 900); f.probe(sequence); } + await settle(); + assert.equal(f.logger.entries.length, 1); + const sample = f.logger.entries[0]; + assert.equal(sample.contract_version, '1.1.0'); assert.equal(sample.success, true); + assert.equal(sample.connection_qualified, true); assert.equal(sample.selected_path_observed, true); + assert.equal(sample.qualification_elapsed_sec, 9); assert.equal(sample.heartbeats_passed, 10); + assert.equal(f.node.lifecycle.canSend, true); +}); + +for (const mode of ['remote-relay', 'missing-stats', 'unordered']) test(`C1 does not fabricate direct success for ${mode}`, async t => { + const f = fixture(t, mode === 'remote-relay' ? 'relay' : 'host'); + if (mode === 'missing-stats') f.entry.pc.getStats = async () => { throw Error('unsupported'); }; + if (mode === 'unordered') f.entry.dc.ordered = false; + for (let sequence = 1; sequence <= 10; sequence++) { f.at(sequence * 800); f.probe(sequence); } + await settle(); + if (mode === 'unordered') { f.at(10000); f.deadline(); } + assert.equal(f.logger.entries.length, 1); assert.equal(f.logger.entries[0].success, false); + assert.equal(f.node.lifecycle.canSend, true, 'measurement does not gate transport'); + if (mode === 'remote-relay') assert.equal(f.logger.entries[0].used_turn, true); +}); + +test('frozen10s deadline records failure without increasing default5s traffic or closing the channel', t => { + const f = fixture(t); assert.equal(f.node.heartbeatIntervalMs, 5000); + f.at(5000); f.probe(1); f.at(10000); f.probe(2); f.deadline(); + assert.equal(f.logger.entries[0].success, false); + assert.equal(f.logger.entries[0].heartbeats_passed, 2); + assert.equal(f.entry.dc.readyState, 'open'); assert.equal(f.node.lifecycle.canSend, true); + f.at(10001); f.probe(3); assert.equal(f.entry.heartbeatsPassed, 2); + assert.equal(f.logger.entries.length, 1); +}); + +test('C1 summary refuses success booleans without coherent ordered/sequence/time/path evidence', () => { + const sample = { success: true, network_pair_class: 'declared', used_turn: false, selected_path_observed: true, + ordered_channel: true, heartbeats_passed: 10, ice_setup_sec: 1, qualification_elapsed_sec: 9 }; + assert.equal(c1SampleQualified(sample), true); + for (const changes of [{ heartbeats_passed: 9 }, { ordered_channel: false }, { selected_path_observed: false }, { used_turn: true }, + { qualification_elapsed_sec: 10.1 }, { ice_setup_sec: 50, qualification_elapsed_sec: 1 }, { ice_setup_sec: 10, qualification_elapsed_sec: 9 }, { heartbeats_passed: undefined }]) assert.equal(c1SampleQualified({ ...sample, ...changes }), false, JSON.stringify(changes)); + const logger = new ExperimentTrialLogger(); + for (let index = 0; index < 30; index++) logger.logTrial('C1', { success: true, network_pair_class: 'declared', used_turn: false, ice_setup_sec: 1 }); + assert.equal(logger.summarizeC1('declared').direct_success_rate, 0); + assert.equal(logger.summarizeC1('declared').c1_status, 'INSUFFICIENT_EVIDENCE'); + assert.equal(logger.summarizeC1('declared').invalid_samples, 30); +}); diff --git a/tests/contracts.test.js b/tests/contracts.test.js new file mode 100644 index 0000000..1220d40 --- /dev/null +++ b/tests/contracts.test.js @@ -0,0 +1,165 @@ +import test from 'node:test'; +import { Datum, applyPrimitiveOp } from '../src/layer1-uor/index.js'; +import assert from 'node:assert/strict'; +import { canonicalBytes, sha256Bytes } from '../src/layer1-uor/custody.js'; +import { createCheckpoint, verifyCheckpoint, resumeProgram, replayProgram, demoProgram, identifyProgram } from '../src/layer4-compute/replay.js'; +import { generateAuthority, signPointer, admitPointer } from '../src/layer1-uor/pointer.js'; +import { createBudget, reserveAction, settleAction, zeroCost } from '../src/layer2-schedulers/policy.js'; +import { BudgetPacedSurvivalScheduler } from '../src/layer2-schedulers/index.js'; +import { LiveDistributedComputeCoordinator } from '../src/layer4-compute/index.js'; +const code = expected => e => e.code === expected; + +test('checkpoints replay every operation and resume equals uninterrupted execution', async () => { + for (const bits of [8, 16, 32, 64, 128]) { + const instructions = []; + for (const op of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16]) { + instructions.push(op <= 3 ? { op } : { op, argHex: '0x3' }); + } + const program = { version: 1, bits, initialValueHex: '0x7', instructions }; + let independent = new Datum(bits, 7n); + for (const instr of instructions) independent = applyPrimitiveOp(instr.op, independent, instr.argHex ? new Datum(bits, BigInt(instr.argHex)) : null); + assert.equal(replayProgram(program).stateHex, '0x' + independent.value.toString(16)); + for (let cut = 0; cut <= instructions.length; cut++) { + const cp = await createCheckpoint(program, cut); + assert.equal((await verifyCheckpoint(program, cp)).execution, 'replayed'); + assert.equal((await resumeProgram(program, cp)).stateHex, replayProgram(program).stateHex); + } + } +}); + +test('checkpoint tampering, semantic forgery, wrong program and broken links fail', async () => { + const program = demoProgram(9); + const first = await createCheckpoint(program, 3); + const next = await createCheckpoint(program, 6, first); + assert.equal((await verifyCheckpoint(program, next, first)).predecessor, 'checked'); + await assert.rejects(verifyCheckpoint(program, { ...first, stateHex: '0x0' }), code('checkpoint-integrity')); + const body = { ...first, stateHex: '0x0' }; delete body.checkpointDigest; + const forged = { ...body, checkpointDigest: await sha256Bytes(canonicalBytes(body), 'checkpoint') }; + await assert.rejects(verifyCheckpoint(program, forged), code('checkpoint-replay')); + await assert.rejects(verifyCheckpoint(demoProgram(9, 1n), first), code('program-mismatch')); + await assert.rejects(verifyCheckpoint(program, next, await createCheckpoint(program, 2)), code('checkpoint-predecessor')); + await assert.rejects(verifyCheckpoint(program, { ...first, trusted: true }), code('invalid-record')); + await assert.rejects(identifyProgram({ ...program, instructions: [{ op: 18, argHex: '0x2' }] }), code('unsupported-operation')); + await assert.rejects(identifyProgram({ ...program, initialValueHex: '0x00' }), code('invalid-ring-value')); + await assert.rejects(identifyProgram({ ...program, instructions: new Array(4097).fill({ op: 2 }) }), code('program-limit')); + assert.equal((await createCheckpoint(demoProgram(0), 0)).stateHex, '0x19919'); +}); + +test('single-writer pointers require pinned authority, exact successor and fresh signed data', async () => { + const alice = await generateAuthority(); const mallory = await generateAuthority(); + const objectRoot = 'sha256:' + 'a'.repeat(64); + const body = { version: 1, name: 'workspace', authorityKey: alice.publicKey, revision: 0, + previousDigest: null, objectRoot, validFromMs: 100, validUntilMs: 200 }; + const genesis = await signPointer(body, alice.privateKey); + const options = { name: 'workspace', trustedAuthorityKey: alice.publicKey, nowMs: 150 }; + assert.deepEqual(await admitPointer(null, genesis, options), genesis); + const successor = await signPointer({ ...body, revision: 1, previousDigest: genesis.pointerDigest }, alice.privateKey); + assert.deepEqual(await admitPointer(genesis, successor, options), successor); + await assert.rejects(admitPointer(successor, genesis, options), code('pointer-conflict')); + await assert.rejects(admitPointer(null, successor, options), code('pointer-bootstrap')); + await assert.rejects(admitPointer(genesis, successor, { ...options, nowMs: 200 }), code('pointer-expired')); + const attacker = await signPointer({ ...body, authorityKey: mallory.publicKey }, mallory.privateKey); + await assert.rejects(admitPointer(null, attacker, options), code('wrong-authority')); + const wrongSigner = await signPointer(body, mallory.privateKey); + await assert.rejects(admitPointer(null, wrongSigner, options), code('pointer-signature')); + await assert.rejects(admitPointer(null, { ...genesis, objectRoot: 'sha256:' + 'b'.repeat(64) }, options), code('pointer-integrity')); + await assert.rejects(admitPointer(null, genesis, { ...options, name: 'other' }), code('pointer-name')); +}); + +test('budget admission is bounded, monotonic, duplicate-safe, and conservative on ambiguous effects', () => { + const limit = { requests: 2, transferBytes: 100, storageBytes: 50, computeSteps: 10 }; + const initial = createBudget({ epoch: 'run-1', startMs: 100, endMs: 200, limit }); + const requested = { requests: 1, transferBytes: 80, storageBytes: 50, computeSteps: 5 }; + const reserved = reserveAction(initial, { id: 'a', kind: 'place', cost: requested }, 120); + assert.deepEqual(initial.spent, zeroCost()); + assert.deepEqual(reserved.spent, requested); + assert.throws(() => reserveAction(reserved, { id: 'b', kind: 'repair', cost: requested }, 130), code('budget-exhausted')); + assert.throws(() => reserveAction(reserved, { id: 'a', kind: 'repair', cost: zeroCost() }, 130), code('duplicate-action')); + assert.throws(() => reserveAction(reserved, { id: 'b', kind: 'repair', cost: zeroCost() }, 119), code('clock-regression')); + assert.throws(() => reserveAction(reserved, { id: 'b', kind: 'repair', cost: zeroCost() }, 200), code('epoch-expired')); + assert.throws(() => settleAction(reserved, 'a', { ...requested, transferBytes: 81 }), code('reservation-exceeded')); + const actual = { requests: 1, transferBytes: 20, storageBytes: 25, computeSteps: 3 }; + const settled = settleAction(reserved, 'a', actual); + assert.deepEqual(settled.spent, actual); + assert.throws(() => settleAction(settled, 'a', zeroCost()), code('unknown-reservation')); + assert.throws(() => reserveAction({ ...reserved, spent: zeroCost() }, { id: 'b', kind: 'place', cost: requested }, 130), code('invalid-budget')); +}); + +test('live scheduler uses an elapsed epoch and enforces its own budget', () => { + for (const origin of [0, 1700000000]) { + const scheduler = new BudgetPacedSurvivalScheduler({ durationSeconds: 100, maxRefreshBudget: 2, minFloorSeconds: 1 }); + scheduler.markRefreshed(origin); + assert.equal(scheduler.markRefreshed(origin + 30), true); + assert.equal(scheduler.markRefreshed(origin + 60), true); + assert.equal(scheduler.evaluate(origin + 90).shouldRefresh, false); + assert.equal(scheduler.markRefreshed(origin + 90), false); + assert.equal(scheduler.refreshCount - 1, 2); + assert.throws(() => scheduler.evaluate(origin + 89), /Clock regression/); + } +}); + +test('live coordinator rejects forged/legacy checkpoints and replays takeover with no relay by default', async () => { + const warm = []; const sent = []; + const transport = { peerId: 'peer-b', openPeers: () => [], broadcast: p => sent.push(p), + publishWarmEnvelope: async p => warm.push(p), fetchWarmEnvelopes: async () => { throw Error('must not contact relay'); } }; + const coordinator = new LiveDistributedComputeCoordinator({ transport, liveDb: { put: async () => ({ addressHex: 'result' }) } }); + assert.equal(await coordinator.ingestCheckpoint({ type: 'compute_ckpt', verified: true, jobId: 'fake' }), false); + const program = demoProgram(9); + const checkpoint = await createCheckpoint(program, 3); + assert.equal(await coordinator.ingestCheckpoint({ type: 'compute_ckpt', jobId: 'job-1', program, checkpoint, ownerPeerId: 'peer-a' }), true); + assert.deepEqual(await coordinator.syncAndTakeOverJobs(), ['job-1']); + await coordinator.running.get('job-1'); + assert.equal(coordinator.jobs.get('job-1').currentValueHex, replayProgram(program).stateHex); + assert.equal(coordinator.jobs.get('job-1').verification, 'replayed'); + assert.equal(warm.length, 0); + assert.equal(sent.length, 6); +}); + +test('live compute publishes stable authenticated owners and takes over only absent routing identities', async () => { + let initialized = false; + const sent = []; + const peers = [{ remoteId: 'key-remote' }]; + const transport = { peerId: 'friendly-local', + get routingPeerId() { return initialized ? 'key-local' : this.peerId; }, + signaling: { async identity() { initialized = true; return { id: 'key-local' }; } }, + openPeers: () => peers, + broadcast: packet => sent.push(packet) + }; + const coordinator = new LiveDistributedComputeCoordinator({ transport, + liveDb: { put: async () => ({ addressHex: 'result' }) } }); + await coordinator.startOrResumeJob({ jobId: 'own', totalSteps: 0, stepDelayMs: 0 }); + assert.equal(sent[0].ownerPeerId, 'key-local', 'initial work must not publish a transient display identity'); + assert.equal(coordinator.jobs.get('own').sourceTag, 'local:friendly-local'); + const program = demoProgram(3), checkpoint = await createCheckpoint(program, 1); + assert.equal(await coordinator.ingestCheckpoint({ type: 'compute_ckpt', jobId: 'remote', program, + checkpoint, ownerPeerId: 'key-remote' }), true); + assert.equal(await coordinator.ingestCheckpoint({ type: 'compute_ckpt', jobId: 'retained-own', program, + checkpoint, ownerPeerId: 'key-local' }), true); + assert.deepEqual(await coordinator.syncAndTakeOverJobs(), [], 'a connected authenticated owner and our own owner are present'); + peers.length = 0; + assert.deepEqual(await coordinator.syncAndTakeOverJobs(), ['remote']); + await coordinator.running.get('remote'); + assert.equal(coordinator.jobs.get('remote').status, 'completed'); + assert.equal(coordinator.jobs.get('remote').ownerPeerId, 'key-local'); + assert.equal(coordinator.jobs.get('retained-own').stepIndex, 1, 'local pending work is not a missing remote owner'); +}); + +test('replaced signaling session cannot publish a transient owner while identity resolves', async () => { + let releaseIdentity, enteredIdentity; + const gate = new Promise(resolve => { releaseIdentity = resolve; }); + const entered = new Promise(resolve => { enteredIdentity = resolve; }); + const sent = []; + const transport = { peerId: 'label', routingPeerId: 'key-new', + signaling: { async identity() { enteredIdentity(); await gate; } }, + openPeers: () => [], broadcast: packet => sent.push(packet) + }; + const coordinator = new LiveDistributedComputeCoordinator({ transport, + liveDb: { put: async () => { throw Error('No completed result may be stored'); } } }); + const work = coordinator.startOrResumeJob({ jobId: 'changed-session', totalSteps: 0, stepDelayMs: 0 }); + await entered; + transport.signaling = { async identity() {} }; + releaseIdentity(); + await assert.rejects(work, code('transport-session-changed')); + assert.equal(sent.length, 0); + assert.equal(coordinator.jobs.size, 0); +}); diff --git a/tests/custody.test.js b/tests/custody.test.js new file mode 100644 index 0000000..7532be0 --- /dev/null +++ b/tests/custody.test.js @@ -0,0 +1,352 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { readFile } from 'node:fs/promises'; +import { + CustodyError, CUSTODY_LIMITS, canonicalBytes, sha256Bytes, commitObject, fragmentDigest, + verifyManifest, verifyFragment, manifestBody, +} from '../src/layer1-uor/custody.js'; +import { + createObject, recoverObject, createPlacement, requestPlacement, requestMigration, + acknowledgePlacement, commitPlacement, failPlacement, observeHolderLoss, retirePlacement, placementStatus, +} from '../src/layer3-storage/custody.js'; +import { LiveUorMeshDatabase } from '../src/layer3-storage/index.js'; + +const bytes = text => new TextEncoder().encode(text); +const clone = value => structuredClone(value); +const rejects = (action, code) => assert.rejects(action, e => e instanceof CustodyError && (!code || e.code === code)); +const throws = (action, code) => assert.throws(action, e => e instanceof CustodyError && (!code || e.code === code)); +const pairs = [[0, 1], [0, 2], [1, 2]]; +async function rehash(manifest) { + manifest.manifestDigest = await sha256Bytes(canonicalBytes(manifestBody(manifest)), 'manifest'); + return manifest; +} +function receipt(bundle, { requestId, index, holder, leaseExpiresAt = 1000 }) { + return { requestId, index, holder, leaseExpiresAt, manifestDigest: bundle.manifest.manifestDigest, + fragmentDigest: bundle.manifest.fragments.digests[index], bytes: bundle.fragments[index].bytes }; +} +async function place(s, bundle, index, holder = `peer-${index}`, requestId = `request-${index}`, nowMs = 10) { + const p = { requestId, index, holder, leaseExpiresAt: 1000 }; + s = await requestPlacement(s, p); + s = await acknowledgePlacement(s, receipt(bundle, p), nowMs); + return commitPlacement(s, requestId, nowMs); +} + +test('canonical encoding is deterministic, closed, bounded and does not execute accessors', () => { + assert.deepEqual(canonicalBytes({ z: [true, null, 123], a: '\u2603' }), canonicalBytes({ a: '\u2603', z: [true, null, 123] })); + assert.equal(new TextDecoder().decode(canonicalBytes({ b: 2, a: 1 })), '{"a":1,"b":2}'); + for (const value of [undefined, NaN, Infinity, -Infinity, 1n, new Date(), new Uint8Array(), '\ud800', '\udfff']) { + throws(() => canonicalBytes(value), 'InvalidCanonicalValue'); + } + for (const value of [[, 1], Object.assign([1], { extra: true }), Object.assign({}, { [Symbol('x')]: 1 })]) { + throws(() => canonicalBytes(value), 'InvalidCanonicalValue'); + } + let called = false; + const getter = Object.defineProperty({}, 'x', { enumerable: true, get() { called = true; return 1; } }); + throws(() => canonicalBytes(getter), 'InvalidCanonicalValue'); + assert.equal(called, false); + throws(() => canonicalBytes(Object.defineProperty({}, 'hidden', { value: 1 })), 'InvalidCanonicalValue'); + const cycle = {}; cycle.self = cycle; + throws(() => canonicalBytes(cycle), 'InvalidCanonicalValue'); + throws(() => canonicalBytes('a'.repeat(CUSTODY_LIMITS.maxStringLength + 1)), 'SizeLimit'); + let nested = null; for (let i = 0; i < 20; i++) nested = [nested]; + throws(() => canonicalBytes(nested), 'SizeLimit'); + throws(() => canonicalBytes(new Array(5000).fill(0)), 'SizeLimit'); +}); + +test('domain-separated full commitments agree with independent Python vectors', async () => { + const fixture = JSON.parse(await readFile(new URL('./fixtures/custody-vectors.json', import.meta.url), 'utf8')); + for (const vector of fixture.vectors) { + const original = Uint8Array.from(Buffer.from(vector.objectHex, 'hex')); + const actual = await createObject(original); + assert.deepEqual(actual.manifest, vector.manifest, vector.name); + for (let i = 0; i < 3; i++) assert.equal(Buffer.from(actual.fragments[i].bytes).toString('hex'), vector.fragments[i].hex); + for (const pair of pairs) assert.deepEqual(await recoverObject(vector.manifest, pair.map(i => actual.fragments[i])), original); + assert.notEqual(actual.manifest.object.contentDigest, actual.manifest.encoding.encodingDigest); + assert.equal(actual.manifest.object.contentDigest.length, 71); + } + for (const vector of fixture.invalidVectors) { + const fragments = vector.fragments.map(f => ({ index: f.index, bytes: Uint8Array.from(Buffer.from(f.hex, 'hex')) })); + await rejects(() => recoverObject(vector.manifest, fragments), vector.expectedError); + } + await rejects(() => sha256Bytes(bytes('x'), 'stitch/object/v1'), 'InvalidSchema'); + await rejects(() => commitObject('implicit text coercion'), 'InvalidBytes'); +}); + +test('every pair and triple recovers exact odd/even/empty bytes over deterministic corpus', async () => { + for (const length of [...Array(80).keys(), 127, 128, 129, 255, 256, 257, 1023, 1024, 1025]) { + const original = Uint8Array.from({ length }, (_, i) => (i * 71 + length * 19) & 255); + const bundle = await createObject(original); + for (const pair of pairs) assert.deepEqual(await recoverObject(bundle.manifest, pair.map(i => bundle.fragments[i])), original, `length ${length} pair ${pair}`); + assert.deepEqual(await recoverObject(bundle.manifest, bundle.fragments), original); + } +}); + +test('async boundaries snapshot original bytes, manifests and fragments', async () => { + const input = bytes('original'); + const pending = createObject(input); input.fill(255); + const bundle = await pending; + assert.deepEqual(await recoverObject(bundle.manifest, bundle.fragments.slice(0, 2)), bytes('original')); + const mutable = clone(bundle.manifest); + const checked = verifyManifest(mutable); mutable.object.byteLength = 1; + assert.equal((await checked).object.byteLength, 8); + const fragments = bundle.fragments.map(f => ({ index: f.index, bytes: new Uint8Array(f.bytes) })); + const recovering = recoverObject(bundle.manifest, fragments.slice(0, 2)); + fragments.forEach(f => f.bytes.fill(0)); + assert.deepEqual(await recovering, bytes('original')); +}); + +test('closed schemas reject truncated commitments, unsupported dependencies and hostile lengths', async () => { + const { manifest } = await createObject(bytes('schema')); + const mutations = [ + m => { m.extra = true; }, m => { delete m.object.digestAlgorithm; }, m => { m.version = 2; }, + m => { m.encoding.dependencies = ['missing-basis']; }, m => { m.encoding.format = 'external'; }, + m => { m.object.contentDigest = m.object.contentDigest.slice(0, 24); }, + m => { m.encoding.encodingDigest = m.encoding.encodingDigest.toUpperCase(); }, + m => { m.fragments.digests.pop(); }, m => { m.fragments.threshold = 1; }, + m => { m.fragments.byteLength += 1; }, m => { m.object.byteLength = -1; }, + m => { m.object.byteLength = Number.MAX_SAFE_INTEGER; }, m => { m.object.byteLength = 1.5; }, + ]; + for (const mutate of mutations) { const m = clone(manifest); mutate(m); await rejects(() => verifyManifest(m)); } + const m = clone(manifest); m.object.contentDigest = 'sha256:' + '0'.repeat(64); + await rejects(() => verifyManifest(m), 'ManifestDigestMismatch'); + const huge = new Uint8Array(CUSTODY_LIMITS.maxObjectBytes + 1); + await rejects(() => createObject(huge), 'SizeLimit'); +}); + +test('recovery rejects duplicate, invalid, truncated, mutated, mixed and extra corrupt fragments', async () => { + const a = await createObject(bytes('fragment-A')), b = await createObject(bytes('fragment-B')); + await rejects(() => recoverObject(a.manifest, [a.fragments[0]]), 'InsufficientFragments'); + await rejects(() => recoverObject(a.manifest, [a.fragments[0], a.fragments[0]]), 'DuplicateFragment'); + await rejects(() => recoverObject(a.manifest, [a.fragments[0], b.fragments[1]]), 'FragmentDigestMismatch'); + const malformed = [ + { index: 3, bytes: a.fragments[0].bytes }, { index: -1, bytes: a.fragments[0].bytes }, + { index: 0.5, bytes: a.fragments[0].bytes }, { index: 0, bytes: [1, 2] }, + { index: 0, bytes: a.fragments[0].bytes.subarray(1) }, + { index: 0, bytes: new Uint8Array(a.fragments[0].bytes.length + 1) }, + { index: 0, bytes: a.fragments[0].bytes, extra: true }, + ]; + for (const f of malformed) await rejects(() => verifyFragment(a.manifest, f)); + const corrupted = a.fragments.map(f => ({ index: f.index, bytes: new Uint8Array(f.bytes) })); + corrupted[2].bytes[0] ^= 1; + await rejects(() => recoverObject(a.manifest, corrupted), 'FragmentDigestMismatch'); + let called = false; + const f = { index: 0, get bytes() { called = true; return a.fragments[0].bytes; } }; + await rejects(() => verifyFragment(a.manifest, f), 'InvalidSchema'); + assert.equal(called, false); +}); + +test('recovery checks complete absent-fragment commitment, object, encoding and canonical padding', async () => { + const a = await createObject(new Uint8Array([1, 2, 3])); + const absent = clone(a.manifest); absent.fragments.digests[2] = 'sha256:' + '0'.repeat(64); + await rehash(absent); + await rejects(() => recoverObject(absent, a.fragments.slice(0, 2)), 'InvalidParity'); + const wrongObject = clone(a.manifest); wrongObject.object.contentDigest = 'sha256:' + '0'.repeat(64); + await rehash(wrongObject); + await rejects(() => recoverObject(wrongObject, a.fragments.slice(0, 2)), 'ObjectDigestMismatch'); + const wrongEncoding = clone(a.manifest); wrongEncoding.encoding.encodingDigest = 'sha256:' + '0'.repeat(64); + wrongEncoding.fragments.digests = await Promise.all(a.fragments.map(f => fragmentDigest(wrongEncoding.encoding.encodingDigest, f.index, f.bytes))); + await rehash(wrongEncoding); + await rejects(() => recoverObject(wrongEncoding, a.fragments.slice(0, 2)), 'EncodingDigestMismatch'); + const badPadding = a.fragments.map(f => ({ index: f.index, bytes: new Uint8Array(f.bytes) })); + badPadding[1].bytes[1] = 7; badPadding[2].bytes[1] ^= 7; + const paddingManifest = clone(a.manifest); + paddingManifest.fragments.digests = await Promise.all(badPadding.map(f => fragmentDigest(paddingManifest.encoding.encodingDigest, f.index, f.bytes))); + await rehash(paddingManifest); + await rejects(() => recoverObject(paddingManifest, badPadding.slice(0, 2)), 'InvalidPadding'); +}); + +test('placement requests and acknowledgements do not count before explicit commit', async () => { + const b = await createObject(bytes('custody')); + let s = await createPlacement(b.manifest); + const initial = s; + const p = { requestId: 'r0', index: 0, holder: 'p0', leaseExpiresAt: 1000 }; + s = await requestPlacement(s, p); + assert.equal(initial.requests.length, 0); + assert.equal(placementStatus(s, 10).committedFragments, 0); + await rejects(() => commitPlacement(s, 'r0', 10), 'InvalidTransition'); + s = await acknowledgePlacement(s, receipt(b, p), 10); + assert.equal(placementStatus(s, 10).committedFragments, 0); + assert.equal(placementStatus(s, 10).assertedCopies, 1); + s = await commitPlacement(s, 'r0', 10); + assert.equal(placementStatus(s, 10).canRecoverFromCommitted, false); + s = await place(s, b, 1); + assert.equal(placementStatus(s, 10).canRecoverFromCommitted, true); + assert.equal(placementStatus(s, 10).toleratesOneHolderLoss, false); + s = await place(s, b, 2); + assert.equal(placementStatus(s, 10).toleratesOneHolderLoss, true); + assert.equal(Object.isFrozen(s.requests[0]), true); + assert.equal(placementStatus(s, 1000).committedFragments, 0); +}); + +test('migration retains source on requested/failed/uncertain and accounts for superseded physical copies', async () => { + const b = await createObject(bytes('safe-migration')); + let s = await createPlacement(b.manifest); + for (let i = 0; i < 3; i++) s = await place(s, b, i); + const old = s; + const p = { requestId: 'migration', index: 0, holder: 'replacement', leaseExpiresAt: 1000 }; + s = await requestMigration(s, p); + assert.equal(placementStatus(s, 10).committedFragments, 3); + assert.equal(old.requests.length, 3); + const uncertain = await failPlacement(s, p.requestId, 'uncertain'); + assert.equal(placementStatus(uncertain, 10).committedFragments, 3); + assert.equal(placementStatus(uncertain, 10).uncertainTransfers, 1); + s = await acknowledgePlacement(s, receipt(b, p), 10); + assert.equal(placementStatus(s, 10).assertedCopies, 4); + const failed = await failPlacement(s, p.requestId); + assert.equal(placementStatus(failed, 10).assertedCopies, 4); + assert.equal(placementStatus(failed, 10).committedFragments, 3); + s = await commitPlacement(s, p.requestId, 10); + assert.equal(s.copies.find(c => c.holder === 'peer-0').status, 'superseded'); + assert.equal(placementStatus(s, 10).assertedCopies, 4); + s = await retirePlacement(s, { index: 0, holder: 'peer-0' }, 10); + assert.equal(placementStatus(s, 10).assertedCopies, 3); + assert.equal(placementStatus(s, 10).toleratesOneHolderLoss, true); +}); + +test('receipt binding, leases, replay, stale source and distinct-holder guards fail closed', async () => { + const b = await createObject(bytes('guards')); + let s = await createPlacement(b.manifest); + const p = { requestId: 'r', index: 0, holder: 'holder', leaseExpiresAt: 1000 }; + s = await requestPlacement(s, p); + for (const change of [r => { r.holder = 'other'; }, r => { r.index = 1; }, r => { r.manifestDigest = 'sha256:' + '0'.repeat(64); }, + r => { r.fragmentDigest = 'sha256:' + '0'.repeat(64); }, r => { r.leaseExpiresAt = 999; }]) { + const r = receipt(b, p); change(r); + await rejects(() => acknowledgePlacement(s, r, 10), 'ReceiptMismatch'); + } + await rejects(() => acknowledgePlacement(s, receipt(b, p), 1000), 'InvalidTransition'); + const ack = await acknowledgePlacement(s, receipt(b, p), 10); + await rejects(() => commitPlacement(ack, 'r', 9), 'ClockRegression'); + throws(() => placementStatus(ack, 9), 'ClockRegression'); + await rejects(() => commitPlacement(ack, 'r', 1000), 'InvalidTransition'); + await rejects(() => commitPlacement(ack, 'r'), 'InvalidSchema'); + s = await commitPlacement(ack, 'r', 10); + await rejects(() => acknowledgePlacement(s, receipt(b, p), 10), 'InvalidTransition'); + await rejects(() => requestPlacement(s, { requestId: 'same-holder', index: 1, holder: 'holder', leaseExpiresAt: 1000 }), 'HolderConflict'); + await rejects(() => requestPlacement(s, p), 'RequestConflict'); + const mp = { requestId: 'm', index: 0, holder: 'new-holder', leaseExpiresAt: 1000 }; + s = await requestMigration(s, mp); + s = await acknowledgePlacement(s, receipt(b, mp), 10); + s = await observeHolderLoss(s, 'holder'); + await rejects(() => commitPlacement(s, 'm', 10), 'StaleRequest'); + await rejects(() => retirePlacement(s, { index: 0, holder: 'new-holder' }, 10), 'InvalidTransition'); + const forged = clone(ack); forged.copies.push(clone(forged.copies[0])); + await rejects(() => commitPlacement(forged, 'r', 10), 'InvalidPlacement'); +}); + +test('concurrent target holder reuse cannot inflate recovery threshold', async () => { + const b = await createObject(bytes('same physical holder')); + let s = await createPlacement(b.manifest); + for (let i = 0; i < 2; i++) { + const p = { requestId: `r${i}`, index: i, holder: 'same', leaseExpiresAt: 1000 }; + s = await requestPlacement(s, p); + s = await acknowledgePlacement(s, receipt(b, p), 10); + } + s = await commitPlacement(s, 'r0', 10); + await rejects(() => commitPlacement(s, 'r1', 10), 'HolderConflict'); + assert.equal(placementStatus(s, 10).canRecoverFromCommitted, false); +}); + +function wire() { + const warm = [], nodes = []; + const node = peerId => { + const n = { peerId, peers: new Map(), sent: [], handlers: [], + openPeers() { return [...this.peers.keys()].map(remoteId => ({ remoteId })); }, + sendToPeer(remoteId, pkt) { + const target = this.peers.get(remoteId); + if (!target) return false; + this.sent.push({ remoteId, pkt: clone(pkt) }); + for (const h of target.handlers) h(this.peerId, clone(pkt)); + return true; + }, + broadcast(pkt) { let sent = 0; for (const id of this.peers.keys()) if (this.sendToPeer(id, pkt)) sent++; return sent; }, + async publishWarmEnvelope(pkt) { warm.push({ ...clone(pkt), from: this.peerId, tsMs: Date.now() }); return true; }, + async fetchWarmEnvelopes() { return clone(warm); }, + }; + n.db = new LiveUorMeshDatabase({ transport: n }); + n.handlers.push((from, msg) => n.db.handleMeshMessage(from, msg)); + nodes.push(n); + return n; + }; + const connect = (a, b) => { a.peers.set(b.peerId, b); b.peers.set(a.peerId, a); }; + const drain = async () => { for (let i = 0; i < 8; i++) await Promise.all(nodes.map(n => n.db.flush())); }; + return { node, connect, drain, warm }; +} + +test('live adapter places one fragment per distinct holder and recovers after a holder loss without relay', async () => { + const w = wire(), writer = w.node('writer'), holders = [w.node('h0'), w.node('h1'), w.node('h2')]; + for (const h of holders) w.connect(writer, h); + const entry = await writer.db.put('three separate fragment holders', { label: 'demo.txt' }); + await w.drain(); + assert.equal(w.warm.length, 0); + assert.equal(entry.addressHex, entry.manifest.object.contentDigest); + assert.equal(placementStatus(writer.db.placements.get(entry.addressHex), Date.now()).committedFragments, 3); + for (let i = 0; i < 3; i++) { + const e = holders[i].db.objects.get(entry.addressHex); + assert.deepEqual([...e.heldIndices], [i]); + assert.equal(e.shards.filter(Boolean).length, 1); + assert.equal(holders[i].db.get(entry.addressHex).ok, false); + } + writer.db.objects.clear(); // recovery no longer consults the creator's full copy + holders[2].db.objects.clear(); + const reader = w.node('reader'); + w.connect(reader, holders[0]); w.connect(reader, holders[1]); + await reader.db.syncFromNetwork(); await w.drain(); + assert.equal(reader.db.get(entry.addressHex).text, 'three separate fragment holders'); + const returned = reader.db.get(entry.addressHex).bytes; returned.fill(0); + assert.equal(reader.db.get(entry.addressHex).text, 'three separate fragment holders'); + assert.equal(reader.db.objects.get(entry.addressHex).shards.filter(Boolean).length, 2); + assert.deepEqual([...reader.db.objects.get(entry.addressHex).heldIndices], []); +}); + +test('live partial placement stays partial and legacy/corrupt/non-byte packets never become verified objects', async () => { + const w = wire(), a = w.node('a'), b = w.node('b'); w.connect(a, b); + const e = await a.db.put('partial'); await w.drain(); + assert.equal(placementStatus(a.db.placements.get(e.addressHex), Date.now()).committedFragments, 1); + assert.equal(b.db.get(e.addressHex).ok, false); + assert.equal(a.sent.filter(s => s.pkt.type === 'uor_shard').length, 1); + const victim = w.node('victim'); + assert.equal(await victim.db.ingestShardEnvelope({ type: 'uor_shard', addressHex: 'short', shardIndex: 0, shardBytes: [1] }), false); + const packet = clone(a.sent.find(s => s.pkt.type === 'uor_shard').pkt); + packet.purpose = 'recovery'; packet.requestId = null; packet.holder = null; packet.leaseExpiresAt = 0; + packet.shardBytes[0] ^= 1; + assert.equal(await victim.db.ingestShardEnvelope(packet), false); + for (const value of [-1, 256, 1.5, '2']) { + packet.shardBytes[0] = value; + assert.equal(await victim.db.ingestShardEnvelope(packet), false); + } + assert.equal(victim.db.objects.size, 0); +}); + +test('public relay requires explicit opt-in for publishing and recovery; cold reader needs retained information', async () => { + const w = wire(), writer = w.node('writer'); + await rejects(() => writer.db.put('private', { persistWarm: true }), 'PublicDataRequired'); + assert.equal(writer.db.objects.size, 0); assert.equal(w.warm.length, 0); + await rejects(() => writer.db.put(new Uint8Array(writer.db.maxWireObjectBytes + 1), { persistWarm: true, publicData: true }), 'SizeLimit'); + assert.equal(writer.db.objects.size, 0); + const entry = await writer.db.put('explicit public demo', { persistWarm: true, publicData: true }); + assert.equal(w.warm.length, 2); + writer.db.objects.clear(); + const reader = w.node('reader'); + assert.equal(await reader.db.syncFromNetwork(), 0); + assert.equal(reader.db.objects.size, 0); + assert.equal(await reader.db.syncFromNetwork('30m', { publicData: true }), 1); + assert.equal(reader.db.get(entry.addressHex).text, 'explicit public demo'); + w.warm.length = 0; + const cold = w.node('cold'); + assert.equal(await cold.db.syncFromNetwork('30m', { publicData: true }), 0); + assert.equal(cold.db.get(entry.addressHex).ok, false); +}); + +test('complete local put promotes a partial cache and repeated put honors a later relay opt-in', async () => { + const w = wire(), a = w.node('a'), b = w.node('b'); w.connect(a, b); + const original = await a.db.put('promote cached fragment'); await w.drain(); + assert.equal(b.db.get(original.addressHex).ok, false); + const promoted = await b.db.put('promote cached fragment'); await w.drain(); + assert.equal(b.db.get(original.addressHex).text, 'promote cached fragment'); + assert.deepEqual([...promoted.heldIndices], [0]); + assert.equal(b.db.placements.has(original.addressHex), true); + assert.equal(w.warm.length, 0); + await b.db.put('promote cached fragment', { persistWarm: true, publicData: true }); + assert.equal(w.warm.length, 2); + assert.equal(w.warm.every(p => p.from === 'b' && Number.isSafeInteger(p.tsMs)), true); +}); diff --git a/tests/dns-json.test.js b/tests/dns-json.test.js new file mode 100644 index 0000000..325b49b --- /dev/null +++ b/tests/dns-json.test.js @@ -0,0 +1,28 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { DohResolver, parseSrvRecord } from '../src/layer5-transport/index.js'; +const answer = (change = {}) => ({ name: 'wanted.example.', type: 16, TTL: 0, data: 'v=uor1;peer=peer', ...change }); +const resolve = body => new DohResolver({ format: "json", fetchImpl: async () => Response.json(body) }).resolve('wanted.example', 'TXT'); +test('SRV parsing rejects extra fields, non-UInt16 fields and invalid target names; root means unavailable', () => { + for (const value of ['-1 NaN 70000 target ignored', '-1 1 443 target', '1 65536 443 target', '1 1 65536 target', '1.5 1 443 target', '1 1 443 target extra', '1 1 443 bad..target', '1 1 443 _not-a-host.example', null]) assert.equal(parseSrvRecord(value), null, String(value)); + assert.deepEqual(parseSrvRecord('0 65535 65535 TARGET.Example.'), { priority: 0, weight: 65535, port: 65535, target: 'target.example' }); + assert.deepEqual(parseSrvRecord('0 0 0 .'), { priority: 0, weight: 0, port: 0, target: '.' }); +}); +test('provider JSON refuses NXDOMAIN, malformed status, truncation, unrelated owner/type and malformed TTL/class', async () => { + for (const Status of [undefined, -1, 3, '0', NaN]) await assert.rejects(resolve({ Status, Answer: [answer()] })); + for (const change of [{ name: 'wrong.example' }, { type: 1 }, { type: '16' }, { TTL: -1 }, { TTL: 0.5 }, { TTL: 2147483648 }, { TTL: undefined }, { class: 3 }, { data: null }]) await assert.rejects(resolve({ Status: 0, Answer: [answer(change)] }), JSON.stringify(change)); + for (const TC of [true, 'true', 1, null]) await assert.rejects(resolve({ Status: 0, TC, Answer: [answer()] })); + assert.equal((await resolve({ Status: 0, TC: false, Answer: [answer()] })).records.length, 1); + await assert.rejects(resolve({ Status: 0, Question: [{ name: 'other.example', type: 16 }], Answer: [answer()] })); +}); +test('JSON association accepts case/trailing-dot equivalence, zero TTL and one explicit CNAME chain', async () => { + const direct = await resolve({ Status: 0, Question: [{ name: 'WANTED.EXAMPLE.', type: 16 }], Answer: [answer({ name: 'WANTED.EXAMPLE' })] }); + assert.equal(direct.ttl_seconds, 0); assert.equal(direct.records[0].peer, 'peer'); + const aliased = await resolve({ Status: 0, Answer: [answer({ type: 5, TTL: 5, data: 'target.example.' }), answer({ name: 'target.example.', TTL: 30 })] }); + assert.equal(aliased.ttl_seconds, 5); assert.equal(aliased.records[0].peer, 'peer'); + for (const answers of [ + [answer({ type: 5, data: 'wanted.example.' })], + [answer({ type: 5, data: 'target.example' }), answer({ type: 5, data: 'other.example' })], + [answer({ type: 5, data: 'target.example' }), answer()] + ]) await assert.rejects(resolve({ Status: 0, Answer: answers })); +}); diff --git a/tests/dns-publication.test.js b/tests/dns-publication.test.js new file mode 100644 index 0000000..1b30dc9 --- /dev/null +++ b/tests/dns-publication.test.js @@ -0,0 +1,218 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { generateAuthority, signPointer, PointerPublisher, pointerDnsText, parsePointerDnsText } from '../src/layer1-uor/pointer.js'; +import { DohResolver } from '../src/layer5-transport/index.js'; +import { ResourceAdmission } from '../src/layer2-schedulers/policy.js'; + +const zoneId = 'a'.repeat(32), name = 'state.example.test'; +const code = expected => error => error.code === expected; +async function fixture() { + const authority = await generateAuthority(); + const make = (revision = 0, previousDigest = null, other = {}) => signPointer({ version: 1, name, + authorityKey: authority.publicKey, revision, previousDigest, objectRoot: 'sha256:' + 'f'.repeat(64), + validFromMs: 0, validUntilMs: 100, ...other }, authority.privateKey); + const first = await make(); + const calls = []; let rows = [], mode = 'success', listing = null; + const admission = new ResourceAdmission({ clock: () => 0 }); + const resolver = new DohResolver({ admission, fetchImpl: async (url, options) => { + const method = options.method ?? 'GET'; calls.push({ url, method, options }); + if (method === 'GET') { + if (mode === 'read-fails') throw Error('unavailable'); + return Response.json(listing ?? { success: true, result: rows, + result_info: { page: 1, count: rows.length, total_count: rows.length, total_pages: 1 } }); + } + if (mode === 'refused') return Response.json({ success: false, errors: [{ message: 'rejected' }] }, { status: 403 }); + if (mode === 'malformed') return new Response('broken'); + if (mode !== 'lost-not-created') rows = [{ id: 'record-1', ...JSON.parse(options.body) }]; + if (mode.startsWith('lost-')) throw Error('lost response'); + return Response.json({ success: true, result: { id: 'record-1' } }); + } }); + const publisher = new PointerPublisher({ resolver, clock: () => 5 }); + const args = candidate => ({ zoneId, apiToken: 'secret-token', name, trustedAuthorityKey: authority.publicKey, candidate }); + return { authority, make, first, calls, admission, resolver, publisher, args, + setMode(value) { mode = value; }, setRows(value) { rows = value; }, setListing(value) { listing = value; } }; +} + +test('lost POST response is reconciled by exact signed read without a duplicate write', async () => { + const f = await fixture(); f.setMode('lost-created'); + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'unknown'); + assert.deepEqual(f.publisher.pending(f.args(f.first)), f.first); + assert.equal(JSON.stringify(f.publisher.pending(f.args(f.first))).includes('secret-token'), false); + const result = await f.publisher.publish(f.args(f.first)); + assert.equal(result.outcome, 'published'); assert.equal(result.reconciled, true); + assert.deepEqual(f.calls.map(c => c.method), ['GET', 'POST', 'GET']); + assert.equal(f.publisher.pending(f.args(f.first)), null); +}); + +test('unknown create with no visible record stays unknown across reads and zone case changes', async () => { + const f = await fixture(); f.setMode('lost-not-created'); + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'unknown'); + assert.equal((await f.publisher.publish({ ...f.args(f.first), zoneId: zoneId.toUpperCase() })).outcome, 'unknown'); + f.setMode('read-fails'); + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'unknown'); + assert.deepEqual(f.calls.map(c => c.method), ['GET', 'POST', 'GET', 'GET']); + const next = await f.make(1, f.first.pointerDigest); + assert.equal((await f.publisher.publish(f.args(next))).outcome, 'unknown'); + assert.equal(f.calls.length, 4); +}); + +test('successor publication reads exact predecessor and reuses provider ID for PUT', async () => { + const f = await fixture(); + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'published'); + const next = await f.make(1, f.first.pointerDigest); + assert.equal((await f.publisher.publish(f.args(next))).outcome, 'published'); + assert.deepEqual(f.calls.map(c => c.method), ['GET', 'POST', 'GET', 'PUT']); + assert.ok(f.calls.at(-1).url.endsWith('/record-1')); + f.setRows([]); + await assert.rejects(f.publisher.publish(f.args(await f.make(2, next.pointerDigest))), code('dns-record-missing')); + assert.equal(f.calls.filter(c => c.method !== 'GET').length, 2); +}); + +test('foreign, forged, and conflicting DNS records never authorize overwrite', async () => { + const f = await fixture(); + const foreign = await generateAuthority(); + const wrong = await signPointer({ version: 1, name, authorityKey: foreign.publicKey, revision: 0, previousDigest: null, + objectRoot: 'sha256:' + 'a'.repeat(64), validFromMs: 0, validUntilMs: 100 }, foreign.privateKey); + const conflict = await f.make(0, null, { objectRoot: 'sha256:' + 'b'.repeat(64) }); + for (const candidate of [wrong, { ...f.first, signature: '0'.repeat(128) }, conflict]) { + f.setRows([{ id: 'record-1', name, type: 'TXT', content: pointerDnsText(candidate) }]); + await assert.rejects(f.publisher.publish(f.args(f.first))); + } + assert.ok(f.calls.every(c => c.method === 'GET')); +}); + +test('incomplete, paginated, multiple, and wrong-name provider listings refuse before mutation', async () => { + const f = await fixture(); + const row = { id: 'record-1', name, type: 'TXT', content: pointerDnsText(f.first) }; + for (const listing of [ + { success: true, result: [] }, + { success: true, result: [], result_info: { page: 1, count: 0, total_count: 1, total_pages: 2 } }, + { success: true, result: [row, row], result_info: { page: 1, count: 2, total_count: 2, total_pages: 1 } }, + { success: true, result: [{ ...row, name: 'other.test' }], result_info: { page: 1, count: 1, total_count: 1, total_pages: 1 } } + ]) { f.setListing(listing); await assert.rejects(f.publisher.publish(f.args(f.first))); } + assert.ok(f.calls.every(c => c.method === 'GET')); +}); + +test('provider rejection permits a later explicit retry; malformed mutation response remains unknown', async () => { + const f = await fixture(); f.setMode('refused'); + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'refused'); + f.setMode('malformed'); + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'unknown'); + f.setMode('success'); + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'unknown'); + assert.deepEqual(f.calls.map(c => c.method), ['GET', 'POST', 'GET', 'POST', 'GET']); +}); + +test('concurrent calls refuse and candidate/credentials are snapshotted before async work', async () => { + const f = await fixture(); + const args = f.args(structuredClone(f.first)); + const work = f.publisher.publish(args); + args.apiToken = 'replacement-token'; args.zoneId = 'b'.repeat(32); args.candidate.objectRoot = 'sha256:' + '0'.repeat(64); + await assert.rejects(f.publisher.publish(f.args(f.first)), code('dns-publication-in-flight')); + assert.equal((await work).outcome, 'published'); + assert.equal(f.calls.filter(c => c.method === 'POST').length, 1); + for (const call of f.calls) { + assert.ok(call.url.includes(zoneId)); + assert.equal(call.options.headers.authorization, 'Bearer secret-token'); + } +}); + +test('DNS lookup reserves its bounded response before the GET and failed work retains charges', async () => { + let calls = 0; + const admission = new ResourceAdmission({ clock: () => 0, + limit: { requests: 1, transferBytes: 1000000, storageBytes: 0, computeSteps: 0 } }); + const resolver = new DohResolver({ admission, fetchImpl: async () => { calls++; throw Error('network'); } }); + await assert.rejects(resolver.listCloudflareRecords({ zoneId, apiToken: 'secret-token', name }), /network/); + assert.equal(admission.state.spent.requests, 1); + assert.ok(admission.state.spent.transferBytes >= resolver.maxResponseBytes); + await assert.rejects(resolver.listCloudflareRecords({ zoneId, apiToken: 'secret-token', name }), code('budget-exhausted')); + assert.equal(calls, 1); +}); + +test('uncertain PUT does not repeat against a still-visible predecessor', async () => { + const f = await fixture(); + await f.publisher.publish(f.args(f.first)); + const next = await f.make(1, f.first.pointerDigest); + f.setMode('lost-not-created'); + assert.equal((await f.publisher.publish(f.args(next))).outcome, 'unknown'); + assert.equal((await f.publisher.publish(f.args(next))).outcome, 'unknown'); + assert.deepEqual(f.calls.map(c => c.method), ['GET', 'POST', 'GET', 'PUT', 'GET']); +}); + +test('expired unresolved candidate can still reconcile its earlier provider write', async () => { + const f = await fixture(); f.setMode('lost-created'); + await f.publisher.publish(f.args(f.first)); + f.publisher.clock = () => 200; + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'published'); + assert.deepEqual(f.calls.map(c => c.method), ['GET', 'POST', 'GET']); +}); + +test('publication-state capacity is reserved before provider I/O', async () => { + const f = await fixture(); + f.resolver.admission = new ResourceAdmission({ clock: () => 0, + limit: { requests: 10, transferBytes: 1000000, storageBytes: 0, computeSteps: 0 } }); + await assert.rejects(f.publisher.publish(f.args(f.first)), code('budget-exhausted')); + assert.equal(f.calls.length, 0); + assert.equal(f.publisher.pending(f.args(f.first)), null); +}); + +test('definite local write refusal preserves spent reads but permits explicit repair and retry', async () => { + const f = await fixture(); + const admission = new ResourceAdmission({ clock: () => 0, + limit: { requests: 1, transferBytes: 1000000, storageBytes: 10000, computeSteps: 0 } }); + f.resolver.admission = admission; + await assert.rejects(f.publisher.publish(f.args(f.first)), code('budget-exhausted')); + assert.deepEqual(f.calls.map(c => c.method), ['GET']); + assert.equal(admission.state.spent.requests, 1); + assert.equal(f.publisher.status(f.args(f.first)).outcome, 'refused'); + assert.equal(f.publisher.status(f.args(f.first)).canPublish, true); + assert.equal(f.publisher.pending(f.args(f.first)), null); + f.resolver.admission = new ResourceAdmission({ clock: () => 0 }); + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'published'); + assert.equal(admission.state.spent.requests, 1, 'repair never refunds the previous read'); + assert.deepEqual(f.calls.map(c => c.method), ['GET', 'GET', 'POST']); +}); + +test('an unclassified writer exception is unresolved and never implicitly retried', async () => { + const f = await fixture(); let mutations = 0; + f.resolver.writeCloudflareRecord = async () => { mutations++; throw Error('response lost after possible dispatch'); }; + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'unknown'); + assert.equal(f.publisher.status(f.args(f.first)).canPublish, false); + assert.equal(f.publisher.status(f.args(f.first)).canReconcile, true); + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'unknown'); + assert.equal(mutations, 1); + assert.deepEqual(f.calls.map(c => c.method), ['GET', 'GET']); +}); + +test('success for a different provider record ID remains uncertain and cannot enable another PUT', async () => { + const f = await fixture(); await f.publisher.publish(f.args(f.first)); + const next = await f.make(1, f.first.pointerDigest); let writes = 0; + f.resolver.writeCloudflareRecord = async () => { writes++; return { ok: true, outcome: 'published', id: 'different-record' }; }; + assert.equal((await f.publisher.publish(f.args(next))).outcome, 'unknown'); + assert.equal(f.publisher.status(f.args(next)).recordId, 'record-1'); + assert.equal((await f.publisher.publish(f.args(next))).outcome, 'unknown'); + assert.equal(writes, 1); +}); + +test('a dispatched provider 503 JSON failure stays unknown and cannot authorize another write', async () => { + const f = await fixture(); let writes = 0; + const original = f.resolver.fetchImpl; + f.resolver.fetchImpl = async (url, options) => { + if (options.method) { writes++; return Response.json({ success: false, errors: [{ code: 1000 }] }, { status: 503 }); } + return original(url, options); + }; + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'unknown'); + assert.equal((await f.publisher.publish(f.args(f.first))).outcome, 'unknown'); + assert.equal(writes, 1); +}); + +test('duplicate or escape-equivalent keys in an externally signed DNS pointer are rejected before verification/write', async () => { + const f = await fixture(); + for (const key of ['objectRoot', 'object\\u0052oot']) { + const raw = `{"${key}":"sha256:${'0'.repeat(64)}",${JSON.stringify(f.first).slice(1)}`; + assert.throws(() => parsePointerDnsText(raw), /Duplicate|duplicate/); + f.setRows([{ id: 'record-1', name, type: 'TXT', content: raw }]); + await assert.rejects(f.publisher.publish(f.args(f.first)), /Duplicate|duplicate/); + } + assert.ok(f.calls.every(call => call.method === 'GET')); +}); diff --git a/tests/dns-wire.test.js b/tests/dns-wire.test.js new file mode 100644 index 0000000..7d23eaa --- /dev/null +++ b/tests/dns-wire.test.js @@ -0,0 +1,88 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { encodeDnsQuery, decodeDnsResponse, queryDnsMessage, readBoundedDnsBytes } from '../src/layer5-transport/dns-wire.js'; +const u16=n=>[n>>8&255,n&255],u32=n=>[n>>>24,n>>>16&255,n>>>8&255,n&255]; +const name=s=>s==='.'?[0]:[...s.split('.').flatMap(l=>[l.length,...Buffer.from(l)]),0]; +const txt=s=>[Buffer.byteLength(s),...Buffer.from(s)]; +function answer({type=16,ttl=60,owner=[0xc0,0x0c],data=txt('hello'),klass=1}={}){return [...owner,...u16(type),...u16(klass),...u32(ttl),...u16(data.length),...data];} +function packet({query=encodeDnsQuery('example.test','TXT'),flags=0x8180,answers=[answer()],authority=[],additional=[]}={}){ + const q=query.bytes;return Uint8Array.from([0,0,...u16(flags),0,1,...u16(answers.length),...u16(authority.length),...u16(additional.length),...q.subarray(12),...answers.flat(),...authority.flat(),...additional.flat()]); +} +const expected=encodeDnsQuery('example.test','TXT'); +const reject=(p,code)=>assert.throws(()=>decodeDnsResponse(p,expected),e=>!code||e.code===code); +test('RFC8484 query uses ID0, recursion desired, typed IN question and valid DNS names',()=>{ + assert.equal(Buffer.from(encodeDnsQuery('www.example.com','A').bytes).toString('hex'),'00000100000100000000000003777777076578616d706c6503636f6d0000010001'); + assert.equal(encodeDnsQuery('BÜCHER.Example.','TXT').name,'xn--bcher-kva.example'); + assert.equal(encodeDnsQuery('_stitch._udp.example.test','SRV').type,33); + for(const value of ['bad..name','https://example.test','a'.repeat(64)+'.test','user@host','one test'])assert.throws(()=>encodeDnsQuery(value)); + for(const type of [0,65536,'BOGUS'])assert.throws(()=>encodeDnsQuery('example.test',type)); +}); +test('DNS compressed owners, complete TXT strings, SRV and opaque unknown RDATA decode',()=>{ + const response=decodeDnsResponse(packet({answers:[answer({data:[...txt('one'),...txt('two')]})]}),expected,{ageSeconds:7}); + assert.equal(response.selected[0].data,'"one" "two"');assert.equal(response.ttlSeconds,53); + const query=encodeDnsQuery('_stitch._udp.example.test','SRV'); + const srv=decodeDnsResponse(packet({query,answers:[answer({type:33,data:[...u16(2),...u16(3),...u16(443),...name('target.example.test')]})]}),query); + assert.deepEqual(srv.selected[0].srv,{priority:2,weight:3,port:443,target:'target.example.test'}); + const unknown=encodeDnsQuery('example.test',65000); + assert.equal(decodeDnsResponse(packet({query:unknown,answers:[answer({type:65000,data:[1,2,3]})]}),unknown).selected[0].data,'\\# 3 010203'); +}); +test('CNAME association, negative SOA lifetime and Age never become signature or DNSSEC proof',()=>{ + const result=decodeDnsResponse(packet({answers:[answer({type:5,ttl:5,data:name('target.test')}),answer({owner:name('target.test'),ttl:90})]}),expected,{ageSeconds:6}); + assert.equal(result.selected.length,1);assert.equal(result.ttlSeconds,0); + const soa=[...name('ns.example.test'),...name('hostmaster.example.test'),...u32(1),...u32(2),...u32(3),...u32(4),...u32(30)]; + const negative=decodeDnsResponse(packet({flags:0x81a3,answers:[],authority:[answer({type:6,ttl:60,data:soa})]}),expected,{ageSeconds:10}); + assert.equal(negative.negative,true);assert.equal(negative.status,3);assert.equal(negative.ttlSeconds,20);assert.equal(negative.authenticatedData,true);assert.equal(negative.dnssecValidatedByClient,false); + assert.equal(decodeDnsResponse(packet({answers:[answer({ttl:0xffffffff})]}),expected).ttlSeconds,0); +}); +test('malformed/truncated/compression/header/question and RDATA cases fail before association',()=>{ + const valid=packet();for(let i=0;i{ + for(const [method,endpoint] of [['POST','https://resolver.test/dns-query{?dns}'],['GET','https://resolver.test/dns-query{?dns}'],['GET','https://resolver.test/dns-query?x=1'],['GET','https://resolver.test/dns-query?dns={dns}']]){ + const reservations=[],calls=[]; + const result=await queryDnsMessage({name:'example.test',type:'TXT',method,endpoint,admission:{reserve:(...args)=>reservations.push(args)},fetchImpl:async(url,options)=>{calls.push({url,options});return new Response(packet(),{headers:{'content-type':'application/dns-message','age':'5'}});}}); + const {url,options}=calls[0];assert.equal(options.headers.accept,'application/dns-message');assert.equal(options.credentials,'omit');assert.equal(options.referrerPolicy,'no-referrer');assert.equal(result.ttlSeconds,55);assert.equal(reservations.length,1); + if(method==='POST'){assert.deepEqual(options.body,expected.bytes);assert.equal(options.headers['content-type'],'application/dns-message');} + else{const encoded=new URL(url).searchParams.get('dns');assert.ok(/^[A-Za-z0-9_-]+$/.test(encoded));assert.deepEqual(new Uint8Array(Buffer.from(encoded,'base64url')),expected.bytes);assert.equal(options.body,undefined);} + } +}); +test('HTTP errors/media/age/endpoint and oversized body never produce DNS success',async()=>{ + for(const response of [new Response('bad',{status:503}),new Response(packet(),{headers:{'content-type':'application/json'}}),new Response(packet(),{headers:{'content-type':'application/dns-message','age':'-1'}})])await assert.rejects(queryDnsMessage({name:'example.test',fetchImpl:async()=>response})); + for(const endpoint of ['http://resolver.test/dns-query','https://user:pass@resolver.test/dns-query','https://resolver.test/path#fragment'])await assert.rejects(queryDnsMessage({name:'example.test',endpoint,fetchImpl:()=>{throw Error('must not fetch');}})); + let cancelled=false;await assert.rejects(readBoundedDnsBytes(new Response(new ReadableStream({pull(c){c.enqueue(new Uint8Array(65536));},cancel(){cancelled=true;}}))),e=>e.code==='response-limit');assert.equal(cancelled,true); +}); +test('TXT bytes can cross UTF8 boundaries; ANY returns owner alias without chasing away answer',()=>{ + const result=decodeDnsResponse(packet({answers:[answer({data:[1,0xe2,2,0x82,0xac]})]}),expected); + assert.equal(result.selected[0].text,'€'); + const query=encodeDnsQuery('example.test','ANY'); + assert.equal(decodeDnsResponse(packet({query,answers:[answer({type:5,data:name('target.test')})]}),query).selected[0].type,5); +}); +test('default public resolver uses actual DNS-message; vendor JSON remains explicit',async()=>{ + const {DohResolver}=await import('../src/layer5-transport/index.js');let sent; + const resolver=new DohResolver({fetchImpl:async(url,options)=>{sent=options;return new Response(packet(),{headers:{'content-type':'application/dns-message'}});}}); + const result=await resolver.resolve('example.test','TXT');assert.equal(sent.headers['content-type'],'application/dns-message');assert.deepEqual(result.rawRecords,['hello']);assert.equal(result.cache_hit_inferred,false); +}); +test('SRV forbids target compression and OPT belongs only in Additional',()=>{ + const query=encodeDnsQuery('example.test','SRV'); + assert.throws(()=>decodeDnsResponse(packet({query,answers:[answer({type:33,data:[0,0,0,0,0,80,0xc0,0x0c]})]}),query),e=>e.code==='dns-name-compression-forbidden'); + reject(packet({answers:[answer({owner:[0],type:41,data:[],klass:4096})]}),'dns-opt-section'); + reject(packet({answers:[],authority:[answer({owner:[0],type:41,data:[],klass:4096})]}),'dns-opt-section'); +}); +test('negative CNAME result lifetime includes alias chain and hidden CORS Age is not zero evidence',async()=>{ + const soa=[...name('ns.test'),...name('mail.test'),...u32(1),...u32(2),...u32(3),...u32(4),...u32(30)]; + const data=packet({flags:0x8183,answers:[answer({type:5,ttl:1,data:name('target.test')})],authority:[answer({owner:name('test'),type:6,ttl:60,data:soa})]}); + assert.equal(decodeDnsResponse(data,expected).ttlSeconds,1); + const response=new Response(packet(),{headers:{'content-type':'application/dns-message'}});Object.defineProperty(response,'type',{value:'cors'}); + const result=await queryDnsMessage({name:'example.test',fetchImpl:async()=>response});assert.equal(result.selected.length,1);assert.equal(result.ttlSeconds,0);assert.equal(result.httpAgeObserved,false); +}); diff --git a/tests/effects-model.test.js b/tests/effects-model.test.js new file mode 100644 index 0000000..1da739f --- /dev/null +++ b/tests/effects-model.test.js @@ -0,0 +1,161 @@ +/** Finite refinement oracles and planted source defects, not compiler certification. */ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { cpSync, mkdtempSync, readFileSync, writeFileSync, rmSync } from 'node:fs'; +import { spawnSync } from 'node:child_process'; +import { tmpdir } from 'node:os'; +import { resolve, dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { model, MODEL_SOURCE, modelExecutionDigest } from '../src/layer1-uor/generated-model.js'; +import { dnsWriteState, dnsWriteOutcome, dnsLifecycle } from '../src/layer1-uor/effects.js'; +const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'); +const bytes = value => new TextEncoder().encode(value); +const tag = value => ({ tag: value, fields: [] }); +const call = (name, ...args) => model[`Stitch.Effects.${name}`](...args); +const scope = { zoneId: bytes('zone'), name: bytes('name.example'), authorityKey: bytes('pinned-key') }; +const candidate = { scope, pointerDigest: bytes('candidate'), previousDigest: bytes('previous'), hasPrevious: true, + revision: 2, validFrom: 10, validUntil: 20 }; +const publication = phase => ({ scope, phase: tag(phase), pointerDigest: bytes('candidate'), recordId: bytes('record-1'), hasRecordId: true }); +const read = { scope, candidateDigest: candidate.pointerDigest, complete: true, authenticated: true, recordPresent: true, + recordId: bytes('record-1'), pointerDigest: bytes('previous'), revision: 1 }; + +test('transport admissions exactly correlate current topic, local/remote identity, generation and live object facts', () => { + for (const closed of [false, true]) for (let generation = 0; generation < 3; generation++) + for (let callbackGeneration = 0; callbackGeneration < 3; callbackGeneration++) + for (const topic of ['mesh', 'mesh-other']) for (const local of ['local', 'local-other']) + for (const remote of ['remote', 'remote-other']) for (const entryCurrent of [false, true]) for (const channelCurrent of [false, true]) { + const state = { generation, closed, channelKey: bytes('mesh'), localPeer: bytes('local') }; + const callback = { generation: callbackGeneration, channelKey: bytes(topic), localPeer: bytes(local), remotePeer: bytes(remote) }; + const current = !closed && generation === callbackGeneration && topic === 'mesh' && local === 'local'; + assert.equal(call('transportSessionMatches', state, callback), current); + assert.equal(call('transportPeerCallbackAllowed', state, callback, bytes('remote'), entryCurrent), current && remote === 'remote' && entryCurrent); + assert.equal(call('transportChannelCallbackAllowed', state, callback, bytes('remote'), entryCurrent, channelCurrent), current && remote === 'remote' && entryCurrent && channelCurrent); + const reopened = call('transportOpen', call('transportClose', state), state.channelKey); + assert.equal(reopened.generation, BigInt(generation + 1)); + assert.equal(call('transportSessionMatches', reopened, { ...callback, generation }), false); + } +}); + +test('VM source reducers match an independent phase machine and never resurrect stale instances', () => { + for (const phase of ['Idle', 'Booting', 'Ready', 'Failed']) for (let generation = 0; generation < 3; generation++) + for (let observedGeneration = 0; observedGeneration < 3; observedGeneration++) for (const instanceCurrent of [false, true]) for (const ready of [false, true]) { + const state = { generation, phase: tag(phase) }, canonical = { ...state, generation: BigInt(generation) }; + const canBoot = phase === 'Idle' || phase === 'Failed', booting = phase === 'Booting', executable = phase === 'Ready'; + assert.equal(call('vmCanBoot', state), canBoot); + assert.equal(call('vmIsBooting', state), booting); + assert.equal(call('vmCanExecute', state), executable); + assert.deepEqual(call('vmStart', state), canBoot ? { generation: BigInt(generation + 1), phase: tag('Booting') } : canonical); + assert.equal(call('vmCallbackAllowed', state, observedGeneration, instanceCurrent), generation === observedGeneration && instanceCurrent && (booting || executable)); + assert.deepEqual(call('vmFail', state, observedGeneration), generation === observedGeneration && booting ? { generation: BigInt(generation + 1), phase: tag('Failed') } : canonical); + assert.deepEqual(call('vmObserveReady', state, observedGeneration, instanceCurrent, ready), generation === observedGeneration && booting && instanceCurrent && ready ? { generation: BigInt(generation), phase: tag('Ready') } : canonical); + } +}); + +test('C1 source progress rejects duplicate/out-of-order/window-mismatched probes and requires exact frozen qualification', () => { + for (let consecutive = 0; consecutive <= 12; consecutive++) for (const hasSequence of [false, true]) + for (let lastSequence = 0; lastSequence <= 2; lastSequence++) for (let sequence = 0; sequence <= 4; sequence++) + for (const now of [0, 1, 10000000, 10000001]) for (const correlated of [false, true]) { + const progress = { startedAt: 0, lastSequence, hasSequence, consecutive }; + const accepted = correlated && now <= 10000000 && (!hasSequence || lastSequence < sequence); + assert.equal(call('c1ProbeAccepted', progress, sequence, now, correlated), accepted); + const next = call('c1ObserveProbe', progress, sequence, now, correlated); + const count = accepted ? hasSequence && lastSequence + 1 === sequence ? consecutive + 1 : 1 : consecutive; + assert.equal(next.consecutive, BigInt(count)); + assert.equal(next.lastSequence, BigInt(accepted ? sequence : lastSequence)); + for (const ordered of [false, true]) for (const observed of [false, true]) for (const relay of [false, true]) { + assert.equal(call('c1ConnectionQualified', progress, now, ordered), ordered && consecutive >= 10 && now <= 10000000); + assert.equal(call('c1DirectSuccess', progress, now, ordered, observed, relay), ordered && consecutive >= 10 && now <= 10000000 && observed && !relay); + } + } +}); + +test('unresolved DNS reads never authorize create/update for any observation flag combination', () => { + for (const phase of ['Idle', 'Published', 'Refused', 'Unknown']) for (let flags = 0; flags < 32; flags++) { + const exact = !!(flags & 1), present = !!(flags & 2), predecessor = !!(flags & 4), bootstrap = !!(flags & 8), live = !!(flags & 16); + const expected = exact ? 'Reconciled' : phase === 'Unknown' ? 'Wait' + : !live ? 'Refuse' : present ? predecessor ? 'Update' : 'Refuse' : bootstrap ? 'Create' : 'Refuse'; + assert.equal(call('dnsSelectRead', tag(phase), exact, present, predecessor, bootstrap, live).tag, expected); + if (phase === 'Unknown') assert.equal(call('dnsDecisionWrites', tag(expected)), false); + } + for (const phase of ['Idle', 'Published', 'Refused', 'Unknown']) { + const state = publication(phase); + assert.equal(call('dnsReadDecision', state, candidate, read, 15).tag, phase === 'Unknown' ? 'Wait' : 'Update'); + assert.equal(call('dnsReadDecision', state, candidate, { ...read, pointerDigest: candidate.pointerDigest }, 100).tag, 'Reconciled'); + for (const field of ['zoneId', 'name', 'authorityKey']) { + const otherScope = { ...scope, [field]: bytes('wrong') }; + assert.equal(call('dnsRequestAllowed', { ...state, scope: otherScope }, candidate, false), false); + assert.equal(call('dnsReadDecision', state, candidate, { ...read, scope: otherScope }, 15).tag, 'Refuse'); + } + for (const observation of [{ ...read, complete: false }, { ...read, authenticated: false }, { ...read, recordId: bytes('record-2') }, { ...read, candidateDigest: bytes('another-candidate') }]) { + assert.equal(call('dnsReadDecision', state, candidate, observation, 15).tag, 'Refuse'); + } + assert.equal(call('dnsRequestAllowed', state, candidate, true), false); + } + assert.equal(call('dnsReadDecision', publication('Unknown'), { ...candidate, pointerDigest: bytes('different') }, read, 15).tag, 'Refuse'); + const initial = { ...publication('Idle'), hasRecordId: false, recordId: bytes('') }; + const absent = { ...read, recordPresent: false, authenticated: false, recordId: bytes('') }; + assert.equal(call('dnsReadDecision', initial, { ...candidate, hasPrevious: false, revision: 0 }, absent, 15).tag, 'Create'); + assert.equal(call('dnsReadDecision', initial, candidate, absent, 15).tag, 'Refuse'); + for (const now of [9, 20]) assert.equal(call('dnsReadDecision', publication('Published'), candidate, read, now).tag, 'Refuse'); +}); + +test('DNS completion consumes only matching scope/candidate and exact retained provider record ID', () => { + const state = publication('Unknown'), result = { scope, candidateDigest: candidate.pointerDigest, recordId: bytes('record-1'), recordIdValid: true, acknowledged: true, refused: false }; + assert.equal(call('dnsFinishWrite', state, result).phase.tag, 'Published'); + for (const field of ['zoneId', 'name', 'authorityKey']) { + assert.equal(call('dnsFinishWrite', state, { ...result, scope: { ...scope, [field]: bytes('wrong') } }).phase.tag, 'Unknown'); + } + for (const resultChange of [{ candidateDigest: bytes('wrong') }, { recordId: bytes('replacement-id') }, { recordIdValid: false }, { acknowledged: false }]) { + assert.equal(call('dnsFinishWrite', state, { ...result, ...resultChange }).phase.tag, 'Unknown'); + } + assert.equal(call('dnsFinishWrite', state, { ...result, acknowledged: false, refused: true }).phase.tag, 'Refused'); + assert.equal(call('dnsFinishWrite', state, { ...result, acknowledged: true, refused: true }).phase.tag, 'Unknown', 'contradictory observation must not enable a retry'); + assert.equal(call('dnsFinishWrite', publication('Published'), result).phase.tag, 'Published'); +}); + +test('DNS adapter cannot turn a Wait reducer no-op into write admission', () => { + const destination = { zoneId: 'zone', name: 'name.example', trustedAuthorityKey: 'key' }; + const pointer = { pointerDigest: 'candidate', previousDigest: null, revision: 0, validFromMs: 0, validUntilMs: 10 }; + const pending = { outcome: 'unknown', pointerDigest: 'candidate', recordId: null, candidate: pointer }; + assert.throws(() => dnsWriteState(destination, pending, pointer, null, null, 5), /refused DNS write admission/); + const begun = dnsWriteState(destination, undefined, pointer, null, null, 5); + assert.equal(begun.outcome, 'unknown'); + assert.equal(dnsWriteOutcome(destination, begun, { ok: true, outcome: 'published', id: 'new-record' }), 'published'); + assert.equal(dnsWriteOutcome(destination, { ...begun, recordId: 'old-record' }, { ok: true, outcome: 'published', id: 'new-record' }), 'unknown'); + assert.deepEqual(dnsLifecycle(pending), { outcome: 'unknown', recordId: null, pointerDigest: 'candidate', canPublish: false, canReconcile: true }); + assert.equal(dnsLifecycle(pending, true).canReconcile, false); +}); + +function mutatedRuntime(t, name, change, testFile) { + const directory = mkdtempSync(join(tmpdir(), `stitch-effects-${name}-`)); + t.after(() => rmSync(directory, { recursive: true, force: true })); + for (const path of ['app/src', 'app/language', 'src', 'scripts/check-model.mjs', `tests/${testFile}`]) cpSync(resolve(root, path), resolve(directory, path), { recursive: true }); + writeFileSync(resolve(directory, 'package.json'), '{"type":"module"}'); + const source = resolve(directory, 'app/src/Stitch/Effects.lex.tex'), before = readFileSync(source, 'utf8'), after = change(before); + assert.notEqual(after, before, name); writeFileSync(source, after); + const generated = spawnSync(process.execPath, ['scripts/check-model.mjs', '--write', '--inventory'], { cwd: directory, encoding: 'utf8', maxBuffer: 8 * 1024 * 1024 }); + assert.equal(generated.status, 0, generated.stderr); + const inventory = JSON.parse(generated.stdout); + assert.equal(inventory.executionDigest, modelExecutionDigest, 'host lifecycle policy is outside replay execution semantics'); + assert.notEqual(inventory.sourceDigest, MODEL_SOURCE.sourceDigest); + const environment = { ...process.env }; delete environment.NODE_TEST_CONTEXT; + const arguments_ = ['--test', '--test-reporter=tap', ...(name === 'stale-vm' ? ['--test-name-pattern=boot deadline'] : []), `tests/${testFile}`]; + const run = spawnSync(process.execPath, arguments_, { cwd: directory, encoding: 'utf8', timeout: 10000, env: environment }); + assert.equal(run.error, undefined, run.error?.message); + assert.notEqual(run.status, 0, `runtime regression suite survived source mutation ${name}\n${run.stdout}`); + assert.match(run.stdout, /fail [1-9]/); +} +const replaceBody = (source, name, body) => { + const start = source.indexOf(` name: ${name},`), begin = source.indexOf(' body:', start), end = source.indexOf('\n}', begin); + assert.ok(start >= 0 && begin > start && end > begin); + return source.slice(0, begin) + ` body: ${body}` + source.slice(end); +}; +for (const [name, change, testFile] of [ + ['stale-session', s => replaceBody(s, 'transportSessionMatches', 'true'), 'transport-generation.test.js'], + ['channel-replacement', s => replaceBody(s, 'transportChannelCallbackAllowed', '(transportPeerCallbackAllowed state callback remotePeer entryCurrent)'), 'transport-generation.test.js'], + ['concurrent-dns', s => replaceBody(s, 'dnsRequestAllowed', 'true'), 'dns-publication.test.js'], + ['repeat-unknown-dns', s => s.replace('| DnsPhase.Unknown => false)', '| DnsPhase.Unknown => true)'), 'dns-publication.test.js'], + ['stale-vm', s => replaceBody(s, 'vmCallbackAllowed', 'true'), 'vm-lifecycle.test.js'], + ['duplicate-boot', s => replaceBody(s, 'vmCanBoot', 'true'), 'vm-lifecycle.test.js'], + ['connection-window', s => replaceBody(s, 'c1ConnectionQualified', 'true'), 'connection-measurement.test.js'] +]) test(`actual runtime regression rejects source defect: ${name}`, t => mutatedRuntime(t, name, change, testFile)); diff --git a/tests/execution-identity.test.js b/tests/execution-identity.test.js new file mode 100644 index 0000000..b2919b2 --- /dev/null +++ b/tests/execution-identity.test.js @@ -0,0 +1,83 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { cpSync, mkdtempSync, readFileSync, writeFileSync, rmSync } from 'node:fs'; +import { spawnSync } from 'node:child_process'; +import { tmpdir } from 'node:os'; +import { dirname, resolve, join } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'); +function build(t, mutate = () => {}) { + const dir = mkdtempSync(join(tmpdir(), 'stitch-execution-identity-')); + t.after(() => rmSync(dir, { recursive: true, force: true })); + for (const path of ['scripts/check-model.mjs', 'app/src', 'app/language', 'src/layer1-uor', 'src/layer4-compute/replay.js']) { + cpSync(resolve(root, path), resolve(dir, path), { recursive: true }); + } + writeFileSync(resolve(dir, 'package.json'), '{"type":"module"}'); + mutate((path, change) => { + const target = resolve(dir, path), before = readFileSync(target, 'utf8'), after = change(before); + assert.notEqual(after, before, `mutation must change ${path}`); writeFileSync(target, after); + }); + const result = spawnSync(process.execPath, ['scripts/check-model.mjs', '--write', '--inventory'], { cwd: dir, encoding: 'utf8', maxBuffer: 8 * 1024 * 1024 }); + assert.equal(result.status, 0, result.stderr); + const check = spawnSync(process.execPath, ['scripts/check-model.mjs', '--check'], { cwd: dir, encoding: 'utf8' }); + assert.equal(check.status, 0, check.stderr); + return { dir, inventory: JSON.parse(result.stdout), runtime: () => import(pathToFileURL(resolve(dir, 'src/layer4-compute/replay.js')).href) }; +} +const program = { version: 1, bits: 8, initialValueHex: '0x0', instructions: [{ op: 2 }] }; + +test('execution closure identifies actual ring and checkpoint roots, interpreter and transitive adapters', t => { + const { inventory } = build(t); + assert.match(inventory.executionDigest, /^sha256:[a-f0-9]{64}$/); + assert.notEqual(inventory.executionDigest, inventory.sourceDigest); + assert.deepEqual(inventory.executionIdentity.roots, ["Stitch.Compute.checkpointLinkAllowed", "Stitch.Compute.instructionWork", "Stitch.Compute.ringStep", "Stitch.Compute.typedInstructionAllowed", "Stitch.Compute.typedInstructionWork", "Stitch.Compute.typedResultBits", "Stitch.Compute.typedStep"]); + assert.deepEqual(Object.keys(inventory.executionIdentity.definitions), ["Stitch.Compute.arithmeticWidth", "Stitch.Compute.binaryLength", "Stitch.Compute.binaryLengthAcc", "Stitch.Compute.bitwiseAcc", "Stitch.Compute.byteWidth", "Stitch.Compute.checkpointLinkAllowed", "Stitch.Compute.concatWords", "Stitch.Compute.instructionAllowed", "Stitch.Compute.instructionWork", "Stitch.Compute.natBitwise", "Stitch.Compute.naturalPower", "Stitch.Compute.normalize", "Stitch.Compute.operandWidth", "Stitch.Compute.powerWork", "Stitch.Compute.powerWorkAcc", "Stitch.Compute.ringModulus", "Stitch.Compute.ringPow", "Stitch.Compute.ringStep", "Stitch.Compute.typedInstructionAdmission", "Stitch.Compute.typedInstructionAllowed", "Stitch.Compute.typedInstructionWork", "Stitch.Compute.typedResultBits", "Stitch.Compute.typedStep"]); + assert.deepEqual(Object.keys(inventory.executionIdentity.types), ["Stitch.Compute.Instruction", "Stitch.Compute.TypedInstruction", "Stitch.Compute.Word"]); + assert.deepEqual(inventory.executionIdentity.adapterSources.map(s => s.path), [ + 'src/layer1-uor/contracts.js', 'src/layer1-uor/custody.js', 'src/layer1-uor/index.js', 'src/layer4-compute/replay.js' + ]); +}); + +test('source formatting, proof-only and unrelated product changes preserve replay compatibility but not provenance', async t => { + const base = build(t), baseline = await base.runtime(), checkpoint = await baseline.createCheckpoint(program, 1); + for (const mutate of [ + edit => edit('app/src/Stitch/Compute.lex.tex', s => s.replace(' name: ringStep,', ' name: ringStep,')), + edit => edit('app/src/Stitch/Compute.lex.tex', s => s.replace('proof: reflexivity{}', 'proof: simplify{definitions: [checkpointLinkAllowed]}')), + edit => edit('app/src/Product/Architecture.lex.tex', s => s.replace('Conditional recovery and honest assurance', 'Recovery and precise assurance')), + edit => edit('app/src/Stitch/Budget.lex.tex', s => s.replace('(reserved + cost)', '(reserved + (cost + 1))')) + ]) { + const changed = build(t, mutate); + assert.notEqual(changed.inventory.sourceDigest, base.inventory.sourceDigest); + assert.equal(changed.inventory.executionDigest, base.inventory.executionDigest); + const runtime = await changed.runtime(); + assert.equal((await runtime.verifyCheckpoint(program, checkpoint)).execution, 'replayed'); + assert.equal((await runtime.createCheckpoint(program, 1)).checkpointDigest, checkpoint.checkpointDigest); + } +}); + +test('reachable operation, normalization, interpreter primitive and adapter changes invalidate the execution root', async t => { + const base = build(t), baseline = await base.runtime(), checkpoint = await baseline.createCheckpoint(program, 1); + for (const mutate of [ + edit => edit('app/src/Stitch/Compute.lex.tex', s => s.replace('then (x + 1)', 'then (x + 2)')), + edit => edit('app/src/Stitch/Compute.lex.tex', s => s.replace('body: (prim remainder value modulus 0 : Nat)', 'body: (prim quotient value modulus 0 : Nat)')), + edit => edit('app/src/Stitch/Compute.lex.tex', s => s.replace('(ringPow (binaryLength modulus y) x y modulus 1)', '(ringPow (binaryLength modulus y) x y modulus 0)')), + edit => edit('app/src/Stitch/Compute.lex.tex', s => s.replace('value := ((prim multiply (project left value) (ringModulus (project right bits)) : Nat) + (project right value))', 'value := ((prim multiply (project right value) (ringModulus (project left bits)) : Nat) + (project left value))')), + edit => edit('app/src/Stitch/Compute.lex.tex', s => s.replace('body: (if ((project instruction opcode) =? 17) then (1 + (powerWork bits (project instruction argument))) else 1)', 'body: (if ((project instruction opcode) =? 17) then (2 + (powerWork bits (project instruction argument))) else 1)')), + + edit => edit('scripts/check-model.mjs', s => s.replace("case 'subtract':return a[0]>=a[1]?a[0]-a[1]:0n", "case 'subtract':return a[0]>=a[1]?a[0]+a[1]:0n")), + edit => edit('src/layer1-uor/contracts.js', s => s.replace('value.length > 34', 'value.length > 35')), + edit => edit('src/layer1-uor/index.js', s => s.replace('SUCC: 2,', 'SUCC: 20,')) + ]) { + const changed = build(t, mutate); + assert.notEqual(changed.inventory.executionDigest, base.inventory.executionDigest); + const runtime = await changed.runtime(); + await assert.rejects(runtime.verifyCheckpoint(program, checkpoint), error => ['checkpoint-model', 'unsupported-operation'].includes(error.code)); + } +}); + +test('legacy whole-source roots and arbitrary execution roots are not implicitly trusted', async t => { + const base = build(t), runtime = await base.runtime(), checkpoint = await runtime.createCheckpoint(program, 1); + for (const modelDigest of [base.inventory.sourceDigest, 'sha256:' + '0'.repeat(64)]) { + await assert.rejects(runtime.verifyCheckpoint(program, { ...checkpoint, modelDigest }), error => error.code === 'checkpoint-model'); + } +}); diff --git a/tests/fixtures/custody-vectors.json b/tests/fixtures/custody-vectors.json new file mode 100644 index 0000000..a5e36bb --- /dev/null +++ b/tests/fixtures/custody-vectors.json @@ -0,0 +1,630 @@ +{ + "version": 1, + "hashFrame": "UTF8(stitch//v1\\0)||uint64be(length)||payload", + "vectors": [ + { + "name": "empty", + "objectHex": "", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:fb7900812ac6cc8ce7460a52714a0431cf55593738c0c16ddbee146eecb26b2f", + "byteLength": 0 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:d5f766a783a1746261ba2f11189efc674e57ecbf138e5ec9e5cdb19629209e31", + "byteLength": 0, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 0, + "digests": [ + "sha256:2c6c6991fa87488bf741a07b47913f534fc4fb5f9410c3adf5eff8a876382440", + "sha256:3525c2284eb297e9e5442685b72d96880c672e54dc2cd5758e938f9f5bdbd1ef", + "sha256:670e56cbfebe05ee008d9531996090fc395bf7dfe634613bdb67f70af4dcbce4" + ] + }, + "manifestDigest": "sha256:cf3f1729162d8d260972c627f0524dc05887334aaf520722b9dd9bdb857645d6" + }, + "fragments": [ + { + "index": 0, + "hex": "" + }, + { + "index": 1, + "hex": "" + }, + { + "index": 2, + "hex": "" + } + ] + }, + { + "name": "one-zero", + "objectHex": "00", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:47ba360bb38a129bbd7502593271cf768eb46262639fbb40eae8cc67bc9790f0", + "byteLength": 1 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:b2a111bdb732cb1694e8c8dd8acb679696f079bd1185259f2b26683818359109", + "byteLength": 1, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 1, + "digests": [ + "sha256:6edb5d20728b51bd1f61775e37f0e4927526e1a70c8baa06a6afc35f76dbf3b1", + "sha256:55b2e52474e1958d307405507260b4c2d6c1ccafc95a138caaa64743a3b8a618", + "sha256:8b2bcaa5c5e21d8cfdd790e050c58d8c4becbb95e58f93e5aa03b47ed8d6896d" + ] + }, + "manifestDigest": "sha256:cbd002eceb6529a65efa2bd0ac6309c6840e69e95a18d0b0d1d4886789761714" + }, + "fragments": [ + { + "index": 0, + "hex": "00" + }, + { + "index": 1, + "hex": "00" + }, + { + "index": 2, + "hex": "00" + } + ] + }, + { + "name": "odd", + "objectHex": "000102feff", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:cdeb0dd11e52d0b86881d0177d1a5eff89af057cf53c456e6bd4c2dab3398c15", + "byteLength": 5 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:415c1ca228ee32c009ccb4576151c15477337611a021cb40a4ae9af066187ac9", + "byteLength": 5, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 3, + "digests": [ + "sha256:ea5989082be0c6c1853f2a3cb4511d0d2d887772be703ee79ee4197d64646efb", + "sha256:985047eea867404d82188c11e746595a4b6becbc23711a8ce0e5c20fb18b0458", + "sha256:e956d96e47e3d1eadb4852212bec8bfa21fddb8988ba83854a83ca9b94437f95" + ] + }, + "manifestDigest": "sha256:8a4e95da7a2ba851196fe4fba81239454b627f61d3690af9cd84e84c48a28faa" + }, + "fragments": [ + { + "index": 0, + "hex": "000102" + }, + { + "index": 1, + "hex": "feff00" + }, + { + "index": 2, + "hex": "fefe02" + } + ] + }, + { + "name": "even", + "objectHex": "00010203feff", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:c503995fc94f30e7e2dba8ef09ef37b5cd822a44db86bccdd2b68f40b310d1f0", + "byteLength": 6 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:4834367dab8f51e5bb97c54b78945ce6e381ccf327d23d668f2652c502778575", + "byteLength": 6, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 3, + "digests": [ + "sha256:208610ffed1fab27d6e45c0664c9eba03f5e01f1f97d9173629614cecdceded2", + "sha256:28fc4c36bf9dfc1b2d919c2e3dd069b1cbf2324bc9b34923a6ca02b8a915546b", + "sha256:6d005d68c3d2a3d46958d36fb2787e86788eb6bfc5de37df44a95ded46e02cdc" + ] + }, + "manifestDigest": "sha256:3c3fe38823160b8d82078e494ed157f526d5d90a73444e0a26946f1fd4c8bfd9" + }, + "fragments": [ + { + "index": 0, + "hex": "000102" + }, + { + "index": 1, + "hex": "03feff" + }, + { + "index": 2, + "hex": "03fffd" + } + ] + }, + { + "name": "utf8", + "objectHex": "53746974636820e2988320f09fa7b5", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:234a5751accf72f5a6bfd0da002a24d6ad8840a4e97f265dcf2836337762e63a", + "byteLength": 15 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:1cea149117f4a73dae21c799a3b48cf5f683fad2fe9805710615e3b2496c04ca", + "byteLength": 15, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 8, + "digests": [ + "sha256:69a86c23b2dd6ab8e4a67af66a3d5a3b4aa0536913c116ee308a4be59f8c908a", + "sha256:45db8cb4888f2cd25f9b3dd14ee72d8e635bd23dec99298704b149ba591bb08d", + "sha256:deda57a02ebed1edbb51d839001a48c4bd35934cf32e036fbd5e8df1072262c5" + ] + }, + "manifestDigest": "sha256:63bde6c53d4f955e175ac8408ceeab9f75e7a9164507a0f84f3e3d994da1a975" + }, + "fragments": [ + { + "index": 0, + "hex": "53746974636820e2" + }, + { + "index": 1, + "hex": "988320f09fa7b500" + }, + { + "index": 2, + "hex": "cbf74984fccf95e2" + } + ] + }, + { + "name": "all-bytes", + "objectHex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:ab0b506a7d86340c4c9967f35b5efc0b4006143faa0291476f0389bd709571a4", + "byteLength": 256 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:b53fdb4a800b598b11996ce7187aafc4b449802a1c223d0d2bf8f8a51abece95", + "byteLength": 256, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 128, + "digests": [ + "sha256:becfa4b6c8f8cdf4ca0104b8a4a5a00c27fae386006d0ded786de78c40734fdd", + "sha256:e077d67e31ed9d9eb1114822dc1abebbf908637f9066da0a3dcbeb70140ecf8d", + "sha256:0db3f3aa1e290e3970e5741cda2f43c4afb2955a11aec70b51f0b39ddf7ac67a" + ] + }, + "manifestDigest": "sha256:427841c818a690f8f7452b6877ab1abb89d06251093f169a4f8ed84041cc563e" + }, + "fragments": [ + { + "index": 0, + "hex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f" + }, + { + "index": 1, + "hex": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff" + }, + { + "index": 2, + "hex": "8080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080" + } + ] + } + ], + "invalidVectors": [ + { + "name": "duplicate-index", + "expectedError": "DuplicateFragment", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:bba24bd4136f657619a38cd64b28fac23988c1afe98691b94ec79c15c04c8b1a", + "byteLength": 3 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:8d3df33ebc100287071f696f2bfe4a10ee6ce75b647e4c2b91f7d289bbc0e1b3", + "byteLength": 3, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 2, + "digests": [ + "sha256:04e61628aaef709f0b17cc1cc016732e6d3220d5e19b8d7db03ffbb4dc3b631f", + "sha256:99752783f64b911a220a0fb36ad7a03b631d17203fc42e759d71d70c2743c222", + "sha256:28d245f2dd41fc7f96cbe80f9ba21485a02060889ca6e3f79274ef241080aedb" + ] + }, + "manifestDigest": "sha256:aa702ddfe916aeafb8e6778526ad061f63b05c477c8a75318db5b26861d1eaa5" + }, + "fragments": [ + { + "index": 0, + "hex": "0102" + }, + { + "index": 0, + "hex": "0102" + } + ] + }, + { + "name": "missing-fragment", + "expectedError": "InsufficientFragments", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:bba24bd4136f657619a38cd64b28fac23988c1afe98691b94ec79c15c04c8b1a", + "byteLength": 3 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:8d3df33ebc100287071f696f2bfe4a10ee6ce75b647e4c2b91f7d289bbc0e1b3", + "byteLength": 3, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 2, + "digests": [ + "sha256:04e61628aaef709f0b17cc1cc016732e6d3220d5e19b8d7db03ffbb4dc3b631f", + "sha256:99752783f64b911a220a0fb36ad7a03b631d17203fc42e759d71d70c2743c222", + "sha256:28d245f2dd41fc7f96cbe80f9ba21485a02060889ca6e3f79274ef241080aedb" + ] + }, + "manifestDigest": "sha256:aa702ddfe916aeafb8e6778526ad061f63b05c477c8a75318db5b26861d1eaa5" + }, + "fragments": [ + { + "index": 0, + "hex": "0102" + } + ] + }, + { + "name": "truncated-object-digest", + "expectedError": "InvalidDigest", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:bba24bd4136f65761", + "byteLength": 3 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:8d3df33ebc100287071f696f2bfe4a10ee6ce75b647e4c2b91f7d289bbc0e1b3", + "byteLength": 3, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 2, + "digests": [ + "sha256:04e61628aaef709f0b17cc1cc016732e6d3220d5e19b8d7db03ffbb4dc3b631f", + "sha256:99752783f64b911a220a0fb36ad7a03b631d17203fc42e759d71d70c2743c222", + "sha256:28d245f2dd41fc7f96cbe80f9ba21485a02060889ca6e3f79274ef241080aedb" + ] + }, + "manifestDigest": "sha256:aa702ddfe916aeafb8e6778526ad061f63b05c477c8a75318db5b26861d1eaa5" + }, + "fragments": [ + { + "index": 0, + "hex": "0102" + }, + { + "index": 1, + "hex": "0300" + } + ] + }, + { + "name": "undeclared-external-basis", + "expectedError": "InvalidSchema", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:bba24bd4136f657619a38cd64b28fac23988c1afe98691b94ec79c15c04c8b1a", + "byteLength": 3 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:8d3df33ebc100287071f696f2bfe4a10ee6ce75b647e4c2b91f7d289bbc0e1b3", + "byteLength": 3, + "dependencies": [ + "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + ] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 2, + "digests": [ + "sha256:04e61628aaef709f0b17cc1cc016732e6d3220d5e19b8d7db03ffbb4dc3b631f", + "sha256:99752783f64b911a220a0fb36ad7a03b631d17203fc42e759d71d70c2743c222", + "sha256:28d245f2dd41fc7f96cbe80f9ba21485a02060889ca6e3f79274ef241080aedb" + ] + }, + "manifestDigest": "sha256:aa702ddfe916aeafb8e6778526ad061f63b05c477c8a75318db5b26861d1eaa5" + }, + "fragments": [ + { + "index": 0, + "hex": "0102" + }, + { + "index": 1, + "hex": "0300" + } + ] + }, + { + "name": "forged-fragment", + "expectedError": "FragmentDigestMismatch", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:bba24bd4136f657619a38cd64b28fac23988c1afe98691b94ec79c15c04c8b1a", + "byteLength": 3 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:8d3df33ebc100287071f696f2bfe4a10ee6ce75b647e4c2b91f7d289bbc0e1b3", + "byteLength": 3, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 2, + "digests": [ + "sha256:04e61628aaef709f0b17cc1cc016732e6d3220d5e19b8d7db03ffbb4dc3b631f", + "sha256:99752783f64b911a220a0fb36ad7a03b631d17203fc42e759d71d70c2743c222", + "sha256:28d245f2dd41fc7f96cbe80f9ba21485a02060889ca6e3f79274ef241080aedb" + ] + }, + "manifestDigest": "sha256:aa702ddfe916aeafb8e6778526ad061f63b05c477c8a75318db5b26861d1eaa5" + }, + "fragments": [ + { + "index": 0, + "hex": "0002" + }, + { + "index": 1, + "hex": "0300" + } + ] + }, + { + "name": "inconsistent-absent-fragment", + "expectedError": "InvalidParity", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:bba24bd4136f657619a38cd64b28fac23988c1afe98691b94ec79c15c04c8b1a", + "byteLength": 3 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:8d3df33ebc100287071f696f2bfe4a10ee6ce75b647e4c2b91f7d289bbc0e1b3", + "byteLength": 3, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 2, + "digests": [ + "sha256:04e61628aaef709f0b17cc1cc016732e6d3220d5e19b8d7db03ffbb4dc3b631f", + "sha256:99752783f64b911a220a0fb36ad7a03b631d17203fc42e759d71d70c2743c222", + "sha256:0000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "manifestDigest": "sha256:2591b87b547c0acf153e11e0f3d8d1f2c85e0768e3534f3cbe0d319796a1ff92" + }, + "fragments": [ + { + "index": 0, + "hex": "0102" + }, + { + "index": 1, + "hex": "0300" + } + ] + }, + { + "name": "nonzero-padding", + "expectedError": "InvalidPadding", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:bba24bd4136f657619a38cd64b28fac23988c1afe98691b94ec79c15c04c8b1a", + "byteLength": 3 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:8d3df33ebc100287071f696f2bfe4a10ee6ce75b647e4c2b91f7d289bbc0e1b3", + "byteLength": 3, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 2, + "digests": [ + "sha256:04e61628aaef709f0b17cc1cc016732e6d3220d5e19b8d7db03ffbb4dc3b631f", + "sha256:4d49fb0500587743b23331951dbc3594371488ff32d9bc31400287c2bf06255e", + "sha256:e22676912370357868ed11c08b7013c8ab4d0e85cc3165d31b2f74379a682cbc" + ] + }, + "manifestDigest": "sha256:1fb5ca67c308bac26362925f1e83b6fd857bb3a49fc667840cd25dfbe4a1d0fb" + }, + "fragments": [ + { + "index": 0, + "hex": "0102" + }, + { + "index": 1, + "hex": "0307" + } + ] + }, + { + "name": "object-does-not-match", + "expectedError": "ObjectDigestMismatch", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "byteLength": 3 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:8d3df33ebc100287071f696f2bfe4a10ee6ce75b647e4c2b91f7d289bbc0e1b3", + "byteLength": 3, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 2, + "digests": [ + "sha256:04e61628aaef709f0b17cc1cc016732e6d3220d5e19b8d7db03ffbb4dc3b631f", + "sha256:99752783f64b911a220a0fb36ad7a03b631d17203fc42e759d71d70c2743c222", + "sha256:28d245f2dd41fc7f96cbe80f9ba21485a02060889ca6e3f79274ef241080aedb" + ] + }, + "manifestDigest": "sha256:9f3795df3f926c0a06b88087c1f7248574281fe0eb4a5319569e2d60b0be03dd" + }, + "fragments": [ + { + "index": 0, + "hex": "0102" + }, + { + "index": 1, + "hex": "0300" + } + ] + }, + { + "name": "encoding-does-not-match", + "expectedError": "EncodingDigestMismatch", + "manifest": { + "version": 1, + "object": { + "digestAlgorithm": "sha256", + "contentDigest": "sha256:bba24bd4136f657619a38cd64b28fac23988c1afe98691b94ec79c15c04c8b1a", + "byteLength": 3 + }, + "encoding": { + "format": "raw", + "encodingDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "byteLength": 3, + "dependencies": [] + }, + "fragments": { + "scheme": "xor-2-of-3", + "threshold": 2, + "count": 3, + "byteLength": 2, + "digests": [ + "sha256:4923c96cc1c8aa51ffcc0c984945dcac5bed0a4fa5dc90225683443c295caa56", + "sha256:575d3f8511847b809d64779a3e977558f04c0685e2a4dd2066402ec47386a19e", + "sha256:5870c7040547df66144782d022330c64581424232d0df712a9f6e91135479d77" + ] + }, + "manifestDigest": "sha256:7e218f8139e4abc87c73ab001ae3672cc05cb1229ad7cc1ac24cc5eda4be3dca" + }, + "fragments": [ + { + "index": 0, + "hex": "0102" + }, + { + "index": 1, + "hex": "0300" + } + ] + } + ] +} diff --git a/tests/guest-qualification.test.js b/tests/guest-qualification.test.js new file mode 100644 index 0000000..ee1d1b8 --- /dev/null +++ b/tests/guest-qualification.test.js @@ -0,0 +1,11 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { guestShellReady } from '../vendor/guest/qualification-protocol.mjs'; +test('waits for an actual line-start root shell prompt, not kernel banner bytes', () => { + for (const text of ['Linux version 6.18.7 #', 'Linux version 6.18.7 #1', 'kernel # ', '\n#', '\nlog # ']) { + assert.equal(guestShellReady(text), false, text); + } + for (const text of ['# ', '\r\n# ', '\n/ # ', '\n/tmp # ']) { + assert.equal(guestShellReady(text), true, text); + } +}); diff --git a/tests/helpers/transactional-authority.js b/tests/helpers/transactional-authority.js new file mode 100644 index 0000000..ea7329c --- /dev/null +++ b/tests/helpers/transactional-authority.js @@ -0,0 +1,25 @@ +// Isolated synthetic transaction boundary. This is not browser IndexedDB qualification. +import { BrowserAuthorityStore } from '../../src/layer1-uor/browser-authority.js'; +export class SyntheticAuthorityStore extends BrowserAuthorityStore { + constructor(state = { records: new Map(), tail: Promise.resolve() }) { super(); this.state = state; this.fail = false; this.count = 0; } + exclusiveAuthority(work) { return this.exclusivePublication("origin-lifecycle", work); } + exclusivePublication(scope, work) { + scope = "origin-lifecycle"; + this.state.locks ??= new Map(); + const result = (this.state.locks.get(scope) ?? Promise.resolve()).then(work); + this.state.locks.set(scope, result.catch(() => {})); return result; + } + records() { return this.state.tail.then(() => structuredClone([...this.state.records])); } + transactionMany(keys, change) { + const result = this.state.tail.then(() => { + const values = new Map(keys.map(key => [key, structuredClone(this.state.records.get(key))])); + const update = change(values); + this.count++; + if (this.fail === true || this.fail === this.count) throw Error('synthetic quota abort'); + for (const [key, value] of update.writes ?? []) this.state.records.set(key, structuredClone(value)); + for (const key of update.deletes ?? []) this.state.records.delete(key); + return structuredClone(update.result); + }); + this.state.tail = result.catch(() => {}); return result; + } +} diff --git a/tests/helpers/vm-filesystem.js b/tests/helpers/vm-filesystem.js new file mode 100644 index 0000000..b02132e --- /dev/null +++ b/tests/helpers/vm-filesystem.js @@ -0,0 +1,29 @@ +/** Deliberately small local v86 filesystem double, with allocations visible to tests. */ +export function filesystemFixture() { + const fs = { + inodes: [{ size: 0, mode: 0x4000, direntries: new Map() }], inodedata: {}, mounts: [], allocations: [], reads: [], + CreateInode() { return { size: 0, mode: 0x8000, direntries: new Map() }; }, + link_under_dir(parent, id, name) { this.inodes[parent].direntries.set(name, id); }, + CreateFile(name, parent) { const id = this.inodes.length; this.inodes.push(this.CreateInode()); this.link_under_dir(parent, id, name); return id; }, + SearchPath(name) { return { id: this.inodes[0].direntries.get(name) ?? -1 }; }, + GetInode(id) { return this.inodes[id]; }, + async Read(id, offset, length) { this.reads.push({ id, offset, length }); return this.inodedata[id]?.subarray(offset, offset + length) ?? new Uint8Array(0); }, + async ChangeSize(id, size) { this.allocations.push(size); this.inodedata[id] = new Uint8Array(size); this.inodes[id].size = size; }, + async CreateBinaryFile(name, parent, bytes) { + const id = this.CreateFile(name, parent); this.allocations.push(bytes.length); + this.inodedata[id] = bytes.slice(); this.inodes[id].size = bytes.length; return id; + }, + async CreateTextFile(name, parent, text) { + const id = this.CreateFile(name, parent); this.allocations.push(text.length); + this.inodedata[id] = new TextEncoder().encode(text); this.inodes[id].size = text.length; return id; + }, + FillDirectory(id) { + const size = [...this.inodes[id].direntries.keys()].reduce((sum, name) => sum + 24 + new TextEncoder().encode(name).length, 0); + this.allocations.push(size); this.inodedata[id] = new Uint8Array(size); this.inodes[id].size = size; + }, + setResult(name, bytes) { + const id = this.CreateFile(name, 0); this.inodedata[id] = bytes; this.inodes[id].size = bytes.length; return id; + } + }; + return fs; +} diff --git a/tests/operator-ui.test.js b/tests/operator-ui.test.js new file mode 100644 index 0000000..565f9af --- /dev/null +++ b/tests/operator-ui.test.js @@ -0,0 +1,22 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; +const html = readFileSync(new URL('../index.html', import.meta.url), 'utf8'); + +test('every operator input has a persistent visible associated label, not only a placeholder', () => { + for (const match of html.matchAll(/<(?:input|textarea|select)\b[^>]*\bid="([^"]+)"[^>]*>/g)) { + assert.match(html, new RegExp(`]*\\bfor="${match[1]}"[^>]*>[^<]*\\S`), match[1]); + } +}); + +test('instructions, stdout text alternative and contextual result regions exist outside the VM canvas', () => { + for (const id of ['objectInputHelp', 'jobInputHelp', 'vmCommandHelp', 'pointerScopeHelp', 'providerTokenHelp', 'pointerAdmissionHelp', 'recoverySelectionHelp']) { + assert.match(html, new RegExp(`id="${id}"`), id); + assert.match(html, new RegExp(`aria-describedby="[^"]*${id}`), id); + } + assert.match(html, /]*id="vmStdoutText"[^>]*tabindex="0"/); + assert.match(html, /id="vmStdoutSummary"[^>]*role="status"/); + for (const id of ['mesh', 'objects', 'compute', 'vm', 'pointers', 'resources']) { + assert.match(html, new RegExp(`id="${id}ActionStatus"[^>]*role="status"`), id); + } +}); diff --git a/tests/placement-repair.test.js b/tests/placement-repair.test.js new file mode 100644 index 0000000..9b672a6 --- /dev/null +++ b/tests/placement-repair.test.js @@ -0,0 +1,316 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { LiveUorMeshDatabase } from '../src/layer3-storage/index.js'; +import { reserveNetwork, ResourceAdmission } from '../src/layer2-schedulers/policy.js'; +import { createObject, placementStatus } from '../src/layer3-storage/custody.js'; +import { model } from '../src/layer1-uor/generated-model.js'; +import { experienceFacts, experienceActionAllowed } from '../src/product-experience.js'; + +function network() { + const nodes = [], sent = [], withheld = []; + let filter = () => true; + const node = (peerId, admission) => { + const n = { peerId, peers: new Map(), admission, + openPeers() { return [...this.peers].map(([remoteId, p]) => ({ remoteId, dc: p.route })); }, + sendToPeer(remoteId, packet) { + const p = this.peers.get(remoteId); + if (!p) return false; + if (this.admission) reserveNetwork(this.admission, 'place', packet); + const envelope = { from: this.peerId, to: remoteId, packet: structuredClone(packet) }; + sent.push(envelope); + if (filter(envelope)) p.node.db.handleMeshMessage(this.peerId, envelope.packet); + else withheld.push(envelope); + return true; + }, + broadcast(packet) { for (const id of this.peers.keys()) this.sendToPeer(id, packet); }, + }; + if (!admission) delete n.admission; + n.db = new LiveUorMeshDatabase({ transport: n }); nodes.push(n); return n; + }; + const connect = (a, b) => { a.peers.set(b.peerId, { node: b, route: {} }); b.peers.set(a.peerId, { node: a, route: {} }); }; + const disconnect = (a, b) => { a.peers.delete(b.peerId); b.peers.delete(a.peerId); }; + const drain = async () => { for (let i = 0; i < 12; i++) await Promise.all(nodes.map(n => n.db.flush())); }; + return { node, connect, disconnect, drain, sent, withheld, filter: f => { filter = f; } }; +} +const shards = (n, from) => n.sent.filter(e => e.from === from && e.packet.type === 'uor_shard' && e.packet.purpose === 'placement'); +const summary = (n, entry) => n.db.placementSummary(entry.addressHex); +const state = (n, entry) => n.db.placements.get(entry.addressHex); +const setup = async () => { + const n = network(), writer = n.node('writer'), holders = [0, 1, 2].map(i => n.node(`h${i}`)); + for (const h of holders) n.connect(writer, h); + const entry = await writer.db.put('exact retained object'); await n.drain(); + return { n, writer, holders, entry }; +}; + +test('pre-join store and repeated store place retained bytes after peers join without fabricating writer shards', async () => { + const n = network(), writer = n.node('writer'); + const entry = await writer.db.put('stored before joining'); + assert.equal(summary(writer, entry).committedFragments, 0); + assert.equal(shards(n, 'writer').length, 0); + const holders = [0, 1, 2].map(i => n.node(`h${i}`)); + for (const h of holders) n.connect(writer, h); + assert.equal(await writer.db.put('stored before joining'), entry); + await n.drain(); + assert.equal(summary(writer, entry).committedFragments, 3); + assert.deepEqual([...entry.heldIndices], []); + assert.equal(shards(n, 'writer').length, 3); + await writer.db.repairPlacement(entry.addressHex); await n.drain(); + assert.equal(shards(n, 'writer').length, 3, 'a complete repair is idempotent'); + await writer.db.clearLocal(); + const reader = n.node('reader'); n.connect(reader, holders[0]); n.connect(reader, holders[1]); + await reader.db.syncFromNetwork(); await n.drain(); + assert.equal(reader.db.get(entry.addressHex).text, 'stored before joining'); +}); + +test('partial placement fills only missing indices and holder loss retains unknown old copies until exact release', async () => { + const n = network(), writer = n.node('writer'), h0 = n.node('h0'); n.connect(writer, h0); + const entry = await writer.db.put('partial then churn'); await n.drain(); + const h1 = n.node('h1'), h2 = n.node('h2'); n.connect(writer, h1); n.connect(writer, h2); + await writer.db.repairPlacement(entry.addressHex); await n.drain(); + assert.equal(shards(n, 'writer').length, 3); assert.equal(summary(writer, entry).committedFragments, 3); + n.disconnect(writer, h0); + assert.equal(summary(writer, entry).committedFragments, 2, 'a current lease is not current reachability'); + const replacement = n.node('replacement'); n.connect(writer, replacement); + await writer.db.repairPlacement(entry.addressHex); await n.drain(); + assert.equal(summary(writer, entry).committedFragments, 3); + assert.equal(summary(writer, entry).assertedCopies, 4, 'disconnection never proves deletion'); + assert.equal(state(writer, entry).copies.find(c => c.holder === 'h0').status, 'superseded'); + assert.deepEqual([...replacement.db.objects.get(entry.addressHex).heldIndices], [0]); + n.connect(writer, h0); + await writer.db.repairPlacement(entry.addressHex); await n.drain(); + assert.equal(summary(writer, entry).assertedCopies, 3); + assert.deepEqual([...h0.db.objects.get(entry.addressHex).heldIndices], []); + assert.equal(h0.db.objects.get(entry.addressHex).shards[0], null); +}); + +test('live migration keeps old custody through an unknown transfer and retires only after fresh receipt and exact release ACK', async t => { + let now = 1000; t.mock.method(Date, 'now', () => now); + const { n, writer, holders, entry } = await setup(); + const target = n.node('target'); n.connect(writer, target); + writer.db.demoPlacementLeaseMs = 10; + n.filter(e => !(e.from === 'target' && e.packet.type === 'uor_shard_ack')); + await writer.db.repairPlacement(entry.addressHex, { replaceHolder: 'h0' }); await n.drain(); + const request = state(writer, entry).requests.at(-1); + assert.equal(request.fromRequestId, state(writer, entry).copies.find(c => c.holder === 'h0').requestId); + assert.equal(summary(writer, entry).committedFragments, 3); + assert.equal(summary(writer, entry).requestedTransfers, 1); + const before = shards(n, 'writer').length; + await writer.db.repairPlacement(entry.addressHex, { replaceHolder: 'h0' }); await n.drain(); + assert.equal(shards(n, 'writer').length, before, 'no blind repeat of an unexpired unknown request'); + // Force only this transfer's lease observation to expire; original custody stays live. + now = request.leaseExpiresAt; + await writer.db.repairPlacement(entry.addressHex); await n.drain(); + assert.equal(state(writer, entry).requests.find(r => r.requestId === request.requestId).status, 'uncertain'); + assert.equal(summary(writer, entry).committedFragments, 3); + n.filter(() => true); writer.db.demoPlacementLeaseMs = 60000; + await writer.db.repairPlacement(entry.addressHex, { replaceHolder: 'h0' }); await n.drain(); + assert.equal(summary(writer, entry).committedFragments, 3); + assert.equal(summary(writer, entry).uncertainTransfers, 1); + assert.equal(summary(writer, entry).assertedCopies, 3); + assert.equal(state(writer, entry).copies.some(c => c.holder === 'h0'), false); + assert.equal(holders[0].db.objects.get(entry.addressHex).shards[0], null); +}); + +test('all expired leases can renew at the same three holders, preserving assertions until fresh checks and not inflating copies', async t => { + let now = 1000; t.mock.method(Date, 'now', () => now); + const { n, writer, entry } = await setup(); + now += 60000; + assert.equal(summary(writer, entry).committedFragments, 0); + n.filter(e => e.packet.type !== 'uor_shard_ack'); + await writer.db.repairPlacement(entry.addressHex); await n.drain(); + assert.equal(summary(writer, entry).committedFragments, 0); + assert.equal(summary(writer, entry).assertedCopies, 3, 'expired physical assertions stay accounted'); + assert.equal(summary(writer, entry).requestedTransfers, 3); + n.filter(() => true); + for (const e of n.withheld) await writer.db.handleMeshMessage(e.from, e.packet); + await n.drain(); + assert.equal(summary(writer, entry).committedFragments, 3); + assert.equal(summary(writer, entry).assertedCopies, 3); + assert.equal(state(writer, entry).requests.length, 6); +}); + +test('forged, stale, replayed and wrong-route receipts cannot establish custody or release the old source', async t => { + let now = 1000; t.mock.method(Date, 'now', () => now); + const n = network(), writer = n.node('writer'), holder = n.node('holder'); n.connect(writer, holder); + n.filter(e => e.packet.type !== 'uor_shard_ack'); + const entry = await writer.db.put('receipts'); await n.drain(); + const ack = n.withheld[0].packet; + for (const change of [{ holder: 'other' }, { manifestDigest: 'sha256:' + '0'.repeat(64) }, { fragmentDigest: 'sha256:' + '0'.repeat(64) }, + { index: 1 }, { requestId: 'unknown' }, { leaseExpiresAt: ack.leaseExpiresAt + 1 }]) { + assert.equal(await writer.db.handleMeshMessage('holder', { ...ack, ...change }), false); + assert.equal(summary(writer, entry).committedFragments, 0); + } + now = ack.leaseExpiresAt; + assert.equal(await writer.db.handleMeshMessage('holder', ack), false); + assert.equal(summary(writer, entry).uncertainTransfers, 1); + n.filter(() => true); + await writer.db.repairPlacement(entry.addressHex); await n.drain(); + assert.equal(summary(writer, entry).committedFragments, 1); + assert.equal(await writer.db.handleMeshMessage('holder', ack), false); + assert.equal(summary(writer, entry).committedFragments, 1); + await holder.db.clearLocal(); n.connect(writer, holder); // same route ID, different data channel and empty RAM + assert.equal(summary(writer, entry).committedFragments, 0); + await writer.db.repairPlacement(entry.addressHex); await n.drain(); + assert.equal(summary(writer, entry).committedFragments, 1); + assert.equal(summary(writer, entry).assertedCopies, 1); +}); + +test('epoch replacement cannot activate an old migration even when reservation IDs repeat, and charges remain retained', async () => { + let clock = 0, active = new ResourceAdmission({ clock: () => clock, durationMs: 100 }); + const prior = active; + const admission = { get state() { return active.state; }, reserve: (...args) => active.reserve(...args), + reservationCurrent: (...args) => active.reservationCurrent(...args) }; + const n = network(), writer = n.node('writer', admission), holders = [0, 1, 2].map(i => n.node(`h${i}`)); + for (const h of holders) n.connect(writer, h); + const entry = await writer.db.put('epoch bound migration'); await n.drain(); + const target = n.node('target'); n.connect(writer, target); + n.filter(e => !(e.from === 'target' && e.packet.type === 'uor_shard_ack')); + await writer.db.repairPlacement(entry.addressHex, { replaceHolder: 'h0' }); await n.drain(); + const old = n.withheld[0].packet, spent = prior.state.spent; + active = new ResourceAdmission({ clock: () => clock, durationMs: 100 }); + assert.notEqual(active.state.epoch, prior.state.epoch); + assert.equal(await writer.db.handleMeshMessage('target', old), false); + assert.equal(summary(writer, entry).committedFragments, 3); + assert.equal(summary(writer, entry).uncertainTransfers, 1); + assert.equal(state(writer, entry).copies.find(c => c.holder === 'h0').status, 'committed'); + assert.deepEqual(prior.state.spent, spent); + n.filter(() => true); + await writer.db.repairPlacement(entry.addressHex, { replaceHolder: 'h0' }); await n.drain(); + assert.equal(summary(writer, entry).committedFragments, 3); + assert.equal(state(writer, entry).copies.some(c => c.holder === 'h0'), false); + clock = 100; + await assert.rejects(writer.db.repairPlacement(entry.addressHex), e => e.code === 'epoch-expired'); +}); + +test('lost release ACK retains superseded copies and exact retry never deletes a newer assignment', async t => { + let now = 1000; t.mock.method(Date, 'now', () => now); + const { n, writer, holders, entry } = await setup(); + const target = n.node('target'); n.connect(writer, target); + writer.db.releaseAckTimeoutMs = 100; + n.filter(e => e.packet.type !== 'uor_shard_release_ack'); + await writer.db.repairPlacement(entry.addressHex, { replaceHolder: 'h0' }); await n.drain(); + assert.equal(summary(writer, entry).assertedCopies, 4); + assert.equal(summary(writer, entry).pendingReleases, 1); + assert.equal(holders[0].db.objects.get(entry.addressHex).shards[0], null); + const oldRelease = n.sent.find(e => e.packet.type === 'uor_shard_release').packet; + // An exact lost-ACK release retry is safe and can establish known release. + now += 100; n.filter(() => true); + await writer.db.repairPlacement(entry.addressHex); await n.drain(); + assert.equal(summary(writer, entry).assertedCopies, 3); + // Moving back creates a new exact assignment, so the earlier release is stale. + writer.db.demoPlacementLeaseMs = 60000; + await writer.db.repairPlacement(entry.addressHex, { replaceHolder: 'target' }); await n.drain(); + const held = holders[0].db.objects.get(entry.addressHex); + assert.equal(held.heldIndices.has(0), true); + assert.equal(await holders[0].db.handleMeshMessage('writer', oldRelease), false); + assert.equal(held.heldIndices.has(0), true); + assert.ok(held.shards[0]); +}); + +test('repair requires exact retained verified bytes and every source activation condition', async () => { + const n = network(), writer = n.node('writer'); + const bundle = await createObject(new TextEncoder().encode('partial only')); + await assert.rejects(writer.db.repairPlacement(bundle.manifest.object.contentDigest), e => e.code === 'MissingObject'); + const entry = await writer.db.put('original'); entry.bytes[0] ^= 1; + await assert.rejects(writer.db.repairPlacement(entry.addressHex), e => e.code === 'ManifestDigestMismatch'); + await writer.db.put('original'); + assert.equal(writer.db.get(entry.addressHex).text, 'original', 'repeated Store restores a complete newly checked local copy'); + for (let mask = 0; mask < 16; mask++) { + const flags = [0, 1, 2, 3].map(i => Boolean(mask & (1 << i))); + assert.equal(model['Stitch.Custody.activationAllowed'](...flags), mask === 15); + } + for (let mask = 0; mask < 8; mask++) { + const facts = experienceFacts({ placementObjectSelected: Boolean(mask & 1), peersReachable: Boolean(mask & 2), policyBlocked: Boolean(mask & 4) }); + assert.equal(experienceActionAllowed('repairPlacementBtn', facts), mask === 3); + } +}); + +test('failed or ambiguous migration sends never replace old custody or refund their real reservation', async () => { + for (const outcome of ['failed', 'uncertain']) { + const { n, writer, entry } = await setup(); + const target = n.node('target'); n.connect(writer, target); + const send = writer.sendToPeer.bind(writer); + writer.sendToPeer = (id, packet) => { + if (id !== 'target' || packet.purpose !== 'placement') return send(id, packet); + if (outcome === 'uncertain') throw Error('unknown send outcome'); + return false; + }; + const spent = writer.db.admission.state.spent; + await writer.db.repairPlacement(entry.addressHex, { replaceHolder: 'h0' }); await n.drain(); + assert.equal(state(writer, entry).requests.at(-1).status, outcome); + assert.equal(summary(writer, entry).committedFragments, 3); + assert.equal(state(writer, entry).copies.find(c => c.holder === 'h0').status, 'committed'); + assert.ok(writer.db.admission.state.spent.storageBytes > spent.storageBytes); + assert.ok(writer.db.admission.state.spent.requests >= spent.requests); + } +}); + +test('mismatched or stale release ACKs cannot hide retained copies and old releases cannot remove another writer claim', async () => { + const { n, writer, holders, entry } = await setup(); + const target = n.node('target'); n.connect(writer, target); + n.filter(e => e.packet.type !== 'uor_shard_release_ack'); + await writer.db.repairPlacement(entry.addressHex, { replaceHolder: 'h0' }); await n.drain(); + const ack = n.withheld.find(e => e.packet.type === 'uor_shard_release_ack').packet; + for (const change of [{ requestId: 'unrelated' }, { index: 1 }, { manifestDigest: 'sha256:' + '0'.repeat(64) }, { holder: 'other' }, { releaseId: 'unrelated' }]) { + assert.equal(await writer.db.handleMeshMessage('h0', { ...ack, ...change }), false); + assert.equal(summary(writer, entry).assertedCopies, 4); + } + assert.equal(await writer.db.handleMeshMessage('other', ack), false); + // A second writer's assignment remains a live local fragment even after the + // first writer's exact claim is released; physical absence is not inferred. + const second = n.node('second'); n.connect(second, holders[0]); n.filter(() => true); + await second.db.put('exact retained object'); await n.drain(); + const release = n.sent.find(e => e.packet.type === 'uor_shard_release').packet; + assert.equal(await holders[0].db.handleMeshMessage('writer', release), true); + await n.drain(); + assert.equal(holders[0].db.objects.get(entry.addressHex).heldIndices.has(0), true); + assert.ok(holders[0].db.objects.get(entry.addressHex).shards[0]); +}); + +test('route and epoch changes while crypto awaits cannot publish tentative migration or retire its source', async t => { + for (const phase of ['receipt-route', 'commit-epoch']) { + const { n, writer, entry } = await setup(); + const target = n.node('target'); n.connect(writer, target); + n.filter(e => !(e.from === 'target' && e.packet.type === 'uor_shard_ack')); + await writer.db.repairPlacement(entry.addressHex, { replaceHolder: 'h0' }); await n.drain(); + const ack = n.withheld[0].packet, priorAdmission = writer.db.admission, spent = priorAdmission.state.spent; + const digest = crypto.subtle.digest.bind(crypto.subtle); + let entered, release, held = false; + const atBoundary = new Promise(resolve => { entered = resolve; }); + const continueCrypto = new Promise(resolve => { release = resolve; }); + t.mock.method(crypto.subtle, 'digest', async (...args) => { + const result = await digest(...args); + const request = state(writer, entry).requests.find(r => r.requestId === ack.requestId); + if (!held && (phase === 'receipt-route' || request.status === 'acknowledged')) { + held = true; entered(); await continueCrypto; + } + return result; + }); + const work = writer.db.handleMeshMessage('target', ack); + await atBoundary; + if (phase === 'receipt-route') n.connect(writer, target); + else writer.db.admission = new ResourceAdmission(); + release(); + assert.equal(await work, false); + t.mock.restoreAll(); await n.drain(); + assert.equal(summary(writer, entry).committedFragments, 3); + assert.equal(state(writer, entry).copies.find(c => c.holder === 'h0').status, 'committed'); + assert.equal(state(writer, entry).requests.find(r => r.requestId === ack.requestId).status, 'uncertain'); + assert.equal(state(writer, entry).copies.find(c => c.holder === 'target').status, 'superseded'); + assert.equal(n.sent.some(e => e.packet.type === 'uor_shard_release'), false); + assert.deepEqual(priorAdmission.state.spent, spent); + } +}); + + +test('placement clock regression refuses before dispatch and keeps original custody history', async t => { + let now = 1000; t.mock.method(Date, 'now', () => now); + const { n, writer, entry } = await setup(); + const target = n.node('target'); n.connect(writer, target); + const history = state(writer, entry), sent = n.sent.length; + now = 999; + assert.throws(() => summary(writer, entry), e => e.code === 'ClockRegression'); + await assert.rejects(writer.db.repairPlacement(entry.addressHex, { replaceHolder: 'h0' }), e => e.code === 'ClockRegression'); + assert.deepEqual(state(writer, entry), history); + assert.equal(n.sent.length, sent); +}); diff --git a/tests/pointer-recovery.test.js b/tests/pointer-recovery.test.js new file mode 100644 index 0000000..f39dd1e --- /dev/null +++ b/tests/pointer-recovery.test.js @@ -0,0 +1,133 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { RecoveryVault, exportRecoveryBundle } from '../src/recovery.js'; +import { generateAuthority, signPointer, PointerObserver } from '../src/layer1-uor/pointer.js'; +import { model } from '../src/layer1-uor/generated-model.js'; +const root = c => `sha256:${c.repeat(64)}`; +async function fixture() { + const authority = await generateAuthority(); + let now = 20, reservations = 0; + const body = { version: 1, name: 'state.example', authorityKey: authority.publicKey, + revision: 7, previousDigest: root('a'), objectRoot: root('b'), validFromMs: 10, validUntilMs: 100 }; + const sign = patch => signPointer({ ...body, ...patch }, authority.privateKey); + const anchor = await sign({}); + const vault = new RecoveryVault(); + const importAnchor = async pointer => vault.import(await exportRecoveryBundle({ version: 1, objects: [], jobs: [], anchors: [pointer] })); + const accept = (pointer = anchor) => vault.acceptRecentAnchor({ name: body.name, authorityKey: authority.publicKey, + expectedDigest: pointer.pointerDigest, nowMs: now, operatorAccepted: true }); + const observer = () => new PointerObserver({ name: body.name, trustedAuthorityKey: authority.publicKey, + clock: () => now, admission: { reserve() { reservations++; } } }); + await importAnchor(anchor); + return { authority, anchor, vault, sign, accept, observer, importAnchor, now: value => { now = value; }, reservations: () => reservations }; +} +const restore = (observer, f, options = {}) => observer.restoreFromRecovery(f.vault, { expectedDigest: f.anchor.pointerDigest, ...options }); +function delayVerification(t) { + let release, entered, first = true; + const gate = new Promise(resolve => { release = resolve; }); + const reached = new Promise(resolve => { entered = resolve; }); + const original = crypto.subtle.verify.bind(crypto.subtle); + t.mock.method(crypto.subtle, 'verify', async (...args) => { + if (first) { first = false; entered(); await gate; } + return original(...args); + }); + return { release, reached }; +} + +test('source restore guard refuses missing trust, every wrong scope/digest/signature observation, expiry and any different head', () => { + const allowed = (...args) => model['Stitch.Pointer.restoreAllowed'](...args); + const good = [true, true, true, true, 10, 100, 20, false, false]; + assert.equal(allowed(...good), true); + for (const index of [0, 1, 2, 3]) { const bad = [...good]; bad[index] = false; assert.equal(allowed(...bad), false); } + assert.equal(allowed(true, true, true, true, 10, 100, 9, false, false), false); + assert.equal(allowed(true, true, true, true, 10, 100, 100, false, false), false); + assert.equal(allowed(true, true, true, true, 10, 100, 20, true, false), false); + assert.equal(allowed(true, true, true, true, 10, 100, 20, true, true), true); + for (let mask = 0; mask < 64; mask++) for (const now of [9, 10, 99, 100]) { + const [accepted, scope, digest, signature, present, same] = Array.from({ length: 6 }, (_, i) => Boolean(mask & (1 << i))); + assert.equal(allowed(accepted, scope, digest, signature, 10, 100, now, present, same), + accepted && scope && digest && signature && 10 <= now && now < 100 && (!present || same)); + } +}); + +test('import, acceptance and explicit exact-scope live restore are separate; normal strict succession then works', async () => { + const f = await fixture(), observer = f.observer(); + await assert.rejects(observer.admit(f.anchor), /pointer-bootstrap/); + await assert.rejects(restore(observer, f), /anchor-not-accepted/); + assert.equal(observer.head, null); + await f.accept(); assert.equal(observer.head, null); + assert.deepEqual(await restore(observer, f), f.anchor); + const next = await f.sign({ revision: 8, previousDigest: f.anchor.pointerDigest }); + assert.deepEqual(await observer.admit(next), next); + for (const pointer of [f.anchor, await f.sign({ revision: 10 }), await f.sign({ revision: 9, previousDigest: root('e') })]) { + await assert.rejects(observer.admit(pointer), /pointer-conflict/); assert.deepEqual(observer.head, next); + } + await assert.rejects(restore(observer, f), /pointer-restore-conflict-or-stale/); assert.deepEqual(observer.head, next); + const restartedVault = new RecoveryVault(); await restartedVault.import(await f.vault.export()); + await assert.rejects(f.observer().restoreFromRecovery(restartedVault, { expectedDigest: f.anchor.pointerDigest }), /anchor-not-accepted/); +}); + +test('only a branded vault accepted decision qualifies, pins cannot change and mismatched scope/digest refuses', async () => { + const f = await fixture(); await f.accept(); const observer = f.observer(); + for (const fake of [f.vault.snapshot(), { acceptedAnchor: () => f.anchor }]) { + await assert.rejects(observer.restoreFromRecovery(fake, { expectedDigest: f.anchor.pointerDigest })); + } + await assert.rejects(restore(observer, f, { expectedDigest: root('e') }), /anchor-not-accepted/); + for (const options of [{ name: 'other', trustedAuthorityKey: f.authority.publicKey }, + { name: f.anchor.name, trustedAuthorityKey: (await generateAuthority()).publicKey }]) { + await assert.rejects(restore(new PointerObserver(options), f), /anchor-not-accepted/); + } + assert.throws(() => { observer.name = 'other'; }, TypeError); + assert.throws(() => { observer.trustedAuthorityKey = '0'.repeat(64); }, TypeError); + const changed = f.vault.snapshot(); changed.acceptedAnchors[0].revision = 999; + assert.deepEqual(await restore(observer, f), f.anchor); +}); + +test('no different retained head is overwritten, even by an independently accepted newer anchor', async () => { + const f = await fixture(); await f.accept(); const observer = f.observer(); + const genesis = await f.sign({ revision: 0, previousDigest: null }); await observer.admit(genesis); + await assert.rejects(restore(observer, f), /pointer-restore-conflict-or-stale/); + assert.deepEqual(observer.head, genesis); assert.equal(f.reservations(), 1); +}); + +test('duplicate restore is storage-idempotent and restore/admit share serialized CAS in either order', async () => { + const f = await fixture(); await f.accept(); let observer = f.observer(); + assert.deepEqual(await Promise.all([restore(observer, f), restore(observer, f)]), [f.anchor, f.anchor]); + assert.equal(f.reservations(), 1); + const next = await f.sign({ revision: 8, previousDigest: f.anchor.pointerDigest }); + observer = f.observer(); + const forward = await Promise.allSettled([restore(observer, f), observer.admit(next)]); + assert.deepEqual(forward.map(r => r.status), ['fulfilled', 'fulfilled']); assert.deepEqual(observer.head, next); + observer = f.observer(); + const reverse = await Promise.allSettled([observer.admit(next), restore(observer, f)]); + assert.deepEqual(reverse.map(r => r.status), ['rejected', 'fulfilled']); assert.deepEqual(observer.head, f.anchor); + observer = f.observer(); const genesis = await f.sign({ revision: 0, previousDigest: null }); + const retainedFirst = await Promise.allSettled([observer.admit(genesis), restore(observer, f)]); + assert.deepEqual(retainedFirst.map(r => r.status), ['fulfilled', 'rejected']); assert.deepEqual(observer.head, genesis); +}); + +test('expiry is sampled after async verification; a failed attempt does not poison the queue', async t => { + const f = await fixture(); await f.accept(); const observer = f.observer(), gate = delayVerification(t); + const pending = restore(observer, f); await gate.reached; f.now(100); gate.release(); + await assert.rejects(pending, /pointer-restore-conflict-or-stale/); assert.equal(observer.head, null); + f.now(20); assert.deepEqual(await restore(observer, f), f.anchor); +}); + +test('a concurrently replaced acceptance and canceled UI scope cannot commit stale restoration', async t => { + const f = await fixture(); await f.accept(); const observer = f.observer(), gate = delayVerification(t); + const pending = restore(observer, f); await gate.reached; + const newer = await f.sign({ revision: 8, previousDigest: f.anchor.pointerDigest }); + await f.importAnchor(newer); await f.accept(newer); gate.release(); + await assert.rejects(pending, /anchor-not-accepted/); assert.equal(observer.head, null); + await assert.rejects(observer.restoreFromRecovery(f.vault, { expectedDigest: newer.pointerDigest, scopeStillCurrent: () => false }), /pointer-restore-conflict-or-stale/); + assert.equal(observer.head, null); +}); + +test('restore rechecks actual signature and local resource refusal preserves missing head', async t => { + const f = await fixture(); await f.accept(); + const observer = f.observer(); + const verification = t.mock.method(crypto.subtle, 'verify', async () => false); + await assert.rejects(restore(observer, f), /pointer-signature/); assert.equal(observer.head, null); verification.mock.restore(); + const refused = new PointerObserver({ name: f.anchor.name, trustedAuthorityKey: f.authority.publicKey, + clock: () => 20, admission: { reserve() { throw Error('budget-exhausted'); } } }); + await assert.rejects(restore(refused, f), /budget-exhausted/); assert.equal(refused.head, null); +}); diff --git a/tests/primitive-operations.test.js b/tests/primitive-operations.test.js new file mode 100644 index 0000000..ad09130 --- /dev/null +++ b/tests/primitive-operations.test.js @@ -0,0 +1,146 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { Datum, PrimitiveOp, applyPrimitiveOp } from '../src/layer1-uor/index.js'; +import { model, modelExecutionDigest } from '../src/layer1-uor/generated-model.js'; +import { createCheckpoint, replayProgram, resumeProgram, verifyCheckpoint, validateProgram, programWork, MAX_TERM_BITS, MAX_PROGRAM_WORK } from '../src/layer4-compute/replay.js'; +import { canonicalBytes, sha256Bytes } from '../src/layer1-uor/custody.js'; +import { ResourceAdmission } from '../src/layer2-schedulers/policy.js'; +const call = (name, ...args) => model['Stitch.Compute.' + name](...args); +const hex = n => '0x' + n.toString(16); +const code = expected => e => e.code === expected; +// Independent left-to-right modular exponent oracle, including every exponent +// bit above 64. Never computes the unbounded integer x**exponent. +function pow(base, exponent, bits) { + const mask = (1n << BigInt(bits)) - 1n; + let value = 1n; + for (const digit of exponent.toString(2)) { value = value * value & mask; if (digit === '1') value = value * base & mask; } + return value; +} +const typed = (instructions, { bits = 16, capacityBits = 128, initialValueHex = '0xabcd' } = {}) => ({ version: 2, bits, capacityBits, initialValueHex, instructions }); +const arg = (op, argBits, argument) => ({ op, argBits, argHex: hex(BigInt(argument)) }); +const admission = computeSteps => new ResourceAdmission({ clock: () => 1, durationMs: 1000, + limit: { requests: 100, transferBytes: 1000000, storageBytes: 1000000, computeSteps } }); + +test('POW conforms to pinned UOR 0.5.2 overflow, zero-unit and full-width exponent rules', () => { + // Upstream foundation/tests/behavior_adr_053_ring_axis_completion.rs. + for (const [a, b, expected] of [[2n, 8n, 0n], [3n, 5n, 243n], [5n, 4n, 113n], [0n, 0n, 1n]]) { + assert.equal(applyPrimitiveOp(17, Datum.w8(a), Datum.w8(b)).value, expected); + assert.equal(call('ringStep', { opcode: 17, argument: b }, a, 256n), expected); + } + for (const bits of [8, 16, 32, 64, 128]) { + const m = 1n << BigInt(bits), values = [0n, 1n, 2n, 3n, m / 2n + 3n, m - 1n]; + for (const a of values) for (const b of values) { + const expected = pow(a, b, bits); + assert.equal(applyPrimitiveOp(17, new Datum(bits, a), new Datum(bits, b)).value, expected); + assert.equal(call('ringStep', { opcode: 17, argument: b }, a, m), expected); + } + const program = { version: 1, bits, initialValueHex: '0x3', instructions: [{ op: 17, argHex: hex(m - 1n) }] }; + assert.equal(replayProgram(program).stateHex, hex(pow(3n, m - 1n, bits))); + assert.equal(programWork(program), 1 + 2 * bits); + } + // A high exponent whose low64 bits are zero must not be mistaken for 0. + assert.equal(call('ringStep', { opcode: 17, argument: 1n << 100n }, 2n, 1n << 128n), 0n); + assert.equal(call('ringStep', { opcode: 17, argument: 1n << 100n }, 3n, 1n << 128n), 54740098937849875961756722746384973825n); +}); + +test('CONCAT appends big-endian term bytes, retaining widths and leading zero bytes', () => { + // Upstream behavior_catamorphism_evaluator.rs: abcd⧺1234 -> abcd1234. + const result = applyPrimitiveOp(14, Datum.w16(0xabcd), Datum.w16(0x1234)); + assert.equal(result.bits, 32); assert.equal(result.value, 0xabcd1234n); + assert.deepEqual([...result.toBytes()], [0x34, 0x12, 0xcd, 0xab]); // legacy coordinate encoding stays LE + const program = typed([arg(14, 16, 0x1234), arg(14, 8, 0), arg(14, 24, 1)]); + assert.deepEqual(replayProgram(program), { stepIndex: 3, stateBits: 64, stateHex: '0xabcd123400000001' }); + assert.deepEqual(replayProgram(typed([arg(14, 16, 1)], { bits: 8, initialValueHex: '0x0' })), { stepIndex: 1, stateBits: 24, stateHex: '0x1' }); + for (let bits = 8; bits < 128; bits += 8) { + const p = typed([arg(14, 8, 0)], { bits, initialValueHex: '0x1' }); + assert.equal(replayProgram(p).stateBits, bits + 8); + assert.equal(replayProgram(p).stateHex, '0x100'); + } + assert.throws(() => applyPrimitiveOp(14, new Datum(128, 1), Datum.w8(2)), RangeError); + assert.throws(() => applyPrimitiveOp(14, Datum.w8(1)), TypeError); + assert.throws(() => validateProgram({ version: 1, bits: 8, initialValueHex: '0x1', instructions: [{ op: 14, argHex: '0x2' }] }), code('unsupported-operation')); +}); + +test('empty byte sequences are CONCAT identities and keep their exact 0-bit width', () => { + const empty = { bits: 0, capacityBits: 0, initialValueHex: '0x0' }; + assert.deepEqual(replayProgram(typed([arg(14, 0, 0)], empty)), { stepIndex: 1, stateBits: 0, stateHex: '0x0' }); + assert.deepEqual(replayProgram(typed([arg(14, 16, 1)], { ...empty, capacityBits: 16 })), { stepIndex: 1, stateBits: 16, stateHex: '0x1' }); + assert.deepEqual(replayProgram(typed([arg(14, 0, 0)])), { stepIndex: 1, stateBits: 16, stateHex: '0xabcd' }); + assert.deepEqual(replayProgram(typed([{ op: 2 }], { ...empty, capacityBits: 8 })), { stepIndex: 1, stateBits: 8, stateHex: '0x1' }); + assert.throws(() => validateProgram(typed([], { ...empty, initialValueHex: '0x1' })), code('invalid-ring-value')); +}); + +test('version 2 follows width-parametric term arithmetic and byte-sized comparisons', () => { + assert.deepEqual(replayProgram(typed([arg(4, 24, 0xffffff)], { bits: 8, initialValueHex: '0x2' })), { stepIndex: 1, stateBits: 24, stateHex: '0x1' }); + const p = typed([arg(14, 8, 0xff), arg(10, 32, 0xffffff), arg(14, 32, 0x12345678)]); + assert.deepEqual(replayProgram(p), { stepIndex: 3, stateBits: 40, stateHex: '0x112345678' }); + for (const op of [15, 16]) { + assert.throws(() => validateProgram(typed([arg(op, 16, 0)])), code('invalid-typed-operation')); + assert.equal(replayProgram({ version: 1, bits: 8, initialValueHex: '0xa', instructions: [{ op, argHex: '0x0' }] }).stateHex, '0x0'); + } + for (const bits of [24, 40, 72, 120, 136]) { + const cap = Math.max(256, bits), x = (1n << BigInt(bits)) - 3n; + for (const op of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17]) { + const instruction = op < 4 ? { op } : arg(op, bits, 3); + const p = typed([instruction], { bits, capacityBits: cap, initialValueHex: hex(x) }); + const expected = op === 17 ? pow(x, 3n, bits) : call('ringStep', { opcode: op, argument: op < 4 ? 0 : 3 }, x, 1n << BigInt(bits)); + assert.equal(replayProgram(p).stateHex, hex(expected)); + assert.equal(replayProgram(p).stateBits, op >= 10 && op <= 13 ? 8 : bits); + } + } +}); + +test('version 2 checkpoints bind exact width, input, capacity, predecessor and execution semantics', async () => { + const p = typed([arg(14, 8, 0), arg(17, 24, 3), arg(14, 16, 1)]); + for (let step = 0; step <= p.instructions.length; step++) { + const cp = await createCheckpoint(p, step); + assert.equal(cp.version, 2); assert.equal(cp.modelDigest, modelExecutionDigest); + assert.equal((await verifyCheckpoint(p, cp)).execution, 'replayed'); + const resumed = await resumeProgram(p, cp); + assert.equal(resumed.stateHex, replayProgram(p).stateHex); assert.equal(resumed.stateBits, replayProgram(p).stateBits); + if (step) { + const prev = await createCheckpoint(p, step - 1), next = await createCheckpoint(p, step, prev); + assert.equal((await verifyCheckpoint(p, next, prev)).predecessor, 'checked'); + } + const forged = { ...cp, stateBits: cp.stateBits + 8 }; delete forged.checkpointDigest; + forged.checkpointDigest = await sha256Bytes(canonicalBytes(forged), 'checkpoint'); + await assert.rejects(verifyCheckpoint(p, forged), code('checkpoint-replay')); + await assert.rejects(verifyCheckpoint({ ...p, capacityBits: 256 }, cp), code('program-mismatch')); + await assert.rejects(verifyCheckpoint(p, { ...cp, modelDigest: 'sha256:' + '0'.repeat(64) }), code('checkpoint-model')); + await assert.rejects(verifyCheckpoint(p, { ...cp, version: 1 }), code('unsupported-checkpoint')); + } +}); + +test('abstract work accounts multiplication rounds and bytes before evaluation and resume', async () => { + const p = typed([arg(14, 8, 0), arg(17, 24, 3)]); + assert.equal(programWork(p), 4 + 5); // concat writes 3 bytes, pow 3 uses 4 modular multiplications + const policy = admission(8); + assert.throws(() => replayProgram(p, 2, policy), code('budget-exhausted')); + assert.equal(policy.state.spent.computeSteps, 0); + const enough = admission(9); replayProgram(p, 2, enough); assert.equal(enough.state.spent.computeSteps, 9); + const cp = await createCheckpoint(p, 1), resumed = admission(9); + await resumeProgram(p, cp, { admission: resumed }); assert.equal(resumed.state.spent.computeSteps, 9); + const zero = typed([arg(17, 16, 0)]); assert.equal(programWork(zero), 1); + const exp = (1n << 128n) - 1n, wide = typed([arg(17, 128, exp)], { bits: 128, initialValueHex: '0x3' }); + assert.equal(programWork(wide), 1 + 4 * 256); +}); + +test('maximum declared capacity executes without stack growth; hostile size/work is refused', () => { + const all = (1n << BigInt(MAX_TERM_BITS)) - 1n; + const concat = typed([arg(14, MAX_TERM_BITS - 8, 1)], { bits: 8, capacityBits: MAX_TERM_BITS, initialValueHex: '0x1' }); + const r = replayProgram(concat); assert.equal(r.stateBits, MAX_TERM_BITS); assert.equal(BigInt(r.stateHex), (1n << BigInt(MAX_TERM_BITS - 8)) + 1n); + const xor = typed([arg(7, MAX_TERM_BITS, all)], { bits: MAX_TERM_BITS, capacityBits: MAX_TERM_BITS, initialValueHex: hex(all) }); + assert.equal(replayProgram(xor).stateHex, '0x0'); assert.equal(programWork(xor), 1 + MAX_TERM_BITS); + const hostile = typed([arg(17, MAX_TERM_BITS, all)], { bits: MAX_TERM_BITS, capacityBits: MAX_TERM_BITS, initialValueHex: '0x3' }); + assert.throws(() => validateProgram(hostile), code('program-work-limit')); + // Test the source tail-recursive power primitive at maximum bit length without + // permitting an undercharged program. No unbounded exponent integer is built. + assert.equal(call('ringPow', MAX_TERM_BITS, 0, all, 1n << BigInt(MAX_TERM_BITS), 1), 0n); + assert.throws(() => validateProgram({ ...concat, capacityBits: MAX_TERM_BITS + 8 }), code('invalid-integer')); + assert.throws(() => validateProgram(typed([arg(14, 8, 1)], { bits: 128, capacityBits: 128, initialValueHex: '0x0' })), code('invalid-typed-operation')); + assert.throws(() => validateProgram(typed([arg(14, 7, 1)])), code('unsupported-width')); + assert.throws(() => validateProgram(typed([{ op: 14, argBits: 16, argHex: '0x10000' } ])), code('invalid-ring-value')); + assert.throws(() => validateProgram(typed([{ op: 14, argBits: 16, argHex: '0x00' } ])), code('invalid-ring-value')); + assert.throws(() => validateProgram(typed(new Array(1025).fill({ op: 2 }))), code('program-limit')); + assert.ok(MAX_PROGRAM_WORK < Number.MAX_SAFE_INTEGER); +}); diff --git a/tests/product-experience.test.js b/tests/product-experience.test.js new file mode 100644 index 0000000..8417a12 --- /dev/null +++ b/tests/product-experience.test.js @@ -0,0 +1,238 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { createHash } from 'node:crypto'; +import { cpSync, mkdtempSync, readFileSync, writeFileSync, rmSync } from 'node:fs'; +import { spawnSync } from 'node:child_process'; +import { tmpdir } from 'node:os'; +import { resolve } from 'node:path'; +import { pathToFileURL } from 'node:url'; +import { model } from '../src/layer1-uor/generated-model.js'; +import { operatorJourneys, operatorActions, experienceFacts, experienceView, experienceActionAllowed, + createOperatorExperience, experienceProvenance } from '../src/product-experience.js'; +const call = (name, ...args) => model[`Product.Experience.${name}`](...args); +const root = resolve(import.meta.dirname, '..'); + +function dom() { + const elements = new Map(); + function element() { + let text = ''; + return { attributes: {}, style: {}, listeners: {}, children: [], writes: 0, + get textContent() { return text; }, set textContent(value) { text = value; this.writes++; }, + set innerHTML(_) { throw Error('Experience must use safe text nodes'); }, + setAttribute(name, value) { this.attributes[name] = String(value); }, + addEventListener(name, callback) { this.listeners[name] = callback; }, + replaceChildren(...children) { this.children = children; }, + focus(options) { this.focused = options; }, scrollIntoView(options) { this.scrolled = options; } }; + } + return { elements, createElement: element, getElementById(id) { + if (!elements.has(id)) elements.set(id, element()); return elements.get(id); + } }; +} + +test('actual browser controls, journey targets and source provenance cover projected Experience', () => { + const html = readFileSync(resolve(root, 'index.html'), 'utf8'); + assert.deepEqual(operatorJourneys.map(j => j.id), ['mesh', 'objects', 'compute', 'vm', 'pointers', 'resources']); + assert.equal(new Set(operatorActions.map(a => a.code)).size, operatorActions.length); + for (const journey of operatorJourneys) { + for (const id of [journey.target, `${journey.id}Title`, `${journey.id}Evidence`]) assert.ok(html.includes(`id="${id}"`), id); + } + for (const action of operatorActions) { + assert.ok(html.includes(`id="${action.control}"`), action.control); + const recoveryAdapter = readFileSync(resolve(root, 'src/recovery-ui.js'), 'utf8'); + assert.ok(html.includes(`bindModelAction('${action.control}',`) || + (recoveryAdapter.includes(`bind('${action.control}',`) && recoveryAdapter.includes('bindModelAction(id,')), action.control); + } + const digest = createHash('sha256').update(readFileSync(resolve(root, experienceProvenance.source))).digest('hex'); + assert.equal(experienceProvenance.sourceSha256, digest); + assert.match(experienceProvenance.assurance, /not whole-host/); +}); + +test('model evidence separates local integrity, conditional placement, pure replay and host effects', () => { + const facts = experienceFacts(); + assert.equal(experienceView('objects', facts).id, 'objectsEmpty'); + assert.equal(experienceView('objects', { ...facts, hasPartial: true }).id, 'objectsPartial'); + assert.equal(experienceView('objects', { ...facts, hasObject: true }).id, 'objectsLocal'); + assert.match(experienceView('objects', { ...facts, hasObject: true, recoverablePlacement: true }).detail, /truthful, reachable/); + assert.equal(experienceView('compute', { ...facts, unfinishedJobs: true }).id, 'computeUnverified'); + assert.equal(experienceView('compute', { ...facts, unfinishedJobs: true, replayedJobs: true }).id, 'computeReplay'); + assert.match(experienceView('vm', { ...facts, vmReady: true }).detail, /not evidence/); + assert.equal(experienceView('pointers', { ...facts, authorityPinned: true, publicationUnknown: true, headRetained: true, publicationPublished: true }).id, 'pointerUnknown'); +}); + +test('all bounded gate combinations refuse unsafe actions without certifying host observations', () => { + const fields = ['disclosureAccepted', 'policyBlocked', 'authorityPinned', 'hasObject', 'headRetained', + 'publicationBusy', 'publicationUnknown', 'dnsConfigured', 'vmReady', 'vmBooting', 'meshJoined', 'unfinishedJobs']; + for (let mask = 0; mask < 2 ** fields.length; mask++) { + const facts = experienceFacts(Object.fromEntries(fields.map((field, i) => [field, Boolean(mask & (1 << i))]))); + if (!facts.disclosureAccepted || facts.policyBlocked) assert.equal(experienceActionAllowed('reconnectBtn', facts), false); + if (facts.publicationUnknown || facts.publicationBusy || facts.policyBlocked || !facts.authorityPinned) assert.equal(experienceActionAllowed('writeSignedDnsBtn', facts), false); + if (!facts.publicationUnknown || facts.publicationBusy || facts.policyBlocked || !facts.dnsConfigured || !facts.authorityPinned) assert.equal(experienceActionAllowed('reconcilePointerBtn', facts), false); + if (!facts.vmReady || facts.policyBlocked) assert.equal(experienceActionAllowed('runVmCmdBtn', facts), false); + if (facts.vmBooting || facts.vmReady) assert.equal(experienceActionAllowed('bootVmBtn', facts), false); + assert.equal(experienceActionAllowed('exportBudgetHistoryBtn', facts), true); + assert.equal(experienceActionAllowed('renewBudgetBtn', facts), true); + } + assert.equal(experienceActionAllowed('unknownControl', experienceFacts()), false); + assert.throws(() => experienceFacts({ policyBlocked: 0 }), /Bool/); + assert.throws(() => experienceFacts({ inventedEvidence: true }), /exact model record/); +}); + +test('per-resource attention is not an invented global denial and local unfinished jobs can resume', () => { + const facts = experienceFacts({ policyAttention: true, unfinishedJobs: true }); + assert.equal(experienceView('resources', facts).id, 'resourcesBlocked'); + for (const control of ['dbPutBtn', 'startJobBtn', 'takeoverJobsBtn']) assert.equal(experienceActionAllowed(control, facts), true); + assert.equal(experienceActionAllowed('takeoverJobsBtn', { ...facts, policyBlocked: true }), false); +}); + +test('navigation is source-owned, keyboard-native, focus preserving and nonanimated without changing mesh hash', () => { + const document = dom(); const refused = []; let observations = {}; + const experience = createOperatorExperience({ document, snapshot: () => observations, onRefused: x => refused.push(x) }); + const get = id => document.getElementById(id); + assert.equal(get('operatorJourneyNav').attributes['aria-label'], call('navigationLabel')); + assert.equal(get('meshPanel').hidden, false); + assert.equal(get('objectsPanel').hidden, true); + assert.equal(get('meshExplanationPanel').open, true); + const nav = get('operatorJourneyNav').children; + assert.equal(nav.length, operatorJourneys.length); + assert.ok(nav.every(button => button.type === 'button' && !button.href)); + const input = get('pointerJsonInput'); input.value = 'retain edited operator input'; + nav[4].listeners.click(); nav[1].listeners.click(); nav[4].listeners.click(); + assert.equal(input.value, 'retain edited operator input'); + assert.deepEqual(get('pointersPanel').focused, { preventScroll: true }); + assert.deepEqual(get('pointersPanel').scrolled, { behavior: 'auto', block: 'start' }); + assert.equal(nav[4].attributes['aria-current'], 'location'); + assert.equal(get('pointersPanel').hidden, false); + assert.ok(operatorJourneys.filter(j => j.id !== 'pointers').every(j => get(j.target).hidden)); + assert.equal(get('pointersExplanationPanel').open, false); + get('pointersExplanationPanel').open = true; experience.render(); + assert.equal(get('pointersExplanationPanel').open, true, 'unchanged updates retain explicit user disclosure choice'); + assert.equal(get('pointersEvidence').attributes['aria-live'], 'polite'); + assert.equal(get('pointersEvidence').attributes['aria-atomic'], 'true'); + assert.equal(get('writeSignedDnsBtn').disabled, true); + assert.equal(experience.allow('writeSignedDnsBtn'), false); assert.equal(refused.length, 1); + const writes = get('pointersEvidence').writes; experience.render(); experience.render(); + assert.equal(get('pointersEvidence').writes, writes, 'unchanged observations must not repeat live announcements'); + observations = { authorityPinned: true, hasObject: true, dnsConfigured: true, publicationUnknown: true, headRetained: true }; + experience.render(); + assert.equal(get('writeSignedDnsBtn').hidden, true); assert.equal(get('reconcilePointerBtn').hidden, false); + assert.equal(get('reconcilePointerBtn').disabled, false); + assert.equal(get('pointersExplanationPanel').open, true); + assert.equal(get('pointerPublicationSetup').open, true); + assert.match(get('operatorNextActions').textContent, /Reconcile Unknown/); + assert.doesNotMatch(get('operatorNextActions').textContent, /Admit Next/); + assert.equal(get('experienceProvenance').attributes['data-model-source-sha256'], experienceProvenance.sourceSha256); + observations = { policyAttention: true }; experience.render(); + assert.equal(get('pointersPanel').hidden, false, 'an asynchronous refusal does not steal navigation or focus'); + assert.equal(get('reviewResourcePolicyBtn').hidden, false); + get('reviewResourcePolicyBtn').listeners.click(); + assert.equal(get('resourcesPanel').hidden, false); + assert.equal(get('resourcesExplanationPanel').open, true); + assert.throws(() => experience.navigate('invented'), /Unknown operator journey/); +}); + +test('named modeled evidence palette has readable contrast on the actual panel surface', () => { + const luminance = hex => hex.slice(1).match(/../g).map(x => parseInt(x, 16) / 255) + .map(c => c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4) + .reduce((sum, c, i) => sum + c * [0.2126, 0.7152, 0.0722][i], 0); + const bg = luminance('#111111'); + for (const style of call('evidenceStyles')) assert.ok((luminance(style.color) + 0.05) / (bg + 0.05) >= 4.5, style.id); +}); + +test('Experience source edits change the real generated semantic projection and stale edits fail closed', async () => { + const temporary = mkdtempSync(resolve(tmpdir(), 'stitch-experience-mutation-')); + try { + for (const file of ['app/src', 'app/language', 'src', 'scripts/check-model.mjs', 'package.json']) cpSync(resolve(root, file), resolve(temporary, file), { recursive: true }); + const source = resolve(temporary, 'app/src/Product/Experience.lex.tex'); + const before = readFileSync(source, 'utf8'); + writeFileSync(source, before.replace('title := "Join a mesh"', 'title := "Join an inspected mesh"') + .replace('body: (disclosed && (not blocked))', 'body: false')); + const check = spawnSync(process.execPath, ['scripts/check-model.mjs', '--check'], { cwd: temporary, encoding: 'utf8' }); + assert.notEqual(check.status, 0); assert.match(check.stderr, /stale source bindings/); + const write = spawnSync(process.execPath, ['scripts/check-model.mjs', '--write'], { cwd: temporary, encoding: 'utf8' }); + assert.equal(write.status, 0, write.stderr); + const changed = await import(pathToFileURL(resolve(temporary, 'src/layer1-uor/generated-model.js'))); + assert.equal(changed.model['Product.Experience.journeys']()[0].title, 'Join an inspected mesh'); + const facts = changed.model['Product.Experience.initialFacts'](); facts.disclosureAccepted = true; + assert.equal(changed.model['Product.Experience.actionAllowed'](0, facts), false); + } finally { rmSync(temporary, { recursive: true, force: true }); } +}); + +test('recovery and guest administration context is source-owned and refuses inappropriate actions', () => { + const base = experienceFacts(); + assert.equal(experienceView('recovery', base).id, 'recoveryEmpty'); + assert.equal(experienceView('recovery', { ...base, recoveryBusy: true }).id, 'recoveryChecking'); + assert.equal(experienceView('recovery', { ...base, recoveryHasEvidence: true }).id, 'recoveryChecked'); + assert.equal(experienceView('recovery', { ...base, recoveryAcceptedAnchor: true }).id, 'recoveryTrusted'); + assert.equal(experienceActionAllowed('importRecoveryBtn', base), false); + assert.equal(experienceActionAllowed('importRecoveryBtn', { ...base, recoveryFileSelected: true }), true); + assert.equal(experienceActionAllowed('importRecoveryBtn', { ...base, recoveryFileSelected: true, recoveryBusy: true }), false); + assert.equal(experienceActionAllowed('acceptRecoveryAnchorBtn', { ...base, recoveryHasAnchors: true }), false); + assert.equal(experienceActionAllowed('acceptRecoveryAnchorBtn', { ...base, recoveryHasAnchors: true, recoveryAnchorConsent: true }), true); + assert.equal(experienceView('vm', { ...base, vmAdminBlocked: true }).id, 'vmQuarantined'); + assert.equal(experienceActionAllowed('stopVmBtn', { ...base, vmCanAdminister: true, vmAdminBlocked: true }), true); + assert.equal(experienceActionAllowed('bootVmBtn', { ...base, vmAdminBlocked: true }), false); + assert.equal(experienceActionAllowed('reconcileVmCommandBtn', { ...base, vmCanReconcileCommand: true }), true); +}); + +test('pinned authority can reach provider scope and saved-write loading after a fresh reload without object RAM', () => { + const facts = experienceFacts({ authorityPinned: true }); + assert.equal(call('publicationSetupVisible', facts), true); + assert.equal(experienceActionAllowed('loadPublicationBtn', facts), true); + assert.equal(experienceActionAllowed('writeSignedDnsBtn', facts), false); +}); + + +test('action explanations preserve authored descriptions and local refusal feedback without stealing focus', () => { + const document = dom(); const get = id => document.getElementById(id); + get('writeSignedDnsBtn').attributes['aria-describedby'] = 'customExplanation'; + const experience = createOperatorExperience({ document, snapshot: () => ({}) }); + experience.allow('writeSignedDnsBtn'); + assert.match(get('pointersActionStatus').textContent, /Without provider credentials/); + assert.match(get('writeSignedDnsBtn').attributes['aria-describedby'], /^customExplanation /); + assert.match(get('writeSignedDnsBtn').attributes['aria-describedby'], /pointersActionStatus/); + assert.equal(get('pointersPanel').focused, undefined); + experience.report('dbPutBtn', 'Exact local storage refusal'); + assert.equal(get('objectsActionStatus').textContent, 'Exact local storage refusal'); +}); + + +test('restore action requires the selected accepted anchor and matching eligible live scope, not import or a generic pin', () => { + const base = experienceFacts(); + for (let mask = 0; mask < 8; mask++) { + const facts = { ...base, recoveryBusy: Boolean(mask & 1), recoveryAcceptedAnchor: Boolean(mask & 2), recoveryCanRestoreAnchor: Boolean(mask & 4) }; + assert.equal(experienceActionAllowed('restoreRecoveryAnchorBtn', facts), !facts.recoveryBusy && facts.recoveryAcceptedAnchor && facts.recoveryCanRestoreAnchor); + } + assert.equal(experienceActionAllowed('restoreRecoveryAnchorBtn', { ...base, recoveryHasAnchors: true, authorityPinned: true }), false); + assert.equal(experienceView('recovery', { ...base, recoveryRestoredAnchor: true }).id, 'recoveryRestored'); + assert.equal(experienceView('recovery', { ...base, recoveryRestoredAnchor: true, recoveryBusy: true }).id, 'recoveryChecking'); +}); + +test('VM journey distinguishes pending, confirmed stop, retained uncertainty and destruction', () => { + const base = experienceFacts({ vmCanAdminister: true, vmAdminBlocked: true, vmFailed: true }); + assert.equal(experienceView('vm', base).id, 'vmQuarantined'); + assert.equal(experienceActionAllowed('stopVmBtn', base), true); + assert.equal(experienceView('vm', { ...base, vmTerminationPending: true }).id, 'vmTerminationPending'); + const stopped = { ...base, vmStopped: true, vmCanReconcileCommand: true, vmCanForgetCommand: true }; + assert.equal(experienceView('vm', stopped).evidence, 'HOST-OBSERVED STOPPED'); + assert.equal(call('viewStyle', stopped, 3), 'observed'); + assert.equal(call('viewStyle', { ...base, vmTerminationPending: true }, 3), 'pending'); + assert.equal(call('viewStyle', base, 3), 'attention'); + assert.equal(experienceActionAllowed('stopVmBtn', stopped), false); + assert.equal(experienceActionAllowed('destroyVmBtn', stopped), true); + assert.equal(experienceActionAllowed('bootVmBtn', stopped), false); + assert.equal(experienceActionAllowed('reconcileVmCommandBtn', stopped), true); + assert.equal(experienceActionAllowed('forgetVmCommandBtn', stopped), true); + assert.equal(experienceView('vm', { ...base, vmAdminBlocked: false, vmDestroyed: true }).id, 'vmDestroyed'); +}); + +test('network fields and full constraints are disclosed on demand, with local validation', () => { + const html = readFileSync(resolve(root, 'index.html'), 'utf8'); + const panel = html.match(/
([\s\S]*?)<\/details>/)?.[1]; + assert.ok(panel); + for (const id of ['vmNetworkSummary', 'vmIpv4Address', 'vmPrefixLength', 'vmNetworkHelp', 'vmNetworkStatus', 'vmNetworkValidation']) + assert.ok(panel.includes(`id="${id}"`), id); + assert.match(panel, /different address for every guest/); + assert.match(panel, /compatible subnet prefixes/); + assert.match(panel, /\/31.*\/32.*Destroy a retained instance/); + assert.doesNotMatch(html, /Linux 5\.6|LINUX 5\.6/); +}); diff --git a/tests/product-model.test.js b/tests/product-model.test.js new file mode 100644 index 0000000..d9f301a --- /dev/null +++ b/tests/product-model.test.js @@ -0,0 +1,63 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { readFileSync, mkdtempSync, cpSync, writeFileSync, rmSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { resolve } from 'node:path'; +import { readProduct, validateProduct, productRegister, literalRows } from '../scripts/check-product.mjs'; +const root=resolve(import.meta.dirname,'..'); +const source=()=>readProduct(root); +const changed=fn=>{const p=structuredClone(source());fn(p);return p;}; +test('complete product register is bound to current source and exact local assets',()=>{ + const expected=productRegister(root); + assert.deepEqual(JSON.parse(readFileSync(resolve(root,'product/contracts.json'),'utf8')),expected); + assert.equal(expected.components.length,18); + assert.equal(expected.capabilities.length,expected.hostCapabilities.length); + assert.deepEqual(expected.releaseBlockers, []); + const guest=expected.assets.find(a=>a.path==='images/buildroot-bzimage.bin'); + assert.equal(guest.sha256,'313a6b545290a2b47856b49bfcc4c7577469749b315932ae008d39fe70fc7f07'); + assert.equal(guest.bytes,8053248); + assert.match(guest.licenseStatus,/fd59fae669e9a40271fb584ca071270d8ed0b8f8/); + for(const a of expected.assets){assert.match(a.sha256,/^[0-9a-f]{64}$/);assert.ok(a.bytes>0);} + assert.equal(expected.assurance.includes('not a Prism receipt'),true); +}); +test('dangling contract owner is refused',()=>assert.throws(()=>validateProduct(changed(p=>p.capabilities[0].owner='missing'),root),/unknown capability owner/)); +test('undeclared assumptions are refused',()=>assert.throws(()=>validateProduct(changed(p=>p.capabilities[0].assumptions.push('invented')),root),/unknown assumption/)); +test('omitted capability coverage is refused',()=>assert.throws(()=>validateProduct(changed(p=>p.capabilities.pop()),root),/capability coverage/)); +test('duplicate components are refused',()=>assert.throws(()=>validateProduct(changed(p=>p.components.push(p.components[0])),root),/duplicate/)); +test('missing component assets are refused',()=>assert.throws(()=>validateProduct(changed(p=>p.assets=p.assets.filter(a=>a.path!=='index.html')),root),/unregistered component asset/)); +test('unknown deployment capabilities are refused',()=>assert.throws(()=>validateProduct(changed(p=>p.deployments[0].requiredCapabilities.push('bgp')),root),/unknown deployment capability/)); +test('dangling architecture flows are refused',()=>assert.throws(()=>validateProduct(changed(p=>p.architecture.find(x=>x.type==='Foundation.Arch::Edge').toIndex=999),root),/dangling architecture edge/)); +test('architecture indexes are sorted positions, not discretionary scores',()=>assert.throws(()=>validateProduct(changed(p=>p.architecture.find(x=>x.type==='Foundation.Arch::Component').index=50),root),/noncanonical architecture index/)); +test('relay opt-in cannot be silently removed',()=>assert.throws(()=>validateProduct(changed(p=>p.capabilities.find(x=>x.capability==='PublicRelay').enabledByDefault=true),root),/relay consent boundary/)); +test('native routing cannot be claimed supported in browser',()=>assert.throws(()=>validateProduct(changed(p=>p.capabilities.find(x=>x.capability==='NativeRouting').enabledByDefault=true),root),/native routing overclaim/)); +test('literal register reader refuses duplicate fields and executable substitutions',()=>{ + const header='definition{\n name: x,\n parameters: [],\n result: Component,\n body: '; + assert.throws(()=>literalRows(header+'(record Component {id := "x", id := "y"})\n}'),/duplicate field/); + assert.throws(()=>literalRows(header+'(record Component {id := (computeIdentity)})\n}'),/unsupported literal/); +}); +test('asset substitution changes the exact artifact identity without inventing provenance',()=>{ + const dir=mkdtempSync(resolve(tmpdir(),'stitch-product-mutation-')); + try{ + for(const path of ['app','src','v86','images','vendor','index.html','package.json','package-lock.json','prismpm.lock','standards.lock','CONTRACT.json'])cpSync(resolve(root,path),resolve(dir,path),{recursive:true}); + const before=productRegister(dir);writeFileSync(resolve(dir,'v86/seabios.bin'),new Uint8Array([0,1,2,3])); + assert.equal(before.releaseBlockers.some(x=>x.path==='v86/seabios.bin'),false); + assert.throws(()=>productRegister(dir),/distribution identity mismatch/); + cpSync(resolve(root,'v86/seabios.bin'),resolve(dir,'v86/seabios.bin')); + rmSync(resolve(dir,'vendor/seabios/COPYING.LESSER')); + assert.throws(()=>productRegister(dir),/ENOENT/); + } finally{rmSync(dir,{recursive:true,force:true});} +}); + +test('origin persistence and Web Locks are explicit optional capabilities, not session RAM', () => { + const p = readProduct(root); + assert.deepEqual(p.hostCapabilities.slice(-2), ['OriginStorage', 'WebLock']); + for (const id of ['originStorage', 'webLock']) { + assert.equal(p.capabilities.find(c => c.id === id).enabledByDefault, false); + assert.equal(p.deployments.find(d => d.id === 'browserSession').requiredCapabilities.includes(id), false); + } + assert.match(p.capabilities.find(c => c.id === 'sessionStorage').operation, /RAM/); + const authority = p.components.find(c => c.id === 'pointerAuthority'); + assert.ok(authority.implementation.includes('src/layer1-uor/browser-authority.js')); + assert.ok(authority.models.includes('Stitch.Effects')); + assert.ok(p.assets.some(a => a.path === 'src/layer1-uor/browser-authority.js')); +}); diff --git a/tests/recovery-ui.test.js b/tests/recovery-ui.test.js new file mode 100644 index 0000000..bef95c1 --- /dev/null +++ b/tests/recovery-ui.test.js @@ -0,0 +1,154 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { installRecoveryControls } from '../src/recovery-ui.js'; +import { exportRecoveryBundle, recoveryObject } from '../src/recovery.js'; +import { generateAuthority, signPointer, PointerObserver } from '../src/layer1-uor/pointer.js'; +import { demoProgram, createCheckpoint } from '../src/layer4-compute/replay.js'; +function setup({ objects = new Map(), observerFactory = options => new PointerObserver(options) } = {}) { + const elements = new Map(), handlers = new Map(); + const element = () => ({ value: '', checked: false, files: [], children: [], listeners: {}, textContent: '', disabled: false, attributes: {}, + setAttribute(name, value) { this.attributes[name] = value; }, + get selectedOptions() { return this.children.filter(child => child.selected); }, + addEventListener(event, handler) { this.listeners[event] = handler; }, + replaceChildren(...children) { this.children = children; this.value = children[0]?.value ?? ''; }, + querySelectorAll() { return []; }, click() {} }); + const document = { getElementById(id) { if (!elements.has(id)) elements.set(id, element()); return elements.get(id); }, createElement: element }; + const pointerObservers = new Map(); + const pointerObserver = () => { + const name = document.getElementById('dnsQueryInput').value.trim(), trustedAuthorityKey = document.getElementById('pointerAuthorityInput').value.trim(); + const key = `${name}:${trustedAuthorityKey}`; + if (!pointerObservers.has(key)) pointerObservers.set(key, observerFactory({ name, trustedAuthorityKey })); + return pointerObservers.get(key); + }; + const controls = installRecoveryControls({ document, liveDb: { objects }, computeCoord: { jobs: new Map() }, + pointerObservers, pointerObserver, bindModelAction: (id, handler) => handlers.set(id, handler) }); + return { document, controls, handlers, pointerObservers, pointerObserver, get: id => document.getElementById(id) }; +} +test('recovery UI checks chosen file, restores local evidence and explicitly completes only pure jobs', async () => { + const ui = setup(); const program = demoProgram(5); + const wire = await exportRecoveryBundle({ version: 1, objects: [await recoveryObject(new Uint8Array([1, 2]))], + jobs: [{ program, checkpoint: await createCheckpoint(program, 2) }], anchors: [] }); + const bytes = new TextEncoder().encode(wire); + ui.get('recoveryFile').files = [{ size: bytes.length, arrayBuffer: async () => bytes.buffer }]; + ui.get('recoveryAnchorConsent').checked = true; + await ui.handlers.get('importRecoveryBtn')(); + assert.equal(ui.get('recoveryAnchorConsent').checked, false); + assert.equal(ui.controls.facts().recoveryHasEvidence, true); + assert.equal(ui.controls.facts().recoveryHasObjects, true); + assert.equal(ui.controls.facts().recoveryHasJobs, true); + assert.match(ui.get('recoveryStatus').textContent, /No mesh, VM or DNS effects/); + await ui.handlers.get('resumeRecoveredJobBtn')(); + assert.match(ui.get('recoveryStatus').textContent, /Pure local replay finished at step 5/); + ui.get('recoveryFile').files = [{ size: 4, arrayBuffer: async () => new TextEncoder().encode('null').buffer }]; + await ui.handlers.get('importRecoveryBtn')(); + assert.match(ui.get('recoveryStatus').textContent, /Refused/); + assert.equal(ui.controls.facts().recoveryHasEvidence, true); +}); +test('oversize file refuses before reading, pending duplicate clicks do not repeat import', async () => { + const ui = setup(); let reads = 0, resolve; + ui.get('recoveryByteLimit').value = '0'; + ui.get('recoveryFile').files = [{ size: 1, arrayBuffer: async () => { reads++; } }]; + await ui.handlers.get('importRecoveryBtn')(); assert.equal(reads, 0); + ui.get('recoveryByteLimit').value = '1000'; + const bytes = new TextEncoder().encode(await exportRecoveryBundle({ version: 1, objects: [], jobs: [], anchors: [] })); + ui.get('recoveryFile').files = [{ size: bytes.length, arrayBuffer: () => { reads++; return new Promise(r => { resolve = r; }); } }]; + const pending = ui.handlers.get('importRecoveryBtn')(); + assert.equal(ui.controls.facts().recoveryBusy, true); + assert.equal(ui.get('recoveryControls').attributes['aria-busy'], 'true'); + await ui.handlers.get('importRecoveryBtn')(); assert.equal(reads, 1); + resolve(bytes.buffer); await pending; assert.equal(ui.controls.facts().recoveryBusy, false); + assert.equal(ui.get('recoveryControls').attributes['aria-busy'], 'false'); +}); + + +test('recovery keeps export choices across reopening and clears stale anchor consent when its scope changes', async () => { + const objects = new Map([['a', { verified: true, bytes: Uint8Array.of(1) }], ['b', { verified: true, bytes: Uint8Array.of(2) }]]); + const ui = setup({ objects }); const panel = ui.get('recoveryControls'); + panel.open = true; panel.listeners.toggle(); + const control = ui.get('recoveryExportSelection'); + control.children[1].selected = false; + panel.listeners.toggle(); + assert.deepEqual(control.selectedOptions.map(option => option.value), ['object:a']); + objects.set('c', { verified: true, bytes: Uint8Array.of(3) }); + panel.listeners.toggle(); + assert.deepEqual(control.selectedOptions.map(option => option.value), ['object:a']); + for (const [id, event] of [['recoveryAnchors', 'change'], ['recoveryAuthority', 'input'], ['recoveryDigest', 'input']]) { + ui.get('recoveryAnchorConsent').checked = true; ui.get(id).listeners[event](); + assert.equal(ui.get('recoveryAnchorConsent').checked, false); + } + assert.equal(ui.get('recoveryObjects').children[0].textContent, 'No objects imported'); +}); + +test('recovered typed jobs require priced work allowance before explicit continuation', async () => { + const { programWork } = await import('../src/layer4-compute/replay.js'); + const ui = setup(); + const program = { version: 2, bits: 8, capacityBits: 8, initialValueHex: '0x3', + instructions: [{ op: 17, argBits: 8, argHex: '0x7' }] }; + const wire = await exportRecoveryBundle({ version: 1, objects: [], jobs: [{ program, checkpoint: await createCheckpoint(program, 0) }], anchors: [] }); + const bytes = new TextEncoder().encode(wire); + ui.get('recoveryFile').files = [{ size: bytes.length, arrayBuffer: async () => bytes.buffer }]; + await ui.handlers.get('importRecoveryBtn')(); + ui.get('recoveryStepLimit').value = program.instructions.length; + await ui.handlers.get('resumeRecoveredJobBtn')(); + assert.match(ui.get('recoveryStatus').textContent, /Refused.*work allowance/); + ui.get('recoveryStepLimit').value = programWork(program); + await ui.handlers.get('resumeRecoveredJobBtn')(); + assert.match(ui.get('recoveryStatus').textContent, /Pure local replay finished at step 1/); +}); + +async function importAnchor(ui) { + const authority = await generateAuthority(), now = Date.now(); + const anchor = await signPointer({ version: 1, name: 'state.example', authorityKey: authority.publicKey, revision: 7, + previousDigest: 'sha256:' + 'a'.repeat(64), objectRoot: 'sha256:' + 'b'.repeat(64), validFromMs: now - 1000, validUntilMs: now + 100000 }, authority.privateKey); + const bytes = new TextEncoder().encode(await exportRecoveryBundle({ version: 1, objects: [], jobs: [], anchors: [anchor] })); + ui.get('recoveryFile').files = [{ size: bytes.length, arrayBuffer: async () => bytes.buffer }]; + await ui.handlers.get('importRecoveryBtn')(); + ui.get('recoveryAuthority').value = authority.publicKey; ui.get('recoveryDigest').value = anchor.pointerDigest; + return { authority, anchor }; +} +async function acceptAnchor(ui) { + ui.get('recoveryAnchorConsent').checked = true; await ui.handlers.get('acceptRecoveryAnchorBtn')(); +} + +test('UI requires separate import, exact acceptance, matching independent live pin and explicit restoration', async () => { + const ui = setup(), { authority, anchor } = await importAnchor(ui); + assert.equal(ui.controls.facts().recoveryCanRestoreAnchor, false); + await ui.handlers.get('restoreRecoveryAnchorBtn')(); assert.equal(ui.pointerObservers.size, 0); + await acceptAnchor(ui); assert.equal(ui.pointerObservers.size, 0); + ui.get('dnsQueryInput').value = anchor.name; + assert.equal(ui.controls.facts().recoveryCanRestoreAnchor, false); + ui.get('pointerAuthorityInput').value = authority.publicKey; + assert.equal(ui.controls.facts().recoveryCanRestoreAnchor, true); + await ui.handlers.get('restoreRecoveryAnchorBtn')(); + assert.deepEqual(ui.pointerObserver().head, anchor); + assert.equal(ui.controls.facts().recoveryRestoredAnchor, true); + assert.match(ui.get('recoveryStatus').textContent, /No DNS write, mesh or VM effect/); + assert.match(ui.get('recoveryLiveScope').textContent, /Retained revision 7/); + ui.get('recoveryDigest').value = 'sha256:' + 'c'.repeat(64); ui.get('recoveryDigest').listeners.input(); + assert.equal(ui.controls.facts().recoveryCanRestoreAnchor, false); + assert.deepEqual(ui.pointerObserver().head, anchor); +}); + +test('UI ignores duplicate restore and close or changed scope cancels a pending commit without replay on reopen', async () => { + let release, reached, calls = 0; + const ui = setup({ observerFactory: options => { + const observer = new PointerObserver(options), restore = observer.restoreFromRecovery.bind(observer); + observer.restoreFromRecovery = async (...args) => { + calls++; reached(); await new Promise(resolve => { release = resolve; }); return restore(...args); + }; + return observer; + } }); + const { authority, anchor } = await importAnchor(ui); await acceptAnchor(ui); + ui.get('dnsQueryInput').value = anchor.name; ui.get('pointerAuthorityInput').value = authority.publicKey; + for (const cancel of [() => { ui.get('recoveryControls').open = false; ui.get('recoveryControls').listeners.toggle(); }, + () => { ui.get('pointerAuthorityInput').listeners.input(); }]) { + let entered; const started = new Promise(resolve => { entered = resolve; }); reached = entered; + const pending = ui.handlers.get('restoreRecoveryAnchorBtn')(); await started; + const before = calls; await ui.handlers.get('restoreRecoveryAnchorBtn')(); assert.equal(calls, before); + cancel(); release(); await pending; + assert.equal(ui.pointerObserver().head, null); + assert.match(ui.get('recoveryStatus').textContent, /Refused/); + ui.get('recoveryControls').open = true; ui.get('recoveryControls').listeners.toggle(); + assert.equal(calls, before); assert.equal(ui.pointerObserver().head, null); + } +}); diff --git a/tests/recovery.test.js b/tests/recovery.test.js new file mode 100644 index 0000000..09e69af --- /dev/null +++ b/tests/recovery.test.js @@ -0,0 +1,140 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { RecoveryVault, recoveryObject, exportRecoveryBundle, verifyRecoveryBundle, RECOVERY_LIMITS } from '../src/recovery.js'; +import { canonicalBytes, sha256Bytes } from '../src/layer1-uor/custody.js'; +import { demoProgram, createCheckpoint } from '../src/layer4-compute/replay.js'; +import { generateAuthority, signPointer } from '../src/layer1-uor/pointer.js'; +const empty = () => ({ version: 1, objects: [], jobs: [], anchors: [] }); +const wire = value => new TextDecoder().decode(canonicalBytes(value, { maxBytes: RECOVERY_LIMITS.wireBytes, maxStringLength: 131072, maxEntries: 262144 })); +async function fixture() { + const bundle = empty(); + bundle.objects.push(await recoveryObject(new TextEncoder().encode('recover me'))); + const program = demoProgram(5); + bundle.jobs.push({ program, checkpoint: await createCheckpoint(program, 3) }); + return bundle; +} +test('roundtrip restores exact object and replay evidence without host effects', async () => { + const vault = new RecoveryVault(); + const bundle = await fixture(); + const exported = await exportRecoveryBundle(bundle); + const result = await vault.import(exported); + assert.equal(result.entries, 2); assert.deepEqual(result.effects, []); + assert.equal(result.durability, 'session-only'); + assert.equal(new TextDecoder().decode(await vault.objectBytes(bundle.objects[0].manifest.object.contentDigest)), 'recover me'); + assert.equal(await vault.export(), exported); + await vault.import(exported); // exact duplicate is idempotent evidence + assert.equal(vault.snapshot().entries, 2); +}); +test('maximum live object survives export/import, reduced operator cap refuses', async () => { + const bundle = empty(); const bytes = new Uint8Array(128 * 1024); bytes[bytes.length - 1] = 199; + bundle.objects.push(await recoveryObject(bytes)); + const exported = await exportRecoveryBundle(bundle); const vault = new RecoveryVault(); + await vault.import(exported); + assert.deepEqual(await vault.objectBytes(bundle.objects[0].manifest.object.contentDigest), bytes); + await assert.rejects(new RecoveryVault({ wireBytes: 1000 }).import(exported)); +}); +test('corruption, partial objects, unknown fields, noncanonical and duplicate evidence refuse atomically', async () => { + const vault = new RecoveryVault(); const bundle = await fixture(); await vault.import(wire(bundle)); + const before = vault.snapshot(); + const cases = []; + let bad = structuredClone(bundle); bad.objects[0].fragments[0].hex = '00'; cases.push(wire(bad)); + bad = structuredClone(bundle); bad.objects[0].fragments.pop(); cases.push(wire(bad)); + bad = structuredClone(bundle); bad.objects.push(bad.objects[0]); cases.push(wire(bad)); + bad = structuredClone(bundle); bad.privateKey = 'secret'; cases.push(wire(bad)); + cases.push(wire(bundle) + ' '); cases.push('{"version":1,"version":1,"objects":[],"jobs":[],"anchors":[]}'); + for (const invalid of cases) { await assert.rejects(vault.import(invalid)); assert.deepEqual(vault.snapshot(), before); } +}); +test('forged state with recomputed digest fails replay, foreign model fails identity', async () => { + const bundle = await fixture(); const checkpoint = bundle.jobs[0].checkpoint; + checkpoint.stateHex = '0x1'; + const { checkpointDigest, ...body } = checkpoint; + checkpoint.checkpointDigest = await sha256Bytes(canonicalBytes(body), 'checkpoint'); + await assert.rejects(verifyRecoveryBundle(wire(bundle)), /checkpoint-replay/); + checkpoint.modelDigest = 'sha256:' + '0'.repeat(64); + await assert.rejects(verifyRecoveryBundle(wire(bundle)), /checkpoint-model/); +}); +test('direct successor without retained predecessor does not overwrite evidence', async () => { + const bundle = await fixture(); const vault = new RecoveryVault(); await vault.import(wire(bundle)); + const before = vault.snapshot(); bundle.jobs[0].checkpoint = await createCheckpoint(bundle.jobs[0].program, 4); + await assert.rejects(vault.import(wire(bundle)), /conflict/); assert.deepEqual(vault.snapshot(), before); +}); +test('aggregate limits precede replay and bound merged entries', async () => { + const bundle = await fixture(); + await assert.rejects(new RecoveryVault({ replaySteps: 2 }).import(wire(bundle)), /replay-limit/); + const vault = new RecoveryVault({ entries: 2 }); await vault.import(wire(bundle)); const before = vault.snapshot(); + const more = empty(); more.objects.push(await recoveryObject(new Uint8Array([1]))); + await assert.rejects(vault.import(wire(more)), /capacity/); assert.deepEqual(vault.snapshot(), before); +}); +test('anchors stay untrusted; separate exact recent consent, signature, expiry and conflict required', async () => { + const authority = await generateAuthority(); const bundle = empty(); + const anchor = await signPointer({ version: 1, name: 'example', authorityKey: authority.publicKey, revision: 7, + previousDigest: 'sha256:' + 'a'.repeat(64), objectRoot: 'sha256:' + 'b'.repeat(64), validFromMs: 10, validUntilMs: 100 }, authority.privateKey); + bundle.anchors.push(anchor); const vault = new RecoveryVault(); await vault.import(wire(bundle)); + assert.deepEqual(vault.snapshot().acceptedAnchors, []); + const approval = { name: anchor.name, authorityKey: authority.publicKey, expectedDigest: anchor.pointerDigest, nowMs: 20, operatorAccepted: true }; + for (const patch of [{ operatorAccepted: false }, { expectedDigest: 'sha256:' + 'c'.repeat(64) }, { nowMs: 100 }, { nowMs: 9 }]) { + await assert.rejects(vault.acceptRecentAnchor({ ...approval, ...patch })); assert.deepEqual(vault.snapshot().acceptedAnchors, []); + } + assert.deepEqual(await vault.acceptRecentAnchor(approval), anchor); + const copy = new RecoveryVault(); await copy.import(await vault.export()); + assert.deepEqual(copy.snapshot().acceptedAnchors, []); // trust never transits a file +}); +test('concurrent imports cannot lose a committed update', async () => { + const a = await fixture(), b = empty(); b.objects.push(await recoveryObject(new Uint8Array([2]))); + const vault = new RecoveryVault(); const result = await Promise.allSettled([vault.import(wire(a)), vault.import(wire(b))]); + assert.equal(result.filter(r => r.status === 'fulfilled').length, 1); +}); + +test('monotonic job progress imports; stale state and forked direct links refuse atomically', async () => { + const bundle = await fixture(); const vault = new RecoveryVault(); await vault.import(wire(bundle)); + const older = wire(bundle); bundle.jobs[0].checkpoint = await createCheckpoint(bundle.jobs[0].program, 4, bundle.jobs[0].checkpoint); + await vault.import(wire(bundle)); assert.equal(vault.snapshot().bundle.jobs[0].checkpoint.stepIndex, 4); + const before = vault.snapshot(); await assert.rejects(vault.import(older), /rollback/); assert.deepEqual(vault.snapshot(), before); +}); +test('new signed anchor evidence retains old trust until separate exact acceptance', async () => { + const authority = await generateAuthority(); const bundle = empty(); + const base = { version: 1, name: 'example', authorityKey: authority.publicKey, revision: 7, + previousDigest: 'sha256:' + 'a'.repeat(64), objectRoot: 'sha256:' + 'b'.repeat(64), validFromMs: 10, validUntilMs: 100 }; + const first = await signPointer(base, authority.privateKey); bundle.anchors.push(first); + const vault = new RecoveryVault(); await vault.import(wire(bundle)); + const approval = { name: base.name, authorityKey: authority.publicKey, nowMs: 20, operatorAccepted: true }; + await vault.acceptRecentAnchor({ ...approval, expectedDigest: first.pointerDigest }); + const second = await signPointer({ ...base, revision: 8, previousDigest: first.pointerDigest }, authority.privateKey); + bundle.anchors = [second]; await vault.import(wire(bundle)); + assert.equal(vault.snapshot().acceptedAnchors[0].pointerDigest, first.pointerDigest); + await assert.rejects(vault.acceptRecentAnchor({ ...approval, expectedDigest: first.pointerDigest })); + await vault.acceptRecentAnchor({ ...approval, expectedDigest: second.pointerDigest }); + assert.equal(vault.snapshot().acceptedAnchors[0].pointerDigest, second.pointerDigest); + const before = vault.snapshot(); bundle.anchors = [first]; await assert.rejects(vault.import(wire(bundle)), /rollback/); + assert.deepEqual(vault.snapshot(), before); +}); +test('explicit codec budgets preserve bytes and reject invalid bounds', () => { + const value = { unicode: 'é', integer: 17, list: [true, null] }; + assert.deepEqual(canonicalBytes(value), canonicalBytes(value, { maxBytes: 1000, maxDepth: 8, maxEntries: 100, maxStringLength: 100 })); + for (const options of [{ maxBytes: -1 }, { maxEntries: Infinity }, { maxDepth: 1.5 }, { maxStringLength: NaN }]) { + assert.throws(() => canonicalBytes(value, options)); + } + assert.throws(() => canonicalBytes({ value: 'é' }, { maxBytes: 13 })); +}); + +test('typed CONCAT and POW survive recovery with exact widths and priced work admission', async () => { + const { programWork, resumeProgram, replayProgram } = await import('../src/layer4-compute/replay.js'); + const program = { version: 2, bits: 8, capacityBits: 24, initialValueHex: '0x1', instructions: [ + { op: 14, argBits: 16, argHex: '0x2' }, { op: 17, argBits: 24, argHex: '0x3' } + ] }; + const checkpoint = await createCheckpoint(program, 1); + const bundle = { ...empty(), jobs: [{ program, checkpoint }] }; + const encoded = await exportRecoveryBundle(bundle); + const cost = programWork(program, 0, 1); + assert.equal((await verifyRecoveryBundle(encoded)).cost.replaySteps, cost); + assert.ok(cost > checkpoint.stepIndex); + await assert.rejects(new RecoveryVault({ replaySteps: cost - 1 }).import(encoded), /replay-limit/); + const vault = new RecoveryVault({ replaySteps: cost }); await vault.import(encoded); + const restored = vault.snapshot().bundle.jobs[0]; + assert.equal(restored.checkpoint.stateBits, 24); + const resumed = await resumeProgram(restored.program, restored.checkpoint); + const expected = replayProgram(program); + assert.equal(resumed.stateBits, expected.stateBits); assert.equal(resumed.stateHex, expected.stateHex); + assert.deepEqual(resumed.effects, []); + assert.equal(await vault.export(), encoded); +}); diff --git a/tests/relay-framing.test.js b/tests/relay-framing.test.js new file mode 100644 index 0000000..e29d5fe --- /dev/null +++ b/tests/relay-framing.test.js @@ -0,0 +1,387 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { model } from '../src/layer1-uor/generated-model.js'; +import { sha256Bytes } from '../src/layer1-uor/custody.js'; +import { createObject } from '../src/layer3-storage/custody.js'; +import { LiveUorMeshDatabase } from '../src/layer3-storage/index.js'; +import { ResourceAdmission, wireBytes } from '../src/layer2-schedulers/policy.js'; +import { WebRtcTransportNode } from '../src/layer5-transport/index.js'; +import { RELAY_LIMITS, RELAY_LIFETIMES, RelayReassembler, snapshotRelayMessage, frameRelayMessage, + decodeBase64Url, encodeBase64Url } from '../src/layer5-transport/relay-framing.js'; + +const now = 1700000000000; +const session = '0'.repeat(32); +const normalize = value => JSON.parse(JSON.stringify(value)); +const code = expected => error => error.code === expected; +const deferred = () => { let resolve; const promise = new Promise(r => { resolve = r; }); return { promise, resolve }; }; +const frame = (payload, options = {}) => frameRelayMessage(snapshotRelayMessage({ from: 'remote', ...payload }), { + channelKey: 'mesh', session, scope: 'warm', createdAtMs: now, ...options }); +const assembler = (options = {}) => new RelayReassembler({ channelKey: 'mesh', scope: 'warm', wallClock: () => now, + clock: () => 0, automaticCleanup: false, ...options }); +const alter = (raw, updates) => JSON.stringify({ ...JSON.parse(raw), ...updates }); +const policy = limit => new ResourceAdmission({ limit: { requests: 4096, transferBytes: 16 * 1024 * 1024, + storageBytes: 16 * 1024 * 1024, computeSteps: 1000000, ...limit } }); +const drain = node => Promise.all([...node.signalSigning.values(), ...node.relayPending.values()].map(job => job.completion)); +function globals(t, entries) { + for (const [name, value] of Object.entries(entries)) { + const previous = Object.getOwnPropertyDescriptor(globalThis, name); + Object.defineProperty(globalThis, name, { value, configurable: true, writable: true }); + t.after(() => previous ? Object.defineProperty(globalThis, name, previous) : delete globalThis[name]); + } +} + +test('relay runtime limits and duplicate/closed/consent gates are source-derived', () => { + const source = model['Stitch.Relay.limits'](); + assert.deepEqual(RELAY_LIMITS, Object.fromEntries(Object.entries(source).map(([key, value]) => [key, Number(value)]))); + assert.equal(RELAY_LIMITS.wireBytes, 4096); + assert.equal(RELAY_LIMITS.messageBytes, 512 * 1024); + assert.equal(model['Stitch.Relay.effectAllowed'](true, 0, 0, true, true), false); + assert.equal(model['Stitch.Relay.effectAllowed'](false, 1, 0, true, true), false); + assert.equal(model['Stitch.Relay.effectAllowed'](false, 0, 0, true, false), false); +}); + +test('RFC4648 unpadded base64url is byte-exact and refuses aliases/nonzero pad bits', () => { + for (let length = 1; length <= 256; length++) { + const bytes = Uint8Array.from({ length }, (_, index) => index); + assert.deepEqual(decodeBase64Url(encodeBase64Url(bytes)), bytes); + } + for (const value of ['', 'A', 'AA=', 'AA==', '+w', '/w', '_x', 'AB', 'AAB', 'a a', 'é']) { + assert.throws(() => decodeBase64Url(value), code('relay-base64')); + } +}); + +test('full 512KiB logical JSON is framed below4096 UTF8 bytes without shrinking its message', async () => { + const overhead = wireBytes({ from: 'remote', data: '' }); + const payload = { from: 'remote', data: 'x'.repeat(RELAY_LIMITS.messageBytes - overhead) }; + const encoded = await frame(payload); + assert.equal(snapshotRelayMessage(payload).byteLength, RELAY_LIMITS.messageBytes); + assert.ok(encoded.frames.length > 1 && encoded.frames.length <= RELAY_LIMITS.frames); + assert.equal(encoded.bytes, encoded.frames.reduce((sum, item) => sum + wireBytes(item), 0)); + for (const raw of encoded.frames) assert.ok(wireBytes(raw) <= 4096); + const receiver = assembler(); + let result; + for (const raw of encoded.frames.reverse()) result = await receiver.accept(raw) ?? result; + assert.deepEqual(normalize(result), payload); + assert.equal(receiver.state.retainedBytes, 0); + assert.throws(() => snapshotRelayMessage({ ...payload, data: payload.data + 'x' }), code('relay-message-limit')); + receiver.dispose(); +}); + +test('UTF8 split boundaries, reordering and duplicates preserve logical bytes and deliver only once', async () => { + const payload = { from: 'peer', data: '😀é\n'.repeat(1800), nested: { objectRoot: 'unchanged' } }; + const encoded = await frame(payload); + const receiver = assembler(); + assert.equal(await receiver.accept(encoded.frames[1]), null); + assert.equal(await receiver.accept(encoded.frames[1]), null); + let result, deliveries = 0; + for (const raw of encoded.frames.slice().reverse()) { + const message = await receiver.accept(raw); + if (message) { result = message; deliveries++; } + } + for (const raw of encoded.frames) assert.equal(await receiver.accept(raw), null); + assert.equal(deliveries, 1); + assert.deepEqual(normalize(result), payload); + assert.equal(receiver.state.entries, 0); assert.equal(receiver.state.tombstones, 1); + receiver.dispose(); +}); + +test('corrupt chunks and conflicting duplicates tombstone exactly their assembly', async () => { + const encoded = await frame({ data: 'x'.repeat(6000) }); + const other = await frame({ data: 'y'.repeat(6000) }, { session: '1'.repeat(32) }); + const receiver = assembler(); + await receiver.accept(encoded.frames[0]); await receiver.accept(other.frames[0]); + const parsed = JSON.parse(encoded.frames[0]); + const bytes = decodeBase64Url(parsed.x); bytes[0] ^= 1; + await assert.rejects(receiver.accept(alter(encoded.frames[0], { x: encodeBase64Url(bytes) })), code('relay-conflicting-duplicate')); + for (const raw of encoded.frames) assert.equal(await receiver.accept(raw), null); + let result; + for (const raw of other.frames.slice(1)) result = await receiver.accept(raw) ?? result; + assert.equal(result.data, 'y'.repeat(6000)); + assert.equal(receiver.state.retainedBytes, 0); + receiver.dispose(); + const corrupt = assembler(); + await corrupt.accept(alter(encoded.frames[0], { x: encodeBase64Url(bytes) })); + await corrupt.accept(encoded.frames[1]); + await assert.rejects(corrupt.accept(encoded.frames[2]), code('relay-integrity')); + assert.equal(corrupt.state.entries, 0); assert.equal(corrupt.state.retainedBytes, 0); + corrupt.dispose(); +}); + +test('mixed metadata is refused, while sender sessions never concatenate', async () => { + const encoded = await frame({ data: 'x'.repeat(6000) }); + const receiver = assembler(); + await receiver.accept(encoded.frames[0]); + await assert.rejects(receiver.accept(alter(encoded.frames[0], { b: JSON.parse(encoded.frames[0]).b + 1 })), code('relay-mixed-message')); + assert.equal(receiver.state.entries, 0); + const separate = assembler(); + await separate.accept(encoded.frames[0]); + for (const raw of encoded.frames.slice(1)) assert.equal(await separate.accept(alter(raw, { s: 'f'.repeat(32) })), null); + assert.equal(separate.state.entries, 2); + assert.equal(separate.state.retainedBytes, 2 * JSON.parse(encoded.frames[0]).b); + receiver.dispose(); separate.dispose(); +}); + +test('wrong channel/purpose, malformed schema and oversized declarations never allocate an assembly', async () => { + const encoded = await frame({ data: 'x'.repeat(6000) }); + const receiver = assembler(); + const bad = [alter(encoded.frames[0], { p: 'signal' }), alter(encoded.frames[0], { c: 'sha256:' + 'f'.repeat(64) }), + alter(encoded.frames[0], { b: RELAY_LIMITS.messageBytes + 1 }), alter(encoded.frames[0], { n: RELAY_LIMITS.frames + 1 }), + alter(encoded.frames[0], { n: 0 }), alter(encoded.frames[0], { i: 999 }), alter(encoded.frames[0], { extra: true }), + encoded.frames[0].replace('"v":', '"v":"stitch/1","v":'), 'é'.repeat(4096)]; + for (const raw of bad) await assert.rejects(receiver.accept(raw)); + assert.equal(receiver.state.entries, 0); assert.equal(receiver.state.retainedBytes, 0); + receiver.dispose(); +}); + +test('sender timestamps cannot extend local assembly horizons and expired bytes are reclaimed', async () => { + let monotonic = 0, wall = now; + const encoded = await frame({ data: 'x'.repeat(6000) }, { scope: 'signal' }); + const receiver = assembler({ scope: 'signal', clock: () => monotonic, wallClock: () => wall }); + await receiver.accept(encoded.frames[0]); + monotonic = RELAY_LIMITS.assemblyAge; + assert.equal(receiver.state.entries, 0); assert.equal(receiver.state.retainedBytes, 0); + assert.equal(await receiver.accept(encoded.frames[1]), null); + monotonic = RELAY_LIFETIMES.signal; wall += RELAY_LIFETIMES.signal; + assert.equal(receiver.state.tombstones, 0); + await assert.rejects(receiver.accept(encoded.frames[0]), code('relay-frame')); + const future = await frame({ data: 'x'.repeat(6000) }, { scope: 'signal', createdAtMs: wall + RELAY_LIMITS.futureSkew + 1 }); + await assert.rejects(receiver.accept(future.frames[0]), code('relay-frame')); + receiver.dispose(); +}); + +test('active entry/declared byte caps and tombstone admission never evict another message', async () => { + const encoded = await frame({ data: 'x'.repeat(6000) }); + const receiver = assembler(); + for (let index = 0; index < RELAY_LIMITS.entries; index++) { + await receiver.accept(alter(encoded.frames[0], { s: index.toString(16).padStart(32, '0') })); + } + await assert.rejects(receiver.accept(alter(encoded.frames[0], { s: 'e'.repeat(32) })), code('relay-reassembly-capacity')); + assert.equal(receiver.state.entries, RELAY_LIMITS.entries); + receiver.dispose(); + const big = assembler(); + const header = { b: RELAY_LIMITS.messageBytes, n: Math.ceil(RELAY_LIMITS.messageBytes / RELAY_LIMITS.chunkBytes) }; + for (let index = 0; index < RELAY_LIMITS.retainedBytes / RELAY_LIMITS.messageBytes; index++) { + await big.accept(alter(encoded.frames[0], { ...header, s: index.toString(16).padStart(32, '0') })); + } + await assert.rejects(big.accept(alter(encoded.frames[0], { ...header, s: 'e'.repeat(32) })), code('relay-reassembly-capacity')); + assert.equal(big.state.retainedBytes, RELAY_LIMITS.retainedBytes); + big.dispose(); + const small = await frame({ data: 'one' }), tombstones = assembler(); + for (let index = 0; index < RELAY_LIMITS.tombstones; index++) { + assert.ok(await tombstones.accept(alter(small.frames[0], { s: index.toString(16).padStart(32, '0') }))); + } + await assert.rejects(tombstones.accept(alter(small.frames[0], { s: 'e'.repeat(32) })), code('relay-reassembly-capacity')); + assert.equal(tombstones.state.tombstones, RELAY_LIMITS.tombstones); + tombstones.dispose(); +}); + +test('pending verification cannot deliver after disposal or consent withdrawal', async t => { + const encoded = await frame({ data: 'one' }); + let consent = true; + const receiver = assembler({ consentCurrent: () => consent }); + await receiver.channel; + const gate = deferred(), entered = deferred(), original = crypto.subtle.digest.bind(crypto.subtle); + t.mock.method(crypto.subtle, 'digest', async (...args) => { entered.resolve(); await gate.promise; return original(...args); }); + const pending = receiver.accept(encoded.frames[0]); + await entered.promise; consent = false; receiver.dispose(); gate.resolve(); + assert.equal(await pending, null); + assert.equal(receiver.state.retainedBytes, 0); +}); + +test('complete untrusted bytes are not deliverable JSON with duplicate keys or invalid UTF8', async () => { + for (const bytes of [new TextEncoder().encode('{"from":"a","from":"b"}'), Uint8Array.from([0xff])]) { + const normal = await frame({ data: 'one' }); + const raw = alter(normal.frames[0], { m: await sha256Bytes(bytes, 'relay-message'), b: bytes.length, n: 1, i: 0, x: encodeBase64Url(bytes) }); + const receiver = assembler(); + await assert.rejects(receiver.accept(raw)); + assert.equal(receiver.state.retainedBytes, 0); + receiver.dispose(); + } +}); + +test('2048 all-ff object survives cold ntfy cache recovery with no oversized provider POST', async t => { + const posts = []; + t.mock.method(globalThis, 'fetch', async (url, options) => { + if (options?.method === 'POST') { + const size = wireBytes(options.body); + // Model ntfy's documented long-body attachment conversion to catch regressions. + posts.push(size <= 4096 ? { event: 'message', message: options.body } : { event: 'message', message: 'attachment', attachment: { url: 'https://unused.invalid' } }); + return { ok: true, status: 200 }; + } + return new Response([...posts.slice().reverse(), posts[0]].map(item => JSON.stringify(item)).join('\n')); + }); + const sender = new WebRtcTransportNode({ peerId: 'writer', channelKey: 'mesh' }); + const receiver = new WebRtcTransportNode({ peerId: 'reader', channelKey: 'mesh' }); + t.after(() => { sender.close(); receiver.close(); }); + const writer = new LiveUorMeshDatabase({ transport: sender }); + const bytes = new Uint8Array(2048).fill(255); + const stored = await writer.put(bytes, { persistWarm: true, publicData: true }); + const { fragments } = await createObject(bytes); + const packet = writer._packet(stored, 0, fragments[0].bytes, { purpose: 'public-relay', holder: 'public-relay' }); + assert.ok(wireBytes({ ...packet, from: sender.peerId, tsMs: Date.now() }) > 4096); + assert.equal(stored.warmPublished, 2); assert.ok(posts.length >= 4); + assert.ok(posts.every(item => !item.attachment && wireBytes(item.message) <= 4096)); + await writer.clearLocal(); + const reader = new LiveUorMeshDatabase({ transport: receiver }); + assert.equal(await reader.syncFromNetwork('30m', { publicData: true }), 1); + assert.deepEqual(reader.get(stored.addressHex).bytes, bytes); + assert.equal(reader.get(stored.addressHex).entry.manifest.manifestDigest, stored.manifest.manifestDigest); +}); + +test('actual signal WebSocket path reassembles large SDP and ignores stale/wrong-channel packets', async t => { + const posts = [], received = []; + class Socket { close() {} } + globals(t, { WebSocket: Socket, BroadcastChannel: undefined }); + t.mock.method(globalThis, 'fetch', async (_, options) => { posts.push(options.body); return { ok: true, status: 200 }; }); + const sender = new WebRtcTransportNode({ peerId: 'sender', channelKey: 'mesh' }); + const receiver = new WebRtcTransportNode({ peerId: 'receiver', channelKey: 'mesh' }); + t.after(() => { sender.close(); receiver.close(); }); + receiver.connect(); receiver.handleSignal = async msg => { received.push(normalize(msg)); }; + const payload = { kind: 'offer', to: (await receiver.signaling.identity()).id, targetSession: receiver.signaling.session, sdp: { type: 'offer', sdp: 'v=0\r\n'.repeat(2500) } }; + assert.equal(sender.sendSignal(payload), true); await drain(sender); + assert.ok(posts.length > 1 && posts.every(raw => wireBytes(raw) <= 4096)); + for (const raw of [...posts.slice().reverse(), ...posts]) await receiver.ws.onmessage({ data: JSON.stringify({ event: 'message', message: raw }) }); + assert.equal(received.length, 1); assert.deepEqual(received[0].payload.sdp, payload.sdp); + const oldSocket = receiver.ws; + receiver.connect('different'); + for (const raw of posts) { + await oldSocket.onmessage({ data: JSON.stringify({ event: 'message', message: raw }) }); + await receiver.ws.onmessage({ data: JSON.stringify({ event: 'message', message: raw }) }); + } + assert.equal(received.length, 1); +}); + +test('warm direct boundary requires explicit opt-in, and failed batches retain exact framed charges', async t => { + const posts = [], events = []; + t.mock.method(globalThis, 'fetch', async (_, options) => { posts.push(options.body); return { ok: false, status: 429 }; }); + const admission = policy(), node = new WebRtcTransportNode({ peerId: 'writer', admission, onEvent: event => events.push(event) }); + t.after(() => node.close()); + assert.equal(await node.publishWarmEnvelope({ data: 'private' }), false); + assert.deepEqual(await node.fetchWarmEnvelopes(), []); + assert.equal(posts.length, 0); assert.equal(admission.state.spent.requests, 0); + assert.equal(await node.publishWarmEnvelope({ data: 'x'.repeat(6000) }, { publicData: true }), false); + const outcome = events.find(event => event.type === 'relay_publish_result'); + assert.equal(outcome.outcome, 'refused'); assert.equal(outcome.httpStatus, 429); + assert.equal(outcome.attempted, 1); assert.ok(outcome.planned > 1); assert.equal(outcome.acknowledged, 0); + assert.equal(admission.state.spent.requests, outcome.planned); + const first = JSON.parse(posts[0]); + const expected = await frameRelayMessage(snapshotRelayMessage({ data: 'x'.repeat(6000), from: node.peerId, tsMs: first.t }), { + channelKey: node.channelKey, session: first.s, scope: 'warm', createdAtMs: first.t }); + assert.equal(admission.state.spent.transferBytes, expected.bytes); +}); + +test('consent withdrawal stops a partly published batch before another external effect', async t => { + let consent = true; + const gate = deferred(), entered = deferred(), posts = [], events = []; + t.mock.method(globalThis, 'fetch', async (_, options) => { posts.push(options.body); entered.resolve(); await gate.promise; return { ok: true, status: 200 }; }); + const node = new WebRtcTransportNode({ peerId: 'writer', onEvent: event => events.push(event) }); + t.after(() => node.close()); + const work = node.publishWarmEnvelope({ data: 'x'.repeat(6000) }, { publicData: true, consentCurrent: () => consent }); + await entered.promise; consent = false; gate.resolve(); + assert.equal(await work, false); assert.equal(posts.length, 1); + const outcome = events.find(event => event.type === 'relay_publish_result'); + assert.equal(outcome.outcome, 'partial'); assert.equal(outcome.acknowledged, 1); + assert.equal(node.admission.state.spent.requests, outcome.planned); +}); + +test('generation change before async digest dispatch sends no frames and spends no batch budget', async t => { + const posts = [], gate = deferred(), entered = deferred(), original = crypto.subtle.digest.bind(crypto.subtle); + t.mock.method(crypto.subtle, 'digest', async (...args) => { entered.resolve(); await gate.promise; return original(...args); }); + t.mock.method(globalThis, 'fetch', async (_, options) => { posts.push(options.body); return { ok: true, status: 200 }; }); + const node = new WebRtcTransportNode({ peerId: 'writer' }); + assert.equal(node.sendSignal({ kind: 'offer', sdp: { sdp: 'x'.repeat(6000) } }), true); + const work = drain(node); await entered.promise; + node.close(); gate.resolve(); await work; + assert.equal(posts.length, 0); assert.equal(node.admission.state.spent.requests, 0); assert.equal(node.relayPending.size, 0); +}); + +test('in-flight outbound work is bounded before asynchronous framing allocates more work', async t => { + const gate = deferred(), original = crypto.subtle.digest.bind(crypto.subtle); + t.mock.method(crypto.subtle, 'digest', async (...args) => { await gate.promise; return original(...args); }); + t.mock.method(globalThis, 'fetch', async () => ({ ok: true, status: 200 })); + const node = new WebRtcTransportNode({ peerId: 'writer' }); + for (let index = 0; index < RELAY_LIMITS.entries; index++) assert.equal(node.sendSignal({ kind: 'announce', index }), true); + assert.equal(node.sendSignal({ kind: 'announce', index: 999 }), false); + assert.equal(node.signalSigning.size, RELAY_LIMITS.entries); + node.close(); gate.resolve(); await drain(node); + assert.equal(node.relayPending.size, 0); +}); + +test('warm polling is single-flight, never follows attachments, drops incomplete data, and permits later complete recovery', async t => { + const gate = deferred(), entered = deferred(), encoded = await frame({ data: 'x'.repeat(6000) }, { createdAtMs: Date.now() }); + let calls = 0, complete = false; + t.mock.method(globalThis, 'fetch', async () => { + calls++; entered.resolve(); await gate.promise; + const frames = complete ? encoded.frames : encoded.frames.slice(0, 1); + return new Response([{ event: 'message', message: 'old attachment', attachment: { url: 'https://never.invalid' } }, + ...frames.map(message => ({ event: 'message', message }))].map(item => JSON.stringify(item)).join('\n')); + }); + const node = new WebRtcTransportNode({ peerId: 'reader', channelKey: 'mesh' }); + t.after(() => node.close()); + const work = node.fetchWarmEnvelopes('30m', { publicData: true }); await entered.promise; + assert.deepEqual(await node.fetchWarmEnvelopes('30m', { publicData: true }), []); + assert.equal(calls, 1); gate.resolve(); assert.deepEqual(await work, []); + complete = true; + const recovered = await node.fetchWarmEnvelopes('30m', { publicData: true }); + assert.equal(recovered.length, 1); assert.equal(recovered[0].data, 'x'.repeat(6000)); assert.equal(calls, 2); +}); + +test('expired/disposed verifications retain their bytes and shared admission until stalled digests settle', async t => { + let monotonic = 0; + const pool = new Map(); + const overhead = wireBytes({ from: 'remote', data: '' }); + const encoded = await frame({ data: 'x'.repeat(RELAY_LIMITS.messageBytes - overhead) }); + const receiver = assembler({ clock: () => monotonic, verificationPool: pool }); + const next = assembler({ clock: () => monotonic, verificationPool: pool }); + await Promise.all([receiver.channel, next.channel]); + const gate = deferred(), original = crypto.subtle.digest.bind(crypto.subtle); + t.mock.method(crypto.subtle, 'digest', async (...args) => { await gate.promise; return original(...args); }); + const pending = []; + for (let index = 0; index < RELAY_LIMITS.retainedBytes / RELAY_LIMITS.messageBytes; index++) { + const s = index.toString(16).padStart(32, '0'); + for (let chunk = 0; chunk < encoded.frames.length - 1; chunk++) await receiver.accept(alter(encoded.frames[chunk], { s })); + pending.push(receiver.accept(alter(encoded.frames.at(-1), { s }))); + // Reach the actual SHA await before admitting another complete message. + await new Promise(resolve => setImmediate(resolve)); + } + assert.equal(pool.size, 4); assert.equal(receiver.state.retainedBytes, RELAY_LIMITS.retainedBytes); + monotonic = RELAY_LIMITS.assemblyAge; + assert.equal(receiver.state.retainedBytes, RELAY_LIMITS.retainedBytes); + receiver.dispose(); + assert.equal(receiver.state.retainedBytes, RELAY_LIMITS.retainedBytes); + await assert.rejects(next.accept(alter(encoded.frames[0], { s: 'f'.repeat(32) })), code('relay-reassembly-capacity')); + gate.resolve(); + assert.deepEqual(await Promise.all(pending), [null, null, null, null]); + assert.equal(pool.size, 0); assert.equal(receiver.state.retainedBytes, 0); + assert.equal(await next.accept(alter(encoded.frames[0], { s: 'f'.repeat(32) })), null); + next.dispose(); +}); + +test('entire128KiB live object range survives framed relay without a contrived2048-byte cap', async t => { + const posts = []; + t.mock.method(globalThis, 'fetch', async (url, options) => { + if (options?.method === 'POST') { + const size = wireBytes(options.body); + // Model ntfy's documented long-body attachment conversion to catch regressions. + posts.push(size <= 4096 ? { event: 'message', message: options.body } : { event: 'message', message: 'attachment', attachment: { url: 'https://unused.invalid' } }); + return { ok: true, status: 200 }; + } + return new Response([...posts.slice().reverse(), posts[0]].map(item => JSON.stringify(item)).join('\n')); + }); + const sender = new WebRtcTransportNode({ peerId: 'writer', channelKey: 'mesh' }); + const receiver = new WebRtcTransportNode({ peerId: 'reader', channelKey: 'mesh' }); + t.after(() => { sender.close(); receiver.close(); }); + const writer = new LiveUorMeshDatabase({ transport: sender }); + const bytes = new Uint8Array(128 * 1024).fill(255); + const stored = await writer.put(bytes, { persistWarm: true, publicData: true }); + const { fragments } = await createObject(bytes); + const packet = writer._packet(stored, 0, fragments[0].bytes, { purpose: 'public-relay', holder: 'public-relay' }); + assert.ok(wireBytes({ ...packet, from: sender.peerId, tsMs: Date.now() }) > 4096); + assert.equal(stored.warmPublished, 2); assert.ok(posts.length >= 4); + assert.ok(posts.every(item => !item.attachment && wireBytes(item.message) <= 4096)); + await writer.clearLocal(); + const reader = new LiveUorMeshDatabase({ transport: receiver }); + assert.equal(await reader.syncFromNetwork('30m', { publicData: true }), 1); + assert.deepEqual(reader.get(stored.addressHex).bytes, bytes); + assert.equal(reader.get(stored.addressHex).entry.manifest.manifestDigest, stored.manifest.manifestDigest); +}); diff --git a/tests/run_all.js b/tests/run_all.js index 61ac78b..19aee7b 100644 --- a/tests/run_all.js +++ b/tests/run_all.js @@ -4,6 +4,7 @@ */ import assert from 'node:assert/strict'; +import { createCheckpoint, demoProgram } from '../src/layer4-compute/replay.js'; import { Datum, @@ -184,7 +185,7 @@ import { // Claim C2 & Objective O2: Cloudflare SRV/TXT writer + staleness measurement against TTL const cfCalls = []; let dohPolls = 0; - const mockDoh = new DohResolver({ + const mockDoh = new DohResolver({ format: "json", fetchImpl: async (url, opts) => { if (url.includes('api.cloudflare.com')) { cfCalls.push({ url, method: opts.method, body: JSON.parse(opts.body) }); @@ -200,7 +201,7 @@ import { ok: true, json: async () => ({ Status: 0, - Answer: [{ TTL: 30, data: `10 20 443 ${targetHost}` }] + Answer: [{ name: 'e1._stitch._udp.example.net.', type: 33, TTL: 30, data: `10 20 443 ${targetHost}` }] }) }; } @@ -238,13 +239,14 @@ import { network_pair_class: 'home<->mobile', success: i < 24, // 24/30 = 80% >= 60% used_turn: false, - ice_setup_sec: 1.8 + ice_setup_sec: 1.8, heartbeats_passed: i < 24 ? 10 : 2, qualification_elapsed_sec: 9, + ordered_channel: true, selected_path_observed: true }); } const c1Summary = logger.summarizeC1('home<->mobile'); assert.equal(c1Summary.trials, 30); assert.equal(c1Summary.direct_success_rate, 0.8); - assert.equal(c1Summary.c1_status, 'VERIFIED'); + assert.equal(c1Summary.c1_status, 'THRESHOLDS_MET'); assert.equal(logger.toJsonl().trim().split('\n').length, 30); } @@ -309,48 +311,32 @@ import { netA.handlers.push((from, msg) => dbA.handleMeshMessage(from, msg)); netB.handlers.push((from, msg) => dbB.handleMeshMessage(from, msg)); - const written = await dbA.put('state-across-zero-peer-gap', { label: 'kernel_state.txt', persistWarm: true }); - assert.equal(dbB.get(written.addressHex).ok, true); - assert.equal(dbB.get(written.addressHex).text, 'state-across-zero-peer-gap'); - assert.equal(mountedInVmB.length, 1); + const written = await dbA.put('state-across-zero-peer-gap', { label: 'kernel_state.txt', persistWarm: true, publicData: true }); + await new Promise(r => setTimeout(r, 20)); + assert.equal(dbB.get(written.addressHex).ok, false); // Only one assigned fragment, never fake full replication. + assert.equal(mountedInVmB.length, 0); // Destroy BOTH Peer A and Peer B (0 live peers online), then spawn Peer C and recover from warm buffer dbA.objects.clear(); dbB.objects.clear(); const netC = createWiredNode('node-C'); const dbC = new LiveUorMeshDatabase({ transport: netC }); - const recoveredCount = await dbC.syncFromNetwork(); + const recoveredCount = await dbC.syncFromNetwork('30m', { publicData: true }); assert.equal(recoveredCount, 1); assert.equal(dbC.get(written.addressHex).text, 'state-across-zero-peer-gap'); // 2. Peer A starts a 9-step compute job, crashes at step 3 (after checkpointing to warm bus), // and Peer C takes over from step 3, finishes steps 3..9, and verifies the 9-step UOR Trace! - const coordC = new LiveDistributedComputeCoordinator({ transport: netC, liveDb: dbC }); - // Simulate Peer A publishing checkpoint at step 3 before dying - const seed = Datum.w64(104729n); - const partial = executeProgramSlice({ - initialDatum: seed, - program: [ - { op: PrimitiveOp.ADD, arg: Datum.w64(257n) }, - { op: PrimitiveOp.XOR, arg: Datum.w64(0x9e3779b97f4a7c15n) }, - { op: PrimitiveOp.SUCC } - ] - }); - await netA.publishWarmEnvelope({ - type: 'compute_ckpt', - jobId: 'job-crash-test', - totalSteps: 9, - stepIndex: 3, - currentValueHex: '0x' + partial.datum.value.toString(16), - events: partial.events.map(e => ({ stepIndex: e.stepIndex, op: e.op, targetHex: e.target.toHex() })), - ownerPeerId: 'node-A-dead', - status: 'running' - }); + const coordC = new LiveDistributedComputeCoordinator({ transport: netC, liveDb: dbC, allowPublicRelay: true }); + // A canonical checkpoint identifies the complete program and input; replay checks its state. + const program = demoProgram(9); + await netA.publishWarmEnvelope({ type: 'compute_ckpt', jobId: 'job-crash-test', program, + checkpoint: await createCheckpoint(program, 3), ownerPeerId: 'node-A-dead' }); const resumedIds = await coordC.syncAndTakeOverJobs(); assert.deepEqual(resumedIds, ['job-crash-test']); // Wait for zero-delay takeover completion - await new Promise(r => setTimeout(r, 3000)); + await coordC.running.get('job-crash-test'); const completedJob = coordC.jobs.get('job-crash-test'); assert.equal(completedJob.status, 'completed'); assert.equal(completedJob.stepIndex, 9); diff --git a/tests/runtime-admission.test.js b/tests/runtime-admission.test.js new file mode 100644 index 0000000..6065f31 --- /dev/null +++ b/tests/runtime-admission.test.js @@ -0,0 +1,842 @@ +import { filesystemFixture } from './helpers/vm-filesystem.js'; +import { SyntheticAuthorityStore } from './helpers/transactional-authority.js'; +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { readFile } from 'node:fs/promises'; +import { installAuthorityControls } from '../src/authority-ui.js'; +import { installRecoveryControls } from '../src/recovery-ui.js'; +import { exportRecoveryBundle, recoveryObject } from '../src/recovery.js'; +import { createOperatorExperience, integrityLabel, executionLabel } from '../src/product-experience.js'; +import { placementStatus } from '../src/layer3-storage/custody.js'; +import { parseCanonicalJson } from '../src/layer1-uor/custody.js'; +import { ResourceAdmission, wireBytes, reserveNetwork } from '../src/layer2-schedulers/policy.js'; +import { generateAuthority, signPointer, PointerObserver, PointerPublisher, pointerDnsText, parsePointerDnsText } from '../src/layer1-uor/pointer.js'; +import { LiveUorMeshDatabase } from '../src/layer3-storage/index.js'; +import { LinuxVmNode, LiveDistributedComputeCoordinator } from '../src/layer4-compute/index.js'; +import { createCheckpoint, demoProgram, replayProgram } from '../src/layer4-compute/replay.js'; +import { DohResolver, WebRtcTransportNode, readBoundedText } from '../src/layer5-transport/index.js'; +import { BudgetPacedSurvivalScheduler } from '../src/layer2-schedulers/index.js'; +const code = expected => error => error.code === expected; +const limits = overrides => ({ requests: 100, transferBytes: 10000000, storageBytes: 100000, computeSteps: 10000, ...overrides }); +const admission = overrides => new ResourceAdmission({ clock: () => 0, durationMs: 100, limit: limits(overrides) }); +const transport = () => ({ peerId: 'local', sent: [], openPeers: () => [{ remoteId: 'remote' }], + sendToPeer(_, packet) { this.sent.push(packet); return true; }, + broadcast(packet) { this.sent.push(packet); return 1; }, + async publishWarmEnvelope(packet) { this.sent.push(packet); return true; }, + async fetchWarmEnvelopes() { return []; } }); + +test('effect admission reserves before work, keeps unknown charges, and never resets its epoch', () => { + let now = 5; + const policy = new ResourceAdmission({ clock: () => now, durationMs: 10, limit: limits({ requests: 1 }) }); + let effects = 0; + assert.throws(() => policy.run('place', { requests: 1 }, () => { effects++; throw Error('ambiguous'); }), /ambiguous/); + assert.equal(policy.state.spent.requests, 1); + assert.throws(() => policy.run('repair', { requests: 1 }, () => effects++), code('budget-exhausted')); + const exposed = policy.state; exposed.spent.requests = 0; exposed.limit.requests = 100; + assert.equal(policy.state.spent.requests, 1); + now = 4; + assert.throws(() => policy.reserve('refresh'), code('clock-regression')); + now = 15; + assert.throws(() => policy.reserve('refresh'), code('epoch-expired')); + assert.equal(effects, 1); +}); + +test('live storage refuses cache and outbound effects before their budgets can be exceeded', async () => { + const t = transport(); + const noCache = new LiveUorMeshDatabase({ transport: t, admission: admission({ storageBytes: 0 }) }); + await assert.rejects(noCache.put('secret'), code('budget-exhausted')); + assert.equal(noCache.objects.size, 0); assert.equal(t.sent.length, 0); + const noNetwork = new LiveUorMeshDatabase({ transport: t, admission: admission({ requests: 0 }) }); + await noNetwork.put('local only'); + assert.equal(t.sent.length, 0); + assert.equal(noNetwork.pendingTransfers.size, 0); + assert.equal([...noNetwork.placements.values()][0].requests[0].status, 'uncertain'); + await assert.rejects(noNetwork.syncFromNetwork(), code('budget-exhausted')); + assert.equal(t.sent.length, 0); +}); + +test('local wipe is ordered after pending writes, clears pending bytes, and cannot refund spent policy', async () => { + const t = transport(), policy = admission(); + const db = new LiveUorMeshDatabase({ transport: t, admission: policy }); + const original = new TextEncoder().encode('snapshot before queue'); + const work = db.put(original); original.fill(0); + const entry = await work; + assert.equal(db.get(entry.addressHex).text, 'snapshot before queue'); + const spent = policy.state.spent; + const second = db.put('queued second'); + await db.clearLocal(); await second; + assert.equal(db.objects.size, 0); assert.equal(db.placements.size, 0); assert.equal(db.pendingTransfers.size, 0); + assert.ok(policy.state.spent.storageBytes >= spent.storageBytes); + assert.ok(policy.state.spent.requests >= spent.requests); +}); + +test('live compute reserves every replay, and refusal prevents publishing or storing a claimed result', async () => { + const t = transport(), policy = admission({ computeSteps: 0 }); + let writes = 0; + const coordinator = new LiveDistributedComputeCoordinator({ transport: t, admission: policy, + liveDb: { put: async () => { writes++; return { addressHex: 'x' }; } } }); + const program = demoProgram(3), checkpoint = await createCheckpoint(program, 1); + assert.equal(await coordinator.ingestCheckpoint({ type: 'compute_ckpt', jobId: 'j', program, checkpoint, ownerPeerId: 'remote' }), false); + assert.equal(coordinator.jobs.size, 0); + await assert.rejects(coordinator.startOrResumeJob({ jobId: 'j', totalSteps: 3, stepDelayMs: 0 }), code('budget-exhausted')); + assert.equal(t.sent.length, 0); assert.equal(writes, 0); + assert.throws(() => replayProgram(program, 3, admission({ computeSteps: 2 })), code('budget-exhausted')); + const full = admission(); + replayProgram(program, 3, full); + assert.equal(full.state.spent.computeSteps, 3); +}); + +test('real WebRTC and DNS adapters share request/UTF-8 limits, including failed sends', async () => { + const policy = admission({ requests: 1, transferBytes: 1000 }); + const events = []; + const node = new WebRtcTransportNode({ peerId: 'p', admission: policy, onEvent: e => events.push(e) }); + let sends = 0, fetches = 0; + node.peers.set('r', { dc: { readyState: 'open', send: () => { sends++; throw Error('uncertain'); }, close() { this.readyState = 'closed'; } } }); + const packet = { type: 'data', value: '☃' }; + assert.equal(node.sendToPeer('r', packet), true, 'accepted queue reports the unknown browser send outcome separately'); + assert.ok(events.some(e => e.type === 'channel_send_result' && e.outcome === 'unknown')); + assert.equal(node.sendToPeer('r', packet), false, 'poisoned channel is not replayed'); + assert.equal(policy.state.spent.transferBytes, wireBytes(packet)); + assert.equal(policy.state.spent.requests, 1); + node.peers.set('r', { dc: { readyState: 'open', send: () => { sends++; }, close() { this.readyState = 'closed'; } } }); + assert.throws(() => node.sendToPeer('r', packet), code('budget-exhausted')); + node.close(); + const dns = new DohResolver({ admission: policy, fetchImpl: async () => { fetches++; return new Response('{}'); } }); + await assert.rejects(dns.resolve('example.test'), code('budget-exhausted')); + await assert.rejects(dns.writeCloudflareRecord({ zoneId: 'z', apiToken: 't', name: 'example.test' }), code('budget-exhausted')); + assert.equal(sends, 1); assert.equal(fetches, 0); +}); + +test('response readers cancel oversized streaming bodies and relay failure keeps its charge', async () => { + let cancelled = false; + const body = new ReadableStream({ start(c) { c.enqueue(new Uint8Array(20)); }, cancel() { cancelled = true; } }); + await assert.rejects(readBoundedText(new Response(body), 10), code('response-limit')); + assert.equal(cancelled, true); + const savedFetch = globalThis.fetch; + let fetches = 0; + try { + globalThis.fetch = async () => { fetches++; throw Error('uncertain'); }; + const policy = admission({ requests: 1 }); + const node = new WebRtcTransportNode({ peerId: 'p', admission: policy }); + assert.equal(await node.publishWarmEnvelope({ type: 'test' }, { publicData: true }), false); + assert.equal(await node.publishWarmEnvelope({ type: 'test' }, { publicData: true }), false); + assert.equal(fetches, 1); assert.equal(policy.state.spent.requests, 1); + } finally { globalThis.fetch = savedFetch; } +}); + +test('warm compute recovery accepts only bounded delivery metadata without treating it as authority', async () => { + const program = demoProgram(5), checkpoint = await createCheckpoint(program, 3); + const packet = { type: 'compute_ckpt', jobId: 'j', program, checkpoint, ownerPeerId: 'remote', from: 'delivery-peer', tsMs: 10 }; + const t = transport(); t.fetchWarmEnvelopes = async () => [packet]; + const c = new LiveDistributedComputeCoordinator({ transport: t, admission: admission(), allowPublicRelay: true, + liveDb: { put: async () => ({ addressHex: 'x' }) } }); + assert.deepEqual(await c.syncAndTakeOverJobs(), []); + assert.equal(c.jobs.get('j').stepIndex, 3); + assert.equal(c.jobs.get('j').ownerPeerId, 'remote'); + const bad = new LiveDistributedComputeCoordinator({ transport: { ...t, fetchWarmEnvelopes: async () => [{ ...packet, injected: true }] }, + admission: admission(), allowPublicRelay: true, liveDb: {} }); + assert.deepEqual(await bad.syncAndTakeOverJobs(), []); + assert.equal(bad.jobs.size, 0); +}); + +test('retained pointer heads serialize forks, reject foreign pins, and preserve complete multipart DNS roots', async () => { + const authority = await generateAuthority(); + const make = (revision, previousDigest) => signPointer({ version: 1, name: 'state.example.test', authorityKey: authority.publicKey, + revision, previousDigest, objectRoot: 'sha256:' + 'f'.repeat(64), validFromMs: 0, validUntilMs: 100 }, authority.privateKey); + const observer = new PointerObserver({ name: 'state.example.test', trustedAuthorityKey: authority.publicKey, clock: () => 5, admission: admission() }); + const first = await make(0, null); + assert.deepEqual(parsePointerDnsText(pointerDnsText(first)), first); + assert.ok(pointerDnsText(first).length > 255); + await observer.admit(first); + const next = await make(1, first.pointerDigest); + const outcomes = await Promise.allSettled([observer.admit(next), observer.admit(next)]); + assert.equal(outcomes.filter(x => x.status === 'fulfilled').length, 1); + assert.equal(observer.head.revision, 1); + const snapshot = observer.head; snapshot.revision = 0; + assert.equal(observer.head.revision, 1); + await assert.rejects(observer.admit(first), code('pointer-conflict')); + const attacker = await generateAuthority(); + const foreign = new PointerObserver({ name: 'state.example.test', trustedAuthorityKey: attacker.publicKey, clock: () => 5 }); + await assert.rejects(foreign.admit(first), code('wrong-authority')); + const noCache = new PointerObserver({ name: 'state.example.test', trustedAuthorityKey: authority.publicKey, clock: () => 5, + admission: admission({ storageBytes: 0 }) }); + await assert.rejects(noCache.admit(first), code('budget-exhausted')); + assert.equal(noCache.head, null); +}); + +async function browserHarness({ AdmissionClass = ResourceAdmission, AuthorityClass = SyntheticAuthorityStore, VmClass = null, publicationMode = 'success' } = {}) { + const html = await readFile(new URL('../index.html', import.meta.url), 'utf8'); + const script = html.match(/