games/kaintuck: fix code-review findings in the engine

games/kaintuck: fix code-review findings in the engine

#30 in Riparion/riparion-retro — merged 2026-06-11

Fixes nine findings from a recall-biased code review of the new kaintuck crate. All in the engine; no UI behavior changes beyond the bug fixes.

Correctness / balance

  1. Duck River skip — a horse + Hard-pace final day could vault both TnDivide and the Duck River and cross the 450-mile finish in one day, winning before the crossing ever ran. settle_day now loops over every passed stand and leave_stand re-settles before the day ends.
  2. Credit-cap shrink — the Cincinnati/Memphis moneylender replaced the cap from current cash, which could drop it below an outstanding debt and lock out credit. Now only ever raised (credit_cap.max(offered)); town indices named via consts.
  3. Interest floored to zerodebt += (debt*0.05).floor() left debts under $20 interest-free. Removed the floor.
  4. Gamble stake not at risk until resolve — the stake is now escrowed when laid (a win pays stake * 2). Net results are identical in normal play, but abandoning the night (e.g. a refresh) forfeits it rather than granting a free retry.

Cleanup

  1. Dead Boat.draft — wired draft into the sandbar cargo loss, making the existing comment true.
  2. Boat cache driftBoat stores only kind; capacity/draft/lumber_value are methods, so a rebalance can't leave a save carrying stale numbers.
  3. Stand::current duplicated POSTS mileposts — now reads its thresholds off Stand::POSTS.
  4. Three town→slug maps — consolidated into one shared TOWN_SLUGS const.

Altitude

  1. Six-fold minigame plumbing — six pending_* fields collapse into one pending_task: Option<MiniTask> with a MiniTask::mode() mapping.

Notes

  • SAVE_VERSION bumped to 2 (#6 and #9 change the serialized Game); v1 saves fall back to a fresh game. Crate bumped 0.1.1 → 0.1.2.
  • #4 is a partial mitigation by design: the minigames are already deterministically seeded, so escrowing the stake closes the money/free-retry angle but can't fully prevent retrying a skill challenge — inherent to client-side save-on-every-transition.
  • Adds regression tests for the Duck River crossing and the gamble escrow; all 21 engine tests pass, clippy clean.

🤖 Generated with Claude Code

Last updated 2026-06-12