feat(play-ball): add defensive-play support, unassisted outs, FC pers… #54

Merged
umpire274 merged 4 commits from v0.10.6 into main 2026-04-16 18:22:06 +02:00
umpire274 commented 2026-04-16 18:05:27 +02:00 (Migrated from github.com)

…istence/resume, and TUI command history recall

Implemented a major v0.10.6 Play Ball engine upgrade focused on defensive scoring commands, persistence consistency, and TUI usability.

Main changes:

  • added support for implicit batter defensive out commands:
    • 63
    • 5
    • f9
    • ff2
    • l6
    • if4
  • added UnassistedOut across parser, engine, DB serialization, replay, and resume
  • added fielder's choice syntax with mandatory destination base:
    • o
  • added composed defensive-play command parsing for comma-separated actions
  • updated defensive-play engine flow to normalize explicit runner targets that match the current batter into batter-target outcomes
  • implemented PlateAppearanceOutcome and PlateAppearanceStep support for:
    • GroundOut
    • FlyOut
    • LineOut
    • InfieldFly
    • UnassistedOut
    • FieldersChoice
  • fixed DB serialization/deserialization and resume reconstruction for all new defensive outcomes
  • fixed resume scoreboard restoration for FieldersChoice
  • fixed live and replay scoreboard handling for batter fielder's choice with forced runner advancement
  • fixed stolen-home scoring so inning partial score is updated together with total score
  • added infield-fly validity checks (<2 outs, runners on 1B and 2B)
  • updated TUI help text and SCORING_GUIDE.md to match actual v0.10.6 behavior
  • reworked TUI Command panel:
    • kept single-line input
    • added command history recall with arrow navigation
    • preserved Log/Help scrolling with Tab focus switching

This release closes the current defensive-play expansion work for v0.10.6 and prepares the project for a cleaner grammar/parser refactor planned for v0.11.0-alpha1.

…istence/resume, and TUI command history recall Implemented a major v0.10.6 Play Ball engine upgrade focused on defensive scoring commands, persistence consistency, and TUI usability. Main changes: - added support for implicit batter defensive out commands: - 63 - 5 - f9 - ff2 - l6 - if4 - added UnassistedOut across parser, engine, DB serialization, replay, and resume - added fielder's choice syntax with mandatory destination base: - <order> o<n> <base> - added composed defensive-play command parsing for comma-separated actions - updated defensive-play engine flow to normalize explicit runner targets that match the current batter into batter-target outcomes - implemented PlateAppearanceOutcome and PlateAppearanceStep support for: - GroundOut - FlyOut - LineOut - InfieldFly - UnassistedOut - FieldersChoice - fixed DB serialization/deserialization and resume reconstruction for all new defensive outcomes - fixed resume scoreboard restoration for FieldersChoice - fixed live and replay scoreboard handling for batter fielder's choice with forced runner advancement - fixed stolen-home scoring so inning partial score is updated together with total score - added infield-fly validity checks (<2 outs, runners on 1B and 2B) - updated TUI help text and SCORING_GUIDE.md to match actual v0.10.6 behavior - reworked TUI Command panel: - kept single-line input - added command history recall with arrow navigation - preserved Log/Help scrolling with Tab focus switching This release closes the current defensive-play expansion work for v0.10.6 and prepares the project for a cleaner grammar/parser refactor planned for v0.11.0-alpha1.
chatgpt-codex-connector[bot] (Migrated from github.com) reviewed 2026-04-16 18:10:21 +02:00
chatgpt-codex-connector[bot] (Migrated from github.com) left a comment

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04dc31382d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `04dc31382d` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
chatgpt-codex-connector[bot] (Migrated from github.com) commented 2026-04-16 18:10:21 +02:00

P2 Badge Credit runs when FC destination is home

The parser accepts fielder's-choice destinations like SC/HOME, but this RunnerDest::Score branch is a no-op, so a command such as o6 sc records a completed plate appearance without adding a run. That produces incorrect totals and inning scoring whenever FC-to-home is entered.

Useful? React with 👍 / 👎.

**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Credit runs when FC destination is home** The parser accepts fielder's-choice destinations like `SC/HOME`, but this `RunnerDest::Score` branch is a no-op, so a command such as `o6 sc` records a completed plate appearance without adding a run. That produces incorrect totals and inning scoring whenever FC-to-home is entered. Useful? React with 👍 / 👎.
chatgpt-codex-connector[bot] (Migrated from github.com) commented 2026-04-16 18:10:21 +02:00

P1 Badge Apply runner segments when replaying fielder's choice PAs

This branch reconstructs FieldersChoice by updating only outs and apply_batter_fielders_choice, but composed defensive plays can also include explicit runner outs/advances (persisted as runner-movement rows in apply_defensive_play_command). Because those runner segments are not applied here, commands like 9 64, 1 o6 1b leave runners on incorrect bases after live apply/resume, causing state drift from what was scored and persisted.

Useful? React with 👍 / 👎.

**<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Apply runner segments when replaying fielder's choice PAs** This branch reconstructs `FieldersChoice` by updating only `outs` and `apply_batter_fielders_choice`, but composed defensive plays can also include explicit runner outs/advances (persisted as runner-movement rows in `apply_defensive_play_command`). Because those runner segments are not applied here, commands like `9 64, 1 o6 1b` leave runners on incorrect bases after live apply/resume, causing state drift from what was scored and persisted. Useful? React with 👍 / 👎.
Sign in to join this conversation.
No description provided.