v0.8.2 — every district opens on a Depot, and the docs are pages now

A second-digit bump for a playtest read back against the save file. Nine questions
were asked of one three-Day game; three were bugs, three were the rules working
and undocumented, three were decisions. Every save on the test server was replayed
against this build BEFORE release, which is how the cost of each rule was known
before it was chosen rather than discovered after.

EVERY DISTRICT OPENS ON A DEPOT. A Whistle Post has one A/D track and is not a
Passenger Facility, so the opening of every game was spent unable to work a
passenger and one arrival away from a collision. Two A/D tracks and passengers
from Stage 1 now; "Players start with Whistle Posts, not Depots" is the harder
game, set when the game is created. The deck follows the choice — starting on
Depots the four Depot upgrade cards are left out, because an upgrade must be to
the next tier and a Depot card at a table of Depots is a dead draw. How much
easier it is showed up as a test failure rather than an argument: the cue-coverage
pool needed widening from 24 seeded games to 60 before it held one collision.

NO SAVE WAS STRANDED BY IT, which took care. This is the one house rule that
changes how a game is DEALT rather than how it plays, so replaying a save under
the wrong opening is a different railroad from intent one — silently, with no
error. `withSavedOpening` fills it on the replay paths ONLY. Putting it in the
resolver instead made a fresh Cutthroat game deal Whistle Posts and read as
Custom, which is how the distinction was found.

THREE BUGS, ALL REPORTED FROM ONE GAME AND ALL CONFIRMED ON ITS SAVE.

An Office held TWO TRAINS ON ONE A/D TRACK. The capacity test passed with nothing
standing, the train the Interlocking had been holding at the Limits was moved into
the free slot, and the arriving train was pushed in after it without anyone asking
again whether there was room — so the collision §8.3 calls for never happened. The
held train keeps priority; the newcomer now takes the consequence it would have
met had the held train arrived first.

THE HISTORY FROZE, permanently, and the log cap was not really the cause. Each
seat's "what have I sent you" bookmark was an INDEX into an array the game trims,
so once a seat's bookmark reached the limit the slice returned nothing for the
rest of the game — at a different moment per seat, because each holds its own.
That game's log ended at exactly the cap. Lines carry a sequence number now, which
survives trimming; proven by pushing twice the cap through a simulated seat.

§8.1 ASKED THE WRONG QUESTION TWICE. "Trains may pass" returned `clear` before the
Subdivision was looked at, so a train entering a Double Track was released however
busy the rest of it was — that, not anything about Control Points, is what let
Train 8 out with no ruling. And a train standing at an Office was invisible to the
scan, so one about to re-enter the very Subdivision being entered counted for
nothing. Capacity is the test, not presence: a Depot with a track free is not in
the way; a Whistle Post with its one track taken is.

THINGS THAT HAPPENED SILENTLY NOW SAY SO — a train held against a facing one, a
train released from the Limits (a side effect of somebody else's arrival, so it
simply appeared at the Office), and the train an Interlocking is holding, whose
explanatory tooltip has existed since #99 with NO renderer ever reading the flag.

WHERE A MOVE IS REFUSED, AND WHY. `exploreMoves` decides where the rails go and the
pick-up restrictions are enforced afterwards in `check`, so a square the rails
reached and the card forbade was reachable, un-offered, and absent from the block
list with nothing said. Those squares are blocked with the rule that blocks them
now, and the reasons are got by ASKING `check` rather than re-deriving: a second
implementation of the rules is exactly the failure the block list exists to avoid.
A train may also always recover its own caboose — X13 prints "may drop but not
pick up anything", and a train needs its caboose to be made up, so one that parted
with it could never legally leave again.

RULES DECIDED IN SEPTEMBER AND APPLIED HERE. A Modifier must sit square against its
host, no diagonals. A passenger Modifier may not be played at a Whistle Post. Both
were built, measured, held back for a fortnight so a playtest could finish, and
applied now. A Second Section costs its card: `SECOND_SECTION` was declared in
content.ts and never dealt, so the action was free and the bot ordered 26
accidental ones in a measured round. The card is dealt and spent — gating on a card
the deck never holds would have deleted the mechanic rather than fixed it.

