Public: anyone can read this; the crew can change it.

The accord binds: quorum, scoring, and the reveal #10

open not picked up yet opened this
opened this

Intent. When acceptances reach the quorum the deal is struck: the table settles, every seat is scored whether they signed or not, and the whole truth comes out.

Done looks like

  • [ ] After every acceptance the engine counts acceptances of the standing offer; at ⌈n/2⌉+1 the game moves to settled, records settled_at, stores the binding accord, and no further act is accepted at any door.
  • [ ] Every seat is scored with score() from src/board.ts against the binding accord and the score is written to seat.score — the record is fixed at settlement, not recomputed on read.
  • [ ] The reveal: after settlement tableState shows every charge, every seat's score and the ranking, and each said claim carries a verdict — true or false, judged against the charge that made it.
  • [ ] A verdict is computed once, at settlement, into claim.verdict, with worth mapped as RULES.md says (none = no aim, small = 1–2, large = 3–5, dread = the −3 aim).
  • [ ] emit("table.settled", …), and the page region showing the table updates live for everyone watching.
  • [ ] Tests: a four-seat table reaches quorum on the third acceptance and not the second; the scores match a hand calculation from RULES.md; a seat that never accepted is still scored; a true and a false said claim get the right verdicts.

Files src/actions.ts, src/actions.test.ts, src/board.ts, src/server.test.ts.

Risks Settlement is the one irreversible write — do it in a single transaction with the acceptance that triggered it, or two simultaneous accepts settle twice. A guest reading mid-settlement must never see a half-revealed table.

Brief that fits @vesper — a game state that ends cleanly and saves what happened. (A person assigns.)

commented

Amended by the planner, now that #36 is merged. binds, ending, settlement and the verdict mapping are written and tested against §10 in src/round.ts, so this issue is the transaction and the record, not the arithmetic.

  • After an acceptance, build the Round and ask binds. When it says the accord is struck, write the settlement settlement() returns — status, settled_at, the binding accord, every seat's score, every said claim's verdict — in one transaction with the acceptance that triggered it, so two simultaneous accepts cannot settle twice.
  • The scores and verdicts are stored, not recomputed on read: settlement() is the source, the rows are the record, and a test asserts a settled table reads the same after the process restarts.
  • The reveal is tableState after settlement: every charge, every score, the ranking with ties sharing a rank, every said claim marked true or false. A guest sees the same reveal as a player — that is the point of the game — and a test asserts a mid-settlement read never shows half of it.
  • src/example.ts is §10's table; the hand calculation 8/6/4/8 and the false claim at the reveal are already asserted in round.test.ts, so this issue's tests are about rows and transactions, not about numbers.

The checklist otherwise stands.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs