Skip to content

[codex] Prepare replay engine for release rule APIs#1

Merged
Jud merged 8 commits into
mainfrom
codex/release-rule-api-refactor
Apr 24, 2026
Merged

[codex] Prepare replay engine for release rule APIs#1
Jud merged 8 commits into
mainfrom
codex/release-rule-api-refactor

Conversation

@Jud

@Jud Jud commented Apr 24, 2026

Copy link
Copy Markdown
Owner

Summary

Prepares diamond-replay for broader release by tightening the public API, adding quality gates, and refactoring simulated rule replay behind an internal rule compiler pipeline.

What changed

  • Added CI with formatting, clippy, tests, doctests, docs, and package verification.
  • Added artifact-backed replay gates for known ground-truth game box scores.
  • Added ReplayOptions and RuleSet as the supported simulation API.
  • Kept legacy no-steal-home wrapper for compatibility while moving the CLI to the options API.
  • Made engine internals private and re-exported stable crate-root result/stat/event types.
  • Moved no-steal-home replay into rules/ with shared stream traversal and shared shadow state.
  • Added direct tests for rule stream traversal and shadow state behavior.
  • Fixed deterministic run attribution for score override reductions and catcher interference PA accounting.
  • Added crate-level docs and updated README release/API notes.

Validation

Local gates passed:

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --all-targets
  • cargo test --doc
  • RUSTDOCFLAGS='"'-D warnings'"' cargo doc --no-deps
  • cargo package

The local commit hooks also ran cargo test successfully on each committed slice.

Jud and others added 6 commits April 13, 2026 20:09
Spray chart: parse hit location (x, y) from ball_in_play defender entries
and store per-player and per-team. Includes hrLocation fallback for
over-the-fence home runs.

Lineup events: handle squash_lineup_index (player removal + compaction),
reorder_lineup (insert-style batting order changes), and sub_players
(substitutions including baserunner identity swap).

Run scoring fixes:
- Unify player run credit with linescore scoring in handle_base_running
  so auto-scored confirmations don't double-count
- Push displaced runners back when remained_on_last_play restores an
  auto-scored runner to a base that was filled by auto-advance

Adds 10U Mariners/Brewers Apr 12 test data (15-14, matches GC).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Jud Jud marked this pull request as ready for review April 24, 2026 18:48
@Jud Jud merged commit ea85123 into main Apr 24, 2026
1 check passed
@Jud Jud deleted the codex/release-rule-api-refactor branch April 24, 2026 19:50
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