@reicek/neataptic-ts 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/.github/agents/boundary-mapper.agent.md +31 -0
  2. package/.github/agents/docs-scout.agent.md +29 -0
  3. package/.github/agents/plan-scout.agent.md +31 -0
  4. package/.github/agents/solid-split.agent.md +143 -0
  5. package/.github/copilot-instructions.md +119 -0
  6. package/.github/skills/solid-split-playbook/SKILL.md +220 -0
  7. package/.github/skills/solid-split-playbook/assets/docs-checklist.md +34 -0
  8. package/.github/skills/solid-split-playbook/assets/split-plan-template.md +48 -0
  9. package/.github/skills/solid-split-playbook/assets/split-workflow-checklist.md +51 -0
  10. package/.github/skills/trace-analyzer-extension/SKILL.md +63 -0
  11. package/.github/skills/trace-analyzer-extension/assets/extension-checklist.md +24 -0
  12. package/.github/skills/trace-analyzer-extension/references/analyzer-extension-workflow.md +101 -0
  13. package/.github/skills/trace-audit-reporting/SKILL.md +96 -0
  14. package/.github/skills/trace-audit-reporting/assets/performance-report-template.md +123 -0
  15. package/.github/skills/trace-audit-reporting/references/trace-analysis-workflow.md +132 -0
  16. package/package.json +7 -3
  17. package/plans/ES2023 migration +13 -8
  18. package/plans/Evolution_Training_Interoperability_Contracts.md +1 -1
  19. package/plans/Flappy_Bird_Folder_Documentation_Pass.md +53 -0
  20. package/plans/Flappy_Evolution_Worker_Documentation_Pass.md +58 -0
  21. package/plans/Interactive_Examples_and_Learning_Path.md +10 -2
  22. package/plans/Memory_Optimization.md +3 -3
  23. package/plans/README.md +63 -0
  24. package/plans/Roadmap.md +15 -3
  25. package/plans/asciiMaze_SOLID_split.done.md +130 -0
  26. package/plans/flappy_bird_SOLID_split.done.md +67 -0
  27. package/scripts/analyze-trace.ts +590 -0
  28. package/scripts/assets/theme.css +221 -34
  29. package/scripts/copy-examples.mjs +9 -5
  30. package/scripts/export-onnx.mjs +3 -3
  31. package/scripts/generate-bench-tables.mjs +10 -10
  32. package/scripts/generate-bench-tables.ts +10 -10
  33. package/scripts/generate-docs.ts +1415 -449
  34. package/scripts/render-docs-html.ts +15 -8
  35. package/src/README.md +127 -222
  36. package/src/architecture/README.md +117 -184
  37. package/src/architecture/architect.ts +6 -0
  38. package/src/architecture/layer/README.md +38 -38
  39. package/src/architecture/network/README.md +49 -31
  40. package/src/architecture/network/activate/README.md +77 -77
  41. package/src/architecture/network/connect/README.md +15 -13
  42. package/src/architecture/network/deterministic/README.md +7 -7
  43. package/src/architecture/network/evolve/README.md +44 -44
  44. package/src/architecture/network/gating/README.md +20 -20
  45. package/src/architecture/network/genetic/README.md +51 -51
  46. package/src/architecture/network/mutate/README.md +97 -97
  47. package/src/architecture/network/network.types.ts +39 -0
  48. package/src/architecture/network/onnx/README.md +264 -264
  49. package/src/architecture/network/prune/README.md +39 -39
  50. package/src/architecture/network/remove/README.md +26 -26
  51. package/src/architecture/network/serialize/README.md +56 -56
  52. package/src/architecture/network/serialize/network.serialize.json.utils.ts +1 -0
  53. package/src/architecture/network/serialize/network.serialize.utils.ts +6 -1
  54. package/src/architecture/network/serialize/network.serialize.utils.types.ts +1 -1
  55. package/src/architecture/network/slab/README.md +61 -61
  56. package/src/architecture/network/standalone/README.md +24 -24
  57. package/src/architecture/network/stats/README.md +9 -9
  58. package/src/architecture/network/topology/README.md +46 -46
  59. package/src/architecture/network/training/README.md +21 -21
  60. package/src/architecture/network.ts +114 -10
  61. package/src/methods/README.md +9 -87
  62. package/src/multithreading/README.md +8 -77
  63. package/src/multithreading/workers/README.md +2 -2
  64. package/src/multithreading/workers/browser/README.md +0 -6
  65. package/src/multithreading/workers/node/README.md +0 -3
  66. package/src/neat/README.md +623 -568
  67. package/src/neat/neat.evolve.population.utils.ts +29 -5
  68. package/src/neat/neat.helpers.ts +16 -0
  69. package/src/neat/neat.topology-intent.utils.ts +160 -0
  70. package/src/utils/README.md +18 -18
  71. package/test/examples/asciiMaze/README.md +59 -59
  72. package/test/examples/asciiMaze/asciiMaze.e2e.test.ts +14 -9
  73. package/test/examples/asciiMaze/browser-entry/README.md +196 -0
  74. package/test/examples/asciiMaze/browser-entry/browser-entry.abort.services.ts +95 -0
  75. package/test/examples/asciiMaze/browser-entry/browser-entry.constants.ts +23 -0
  76. package/test/examples/asciiMaze/browser-entry/browser-entry.curriculum.services.ts +115 -0
  77. package/test/examples/asciiMaze/browser-entry/browser-entry.globals.services.ts +106 -0
  78. package/test/examples/asciiMaze/browser-entry/browser-entry.host.services.ts +157 -0
  79. package/test/examples/asciiMaze/browser-entry/browser-entry.services.ts +14 -0
  80. package/test/examples/asciiMaze/browser-entry/browser-entry.ts +129 -0
  81. package/test/examples/asciiMaze/browser-entry/browser-entry.types.ts +120 -0
  82. package/test/examples/asciiMaze/browser-entry/browser-entry.utils.ts +98 -0
  83. package/test/examples/asciiMaze/browser-entry.ts +10 -576
  84. package/test/examples/asciiMaze/dashboardManager/README.md +276 -0
  85. package/test/examples/asciiMaze/dashboardManager/archive/README.md +16 -0
  86. package/test/examples/asciiMaze/dashboardManager/archive/dashboardManager.archive.services.ts +267 -0
  87. package/test/examples/asciiMaze/dashboardManager/dashboardManager.constants.ts +35 -0
  88. package/test/examples/asciiMaze/dashboardManager/dashboardManager.services.ts +103 -0
  89. package/test/examples/asciiMaze/dashboardManager/dashboardManager.ts +181 -0
  90. package/test/examples/asciiMaze/dashboardManager/dashboardManager.types.ts +267 -0
  91. package/test/examples/asciiMaze/dashboardManager/dashboardManager.utils.ts +254 -0
  92. package/test/examples/asciiMaze/dashboardManager/live/README.md +14 -0
  93. package/test/examples/asciiMaze/dashboardManager/live/dashboardManager.live.services.ts +264 -0
  94. package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +47 -0
  95. package/test/examples/asciiMaze/dashboardManager/telemetry/dashboardManager.telemetry.services.ts +513 -0
  96. package/test/examples/asciiMaze/dashboardManager.ts +13 -2335
  97. package/test/examples/asciiMaze/evolutionEngine/README.md +1058 -0
  98. package/test/examples/asciiMaze/evolutionEngine/curriculumPhase.ts +90 -0
  99. package/test/examples/asciiMaze/evolutionEngine/engineState.constants.ts +36 -0
  100. package/test/examples/asciiMaze/evolutionEngine/engineState.ts +58 -513
  101. package/test/examples/asciiMaze/evolutionEngine/engineState.types.ts +212 -0
  102. package/test/examples/asciiMaze/evolutionEngine/engineState.utils.ts +301 -0
  103. package/test/examples/asciiMaze/evolutionEngine/evolutionEngine.types.ts +445 -0
  104. package/test/examples/asciiMaze/evolutionEngine/evolutionLoop.ts +81 -50
  105. package/test/examples/asciiMaze/evolutionEngine/optionsAndSetup.ts +2 -4
  106. package/test/examples/asciiMaze/evolutionEngine/populationDynamics.ts +17 -33
  107. package/test/examples/asciiMaze/evolutionEngine/populationPruning.ts +1 -1
  108. package/test/examples/asciiMaze/evolutionEngine/rngAndTiming.ts +1 -2
  109. package/test/examples/asciiMaze/evolutionEngine/sampling.ts +1 -1
  110. package/test/examples/asciiMaze/evolutionEngine/scratchPools.ts +2 -5
  111. package/test/examples/asciiMaze/evolutionEngine/setupHelpers.ts +30 -37
  112. package/test/examples/asciiMaze/evolutionEngine/telemetryMetrics.ts +16 -58
  113. package/test/examples/asciiMaze/evolutionEngine/trainingWarmStart.ts +2 -2
  114. package/test/examples/asciiMaze/evolutionEngine.ts +55 -55
  115. package/test/examples/asciiMaze/fitness.ts +2 -2
  116. package/test/examples/asciiMaze/fitness.types.ts +65 -0
  117. package/test/examples/asciiMaze/interfaces.ts +64 -1352
  118. package/test/examples/asciiMaze/mazeMovement/README.md +356 -0
  119. package/test/examples/asciiMaze/mazeMovement/finalization/README.md +49 -0
  120. package/test/examples/asciiMaze/mazeMovement/finalization/mazeMovement.finalization.ts +138 -0
  121. package/test/examples/asciiMaze/mazeMovement/mazeMovement.constants.ts +101 -0
  122. package/test/examples/asciiMaze/mazeMovement/mazeMovement.services.ts +230 -0
  123. package/test/examples/asciiMaze/mazeMovement/mazeMovement.ts +299 -0
  124. package/test/examples/asciiMaze/mazeMovement/mazeMovement.types.ts +185 -0
  125. package/test/examples/asciiMaze/mazeMovement/mazeMovement.utils.ts +153 -0
  126. package/test/examples/asciiMaze/mazeMovement/policy/README.md +91 -0
  127. package/test/examples/asciiMaze/mazeMovement/policy/mazeMovement.policy.ts +467 -0
  128. package/test/examples/asciiMaze/mazeMovement/runtime/README.md +95 -0
  129. package/test/examples/asciiMaze/mazeMovement/runtime/mazeMovement.runtime.ts +354 -0
  130. package/test/examples/asciiMaze/mazeMovement/shaping/README.md +124 -0
  131. package/test/examples/asciiMaze/mazeMovement/shaping/mazeMovement.shaping.ts +459 -0
  132. package/test/examples/asciiMaze/mazeMovement.ts +12 -2978
  133. package/test/examples/flappy_bird/README.md +193 -88
  134. package/test/examples/flappy_bird/browser-entry/README.md +1441 -0
  135. package/test/examples/flappy_bird/browser-entry/browser-entry.host.utils.ts +4 -324
  136. package/test/examples/flappy_bird/browser-entry/browser-entry.network-view.utils.ts +9 -396
  137. package/test/examples/flappy_bird/browser-entry/browser-entry.playback.utils.ts +6 -714
  138. package/test/examples/flappy_bird/browser-entry/browser-entry.render.types.ts +26 -3
  139. package/test/examples/flappy_bird/browser-entry/browser-entry.runtime.types.ts +16 -1
  140. package/test/examples/flappy_bird/browser-entry/browser-entry.simulation.types.ts +39 -5
  141. package/test/examples/flappy_bird/browser-entry/browser-entry.spawn.utils.ts +11 -31
  142. package/test/examples/flappy_bird/browser-entry/browser-entry.stats.types.ts +32 -4
  143. package/test/examples/flappy_bird/browser-entry/browser-entry.ts +11 -0
  144. package/test/examples/flappy_bird/browser-entry/browser-entry.types.ts +8 -0
  145. package/test/examples/flappy_bird/browser-entry/browser-entry.visualization.types.ts +50 -7
  146. package/test/examples/flappy_bird/browser-entry/browser-entry.visualization.utils.ts +21 -893
  147. package/test/examples/flappy_bird/browser-entry/browser-entry.worker.types.ts +91 -10
  148. package/test/examples/flappy_bird/browser-entry/host/README.md +318 -0
  149. package/test/examples/flappy_bird/browser-entry/host/host.canvas.service.ts +16 -0
  150. package/test/examples/flappy_bird/browser-entry/host/host.constants.ts +20 -0
  151. package/test/examples/flappy_bird/browser-entry/host/host.dom.service.ts +10 -0
  152. package/test/examples/flappy_bird/browser-entry/host/host.resize.service.ts +1 -295
  153. package/test/examples/flappy_bird/browser-entry/host/host.stats.service.ts +14 -0
  154. package/test/examples/flappy_bird/browser-entry/host/host.ts +592 -6
  155. package/test/examples/flappy_bird/browser-entry/host/host.types.ts +13 -0
  156. package/test/examples/flappy_bird/browser-entry/host/resize/README.md +309 -0
  157. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.constants.ts +47 -0
  158. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.services.ts +392 -0
  159. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.ts +132 -0
  160. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.types.ts +92 -0
  161. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.utils.ts +272 -0
  162. package/test/examples/flappy_bird/browser-entry/network-view/README.md +389 -0
  163. package/test/examples/flappy_bird/browser-entry/network-view/network-view.draw.service.ts +13 -0
  164. package/test/examples/flappy_bird/browser-entry/network-view/network-view.labels.utils.ts +12 -0
  165. package/test/examples/flappy_bird/browser-entry/network-view/network-view.layout.utils.ts +14 -0
  166. package/test/examples/flappy_bird/browser-entry/network-view/network-view.topology.utils.ts +267 -0
  167. package/test/examples/flappy_bird/browser-entry/network-view/network-view.ts +823 -7
  168. package/test/examples/flappy_bird/browser-entry/network-view/network-view.types.ts +11 -0
  169. package/test/examples/flappy_bird/browser-entry/playback/README.md +845 -0
  170. package/test/examples/flappy_bird/browser-entry/playback/background/README.md +355 -0
  171. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +1068 -0
  172. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.batch.services.ts +64 -0
  173. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.cache.services.ts +207 -0
  174. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.constants.ts +197 -0
  175. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.batch.utils.ts +114 -0
  176. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.layout.utils.test.ts +96 -0
  177. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.layout.utils.ts +204 -0
  178. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.services.ts +49 -0
  179. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.utils.ts +313 -0
  180. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.layer.services.ts +81 -0
  181. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.math.utils.test.ts +33 -0
  182. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.math.utils.ts +201 -0
  183. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.selection.utils.ts +171 -0
  184. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.timing.utils.ts +124 -0
  185. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.utils.test.ts +279 -0
  186. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.utils.ts +132 -0
  187. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.scene.services.ts +26 -0
  188. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.services.ts +65 -0
  189. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.ts +48 -0
  190. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.types.ts +342 -0
  191. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.utils.ts +10 -0
  192. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.cache.services.ts +96 -0
  193. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.constants.ts +127 -0
  194. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.draw.services.ts +184 -0
  195. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.scene.services.ts +64 -0
  196. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.services.ts +6 -0
  197. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.ts +53 -0
  198. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.types.ts +105 -0
  199. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.utils.ts +100 -0
  200. package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +541 -0
  201. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.bird.utils.ts +180 -0
  202. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.canvas.services.ts +77 -0
  203. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.entity.services.ts +167 -0
  204. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.scene.services.ts +57 -0
  205. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.service.test.ts +176 -0
  206. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.service.ts +113 -0
  207. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.services.ts +35 -0
  208. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.trail.utils.ts +248 -0
  209. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.types.ts +103 -0
  210. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.utils.ts +11 -0
  211. package/test/examples/flappy_bird/browser-entry/playback/playback.constants.ts +1 -1
  212. package/test/examples/flappy_bird/browser-entry/playback/playback.frame-render.service.ts +10 -0
  213. package/test/examples/flappy_bird/browser-entry/playback/playback.iteration.services.ts +192 -0
  214. package/test/examples/flappy_bird/browser-entry/playback/playback.loop.service.ts +12 -0
  215. package/test/examples/flappy_bird/browser-entry/playback/playback.orchestration.types.ts +78 -0
  216. package/test/examples/flappy_bird/browser-entry/playback/playback.render.pipe-outline.service.ts +128 -0
  217. package/test/examples/flappy_bird/browser-entry/playback/playback.render.service.ts +1 -116
  218. package/test/examples/flappy_bird/browser-entry/playback/playback.session.services.ts +184 -0
  219. package/test/examples/flappy_bird/browser-entry/playback/playback.snapshot.utils.test.ts +121 -0
  220. package/test/examples/flappy_bird/browser-entry/playback/playback.snapshot.utils.ts +8 -0
  221. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.layer.services.ts +36 -0
  222. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.service.ts +11 -128
  223. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.services.ts +268 -0
  224. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.types.ts +91 -0
  225. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.utils.ts +11 -4
  226. package/test/examples/flappy_bird/browser-entry/playback/playback.trail.utils.ts +9 -86
  227. package/test/examples/flappy_bird/browser-entry/playback/playback.ts +75 -7
  228. package/test/examples/flappy_bird/browser-entry/playback/playback.types.ts +12 -9
  229. package/test/examples/flappy_bird/browser-entry/playback/playback.worker-channel.utils.ts +11 -123
  230. package/test/examples/flappy_bird/browser-entry/playback/snapshot/README.md +55 -0
  231. package/test/examples/flappy_bird/browser-entry/playback/snapshot/playback.snapshot.services.ts +103 -0
  232. package/test/examples/flappy_bird/browser-entry/playback/snapshot/playback.snapshot.summary.utils.test.ts +45 -0
  233. package/test/examples/flappy_bird/browser-entry/playback/snapshot/playback.snapshot.summary.utils.ts +28 -0
  234. package/test/examples/flappy_bird/browser-entry/playback/trail/README.md +95 -0
  235. package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.history.services.test.ts +35 -0
  236. package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.history.services.ts +64 -0
  237. package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.opacity.utils.test.ts +37 -0
  238. package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.opacity.utils.ts +74 -0
  239. package/test/examples/flappy_bird/browser-entry/playback/worker-channel/README.md +71 -0
  240. package/test/examples/flappy_bird/browser-entry/playback/worker-channel/playback.worker-channel.request.services.ts +45 -0
  241. package/test/examples/flappy_bird/browser-entry/playback/worker-channel/playback.worker-channel.summary.services.ts +74 -0
  242. package/test/examples/flappy_bird/browser-entry/playback/worker-channel/playback.worker-channel.types.ts +53 -0
  243. package/test/examples/flappy_bird/browser-entry/runtime/README.md +304 -0
  244. package/test/examples/flappy_bird/browser-entry/runtime/runtime.browser-globals.service.ts +15 -0
  245. package/test/examples/flappy_bird/browser-entry/runtime/runtime.errors.ts +17 -0
  246. package/test/examples/flappy_bird/browser-entry/runtime/runtime.evolution-launch.service.ts +56 -0
  247. package/test/examples/flappy_bird/browser-entry/runtime/runtime.evolution-loop.service.ts +19 -0
  248. package/test/examples/flappy_bird/browser-entry/runtime/runtime.lifecycle.service.ts +96 -0
  249. package/test/examples/flappy_bird/browser-entry/runtime/runtime.startup.service.ts +92 -0
  250. package/test/examples/flappy_bird/browser-entry/runtime/runtime.telemetry.service.ts +24 -0
  251. package/test/examples/flappy_bird/browser-entry/runtime/runtime.ts +31 -121
  252. package/test/examples/flappy_bird/browser-entry/runtime/runtime.types.ts +65 -0
  253. package/test/examples/flappy_bird/browser-entry/visualization/README.md +568 -0
  254. package/test/examples/flappy_bird/browser-entry/visualization/visualization.colors.utils.ts +26 -0
  255. package/test/examples/flappy_bird/browser-entry/visualization/visualization.constants.ts +110 -0
  256. package/test/examples/flappy_bird/browser-entry/visualization/visualization.draw.service.ts +979 -19
  257. package/test/examples/flappy_bird/browser-entry/visualization/visualization.legend.utils.ts +157 -3
  258. package/test/examples/flappy_bird/browser-entry/visualization/visualization.topology.utils.ts +13 -27
  259. package/test/examples/flappy_bird/browser-entry/visualization/visualization.ts +7 -20
  260. package/test/examples/flappy_bird/browser-entry/visualization/visualization.types.ts +14 -0
  261. package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +238 -0
  262. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.errors.ts +11 -0
  263. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.generation.service.ts +12 -0
  264. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.playback.service.test.ts +143 -0
  265. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.playback.service.ts +140 -14
  266. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.request.service.ts +27 -0
  267. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.ts +8 -0
  268. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.types.ts +23 -0
  269. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.url.service.ts +5 -0
  270. package/test/examples/flappy_bird/constants/README.md +1163 -0
  271. package/test/examples/flappy_bird/constants/constants.birds.ts +16 -38
  272. package/test/examples/flappy_bird/constants/constants.difficulty.ts +21 -0
  273. package/test/examples/flappy_bird/constants/constants.network-view.ts +24 -0
  274. package/test/examples/flappy_bird/constants/constants.network.ts +1 -1
  275. package/test/examples/flappy_bird/constants/constants.observation.ts +7 -0
  276. package/test/examples/flappy_bird/constants/constants.palette.ts +9 -2
  277. package/test/examples/flappy_bird/constants/constants.physics.ts +9 -0
  278. package/test/examples/flappy_bird/constants/constants.pipe-render.ts +3 -0
  279. package/test/examples/flappy_bird/constants/constants.pipes.ts +22 -3
  280. package/test/examples/flappy_bird/constants/constants.runtime.ts +28 -4
  281. package/test/examples/flappy_bird/constants/constants.starfield.ts +78 -3
  282. package/test/examples/flappy_bird/constants/constants.ts +6 -0
  283. package/test/examples/flappy_bird/environment/README.md +182 -0
  284. package/test/examples/flappy_bird/environment/environment.collision.utils.ts +7 -0
  285. package/test/examples/flappy_bird/environment/environment.constants.ts +16 -3
  286. package/test/examples/flappy_bird/environment/environment.observation.utils.ts +12 -19
  287. package/test/examples/flappy_bird/environment/environment.state.service.ts +10 -0
  288. package/test/examples/flappy_bird/environment/environment.step.service.ts +15 -66
  289. package/test/examples/flappy_bird/environment/environment.types.ts +14 -0
  290. package/test/examples/flappy_bird/evaluation/README.md +155 -0
  291. package/test/examples/flappy_bird/evaluation/evaluation.constants.ts +23 -4
  292. package/test/examples/flappy_bird/evaluation/evaluation.fitness.utils.ts +16 -1
  293. package/test/examples/flappy_bird/evaluation/evaluation.rollout.service.ts +7 -374
  294. package/test/examples/flappy_bird/evaluation/evaluation.seed.utils.ts +4 -0
  295. package/test/examples/flappy_bird/evaluation/evaluation.types.ts +18 -2
  296. package/test/examples/flappy_bird/evaluation/rollout/README.md +355 -0
  297. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.constants.ts +38 -0
  298. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.service.ts +71 -0
  299. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.services.ts +338 -0
  300. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.types.ts +69 -0
  301. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.utils.ts +399 -0
  302. package/test/examples/flappy_bird/flappy-evolution-worker/README.md +845 -0
  303. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.constants.ts +49 -7
  304. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.errors.ts +34 -3
  305. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.evolution.service.ts +22 -0
  306. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.playback.service.ts +62 -26
  307. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.protocol.service.ts +27 -1
  308. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.runtime.service.ts +23 -0
  309. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.frame.service.ts +378 -0
  310. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.types.ts +22 -0
  311. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.utils.ts +20 -203
  312. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.snapshot.utils.test.ts +94 -0
  313. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.snapshot.utils.ts +78 -13
  314. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.ts +235 -344
  315. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.types.ts +170 -22
  316. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.warm-start.service.ts +314 -0
  317. package/test/examples/flappy_bird/flappy.simulation.shared.utils.ts +17 -0
  318. package/test/examples/flappy_bird/flappyEnvironment.ts +21 -0
  319. package/test/examples/flappy_bird/flappyEvaluation.ts +12 -0
  320. package/test/examples/flappy_bird/flappyEvolution.worker.ts +7 -0
  321. package/test/examples/flappy_bird/index.ts +8 -2
  322. package/test/examples/flappy_bird/rng.ts +10 -0
  323. package/test/examples/flappy_bird/simulation-shared/README.md +518 -0
  324. package/test/examples/flappy_bird/simulation-shared/observation/README.md +255 -0
  325. package/test/examples/flappy_bird/simulation-shared/observation/observation.features.utils.ts +339 -0
  326. package/test/examples/flappy_bird/simulation-shared/observation/observation.ts +19 -0
  327. package/test/examples/flappy_bird/simulation-shared/observation/observation.vector.utils.ts +81 -0
  328. package/test/examples/flappy_bird/simulation-shared/simulation-shared.constants.ts +3 -0
  329. package/test/examples/flappy_bird/simulation-shared/simulation-shared.control.utils.ts +6 -0
  330. package/test/examples/flappy_bird/simulation-shared/simulation-shared.difficulty.utils.ts +9 -0
  331. package/test/examples/flappy_bird/simulation-shared/simulation-shared.errors.ts +10 -1
  332. package/test/examples/flappy_bird/simulation-shared/simulation-shared.memory.utils.ts +18 -0
  333. package/test/examples/flappy_bird/simulation-shared/simulation-shared.observation.utils.ts +7 -402
  334. package/test/examples/flappy_bird/simulation-shared/simulation-shared.spawn.utils.ts +36 -6
  335. package/test/examples/flappy_bird/{evaluation/evaluation.statistics.utils.ts → simulation-shared/simulation-shared.statistics.utils.ts} +30 -9
  336. package/test/examples/flappy_bird/simulation-shared/simulation-shared.types.ts +38 -5
  337. package/test/examples/flappy_bird/trainFlappyBird.ts +13 -0
  338. package/test/examples/flappy_bird/trainer/README.md +676 -0
  339. package/test/examples/flappy_bird/trainer/evaluation/README.md +253 -0
  340. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.constants.ts +15 -0
  341. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.services.ts +86 -0
  342. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.ts +187 -0
  343. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.types.ts +32 -0
  344. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.utils.ts +182 -0
  345. package/test/examples/flappy_bird/trainer/trainer.evaluation.service.ts +13 -0
  346. package/test/examples/flappy_bird/trainer/trainer.fitness.service.ts +23 -1
  347. package/test/examples/flappy_bird/trainer/trainer.loop.service.ts +17 -1
  348. package/test/examples/flappy_bird/trainer/trainer.report.service.services.ts +181 -0
  349. package/test/examples/flappy_bird/trainer/trainer.report.service.ts +136 -0
  350. package/test/examples/flappy_bird/trainer/trainer.selection.utils.ts +89 -0
  351. package/test/examples/flappy_bird/trainer/trainer.setup.service.ts +22 -0
  352. package/test/examples/flappy_bird/trainer/trainer.signals.service.ts +8 -0
  353. package/test/examples/flappy_bird/trainer/trainer.ts +38 -553
  354. package/test/examples/flappy_bird/trainer/trainer.types.ts +44 -7
  355. package/test/neat/neat.topology-intent.test.ts +129 -0
  356. package/test/network/network.topology-intent.test.ts +44 -0
  357. package/test/examples/flappy_bird/browser-entry/browser-entry.utils.ts +0 -12
  358. package/test/examples/flappy_bird/environment/environment.ts +0 -7
  359. package/test/examples/flappy_bird/evaluation/evaluation.ts +0 -7
  360. package/test/examples/flappy_bird/simulation-shared/simulation-shared.ts +0 -15
  361. package/test/examples/flappy_bird/trainer/trainer.statistics.utils.ts +0 -78
