S3a.3 — The bank, round cap and endings #166
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.52) × (1 − Review Confidence (0.39)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 68% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #166"
general
weight: 0.35
github-actions[bot]
S3a.3: the bank, the round cap and the endings (design §4.2 step 8, §6, §7.5, §8; §17.1 for the server's timing).
Closes #90
What it does
endCheck(end.ts) ends the game once the bank is empty or the round is the round cap (roundCap: 12on the job, [tunable], overridable ascontentOverrides.roundCap). Nothing below the end check runs: no alibi window and no meeting after the last round. Every ending still goes throughgameEnded.honestyLine: 2/3on the job), the heist succeeds. Below it, the heist is sunk by theft (FailureReason"theft"replaces"target"). Honesty is the coins that reached the duffel ÷ the coins taken from the bank. Seized coins count neither way, and the meter reads full before any coin is taken. The coins that reached the duffel are the R6 Haul until S3a.4 builds the duffel (see Decisions).winsOn, which S3a.6 moves into its handler. The bust path is unchanged.ActNumberwidens tonumber(rounds 10–12 are act 4, and no meeting follows them). After a regular meeting the next round starts, with no checkpoint. Event cards and the bots' Rig/last-round logic read the cap.targetbecomestheft, read from public honesty (the Haul ÷ the bank's start minus the bank left minus the coins raids seized). A ★ role leans toward theft; the Mole rings only then. Team-minded bots pocket only while honesty stays at least 1.1 × the line (HONESTY_MARGIN, a bot setting). This replaces checkpoint pacing.GameRecordgetsreason: "theft"andcapWithBankLeft. New report rows: "Ended at the cap, over ¼ of the bank left" (§21 G4, a suite rate gated ≤ 10%) and "Sunk by theft" (G8, reported only).quickid is renamed15m(cleanup audit: "renamed in S3a.3 with the timing table").end.test.tsis rewritten around §4.2/§6.2/§7.5/§8 (16 tests). It covers the bank emptying early with no meeting after it, a short last round, the 12-round cap with the shipped numbers, the cap as an override, exactly two-thirds as a success, below it as theft with the Mole winning, seized coins left out, ties with no tie-break, the whole-crew win and replay. New fuzz invariants: rounds stay within the cap; the game is over once the bank is empty or the cap is reached; a non-bust ending is the bank or the cap; success ⇔ honesty ≥ line. The fuzz outcomes must includetheft, and a "short" tuning (cap 4) is added. Override validation coversroundCap. A server scenario has a crew pocketing every Lobby coin to the cap, which is sunk by theft. A reveal QA seed (qa55-5-t125) is sunk by theft with the Mole winning.checkpointCheckedis removed from the samples, from the visibility pin and from the reveal's shown list.gameEnded(public) keeps its shape.Deleted (cleanup audit list 3, S3a.3 rows, and what they superseded)
CheckpointRules/job.checkpoints,checkpointTarget, thecheckpointCheckedevent (type, sample, fold, reveal list, describe/away/meeting-result lines, the Meetings result banner), the act meeting's checkpoint and the final meeting's final check (checkpoint()in meeting.ts), thecheckpointscontent override, and the Rookie'scheckpointMadetoken trigger.3 × ROUNDS_PER_ACTas the game length in deck.ts, botstotalRounds, web3 * ROUNDS_PER_ACT).ROUNDS_PER_ACTstays only for the meeting bridge (S3a.5).ranking/leadersOf.checkpointsinR6_COINS/V01_NUMBERSand the bots and sim pins), "the bank doesn't end the game until S3a.3", and grabs cut to 0 by an empty bank.choosePocket, thetargetforecast.checkpointRankings,Standing/standing,afterAct1/afterAct2,act3MaxGain,endedAct,finalTarget,checkpointsMissed, the comeback and decided-early metrics and suite rates (R6 §17.4 gates with no R7 §21 counterpart), and themissrate.TargetBarcomponent and CSS,targetBar,nextTarget,targetName, the gallery's target-bar section, and checkpoint test cases.checkpointTargetunit tests.Lines
| Package | Added | Removed |
|---|---:|---:|
| apps/server | +88 | -88 |
| apps/sim | +97 | -305 |
| apps/web | +113 | -240 |
| packages/bots | +70 | -59 |
| packages/content | +28 | -36 |
| packages/engine | +368 | -511 |
| Total | +764 | -1239 |
Results
pnpm typecheckandpnpm knip: clean. Vitest: engine 853, content 39, bots 160, sim 200, server + web 949 (1 skipped), all green.pnpm precheck(Mac, load ~12): typecheck, knip, theme lint and scope check clean. Unit tests: 2249 passed, 1 skipped. e2e (scoped full tier): 388 passed and 1 failed. The failure wasinfotip.spec.ts"a scroll moves an open tip" [mobile], which this PR doesn't touch; it passed in an earlier precheck run and 63/63 on a--repeat-each=3rerun, so it is a load flake. The changedgame.spec.ts15-min game passed 6/6 with--repeat-each=3.game.spec.tschecked the deleted checkpoint ledger line.scheduler.test.tsassumed a bot game always reaches the first meeting, but a bust can end it first (the same issue S3a.2 hit).| | 3p | 6p | 8p | 12p |
|---|---:|---:|---:|---:|
| success | 52% | 36% | 8% | 1% |
| bust | 33% | 60% | 88% | 99% |
| sunk by theft | 15% | 5% | 4% | 0% |
| cap with > ¼ bank left | 5% | 13% | 7% | 1% |
| bank emptied | 22% | 4% | 0% | 0% |
The bust rate was already far above its 8–20% band after S3a.2 (47% at 6p). Games now run up to 12 rounds instead of 9, so more of them reach the bust line. This is S5 tuning (bulbs, cooling, bot caution); see Follow-ups.
Decisions
Provisional, for the PM to fold into decisions.md.
honestyLine, 2/3); the round cap is content and overridable.ranking/leadersOfnow (no tie-break; everyone at the top wins). It is the endings' winner rule, and the bust path already worked this way.ActNumberwidens tonumber. No meeting follows rounds 10–12, because the cap ends the game first.quick→15m, round time = session ÷ cap (75 s for 15 min). Stored lobbies withsessionLength: "quick"fall back to 1 h timing through the scheduler's existing default. The live game has no real players, so there is no migration shim.HONESTY_MARGIN). The theft forecast is an even chance on the line and certain an eighth of the line below, the same shape as the old target forecast.Follow-ups
docs/balance/baseline.json; its comeback/decided-early/miss rates no longer exist.honesty()with duffel credit, add the public honesty meter (§7.5) and the getaway car (§6.3), and update the bots'coinsTaken/forecast to read the new fact.ROUNDS_PER_ACT,ActNumberand the webmeetingAfter/MeetingNamewording.🤖 Generated with Claude Code