@reicek/neataptic-ts 0.1.26 → 0.1.27

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 (123) hide show
  1. package/.github/agents/boundary-mapper.agent.md +13 -8
  2. package/.github/agents/docs-scout.agent.md +14 -9
  3. package/.github/agents/plan-scout.agent.md +11 -6
  4. package/.github/agents/solid-split.agent.md +33 -17
  5. package/.github/copilot-instructions.md +100 -88
  6. package/.github/skills/educational-docs/SKILL.md +90 -40
  7. package/.github/skills/educational-docs/assets/mermaid-diagram-playbook.md +141 -141
  8. package/.github/skills/educational-docs/assets/visual-style-guide.md +1 -1
  9. package/.github/skills/plan-alignment/SKILL.md +1 -1
  10. package/.github/skills/solid-split/SKILL.md +54 -35
  11. package/.github/skills/solid-split/assets/docs-checklist.md +1 -1
  12. package/.github/skills/solid-split/assets/split-plan-template.md +41 -12
  13. package/.github/skills/solid-split/assets/split-workflow-checklist.md +4 -1
  14. package/.github/skills/test-fix-workflow/SKILL.md +12 -7
  15. package/.github/skills/trace-analyzer-extension/SKILL.md +1 -1
  16. package/.github/skills/trace-analyzer-extension/assets/extension-checklist.md +1 -1
  17. package/.github/skills/trace-analyzer-extension/references/analyzer-extension-workflow.md +1 -1
  18. package/.github/skills/trace-audit-reporting/SKILL.md +1 -1
  19. package/.github/skills/trace-audit-reporting/assets/performance-report-template.md +1 -1
  20. package/.github/skills/trace-audit-reporting/references/trace-analysis-workflow.md +1 -1
  21. package/.github/skills/tracker-handoff/SKILL.md +53 -5
  22. package/package.json +1 -1
  23. package/plans/Flappy_Bird_Folder_Documentation_Pass.logs.md +42 -0
  24. package/plans/Flappy_Bird_Folder_Documentation_Pass.md +22 -104
  25. package/plans/README.md +6 -2
  26. package/plans/Roadmap.md +35 -31
  27. package/plans/analyze-trace-solid-split.logs.md +35 -0
  28. package/plans/analyze-trace-solid-split.plans.md +21 -52
  29. package/plans/architecture-solid-split.logs.md +44 -0
  30. package/plans/architecture-solid-split.plans.md +20 -653
  31. package/plans/asciiMaze-typescript-repair.logs.md +35 -0
  32. package/plans/asciiMaze-typescript-repair.plans.md +30 -36
  33. package/plans/generate-docs-solid-split.logs.md +36 -0
  34. package/plans/generate-docs-solid-split.plans.md +21 -73
  35. package/plans/methods-docs.logs.md +37 -0
  36. package/plans/methods-docs.plans.md +22 -183
  37. package/plans/methods-solid-split.logs.md +41 -0
  38. package/plans/methods-solid-split.plans.md +23 -65
  39. package/plans/neat-docs.logs.md +38 -0
  40. package/plans/neat-docs.plans.md +21 -63
  41. package/plans/neat-test-surface-repair.logs.md +38 -0
  42. package/plans/neat-test-surface-repair.plans.md +24 -24
  43. package/plans/readme-first-section-pass.logs.md +63 -0
  44. package/plans/readme-first-section-pass.plans.md +42 -0
  45. package/plans/render-docs-html-solid-split.logs.md +36 -0
  46. package/plans/render-docs-html-solid-split.plans.md +20 -54
  47. package/plans/src-no-explicit-any-cleanup.logs.md +39 -0
  48. package/plans/src-no-explicit-any-cleanup.plans.md +23 -161
  49. package/plans/utils-docs.logs.md +37 -0
  50. package/plans/utils-docs.plans.md +20 -35
  51. package/src/README.md +88 -22
  52. package/src/architecture/README.md +94 -17
  53. package/src/architecture/activationArrayPool/README.md +53 -0
  54. package/src/architecture/activationArrayPool/activationArrayPool.ts +53 -0
  55. package/src/architecture/layer/README.md +94 -5
  56. package/src/architecture/layer/layer.ts +94 -5
  57. package/src/architecture/network/README.md +85 -14
  58. package/src/architecture/network/activate/README.md +301 -213
  59. package/src/architecture/network/activate/docs.order.json +9 -0
  60. package/src/architecture/network/activate/network.activate.utils.ts +90 -0
  61. package/src/architecture/network/connect/README.md +80 -3
  62. package/src/architecture/network/connect/docs.order.json +9 -0
  63. package/src/architecture/network/connect/network.connect.utils.ts +79 -0
  64. package/src/architecture/network/deterministic/README.md +96 -12
  65. package/src/architecture/network/deterministic/docs.order.json +10 -0
  66. package/src/architecture/network/deterministic/network.deterministic.utils.ts +90 -0
  67. package/src/architecture/network/evolve/README.md +286 -228
  68. package/src/architecture/network/evolve/docs.order.json +11 -0
  69. package/src/architecture/network/evolve/network.evolve.utils.ts +59 -0
  70. package/src/architecture/network/gating/README.md +58 -16
  71. package/src/architecture/network/gating/docs.order.json +9 -0
  72. package/src/architecture/network/gating/network.gating.utils.ts +43 -0
  73. package/src/architecture/network/genetic/README.md +75 -36
  74. package/src/architecture/network/genetic/docs.order.json +10 -0
  75. package/src/architecture/network/genetic/network.genetic.utils.ts +53 -17
  76. package/src/architecture/network/network.ts +91 -46
  77. package/src/architecture/network/standalone/README.md +309 -285
  78. package/src/architecture/network/standalone/docs.order.json +13 -0
  79. package/src/architecture/network/standalone/network.standalone.utils.ts +51 -28
  80. package/src/architecture/network.ts +94 -17
  81. package/src/architecture/nodePool/README.md +53 -0
  82. package/src/architecture/nodePool/nodePool.ts +53 -0
  83. package/src/methods/README.md +80 -34
  84. package/src/methods/methods.ts +80 -34
  85. package/src/methods/mutation/README.md +39 -93
  86. package/src/methods/mutation/mutation.ts +58 -0
  87. package/src/multithreading/README.md +114 -14
  88. package/src/multithreading/docs.order.json +5 -0
  89. package/src/multithreading/multi.ts +103 -7
  90. package/src/multithreading/types.ts +6 -1
  91. package/src/multithreading/workers/README.md +72 -2
  92. package/src/multithreading/workers/browser/README.md +39 -0
  93. package/src/multithreading/workers/browser/testworker.ts +40 -0
  94. package/src/multithreading/workers/node/README.md +50 -11
  95. package/src/multithreading/workers/node/docs.order.json +4 -0
  96. package/src/multithreading/workers/node/testworker.ts +43 -3
  97. package/src/multithreading/workers/workers.ts +36 -1
  98. package/src/neat/README.md +230 -152
  99. package/src/neat/adaptive/core/README.md +99 -42
  100. package/src/neat/adaptive/core/adaptive.core.ts +71 -14
  101. package/src/neat/adaptive/core/docs.order.json +8 -0
  102. package/src/neat/docs.order.json +9 -0
  103. package/src/neat/lineage/README.md +118 -16
  104. package/src/neat/lineage/lineage.ts +115 -13
  105. package/src/neat/neat.defaults.constants.ts +91 -13
  106. package/src/neat.ts +86 -20
  107. package/src/utils/README.md +71 -21
  108. package/src/utils/memory.ts +69 -19
  109. package/test/examples/asciiMaze/browser-entry/README.md +81 -8
  110. package/test/examples/asciiMaze/browser-entry/browser-entry.ts +81 -8
  111. package/test/examples/asciiMaze/dashboardManager/README.md +68 -4
  112. package/test/examples/asciiMaze/dashboardManager/dashboardManager.ts +68 -4
  113. package/test/examples/asciiMaze/evolutionEngine/README.md +1259 -1174
  114. package/test/examples/asciiMaze/evolutionEngine/docs.order.json +10 -0
  115. package/test/examples/asciiMaze/evolutionEngine/evolutionEngine.types.ts +87 -0
  116. package/test/examples/asciiMaze/mazeMovement/README.md +81 -4
  117. package/test/examples/asciiMaze/mazeMovement/mazeMovement.ts +81 -4
  118. package/test/examples/flappy_bird/browser-entry/README.md +64 -21
  119. package/test/examples/flappy_bird/browser-entry/browser-entry.ts +64 -21
  120. package/test/examples/flappy_bird/flappy-evolution-worker/README.md +98 -10
  121. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.ts +98 -10
  122. package/test/examples/flappy_bird/simulation-shared/README.md +88 -4
  123. package/test/examples/flappy_bird/simulation-shared/simulation-shared.types.ts +88 -4