@@ -5,17 +5,26 @@ Objective
5
5
  ---------
6
6
  Aggressively modernize the codebase to idiomatic ES2023, leveraging the latest TypeScript and JavaScript features to improve code clarity, expressiveness, and maintainability. As an educational library, it should serve as an example of modern coding practices.
7
7
 
8
+ Roadmap status
9
+ --------------
10
+ This plan is part of `plans/Roadmap.md` Phase 0, but it starts after the current demo-structure work is complete.
11
+
12
+ Current prerequisite work before broad mechanical modernization:
13
+ - refine the active demo surfaces, especially `test/examples/flappy_bird`,
14
+ - finish the SOLID split of `test/examples/asciiMaze`,
15
+ - keep touched orchestration in `src/` strict about responsibility boundaries, substitutability, and DRY reuse.
16
+
8
17
  Guiding Principles
9
18
  ------------------
10
19
  1. **Modern First**: Always prefer the most modern and expressive ES2023+ features where they improve clarity.
11
20
  2. **Test-Driven Refactoring**: All changes will be validated against the existing comprehensive test suite (909+ tests). No new features will be added, but refactoring will be done with confidence that the public API and behavior remain unchanged.
12
21
  3. **API Stability**: Maintain the existing public API contract. Syntactic changes must be behavior-preserving, as confirmed by passing tests.
