feat(item-delivery): reload persisted ledgers after restart - #110
feat(item-delivery): reload persisted ledgers after restart#110cursor[bot] wants to merge 3 commits into
Conversation
Reconstruct the stored tenant, release, locale, digest, allowed item set, and monotonic delivery prefix so a later deliver continues the same form. Exact replay stays Duplicate. Tenant rebinding and gapped sequences fail closed. Recovery COPY/restore covers the delivery tables. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
There was a problem hiding this comment.
Stale comment
Item-delivery reload is the right buyer slice: persist already exists on main, and a restart must reconstruct the stored prefix so a later
delivercannot invent a new form. Domainfrom_durable_evidence/from_durable_events,load_item_delivery_ledgerunder READ COMMITTED, tenant mismatch as ConflictingReplay, and recovery COPY ofitem_delivery_ledger/item_delivery_eventmatch the persist contract.Do not merge this draft. Exact-head Runtime CI, 100% owned line/branch coverage, and an independent last-push review are still required. This review is not that approval.
Must-fix before merge:
is_canonical_sha256is new production code and the contract tests only feedsha256:not-a-digest(prefix present, length != 64). Thestrip_prefixmiss path and the 64-byte non-hex.all()path are unexercised. This repository fails closed on incomplete branch coverage, so Production branch coverage will reject75baceeuntil those cases exist.Keep out of this PR: session item-set authority (#99 / #94), HTTP delivery, and
instrument_version_refon the ledger header.Operator next action: add the two digest-reconstruction cases, re-run
cargo test --test item_delivery_contractand the coverage jobs on the unchanged head, then request an independent last-push review. After merge, callload_item_delivery_ledgerbeforedeliverso a restarted worker continues the stored form.Sent by Cursor Automation: Fix Issues
Absorb the #110 recovery fixture so COPY/restore proves delivered items survive backup and cannot be replayed under a conflicting identity. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
There was a problem hiding this comment.
Review (COMMENT)
This slice is real: persist exists on main, and a restart must reconstruct already-shown items. Prefer #186 60ca077 as the landing vehicle instead of merging this head in parallel.
#186 keeps the same buyer outcome and adds:
FOR SHAREon the ledger header, with honest rustdoc that persist still does not takeFOR UPDATE- exact-spelling session/tenant aliases (whitespace padding fails closed)
- tenant-scoped event load, not session-only
- dedicated restart-reload fixtures plus the recovery COPY/restore identity proof that started here
- ADR-0015 / ERD / UML / as-built schema updates
Do not merge #110 and #186 together. Independent last-push review still gates #186. Do not self-approve.
Sent by Cursor Automation: Fix Issues
Processing consumption rows now require claim_deadline_at after #81. Seed the wall-clock deadline and prove binary restore preserves it.
|
Exact-head The previous Runtime CI fail was on |


Superseded
Close this predecessor without merge. The restart/reload product slice moved through #186/#216 and is now carried by #224; the unrelated inbox recovery fixture has its own bounded vehicle on #177.
Fresh evidence immediately before closure:
cbba9a2ba5d88dbda0b3e8841bae8028985fdb729b47a0f779b53f98fffd9fffff65120a1c3761e6main:a7637351be8f0f90c12651d3bcafd959bc52ac81claim_deadline_atrecovery-fixture change is intentionally separated on test(recovery): preserve inbox claim deadline evidence #177 and must not keep an obsolete item-delivery predecessor open.Do not merge this predecessor in parallel with the successor line.