Skip to content

Invalidate mechanics on new patch instead of on a timer #8

Description

@Glockner00

Parent

#1

What to build

Mechanics are never stale after a balance patch. Today item and hero assets expire on a fixed multi-day timer, but patches have shipped a day apart — so the coach can serve outdated mechanics for up to a week.

That is the worst possible thing to be wrong about. Mechanics are the layer supplying the reason behind a recommendation, and the layer a player will trust most. Telling someone to buy an item for an effect a patch removed is a confident, well-formatted, wrong answer.

After this ticket, the arrival of a new patch event invalidates stored mechanics and triggers a re-sync. Freshness is driven by patch detection, not elapsed time.

Implement at the snapshot layer, not per table. Invalidation should apply to mechanics snapshots generally, so ability mechanics (#6) inherit this automatically when they land, with no follow-up work. Writing it per-table would mean revisiting this ticket later.

Keep the timer as a backstop for the case where no patch has ever been observed locally, so a fresh workspace still behaves sensibly.

Only mechanics need this. Statistics degrade gracefully with window age and are handled separately; mechanics are either current or wrong.

Acceptance criteria

  • Recording a new patch event invalidates stored mechanics
  • The next mechanics lookup after invalidation triggers a re-sync from upstream
  • With no new patch event, a mechanics lookup performs no upstream request
  • Invalidation is implemented against mechanics snapshots generally, so future mechanics types inherit it without changes
  • The elapsed-time expiry remains as a fallback when no patch event has been observed
  • Statistical data is unaffected by patch-driven invalidation
  • Invalidation is resilient to patch events arriving out of chronological order
  • Tested at the coach tool seam: a test asserts a lookup, then a patch event, then a second lookup causes exactly one re-sync — and that a lookup without an intervening patch event causes none
  • Full test suite passes

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions