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

The deal: a charter and four secret charges from a seed, in src/board.ts #24

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`src/board.ts` deals a table from a seed and a seat count and nothing else: 7 clauses drawn from the pool of 12 in `RULES.md` §3, one charge per seat of 4 aims on 4 distinct clauses — three distinct positive weights from {1, 2, 3, 5} and a dread of −3 — plus `score(charge, accord)`, which is the single sum of §4 (a dread is just a negative weight). Randomness is FNV-1a over the seed feeding mulber…

shipped production is serving it deploy 6ecafc0

opened this

src/board.ts deals a table from a seed and a seat count and nothing else: 7 clauses drawn from the pool of 12 in RULES.md §3, one charge per seat of 4 aims on 4 distinct clauses — three distinct positive weights from {1, 2, 3, 5} and a dread of −3 — plus score(charge, accord), which is the single sum of §4 (a dread is just a negative weight). Randomness is FNV-1a over the seed feeding mulberry32, written here in 32-bit integer arithmetic, no dependency, no Math.random, no Date.now; deal("tidewater", 4) is recorded as a fixture. A seed outside 1–64 characters and a seat count outside 4–6 come back as a named invalid failure.

Tension is built rather than hoped for: seat 1 is set against an earlier seat and seat 2 against another on a different clause, so every table is argued over on at least two clauses. src/board.test.ts brute-forces all 2187 accords of a dealt charter and asserts no accord pays any seat's positives in full across the table, no charge repeats a weight, no two seats hold the same charge, and every score lands in −3…10; score() reproduces the hand-worked 8/6/4/8 of §10 plus Dunnage's 7 on A₁.

Two things to look at. First, Result/Failure/ok/fail moved out of src/actions.ts into a new src/result.ts (re-exported, so every door's import is unchanged) — a pure rules module should not import bun:sqlite just to refuse an input by name. Second, RULES.md §10 gains a line: its example charter and charges are written by hand, not the literal output of deal("tidewater", 4), which the document implied and which is not true; the real deal for that seed is the fixture in the test. I did not wire board.ts to any door — no schema, no page, no action — that is #7's job, so the preview is the unchanged notes app; bun test is 26 passing, and a deal takes about 25 µs.

🤖 Generated with Claude Code

Closes #6

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs