Repository navigation
feat(catalog): store each card's mana value from the catalog (#250) - #279
Merged
Merged
Conversation
Spec 058, approved at Gate A: a nullable mtg_cards.mana_value filled from Scryfall cmc, reapplied once on upgrade so existing instances fill it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Revised after round 1 of the read-only Opus plan review (two blocking findings and nine smaller ones, all folded in). Round 2 follows at the maintainer's request. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Round 2 (Opus, APPROVE WITH CHANGES, nothing blocking): the redo command is db:migrate:redo:primary in the spec and plan; AC-3.1 checks the cards' other attributes; AC-4.1 says why the value is not derived from the mana cost; verification.md is written in two steps; every core spec runs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The class is AddManaValueToMTGCards: the MTG acronym inflection makes the file name camelize to that, not AddManaValueToMtgCards. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…a value (#250) MTG::Scryfall::Source#reapply? is now true for either of two reasons: spec 011 AC-2.3 (printings have no artwork ids) or spec 058 decision 3 (cards exist and none has a mana value), so an upgraded instance fills the column on its next scheduled refresh even when Scryfall has published no new file. Catalog::Refresh, Catalog::Sources, views, helpers and controllers are untouched. Failed first (the only two): "asks once for a catalog whose cards have no mana value yet, when artwork ids are all there" (source_spec, AC-3.4) and "applies a scheduled refresh of an already-applied version while no card has a mana value" (refresh_scryfall_spec, AC-3.2: the run was skipped). The other new examples (the spec 011 hook example, "does not ask while some card has a mana value", "asks for either reason alone", and the refresh examples for AC-3.1, AC-3.3, AC-3.5, AC-3.6 and AC-3.7) are guards that passed before the change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Catalog core and catalog operations record the mana value and the second reapply reason, releasing.md gets the upgrade note, verification.md holds the evidence of Phases 1-4, and the plan names the migration class as built (AddManaValueToMTGCards, from the MTG acronym inflection). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
SPEC-ALIGNED WITH NOTES: no blocking or major findings. The reapply? cost comment says at most four queries, the migration comment is reflowed, the degenerate no-cmc file is an accepted limit, and the verdict is recorded in verification.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A lesson on filling a new catalog column (refresh digest, reapply? reason, the pre-upgrade state a spec must reset) and a note on db:migrate:redo:primary and the MTG acronym in a migration class name. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rations (#250) Distillation log rows in both area docs; the index row reads Frozen with the plan marked retirement owed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rations area docs (spec 027 D4) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
plainprogrammer
marked this pull request as ready for review
November 10, 2026 13:58
# Conflicts: # docs/specs/README.md
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.
Closes #250. Spec 058 (roadmap 14d): the deck shape panel (#256) can draw a mana curve from local data.
What changes
mtg_cards.mana_value: a nullable float, MTG only, no default; one reversible migration (AddManaValueToMTGCards). No core table changes.MTG::Scryfall::Mapper.mana_valuereads Scryfall'scmc, else the front face's (real reversible cards have no top-levelcmc), else nil. Numeric only, neverfetchorFloat(), so an odd value can never make a record malformed and drop the card.MTG::Scryfall::Source#reapply?gains a second reason (cards exist and none has a mana value), so an upgraded instance fills the column on its next refresh even when Scryfall's file is unchanged.docs/releasing.md, spec, plan andverification.mdunderdocs/specs/058-mtg-mana-value/.Verification
bin/cipassed at pushed SHAd415dd15(3054 examples bybin/rspec --dry-run). GitHub CI run 42828485850 on the same SHA: all jobs green (checks, RSpec 1-4 of 4, both image jobs with the upgrade smoke).reapply?reason and AC-3.2 failed before the change; the other new examples are guards (stated in the Phase 3 commit body).db:migrate:redo:primary(plaindb:migrate:redoaborts in this four-database app; spec v1.0.3 names it). Schema diff: the version line and the one column.For the maintainer
docs/lessons/2026-11-10-…) and a line in.claude/memory/migrate-schema-noise.md; written without a separate approval, drop them if unwanted.AddManaValueToMTGCards(acronym inflection); spec AC-4.3 spells itAddManaValueToMtgCards, recorded inverification.md.🤖 Generated with Claude Code