@@ -1,14 +1,87 @@
1
1
  /**
2
- * Public browser entry facade for the ASCII Maze demo module boundary.
2
+ * Browser-hosted curriculum boundary for the ASCII Maze example.
3
3
  *
4
- * The folder now owns host bootstrap, runtime orchestration, globals
5
- * compatibility, and resize handling behind focused helpers. This facade keeps
6
- * the public API stable while presenting a small orchestration-first surface.
4
+ * This folder is where a long-running maze experiment becomes a browser
5
+ * experience a human can actually steer and inspect. The evolution engine still
6
+ * owns search, scoring, and curriculum advancement. The browser-entry boundary
7
+ * owns host elements, resize behavior, telemetry fan-out, globals
8
+ * compatibility, and the lifecycle handle that embedding code talks to.
7
9
  *
8
- * Educational note:
9
- * `index.html` is only the browser shell that loads the prebuilt bundle and
10
- * forwards into this API through window globals. If you want the real browser
11
- * host boundary, start here rather than with the HTML loader.
10
+ * Read it as a boundary between two clocks. One clock belongs to the maze
11
+ * curriculum that carries refined winners into larger procedural mazes. The
12
+ * other clock belongs to the browser host that has to paint dashboards, react
13
+ * to cancellation, and stay polite to resize or unload events. `browser-entry/`
14
+ * exists so those clocks can cooperate without collapsing into one monolithic
15
+ * demo script.
16
+ *
17
+ * That separation matters because `index.html` is intentionally thin. The page
18
+ * only loads the published bundle from `docs/assets`, exposes a globals bridge,
19
+ * and then hands off to this start surface. If you want the real host/runtime
20
+ * seam, start here instead of with the HTML shell.
21
+ *
22
+ * A second useful mental model is ownership. This folder does not own maze
23
+ * fitness, winner refinement, or solve thresholds. Those stay in
24
+ * `evolutionEngine/`. The host boundary owns container resolution, dashboard
25
+ * plumbing, cooperative abort wiring, and the stable run handle that browser
26
+ * callers can stop, await, or subscribe to.
27
+ *
28
+ * Read the chapter in three passes. Start with `browser-entry.ts` for the
29
+ * public `start(...)` surface. Continue to `browser-entry.services.ts` for host
30
+ * assembly, globals wiring, and curriculum hand-off. Finish with the constants,
31
+ * curriculum, and host helper files when you want the browser-specific
32
+ * mechanics rather than the public lifecycle contract.
33
+ *
34
+ * ```mermaid
35
+ * flowchart LR
36
+ * classDef base fill:#08131f,stroke:#1ea7ff,color:#dff6ff,stroke-width:1px;
37
+ * classDef accent fill:#0f2233,stroke:#ffd166,color:#fff4cc,stroke-width:1.5px;
38
+ *
39
+ * HtmlShell["index.html\nbundle loader"]:::base --> Globals["window globals\ncompatibility bridge"]:::base
40
+ * Globals --> Start["start(...)\npublic browser entry"]:::accent
41
+ * Start --> Host["host services\ndashboard + resize + container"]:::base
42
+ * Start --> Curriculum["runBrowserEntryCurriculum\nphase orchestration"]:::base
43
+ * Curriculum --> Engine["Evolution engine\nsearch and solve logic"]:::base
44
+ * Host --> Handle["AsciiMazeRunHandle\nstop done telemetry"]:::base
45
+ * Curriculum --> Handle
46
+ * ```
47
+ *
48
+ * ```mermaid
49
+ * flowchart TD
50
+ * classDef base fill:#08131f,stroke:#1ea7ff,color:#dff6ff,stroke-width:1px;
51
+ * classDef accent fill:#0f2233,stroke:#ffd166,color:#fff4cc,stroke-width:1.5px;
52
+ *
53
+ * BrowserEntry["browser-entry/"]:::accent --> PublicApi["browser-entry.ts\npublic start surface"]:::base
54
+ * BrowserEntry --> Services["browser-entry.services.ts\nhost and globals assembly"]:::base
55
+ * BrowserEntry --> Curriculum["browser-entry.curriculum.services.ts\nphase hand-off"]:::base
56
+ * BrowserEntry --> HostUtils["browser-entry.host.services.ts\nand utils"]:::base
57
+ * BrowserEntry --> Types["browser-entry.types.ts\nrun-handle contracts"]:::base
58
+ * ```
59
+ *
60
+ * For background reading on the cooperative stop side of the boundary, see
61
+ * MDN, [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController),
62
+ * which is the browser primitive this entry layer uses to compose internal and
63
+ * caller-provided cancellation without moving DOM concerns into the engine.
64
+ *
65
+ * Example: boot the browser demo from embedding code and stop it later.
66
+ *
67
+ * ```ts
68
+ * const handle = await start('ascii-maze-output');
69
+ *
70
+ * setTimeout(() => handle.stop(), 5_000);
71
+ * await handle.done;
72
+ * ```
73
+ *
74
+ * Example: subscribe to telemetry while the curriculum advances.
75
+ *
76
+ * ```ts
77
+ * const handle = await start('ascii-maze-output');
78
+ * const unsubscribe = handle.onTelemetry((telemetry) => {
79
+ * console.log(telemetry.generation, telemetry.bestFitness);
80
+ * });
81
+ *
82
+ * await handle.done;
83
+ * unsubscribe();
84
+ * ```
12
85
  */
