Skip to content

feat: add trick argument to guarantee a named move in the combo - #54

Merged
nazroll merged 1 commit into
mainfrom
feat/include-trick
Jul 8, 2026
Merged

feat: add trick argument to guarantee a named move in the combo#54
nazroll merged 1 commit into
mainfrom
feat/include-trick

Conversation

@nazroll

@nazroll nazroll commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • New trick keyword on generate_combo: the named move is guaranteed to appear in the result
  • Placement is natural: the move is picked the first time the chain's state can reach it; if the chain never gets there, the combo is rebuilt anchored on that move
  • Fuzzy name resolution: case-insensitive, fakie-style wording (Forward Open Gazelle, Fakie 540) mapped back to canonical prefixes, small typos matched via difflib (cutoff 0.75); unknown names raise ValueError with did-you-mean suggestions
  • An explicit trick wins over max_stage (the stage filter still applies to every other move)
  • Chain-building extracted into _build_chain so the fallback rebuild reuses the exact same cascade; 7 new tests

Test plan

  • ruff, black, mypy (strict), pytest — all green locally (50 passed)
  • Exercised end-to-end: guaranteed inclusion over 50 runs, typo'd fakie input ('forward open gazele'), stage-clash (Front 540 at max_stage=1), unknown-name error

🤖 Generated with Claude Code

generate_combo(trick='Front Open Gazelle') always includes that move:
it is woven in the first time the state machine can reach it, falling
back to anchoring it as the first trick. Matching is case-insensitive,
accepts fakie wording (Forward/Fakie prefixes) and small typos via
difflib; unknown names raise ValueError with suggestions. An explicit
trick wins over max_stage while the stage filter still applies to the
rest of the pool.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@nazroll
nazroll merged commit d66a129 into main Jul 8, 2026
7 checks passed
@nazroll
nazroll deleted the feat/include-trick branch July 8, 2026 12:50
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.

1 participant