Audit fixes batch 4: run-identity stranding, healing race, handler guards #265
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!265
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/audit-fixes-batch4"
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?
Fourth batch from the audit. Stacks on #264. Confirmed correctness + resilience fixes; 244/244 tests pass against the live game DLL.
Run-identity stranding (#255)
GameStartTime(finding #11). The 8 copy-pasted_currentRun ??= new RunData {...}sites minted a run withoutGameStartTime, so a later Continue/hot-reload couldn't match it → the same stranding class the adoption work fixed for the main path. Unified into oneEnsureLazyCurrentRunLocked()helper that always stamps it.RecordUpgradeno longer mints a phantom run during save deserialization (finding #58). The game firesUpgradeInternalon template cards while loading a save (_currentRunnull); the mint ran before the "have we seen this card?" gate, creating a junkin_progressrun thatOnRunStartedthen saved. The gate now runs first.Healing-finalize race (#254, findings #19/#50)
GetOrCreateRelicAggregateForHealingLockedusedGetOrCreateRelicAggregateLocked, which does_pendingCombat ??= new— so when the pool-thread heal finalize lost the race withOnCombatEnded's promote+null, the lost-healing tail landed in an orphan buffer discarded at the next combat (stranded on a run's final victorious combat). It now routes to the committed run aggregate when there's no live pending combat, and persists that late write.Exception-discipline hot spots (#261, findings #70 / #143 open half)
The terminal run-end funnel (
RunHistoryUtilitiesCreateEntryPatch.Postfix— previously the one patch with no try/catch) and the three event-subscribed lifecycle handlers (OnRunStarted/OnCombatSetUp/OnCombatEnded) now run under an always-on Error-logging guard, so a tracker throw can't propagate into the game's own run/combat dispatch. The fullPatchGuardconvention across all patches remains #261.🤖 Generated with Claude Code
Superseded by #267, which consolidates this and the rest of the audit work onto current main (these branches all conflicted after #247 landed). Closing in favor of the single mergeable PR.
Pull request closed