v0.7.9.6 — three things the engine knew and the screen did not

Found by looking rather than by being told. Gitea#21, #22, #94 and #96
were four instances of one fault in a row — the engine gains something
that changes what a train may do, and nothing draws it — and every one
was found by a player hitting it. So instead of waiting for the fifth,
every field of GameState and its nested types was enumerated, checked for
a reader in sim/view.ts, src/web/ and sim/narrate.ts, and the survivors
verified BY RUNNING THE ENGINE rather than by trusting the grep.

Four fields had no reader. `movedThisPhase` lives and dies inside one
`advance` call and is nobody's business. The other three are below. What
was ruled out matters as much: `freightWorked`, `drawnThisTurn`,
`freightAgentUsed`, `switchedSince` and `movesUsed` are invisible on
purpose, their effect already showing as legality or as a complement
already on the Frame. A field is not a display gap merely because nothing
renders it.

#98 — the Crew Tray pool. §7 scarcity is called an explicit mechanic and
was explicit only in the engine. The blocked panel had one tray rule,
keyed off the train due out this Stage, so a player who spent a card on
an Extra or ordered a second section got an EMPTY panel while their train
sat behind an exhausted pool — both having been announced once in the log
in a line promising a future event that nothing then confirmed. The
shared table carries the pool and the queue now, so the common board gets
it too, and the panel reports all three with the count beside them.

#99 — a train held at the Limits vanished off the board, and this one had
shipped. The Interlocking stops an inbound train on the Limit Track
rather than colliding with a full Office. `arriveAtOffice` removes the
tray from the Mainline node's `transits` and the Interlocking branch
pushes it onto `heldAtLimits` without assigning `tray.position` — and the
map draws mainline nodes from `transits` and squares from
`position.at === 'grid'`, so between the two it was drawn in NEITHER. It
disappeared on arrival and reappeared in the Office some Stages later.
Fixed in the view: the engine is right, and `position` is left alone
deliberately so nothing treats the train as standing somewhere it could
be switched from.

#100 — the Campaign Train's speeches change its rules, and the card said
the same thing before and after. Worse, the "EXPEDITED ... costs 1
Revenue" warning prints only under `rules.expedite`, so X17 became
subject to a fault whose warning the game shows to every other expedited
train and never to it. `trainRules` reads `speechMade` now and borrows
`isExpedited` from advance.ts rather than restating the test.

#45 — the 0.7.9 dead-field audit, finished, and the answer was different
for each. `overHandLimit` is WIRED: its consumer existed all along and
was inferring the hand limit from the ABSENCE of `draw.end` in the menu,
which is sound only while `check` keeps refusing for exactly three
reasons. `viewerSeat` is DOCUMENTED, with a condition — Gitea#20's board
keys districts by seat, and the note says to delete it if step 2 ships
without using it.

The audit had missed a third limb. `game.mustPlayCard` was assigned on
every submit and read by nothing: deleted. Chasing it turned up the thing
worth fixing — the §6.2 hand-limit test existed in THREE places, all
agreeing, which is the state #96's disagreement started from. One
`overHandLimit(state, player)` in state.ts now, and the other two ask it.
`Session.overHandLimit()` is deleted rather than kept: the Frame already
carries the fact, so the method was a second path to it.

934 tests pass, up from 917. The 17 new ones were written red, and each
fix checked by mutation: reverting `speechMade` fails 2, dropping the
held-train projection fails 4, forgetting the tray queues fails 2. The
empty blocked panel is reported beside its positive control, since an
empty result from a broken function proves nothing.