13
- 4. **Memory Diligence**: Proactively use memory-saving techniques like memory pools and object reuse where appropriate.
22
+ 4. **Scope Discipline**: Keep this plan focused on syntax, modules, and enforcement. Memory-management features and performance architecture belong in `plans/Memory_Optimization.md`.
14
23
 
15
24
  Phase Roadmap
16
25
  -------------
17
26
  * **Phase 0: Baseline & Tooling**
18
- * **Status**: Not Started
27
+ * **Status**: Queued behind current demo refactor work
19
28
  * **Description**: Set up and configure linting and code style validation tools to enforce modern syntax.
20
29
 
21
30
  * **Phase 1: Mechanical Syntax Upgrades**
@@ -30,15 +39,11 @@ Phase Roadmap
30
39
  * **Status**: Not Started
31
40
  * **Description**: Convert CommonJS `require()` statements to ES modules (`import`/`export`) and audit for import cycles.
32
41
 
33
- * **Phase 4: Advanced Memory Management**
34
- * **Status**: Not Started
35
- * **Description**: Implement an optional `WeakRef`-based tracking system for large network populations to reduce memory pressure.
36
-
37
- * **Phase 5: Automation & CI**
42
+ * **Phase 4: Automation & CI**
38
43
  * **Status**: Not Started
