[Phase 1.8] Runtime CardCatalog Loader & Deterministic CardManifestHash #22

Open
opened 2026-11-17 08:14:08 +00:00 by john4064 · 0 comments
Owner

Goal

Build a pure-Rust runtime CardCatalog in chaotic_core that loads all verified .ron cards into sorted lookups and computes a deterministic CardManifestHash (SHA-256) for client/server/replay lockstep verification.

Metadata

  • Phase / Step: Phase 1.8
  • Depends On: #4, #5
  • Unlocks: #13, #27
  • Target Crates / Paths: crates/chaotic_core/src/catalog.rs
  • Line Budget Plan: Production .rs <= 400 lines, test .rs <= 600 lines, mod.rs < 80 lines (AGENTS.md Section 2.3)

Acceptance Criteria

  • Load all .ron files from assets/cards/ deterministically sorted by CardId.
  • Provide O(1) lookup helpers (get_creature, get_attack, get_mugic, get_battlegear, get_location) and base_name equivalence index.
  • Compute a canonical SHA-256 CardManifestHash across every Verified card definition so mismatched client/server assets are rejected immediately.
  • Exclude or flag UnverifiedQuarantine cards from Ranked deck legality by default (allowing opt-in only in sandbox tests).
## Goal Build a pure-Rust runtime `CardCatalog` in `chaotic_core` that loads all verified `.ron` cards into sorted lookups and computes a deterministic `CardManifestHash` (SHA-256) for client/server/replay lockstep verification. ## Metadata - **Phase / Step:** Phase 1.8 - **Depends On:** #4, #5 - **Unlocks:** #13, #27 - **Target Crates / Paths:** `crates/chaotic_core/src/catalog.rs` - **Line Budget Plan:** Production `.rs` <= 400 lines, test `.rs` <= 600 lines, `mod.rs` < 80 lines (`AGENTS.md` Section 2.3) ## Acceptance Criteria - [ ] Load all `.ron` files from `assets/cards/` deterministically sorted by `CardId`. - [ ] Provide O(1) lookup helpers (`get_creature`, `get_attack`, `get_mugic`, `get_battlegear`, `get_location`) and `base_name` equivalence index. - [ ] Compute a canonical SHA-256 `CardManifestHash` across every `Verified` card definition so mismatched client/server assets are rejected immediately. - [ ] Exclude or flag `UnverifiedQuarantine` cards from Ranked deck legality by default (allowing opt-in only in sandbox tests).
Sign in to join this conversation.
No description provided.