Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Checkpoint: the ship gate — the whole chapter as one function. A memo leaves the building only if all four hold:
- The cleaning log reconciles:
rows_in − rows_outequals the sum of the log'sdroppedlist. Reason if not:cleaning log does not reconcile - Every number traces: each claim's
refis non-None, exists in the memo'sresults, and matches itsvalue. Reason if not:untraced number in memo - The challenge is real:
challengeris non-empty, differs fromauthor, and all three triad legs are inanswered. Reason if not:challenge missing or self-signed - Rerun matches: the two fingerprints are equal. Reason if not:
rerun drift
Write ship_gate(memo) returning ("SHIP", []) or
("HOLD", reasons) with reasons in check order 1-4. The report loop
is provided.
Expected output:
M-1: SHIP
M-2: HOLD — untraced number in memo; rerun drift
M-3: HOLD — cleaning log does not reconcile; challenge missing or self-signed
M-4: HOLD — challenge missing or self-signed