39
44
  * **Description**: Implement CI checks to enforce ES2023 style and prevent regressions.
40
45
 
41
- * **Phase 6: Documentation**
46
+ * **Phase 5: Documentation**
42
47
  * **Status**: Not Started
43
48
  * **Description**: Update all project documentation, including `README.md` and contributor guidelines, to reflect the modernized codebase.
44
49
 
@@ -187,4 +187,4 @@ Acceptance:
187
187
 
188
188
  - Hybrid workflows are well-defined and reproducible.
189
189
  - Training integration does not require ad-hoc per-project glue.
190
- - Parameter mapping becomes a building block for export/worker features.
190
+ - Parameter mapping becomes a later unification seam for export- and worker-adjacent tooling once those Phase 4 foundations exist.
@@ -0,0 +1,53 @@
1
+ # Flappy Bird Folder Documentation Pass
2
+
3
+ ## Purpose
4
+
5
+ Run a folder-focused documentation pass across every README-owning folder under
6
+ `test/examples/flappy_bird` so the generated documentation reads like a guided
7
+ tour of the example architecture rather than a sparse export inventory.
8
+
9
+ ## Root
10
+
11
+ - Split root: `test/examples/flappy_bird`
12
+ - README inventory: 24 README-owning folders under the root
13
+ - Nearest README reviewed: `test/examples/flappy_bird/README.md`
14
+ - Parent README reviewed: `test/examples/README.md` if needed per step
15
+ - Relevant plan: `plans/Interactive_Examples_and_Learning_Path.md`
16
+
17
+ ## Durable Rules
18
+
19
+ - Keep the README inventory explicit and visible in the todo list.
20
+ - Keep exactly one active README or README-owning folder at a time.
21
+ - Do not hand-edit generated subfolder README files; improve source JSDoc and
22
+ regenerate docs.
23
+ - Keep compatibility facades documented as facades, not as implementation sinks.
24
+ - Prefer educational JSDoc that explains what, why, invariants, defaults, and
25
+ performance tradeoffs when those details help a learner understand the example.
26
+
27
+ ## Target Shape
28
+
29
+ - Each README-owning folder has source JSDoc rich enough to generate a useful
30
+ README without manual rescue edits.
31
+ - Compatibility facades explain where deeper responsibilities live.
32
+ - Browser, evaluation, simulation, worker, and trainer boundaries read like a
33
+ coherent architecture map when browsed top-down.
34
+
35
+ ## Steps
36
+
37
+ - [x] Step 1: Tidy the root `test/examples/flappy_bird` surface and verify the
38
+ README inventory-driven workflow.
39
+ - [x] Step 2: Tidy the worker and trainer-facing folders.
40
+ - [ ] Step 3: Tidy shared simulation, environment, constants, and evaluation
41
+ folders.
42
+ - [ ] Step 4: Tidy browser-entry and its nested README-owning folders one by one.
43
+ - [ ] Step 5: Regenerate docs, run focused validation, and record any durable
44
+ boundary notes that changed during the pass.
45
+
46
+ ## Done Criteria
47
+
48
+ - Every README-owning folder in the inventory has been handled explicitly.
49
+ - Generated README content is educational and boundary-aware.
50
+ - The todo list reflects completion folder by folder.
51
+ - Docs regeneration succeeds after documentation-affecting changes.
52
+ - A later session can resume from this plan and the todo list without prior chat
53
+ history.
@@ -0,0 +1,58 @@
1
+ # Flappy Evolution Worker Documentation Pass
2
+
3
+ ## Purpose
4
+
5
+ Deepen the source JSDoc for the `test/examples/flappy_bird/flappy-evolution-worker`
6
+ boundary so the generated folder README explains not only what each exported
7
+ surface is called, but why the worker exists, how the protocol fits browser
8
+ rendering, which pieces own simulation versus transport versus warm-start
9
+ behavior, and what invariants matter when extending the example.
10
+
11
+ ## Root
12
+
13
+ - Split root: `test/examples/flappy_bird/flappy-evolution-worker`
14
+ - Nearest README reviewed: `test/examples/flappy_bird/flappy-evolution-worker/README.md`
15
+ - Parent README reviewed: `test/examples/flappy_bird/README.md`
16
+ - Relevant plan: `plans/Interactive_Examples_and_Learning_Path.md`
17
+
18
+ ## Durable Rules
19
+
20
+ - Keep exactly one active step at a time.
21
+ - Update this plan immediately after each completed step.
22
+ - Do not hand-edit generated README files; improve source JSDoc and run docs.
23
+ - Keep `flappy-evolution-worker.ts` orchestration-first and document helper
24
+ ownership clearly.
25
+ - Treat the demo worker as a learning surface: documentation should teach the
26
+ message flow, deterministic simulation model, and packed-snapshot transport.
27
+
28
+ ## Target Shape
29
+
30
+ - `test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.ts`
31
+ remains the orchestration-first worker entrypoint.
32
+ - Supporting files explain their responsibility in the generated README:
33
+ runtime setup, protocol routing, evolution, playback, simulation,
34
+ snapshots, warm-start, and transport contracts.
35
+ - Public and README-visible symbols include conceptual JSDoc, brief examples
36
+ where behavior is non-obvious, and notes about defaults, invariants, or
37
+ performance tradeoffs when that context improves learning value.
38
+
39
+ ## Steps
40
+
41
+ - [x] Step 1: Review the nearest README files, current worker surface, and the
42
+ relevant examples plan.
43
+ - [x] Step 2: Enrich foundational worker service docs (`constants`, `errors`,
44
+ `runtime`, `protocol`, `evolution`, `playback`).
45
+ - [x] Step 3: Enrich simulation and transport docs (`simulation.*`,
46
+ `snapshot.*`, `types`, `warm-start`, entrypoint helpers, and narrow tests).
47
+ - [x] Step 4: Run docs regeneration and focused validation, then record the
48
+ finished boundary note.
49
+
50
+ ## Done Criteria
51
+
52
+ - The generated worker README reads like a guided tour of the subsystem rather
53
+ than a sparse symbol index.
54
+ - Each worker file has enough source JSDoc to explain its role in the folder.
55
+ - Non-obvious contracts mention the important defaults, invariants, or
56
+ performance semantics.
57
+ - Docs regeneration completes after the source comments are updated.
58
+ - The next session can resume from this plan alone if another pass is needed.
@@ -6,12 +6,16 @@ Reduce time-to-first-success by shipping a small set of **runnable examples** th
6
6
 
