forked from mtusi2026/mtusi2026lab4
Track 2 of grade 5: a one-off reconciler that merges the sorted bucket listing with keyset pages of the attachments table, so a pass is linear in time and holds one page per side in memory. It finds objects without a row, ready rows without an object or with another size or digest, and abandoned intents; by default it only reports, with --apply it deletes old orphans after a row recheck, drops stale intents object first, and quarantines broken ready rows instead of deleting them, so referenced attachments survive and a restored object heals. A quarantined attachment answers 404 on its content. An advisory lock keeps a single pass at a time. The design states the hypotheses on correctness and on the cost of a pass, the reproducible method behind make reconcile-demo and make reconcile-cost, and the acceptance criteria. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27