Skip to content

fix: reject multi-sub-roll group sort at parse time #101#113

Merged
edloidas merged 1 commit into
masterfrom
issue-101
Apr 29, 2026
Merged

fix: reject multi-sub-roll group sort at parse time #101#113
edloidas merged 1 commit into
masterfrom
issue-101

Conversation

@edloidas
Copy link
Copy Markdown
Owner

Rejected multi-sub-roll Group targets ({a, b}s, ({a, b})s) at parse time with INVALID_SORT_TARGET and a deferred-status message. evalSort flat-sorts produced dice and cannot honor Stage 3 spec §3 hierarchical sort, which 6b6ffbc (#82) explicitly deferred — accepting the syntax until then would silently ship non-spec behaviour.

  • Added an unwrapTransparent walk in parseSort after the deepContainsDicePool guard; rejects when the unwrapped base is a Group with two or more sub-expressions.
  • Removed the should accept multi-sub-roll group parser shape test; added errors cases for {1d6, 2d8}s and ({1d6, 2d8})s.
  • Refreshed the evalSort JSDoc to state that multi-sub-roll Groups are rejected at parse time.

Closes #101

Drafted with AI assistance

Added a multi-sub-roll `Group` target reject in `parseSort` after the deep dice-pool guard, throwing `INVALID_SORT_TARGET` with a deferred-status message via `unwrapTransparent` (the helper from #92).
Removed the `should accept multi-sub-roll group` parser shape test and added `errors` cases for `{1d6, 2d8}s` and the parens-wrapped `({1d6, 2d8})s` variant.
Refreshed the `evalSort` JSDoc to state that multi-sub-roll Groups are rejected at parse time instead of falling through to the flat-pool path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@edloidas edloidas self-assigned this Apr 29, 2026
@edloidas edloidas merged commit 9bddc98 into master Apr 29, 2026
10 checks passed
@edloidas edloidas deleted the issue-101 branch April 29, 2026 23:02
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.

fix: reject multi-sub-roll group sort at parse time

1 participant