W-062: ecs-relations transitive reachability (REL-F02)¶
Type: feature · Size: S · Epic: E-relations-v0 · Target: packages/ecs-relations · Breaking: no Depends: W-060 Refs: spec REL-020..REL-028 (group REL-F02; KL3, KL8)
Goal¶
Implement isReachable(world, from, rel, to) in packages/ecs-relations: a pure, uncached traversal over the pairs present at call time, with no registration needed. Headless only.
Steps¶
- S1 (REL-020, REL-021, REL-022, REL-025, REL-026):
isReachablewalkstargetsFor(rel)fromfromwith a visited set; a direct pair counts; the result is not reflexive; no cache, so later changes are seen; works for exclusive and store relations; files: packages/ecs-relations/src/is-reachable.ts, packages/ecs-relations/src/index.ts, packages/ecs-relations/tests/is-reachable.test.ts - S2 (REL-023, REL-024, REL-027, REL-028; changeset): diamonds reach through either branch and visit each entity once; cycles terminate and answer correctly, including
a → a; destroying a middle entity breaks the path; a dead or foreign entity givesfalsewithout throwing; files: packages/ecs-relations/tests/is-reachable-graph.test.ts, packages/ecs-relations/src/is-reachable.ts, .changeset/w-062-ecs-relations-reachable.md (patch,@workspace/ecs-relations)
Log¶
- 2026-11-01 created (Triage), split from the approved spec W-008
- 2026-11-01 placed in Later (Depends W-060 not done; ready once the scaffold is done)
- 2026-11-02 moved to Next (Triage): W-060 done, size S, target and Goal filled
- 2026-11-02 moved down in Next behind the demo-critical items (Triage)