7
7
  - building networks (preconfigured + primitives)
8
8
  - evolving with NEAT
9
- - exporting inference
10
9
  - running in browser
11
10
 
11
+ Phase note:
12
+
13
+ - Phase 3 covers the starter learning path only.
14
+ - Standalone export and worker examples are follow-on additions after the corresponding Phase 4 capabilities exist.
15
+
12
16
  ## Goals
13
17
 
14
- - G1: Provide a clear learning path: “hello world” → “evolution” → “export” “workers”.
18
+ - G1: Provide a clear learning path: “hello world” → “evolution” → “browser quickstart”, then extend it with “export” and “workers” once those features are shipped.
15
19
  - G2: Examples are runnable with minimal setup and are kept in sync with the public API.
16
20
  - G3: Examples serve as regression checks (lightweight smoke checks).
17
21
 
@@ -32,6 +36,9 @@ Reduce time-to-first-success by shipping a small set of **runnable examples** th
32
36
  - Run a tiny NEAT evolution loop.
33
37
  4. **Sequence (NARX)**
34
38
  - Demonstrate state handling + reset.
39
+
40
+ ### Later extensions (after Phase 4 capabilities land)
41
+
35
42
  5. **Standalone export**
36
43
  - Export inference module and run it.
37
44
  6. **Worker evaluation**
@@ -82,6 +89,7 @@ Acceptance:
82
89
  ### Step 4 — Document the learning path
83
90
 
84
91
  - Add a top-level doc that lists examples in recommended order.
92
+ - Clearly mark export/worker examples as later-phase extensions so starter examples stay aligned with the roadmap.
85
93
 
86
94
  Acceptance:
87
95
 
@@ -259,7 +259,7 @@ Test Coverage (single expectation style): capacity growth, versioning, flags par
259
259
 
260
260
  Deferred (post‑Phase 3): chunked copy yield refinements (browser large slabs), adjacency→phenotype direct mapping (moved to caching phase), forward variance reduction (targeted in later phases once churn reduced).
261
261
 
262
- ### Phase 3 Results (Final Validation Before HyperEvoDevo MorphoNEAT)
262
+ ### Phase 3 Results (Final Validation Before Later Track 1 Phases)
263
263
 
264
264
  Source: `test/benchmarks/benchmark.results.json` (latest history entry vs earliest recorded baseline in same file).
265
265
 
@@ -285,11 +285,11 @@ Notes:
285
285
  - Bytes/connection held constant (no regression) despite added optional slabs; gain omission and plasticity pay‑for‑use prevented per-connection inflation. This confirms the pay-for-use principle is working but highlights that progress on the bytes/connection reduction metric is dependent on Phase 5 (Sparsity).
286
286
  - Field audit counts: Connection enumerable keys = 9 (stable), Node = 15 (stable) per benchmark `fieldAudit` confirmation.
287
287
 
288
- Results Notes & Next Step: For quantitative deltas see table above; variance & invariant consolidation detailed in Phase 3 Conclusion below. Proceed to HyperEvoDevo MorphoNEAT work with stable slab foundation.
288
+ Results Notes & Next Step: For quantitative deltas see table above; variance & invariant consolidation detailed in Phase 3 Conclusion below. Proceed to Phase 4 centralized memory management and browser-validation work with a stable slab foundation. Track 2 Hyper work remains gated behind the Track 1 conditions defined earlier in this document.
289
289
 
290
290
  #### Phase 3 Conclusion (Extended Slab Packing & Validation)
291
291
 
292
- All planned Phase 3 memory layout features are implemented, documented, and validated by tests; the slab system now provides a payforuse foundation for forthcoming HyperEvoDevo MorphoNEAT caching & morphogenesis work.
292
+ All planned Phase 3 memory layout features are implemented, documented, and validated by tests; the slab system now provides a pay-for-use foundation for later Track 1 caching work and eventual HyperEvoDevo MorphoNEAT phases once the Track 1 gate is satisfied.
293
293
 
294
294
  Delivered Enhancements (Recap):
295
295
 
