Derive meta-power registry ids from the game types #309
No reviewers
Labels
No labels
4-29
bug
documentation
duplicate
enhancement
flow improvement
good first issue
help wanted
invalid
investigating
issue-agent
issue-agent-blocked
issue-agent-complete
issue-agent-pr-open
issue-agent-runner-nelsonlaptop
issue-agent-runner-nelsonpc
issue-agent-runner-nelsonpc-user
issue-agent-running
needs-verification
next to do
question
queue
recon
relics-stats-onboarding
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/spirelens!309
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/defect-buffer-damage-tracking-78608c"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ModelDb.GetIdslugifies the whole type name and only strips_MODELfrom the category, soRupturePowerisPOWER.RUPTURE_POWER. Every hand-copied entry inMetaPowerRegistryused a shortened form the game never emits, andTryGetByPowermatches onpower.Id— soRecordMetaPowerApplicationLockedreturned early for all 19 entries.Measured impact
Across 434 saved runs (Apr 28 – Aug 8),
successful_applicationsandmeta_active_turnsare zero in every one of the 30 power aggregates. Neither has ever recorded a value.Card-driven paths (
TryGetByCard, which worked because card ids have no suffix) kept writing denominators under the short key, whilepower.Id.ToString()paths wrote outcomes under the canonical key — splitting one power across two aggregates. One run holds Danse Macabre withblock_gained: 56, turns_active: 7underPOWER.DANSE_MACABRE_POWERwhile the tooltip looked upPOWER.DANSE_MACABREand rendered 0.OrbCardRegistryandRandomCardGenerationRegistryhad the identical defect.OrbCardRegistry.TryGetRecurringByPowermatches a live power id, so recurring-Power orb attribution was dead the same way.The fix
All three registries resolve ids through
ModelIds.TryGet<T>(), which asks the game. It returns null instead of throwing so one changed model hierarchy cannot take a registry down at class load, and the lists are lazy for the same reason. A renamed game class is now a compile error rather than a lookup that quietly returns nothing.Tooltip meta-power switches dispatch on card ids: switch labels must be compile-time constants, derived power ids cannot be, and card ids carry no type suffix. That removes ten duplicated power-id consts.
Dead code removed
Nine
Append*PowerStatshelpers — Entropy, Juggling, Danse Macabre, Vicious, Dark Embrace, Stampede, Feel No Pain, Aggression, Rupture — had zero call sites in a non-partial class where they areprivate static. They were a second, also-broken rendering of rows the shared switch already produces, and the sole reason ten of the wrong-id consts existed. TheirDisplayNamefallbacks are why this looked partially mitigated; nothing was actually reachable.No history reconciliation
Deliberate. The two stats that broke were never written to disk, so a merge could only recover one run''s block total — not worth new logic in the persistence path every run file passes through. Old files keep both key forms; the primer explains why.
Notes
MetaPowerRegistryTestsnow pins that every entry isPOWER.*_POWERand that lookup by live id round-trips.ConsumingShadowPowerStatsTestshad a hardcodedPOWER.CONSUMING_SHADOWthat was asserting the bug.