parser: harden possessive participle classifier (#808 followup) - #904
Merged
matthewevans merged 2 commits intoMay 23, 2026
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…rs#808) Three targeted fixes against `parse_possessive_participle` / `parse_possessive_object_type` in `oracle_quantity.rs`: 1. Decompose the object-type combinator. Replace the verbatim 9-string `alt(tag(...))` with `opt(parse_supertype_prefix) + alt(singular_type_words ∪ token)`. Reuses `oracle_nom::target::parse_supertype_prefix` (CR 205.4a) so composed forms like `"the sacrificed legendary creature's power"` parse via the supertype × type axis instead of the cartesian enumeration. Adds the `token` referent (CR 109.1 / CR 110.5) which is not a CR 205 card type but anchors real possessive references. 2. Extend the participle list. Add `milled` (Court of Cunning, Patchwork Automaton, Demilich class) and `discovered` (LCI Discover mechanic). These are the two missing participle-possessive cost / trigger-condition referents Gemini called out. 3. Lock the word-boundary invariant with regression tests. The determiner gate (`"that "` / `"the "`) in `classify_possessive_referent`, combined with `all_consuming((participle, tag(" "), object_type))`, already guarantees that player-possessives (`"an opponent's ..."`) cannot match the participle branch. New tests pin both halves of the contract — positive composition tests for the new participles + supertype + token cases, and negative tests for `"an opponent's"` and plural `creatures'` prefixes. 8 new tests in `parser::oracle_quantity::tests`. All 112 module tests pass; `cargo clippy --all-targets -- -D warnings` clean; coverage holds at 85.33% (29670 / 34770). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
MichaelMillsOfficial
force-pushed
the
card/yuriko-followup
branch
from
May 23, 2026 05:08
2ed1769 to
8f2c421
Compare
This was referenced Jun 29, 2026
This was referenced Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #808 (Yuriko, the Tiger's Shadow). Addresses Gemini review feedback on `parse_possessive_participle` / `parse_possessive_object_type` in `oracle_quantity.rs`.
Changes
1. Decompose the object-type combinator
Replace the verbatim 9-string `alt(tag(...))` with `opt(parse_supertype_prefix) + alt(singular_type_words ∪ token)`. Reuses `oracle_nom::target::parse_supertype_prefix` (CR 205.4a) so composed forms like `"the sacrificed legendary creature's power"` parse via the supertype × type axis instead of the cartesian enumeration. Adds the `token` referent (CR 109.1 / CR 110.5) which is not a CR 205 card type but anchors real possessive references.
2. Extend the participle list
Add `milled` (Court of Cunning, Patchwork Automaton, Demilich class) and `discovered` (LCI Discover mechanic). These are the two missing participle-possessive cost / trigger-condition referents Gemini called out.
3. Lock the word-boundary invariant with regression tests
The determiner gate (`"that "` / `"the "`) in `classify_possessive_referent`, combined with `all_consuming((participle, tag(" "), object_type))`, already guarantees that player-possessives (`"an opponent's ..."`) cannot match the participle branch. New tests pin both halves of the contract — positive composition tests for the new participles + supertype + token cases, and negative tests for `"an opponent's"` and plural `creatures'` prefixes.
Sample card texts now covered
Verification
🤖 Generated with Claude Code