[P1] Align relic patches with the game's real trigger gates (verify against decompile) #256

Closed
opened 2026-07-03 02:30:54 -07:00 by nelsong6 · 2 comments
nelsong6 commented 2026-07-03 02:30:54 -07:00 (Migrated from github.com)

Priority: P1. From the 2026-07-02 audit. All findings here are UNVERIFIED (verification cap) — each fix MUST cite the decompiled game gate before it is accepted. This is a standing "observed outcome, not intended modifier; mirror the game's real gate" cleanup.

Many relic patches re-implement the game's trigger gate incorrectly and record for triggers that never happened:

  • Book Repair Knife counts Doom deaths with !IsPlayer instead of the ShouldOwnerDeathTriggerFatal predicate → inflates minion/segment kills and phantom healing (BookRepairKnifeAfterDiedToDoomPatch.cs:35).
  • Prismatic Gem CardRewardsAffected increments per option, and even on unchanged pools (PrismaticGemStatsPatch.cs:55) → guard on !ReferenceEquals(options, __result).
  • Bag of Marbles / Red Mask gate on RoundNumber == 1 && IsAlive instead of TurnNumber <= 1 && HittableEnemies, double-counting on extra turns.
  • Pocketwatch records the modifier's intended +3 rather than observed draws (RunTracker.cs draw path).
  • CardPlacedOnTopPatch only patches the single-card overload, so multi-card top-placements (PhotonCut/Glimmer) are never counted (CardPlacedOnTopPatch.cs:22).
  • GlamEnchantPlayCount is patched on a pure UI calculation, so hovers inflate replay-planned stats (GlamEnchantPlayCountPatch.cs:15).

For each: read the decompiled relic/method, mirror its real gate, and count actual applications rather than a modifier's return value. Add or update the per-relic test with the gate condition pinned.

Process guardrail: the issue template for relic-stat fixes should require a decompile citation before merge, since this whole family stems from re-implementing game gates from the card text instead of the code.

**Priority: P1.** From the 2026-07-02 audit. **All findings here are UNVERIFIED (verification cap) — each fix MUST cite the decompiled game gate before it is accepted.** This is a standing "observed outcome, not intended modifier; mirror the game's real gate" cleanup. Many relic patches re-implement the game's trigger gate incorrectly and record for triggers that never happened: - **Book Repair Knife** counts Doom deaths with `!IsPlayer` instead of the `ShouldOwnerDeathTriggerFatal` predicate → inflates minion/segment kills and phantom healing (`BookRepairKnifeAfterDiedToDoomPatch.cs:35`). - **Prismatic Gem** `CardRewardsAffected` increments per option, and even on unchanged pools (`PrismaticGemStatsPatch.cs:55`) → guard on `!ReferenceEquals(options, __result)`. - **Bag of Marbles / Red Mask** gate on `RoundNumber == 1 && IsAlive` instead of `TurnNumber <= 1 && HittableEnemies`, double-counting on extra turns. - **Pocketwatch** records the modifier's intended `+3` rather than observed draws (`RunTracker.cs` draw path). - **CardPlacedOnTopPatch** only patches the single-card overload, so multi-card top-placements (PhotonCut/Glimmer) are never counted (`CardPlacedOnTopPatch.cs:22`). - **GlamEnchantPlayCount** is patched on a pure UI calculation, so hovers inflate replay-planned stats (`GlamEnchantPlayCountPatch.cs:15`). For each: read the decompiled relic/method, mirror its real gate, and count actual applications rather than a modifier's return value. Add or update the per-relic test with the gate condition pinned. Process guardrail: the issue template for relic-stat fixes should **require a decompile citation** before merge, since this whole family stems from re-implementing game gates from the card text instead of the code.
nelsong6 commented 2026-07-03 09:34:28 -07:00 (Migrated from github.com)

Uncapped audit pass — additional confirmed relic-gate items + the ADR angle:

  • CardPlacedOnTopPatch.cs:22 patches only the single-card overload, so PhotonCut/Glimmer top-placements are never counted (#57, HIGH) — retarget the innermost IEnumerable<CardModel> Add overload.
  • GlamEnchantPlayCountPatch.cs:15 fires on every hover/description render, inflating TimesReplayExtraPlanned (#66, HIGH) — recover inside HookModifyCardPlayCountPatch.
  • PlayerGainEnergyPatch.cs:34 double-attributes Gremlin Horn energy+draws to both relic and the resolving card (#17, HIGH) — resolve via the AttributionWindow registry (#250).
  • Standing principle: enforce ADR-0001/0002 'record observed outcomes, not intended modifiers' — Pocketwatch records ModifyHandDraw's +3 intent not observed draws (#21, #54, #149); Bag of Marbles/Red Mask count alive enemies not observed Vulnerable/Weak receipts (#149). Add an issue-template requirement: decompile citation + observed-vs-intended justification before a relic-stat PR merges.
**Uncapped audit pass — additional confirmed relic-gate items + the ADR angle:** - `CardPlacedOnTopPatch.cs:22` patches only the single-card overload, so PhotonCut/Glimmer top-placements are never counted (#57, HIGH) — retarget the innermost `IEnumerable<CardModel>` Add overload. - `GlamEnchantPlayCountPatch.cs:15` fires on every hover/description render, inflating `TimesReplayExtraPlanned` (#66, HIGH) — recover inside `HookModifyCardPlayCountPatch`. - `PlayerGainEnergyPatch.cs:34` double-attributes Gremlin Horn energy+draws to both relic and the resolving card (#17, HIGH) — resolve via the AttributionWindow registry (#250). - **Standing principle:** enforce ADR-0001/0002 'record observed outcomes, not intended modifiers' — Pocketwatch records ModifyHandDraw's +3 intent not observed draws (#21, #54, #149); Bag of Marbles/Red Mask count alive enemies not observed Vulnerable/Weak receipts (#149). Add an issue-template requirement: decompile citation + observed-vs-intended justification before a relic-stat PR merges.
nelsong6 commented 2026-07-05 15:45:05 -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#256
No description provided.