# js/physics/rules/ — agents.md Part of the modularization pass. Module map: `MODULES.md`; runtime model: `architecture.md`. Installs into `P`: checkEndStates, birdsRemaining, starsFor. - Win/lose arbitration (called from step): all enemies dead -> won, no bird left in play with enemies alive -> lost. S-5 (added 2026-09-29): a LANDED bird counts as a bird still in play — do not declare `lost` while one is out in the world (it can still fall, smash and kill). `starsFor(g)` maps score to the level's three star thresholds. - Keep this submodule free of physics: it decides, it does not move anything.