--- title: "Sprint 12 — CI Briefing" description: "Ban HashMap via clippy, tracing infrastructure, system dependency graph, rng_seed field" type: sprint status: archived sprint: 12 team: "ci" --- # Sprint 12: Build — CI Tasks **Goal:** Lay the production-layer foundations — simulation tier system, sound event pipeline, visual grammar, and knowledge boundary enforcement — and complete all v0.1 copy authoring so content packs, opening hooks, and world-building docs are done. **Branch:** `ci` **Agents:** Justine (build/deploy) ## Carry-over from Sprint 11 None. Sprint 11 was 7/7 done. ## New Tickets | # | Title | Blocked by | |---|-------|------------| | #343 | Ban HashMap in simulation crate via clippy | — | | #344 | Set up tracing crate infrastructure | — | | #346 | System dependency graph debug command | — | | #527 | Add rng_seed field to ObserverSnapshot for deterministic replay | — | Use `db/connectors/ticket show ` for full details. ## Key Decisions - `decisions/architecture.md` — D-020 (Godot + Rust IPC, bridge types), D-041 (knowledge graph, observer snapshot contract) - `decisions/scope.md` — D-030 (testing architecture — D-phase alignment) ## Notes **#343 — Ban HashMap in simulation crate via clippy** - Critical priority. Deterministic simulation requires deterministic iteration order; `std::collections::HashMap` does not guarantee this. - Add `clippy::disallowed_types` to `.clippy.toml` (or `.cargo/config.toml`'s `[target.*.rustflags]` section) scoped to the `simulation` crate only. - Approved alternatives: `BTreeMap` (ordered) or `IndexMap` from the `indexmap` crate (insertion-ordered, deterministic). - This lint will surface existing violations. Each violation in `server/src/simulation/` needs a follow-up fix — file separate tickets for each if the count is large, or fix inline if small. - CI must fail on new violations after this is merged. **#344 — Set up tracing crate infrastructure** - Add `tracing` and `tracing-subscriber` to `server/Cargo.toml`. - Initialize in `server/src/main.rs` with a stdout subscriber in dev (pretty format) and JSON in CI. - Add structured log points to: tick duration (`tracing::info!(tick_ms = ...)`), per-system timing (wrap heavy systems with `tracing::instrument`), bridge I/O metrics, tier transition events. - This is prerequisite instrumentation for tier system debugging (Sprint 12 server work in #99). - In CI (`make ci-server`), the JSON log output should be captured but not asserted on — just confirm the binary runs without panic. **#346 — System dependency graph debug command** - Implement a `--dump-schedule` CLI flag (or `make debug-schedule` Makefile target) that prints the bevy_ecs system ordering and component access patterns. - Use bevy's `World::resource::()` or the `bevy_app::App::render_schedule_graph()` approach (check bevy 0.14/0.15 API — confirm current version in `server/Cargo.toml`). - Output: plain text or DOT format listing systems in execution order with their component read/write access. - CI integration: run on each PR, save output as artifact, diff against baseline to catch unintended system reordering. - Lives in `server/src/main.rs` (flag) or a dedicated `server/src/debug.rs` module. **#527 — Add rng_seed field to ObserverSnapshot for deterministic replay** - The WRONG button (#507, done Sprint 11) writes `inputs.jsonl` and `seed.txt` for replay, but `seed.txt` currently writes `"unavailable"` because the server does not include `rng_seed` in `ObserverSnapshot`. - Fix: add `rng_seed: Option` to the `ObserverSnapshot` struct in `server/src/bridge/types.rs`. - Populate it from the simulation's RNG state on each tick. The RNG system lives in `server/src/simulation/rng.rs`. - This is a server-side change committed from the CI branch. Coordinate with server team to avoid conflict on `bridge/types.rs` — or implement as a separate additive commit that merges cleanly. - Completes the WRONG button capture loop. After this, replays can fully reproduce observed bugs. ## Dependency Chain ``` #343, #344, #346, #527 — all standalone, all parallel ``` ## PR Workflow When ready to submit, create a PR with `tea` CLI. **All flags are required** to avoid TTY prompts (see CLAUDE.md "Gitea access" section): ```bash tea pr create --repo jpmschweitzer/settled-reach --login schweitz --title "feat(ci): Sprint 12 — HashMap lint, tracing infra, schedule debug, rng_seed fix" --description "body" --base main --head ci ```