W-029: ecs-schedule run and stepping (SCH-F03, part 1)¶
Type: feature · Size: M · Epic: E-schedule-v0 · Target: packages/ecs-schedule · Breaking: no Depends: W-027, W-028 Refs: spec SCH-002, SCH-030, SCH-031, SCH-032, SCH-033, SCH-034, SCH-035, SCH-038, SCH-039, SCH-040, SCH-041, SCH-042, SCH-107, SCH-108, SCH-109, SCH-110, SCH-111
Goal¶
Complete run, runPhase, and runPhases for automatic and manual phases, with dt validation and no clock. The turn-based stepping contract (SCH-040) and the manual phase rules (SCH-107..111) are covered here. OnStart once-only handling and error or re-entrancy rules are in W-030.
Steps¶
- S1 (SCH-002, SCH-030, SCH-031):
runexecutes every enabled automatic phase in phase order and returns synchronously;dtis passed unchanged and no clock is read; files: packages/ecs-schedule/src/run.ts, packages/ecs-schedule/tests/run-full.test.ts - S2 (SCH-032, SCH-033, SCH-035):
runPhaseruns one phase;runPhasesruns an inclusive automatic range in phase order; consecutive ranges equal onerun; files: packages/ecs-schedule/src/run-phases.ts, packages/ecs-schedule/src/create-schedule.ts, packages/ecs-schedule/tests/run-phases.test.ts - S3 (SCH-034, SCH-041): unknown phase and
fromaftertothrow;NaN, infinite, or negativedtthrows before any system runs or state changes; files: packages/ecs-schedule/src/validate-run.ts, packages/ecs-schedule/tests/run-validate.test.ts, packages/ecs-schedule/src/create-schedule.ts - S4 (SCH-038, SCH-039, SCH-040, SCH-042): empty schedule or phase is a no-op; repeated
runwith changingdt;runPhasesstops at its range;dtof0passes through; files: packages/ecs-schedule/tests/run-stepping.test.ts - S5 (SCH-107, SCH-108, SCH-109, SCH-110, SCH-111):
runskips manual phases;runPhaseandrunPhasesrun manual phases of one component; mixed or cross-component endpoints throw; files: packages/ecs-schedule/src/run-manual.ts, packages/ecs-schedule/tests/run-manual.test.ts - S6 (changeset): add
.changeset/w-029-ecs-schedule-run.md(patch,@workspace/ecs-schedule)
Log¶
- 2026-11-01 created from the approved spec split of W-004 (Triage)
- 2026-11-02 moved from Next to Now, state active (Triage)
- 2026-11-02 S1 and S2 done, S2 Reviewer APPROVED (Triage)
- 2026-11-02 S3 done, Reviewer APPROVED; files add packages/ecs-schedule/src/create-schedule.ts (Triage)
- 2026-11-02 re-check the SCH-041 "state unchanged" OnStart assertion when W-030 lands (Triage)
- 2026-11-02 S4 done, Reviewer APPROVED; characterization tests, no src change (Triage)
- 2026-11-02 S5 done, Reviewer APPROVED after 1 fix round (Triage)
- 2026-11-02 S6 done; final Reviewer APPROVED, done (Triage)