Fix manasight/manasight-parser#221: emit ChoiceResult / LinkInfo annotation details#222
Conversation
Code reviewFound 1 issue:
manasight-parser/src/parsers/gre/annotations.rs Lines 492 to 531 in 753e08b The new test modules cover present-key cases but not the absent-key fallbacks: manasight-parser/src/parsers/gre/annotations.rs Lines 2018 to 2020 in 753e08b |
Code reviewFound 1 issue:
Emit site (no positive-path test covers this branch): manasight-parser/src/parsers/gre/annotations.rs Lines 503 to 506 in 7990adc Tests only ever assert absence: manasight-parser/src/parsers/gre/annotations.rs Lines 2062 to 2065 in 7990adc |
Code reviewNo blocking issues found. Checked for bugs and CLAUDE.md/CONVENTIONS compliance across five independent passes (CLAUDE.md adherence, shallow bug scan, git-history context, prior-PR comments, code-comment compliance). Both findings from the earlier review rounds are resolved:
One sub-threshold observation was scored below the confidence bar and filtered: the |
The GRE annotation types AnnotationType_ChoiceResult and AnnotationType_LinkInfo were hitting the no-op catch-all arm in add_type_specific_fields, silently discarding all choice details (Choice_Value, Choice_Domain, ChooseLinkType, etc.). This meant "name a card" effects (Pithing Needle, Meddling Mage, Petrified Hamlet) reached the desktop with base fields only — the chosen card name was lost. Changes: - Added ANNOTATION_TYPE_CHOICE_RESULT / ANNOTATION_TYPE_LINK_INFO consts. - Added two match arms in add_type_specific_fields routing to the new extractors. - Added add_choice_result_fields (always emits choice_value; conditionally emits choice_domain and choice_sentiment — permissive, no branching on domain value). - Added add_link_info_fields (conditionally emits choose_link_type, source_ability_grp_id, link_type — permissive, no branching on link-type value). - Updated extract_annotations doc-comment to document both new annotation types. - Added mod choice_result_extraction (3 tests: Domain=5, value-only, Domain=13 CardName live capture) and mod link_info_extraction (2 tests: Type+source+link, CardName-only) mirroring the existing mod designation_extraction test style. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add edge-case tests for the permissive ChoiceResult/LinkInfo extractors: - ChoiceResult with absent Choice_Value -> choice_value falls back to 0, no domain/sentiment - LinkInfo with all detail keys absent -> no type-specific fields emitted Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add positive-path test for the choice_sentiment conditional emit. Every prior ChoiceResult test only asserted choice_sentiment absence; its sibling optional field choice_domain had a positive (Domain=5) test, leaving the symmetric choice_sentiment emit path uncovered. New test feeds a Choice_Sentiment detail and asserts choice_sentiment is emitted alongside choice_value/choice_domain.
91feeb0 to
b5044fb
Compare
Summary
AnnotationType_ChoiceResultandAnnotationType_LinkInfodetail fields instead of dropping them at the no-op catch-all, so "name a card" choices and their link metadata reach the desktop.Changes Made
ANNOTATION_TYPE_CHOICE_RESULT/ANNOTATION_TYPE_LINK_INFOconsts and match arms inadd_type_specific_fields.add_choice_result_fields/add_link_info_fieldsextractors (permissive, mirroringadd_designation_fields— generic per-domain emit, no special-casing CardName).choice_value(always),choice_domain,choice_sentiment; LinkInfo:choose_link_type,source_ability_grp_id,link_type.extract_annotationsdoc-comment to document both new types.Testing
mod choice_result_extraction(3 tests: Domain=5, value-only, Domain=13 CardName live capture shape) andmod link_info_extraction(2 tests:ChooseLinkType="Type" with sourceAbilityGRPID + LinkType;ChooseLinkType="CardName" minimal case).Stacked PR
Base:
main— single PR, no stack.Closes #221
🤖 Generated with Claude Code