W-032: ecs-schedule conditions (SCH-F04, part 2)¶
Type: feature · Size: M · Epic: E-schedule-v0 · Target: packages/ecs-schedule · Breaking: no Depends: W-031 Refs: spec SCH-113, SCH-118, SCH-119, SCH-120, SCH-121, SCH-122
Goal¶
Add system runIf conditions: a system runs only if it is enabled and its own runIf holds. Checks are evaluated per system and per call, in order, and short-circuit. Set conditions in SCH-118 are added in W-034 with sets. Conditions apply in every run API, including manual phases.
Steps¶
- S1 (SCH-118, SCH-119): check order is enabled flag, then own
runIf; a skipped system does not callrun; conditions are re-evaluated per system and per call; files: packages/ecs-schedule/src/conditions.ts, packages/ecs-schedule/tests/conditions-order.test.ts - S2 (SCH-120, SCH-121):
runIf(world)is called synchronously with only the world; a non-boolean result throws naming the schedule and system; files: packages/ecs-schedule/tests/conditions-validate.test.ts - S3 (SCH-122): conditions apply in
runPhaseandrunPhases, including manual phases; files: packages/ecs-schedule/tests/conditions-phases.test.ts - S3a (SCH-113): an OnStart phase whose systems are all skipped by
runIfcounts as done once the phase completed; a last system skipped byrunIfleaves earlier systems not rerun on the next call; a throw in an earlier OnStart system leaves OnStart not done even when the last system is skipped byrunIf; replaces the matchingit.todoentry in packages/ecs-schedule/tests/on-start-done.test.ts; files: packages/ecs-schedule/tests/on-start-done.test.ts - S4 (changeset): add
.changeset/w-032-ecs-schedule-conditions.md(patch,@workspace/ecs-schedule)
Log¶
- 2026-11-01 created from the approved spec split of W-004 (Triage)
- 2026-11-02 S3a added for SCH-113 (runIf-skipped OnStart), taken from the deferred W-030 S2 cases (Triage)