@@ -0,0 +1,63 @@
1
+ # Plans Index
2
+
3
+ This file is a lightweight index for the `plans/` folder.
4
+
5
+ Purpose:
6
+
7
+ - help agents and contributors choose the right plan document quickly,
8
+ - keep architectural work aligned with roadmap intent,
9
+ - avoid loading the entire `plans/` directory into context.
10
+
11
+ Recommended reading order:
12
+
13
+ 1. Read `plans/README.md` for the map.
14
+ 2. Read `plans/Roadmap.md` when the task depends on sequencing, current phase status, or cross-plan priority.
15
+ 3. Read only the single most relevant detailed plan.
16
+ 4. Read one additional related plan only when the task clearly spans two initiatives.
17
+ 5. Read `plans/neat.plans.md` for the core NEAT direction and current engineering baseline when the task touches architecture or evolutionary correctness.
18
+
19
+ Selection guide:
20
+
21
+ - `plans/neat.plans.md`: core NEAT correctness, innovation tracking, crossover alignment, speciation invariants.
22
+ - `plans/Roadmap.md`: dependency-aware execution order across all initiatives.
23
+ - `plans/Architecture_Primitives_Node_Group_Layer.md`: first-class architecture-building primitives such as nodes, groups, and layers.
24
+ - `plans/Browser_Build_and_CDN_Distribution.md`: browser packaging, CDN usage, and distribution ergonomics.
25
+ - `plans/Construct_From_Parts_Graph_Assembly.md`: deterministic graph assembly and validated network construction from parts.
26
+ - `plans/Evolution_Training_Interoperability_Contracts.md`: contracts between evolution workflows and gradient-based training.
27
+ - `plans/HyperEvoDevoMorphoNEAT.md`: evo-devo and morphology-oriented research direction.
28
+ - `plans/Interactive_Examples_and_Learning_Path.md`: runnable examples, onboarding flow, and learning-path improvements.
29
+ - `plans/Memory_Optimization.md`: scaling, memory layout, and strategies for very large networks.
30
+ - `plans/Network_Visualization_Export_Schema.md`: stable export schema for visualization and inspection tooling.
31
+ - `plans/ONNX_EXPORT_PLAN.md`: ONNX export/import architecture and rollout phases.
32
+ - `plans/Population_Save_Resume_and_Checkpointing.md`: checkpointing, persistence, save/resume workflows.
33
+ - `plans/Preconfigured_Architectures_MLP_LSTM_GRU_NARX.md`: prebuilt architecture constructors and sequence-oriented builders.
34
+ - `plans/Stable_Activation_Ordering_and_Explicit_IO_Roles.md`: deterministic execution ordering and explicit input/output roles.
35
+ - `plans/Standalone_Inference_Export.md`: dependency-free exported inference runtime.
36
+ - `plans/Turnkey_Multithread_Evaluation_API.md`: parallel evaluation API for Node and browser workers.
37
+ - `plans/Worker_Friendly_Network_Serialization_Fastpath.md`: fast serialization path for worker-based evaluation.
38
+
39
+ Task-to-plan trigger phrases:
40
+
41
+ - NEAT correctness, innovation IDs, crossover, compatibility distance, speciation: `plans/neat.plans.md`
42
+ - roadmap, sequence, dependency order, what comes first: `plans/Roadmap.md`
43
+ - architecture builder, layer API, node/group primitives: `plans/Architecture_Primitives_Node_Group_Layer.md`
44
+ - construct from parts, graph assembly, deterministic builder: `plans/Construct_From_Parts_Graph_Assembly.md`
45
+ - browser bundle, CDN, browser-first usage: `plans/Browser_Build_and_CDN_Distribution.md`
46
+ - ONNX, import/export interoperability: `plans/ONNX_EXPORT_PLAN.md`
47
+ - visualization, schema, inspect network shape: `plans/Network_Visualization_Export_Schema.md`
48
+ - checkpoint, resume, save population: `plans/Population_Save_Resume_and_Checkpointing.md`
49
+ - workers, threads, parallel evaluation: `plans/Turnkey_Multithread_Evaluation_API.md`
50
+ - worker serialization, transfer cost, fastpath: `plans/Worker_Friendly_Network_Serialization_Fastpath.md`
51
+ - standalone runtime, exported inference file: `plans/Standalone_Inference_Export.md`
52
+ - activation order, IO roles, deterministic execution: `plans/Stable_Activation_Ordering_and_Explicit_IO_Roles.md`
53
+ - memory pressure, large networks, compact storage: `plans/Memory_Optimization.md`
54
+ - hybrid evolution plus training, optimizer handoff: `plans/Evolution_Training_Interoperability_Contracts.md`
55
+ - preconfigured models, MLP, LSTM, GRU, NARX builders: `plans/Preconfigured_Architectures_MLP_LSTM_GRU_NARX.md`
56
+ - examples, tutorials, learning path, onboarding: `plans/Interactive_Examples_and_Learning_Path.md`
57
+ - evo-devo, morphology, research-heavy extensions: `plans/HyperEvoDevoMorphoNEAT.md`
58
+
59
+ Working rule:
60
+ When a task changes code in a way that could conflict with one of these plans, mention the relevant plan in the working notes or final summary and call out any mismatch instead of silently diverging from the roadmap.
61
+
62
+ Authority rule:
63
+ For cross-plan sequencing and active priority, `plans/Roadmap.md` is authoritative. Detailed plans may contain future-state inventory, local sub-phases, or stale status notes; if a detailed plan appears to pull later-phase work earlier, follow `plans/Roadmap.md` unless both files are updated together.
package/plans/Roadmap.md CHANGED
@@ -13,12 +13,17 @@ Where it helps, this roadmap uses **lanes** (things that can proceed in parallel
13
13
 
14
14
  ## Phase 0 — Hygiene + Refactor Baseline
15
15
 
16
- **Outcome:** keep iteration speed high and reduce refactor risk.
16
+ **Outcome:** keep iteration speed high, reduce refactor risk, and finish the structural cleanup needed before broad mechanical modernization.
17
17
 
18
- - ES2023 modernization (ongoing, mechanical refactors + CI enforcement)
18
+ - Demo refinement and learnability hardening [DONE]
19
+ - asciiMaze SOLID split before ES2023 modernization [DONE]
20
+ - Phase 0 remaining focus: ES2023 modernization (after the completed demo-structure pass)
21
+ - The `flappy_bird` reference split plan and the `asciiMaze` SOLID split plan are now both complete, so the remaining Phase 0 work is the repository-wide modernization pass and its validation gate.
22
+ - ES2023 modernization (after the demo-structure pass; mechanical refactors + CI enforcement)
19
23
  - Plan: [ES2023 migration](ES2023%20migration)
24
+ - Scope note: this phase is syntax/module modernization plus CI enforcement. Memory-management or performance-feature work remains owned by [Memory_Optimization.md](Memory_Optimization.md).
20
25
 
21
- **Gate to Phase 1:** `npx tsc --noEmit -p tsconfig.json` and `npm test` are green after the refactor split.
26
+ **Gate to Phase 1:** `flappy_bird` refinement is stable, the `asciiMaze` SOLID split is complete, and `npx tsc --noEmit -p tsconfig.json` plus `npm test` are green after the refactor pass.
22
27
 
23
28
  ## Phase 1 — Core Correctness + Determinism Foundations (Critical Path)
24
29
 
@@ -62,6 +67,9 @@ Where it helps, this roadmap uses **lanes** (things that can proceed in parallel
62
67
 
63
68
  **Notes:**
64
69
 
70
+ - Phase 3 examples are the starter set only: Node hello/evolve flows plus one minimal browser quickstart once the browser bundle exists.
71
+ - Examples that depend on standalone export or worker execution are follow-on additions in Phase 4 after those capabilities land.
72
+ - Before expanding the examples catalog, choose the canonical examples home and decide whether `bench-browser/` is the browser-example host so demo work does not fragment.
65
73
  - Visualization can be implemented slightly earlier, but it becomes much more valuable once primitives/builders provide stable labels/roles.
66
74
 
67
75
  ## Phase 4 — Deployment + Parallel Evaluation (Inference Artifacts, Workers, Checkpoints)
@@ -84,6 +92,7 @@ Where it helps, this roadmap uses **lanes** (things that can proceed in parallel
84
92
  - Standalone export and worker payloads share an “inference IR” concept; building that once reduces duplication.
85
93
  - Multithread evaluation becomes straightforward after payloads exist.
86
94
  - Checkpointing and hybrid evaluation benefit from deterministic scheduling and a clear parameter/vector mapping.
95
+ - Evolution-training parameter vectors are a later unification seam, not a blocker for standalone export or worker payloads unless that contract is deliberately split into an earlier mini-phase.
87
96
 
88
97
  ## Phase 5 — Scale & Performance (Memory Optimization Track)
89
98
 
@@ -98,6 +107,7 @@ This plan is large and can run as a **parallel lane** after Phase 1, but it shou
98
107
 
99
108
  - Start / continue Track 1 after Phase 1 is stable.
100
109
  - Prioritize improvements that directly benefit the worker payload + inference export paths (typed arrays, slabs, reuse) so Phase 4 gets faster “for free”.
110
+ - If a detailed memory-plan subsection implies Hyper work can begin immediately after an intermediate Track 1 checkpoint, treat that as stale wording; Hyper remains gated by the Track 1 conditions below.
101
111
 
102
112
  **Gate to Phase 7 (Hyper):** Track 1 gates in `Memory_Optimization.md` are met (especially Phase 4–7 stability + variance/hardening).
103
113
 
@@ -124,6 +134,8 @@ This plan is large and can run as a **parallel lane** after Phase 1, but it shou
124
134
 
125
135
  ## Summary: Critical Path vs Parallel Lanes
126
136
 
137
+ Current status: the project is still in **Phase 0**, with the demo-structure baseline complete (`flappy_bird` refinement and `asciiMaze` SOLID split) and repository-wide ES2023 modernization now the remaining Phase 0 focus.
138
+
127
139
  - **Critical path:** Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4
128
140
  - **Parallel lane A (performance):** [Memory_Optimization.md](Memory_Optimization.md) Track 1 after Phase 1 stabilizes
129
141
  - **Parallel lane B (interop):** [ONNX_EXPORT_PLAN.md](ONNX_EXPORT_PLAN.md) after Phase 2 (or earlier if scoped tightly)
@@ -0,0 +1,130 @@
1
+ # asciiMaze SOLID Split
2
+
3
+ Purpose
4
+
5
+ - Keep `test/examples/asciiMaze` aligned with the stronger modular example direction established by `test/examples/flappy_bird`.
6
+ - Track only the durable, high-level structural work still needed to reach a strict SOLID, DRY, maintainable end state.
7
+ - Keep this document resumable across sessions.
8
+ - Keep this document short; detailed split design belongs in the implementation step.
9
+
10
+ Progress rules
11
+
12
+ - Use `[]` for a step that is not yet completed.
13
+ - Use `[DONE]` immediately after finishing a step.
14
+ - Update this document whenever the step order changes, a step is added, a step is removed, or the overall plan shifts.
15
+ - Keep completed steps in place so progress is visible when resuming later.
16
+ - Do not expand this file with temporary implementation detail; only record durable high-level progress.
17
+
18
+ Current read
19
+
20
+ - `asciiMaze` is already meaningfully decomposed compared with an older flat layout.
21
+ - The remaining work is concentrated in a small number of large coordination and policy-heavy modules.
22
+ - Confirmed current runtime orchestration order: `browser-entry.ts` bootstraps host services and invokes `EvolutionEngine.runMazeEvolution()`, `evolutionEngine.ts` normalizes and prepares the run, `evolutionEngine/evolutionLoop.ts` owns generation orchestration, `mazeMovement.ts` executes per-agent simulation, and `dashboardManager.ts` emits telemetry back to browser listeners and host globals.
23
+ - The existing Step 2-8 order still matches that flow: split simulation policy first, then presentation, then browser host glue, then shared contracts, and only then collapse the remaining engine-side reporting and runtime adapter seams.
24
+ - Step 2 is now finalized around the dedicated `mazeMovement/` folder boundary: shared simulation types live in `mazeMovement.types.ts`, constants in `mazeMovement.constants.ts`, reusable helpers in `mazeMovement.utils.ts`, pooled mutable infrastructure in `mazeMovement.services.ts`, runtime primitives in `mazeMovement/runtime/mazeMovement.runtime.ts`, action policy in `mazeMovement/policy/mazeMovement.policy.ts`, reward shaping in `mazeMovement/shaping/mazeMovement.shaping.ts`, result assembly in `mazeMovement/finalization/mazeMovement.finalization.ts`, and the public class facade now lives in `mazeMovement/mazeMovement.ts` with the old top-level file reduced to a compatibility re-export.
25
+ - Step 3 is now finalized around the dedicated `dashboardManager/` folder boundary: shared dashboard types live in `dashboardManager.types.ts`, constants in `dashboardManager.constants.ts`, reusable formatting and calculation helpers live in `dashboardManager.utils.ts`, rendering/archive/telemetry orchestration now lives in `dashboardManager.services.ts`, and the public class facade now lives in `dashboardManager/dashboardManager.ts` with the old top-level file reduced to a compatibility re-export.
26
+ - Step 4 is now finalized around the dedicated `browser-entry/` folder boundary: shared browser host contracts live in `browser-entry.types.ts`, host and curriculum constants live in `browser-entry.constants.ts`, DOM resolution and curriculum helpers live in `browser-entry.utils.ts`, host bootstrap/resize wiring/abort composition/globals compatibility/runtime orchestration now live in `browser-entry.services.ts`, and the public browser facade now lives in `browser-entry/browser-entry.ts` with the old top-level file reduced to a compatibility re-export.
27
+ - Step 5 is now finalized around focused contract owners instead of the old `interfaces.ts` dependency bucket: evolution run/configuration and engine-internal helper contracts now live in `evolutionEngine/evolutionEngine.types.ts`, fitness evaluation contracts now live in `fitness.types.ts`, existing browser-entry/dashboardManager/mazeMovement module-owned `*.types.ts` files remain the primary owners for their split boundaries, and the top-level `interfaces.ts` file is now reduced to a narrow shared/core compatibility layer that re-exports moved contracts while retaining only the genuinely cross-cutting network, dashboard-abstraction, maze-run-result, and terminal-result shapes.
28
+ - Step 6 is now finalized around a narrow engine-owned host adapter boundary: `evolutionEngine/evolutionEngine.types.ts` owns the `EvolutionHostAdapter` and stop-event contracts, `evolutionEngine/setupHelpers.ts` now reads cooperative pause state through that adapter instead of polling browser globals directly, `evolutionEngine/evolutionLoop.ts` now reports solve and stop outcomes through the adapter instead of dispatching browser behavior itself, and `browser-entry/browser-entry.globals.services.ts` owns the browser implementation that maps those engine events back to browser globals and solved-event compatibility behavior.
29
+ - Step 7 is now finalized around owner-defined runtime and presentation contracts instead of browser-entry-local runtime shims: `dashboardManager/dashboardManager.types.ts` now owns the shared browser/non-browser presentation seam through `DashboardPresentationAdapter`, `DashboardTelemetryPayload`, and `AsciiMazeTelemetrySnapshot`; `browser-entry/browser-entry.types.ts` now consumes those dashboard-owned contracts for the public run handle and host services instead of defining its own `RuntimeDashboard`/`RuntimeEvolutionResult` adapters; and `evolutionEngine/evolutionEngine.types.ts` now owns the shared run-result and loose runtime helper contracts (`MazeEvolutionRunResult`, tracked network/genome helpers, species-history host) consumed by the engine facade, telemetry helpers, and population-dynamics helpers. The remaining compatibility-only runtime shapes are the browser platform shims in `browser-entry/browser-entry.types.ts` (`RuntimeWindow` and abort-signal helpers), not duplicated presentation or engine result seams.
30
+ - Step 8 is now finalized around an engine-owned curriculum/refinement boundary: `evolutionEngine/curriculumPhase.ts` now owns phase-outcome interpretation, curriculum solve-threshold evaluation, and refined winner carry-over resolution; `browser-entry/browser-entry.curriculum.services.ts` now focuses on browser-only dimension scheduling, animation-frame pacing, and lifecycle completion; and `asciiMaze.e2e.test.ts` now reuses the same engine-owned helper instead of re-implementing winner-refinement carry-over locally. The remaining compatibility surface is the underlying `networkRefinement.ts` implementation, which stays reusable behind the engine-owned curriculum helper rather than being called directly by browser-entry.
31
+ - Step 9 is now finalized around final-shape validation rather than further splitting: the folder-owned boundaries remain `mazeMovement/`, `dashboardManager/`, `browser-entry/`, and `evolutionEngine/`; the top-level compatibility files remain intentionally narrow for stable imports; the engine facade now explicitly documents `resolveMazeEvolutionPhaseOutcome` as a compatibility export owned by `evolutionEngine/curriculumPhase.ts`; and the required final validations succeeded with `npx tsc --noEmit -p tsconfig.json` and `npm run docs`.
32
+
33
+ Split standard
34
+
35
+ - Large or multi-responsibility example files should not be split into a growing pile of sibling files at the same level.
36
+ - When a main file becomes a real module boundary, split it into a dedicated folder that keeps orchestration, contracts, helpers, constants, errors, and services together.
37
+ - The exported main surface should remain easy to find and should keep the module's public orchestration flow.
38
+
39
+ Required naming pattern
40
+
41
+ - For a main module named `module`, prefer:
42
+ - `module/module.ts`
43
+ - `module/module.utils.ts`
44
+ - `module/module.types.ts`
45
+ - `module/module.errors.ts`
46
+ - `module/module.services.ts`
47
+ - `module/module.constants.ts`
48
+
49
+ - For a nested sub-module named `sub-module` inside `module`, prefer:
50
+ - `module/sub-module/module.sub-module.ts`
51
+ - `module/sub-module/module.sub-module.utils.ts`
52
+ - `module/sub-module/module.sub-module.types.ts`
53
+ - `module/sub-module/module.sub-module.errors.ts`
54
+ - `module/sub-module/module.sub-module.services.ts`
55
+ - `module/sub-module/module.sub-module.constants.ts`
56
+
57
+ Naming intent
58
+
59
+ - `*.ts`: main orchestration or primary public surface for that module boundary.
60
+ - `*.utils.ts`: pure or mostly pure helpers that do not define the module's main orchestration.
61
+ - `*.types.ts`: focused types, DTOs, interfaces, and narrow contracts.
62
+ - `*.errors.ts`: named error classes and error helpers local to the module.
63
+ - `*.services.ts`: side-effecting or stateful service helpers used by the orchestration layer.
64
+ - `*.constants.ts`: named constants and lookup tables local to the module.
65
+
66
+ Boundary rules
67
+
68
+ - Do not create dedicated folders for trivial files that are already small and single-purpose.
69
+ - Do create a dedicated folder once a file becomes a real subsystem with multiple helper categories.
70
+ - Keep the top-level `module/module.ts` file orchestration-first rather than turning it into another utility bucket.
71
+ - Prefer subfolders when a subsystem inside a module grows into its own concern, instead of continuing to append helper files to the parent module folder.
72
+ - Keep runtime-host glue, domain policy, rendering, telemetry, and shared contracts in separate files once they stop being tiny.
73
+
74
+ asciiMaze target shape
75
+
76
+ - `evolutionEngine.ts` should continue toward a dedicated `evolutionEngine/` orchestration-first module, which is already the correct direction.
77
+ - `mazeMovement.ts` should move toward a dedicated `mazeMovement/` folder rather than being split into multiple top-level siblings.
78
+ - `dashboardManager.ts` should move toward a dedicated `dashboardManager/` folder with rendering, archive, telemetry, and formatting boundaries.
79
+ - `browser-entry.ts` should move toward a dedicated `browser-entry/` folder that separates host bootstrap, runtime orchestration, globals compatibility, and resize behavior.
80
+ - `interfaces.ts` should be replaced by narrower module-local `*.types.ts` files plus a smaller shared contract surface where truly needed.
81
+
82
+ High-level gaps
83
+
84
+ - `mazeMovement.ts` is still a god module.
85
+ - It mixes simulation state, pooled buffers, action policy, exploration heuristics, reward shaping, saturation handling, and result finalization.
86
+ - Shared static mutable state in `mazeMovement.ts` weakens substitutability, test isolation, and future worker-safe reuse.
87
+ - When split, this should become a dedicated `mazeMovement/` folder instead of several new top-level files.
88
+
89
+ - `browser-entry.ts` still combines host bootstrapping with runtime policy.
90
+ - It currently handles DOM lookup, logger wiring, dashboard setup, resize behavior, abort composition, curriculum progression, best-network carry-over, compatibility globals, and auto-start behavior.
91
+ - This should be split into smaller host/runtime/bootstrap services so the browser entry becomes thin orchestration only.
92
+ - When split, prefer a dedicated `browser-entry/` folder with runtime, host, globals, and resize sub-areas.
93
+
94
+ - Runtime shape adapters are now mostly centralized in owning module boundaries.
95
+ - Engine-side loose runtime helper contracts now live in `evolutionEngine/evolutionEngine.types.ts`, and browser/non-browser presentation contracts now live in `dashboardManager/dashboardManager.types.ts`.
96
+ - Remaining runtime-specific shapes are limited to browser platform compatibility helpers rather than duplicated presentation or evolution-result adapters.
97
+
98
+ - Browser and non-browser presentation concerns are now more parallel.
99
+ - Host-specific browser wiring now depends on the shared dashboard-owned presentation model instead of re-declaring telemetry and redraw seams locally.
100
+ - Remaining follow-up work is concentrated in refinement, curriculum, and evolution orchestration boundaries rather than presentation-contract drift.
101
+
102
+ - Refinement, curriculum progression, and evolution orchestration now have clearer owners.
103
+ - The engine-owned curriculum helper interprets completed run results and refines carry-over winners, while browser-entry stays focused on host scheduling and maze-dimension progression.
104
+ - Future changes to winner refinement or curriculum carry-over policy should now land in the engine boundary instead of cross-cutting browser-entry and curriculum-style callers.
105
+
106
+ Execution steps
107
+
108
+ - [DONE] Step 1: Audit the remaining `asciiMaze` coordination-heavy surfaces and confirm the execution order across `mazeMovement`, `dashboardManager`, `browser-entry`, shared contracts, and engine-side reporting seams.
109
+ - [DONE] Step 2: Split `mazeMovement.ts` into a dedicated `mazeMovement/` module boundary so simulation state, pooled buffers, action policy, exploration heuristics, reward shaping, saturation handling, and result finalization stop accumulating in one file.
110
+ - [DONE] Step 3: Split `dashboardManager.ts` into a dedicated `dashboardManager/` module boundary so live rendering, solved-archive rendering, telemetry aggregation, bounded history storage, event emission, and formatting evolve behind focused files.
111
+ - [DONE] Step 4: Thin `browser-entry.ts` into a dedicated `browser-entry/` module boundary so host bootstrap, runtime orchestration, globals compatibility, and resize behavior evolve independently.
112
+ - [DONE] Step 5: Decompose `interfaces.ts` into focused module-owned `*.types.ts` files and leave behind only the smallest shared contract surface that is still truly cross-cutting.
113
+ - [DONE] Step 6: Remove browser-facing solve, stop, and pause side effects from engine internals so `evolutionEngine` reports through a narrower adapter or reporting boundary instead of touching host behavior directly.
114
+ - [DONE] Step 7: Consolidate scattered runtime shape adapters and presentation seams so browser and non-browser paths depend on clearer shared contracts rather than ad hoc local `Runtime*` compensating interfaces.
115
+ - [DONE] Step 8: Recheck refinement, curriculum, and evolution boundaries so follow-up changes do not reintroduce cross-cutting orchestration drift after the earlier splits.
116
+ - [DONE] Step 9: Validate the final shape by checking naming consistency, folder ownership, generated-doc expectations, and TypeScript/build health.
117
+
118
+ Execution expectation
119
+
120
+ - Each major split should create a dedicated folder first, then move one helper category at a time.
121
+ - Preserve the public entry surface in the main module file inside that folder.
122
+ - Avoid introducing one-off naming styles for each refactor; use the module and sub-module naming pattern above.
123
+
124
+ Done criteria
125
+
126
+ - No single demo file remains the obvious coordination sink for multiple unrelated responsibilities.
127
+ - Host glue, simulation policy, telemetry aggregation, and rendering each have clear module boundaries.
128
+ - Shared contracts are focused enough that runtime-specific adapters stop proliferating.
129
+ - The example remains educational, but the top-level flow becomes orchestration rather than implementation-heavy.
130
+ - Dedicated folders, file names, and subfolder names follow one predictable pattern instead of ad hoc split layouts.
@@ -0,0 +1,67 @@
1
+ # flappy_bird SOLID Split
2
+
3
+ Purpose
4
+
5
+ - Keep `test/examples/flappy_bird` as the reference demo for SOLID, modular example work.
6
+ - Keep this document resumable across sessions.
7
+ - Keep this document high level only.
8
+ - Keep implementation details, temporary file maps, and short-lived decisions in the chat session rather than in this file.
9
+
10
+ Progress rules
11
+
12
+ - Use `[]` for a step that is not yet completed.
13
+ - Use `[DONE]` immediately after finishing a step.
14
+ - Update this document whenever the step order changes, a step is added, a step is removed, or the overall plan shifts.
15
+ - Keep completed steps in place so progress is visible when resuming later.
16
+ - Do not expand this file with temporary implementation detail; only record durable high-level progress.
17
+
18
+ Split standard
19
+
20
+ - Large or multi-responsibility demo files should not grow into a wider pile of sibling files at the same folder level.
21
+ - When an area becomes a real subsystem, move it into a dedicated folder that keeps orchestration, contracts, helpers, constants, errors, and services together.
22
+ - Keep the main exported module file as the easiest entry point and keep it orchestration-first.
23
+ - Prefer dedicated subfolders once a subsystem has clear internal categories.
24
+ - Preserve domain-scoped constants instead of recentralizing them.
25
+
26
+ Naming pattern
27
+
28
+ - Main module pattern:
29
+ - `module/module.ts`
30
+ - `module/module.utils.ts`
31
+ - `module/module.types.ts`
32
+ - `module/module.errors.ts`
33
+ - `module/module.services.ts`
34
+ - `module/module.constants.ts`
35
+
36
+ - Nested sub-module pattern:
37
+ - `module/sub-module/module.sub-module.ts`
38
+ - `module/sub-module/module.sub-module.utils.ts`
39
+ - `module/sub-module/module.sub-module.types.ts`
40
+ - `module/sub-module/module.sub-module.errors.ts`
41
+ - `module/sub-module/module.sub-module.services.ts`
42
+ - `module/sub-module/module.sub-module.constants.ts`
43
+
44
+ Execution steps
45
+
46
+ - [DONE] Step 1: Audit `browser-entry` utility surfaces and confirm which broad files still need dedicated subfolder splits.
47
+ - [DONE] Step 2: Continue the `browser-entry/playback/` split so playback orchestration, rendering support, and snapshot interpretation stay in focused module-owned files.
48
+ - [DONE] Step 3: Continue the `browser-entry/visualization/` split so visualization orchestration, layout, rendering, and interpretation responsibilities stay separate.
49
+ - [DONE] Step 4: Continue the `browser-entry/network-view/` split so layout, color semantics, labeling, and draw-time interpretation do not collapse into one broad utility surface.
50
+ - [DONE] Step 5: Continue the `browser-entry/host/` split so DOM assembly stays compositional and host setup does not keep accumulating in one utility file.
51
+ - [DONE] Step 6: Keep `trainer/trainer.ts` orchestration-first by moving reporting, policy, planning, and stop-control details behind trainer-owned helpers and services.
52
+ - [DONE] Step 7: Keep the worker entry surface thin by preserving `flappy-evolution-worker` as a protocol-first boundary with playback, simulation, evolution, and runtime details behind worker-owned modules.
53
+ - [DONE] Step 8: Continue splitting `simulation-shared` observation assembly so shared observation logic does not reform into a broad policy hub.
54
+ - [DONE] Step 9: Recheck the browser visualization and network-view path for responsibility drift after the earlier splits, and realign any overlap back into explicit module boundaries.
55
+ - [DONE] Step 10: Validate the final shape by checking naming consistency, folder ownership, generated-doc expectations, and TypeScript/build health.
56
+ - [DONE] Step 11: Extract playback background composition into a dedicated background submodule so sky, horizon, and future ground parallax can evolve independently.
57
+ - [DONE] Step 12: Extract host resize orchestration, layout math, and DOM mutation helpers into a dedicated `host/resize/` submodule so responsive layout policies evolve without bloating the host root.
58
+ - [DONE] Step 13: Extract playback starfield contracts and tile-render mechanics into dedicated starfield-owned files so cache orchestration stays thin and reusable.
59
+ - [DONE] Step 14: Extract evaluation rollout orchestration into a dedicated `evaluation/rollout/` submodule so runtime state, policy, shaping helpers, and rollout-local contracts evolve behind one stable public entry.
60
+
61
+ Done criteria
62
+
63
+ - Browser runtime files read as orchestration over focused services rather than large utility buckets.
64
+ - Trainer and worker entrypoints stay thin, with domain logic living behind explicit service boundaries.
65
+ - Visualization, observation, playback, and host setup each evolve independently without overlapping responsibility.
66
+ - Dedicated folders, file names, and subfolder names continue following one predictable pattern instead of drifting into ad hoc layouts.
67
+ - The demo remains the stronger reference shape that other examples can copy and resume cleanly.