Modules 05–06 / Own the evidence boundary
Which bytes?
Which history?
Build a package check that can stop the wrong runtime, then a replay policy that refuses incomplete evidence. Both become source files you can run and test.
Owned local teaching project · Node 22+ for coding · phone reading and worked demonstrations supported
05 / FROM A CLAIM TO AN OBSERVATION
A hash compares bytes. Trust chooses the reference.
A digest is a fixed-size result computed from bytes. This project uses SHA-256. A manifest lists approved file paths, digests and a release identifier. The observer reads the owned files; the policy compares those observations with the approved manifest before the launcher starts the server.
Who may change this?
What is actually on disk?
Start or refuse.
The manifest is trusted because of the workflow that supplies it, not because it contains hashes. If the same owner changes both the files and the reference, a match cannot establish that the owner is trustworthy. This lab has no remote attestation or signing authority. Its boundary is an approved local reference versus an observed owned package.
WORKED INPUTS / NOT A SUBMISSION
Validate the reference and supported-list shapes first, then check release support, compare the complete path inventory, and finally compare digests. This order determines the first refusal reason. A match establishes agreement between these two inputs. It does not establish that observations came from a trusted file reader or authenticate who approved the reference. Compare that limit with your saved prediction and append a revision if needed.
05 / CONSTRUCT AND TEST
Make the launcher earn its decision.
From the complete reference project, prepare your independent source exercise:
npm run core:prepare -- integrity
Change into the printed workspace. Read integrity/LEARNER.md, record predictions in response.md, and implement integrity/policy.mjs. The supplied observer performs bounded file reads and hashing. Your policy must check shape, supported release, inventory and digests; do not replace the approved reference with the observed values.
npm run core:check -- --assistance "none"
Use an accurate assistance declaration. The checker runs your captured policy against actual owned-file observations and independent expected results. A missing file, a changed byte and an unsupported release are different failure cases. Correct policies must also admit unchanged packages and approved updates.
Run npm run start:verified in the reference project to see the real launcher check its inventory before starting HTTP. For the failure experiment, use the exercise instructions' disposable package copy; keep the approved reference unchanged. Editing your own package here is an explicit test fixture, never an instruction to modify someone else's game.
06 / REPRODUCE A DECISION
A final score leaves out the route.
A causal event is an operation needed to reproduce later state: joining, admitting an input, or taking a simulation tick. A checkpoint records the state just before a retained event window. It includes pending intent, expiry, cooldown and detector history as well as visible position and score. Omitting pending interaction can change the next tick even when two screenshots look identical.
The recorder keeps a bounded window. Before it runs out of room, it saves a new checkpoint and begins a new complete window. Absolute event indices make missing, duplicated or reordered entries visible. Replay restores the checkpoint, applies each event in order and compares the resulting state with the recorded final state.
- Boundary 128Checkpoint is the state before event 129.
- Events 129…221Every index appears once, in order.
- Apply the windowRestore private intent and detector history too.
- Compare finalA matching result proves internal consistency.
A gap such as 129, 131 refuses with sequence. An unknown runtime refuses with incompatible. A different final state refuses with final.
RECORDED OWNED GAME / WORKED DEMONSTRATION
These saved inputs, verdicts and playback frames came from the owned Node game and its replay checker. This browser displays recorded results; the CLI commands below recompute them. Browser playback is an inspectable teaching aid and does not authenticate the record's author. A consistent record can still be fabricated by someone who controls its checkpoint, events and final state. A refused record establishes insufficient or inconsistent evidence, not a player's intent.
06 / CONSTRUCT AND TEST
Refuse a story you cannot reproduce.
npm run core:prepare -- telemetry
In the printed workspace, read telemetry/LEARNER.md and implement telemetry/policy.mjs. The supplied engine facade validates checkpoint shape and applies operations. Your policy checks release compatibility, completeness and contiguous event indices, then orchestrates replay and compares the final state. The source exercise's tests include complete rollover windows; rejecting every nonzero starting index is wrong.
npm run core:check -- --assistance "none"
For an actual server capture, run npm run trace:sample -- artifacts/session-window.json from the reference project. Then run npm run window:replay -- artifacts/session-window.json. The capture script owns a private test clock while its game inputs cross HTTP. No gameplay endpoint lets a client advance time or export other sessions.
Keep all first submissions, feedback and repairs. The checker grades executable behavior; the written transfer needs review. Later modules use these records to measure a detector and decide what evidence to retain.
Reading and limits
For the concrete APIs, see the official Node hash documentation and file-reading documentation. The manifest, event format and exercises are original teaching designs. The process/IPC context continues the reading pointers from the earlier lesson.
Return to the complete course map →