VB-1598: Fair: an offer still open when the fair ends lapses with it
Status: done (2026-11-24)
Priority: 2
Size: S
Design ref: design.md, The fair; backlog/VB-1584.md
Goal: no offer of the fair outlives the loads it was made from
Acceptance criteria:
Noted by VB-1584, 24 November 2026.
VB-1598, 24 November 2026:
- The lapse is in
unload itself, so it also covers a dealer who dies with a swap open (the why is then “ has died", else "the fair is over"); told by sim/offers' default lapse line (`offerLapsed`). The prompt is a view of `st.offers` (sim/opportunities), so it closes with the offer.
- Decision (close call): the guard VB-1584 put in the basis’s weigh is removed, not kept beside the lapse:
unload is the only place a load ends, and a guard never reached would hide the next such fault. In its place the invariants check it: an open swap’s two dealers carry loads.
- The invariants had no branch for a swap: an open one was read as a gift or an ask and reported malformed (no test saw it: tests/fair.js filters by “fair”). It has its own branch now.
- The check is in tests/fair.js, on a saved copy of its run at the last day’s close of dealing; without the lapse it throws in weigh. tests/fair.js is in the integration tier, not
npm test.
- No counter: the scan is of the open offers, once per load unpacked.