Demo: card-script review CI (advisory) — do not merge#23
Open
MostCromulent wants to merge 2 commits into
Open
Conversation
4ab098e to
f3e1d17
Compare
| ManaCost:2 U | ||
| Types:Artifact Creature Robot | ||
| PT:2/2 | ||
| T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigNope | TriggerDescription$ When this enters, draw a card. |
There was a problem hiding this comment.
Execute$ TrigNope → undefined SVar (card won't load)
| Types:Artifact Creature Robot | ||
| PT:2/2 | ||
| T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigNope | TriggerDescription$ When this enters, draw a card. | ||
| SVar:TrigDraw:DB$ Draw |
There was a problem hiding this comment.
SVar TrigDraw is never referenced (clause never fires)
| Name:Zztest Dup Param | ||
| ManaCost:1 R | ||
| Types:Instant | ||
| A:SP$ DealDamage | ValidTgts$ Any | ValidTgts$ Creature | NumDmg$ 2 | SpellDescription$ Deal 2 damage. |
There was a problem hiding this comment.
duplicate ValidTgts$ → engine keeps only the last
| @@ -0,0 +1,4 @@ | |||
| Name:Zztest No Cost | |||
| Name:Zztest Param Typo | ||
| ManaCost:R | ||
| Types:Instant | ||
| A:SP$ DealDamage | ValidTgt$ Any | NumDmg$ 2 | Foozle$ True | SpellDescription$ Deal 2 damage to any target. |
| Name:Zztest Param Typo | ||
| ManaCost:R | ||
| Types:Instant | ||
| A:SP$ DealDamage | ValidTgt$ Any | NumDmg$ 2 | Foozle$ True | SpellDescription$ Deal 2 damage to any target. |
There was a problem hiding this comment.
Foozle$ → appears in no other card (unknown or outdated param?)
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.
Summary
Proof of concept for an advisory CI check that reviews changed card scripts on a PR and posts terse inline comments — a deterministic linter plus a Scryfall card-frame fact-check. It never fails the check, it only comments; a reviewer decides what to act on. Do not merge — the fixtures below are deliberately broken so the bot has something to flag.
What it checks
.github/scripts/cardlint.py— deterministic linter: undefinedExecute$/SubAbility$/Choices$refs (a badExecute$means the card fails to load), duplicate or unknown params, illegal mana tokens, a missingManaCost, loyalty abilities missingPlaneswalker$ True, and more. Its "known params" are derived from the card corpus itself, so it adapts when the engine adds or renames a param..github/scripts/card_script_review.py— compares the card frame (name, type line, power/toughness, mana cost, loyalty) against Scryfall. Catches transcription slips like a missingLegendary, an instant/sorcery swap, or a wrong mana symbol. Stays silent when a card isn't on Scryfall yet.Fixtures in this PR
crystal_inhuman_princess.txtLegendarysupertype droppedLegendaryelektra_femme_fatale.txt4/2→3/2vulture_feathered_fiend.txt3 U U→2 U Uzztest_broken_etb.txtExecute$points at an undefined SVarzztest_param_typo.txtValidTgt$typo + made-upFoozle$ValidTgt$→ValidTgts$; unknown paramzztest_no_cost.txtManaCostlineManaCostlineThe three real cards (Crystal/Elektra/Vulture) are recent cards not yet in this tree, chosen so they shadow no existing card or test; the
zztest_*cards use placeholder names.🤖 Generated with Claude Code