refactor: domain-model cleanup (glossary, drift-in-DB, rarity cap) - #40
Merged
Conversation
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
Domain-model cleanup driven by a grilling + domain-modeling session. Introduces
CONTEXT.md(the project glossary) and aligns code, behavior, and docs with the sharpened vocabulary. Each decision came from a recorded trade-off with the maintainer.Glossary (
CONTEXT.md)Collection, Faction vs Nation (internal code vs user-facing layer), Ability, Diff vs Drift, Reserved, Spawnable, Exile, Deck, Quantity, Baseline.
Behavior changes
attributes→abilitiesacross internal keys, templates, and the diff. The raw JSON export keepsattributes— that key mirrors the API verbatim.deck import—deck addis the single import path (it already does everythingimportdid and more).deck addquantity check — a mismatch is now only flagged when the deck needs more copies than the collection records;--updateonly raises quantities, never lowers them (matches the docs and the "a deck is evidence of ownership" model).updateanddeck add --updatenow clamp to the per-rarity maximum (as the game does), with a warning. Previously only the web editor capped.sync-diff-*.mdon apply/reject/--diff-only. The diff is shown on screen; pass--diff-report PATHto also save it.sync-schema-diff-*.md/sync-schema-observed-*.json. The observed shape is stashed in metadata;baseline acceptpromotes exactly the reviewed shape and clears it. CLI prints the drift; the web modal renders it. Accepting a baseline stays a deliberate CLI step.Docs
README, CONTRIBUTING, and
.gitignoreupdated in the same branch. "catalog" removed in favor of "Collection" / "card set".Verification
make checkgreen: format + lint + mypy (47 files) + 458 tests (was 451).baseline accept→ clear), sync file behavior, and the web drift modal over HTTP.Test plan
make checkupdateon an Elite cardbaseline acceptpromotes and clears itsyncwrites no file by default;--diff-report PATHdoes