Skip to content

Marathon#3

Merged
folkengine merged 3 commits into
mainfrom
marathon
May 10, 2026
Merged

Marathon#3
folkengine merged 3 commits into
mainfrom
marathon

Conversation

@folkengine
Copy link
Copy Markdown
Contributor

⏺ Features

  • src/history/audit.rs — new AuditResult struct + GameRecord::audit() with 7 structural invariant checks + GameCollection::audit_all()
  • src/history/replay.rs — new ReplayResult struct + GameRecord::replay() with deterministic re-deal via initial_draw_pile + GameCollection::replay_all()
  • src/history/record.rs — GameCollection promoted from newtype to versioned struct (gfcore_version, format_version, games); FORMAT_VERSION = 1; save() /
    save_to() for timestamped file output; GameRecord gains initial_draw_pile: Option for replay
  • src/game/state.rs — pending_turn_actions: Vec accumulator added to Game; populated in handle_ask/handle_draw; flushed into
    TurnRecord::actions; Game::new refactored to setup() helper; Game::new_with_deck() added for replay
  • src/prelude.rs — AuditResult and ReplayResult re-exported under #[cfg(feature = "history")]

Fixes

  • src/error/mod.rs — GfError::IoError(String) and GfError::NoReplayData variants added; NoReplayData display broadened to cover missing initial_draw_pile
    case
  • src/history/replay.rs — removed unused use super::* (CI -D warnings hard error); replay loop refactored from O(n²) per-turn snapshots to single post-loop
    game.record() call
  • tests/history_integration.rs — play_game_with_bot_profiles() switched to BotProfile::default_profiles() (4-player mixed strategy) to fix flaky
    non-termination with 2-player BasicStrategy-only setup

Tests

  • tests/history_integration.rs — test_audit_all_on_played_collection and test_replay_all_on_played_collection (5 games each)
  • tests/bot_marathon.rs — record.audit() added to validate_last_game so every marathon game is structurally audited

Docs / Config

  • docs/superpowers/plans/2026-05-09-game-history-audit.md — implementation plan
  • docs/superpowers/specs/2026-05-09-game-history-audit-design.md — approved design spec
  • .github/workflows/CI.yaml — miri removed from CI; minor workflow tweaks
  • Makefile / Cargo.toml / Cargo.lock — minor version/tooling updates

folkengine added 3 commits May 9, 2026 18:58
  - Add GfError::IoError and GfError::NoReplayData variants
  - Add TurnRecord::actions: Option<Vec<PlayerAction>> for replay path
  - Restructure GameCollection from newtype to versioned struct with
    gfcore_version, format_version, and games fields
  - Add GameCollection::save() and save_to() for timestamped file output
  - Add src/history/audit.rs: AuditResult and GameRecord::audit() with
    7 structural invariant checks; GameCollection::audit_all()
  - Add src/history/replay.rs: ReplayResult and GameRecord::replay()
    using stored initial_draw_pile for deterministic re-deal;
    GameCollection::replay_all()
  - Capture pending_turn_actions in Game struct; flush into TurnRecord
  - Store initial_draw_pile in GameRecord before dealing for replay
  - Re-export AuditResult and ReplayResult from prelude
  - Add audit_all and replay_all integration tests (5 games each)
  - Add record.audit() call in bot_marathon validate_last_game
2. tests/history_integration.rs — play_game_with_bot_profiles() now uses BotProfile::default_profiles() (4 players, mixed BasicStrategy + RandomStrategy),
matching the bot_marathon setup that's prove
@folkengine folkengine merged commit ad09be0 into main May 10, 2026
18 checks passed
@folkengine folkengine deleted the marathon branch May 10, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant