v0.4.9e — five of six playtest bugs: one button per train, and a load that has to go somewhere

Gameplay testing on 0.4.9d returned six reports. Five are fixed; the sixth could not be
reproduced and is written up in TODO.md with the two questions that would pin it down.

TWO TRAINS AT ONE PLATFORM ANSWERED TO ONE BUTTON. `porter.board` and `porter.detrain`
carried no tray, so there was one button per platform however many trains stood at it and
the reducer filled the first empty coach on the A/D tracks. `check` and the reducer were not
even asking the same question: `check` skipped a train whose card refuses passenger work and
the reducer did not. Both intents now carry an optional `trayId`, one function resolves the
train and the coach for check/execute/reduce alike, `legal.ts` offers one candidate per train,
and the label names it.

A LOAD COULD BE MADE AND BROKEN WITHOUT GOING ANYWHERE. A Freight House could unload the
boxcar it had just loaded; a platform could detrain the passengers it had just boarded. Full
Revenue at both ends for a movement that never happened. Jesse's rule: a load made anywhere in
an Office Area may not be broken anywhere in that Office Area, ever — it has to be carried to
another district. The load carries the seat that made it (`RollingStock.origin`), stripped by
`pooled` at every yard push. Measured at -0.60 +/- 0.10 Revenue a game (t = -6.1) over 400
paired deals: 78 worse, 3 better, 319 unchanged — free Revenue coming off the board, not a nerf.

THE GROCER'S WAREHOUSE SHIPPED AND THE REFINERY RECEIVED. Both were `flow: 'both'` on the
reading that "Freight House" was a collective term for exactly those two, and therefore what
§9.3 described. The engine has dealt a Freight House CARD since before v0.4.9, so §9.3 names
it and the argument goes. The card set agrees: all three Refinery modifiers grant +1 outbound.
Refinery outbound-only, Grocer's inbound-only, Freight House the one two-way industry — which
leaves exactly the one same-district pairing the rule above refuses.

NOT REPRODUCED: cars left behind when backing up over them. Five layouts tried, including cars
spotted at an industry; every one couples the lot. Three are pinned in `apply.test.ts`. One way
to create such cars was closed anyway — `flyingSwitch` wrote its cut past `carsOn`.

Both published replays that had gone dead were re-recorded; a rules change retires a save, and
`harness.test.ts` is what catches it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011nbvwWMef8CuEP6t5cgkTv
This commit is contained in:
Jesse.Markowitz
2026-08-21 23:55:08 -04:00
co-authored by Claude Opus 5
parent f9c4d9fa92
commit 7c35e002af
25 changed files with 2753 additions and 1812 deletions
+10 -7
View File
@@ -474,8 +474,10 @@ describe('switching accomplishes something (regression)', () => {
* grew faster, which is traffic rather than aimlessness, and there are two new sources of it:
* Extras now start at the Division Point their NUMBER sends them to, so westbound Extras exist
* at all (measured 32 west / 29 east across 60 deals, against every single one launching
* eastbound from the West Division Point before); and the Grocer's Warehouse ships as well as
* receives, so there is more switching worth doing.
* eastbound from the West Division Point before); and the Grocer's Warehouse briefly shipped as
* well as received, which was more switching worth doing. That second source is gone again in
* v0.4.9e — the Grocer's is inbound-only, as it always was on the sheet — and the ratio still
* clears the floor, so the figure is left where it is rather than re-tuned to one release.
*
* A crew that shuttles for its own sake would show this ratio climbing while `work` stood still.
* Logged in TODO.md with the rest of the bot drift rather than quietly absorbed.
@@ -1070,12 +1072,13 @@ describe('the freight figures count both halves (regression)', () => {
// that on: an unload needs an inbound industry built, reachable, and a loaded car spotted at it,
// and whether the bot manages all three on a given deal is luck, not the thing under test.
/**
* FORTY DEALS, up from twelve, and the reason is a rules correction rather than flakiness.
* FORTY DEALS, up from twelve, and the reason was a rules correction rather than flakiness.
*
* The Grocer's Warehouse is a BOTH-direction facility now — `card-reference.md` always said so —
* where the engine had it inbound-only. So the bot can ship from it as well as receive, and it
* often does: deals producing at least one completed unload went from 12 in 40 to 6 in 40, while
* unloads themselves are unharmed (30 completed across the 40 measured after the change).
* The Grocer's Warehouse was briefly a both-direction facility, so the bot shipped from it as
* well as receiving and deals producing at least one completed unload fell from 12 in 40 to 6 in
* 40. v0.4.9e put it back to inbound-only, which is what the sheet always printed. The wider
* sample is kept: the precondition it protects — that some deal in the batch actually completes
* an unload — is worth having whichever way the rule goes.
*
* The subject here is the INSTRUMENT — does `freightUnload` count Revenue earned rather than
* unloads started — and `unloads > 0` is only the precondition that makes the comparison mean