13
86
 
14
87
  import { BROWSER_ENTRY_CONSTANTS as C } from './browser-entry.constants';
@@ -1,10 +1,74 @@
1
1
  # dashboardManager
2
2
 
3
- Public DashboardManager facade for the dedicated dashboardManager module boundary.
3
+ Search-visibility boundary for ASCII Maze browser and terminal hosts.
4
+
5
+ Evolution is difficult to trust when all you see is a final score. The
6
+ dashboard boundary turns per-generation updates into a live board, a solved
7
+ archive, and a reusable telemetry snapshot so long runs stay legible while
8
+ they are still happening.
9
+
10
+ That is why this folder exists as a separate boundary instead of staying
11
+ mixed into the engine. The engine should answer whether the search is making
12
+ progress. The dashboard should answer how a human can see that progress:
13
+ current best candidate, recent trends, species counts, complexity drift, and
14
+ solved artifacts worth preserving.
15
+
16
+ Read the folder as three cooperating shelves. The public `DashboardManager`
17
+ class keeps the stable host-facing API. `dashboardManager.services.ts`
18
+ handles update ingestion, redraws, and telemetry emission. The archive, live,
19
+ and telemetry subfolders keep presentation concerns decomposed so browser and
20
+ terminal hosts can reuse the same core state with different outputs.
21
+
22
+ The chapter matters because telemetry without presentation quickly becomes a
23
+ pile of numbers, while presentation without a stable telemetry contract
24
+ becomes fragile host-specific logic. This boundary keeps those concerns close
25
+ enough to cooperate and separate enough to evolve independently.
26
+
27
+ Read this chapter in three passes. Start with the class surface for the
28
+ public update, redraw, and snapshot methods. Continue to the service module
29
+ for the runtime dataflow. Finish in `archive/`, `live/`, and `telemetry/`
30
+ when you want the host-specific rendering details rather than the stable
31
+ dashboard contract.
32
+
33
+ ```mermaid
34
+ flowchart LR
35
+ classDef base fill:#08131f,stroke:#1ea7ff,color:#dff6ff,stroke-width:1px;
36
+ classDef accent fill:#0f2233,stroke:#ffd166,color:#fff4cc,stroke-width:1.5px;
37
+
38
+ Engine["Evolution engine update"]:::base --> Dashboard["DashboardManager.update(...)\npublic ingest surface"]:::accent
39
+ Dashboard --> Live["live board\ncurrent best and trends"]:::base
40
+ Dashboard --> Archive["solved archive\nretained artifacts"]:::base
41
+ Dashboard --> Telemetry["public telemetry snapshot\nhost subscriptions"]:::base
42
+ ```
43
+
44
+ ```mermaid
45
+ flowchart TD
46
+ classDef base fill:#08131f,stroke:#1ea7ff,color:#dff6ff,stroke-width:1px;
47
+ classDef accent fill:#0f2233,stroke:#ffd166,color:#fff4cc,stroke-width:1.5px;
48
+
49
+ Hosts["Browser or terminal host"]:::base --> Facade["DashboardManager\nclass facade"]:::accent
50
+ Facade --> Services["dashboardManager.services.ts\nstateful orchestration"]:::base
51
+ Services --> State["history state\ncurrent best\nlast telemetry"]:::base
52
+ Services --> Views["archive/ live/ telemetry/\nrendering helpers"]:::base
53
+ ```
54
+
55
+ Example: create one dashboard instance for a run and feed it updates.
56
+
57
+ ```ts
58
+ const dashboard = new DashboardManager(clearOutput, logOutput, archiveOutput);
4
59
 
5
- The folder now owns local contracts, constants, pure formatting helpers, and
6
- stateful rendering and telemetry services. This facade keeps the established
7
- class-based API stable while delegating the heavy work to focused helpers.
60
+ dashboard.update(maze, result, network, generation, neatInstance);
61
+ dashboard.redraw(maze, neatInstance);
62
+ ```
63
+
64
+ Example: read the latest public telemetry snapshot after several updates.
65
+
66
+ ```ts
67
+ const telemetry = dashboard.getLastTelemetry();
68
+
69
+ console.log(telemetry.generation);
70
+ console.log(telemetry.bestFitness);
71
+ ```
8
72
 
