Skip to content

Snapshot part in the app: canonical bytes, address and patch, held to their oracles - #158

Merged
github-actions[bot] merged 3 commits into
mainfrom
claude/project-thread-5w17x2
Nov 16, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
claude/project-thread-5w17x2

Conversation

@afflom

@afflom afflom commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Requested by Alex · project thread

What

Slices 1 to 3 proved the snapshot standards as generators. This slice moves them into the Prism itself, as a part the page can call.

  • app/src/PrismSnapshot.lex.tex is the snapshot part. It is assembled mechanically from the modules generators/snapshot already proves (GenPatch, GenJcs, Sha256), without the archive harness.
  • Guest snapshot (app/specs/guests/snapshot/snapshot.json, site/snapshot/guest.mjs, pinned wasm) answers four requests. The first line names the operation and the rest is its body.
    • canonical: the RFC 8785 bytes of a JSON state, or not I-JSON.
    • address: sha256: and the FIPS 180-4 SHA-256 of those bytes (the UOR u:digest).
    • apply: [document, patch] gives the patched state in canonical form, or the patch does not apply (RFC 6902, all or nothing).
    • sha256: a NIST CAVP Len and Msg pair gives its MD line.
  • The guest's 94 acceptance vectors (app/specs/snapshot/spec.json) are not written by hand. A new step of generators/snapshot, snapshotvectors (module GenVec), writes them from the oracles under app/specs/oracle/:
    • 17 apply vectors: every case of json-patch-tests spec_tests.json (RFC 6902 Appendix A).
    • 6 canonical and 6 address vectors: every input of the RFC 8785 author's test data.
    • 65 sha256 vectors: every message of NIST CAVP SHA256ShortMsg.rsp.
  • ST-01 register (app/specs/standards/register/rfc{8785,6902,6901}.json):
    • RFC 8785, RFC 6902 and RFC 6901 are pinned by hash and measured with the bcp14 generator: 27, 18 and 3 requirements.
    • 13 of RFC 8785's and 5 of RFC 6902's are claimed as enforced. Each claim names the oracle vector that holds it. The other 30 are listed as debt.
    • FIPS 180-4 is not registered here. Its entry comes with the shared app/src/Sha256 module from the nervous-system work, and this part will then import that module. NIST's CAVP vectors hold the SHA-256 here meanwhile.
  • generators/snapshot's dispatch is split in two definitions. One long chain hit the code generator's recursion depth in the native build.

Evidence

  • lexlean verify and prismpm build pass for the guest: all 94 vectors run against the built wasm. A second build from the committed source gave the same wasm, byte for byte (041b56c0…9768).
  • lexlean verify passes on 12 modules of generators/snapshot and prismpm build passes its vectors.
  • A scratch Python reading of the same oracles gave the same 94 vectors, except one. For Appendix A.13 (an operation with two op members) the generator keeps the oracle's bytes, where Python's parser drops the duplicate. The generator's is the faithful one.
  • Planted defects:
    • One word changed in an oracle output: GN-01 refused (french.json: not its canonical output).
    • One vector changed in spec.json: GU-01 refused (snapshot: its modules, vectors or limits changed since it was built).
  • After merging main at 0c2b4e9 (per-item guest and standards registers), these pass locally: cargo test -p repo-conformance (all suites), tools/generators/run.sh and --check, tools/guests/gen.py check (36 current), tools/standards/gate.py --check --base origin/main, tools/handwritten/gate.py --check (none added or grown) and xtask audit-pii.

Not in this slice

  • The 30 requirements left as debt. Most are already exercised by the full 112-case json-patch-tests run in generators/snapshot. They become enforced once those cases are also guest vectors, which is next.
  • The two new parts are in the parts debt until a journey calls them.
  • UOR state:Context and state:Transition records, PROV lineage, and one SCXML macrostep in giving one snapshot out.

🤖 Generated with Claude Code

https://claude.ai/code/session_013Asa3Q2QJSrxDiN12Nqa8A

… their oracles

app/src/PrismSnapshot.lex.tex is the Prism's snapshot part, assembled
from the modules generators/snapshot already proves: RFC 8785 canonical
bytes, the UOR digest address (sha256: and the FIPS 180-4 SHA-256 of
those bytes), and the RFC 6902 patch from one state to the next. Its
guest "snapshot" answers canonical, address, apply and sha256.

Its 94 acceptance vectors (app/specs/snapshot/spec.json) are written by
a new generators/snapshot step, snapshotvectors, from the oracles: the
17 RFC 6902 Appendix A cases of json-patch-tests, the 6 inputs of the
RFC 8785 author's test data (canonical and address), and the 65 NIST
CAVP ShortMsg messages. GN-01 holds the file; GU-01 holds the wasm.

ST-01: RFC 8785, RFC 6902 and RFC 6901 are pinned and measured (13 of
27, 5 of 18, 0 of 3 enforced, each claim naming the oracle vector that
holds it; the rest is debt). FIPS 180-4 is registered, unpinned until
an extractor reads NIST's PDF.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3Q2QJSrxDiN12Nqa8A
@github-actions

Copy link
Copy Markdown
Contributor

Merge train notice: the merge train merges this pull request once it is green on current main; don't enable auto-merge.


Generated by Claude Code

…extractor

Main replaced tools/standards/extract/bcp14.py with generators/bcp14.
RFC 8785, 6902 and 6901 get their steps there and their inventories
name the generated files; the requirement ids are unchanged (27, 18, 3).
The guests spec and lock keep main's new guests and add snapshot.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3Q2QJSrxDiN12Nqa8A
… registers

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3Q2QJSrxDiN12Nqa8A
@github-actions
github-actions Bot merged commit fe7ec04 into main Nov 16, 2026
7 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Live: this change is on the published page, as main fe7ec040132bcad07dcfafb0fa4dc2b07cd86c78.

The publish job opened the published page in a fresh Chromium and its live checks passed (PG-01, PD-01, PD-02): https://github.com/afflom/me/actions/runs/43977249372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants