@reicek/neataptic-ts 0.1.21 → 0.1.22
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.
- package/.github/agents/boundary-mapper.agent.md +29 -0
- package/.github/agents/docs-scout.agent.md +29 -0
- package/.github/agents/plan-scout.agent.md +29 -0
- package/.github/agents/solid-split.agent.md +138 -0
- package/.github/copilot-instructions.md +103 -0
- package/package.json +6 -3
- package/plans/ES2023 migration +13 -8
- package/plans/Evolution_Training_Interoperability_Contracts.md +1 -1
- package/plans/Interactive_Examples_and_Learning_Path.md +10 -2
- package/plans/Memory_Optimization.md +3 -3
- package/plans/README.md +63 -0
- package/plans/Roadmap.md +15 -3
- package/plans/asciiMaze_SOLID_split.done.md +130 -0
- package/plans/flappy_bird_SOLID_split.done.md +67 -0
- package/scripts/assets/theme.css +221 -34
- package/scripts/copy-examples.mjs +9 -5
- package/scripts/export-onnx.mjs +3 -3
- package/scripts/generate-bench-tables.mjs +10 -10
- package/scripts/generate-bench-tables.ts +10 -10
- package/scripts/generate-docs.ts +1415 -449
- package/scripts/render-docs-html.ts +15 -8
- package/src/README.md +101 -223
- package/src/architecture/README.md +57 -185
- package/src/architecture/layer/README.md +38 -38
- package/src/architecture/network/README.md +33 -31
- package/src/architecture/network/activate/README.md +77 -77
- package/src/architecture/network/connect/README.md +15 -13
- package/src/architecture/network/deterministic/README.md +7 -7
- package/src/architecture/network/evolve/README.md +44 -44
- package/src/architecture/network/gating/README.md +20 -20
- package/src/architecture/network/genetic/README.md +51 -51
- package/src/architecture/network/mutate/README.md +97 -97
- package/src/architecture/network/onnx/README.md +264 -264
- package/src/architecture/network/prune/README.md +39 -39
- package/src/architecture/network/remove/README.md +26 -26
- package/src/architecture/network/serialize/README.md +56 -56
- package/src/architecture/network/slab/README.md +61 -61
- package/src/architecture/network/standalone/README.md +24 -24
- package/src/architecture/network/stats/README.md +9 -9
- package/src/architecture/network/topology/README.md +46 -46
- package/src/architecture/network/training/README.md +21 -21
- package/src/methods/README.md +9 -87
- package/src/multithreading/README.md +8 -77
- package/src/multithreading/workers/README.md +2 -2
- package/src/multithreading/workers/browser/README.md +0 -6
- package/src/multithreading/workers/node/README.md +0 -3
- package/src/neat/README.md +562 -568
- package/src/utils/README.md +18 -18
- package/test/examples/asciiMaze/README.md +59 -59
- package/test/examples/asciiMaze/asciiMaze.e2e.test.ts +14 -9
- package/test/examples/asciiMaze/browser-entry/README.md +196 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.abort.services.ts +95 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.constants.ts +23 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.curriculum.services.ts +115 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.globals.services.ts +106 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.host.services.ts +157 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.services.ts +14 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.ts +129 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.types.ts +120 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.utils.ts +98 -0
- package/test/examples/asciiMaze/browser-entry.ts +10 -576
- package/test/examples/asciiMaze/dashboardManager/README.md +276 -0
- package/test/examples/asciiMaze/dashboardManager/archive/README.md +16 -0
- package/test/examples/asciiMaze/dashboardManager/archive/dashboardManager.archive.services.ts +267 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.constants.ts +35 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.services.ts +103 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.ts +181 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.types.ts +267 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.utils.ts +254 -0
- package/test/examples/asciiMaze/dashboardManager/live/README.md +14 -0
- package/test/examples/asciiMaze/dashboardManager/live/dashboardManager.live.services.ts +264 -0
- package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +47 -0
- package/test/examples/asciiMaze/dashboardManager/telemetry/dashboardManager.telemetry.services.ts +513 -0
- package/test/examples/asciiMaze/dashboardManager.ts +13 -2335
- package/test/examples/asciiMaze/evolutionEngine/README.md +1058 -0
- package/test/examples/asciiMaze/evolutionEngine/curriculumPhase.ts +90 -0
- package/test/examples/asciiMaze/evolutionEngine/engineState.constants.ts +36 -0
- package/test/examples/asciiMaze/evolutionEngine/engineState.ts +58 -513
- package/test/examples/asciiMaze/evolutionEngine/engineState.types.ts +212 -0
- package/test/examples/asciiMaze/evolutionEngine/engineState.utils.ts +301 -0
- package/test/examples/asciiMaze/evolutionEngine/evolutionEngine.types.ts +445 -0
- package/test/examples/asciiMaze/evolutionEngine/evolutionLoop.ts +81 -50
- package/test/examples/asciiMaze/evolutionEngine/optionsAndSetup.ts +2 -4
- package/test/examples/asciiMaze/evolutionEngine/populationDynamics.ts +17 -33
- package/test/examples/asciiMaze/evolutionEngine/populationPruning.ts +1 -1
- package/test/examples/asciiMaze/evolutionEngine/rngAndTiming.ts +1 -2
- package/test/examples/asciiMaze/evolutionEngine/sampling.ts +1 -1
- package/test/examples/asciiMaze/evolutionEngine/scratchPools.ts +2 -5
- package/test/examples/asciiMaze/evolutionEngine/setupHelpers.ts +30 -37
- package/test/examples/asciiMaze/evolutionEngine/telemetryMetrics.ts +16 -58
- package/test/examples/asciiMaze/evolutionEngine/trainingWarmStart.ts +2 -2
- package/test/examples/asciiMaze/evolutionEngine.ts +55 -55
- package/test/examples/asciiMaze/fitness.ts +2 -2
- package/test/examples/asciiMaze/fitness.types.ts +65 -0
- package/test/examples/asciiMaze/interfaces.ts +64 -1352
- package/test/examples/asciiMaze/mazeMovement/README.md +356 -0
- package/test/examples/asciiMaze/mazeMovement/finalization/README.md +49 -0
- package/test/examples/asciiMaze/mazeMovement/finalization/mazeMovement.finalization.ts +138 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.constants.ts +101 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.services.ts +230 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.ts +299 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.types.ts +185 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.utils.ts +153 -0
- package/test/examples/asciiMaze/mazeMovement/policy/README.md +91 -0
- package/test/examples/asciiMaze/mazeMovement/policy/mazeMovement.policy.ts +467 -0
- package/test/examples/asciiMaze/mazeMovement/runtime/README.md +95 -0
- package/test/examples/asciiMaze/mazeMovement/runtime/mazeMovement.runtime.ts +354 -0
- package/test/examples/asciiMaze/mazeMovement/shaping/README.md +124 -0
- package/test/examples/asciiMaze/mazeMovement/shaping/mazeMovement.shaping.ts +459 -0
- package/test/examples/asciiMaze/mazeMovement.ts +12 -2978
- package/test/examples/flappy_bird/Trace-20260309T191949.json +24124 -0
- package/test/examples/flappy_bird/browser-entry/README.md +1129 -0
- package/test/examples/flappy_bird/browser-entry/browser-entry.host.utils.ts +4 -324
- package/test/examples/flappy_bird/browser-entry/browser-entry.network-view.utils.ts +6 -399
- package/test/examples/flappy_bird/browser-entry/browser-entry.playback.utils.ts +1 -717
- package/test/examples/flappy_bird/browser-entry/browser-entry.spawn.utils.ts +11 -31
- package/test/examples/flappy_bird/browser-entry/browser-entry.visualization.utils.ts +15 -893
- package/test/examples/flappy_bird/browser-entry/host/README.md +307 -0
- package/test/examples/flappy_bird/browser-entry/host/host.resize.service.ts +1 -295
- package/test/examples/flappy_bird/browser-entry/host/host.ts +562 -6
- package/test/examples/flappy_bird/browser-entry/host/resize/README.md +274 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.constants.ts +31 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.services.ts +360 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.ts +117 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.types.ts +63 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.utils.ts +250 -0
- package/test/examples/flappy_bird/browser-entry/network-view/README.md +399 -0
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.topology.utils.ts +255 -0
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.ts +802 -7
- package/test/examples/flappy_bird/browser-entry/playback/README.md +684 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/README.md +277 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +770 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.cache.services.ts +178 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.constants.ts +107 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.utils.ts +518 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.math.utils.ts +117 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.utils.ts +233 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.services.ts +211 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.ts +48 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.types.ts +212 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.utils.ts +81 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.cache.services.ts +96 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.constants.ts +62 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.services.ts +244 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.ts +53 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.types.ts +68 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.utils.ts +100 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +310 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.service.ts +92 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.services.ts +272 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.types.ts +39 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.utils.ts +493 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.constants.ts +1 -1
- package/test/examples/flappy_bird/browser-entry/playback/playback.frame-render.service.ts +4 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.snapshot.utils.ts +44 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.service.ts +39 -122
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.services.ts +272 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.types.ts +62 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.utils.ts +11 -4
- package/test/examples/flappy_bird/browser-entry/playback/playback.ts +409 -8
- package/test/examples/flappy_bird/browser-entry/playback/playback.types.ts +4 -12
- package/test/examples/flappy_bird/browser-entry/runtime/README.md +235 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.evolution-launch.service.ts +45 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.lifecycle.service.ts +81 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.startup.service.ts +74 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.ts +31 -121
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.types.ts +36 -0
- package/test/examples/flappy_bird/browser-entry/visualization/README.md +557 -0
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.constants.ts +110 -0
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.draw.service.ts +957 -19
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.legend.utils.ts +138 -3
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.topology.utils.ts +3 -27
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.ts +1 -23
- package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +156 -0
- package/test/examples/flappy_bird/constants/README.md +1179 -0
- package/test/examples/flappy_bird/constants/constants.network-view.ts +24 -0
- package/test/examples/flappy_bird/constants/constants.palette.ts +7 -0
- package/test/examples/flappy_bird/constants/constants.starfield.ts +78 -3
- package/test/examples/flappy_bird/environment/README.md +143 -0
- package/test/examples/flappy_bird/environment/environment.observation.utils.ts +1 -19
- package/test/examples/flappy_bird/environment/environment.step.service.ts +3 -66
- package/test/examples/flappy_bird/evaluation/README.md +130 -0
- package/test/examples/flappy_bird/evaluation/evaluation.fitness.utils.ts +1 -1
- package/test/examples/flappy_bird/evaluation/evaluation.rollout.service.ts +5 -375
- package/test/examples/flappy_bird/evaluation/rollout/README.md +291 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.constants.ts +30 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.service.ts +58 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.services.ts +310 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.types.ts +56 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.utils.ts +368 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/README.md +618 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.playback.service.ts +7 -7
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.frame.service.ts +364 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.types.ts +14 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.utils.ts +4 -201
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.ts +184 -345
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.warm-start.service.ts +291 -0
- package/test/examples/flappy_bird/flappy.simulation.shared.utils.ts +5 -0
- package/test/examples/flappy_bird/simulation-shared/README.md +417 -0
- package/test/examples/flappy_bird/simulation-shared/observation/README.md +183 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.features.utils.ts +301 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.ts +9 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.vector.utils.ts +59 -0
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.observation.utils.ts +5 -403
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.spawn.utils.ts +20 -6
- package/test/examples/flappy_bird/{evaluation/evaluation.statistics.utils.ts → simulation-shared/simulation-shared.statistics.utils.ts} +23 -8
- package/test/examples/flappy_bird/trainer/README.md +563 -0
- package/test/examples/flappy_bird/trainer/evaluation/README.md +199 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.constants.ts +9 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.services.ts +73 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.ts +165 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.types.ts +25 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.utils.ts +161 -0
- package/test/examples/flappy_bird/trainer/trainer.evaluation.service.ts +13 -0
- package/test/examples/flappy_bird/trainer/trainer.report.service.services.ts +181 -0
- package/test/examples/flappy_bird/trainer/trainer.report.service.ts +126 -0
- package/test/examples/flappy_bird/trainer/trainer.selection.utils.ts +89 -0
- package/test/examples/flappy_bird/trainer/trainer.ts +11 -553
- package/test/examples/flappy_bird/browser-entry/browser-entry.utils.ts +0 -12
- package/test/examples/flappy_bird/environment/environment.ts +0 -7
- package/test/examples/flappy_bird/evaluation/evaluation.ts +0 -7
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.ts +0 -15
- package/test/examples/flappy_bird/trainer/trainer.statistics.utils.ts +0 -78
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Use when planning a refactor, splitting a large module, identifying orchestration files versus helpers, or mapping module boundaries before edits. Keywords: refactor, split file, boundaries, helpers, orchestration, module map."
|
|
3
|
+
name: "Boundary Mapper"
|
|
4
|
+
tools: [read, search, todo]
|
|
5
|
+
user-invocable: false
|
|
6
|
+
agents: []
|
|
7
|
+
---
|
|
8
|
+
You are a read-only refactor planning specialist for NeatapticTS.
|
|
9
|
+
|
|
10
|
+
Your job is to map folder responsibilities, identify orchestration files versus helper/detail files, and propose small safe edit boundaries before implementation begins.
|
|
11
|
+
|
|
12
|
+
## Constraints
|
|
13
|
+
- DO NOT edit files.
|
|
14
|
+
- DO NOT propose a large rewrite when a sequence of targeted edits is safer.
|
|
15
|
+
- DO NOT ignore folder README guidance or plan alignment when the task is architectural.
|
|
16
|
+
|
|
17
|
+
## Approach
|
|
18
|
+
1. Read the nearest folder `README.md` and parent README when needed.
|
|
19
|
+
2. For architectural work, read `plans/README.md` and the single most relevant detailed plan.
|
|
20
|
+
3. Identify the public API surface, orchestration file, helper clusters, tests, and likely affected neighbors.
|
|
21
|
+
4. Return a stepwise decomposition that favors small, documented, low-risk passes.
|
|
22
|
+
|
|
23
|
+
## Output Format
|
|
24
|
+
Return:
|
|
25
|
+
- `Primary orchestration file:` path.
|
|
26
|
+
- `Helper clusters:` short bullet list.
|
|
27
|
+
- `Likely affected tests/docs:` short bullet list.
|
|
28
|
+
- `Suggested edit sequence:` 3 to 6 numbered steps.
|
|
29
|
+
- `Risk notes:` 0 to 4 short bullets.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Use when checking generated folder README context, JSDoc drift, missing examples, stale docs, or deciding whether to update source comments versus run npm run docs. Keywords: README, JSDoc, docs, generated docs, drift, examples."
|
|
3
|
+
name: "Docs Scout"
|
|
4
|
+
tools: [read, search]
|
|
5
|
+
user-invocable: false
|
|
6
|
+
agents: []
|
|
7
|
+
---
|
|
8
|
+
You are a read-only documentation reconnaissance specialist for NeatapticTS.
|
|
9
|
+
|
|
10
|
+
Your job is to use generated folder `README.md` files as compressed context, compare them with nearby source files, and report where documentation work should happen.
|
|
11
|
+
|
|
12
|
+
## Constraints
|
|
13
|
+
- DO NOT edit generated `src/**/README.md` files.
|
|
14
|
+
- DO NOT suggest hand-editing generated READMEs.
|
|
15
|
+
- DO NOT rewrite code behavior; focus on documentation drift, missing explanation, and likely source JSDoc targets.
|
|
16
|
+
|
|
17
|
+
## Approach
|
|
18
|
+
1. Read the nearest folder `README.md` first, then the nearest useful parent README if the task spans sibling modules.
|
|
19
|
+
2. Read only the source files needed to verify the README summary against implementation.
|
|
20
|
+
3. Distinguish between three cases: README is sufficient, JSDoc should be improved, or docs likely just need regeneration with `npm run docs`.
|
|
21
|
+
4. Call out examples, invariants, or exported symbols that seem under-documented.
|
|
22
|
+
|
|
23
|
+
## Output Format
|
|
24
|
+
Return:
|
|
25
|
+
- `Folder README used:` path list.
|
|
26
|
+
- `Assessment:` one short paragraph.
|
|
27
|
+
- `JSDoc targets:` short bullet list of source files or exported symbols.
|
|
28
|
+
- `Docs refresh needed:` `yes` or `no`, with a one-line reason.
|
|
29
|
+
- `User-facing gaps:` 0 to 4 short bullets.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Use when selecting a relevant plan document, checking roadmap alignment, mapping trigger phrases to plans, or preparing an architectural alignment brief before coding. Keywords: plans, roadmap, architecture, NEAT correctness, ONNX, workers, checkpointing, visualization."
|
|
3
|
+
name: "Plan Scout"
|
|
4
|
+
tools: [read, search]
|
|
5
|
+
user-invocable: false
|
|
6
|
+
agents: []
|
|
7
|
+
---
|
|
8
|
+
You are a read-only plan alignment specialist for NeatapticTS.
|
|
9
|
+
|
|
10
|
+
Your job is to identify the smallest useful subset of `plans/` documents for a task and return a compact alignment brief.
|
|
11
|
+
|
|
12
|
+
## Constraints
|
|
13
|
+
- DO NOT edit files.
|
|
14
|
+
- DO NOT read the whole `plans/` directory unless the task explicitly requires broad roadmap synthesis.
|
|
15
|
+
- DO NOT recommend a plan file without explaining why it matches the task.
|
|
16
|
+
|
|
17
|
+
## Approach
|
|
18
|
+
1. Read `plans/README.md` first.
|
|
19
|
+
2. If the task concerns core NEAT architecture or evolutionary correctness, read `plans/neat.plans.md` next.
|
|
20
|
+
3. Otherwise read only the single most relevant detailed plan, with at most one additional related plan when necessary.
|
|
21
|
+
4. Extract terminology, constraints, sequencing hints, and any likely code/plan mismatch risks.
|
|
22
|
+
|
|
23
|
+
## Output Format
|
|
24
|
+
Return:
|
|
25
|
+
- `Primary plan:` path and one-sentence reason.
|
|
26
|
+
- `Optional secondary plan:` path and one-sentence reason, or `none`.
|
|
27
|
+
- `Key terms:` short comma-separated list.
|
|
28
|
+
- `Guardrails:` 2 to 4 short bullets.
|
|
29
|
+
- `Possible mismatch risks:` 0 to 3 short bullets.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Use when executing a deliberate SOLID module split, folderizing a large file, following or creating a durable split plan, updating plan progress, and ending each completed step with a handoff prompt for the next session. Keywords: SOLID split, split plan, folderize, module boundary, orchestration-first, compatibility re-export, handoff prompt."
|
|
3
|
+
name: "solid-split"
|
|
4
|
+
tools: [read, edit, search, execute, todo, agent]
|
|
5
|
+
argument-hint: "Describe the module to split, the plan file to follow or create, and the single current step to complete."
|
|
6
|
+
agents: ["Boundary Mapper", "Plan Scout", "Docs Scout"]
|
|
7
|
+
user-invocable: true
|
|
8
|
+
---
|
|
9
|
+
You are a plan-first SOLID refactor execution agent for NeatapticTS.
|
|
10
|
+
|
|
11
|
+
Your job is to complete one durable split step at a time, keep the codebase aligned with a resumable plan document, and end every completed step with a handoff prompt that is ready to start the next step in a new session.
|
|
12
|
+
|
|
13
|
+
## Constraints
|
|
14
|
+
- ALWAYS locate and follow the most relevant existing plan in `plans/` before editing.
|
|
15
|
+
- If no suitable durable plan exists, create one in `plans/` before making implementation edits.
|
|
16
|
+
- ALWAYS keep the plan high-level and resumable, using durable progress markers like `[]` and `[DONE]`.
|
|
17
|
+
- ALWAYS keep a todo list with exactly one active implementation item for the current step.
|
|
18
|
+
- ONLY complete one durable plan step per invocation unless the user explicitly overrides that rule.
|
|
19
|
+
- DO NOT move on to the next plan step in the same session after finishing the current one.
|
|
20
|
+
- DO NOT leave the plan file stale after completing or materially reshaping a step.
|
|
21
|
+
- DO NOT hand-edit generated README files; improve source JSDoc and run docs generation when needed.
|
|
22
|
+
- DO NOT break stable import paths when a compatibility facade or re-export shim is required.
|
|
23
|
+
- Prefer folder-first module boundaries and orchestration-first main files.
|
|
24
|
+
|
|
25
|
+
## Required Workflow
|
|
26
|
+
1. Read the nearest folder `README.md` and the nearest useful parent README when the split spans sibling areas.
|
|
27
|
+
2. Read `plans/README.md` first for architectural work, then read only the single most relevant detailed plan, with at most one additional related plan if needed.
|
|
28
|
+
3. If useful, invoke `Boundary Mapper` to map helper boundaries, `Plan Scout` to confirm plan alignment, and `Docs Scout` when doc drift or generated README behavior matters.
|
|
29
|
+
4. Find the current plan step to execute. If no durable plan exists, create one modeled after `plans/asciiMaze_SOLID_split.md`: short purpose, durable progress rules, concise target shape, explicit execution steps, and done criteria.
|
|
30
|
+
5. Convert the current step into a tight todo list with one active item.
|
|
31
|
+
6. Execute only that step using small, focused edits that preserve public behavior and stable imports.
|
|
32
|
+
7. Update the plan immediately after the step is complete or if the durable step ordering changes.
|
|
33
|
+
8. Run the minimum validation needed for touched files and stated done criteria, such as TypeScript checks, docs generation, or build validation.
|
|
34
|
+
9. Stop after reporting the completed step. Do not continue into the next step automatically.
|
|
35
|
+
|
|
36
|
+
## Split Execution Rules
|
|
37
|
+
- Keep the main `module/module.ts` file orchestration-first.
|
|
38
|
+
- Move one helper category at a time behind focused files or subfolders.
|
|
39
|
+
- Reduce the old top-level file to a compatibility re-export when stable imports must keep working.
|
|
40
|
+
- Improve JSDoc on exported or public surfaces touched by the split.
|
|
41
|
+
- Prefer declarative top-level flow and keep implementation detail below the fold in helpers or services.
|
|
42
|
+
- Preserve existing style, naming conventions, and ES2023-first patterns.
|
|
43
|
+
|
|
44
|
+
## If Blocked
|
|
45
|
+
- If the current step cannot be completed safely, stop without advancing the plan step to `[DONE]`.
|
|
46
|
+
- Record only durable plan changes, not temporary debugging notes.
|
|
47
|
+
- Return the blocker, the smallest safe next action, and a revised handoff prompt for the next session.
|
|
48
|
+
|
|
49
|
+
## Output Format
|
|
50
|
+
Return:
|
|
51
|
+
- `Plan file:` path and whether it was followed, created, or updated.
|
|
52
|
+
- `Completed step:` exact plan step label, or `blocked`.
|
|
53
|
+
- `Changes made:` short bullet list.
|
|
54
|
+
- `Validation:` short bullet list with pass, fail, or not run.
|
|
55
|
+
- `Plan update:` one short sentence describing the durable plan change.
|
|
56
|
+
- `Handoff prompt:` a paste-ready prompt that explicitly tells the next session to continue with the next numbered plan step, rendered inside a fenced code block so it appears in a text-copy box.
|
|
57
|
+
|
|
58
|
+
## Final Response Requirement
|
|
59
|
+
- The last part of every successful run MUST be a next-session handoff prompt rendered in a fenced `text` code block.
|
|
60
|
+
- The handoff prompt MUST use the complete template below, adapted to the specific repository, plan file, module boundary, known current state, validation expectations, and next numbered step.
|
|
61
|
+
- The handoff prompt MUST be actionable on its own, without requiring the next session to infer missing context from prior chat history.
|
|
62
|
+
- When relevant, include confirmed completed prior steps, important file locations, validation commands already known to be required, and any worktree cautions about unrelated generated changes.
|
|
63
|
+
- If blocked, emit the same complete template but rewrite `What to do` so it starts with the smallest safe unblock action instead of full step execution.
|
|
64
|
+
|
|
65
|
+
## Handoff Prompt Template
|
|
66
|
+
Use this as the default next-session prompt shape and specialize every placeholder:
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
Continue the <workstream name> SOLID split in <workspace root> by executing Step <N> from <plan path>: <step goal>.
|
|
70
|
+
|
|
71
|
+
Current state to assume:
|
|
72
|
+
- Step <N-1> is complete.
|
|
73
|
+
- <Previously completed boundary or durable milestone>.
|
|
74
|
+
- The real facade now lives in <current facade path>.
|
|
75
|
+
- The legacy entrypoint <compatibility shim path> is now a compatibility re-export.
|
|
76
|
+
- <Other durable file-location fact that the next step should assume>.
|
|
77
|
+
- <plan path> already marks Step <N-1> as done.
|
|
78
|
+
- Required validations most recently succeeded with:
|
|
79
|
+
- <validation command 1>
|
|
80
|
+
- <validation command 2>
|
|
81
|
+
- The working tree may contain unrelated generated README/doc changes from docs generation or prior refactor work. Do not revert unrelated changes.
|
|
82
|
+
|
|
83
|
+
What to do:
|
|
84
|
+
1. Read <nearest folder README path> first.
|
|
85
|
+
2. Read <plan path>.
|
|
86
|
+
3. Inspect the current surface for this step and its closest related files, especially:
|
|
87
|
+
- <primary file path>
|
|
88
|
+
- <related file path>
|
|
89
|
+
- any nearby consumers/importers or sibling helpers affected by this boundary
|
|
90
|
+
4. Create and execute the Step <N> split or refactor using the repo's folder-first pattern:
|
|
91
|
+
- <module>/<module>.ts
|
|
92
|
+
- <module>/<module>.types.ts
|
|
93
|
+
- <module>/<module>.utils.ts
|
|
94
|
+
- <module>/<module>.services.ts
|
|
95
|
+
- <module>/<module>.constants.ts
|
|
96
|
+
- add nested subfolders only if clearly justified by existing responsibility seams
|
|
97
|
+
5. Keep the public API stable. Existing imports of <stable import path> should keep working.
|
|
98
|
+
6. Make the main facade orchestration-first. Move <responsibility cluster list> behind focused helpers, services, or submodules.
|
|
99
|
+
7. Improve JSDoc for exported/public surfaces you touch. Do not hand-edit generated README files under generated-doc locations; update source JSDoc instead.
|
|
100
|
+
8. Update <plan path> to reflect durable Step <N> progress once the step is actually complete.
|
|
101
|
+
9. Validate with:
|
|
102
|
+
- <validation command 1>
|
|
103
|
+
- <validation command 2>
|
|
104
|
+
10. Do not run broad test suites unless truly necessary. Preserve unrelated worktree changes.
|
|
105
|
+
|
|
106
|
+
Implementation constraints:
|
|
107
|
+
- Use apply_patch for edits.
|
|
108
|
+
- Keep changes minimal and focused on Step <N>.
|
|
109
|
+
- Do not revert user changes or unrelated generated files.
|
|
110
|
+
- Follow the repo's TypeScript, JSDoc, and style constraints from <instructions path>.
|
|
111
|
+
- Prefer ES2023 style where touched code benefits from it.
|
|
112
|
+
- Keep naming descriptive; avoid short local identifiers.
|
|
113
|
+
- If the target module is too large for a single safe pass, split one helper category at a time but finish the full Step <N> boundary in this session if feasible.
|
|
114
|
+
|
|
115
|
+
Definition of done:
|
|
116
|
+
- <Module or boundary> is no longer the obvious coordination sink.
|
|
117
|
+
- The main facade is thin and orchestration-first.
|
|
118
|
+
- Focused helper files own <responsibility cluster list> responsibilities.
|
|
119
|
+
- Existing consumers still compile without import churn.
|
|
120
|
+
- <plan path> reflects the new durable shape.
|
|
121
|
+
- <validation outcome 1> passes.
|
|
122
|
+
- <validation outcome 2> passes.
|
|
123
|
+
|
|
124
|
+
Final response requirements:
|
|
125
|
+
- Summarize the new <module or boundary> shape.
|
|
126
|
+
- Mention which files became the new public facade and compatibility shim, if any.
|
|
127
|
+
- Report validation results for the required checks.
|
|
128
|
+
- Provide a handoff prompt to perform Step <N+1> in a new session inside a text-copy box. The last step must be to generate the prompt for the next step using this same template.
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Handoff Rule
|
|
132
|
+
Every successful run must end with a handoff prompt inside a fenced code block, using the complete template above and at minimum preserving this opening sentence shape:
|
|
133
|
+
|
|
134
|
+
```text
|
|
135
|
+
Continue with <plan path>, starting Step <N>: <step title>. First read the nearest folder README.md files, confirm plan alignment, complete only this step, update the plan when done, validate the touched surface, and stop with the next handoff prompt.
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
If the run is blocked, end with the same fenced code block shape and the same complete template, but replace the completion request with the smallest safe unblock action.
|
|
@@ -15,6 +15,70 @@ When you touch code under `src/` or `test/`, prefer improving JSDoc so the gener
|
|
|
15
15
|
|
|
16
16
|
Keep examples short, dependency-light, and consistent with the current public API (avoid imaginary helpers or absolute file paths).
|
|
17
17
|
|
|
18
|
+
Generated README handling
|
|
19
|
+
------------------------
|
|
20
|
+
Folder `README.md` files inside `src/` are generated artifacts and should be treated as read-only during normal editing.
|
|
21
|
+
|
|
22
|
+
When a generated `src/**/README.md` is lacking, improve the associated JSDoc in the source files that feed it instead of editing the README directly.
|
|
23
|
+
|
|
24
|
+
When a generated `src/**/README.md` appears outdated relative to the code or JSDoc:
|
|
25
|
+
|
|
26
|
+
- do not hand-edit the generated README,
|
|
27
|
+
- run `npm run docs` to refresh generated documentation when needed,
|
|
28
|
+
- consider agents pre-approved to run `npm run docs` after doc-affecting edits so README files stay synchronized and drift does not confuse later work.
|
|
29
|
+
|
|
30
|
+
Folder README reconnaissance (read this before deep code search)
|
|
31
|
+
---------------------------------------------------------------
|
|
32
|
+
Because JSDoc is auto-compiled into each folder's `README.md`, those README files are the fastest condensed overview of a module's purpose, exported surface, neighboring files, and intended usage.
|
|
33
|
+
|
|
34
|
+
Before exploring or editing a folder in `src/` or `test/`, agents should:
|
|
35
|
+
|
|
36
|
+
1. Read the nearest folder `README.md` first.
|
|
37
|
+
- Example: before changing `src/architecture/network/genetic/*`, read `src/architecture/network/genetic/README.md`.
|
|
38
|
+
2. Read the nearest useful parent README when the task spans multiple sibling areas.
|
|
39
|
+
- Example: pair `src/architecture/network/genetic/README.md` with `src/architecture/network/README.md`.
|
|
40
|
+
3. Only then read individual source files.
|
|
41
|
+
|
|
42
|
+
Use folder README files to quickly answer:
|
|
43
|
+
|
|
44
|
+
- What is this folder responsible for?
|
|
45
|
+
- Which files are likely orchestration files vs helper/detail files?
|
|
46
|
+
- What public APIs, invariants, or examples are already documented here?
|
|
47
|
+
- Which neighboring modules or tests are probably affected by a change?
|
|
48
|
+
- Whether a code change should also improve JSDoc because the generated README is user-facing.
|
|
49
|
+
|
|
50
|
+
This README-first pass is especially useful for:
|
|
51
|
+
|
|
52
|
+
- fast codebase orientation in unfamiliar folders,
|
|
53
|
+
- choosing the right edit target before opening many files,
|
|
54
|
+
- planning refactors without breaking folder responsibilities,
|
|
55
|
+
- spotting doc/code drift early,
|
|
56
|
+
- finding likely examples and tests for a feature,
|
|
57
|
+
- producing concise explanations for the user after changes.
|
|
58
|
+
|
|
59
|
+
If the folder README appears stale, incomplete, or in tension with the code, treat that as a signal to improve the underlying JSDoc in the touched source files when it is safe to do so.
|
|
60
|
+
|
|
61
|
+
Plan-aware execution (align changes without overloading context)
|
|
62
|
+
---------------------------------------------------------------
|
|
63
|
+
This repository has an active `plans/` directory with roadmap and design intent. Agents should keep work aligned with those plans, but should avoid loading the entire folder into context unless the task truly requires it.
|
|
64
|
+
|
|
65
|
+
Use this lightweight plan workflow:
|
|
66
|
+
|
|
67
|
+
1. For any architectural feature, roadmap item, major refactor, export format, or new subsystem work, read `plans/README.md` first as the lightweight plan index.
|
|
68
|
+
2. Then read `plans/neat.plans.md` when the task touches core NEAT architecture or evolutionary correctness, or otherwise read only the single most relevant plan file from `plans/` for the task at hand.
|
|
69
|
+
3. If the task touches two clearly related initiatives, read at most one additional plan file.
|
|
70
|
+
4. Do not bulk-read the whole `plans/` directory by default.
|
|
71
|
+
|
|
72
|
+
When applying a plan:
|
|
73
|
+
|
|
74
|
+
- preserve its terminology and goals unless the user asks to revise the plan,
|
|
75
|
+
- mention any visible mismatch between the codebase and the plan,
|
|
76
|
+
- prefer incremental steps that move the code toward the documented direction,
|
|
77
|
+
- avoid introducing APIs or architecture that conflict with a stated plan without explicitly flagging the conflict.
|
|
78
|
+
|
|
79
|
+
For substantial work, agent prompts and final summaries should briefly note which README and which plan document informed the change.
|
|
80
|
+
After substantial edits, keep summaries short and high level by default, and only expand into detailed walkthroughs when the user asks.
|
|
81
|
+
|
|
18
82
|
**CRITICAL: Fix-first strategy for test failures**
|
|
19
83
|
---------------------------------------------------
|
|
20
84
|
When asked to fix multiple test failures:
|
|
@@ -79,6 +143,44 @@ How to use these instructions
|
|
|
79
143
|
- Always prefer to produce code that already satisfies the style guide.
|
|
80
144
|
- If you cannot fully transform a file (large refactor), return a patch with clear TODO comments, an explicit list of remaining violations, and small, safe automated fixes where possible.
|
|
81
145
|
- If you propose changes that alter public behavior, include tests and TypeScript typechecks.
|
|
146
|
+
- Default discovery order for non-trivial tasks: relevant folder `README.md` -> parent folder `README.md` if needed -> `plans/README.md` for roadmap alignment when relevant -> the specific source files and the single most relevant detailed plan.
|
|
147
|
+
- Treat generated folder READMEs as compressed context, not as a substitute for code. Use them to reduce search noise, then verify behavior in source.
|
|
148
|
+
- Prefer multiple small, targeted, documented edits over large single-pass rewrites when both approaches can solve the task. This reduces breakage risk and makes generated-doc refreshes easier to verify.
|
|
149
|
+
|
|
150
|
+
Standard architecture for project files
|
|
151
|
+
---------------------------------------
|
|
152
|
+
When splitting medium or large modules in `src/` or `test/`, prefer a dedicated folder-based module boundary instead of accumulating many sibling files at the parent level.
|
|
153
|
+
|
|
154
|
+
Use this naming convention for a module named `module`:
|
|
155
|
+
- `module/module.ts`
|
|
156
|
+
- `module/module.utils.ts`
|
|
157
|
+
- `module/module.types.ts`
|
|
158
|
+
- `module/module.errors.ts`
|
|
159
|
+
- `module/module.services.ts`
|
|
160
|
+
- `module/module.constants.ts`
|
|
161
|
+
|
|
162
|
+
Use this naming convention for a nested sub-module named `sub-module` inside `module`:
|
|
163
|
+
- `module/sub-module/module.sub-module.ts`
|
|
164
|
+
- `module/sub-module/module.sub-module.utils.ts`
|
|
165
|
+
- `module/sub-module/module.sub-module.types.ts`
|
|
166
|
+
- `module/sub-module/module.sub-module.errors.ts`
|
|
167
|
+
- `module/sub-module/module.sub-module.services.ts`
|
|
168
|
+
- `module/sub-module/module.sub-module.constants.ts`
|
|
169
|
+
|
|
170
|
+
Interpretation rules:
|
|
171
|
+
- `*.ts`: main orchestration and primary public surface for the module.
|
|
172
|
+
- `*.utils.ts`: helper logic that is not the main orchestration path.
|
|
173
|
+
- `*.types.ts`: interfaces, DTOs, context/result objects, and narrow contracts.
|
|
174
|
+
- `*.errors.ts`: module-local error classes and error helpers.
|
|
175
|
+
- `*.services.ts`: side-effecting or stateful services used by orchestration.
|
|
176
|
+
- `*.constants.ts`: named constants, lookup tables, and local config values.
|
|
177
|
+
|
|
178
|
+
Architecture rules:
|
|
179
|
+
- Do not create a folder for every tiny file; use this pattern when a file has become a real subsystem.
|
|
180
|
+
- Keep the main `module/module.ts` file orchestration-first and declarative.
|
|
181
|
+
- Prefer subfolders over continued file sprawl when a module develops a clear internal subsystem.
|
|
182
|
+
- Avoid one-off naming patterns during refactors; once a module is folderized, keep all follow-up files in the same naming scheme.
|
|
183
|
+
- Replace broad catch-all files with narrower module-owned `*.types.ts`, `*.services.ts`, or `*.utils.ts` files rather than recreating another hub.
|
|
82
184
|
|
|
83
185
|
Strict rules to enforce (apply to any suggestion touching `src/` or `test/`)
|
|
84
186
|
---------------------------------------------------------------------
|
|
@@ -122,6 +224,7 @@ Strict rules to enforce (apply to any suggestion touching `src/` or `test/`)
|
|
|
122
224
|
3) Introduce typed context/result objects to reduce parameter sprawl
|
|
123
225
|
4) Simplify top-level flow to orchestration only
|
|
124
226
|
5) Fold repeated logic into collect/transform/fold helpers
|
|
227
|
+
- All new complex methods should follow a declarative above-the-fold structure: keep the exported or top-level method as step-oriented orchestration, and place the actual logic in small SRP private helpers below the fold.
|
|
125
228
|
- Keep the top-level method declarative and linear, with numbered inline comments (`Step 1`, `Step 2`, ...).
|
|
126
229
|
- Ensure each helper has one reason to change (SRP), very low cognitive complexity, and descriptive naming.
|
|
127
230
|
- Place helper declarations after the top-level return/fold where language/style allows.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reicek/neataptic-ts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Architecture-free neural network library with genetic algorithm implementations",
|
|
5
5
|
"main": "./dist/neataptic.js",
|
|
6
6
|
"module": "./dist/neataptic.js",
|
|
@@ -25,13 +25,16 @@
|
|
|
25
25
|
"test:e2e:logs": "npx jest e2e.test.ts --verbose --runInBand --no-cache",
|
|
26
26
|
"test:dist": "npm run build:ts && jest --no-cache --coverage --collect-coverage --runInBand --testPathIgnorePatterns=.e2e.test.ts",
|
|
27
27
|
"docs:build-scripts": "tsc -p tsconfig.docs.json && node scripts/write-dist-docs-pkg.mjs",
|
|
28
|
-
"docs:folders": "npm run docs:build-scripts && node ./dist-docs/scripts/generate-docs.js",
|
|
28
|
+
"docs:folders:src": "npm run docs:build-scripts && node ./dist-docs/scripts/generate-docs.js --target=src",
|
|
29
|
+
"docs:folders:asciiMaze": "npm run docs:build-scripts && node ./dist-docs/scripts/generate-docs.js --target=asciiMaze",
|
|
30
|
+
"docs:folders:flappy-bird": "npm run docs:build-scripts && node ./dist-docs/scripts/generate-docs.js --target=flappy-bird",
|
|
31
|
+
"docs:folders": "npm run docs:folders:src && npm run docs:folders:asciiMaze && npm run docs:folders:flappy-bird",
|
|
29
32
|
"docs:html": "npm run docs:build-scripts && node ./dist-docs/scripts/render-docs-html.js",
|
|
30
33
|
"docs:examples": "node scripts/copy-examples.mjs",
|
|
31
34
|
"prettier": "npm run prettier:tests && npm run prettier:src",
|
|
32
35
|
"prettier:tests": "npx prettier --write test/**/*.ts",
|
|
33
36
|
"prettier:src": "npx prettier --write src/**/*.ts",
|
|
34
|
-
"docs": "npm run build:ascii-maze && npm run build:flappy-worker && npm run build:flappy-bird && npm run docs:examples && npm run docs:
|
|
37
|
+
"docs": "npm run build:ascii-maze && npm run build:flappy-worker && npm run build:flappy-bird && npm run docs:examples && npm run docs:folders && node ./dist-docs/scripts/render-docs-html.js",
|
|
35
38
|
"lint": "eslint src/ test/",
|
|
36
39
|
"lint:fix": "eslint src/ --fix",
|
|
37
40
|
"onnx:export": "node scripts/export-onnx.mjs"
|
package/plans/ES2023 migration
CHANGED
|
@@ -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. **
|
|
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**:
|
|
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:
|
|
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
|
|
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
|
|
190
|
+
- Parameter mapping becomes a later unification seam for export- and worker-adjacent tooling once those Phase 4 foundations exist.
|
|
@@ -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”
|
|
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
|
|
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
|
|
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 pay
|
|
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
|
|
package/plans/README.md
ADDED
|
@@ -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
|
|
16
|
+
**Outcome:** keep iteration speed high, reduce refactor risk, and finish the structural cleanup needed before broad mechanical modernization.
|
|
17
17
|
|
|
18
|
-
-
|
|
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`
|
|
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)
|