THE DOCUMENTATION IS A SET OF PAGES, not five text files served as text/plain — a
card reference is mostly tables, and as plain text a table is rows of pipes.
Markdown is still the one copy; the build renders it, and publishes the .md beside
each page. No Markdown library: this project has no runtime dependencies and one
would be a poor first. The pages add what Markdown cannot carry without drifting —
a nav across the set, a contents list built from the headings actually rendered,
an anchor on every heading, a 70-character measure, and tables that are tables.
They print as ink on paper.

The references caught up with the rules, checked rather than assumed: two
statements had gone from stale to misleading (the Quickstart told a new player to
"get a Depot down as soon as one appears"), and four rules nobody could look up
are written down — the Office tier table, §8.1 in practice, what the Circus Train
pays for, and that a Realignment can be a card with no legal target.

Adding one card to the deck reshuffles every seeded deal, which broke five
fixtures. Each was a seed meaning "a game like this" — TODO #84, exactly — so
seeds moved and pools widened rather than assertions weakening, and the clearance
fixture pins its terrain the way `enhancements.test.ts` already does. The three
published replays were re-recorded.

Closes TODO #40, #42a, #108, #109 and #110.

1046 fast tests and 35 sim tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MUizFYCMHRWhbWwXhp7WPR
This commit is contained in:
Jesse.Markowitz
2026-09-23 07:07:21 -04:00
co-authored by Claude Opus 5
parent 517238a727
commit 3befc420da
66 changed files with 6828 additions and 3324 deletions
+96 -5
View File
@@ -1101,9 +1101,20 @@ function evaluateClearance(
const node = s.division.nodes[targetIndex];
if (!node || node.kind !== 'mainline') return 'clear';
// Double Track and Uncontrolled Siding print "Trains may pass", so occupancy does not block.
/**
* "TRAINS MAY PASS" IS A PROPERTY OF ONE CARD, NOT OF THE SUBDIVISION (Jesse, 2026-09-23).
*
* This returned `clear` outright, before the subdivision was looked at — so a train entering a
* Double Track was released however busy the rest of the Subdivision was, including against a
* train coming the other way three cards deeper in. Reported from a table: Train 8 highballed
* from the Western Division Point with no ruling asked, and the reason was this line rather than
* anything about Control Points.
*
* What the card actually prints is that TWO TRAINS MAY SHARE IT. So it excuses occupants ON THIS
* CARD and nothing else, which is what `passesHere` below is for.
*/
const profile = MAINLINE_PROFILES.find((m) => m.kind === node.card);
if (profile?.trainsMayPass) return 'clear';
const passesHere = profile?.trainsMayPass === true;
/**
* §8.1 asks about the next SUBDIVISION, not the next card.
@@ -1138,9 +1149,32 @@ function evaluateClearance(
const occupants: { tray: TrayId; onCard: number }[] = [];
for (const i of subdivision) {
const n = s.division.nodes[i];
if (!n || n.kind !== 'mainline') continue;
if (behind(i)) continue;
for (const t of n.transits) if (t.tray) occupants.push({ tray: t.tray, onCard: i });
if (n?.kind === 'mainline') {
// A card that lets trains pass is not an obstruction on its own account.
if (i === targetIndex && passesHere) continue;
for (const t of n.transits) if (t.tray) occupants.push({ tray: t.tray, onCard: i });
continue;
}
/**
* A TRAIN STANDING AT AN OFFICE WITH NOWHERE TO PUT IT OCCUPIES THE SUBDIVISION TOO.
*
* Jesse's ruling, 2026-09-23, from a table where Train 19 was released from the Eastern
* Division Point towards Train 14 and nobody was asked: at the moment of the decision Train 14
* was not in `transits` at all, it was standing in a district. §8.1 was only ever reading
* trains in transit, so a train about to re-enter the very Subdivision being entered counted
* for nothing.
*
* CAPACITY IS THE TEST, not the mere presence of a train — his reasoning exactly. At a Whistle
* Post, one A/D track and a train on it means there is nowhere for the two to pass and no
* choice to be made. At a Depot or a Terminal with a track still free there is somewhere to go,
* and the train at the Office is not in the way.
*/
if (n?.kind === 'office') {
const area = areaAtSeat(s, n.seat);
if (area.adOccupancy.length < officeProfile(area.tier).adTracks) continue;
for (const held of area.adOccupancy) occupants.push({ tray: held, onCard: i });
}
}
/**
@@ -1167,6 +1201,24 @@ function evaluateClearance(
// facing trains, add +4/+8/+12 to the other train's number". Without a device there is no
// way to pass the order, so the train simply holds.
if (spendDispatchBonus(s, tray, otherTray, events) > 0) continue;
/**
* SAY SO (Jesse, 2026-09-23: "does it make sense to have something listed in history or
* somewhere else when the train is not allowed to pass?").
*
* A facing train is an absolute bar and this returned silently — the train simply did not
* depart, Stage after Stage, with nothing on screen saying why. Only the ABS Signals case
* below announced itself, and it was given a line for exactly this reason.
*
* NAMES WHAT IS IN THE WAY, because the answer to "why is nothing happening" is a specific
* train somewhere specific, not a rule number.
*/
events.push({
type: 'trainHeld',
trainNumber: tray.trainNumber ?? 0,
reason:
`Train ${otherTray.trainNumber ?? '?'} is coming the other way in the same Subdivision — ` +
'§8.1 holds a train against a facing one, and there is no Control Point between them to pass at',
});
return 'blocked';
}
@@ -1495,12 +1547,51 @@ function arriveAtOffice(
return 'moved';
}
// A train held at the Limits takes the first free A/D track before any newcomer.
/**
* A TRAIN HELD AT THE LIMITS TAKES THE FIRST FREE A/D TRACK BEFORE ANY NEWCOMER — and taking it
* FILLS IT, which is what this used to forget.
*
* Reported from a table, 2026-09-23: a Whistle Post with one A/D track held Trains 8 and 19 at
* once. The capacity test above had passed (nothing standing), this block then moved the held
* train in, and the arriving train was pushed in after it without anyone asking again whether
* there was room. So the Office ended up over capacity and the collision §8.3 calls for never
* happened.
*
* The held train has priority — it has been waiting — so the NEWCOMER takes the consequence, and
* it is the same consequence it would have met had the held train got there first: held at its
* own Limits where there is an Interlocking, and a collision where there is not.
*
* IT IS ALSO ANNOUNCED. The release used to be a silent side effect of somebody else's arrival:
* the train simply appeared at the Office, and the report was "wasn't clear what changed and why
* train 8 was suddenly released".
*/
if (area.heldAtLimits.length > 0 && area.heldAtLimits[0] !== id) {
const first = area.heldAtLimits.shift()!;
area.adOccupancy.push(first);
const held = s.trays.get(first);
if (held) held.position = { at: 'grid', seat, coord: area.officeCoord };
events.push({
type: 'trainReleasedFromLimits',
trainNumber: held?.trainNumber ?? 0,
office: officeProfile(area.tier).name,
owner: playerAtSeat(s, seat),
freedBy: tray.trainNumber ?? 0,
});
// The slot it just took is gone. Ask again for the train that is arriving now.
if (area.adOccupancy.length >= capacity) {
if (hasEnhancement('interlocking')) {
area.heldAtLimits.push(id);
events.push({
type: 'trainDiverted',
trainNumber: tray.trainNumber ?? 0,
to: 'the Limits',
reason: 'Interlocking held it clear of a full Office instead of a collision',
});
return 'moved';
}
collide(s, playerAtSeat(s, seat), [id], events, 'no free A/D track', 'the Office');
return 'moved';
}
}
area.heldAtLimits = area.heldAtLimits.filter((t) => t !== id);