Audit fixes batch 1: STS2-update build unblock + four confirmed stat bugs #248
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!248
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/audit-fixes-batch1"
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?
First batch of fixes from a full-codebase quality audit. Stacks on #246 (killing-blow / Continue-stranding work) — until that merges, the diff shows its commits too. The STS2-update commit (
6354d6c) is a P0 build unblock and can be cherry-picked to land independently first.P0 — Slay the Spire 2 update broke the build (commit
6354d6c)Steam shipped an STS2 update (game DLL dated 2026-07-02) that removed
Hook.AfterTurnEnd. Two block-window cleanup patches referenced it vianameof(...), a compile-time reference, so the mod no longer builds against the live game at all — this blocks every build/deploy, including #246. Discovered when the audit's post-fix build failed withCS0117: 'Hook' does not contain a definition for 'AfterTurnEnd'.TargetMethods()lookup instead of compile-timenameof, matching the resilientAccessToolspattern their sibling patches already use. Missing method → patch skipped, not a broken build.Harmony.PatchAll()inCoreMain.Initializewith per-class install in try/catch, so one patch whose target a game update reshaped can't abort all patching and silently kill every stat hook.Core builds against the updated DLL; all 238 tests pass. Not verified: runtime patch binding against the new game (needs an in-game launch). This change ensures graceful degradation if another patch fails to bind; a full compat pass is filed as a tracking issue.
Four confirmed stat-attribution bugs (commit
e6c0126)Each confirmed against decompiled game behaviour by an adversarial verification pass; each localized and independent.
effective = unblocked - overkilldouble-subtracted overkill → every poison kill recorded ~0 effective damage (a poison deck's normal finisher)ComputeEnemyDamageTotalshelper (effective = unblocked); include overkill in the tick-size denominator. One convention for all damage sites; pinned by a lethal-overkill testIsPlayer=false) absorbing hits counted as damage-to-player, doubledDamageInstancesper DieForYou redirect, and Osty's own attacks minted a bogusMONSTER.OSTYenemy aggregate every Necrobinder runRecordEnemyDamagereturns early unlessReceiver.IsPlayer(matches sibling method + primer spec)AfterBlockClearedeven when a retain effect (Barricade/Blur/Sturdy Clamp) prevented the clear; unarmed fallback charged the whole ledger as wasted and anonymized the survivors → retain decks showed inflated block-wasted, ~0 block-effective every turnReconcilePlayerBlockLedgerLockedwaste exactlymax(0, tracked-actual)Task.Runwrites with non-atomicFile.WriteAllText; a won/lost run's two back-to-back saves raced (outcome save dropped or stalein_progresswins), and a crash mid-write truncated the whole run fileFile.Moveoverwrite; path resolution off the pool threadTest plan
dotnet test Tests/SpireLens.Core.Tests— 238/238 pass against the live updated game DLL.lib/reference stub; the only stub failures are 11 pre-existing asset-coupled tooltip-icon tests (identical set with or without these changes).Remaining audit findings (attribution-window architecture, MP ownership, repair-path asymmetry, full STS2-compat pass, etc.) are being filed as separate tracked issues.
🤖 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