Conversation
intent(flag_groups): encode flag type (value vs bool) and value restrictions directly in the definition string, removing the need for `<flag:name>` to consume a trailing value pattern token decision(flag_groups): reuse the existing pattern syntax (pipe-separated aliases + optional value pattern) so users learn one notation for both rules and definitions learned(flag_groups): the old `<flag:name> VALUE_PATTERN` design forced `*` to serve double duty as both value capture and remaining-args wildcard, making patterns like `<flag:name> * *` confusing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sing intent(flag_groups): eliminate duplicated parsing logic between `parse_flag_group_definition` and the rule pattern parser decision(flag_groups): pass definition strings through the existing `build_pattern_tokens` with `inside_group = true` so that trailing `*` is consumed as a value pattern, then extract aliases and value from the resulting `FlagWithValue` or `Alternation` token Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request refactors flag group definitions from arrays to pattern strings, enabling support for boolean flags and value-restricted matching. The flag:name placeholder is now standalone in rule patterns, as its value-handling behavior is derived from the group's definition. Feedback was provided regarding the performance overhead of parsing these definition strings repeatedly during the matching process, suggesting they be parsed once and cached.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #300 +/- ##
==========================================
- Coverage 89.13% 89.05% -0.08%
==========================================
Files 53 53
Lines 11603 11665 +62
==========================================
+ Hits 10342 10388 +46
- Misses 1261 1277 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
intent(flag_groups): avoid redundant parsing of flag group definition strings during pattern matching, which is called repeatedly due to backtracking in the recursive match_engine decision(flag_groups): add a `parsed_flag_groups` field to Definitions populated eagerly after config load/merge/validate, keeping the parse-once-use-many pattern without changing match_engine's signature Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Why
<flag:name> *in a pattern consumes*as the flag's value pattern, requiring an extra*for remaining-token absorption (<flag:name> * *), which is confusingWhat
flag_groupsdefinition format from arrays to pattern stringsBefore:
After:
<flag:name>no longer consumes the next token as a value pattern, making patterns more intuitive