Track the damage Panache deals #329

Merged
nelsong6 merged 1 commit from claude/panache-power-tracking into main 2026-09-09 22:29:25 -07:00
nelsong6 commented 2026-09-09 22:27:48 -07:00 (Migrated from github.com)

Panache wasn't in MetaPowerRegistry, so it had no pooled aggregate, no meta-power card, no badge, no shared summary. Worse, its damage was invisible: it strikes from AfterCardPlayed through the creature overload of CreatureCmd.Damage, which forwards cardSource: null, so every hit arrived anonymous and the tracker's null-source branch dropped it.

That understatement became load-bearing when the deck view gained damage sorting (#325): a Panache reported Total damage 0, sorted to the bottom, and under the attacks-only filter disappeared from the view entirely — the sort actively misreporting a card that deals real damage.

The damage had nowhere to go

Registering it is the easy half. No registered power had ever dealt damage, so PowerAggregate carried no damage fields at all. It now has the same five as CardAggregate — TotalIntended, TotalBlocked, TotalOverkill, TotalEffective, Kills — named to match so the tooltip vocabulary lines up, and merged through MergePowerAggregatesInto with everything else.

Attribution

Follows the primer's rule for downstream damage: arm a narrow window at a reliable event, consume only what plainly belongs to it.

A prefix on PanachePower.AfterCardPlayed opens the window. The damage observer claims an entry only when it:

  • carries no card source
  • was dealt by the power's owner — a poison tick has no dealer at all, which is what cleanly separates the two
  • lands on an enemy
  • arrives within a bounded combat-history distance of the arm

A prefix rather than a postfix on purpose: the method is async, so a postfix runs when the Task is returned, not when the damage resolves — it would close the window before the entries arrive.

Schema

New persisted fields come with Fixtures/RunSchema/panache-power-damage-run.json, a README entry, and three SchemaLoadingTests cases: historical load, resumable load, and a missing-field default asserted against the older aggression-power-run.json.

NotInDeckViewTests pins the registry order and caught the new entry, exactly as its comment says it should.

Verification

2137 passed, 0 failed. Built, deployed, hot-reloaded: patch install went 433 → 434 and the diag dump lists PanachePower.AfterCardPlayed.

Restart required before behavioural testing. This adds a Harmony target that was unpatched in the running process, so per the primer existing compiled callers may bypass the detour until a restart. Live verification not run.

🤖 Generated with Claude Code

Panache wasn't in `MetaPowerRegistry`, so it had no pooled aggregate, no meta-power card, no badge, no shared summary. Worse, **its damage was invisible**: it strikes from `AfterCardPlayed` through the creature overload of `CreatureCmd.Damage`, which forwards `cardSource: null`, so every hit arrived anonymous and the tracker's null-source branch dropped it. That understatement became load-bearing when the deck view gained damage sorting (#325): a Panache reported **Total damage 0**, sorted to the bottom, and under the attacks-only filter disappeared from the view entirely — the sort actively misreporting a card that deals real damage. ## The damage had nowhere to go Registering it is the easy half. No registered power had ever dealt damage, so `PowerAggregate` carried **no damage fields at all**. It now has the same five as `CardAggregate` — `TotalIntended`, `TotalBlocked`, `TotalOverkill`, `TotalEffective`, `Kills` — named to match so the tooltip vocabulary lines up, and merged through `MergePowerAggregatesInto` with everything else. ## Attribution Follows the primer's rule for downstream damage: arm a narrow window at a reliable event, consume only what plainly belongs to it. A **prefix** on `PanachePower.AfterCardPlayed` opens the window. The damage observer claims an entry only when it: - carries no card source - was dealt **by the power's owner** — a poison tick has no dealer at all, which is what cleanly separates the two - lands on an enemy - arrives within a bounded combat-history distance of the arm A prefix rather than a postfix on purpose: the method is `async`, so a postfix runs when the Task is *returned*, not when the damage resolves — it would close the window before the entries arrive. ## Schema New persisted fields come with `Fixtures/RunSchema/panache-power-damage-run.json`, a README entry, and three `SchemaLoadingTests` cases: historical load, resumable load, and a missing-field default asserted against the older `aggression-power-run.json`. `NotInDeckViewTests` pins the registry order and caught the new entry, exactly as its comment says it should. ## Verification `2137 passed, 0 failed`. Built, deployed, hot-reloaded: patch install went `433 → 434` and the diag dump lists `PanachePower.AfterCardPlayed`. **Restart required before behavioural testing.** This adds a Harmony target that was unpatched in the running process, so per the primer existing compiled callers may bypass the detour until a restart. Live verification not run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
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!329
No description provided.