mirror of
https://github.com/tiennm99/ai-coding-workflow-labs.git
synced 2026-09-17 06:24:20 +00:00
- Implemented MatchEngine class with validateMatch method - Multi-stage validation: type check → position check → pathfinding - Type check happens before expensive pathfinding (fail-fast optimization) - Returns MatchResult with valid flag, reason, path, turns, and score - All 8 test cases covering all validation branches - Score calculated using Scoring.calculate Test coverage: - Different tile types → valid=false, reason='different-type' - Same tile ID → valid=false, reason='same-tile' - Valid 0-turn path → valid=true, turns=0, score=150 - Valid 1-turn path → valid=true, turns=1, score=125 - Valid 2-turn path → valid=true, turns=2, score=100 - 3+ turn path → valid=false, reason='too-many-turns' - No path (blocked) → valid=false, reason='no-path' - Score calculation correct for valid matches