[P1] Scope all player-keyed recording to the local player in co-op (zero LocalContext usage today) #260
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#260
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Priority: P1. Promoted from #257's P2 "decision needed" bullet — the uncapped audit pass (2026-07-02) confirmed these as HIGH stat-corruption in a supported mode (co-op), not hygiene.
Problem
Verified:
grep LocalContextoverCore/returns zero SpireLens uses ofIsMe/IsMine/GetMe. In co-op the local machine simulates all players, so partner events fold into the local run file every combat.Confirmed sites:
CardEnterDeckPatch.cs:41mints aggregates for partner deck cards, whileCaptureInstanceNumbersByDeckRanksnapshots onlyPlayers.FirstOrDefault()(#61, HIGH).RedMaskBeforeSideTurnStartPatch.cs:34,BagOfMarblesBeforeSideTurnStartPatch,OstyCmdSummonPatchrecord partner relic/summon activations into localRelicAggregates/MetaStats(#71, HIGH).TheAbacusAfterShufflePatch.cs:26arms on a partner shuffle (#53)._pendingPlayerBlockClearare singletons fed by everyIsPlayercreature, soReconcilePlayerBlockLedgerLocked(RunTracker.cs:5278/5304) compares one player'sBlockagainst the summed total — garbaging block stats in any MP combat (#43, #32, HIGH).Decision (pick one, apply uniformly)
RunTracker.TrackedPlayeratOnRunStartedviaLocalContext.GetMe(runState) ?? Players.FirstOrDefault(), and gate everyIsPlayer/Type==Deck/ relic-model entry point on it.Players.Count > 1and document MP as out of scope.Single-player is unchanged either way. The current implicit single-player assumption cannot be fixed piecemeal — the leak re-enters at the next unguarded entry point — so decide once and encode it as a reviewable convention.
Implemented in #268: co-op now tracks the LOCAL player's stats (not a kill-switch). Resolves the tracked NetId from LocalContext.NetId (sole-player fallback) at run start + adopt; fail-open (null → allow all, so single-player is byte-identical). Player-keyed ingresses gated on ownership (card play, deck entry, enemy-damage-taken, block, energy dispatch, Red Mask / Bag of Marbles / The Abacus). Live-verified: 'TrackedPlayer resolved: net_id=1' on the running run. Remaining relic side-turn patches follow the identical IsTrackedRelic template; Osty-summon + poison-power co-op ownership are small follow-ups.
Closing during repository issue cleanup. If this becomes active work again, we can reopen or recreate it as a fresh, specific task.