Skip to content

W-043: ecs-prefab demo-dnd scenario, test-only (PREFAB-F06)

Type: feature · Size: S · Epic: E-prefab-v0 · Target: packages/ecs-prefab · Breaking: no Depends: W-040, W-041, W-042 Refs: spec PREFAB-070..PREFAB-073

Goal

Test the demo-dnd prefab scenario headlessly: Goblin and Orc templates, instances, and a Goblin Boss variant, with combatant queries and combat observers that must never see templates. The test defines its own combatant traits and does not change apps/demo-dnd. No package code changes, so no changeset.

Steps

  • S1 (PREFAB-070, PREFAB-071): Goblin and Orc templates with combatant traits; a combatant query returns exactly the N instances and never the templates; per-instance overrides leave the template unchanged; two Goblin instances have independent Health; files: packages/ecs-prefab/tests/dnd-scenario-spawn.test.ts
  • S2 (PREFAB-072, PREFAB-073): the Goblin Boss variant has its own Health and the goblin's other traits and is returned by the combatant query; combat-log and defeat observers using onQueryAdd and onQueryRemove do not fire for templates; files: packages/ecs-prefab/tests/dnd-scenario-variants.test.ts
  • S3 (check): run pnpm turbo run typecheck lint test --filter=@workspace/ecs-prefab; no changeset, since no package code changes

Log

  • 2026-11-01 created from the approved spec split of W-005 (Triage)
  • 2026-11-01 held: waits on the OQ6 decision after the W-039 S1 spike (decision logged in W-039 first) (Triage)