NOT VERIFIED AT A TABLE. Engine and view work, checked by tests and by
running the engine. #39 and #35 still stand.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5boPxP6JHRYMm8adXaF5R
This commit is contained in:
Jesse.Markowitz
2026-09-07 21:29:16 -04:00
co-authored by Claude Opus 5
parent d5445badcc
commit 7f4e027258
15 changed files with 685 additions and 52 deletions
+111
View File
@@ -19,6 +19,117 @@ page as `v0.1.0 · <sha> · <date>`, so what is deployed can always be identifie
---
## 0.7.9.6 — 2026-09-07
Three things the engine knew and the screen did not, found by looking for them rather than by
waiting to be told — plus the dead-field audit from 0.7.9 finished off.
### The method, first, because it is the part that generalises
Gitea#21, Gitea#22, #94 and #96 were four instances of one fault in a row: the engine gains something
that changes what a train may do, and nothing draws it. Every one was found by a player hitting it.
So rather than wait for the fifth, every field of `GameState` and its nested types was enumerated and
checked for a reader in `sim/view.ts`, `src/web/` and `sim/narrate.ts` — and the survivors were then
**verified by running the engine**, not by trusting the grep. Four fields had no reader anywhere.
`movedThisPhase` is set and cleared inside a single `advance` call and is nobody's business. The
other three are below.
Saying what was ruled out matters as much: `freightWorked`, `drawnThisTurn`, `freightAgentUsed`,
`switchedSince` and `movesUsed` are all invisible on purpose — their effect already shows as
legality, or as a complement already on the Frame. A field is not a display gap merely because
nothing renders it. `dispatchUsedToday` is the one genuine maybe left, and is not done.
### The Crew Tray pool is a mechanic you can now see (#98)
`state.ts` calls §7's tray scarcity "an explicit mechanic" and it was explicit only in the engine.
The blocked panel — the one that answers "why is nothing moving?" — had exactly one tray rule, keyed
off the train due out this Stage. So a player who had spent a card on an Extra, or ordered a second
section, got a **completely empty** panel while their train sat behind an exhausted pool. Both had
been announced once in the log, in a line that promised a future event — "it runs once as soon as a
Crew Tray frees up", "an identical train will run right behind it" — which nothing ever confirmed.
`projectSharedTable` carries `crewTrays` and `queued` now, so the common board gets it too, and the
panel reports all three cases with the count beside them: "no free Crew Tray" on its own reads like a
permanent fact about the game rather than a state that will pass.
The first draft of that count derived the pool size as `trays.size + freeTrays.length`. That is
invariant in play — `retireTrain` puts the tray back — and reads **"0 of 0"** the moment it meets a
state where a tray is neither free nor carrying a train. `crewTrayCount` already owned the number.
### A train held at the Limits had been vanishing off the board (#99)
The most serious of the three, and it had been shipped. The Interlocking is the designed answer to a
full Office: rather than Gap 2d's automatic collision, the train is stopped on the Limit Track and
takes the first A/D track that frees, ahead of any newcomer.
`arriveAtOffice` removes the tray from the Mainline node's `transits`, and the Interlocking branch
pushes it onto `area.heldAtLimits` **without assigning `tray.position`**. The map draws mainline
nodes from `transits` and district squares from `position.at === 'grid'` — so between the two, the
train was drawn in neither. It disappeared from the board on arrival and reappeared in the Office
some Stages later, with a single log line as the whole account of it.
Measured rather than reasoned: with the tray in `transits` the Interchange node carries its chip;
moved to `heldAtLimits` exactly as the engine moves it, that node's `trains` is `[]` and no grid
square has gained it.
Fixed in the **view**, not the engine. The engine is right — a held train is inside the Limits and
not on an A/D track — and `position` is deliberately left alone so nothing may treat the train as
standing on a square it could be switched from. The map draws it on the Limits square it came in by
(eastbound at `limitsWest`, westbound at `limitsEast`), flagged so it does not read as an ordinary
arrival, with the reason on the chip and in the blocked panel.
### The Campaign Train now says whether its speeches are made (#100)
X17 is "one turn at station (speeches) then expedite" — two states, not one sentence. Its first
Office arrival is an ordinary stop; every arrival after runs expedited, and an expedited train left
off the Office square when the next Mainline Phase begins is a fault costing 1 Revenue.
`trainRules()` took `{ trainNumber, trainIsExtra }`, so it could not see `speechMade` even though
both of its tray-side callers hand it a whole `CrewTray` that has it. The chip read identically
before and after. Worse, the "EXPEDITED … costs 1 Revenue" warning is printed only under
`rules.expedite` — so X17 became subject to a fault whose warning the game shows to every other
expedited train and never to it. It now says which half it is in, and borrows `isExpedited` from
`advance.ts` rather than restating the test.
### The 0.7.9 dead-field audit, finished (#45)
Deferred by Jesse on 2026-08-30 with the decision framed as delete-or-document. The answer turned out
to be different for each, and neither was a patch.
**`overHandLimit` is wired, because its consumer existed all along and was guessing.** `main.ts`
already draws a disabled "End Local Operations" button explaining the hand limit — but decided to
draw it from the *absence* of `draw.end` in the menu. That is sound only because `check('draw.end')`
refuses for exactly three reasons and the two guards beside it rule out the other two; a fourth
reason would have made the panel explain a refusal by describing something else entirely, which is
#90 verbatim. It reads `f.overHandLimit` now — which is what the field was built for in the first
place. Behaviour is unchanged; the screen states its reason instead of inferring it.
**`viewerSeat` is documented, with a condition.** Gitea#20's common board keys districts by seat and
resolves the player through `playerAtSeat`, so a client picking its own district out of a seat-keyed
board needs this and cannot get it from `viewer`. The declaration says so — and says to delete it if
step 2 ships without using it.
**And the audit had missed a third limb.** `game.mustPlayCard` was assigned from `overHandLimit` on
every submit and read by nothing at all: deleted. Chasing it turned up the thing actually worth
fixing — the §6.2 hand-limit test existed in **three** places (`check('draw.end')`, an inline
recomputation inside `snapshot()`, and `web/game.ts`'s own). All three agreed, which is precisely the
state #96's disagreement started from. There is one `overHandLimit(state, player)` in `state.ts` now
and the other two ask it. `Session.overHandLimit()` — declared on the interface and implemented
twice — is deleted rather than kept, the Frame already carrying the fact.
### Proof
934 tests pass, up from 917. The 17 new ones were written red and each fix was then checked by
mutation: reverting `speechMade` fails 2, dropping the held-train projection fails 4, and forgetting
the two tray queues fails 2. The blocked panel returning nothing for the queues is reported alongside
its positive control — the same state with a timetabled train due, which correctly says "no free Crew
Tray" — because an empty result from a function that is simply broken proves nothing.
**Not verified at a table.** All of this is engine and view work checked by tests and by running the
engine; no part of it has been met by a person at a board. #39 and #35 still stand.
---
## 0.7.9.5 — 2026-09-07
Two faults in what 0.7.9.4 had just built, both of the same shape: a second copy of an answer that