Create ecs/system-database/system-database.ts: Database.Plugin.create({ extends: Database.Plugin.combine(ComputedDatabase.plugin, scheduler), systems }) where the systems
map is declared inline (see features/ecs/systems.md — inline is required for db to be
typed and for system-name inference; a systems/ folder is optional, only for extracted
per-frame body helpers).
- A system is a
SystemDeclaration:{ create, schedule?: { before?, after?, during? } }.create(db)runs once (capture queries / index handles / closures); the returned function advances the world one tick. Returnvoidfor an init-only system (seeding entities). - The step math lives in
data/; each system reads store rows, calls the puredata/step, writes back — viadb.store(writable) for hot per-row work, ordb.transactions.*for discrete events. Iterate archetypes perarchetypes.md(tail→head when destroying rows). - Order under
schedule(mirror thedata/step's internal sequence); drive the loop by combiningscheduler(rAF), gated by theschedulerStateresource.
Only for real-time features (games, sims) — turn-based features skip this phase entirely.
Comes after build-computed. The how is in the auto-loading features/ecs/systems.md rule.