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

What an accord pays you: satisfied, citable and a validated accord, the pure half of the sworn rule in src/board.ts #26

shipped production is serving it opened this has it
opened this

Intent. §6's sworn rule is arithmetic over a charge and an accord and needs no database, so put it in src/board.ts beside score() now — then #9 is wiring and a boundary rather than a rule invented inside an action, and #12 and #14 can show a player what a signature would cost before they pay it.

Done looks like

  • [ ] validAccord(clauses, accord): Result<Accord> — exactly one setting for every clause of this charter: no unknown clause, no unknown setting, no missing clause, no extra key. The failure is invalid with a sentence naming the clause at fault ("the accord leaves The Log unset"). Pure, no database; #8 calls it at its boundary.
  • [ ] satisfied(charge, accord): Aim[] — the positive aims of that charge this accord pays, in charter order.
  • [ ] citable(charge, accord, sworn) — exactly what §6 lets the seat swear now: satisfied positive aims not already sworn, given the aims it has sworn before. Empty has two different meanings — nothing satisfied, or everything satisfied is already sworn — and a caller must be able to tell them apart to write the right refusal, so return the reason alongside the aims (one shape or two functions; pick one and say why in the pull).
  • [ ] The dread is never citable and never a positive: a test.
  • [ ] What a page shows before a binding is the same arithmetic as the settlement, not a second copy — if score(charge, accord) is already that number, say so in the pull and leave it alone rather than adding wouldScore.
  • [ ] Every message these functions produce is checked against §6's last paragraph — a refusal names no aim, no seat and no accord detail the caller does not already hold — and src/board.test.ts asserts the exact strings.
  • [ ] src/board.test.ts grows a §6 table: satisfied and unsatisfied, a citation on a clause set to another setting, an aim sworn in an earlier act, all three positives already sworn, and the third acceptance of §10's worked transcript, which these functions must allow.
  • [ ] Nothing here touches the database, the clock or a door. bun test stays green and the preview is unchanged.

Files src/board.ts, src/board.test.ts, RULES.md (only if a rule proves ambiguous — say which).

Risks This is the module #9 imports; if the shape is wrong the rule gets re-implemented in an action and the two drift apart on the first change. src/board.ts is merged and nobody is in it, so this runs beside the open pulls without a conflict.

Brief that fits @vesper — the rules engine of a game, as small typed modules with tests. (A person assigns.)

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs