houserules/packages
Joey Yakimowich-Payne 9441570349
feat(engine): aura effect computation + onAfterMove hook
T3 Wave 4 (T28). Wires the add-aura primitive's seeded AuraSpec facts
into a runtime recomputation that produces AuraContributions on
affected pieces every move.

- computeAuraFacts(session):
    1. Retracts every AuraContributions fact (clean slate).
    2. Walks every piece with an AuraSpec list and, for each aura,
       finds all in-range pieces via Chebyshev (king-move) distance
       and accumulates deltas per (targetId, targetAttr).
    3. Commits the staging map as AuraContributions = { attr → delta }
       on each affected piece. Empty maps are NOT written, so
       unaffected pieces return undefined for session.get(id, 'AuraContributions').
- New ChessAttrMap entry: AuraContributions = Readonly<Record<string, number>>.
- __modifier-profile-integration__ preset gains an onAfterMove hook
  that calls computeAuraFacts(session) after every successful move.
  Self-application is skipped; source moving out of range retracts
  contribution on next recompute.

9 vitest scenarios: neighbour coverage, out-of-range exclusion,
multi-source accumulation, self-application skip, stale retraction
on source move, idempotency, multi-attr per source, empty-state
no-op, and the engine end-to-end wiring via onAfterMove.

Consumer wiring (HpBonus + AuraContributions[HpBonus] compose at
effective-attr read points) is deferred — this task delivers the
infrastructure and the recompute cadence; downstream readers
integrate on an as-needed basis.
2026-04-19 20:05:38 -06:00
..
chess feat(engine): aura effect computation + onAfterMove hook 2026-04-19 20:05:38 -06:00
rete refactor(rete): use asEntityId for AGG_FACT sentinel id 2026-04-19 16:49:50 -06:00
server feat(server): custom-modifier.register WS handler 2026-04-19 20:01:11 -06:00