9
73
  ## dashboardManager/dashboardManager.types.ts
10
74
 
@@ -1,9 +1,73 @@
1
1
  /**
2
- * Public DashboardManager facade for the dedicated dashboardManager module boundary.
2
+ * Search-visibility boundary for ASCII Maze browser and terminal hosts.
3
3
  *
4
- * The folder now owns local contracts, constants, pure formatting helpers, and
5
- * stateful rendering and telemetry services. This facade keeps the established
6
- * class-based API stable while delegating the heavy work to focused helpers.
4
+ * Evolution is difficult to trust when all you see is a final score. The
5
+ * dashboard boundary turns per-generation updates into a live board, a solved
6
+ * archive, and a reusable telemetry snapshot so long runs stay legible while
7
+ * they are still happening.
8
+ *
9
+ * That is why this folder exists as a separate boundary instead of staying
10
+ * mixed into the engine. The engine should answer whether the search is making
11
+ * progress. The dashboard should answer how a human can see that progress:
12
+ * current best candidate, recent trends, species counts, complexity drift, and
13
+ * solved artifacts worth preserving.
14
+ *
15
+ * Read the folder as three cooperating shelves. The public `DashboardManager`
16
+ * class keeps the stable host-facing API. `dashboardManager.services.ts`
17
+ * handles update ingestion, redraws, and telemetry emission. The archive, live,
18
+ * and telemetry subfolders keep presentation concerns decomposed so browser and
19
+ * terminal hosts can reuse the same core state with different outputs.
20
+ *
21
+ * The chapter matters because telemetry without presentation quickly becomes a
22
+ * pile of numbers, while presentation without a stable telemetry contract
23
+ * becomes fragile host-specific logic. This boundary keeps those concerns close
24
+ * enough to cooperate and separate enough to evolve independently.
25
+ *
26
+ * Read this chapter in three passes. Start with the class surface for the
27
+ * public update, redraw, and snapshot methods. Continue to the service module
28
+ * for the runtime dataflow. Finish in `archive/`, `live/`, and `telemetry/`
29
+ * when you want the host-specific rendering details rather than the stable
30
+ * dashboard contract.
31
+ *
32
+ * ```mermaid
33
+ * flowchart LR
34
+ * classDef base fill:#08131f,stroke:#1ea7ff,color:#dff6ff,stroke-width:1px;
35
+ * classDef accent fill:#0f2233,stroke:#ffd166,color:#fff4cc,stroke-width:1.5px;
36
+ *
37
+ * Engine["Evolution engine update"]:::base --> Dashboard["DashboardManager.update(...)\npublic ingest surface"]:::accent
38
+ * Dashboard --> Live["live board\ncurrent best and trends"]:::base
39
+ * Dashboard --> Archive["solved archive\nretained artifacts"]:::base
40
+ * Dashboard --> Telemetry["public telemetry snapshot\nhost subscriptions"]:::base
41
+ * ```
42
+ *
43
+ * ```mermaid
44
+ * flowchart TD
45
+ * classDef base fill:#08131f,stroke:#1ea7ff,color:#dff6ff,stroke-width:1px;
46
+ * classDef accent fill:#0f2233,stroke:#ffd166,color:#fff4cc,stroke-width:1.5px;
47
+ *
48
+ * Hosts["Browser or terminal host"]:::base --> Facade["DashboardManager\nclass facade"]:::accent
49
+ * Facade --> Services["dashboardManager.services.ts\nstateful orchestration"]:::base
50
+ * Services --> State["history state\ncurrent best\nlast telemetry"]:::base
51
+ * Services --> Views["archive/ live/ telemetry/\nrendering helpers"]:::base
52
+ * ```
53
+ *
54
+ * Example: create one dashboard instance for a run and feed it updates.
55
+ *
56
+ * ```ts
57
+ * const dashboard = new DashboardManager(clearOutput, logOutput, archiveOutput);
58
+ *
59
+ * dashboard.update(maze, result, network, generation, neatInstance);
60
+ * dashboard.redraw(maze, neatInstance);
61
+ * ```
62
+ *
63
+ * Example: read the latest public telemetry snapshot after several updates.
64
+ *
65
+ * ```ts
66
+ * const telemetry = dashboard.getLastTelemetry();
67
+ *
68
+ * console.log(telemetry.generation);
69
+ * console.log(telemetry.bestFitness);
70
+ * ```
7
71
  */
8
72
 
9
73
  import type Neat from '../../../../src/neat';