v0.11.0-alpha2 #58

Merged
umpire274 merged 2 commits from v0.11.0-alpha2 into main 2026-04-20 16:40:36 +02:00
umpire274 commented 2026-04-20 16:40:10 +02:00 (Migrated from github.com)
  • feat(commands): add grammar layer for stateless segment parsing WIP 1/2
  • feat(commands): rebuild scoring parser on a formal grammar WIP 2/2
- feat(commands): add grammar layer for stateless segment parsing [WIP 1/2](https://github.com/umpire274/bs_scoring/commit/d71bf8e518673bb2a17bba1369fa900139c684bf) - feat(commands): rebuild scoring parser on a formal grammar [WIP 2/2](https://github.com/umpire274/bs_scoring/commit/0892abcff0e6bf4f318f0ab1df75a1afc1259d10)
chatgpt-codex-connector[bot] (Migrated from github.com) reviewed 2026-04-20 16:47:27 +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: 0892abcff0

ℹ️ 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:** `0892abcff0` <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>
@ -0,0 +70,4 @@
/// Hyphenated fielding sequence: digits separated by `-`.
pub(super) static RE_FIELDING_SEQ_DASHED: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"^\d(-\d)+$").unwrap());
chatgpt-codex-connector[bot] (Migrated from github.com) commented 2026-04-20 16:47:27 +02:00

P2 Badge Restrict fielding-sequence regexes to fielders 1-9

Both fielding-sequence token patterns use \d, so invalid inputs like 60 or 6-0 are lexed as valid FieldingSeq values even though fielder 0 is illegal. Those inputs bypass parse-time rejection and later fail in command building with a generic validation error (segment_index: 0) rather than a segment-specific parse error, which breaks the new diagnostic model. Tightening these regexes to [1-9] prevents malformed fielder numbers from entering the pipeline.

Useful? React with 👍 / 👎.

**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Restrict fielding-sequence regexes to fielders 1-9** Both fielding-sequence token patterns use `\d`, so invalid inputs like `60` or `6-0` are lexed as valid `FieldingSeq` values even though fielder `0` is illegal. Those inputs bypass parse-time rejection and later fail in command building with a generic validation error (`segment_index: 0`) rather than a segment-specific parse error, which breaks the new diagnostic model. Tightening these regexes to `[1-9]` prevents malformed fielder numbers from entering the pipeline. Useful? React with 👍 / 👎.
@ -0,0 +187,4 @@
let has_pitch = indexed
.iter()
.any(|s| matches!(s.segment, Segment::Pitch(_)));
if has_pitch && has_non_steal_action {
chatgpt-codex-connector[bot] (Migrated from github.com) commented 2026-04-20 16:47:27 +02:00

P1 Badge Reject steals when action segments are present

check_mixing only errors on has_pitch && has_non_steal_action, so lines that mix steals with hits/outs/FC (for example 5 h, 3 st 2b) are accepted even though this combination is unsupported in the new grammar. Once accepted, build_commands still emits both commands (steal plus hit/defensive play), which can apply extra runner movement in the same plate appearance and produce incorrect scoring state instead of a validation error. Please add an explicit steal-vs-action exclusion in the mixing pass.

Useful? React with 👍 / 👎.

**<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Reject steals when action segments are present** `check_mixing` only errors on `has_pitch && has_non_steal_action`, so lines that mix steals with hits/outs/FC (for example `5 h, 3 st 2b`) are accepted even though this combination is unsupported in the new grammar. Once accepted, `build_commands` still emits both commands (steal plus hit/defensive play), which can apply extra runner movement in the same plate appearance and produce incorrect scoring state instead of a validation error. Please add an explicit steal-vs-action exclusion in the mixing pass. Useful? React with 👍 / 👎.
Sign in to join this conversation.
No description provided.