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
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Intent. §6's sworn rule is arithmetic over a charge and an accord and needs no database, so put it in
src/board.tsbesidescore()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 isinvalidwith 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).score(charge, accord)is already that number, say so in the pull and leave it alone rather than addingwouldScore.src/board.test.tsasserts the exact strings.src/board.test.tsgrows 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.bun teststays 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.tsis 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.)