[P2] Structural guardrails: per-combat state on PendingCombat, named history windows, RunTracker decomposition #263

Closed
opened 2026-07-03 09:33:41 -07:00 by nelsong6 · 1 comment
nelsong6 commented 2026-07-03 09:33:41 -07:00 (Migrated from github.com)

Priority: P2. From the 2026-07-02 uncapped audit pass. Standing architecture guardrails — the structural changes that make the recurring bug classes hard to re-introduce.

  • Move per-combat one-shot state onto PendingCombat so new PendingCombat() is the reset. The hand-maintained reset list in ResetCombatContextState has already drifted (Bone Flute omission #10, fixed in PR #248; _pendingRelicHeals never reset #145). Migrating each _pendingXxx flag onto the buffer removes the whole "forgot to reset" class. (#145, #146)
  • Name the history-count staleness windows. Three uncommented comparison semantics (==, <= +1, >=) are copy-pasted as window-width guards. Replace with a HistoryWindow enum + predicate so width is explicit, not folklore. (#147)
  • Phased decomposition of the 6,146-line RunTracker behind the existing static facade — identity map, block ledger, poison ledger, replay tracker, effect windows, lifecycle as cohesive units. Hot-reload-safe because the statics die per reload. Do it incrementally, each extraction pinned by existing tests. (#146)
  • RuntimeOptions bridge handshake. The Loader↔Core options bridge is four hand-synced field lists with no version handshake, plus dead BuildTimeZoneId plumbing. Add a ContractVersion handshake + a reflection parity test. (#124, #87)
  • F5 hot-reload combat guard. F5 has no active-combat guard, so an accidental keypress mid-combat discards _pendingCombat. Gate on active-combat + a confirmation. (#122)

Findings: #145, #147, #146, #124, #87, #122.

**Priority: P2.** From the 2026-07-02 uncapped audit pass. Standing architecture guardrails — the structural changes that make the recurring bug classes hard to re-introduce. - **Move per-combat one-shot state onto `PendingCombat`** so `new PendingCombat()` *is* the reset. The hand-maintained reset list in `ResetCombatContextState` has already drifted (Bone Flute omission #10, fixed in PR #248; `_pendingRelicHeals` never reset #145). Migrating each `_pendingXxx` flag onto the buffer removes the whole "forgot to reset" class. (#145, #146) - **Name the history-count staleness windows.** Three uncommented comparison semantics (`==`, `<= +1`, `>=`) are copy-pasted as window-width guards. Replace with a `HistoryWindow` enum + predicate so width is explicit, not folklore. (#147) - **Phased decomposition of the 6,146-line `RunTracker`** behind the existing static facade — identity map, block ledger, poison ledger, replay tracker, effect windows, lifecycle as cohesive units. Hot-reload-safe because the statics die per reload. Do it incrementally, each extraction pinned by existing tests. (#146) - **RuntimeOptions bridge handshake.** The Loader↔Core options bridge is four hand-synced field lists with no version handshake, plus dead `BuildTimeZoneId` plumbing. Add a `ContractVersion` handshake + a reflection parity test. (#124, #87) - **F5 hot-reload combat guard.** F5 has no active-combat guard, so an accidental keypress mid-combat discards `_pendingCombat`. Gate on active-combat + a confirmation. (#122) Findings: #145, #147, #146, #124, #87, #122.
nelsong6 commented 2026-07-05 15:44:54 -07:00 (Migrated from github.com)

Closing during repository issue cleanup. If this becomes active work again, we can reopen or recreate it as a fresh, specific task.

Closing during repository issue cleanup. If this becomes active work again, we can reopen or recreate it as a fresh, specific task.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/spirelens#263
No description provided.