@reicek/neataptic-ts 0.1.25 → 0.1.26

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 (210) hide show
  1. package/.github/copilot-instructions.md +11 -0
  2. package/.github/skills/trace-analyzer-extension/SKILL.md +3 -3
  3. package/.github/skills/trace-analyzer-extension/assets/extension-checklist.md +1 -1
  4. package/.github/skills/trace-analyzer-extension/references/analyzer-extension-workflow.md +1 -1
  5. package/.github/skills/trace-audit-reporting/SKILL.md +3 -3
  6. package/.github/skills/trace-audit-reporting/references/trace-analysis-workflow.md +1 -1
  7. package/package.json +19 -13
  8. package/plans/Flappy_Bird_Folder_Documentation_Pass.md +4 -4
  9. package/plans/README.md +24 -0
  10. package/plans/Roadmap.md +62 -40
  11. package/plans/analyze-trace-solid-split.plans.md +66 -0
  12. package/plans/architecture-solid-split.plans.md +9 -15
  13. package/plans/asciiMaze-typescript-repair.plans.md +1 -1
  14. package/plans/generate-docs-solid-split.plans.md +87 -0
  15. package/plans/methods-docs.plans.md +25 -1
  16. package/plans/methods-solid-split.plans.md +14 -14
  17. package/plans/neat-docs.plans.md +9 -1
  18. package/plans/neat-test-surface-repair.plans.md +1 -1
  19. package/plans/render-docs-html-solid-split.plans.md +68 -0
  20. package/plans/src-no-explicit-any-cleanup.plans.md +1 -1
  21. package/plans/utils-docs.plans.md +6 -1
  22. package/scripts/analyze-trace/analyze-trace.analysis.ts +479 -0
  23. package/scripts/analyze-trace/analyze-trace.constants.ts +35 -0
  24. package/scripts/analyze-trace/analyze-trace.io.ts +69 -0
  25. package/scripts/analyze-trace/analyze-trace.report.ts +100 -0
  26. package/scripts/analyze-trace/analyze-trace.shared.ts +116 -0
  27. package/scripts/analyze-trace/analyze-trace.ts +45 -0
  28. package/scripts/analyze-trace/analyze-trace.types.ts +72 -0
  29. package/scripts/assets/theme.css +80 -23
  30. package/scripts/copy-examples.ts +239 -0
  31. package/scripts/export-onnx.ts +223 -0
  32. package/scripts/generate-bench-tables.ts +378 -37
  33. package/scripts/generate-docs/generate-docs.constants.ts +107 -0
  34. package/scripts/generate-docs/generate-docs.order.ts +355 -0
  35. package/scripts/generate-docs/generate-docs.state.ts +31 -0
  36. package/scripts/generate-docs/generate-docs.targets.ts +165 -0
  37. package/scripts/generate-docs/generate-docs.ts +63 -0
  38. package/scripts/generate-docs/generate-docs.types.ts +112 -0
  39. package/scripts/generate-docs/output/generate-docs.output.folder-index.utils.ts +167 -0
  40. package/scripts/generate-docs/output/generate-docs.output.ordering.utils.ts +353 -0
  41. package/scripts/generate-docs/output/generate-docs.output.readme.utils.ts +420 -0
  42. package/scripts/generate-docs/output/generate-docs.output.ts +123 -0
  43. package/scripts/generate-docs/output/generate-docs.output.warnings.utils.ts +219 -0
  44. package/scripts/generate-docs/symbols/generate-docs.symbols.collection.utils.ts +365 -0
  45. package/scripts/generate-docs/symbols/generate-docs.symbols.jsdoc.utils.ts +373 -0
  46. package/scripts/generate-docs/symbols/generate-docs.symbols.normalize.utils.ts +155 -0
  47. package/scripts/generate-docs/symbols/generate-docs.symbols.render.utils.ts +149 -0
  48. package/scripts/generate-docs/symbols/generate-docs.symbols.signature.utils.ts +289 -0
  49. package/scripts/generate-docs/symbols/generate-docs.symbols.ts +11 -0
  50. package/scripts/mermaid-cli.mjs +102 -22
  51. package/scripts/mermaid-cli.ts +736 -0
  52. package/scripts/render-docs-html/render-docs-html.assets.ts +54 -0
  53. package/scripts/render-docs-html/render-docs-html.mermaid.ts +245 -0
  54. package/scripts/{render-docs-html.sidebar.ts → render-docs-html/render-docs-html.navigation.ts} +141 -144
  55. package/scripts/render-docs-html/render-docs-html.pages.ts +333 -0
  56. package/scripts/render-docs-html/render-docs-html.shared.ts +333 -0
  57. package/scripts/render-docs-html/render-docs-html.types.ts +42 -0
  58. package/scripts/render-docs-html.ts +23 -587
  59. package/scripts/run-docs.ts +238 -0
  60. package/scripts/write-dist-docs-pkg.ts +40 -0
  61. package/src/README.md +75 -75
  62. package/src/architecture/connection/README.md +5 -5
  63. package/src/architecture/layer/README.md +508 -508
  64. package/src/architecture/network/README.md +1458 -1458
  65. package/src/architecture/network/activate/README.md +694 -694
  66. package/src/architecture/network/bootstrap/README.md +77 -77
  67. package/src/architecture/network/connect/README.md +74 -74
  68. package/src/architecture/network/deterministic/README.md +135 -135
  69. package/src/architecture/network/evolve/README.md +364 -364
  70. package/src/architecture/network/gating/README.md +130 -130
  71. package/src/architecture/network/genetic/README.md +399 -399
  72. package/src/architecture/network/mutate/README.md +897 -897
  73. package/src/architecture/network/onnx/README.md +720 -720
  74. package/src/architecture/network/onnx/export/README.md +728 -728
  75. package/src/architecture/network/onnx/export/layers/README.md +450 -450
  76. package/src/architecture/network/onnx/import/README.md +618 -618
  77. package/src/architecture/network/onnx/schema/README.md +32 -32
  78. package/src/architecture/network/prune/README.md +245 -245
  79. package/src/architecture/network/remove/README.md +135 -135
  80. package/src/architecture/network/runtime/README.md +106 -106
  81. package/src/architecture/network/serialize/README.md +542 -542
  82. package/src/architecture/network/slab/README.md +608 -608
  83. package/src/architecture/network/standalone/README.md +212 -212
  84. package/src/architecture/network/stats/README.md +84 -84
  85. package/src/architecture/network/topology/README.md +465 -465
  86. package/src/architecture/network/training/README.md +200 -200
  87. package/src/architecture/node/README.md +5 -5
  88. package/src/architecture/nodePool/README.md +14 -14
  89. package/src/methods/README.md +99 -99
  90. package/src/methods/activation/README.md +189 -189
  91. package/src/methods/cost/README.md +131 -131
  92. package/src/methods/rate/README.md +86 -86
  93. package/src/multithreading/README.md +77 -77
  94. package/src/multithreading/workers/browser/README.md +8 -8
  95. package/src/multithreading/workers/node/README.md +8 -8
  96. package/src/neat/README.md +148 -148
  97. package/src/neat/adaptive/README.md +120 -120
  98. package/src/neat/adaptive/acceptance/README.md +40 -40
  99. package/src/neat/adaptive/complexity/README.md +137 -137
  100. package/src/neat/adaptive/core/README.md +197 -197
  101. package/src/neat/adaptive/lineage/README.md +90 -90
  102. package/src/neat/adaptive/mutation/README.md +284 -284
  103. package/src/neat/compat/README.md +43 -43
  104. package/src/neat/compat/core/README.md +90 -90
  105. package/src/neat/diversity/README.md +35 -35
  106. package/src/neat/diversity/core/README.md +88 -88
  107. package/src/neat/evaluate/README.md +85 -85
  108. package/src/neat/evaluate/auto-distance/README.md +75 -75
  109. package/src/neat/evaluate/entropy-compat/README.md +37 -37
  110. package/src/neat/evaluate/entropy-sharing/README.md +43 -43
  111. package/src/neat/evaluate/fitness/README.md +23 -23
  112. package/src/neat/evaluate/novelty/README.md +120 -120
  113. package/src/neat/evaluate/objectives/README.md +17 -17
  114. package/src/neat/evaluate/shared/README.md +94 -94
  115. package/src/neat/evolve/README.md +96 -96
  116. package/src/neat/evolve/adaptive/README.md +60 -60
  117. package/src/neat/evolve/objectives/README.md +63 -63
  118. package/src/neat/evolve/offspring/README.md +56 -56
  119. package/src/neat/evolve/population/README.md +171 -171
  120. package/src/neat/evolve/runtime/README.md +79 -79
  121. package/src/neat/evolve/speciation/README.md +74 -74
  122. package/src/neat/evolve/warnings/README.md +10 -10
  123. package/src/neat/export/README.md +114 -114
  124. package/src/neat/helpers/README.md +50 -50
  125. package/src/neat/init/README.md +9 -9
  126. package/src/neat/lineage/core/README.md +101 -101
  127. package/src/neat/multiobjective/category/README.md +74 -74
  128. package/src/neat/multiobjective/crowding/README.md +272 -272
  129. package/src/neat/multiobjective/dominance/README.md +171 -171
  130. package/src/neat/multiobjective/fronts/README.md +68 -68
  131. package/src/neat/multiobjective/metrics/README.md +43 -43
  132. package/src/neat/multiobjective/objectives/README.md +31 -31
  133. package/src/neat/multiobjective/shared/README.md +27 -27
  134. package/src/neat/mutation/README.md +97 -97
  135. package/src/neat/mutation/add-conn/README.md +115 -115
  136. package/src/neat/mutation/add-node/README.md +126 -126
  137. package/src/neat/mutation/flow/README.md +149 -149
  138. package/src/neat/mutation/repair/README.md +185 -185
  139. package/src/neat/mutation/select/README.md +117 -117
  140. package/src/neat/mutation/shared/README.md +32 -32
  141. package/src/neat/objectives/README.md +25 -25
  142. package/src/neat/objectives/core/README.md +67 -67
  143. package/src/neat/pruning/README.md +40 -40
  144. package/src/neat/pruning/core/README.md +171 -171
  145. package/src/neat/pruning/facade/README.md +32 -32
  146. package/src/neat/rng/README.md +104 -104
  147. package/src/neat/rng/core/README.md +137 -137
  148. package/src/neat/rng/facade/README.md +50 -50
  149. package/src/neat/selection/README.md +111 -111
  150. package/src/neat/selection/core/README.md +227 -227
  151. package/src/neat/selection/facade/README.md +61 -61
  152. package/src/neat/shared/README.md +163 -163
  153. package/src/neat/speciation/README.md +31 -31
  154. package/src/neat/speciation/threshold/README.md +35 -35
  155. package/src/neat/species/README.md +25 -25
  156. package/src/neat/species/core/README.md +20 -20
  157. package/src/neat/species/core/shared/README.md +18 -18
  158. package/src/neat/species/history/context/README.md +22 -22
  159. package/src/neat/telemetry/accessors/README.md +58 -58
  160. package/src/neat/telemetry/exports/README.md +233 -233
  161. package/src/neat/telemetry/facade/README.md +252 -252
  162. package/src/neat/telemetry/facade/archive/README.md +57 -57
  163. package/src/neat/telemetry/facade/buffer/README.md +43 -43
  164. package/src/neat/telemetry/facade/lineage/README.md +12 -12
  165. package/src/neat/telemetry/facade/objectives/README.md +44 -44
  166. package/src/neat/telemetry/facade/runtime/README.md +26 -26
  167. package/src/neat/telemetry/facade/species/README.md +27 -27
  168. package/src/neat/telemetry/metrics/README.md +696 -696
  169. package/src/neat/telemetry/recorder/README.md +57 -57
  170. package/src/neat/telemetry/types/README.md +32 -32
  171. package/src/neat/topology-intent/README.md +75 -75
  172. package/src/utils/README.md +193 -193
  173. package/test/examples/asciiMaze/browser-entry/README.md +92 -92
  174. package/test/examples/asciiMaze/dashboardManager/README.md +109 -109
  175. package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +28 -28
  176. package/test/examples/asciiMaze/evolutionEngine/README.md +1527 -1527
  177. package/test/examples/asciiMaze/mazeMovement/README.md +105 -105
  178. package/test/examples/asciiMaze/mazeMovement/finalization/README.md +16 -16
  179. package/test/examples/asciiMaze/mazeMovement/policy/README.md +57 -57
  180. package/test/examples/asciiMaze/mazeMovement/runtime/README.md +52 -52
  181. package/test/examples/asciiMaze/mazeMovement/shaping/README.md +46 -46
  182. package/test/examples/flappy_bird/browser-entry/README.md +508 -508
  183. package/test/examples/flappy_bird/browser-entry/host/README.md +101 -101
  184. package/test/examples/flappy_bird/browser-entry/host/resize/README.md +144 -144
  185. package/test/examples/flappy_bird/browser-entry/network-view/README.md +194 -194
  186. package/test/examples/flappy_bird/browser-entry/playback/README.md +278 -278
  187. package/test/examples/flappy_bird/browser-entry/playback/background/README.md +129 -129
  188. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +502 -502
  189. package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +139 -139
  190. package/test/examples/flappy_bird/browser-entry/playback/snapshot/README.md +10 -10
  191. package/test/examples/flappy_bird/browser-entry/playback/trail/README.md +43 -43
  192. package/test/examples/flappy_bird/browser-entry/playback/worker-channel/README.md +30 -30
  193. package/test/examples/flappy_bird/browser-entry/runtime/README.md +59 -59
  194. package/test/examples/flappy_bird/browser-entry/visualization/README.md +276 -276
  195. package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +16 -16
  196. package/test/examples/flappy_bird/constants/README.md +1070 -1070
  197. package/test/examples/flappy_bird/environment/README.md +22 -22
  198. package/test/examples/flappy_bird/evaluation/README.md +32 -32
  199. package/test/examples/flappy_bird/evaluation/rollout/README.md +141 -141
  200. package/test/examples/flappy_bird/flappy-evolution-worker/README.md +425 -425
  201. package/test/examples/flappy_bird/simulation-shared/README.md +170 -170
  202. package/test/examples/flappy_bird/simulation-shared/observation/README.md +109 -109
  203. package/test/examples/flappy_bird/trainer/README.md +325 -325
  204. package/test/examples/flappy_bird/trainer/evaluation/README.md +74 -74
  205. package/scripts/analyze-trace.ts +0 -590
  206. package/scripts/copy-examples.mjs +0 -114
  207. package/scripts/export-onnx.mjs +0 -86
  208. package/scripts/generate-bench-tables.mjs +0 -182
  209. package/scripts/generate-docs.ts +0 -2900
  210. package/scripts/write-dist-docs-pkg.mjs +0 -16
@@ -43,207 +43,196 @@ test can inspect the recorded state without reaching into controller internals.
43
43
 
44
44
  ## neat/telemetry/facade/telemetry.facade.ts
45
45
 
46
- ### getObjectiveKeys
46
+ ### clearParetoArchive
47
47
 
48
48
  ```ts
49
- getObjectiveKeys(
49
+ clearParetoArchive(
50
50
  host: NeatTelemetryFacadeHost,
51
- ): string[]
51
+ ): void
52
52
  ```
53
53
 
54
- Return just the registered objective keys in stable order.
54
+ Clear the Pareto archive metadata stored on the host.
55
55
 
56
- This is the shortest inspection surface for tests and quick diagnostics that
57
- only need to confirm which objectives are active, not the full descriptor
58
- payload.
56
+ Use this when multi-objective inspection should restart from a clean archive
57
+ window, for example between experiments or before capturing a focused new
58
+ frontier snapshot.
59
59
 
60
60
  Parameters:
61
- - `host` - - `Neat` instance exposing objective descriptors.
61
+ - `host` - - `Neat` instance whose Pareto archive should be emptied.
62
62
 
63
- Returns: Ordered list of active objective keys.
63
+ Returns: Nothing. The archive buffer is reset in place.
64
64
 
65
- ### getTelemetry
65
+ ### clearTelemetry
66
66
 
67
67
  ```ts
68
- getTelemetry(
68
+ clearTelemetry(
69
69
  host: NeatTelemetryFacadeHost,
70
- ): TelemetryEntry[]
70
+ ): void
71
71
  ```
72
72
 
73
- Return the in-memory telemetry buffer.
73
+ Clear cached telemetry entries.
74
74
 
75
- This is the fastest way to inspect the recent rhythm of a run: score trends,
76
- diversity changes, objective snapshots, and timing evidence exactly as they
77
- were recorded generation by generation.
75
+ Use this when you want a fresh observation window without restarting the run.
76
+ It is especially useful in notebooks, UI sessions, or targeted experiments
77
+ where older telemetry would otherwise drown out the next few generations.
78
78
 
79
79
  Parameters:
80
- - `host` - - `Neat` instance storing generation telemetry snapshots.
81
-
82
- Returns: Telemetry entries captured so far, or an empty array when telemetry
83
- is not initialized.
84
-
85
- Example:
80
+ - `host` - - `Neat` instance whose telemetry buffer should be reset.
86
81
 
87
- const telemetryWindow = getTelemetry(neat).slice(-5);
88
- console.table(telemetryWindow.map((entry) => ({
89
- generation: entry.generation,
90
- bestScore: entry.bestScore,
91
- species: entry.species,
92
- })));
82
+ Returns: Nothing. The helper mutates the host buffer in place.
93
83
 
94
- ### exportTelemetryJSONL
84
+ ### clearTelemetryObjectives
95
85
 
96
86
  ```ts
97
- exportTelemetryJSONL(
87
+ clearTelemetryObjectives(
98
88
  host: NeatTelemetryFacadeHost,
99
- ): string
89
+ ): void
100
90
  ```
101
91
 
102
- Export telemetry as JSON Lines so logs can stream into files or post-processors.
92
+ Remove all registered custom objectives so only the default objective path remains.
103
93
 
104
- JSONL is the most automation-friendly telemetry surface: one entry per line,
105
- easy to append to a file, easy to pipe into scripts, and stable enough for
106
- notebook or CLI post-processing.
94
+ Read this as the reset companion to {@link registerTelemetryObjective}. It is
95
+ useful when one inspection session temporarily added custom objectives and the
96
+ caller wants to return the controller to its simpler baseline objective view.
107
97
 
108
98
  Parameters:
109
- - `host` - - `Neat` instance whose telemetry buffer should be serialized.
99
+ - `host` - - `Neat` instance whose objective registry should be cleared.
110
100
 
111
- Returns: JSONL payload with one telemetry object per line.
101
+ Returns: Nothing. The helper mutates the objective registry in place.
112
102
 
113
- ### exportTelemetryCSV
103
+ ### exportParetoFrontJSONL
114
104
 
115
105
  ```ts
116
- exportTelemetryCSV(
106
+ exportParetoFrontJSONL(
117
107
  host: NeatTelemetryFacadeHost,
118
- maxEntries: number,
108
+ maxEntries: number | undefined,
119
109
  ): string
120
110
  ```
121
111
 
122
- Export recent telemetry entries as CSV for quick spreadsheet inspection.
112
+ Export recent Pareto archive entries as JSON Lines.
123
113
 
124
- Prefer this when the reader is a person scanning a table instead of a script
125
- parsing nested JSON. The helper intentionally focuses on a recent window so a
126
- long run can still produce a compact worksheet.
114
+ Use this when the archive needs to leave the controller for offline analysis,
115
+ regression fixtures, or notebook-driven frontier inspection. Compared with
116
+ `getParetoArchive()`, the emphasis here is portability rather than immediate
117
+ in-memory inspection.
127
118
 
128
119
  Parameters:
129
- - `host` - - `Neat` instance whose telemetry buffer should be exported.
130
- - `maxEntries` - - Maximum number of recent entries to include.
131
-
132
- Returns: CSV string containing the requested telemetry window.
133
-
134
- Example:
120
+ - `host` - - `Neat` instance storing Pareto objective snapshots.
121
+ - `maxEntries` - - Maximum number of entries to serialize.
135
122
 
136
- const csv = exportTelemetryCSV(neat, 100);
137
- console.log(csv.split('\n').slice(0, 3).join('\n'));
123
+ Returns: JSONL payload for recent Pareto archive entries.
138
124
 
139
- ### clearTelemetry
125
+ ### exportSpeciesHistoryCSV
140
126
 
141
127
  ```ts
142
- clearTelemetry(
128
+ exportSpeciesHistoryCSV(
143
129
  host: NeatTelemetryFacadeHost,
144
- ): void
130
+ maxEntries: number,
131
+ ): string
145
132
  ```
146
133
 
147
- Clear cached telemetry entries.
134
+ Export species history as CSV rows.
148
135
 
149
- Use this when you want a fresh observation window without restarting the run.
150
- It is especially useful in notebooks, UI sessions, or targeted experiments
151
- where older telemetry would otherwise drown out the next few generations.
136
+ Prefer this when the reader is a person first and a program second. CSV is
137
+ the quickest path from species history into spreadsheets, ad-hoc inspection,
138
+ or lightweight experiment notes.
152
139
 
153
140
  Parameters:
154
- - `host` - - `Neat` instance whose telemetry buffer should be reset.
141
+ - `host` - - `Neat` instance whose species history should be exported.
142
+ - `maxEntries` - - Maximum number of recent history entries to include.
155
143
 
156
- Returns: Nothing. The helper mutates the host buffer in place.
144
+ Returns: CSV payload for offline species analysis.
157
145
 
158
- ### getObjectives
146
+ ### exportSpeciesHistoryJSONL
159
147
 
160
148
  ```ts
161
- getObjectives(
149
+ exportSpeciesHistoryJSONL(
162
150
  host: NeatTelemetryFacadeHost,
163
- ): { key: string; direction: "max" | "min"; }[]
151
+ maxEntries: number,
152
+ ): string
164
153
  ```
165
154
 
166
- Return a compact view of active objective descriptors.
155
+ Export species history as JSON Lines.
167
156
 
168
- The full objective descriptor includes accessors and internal metadata. This
169
- read model trims that down to the pieces most useful in UI surfaces and
170
- debugging output: the key and whether the objective is minimized or
171
- maximized.
157
+ Prefer this when the next consumer is a script, notebook, or append-friendly
158
+ file sink. JSONL keeps each generation independently parseable while still
159
+ preserving the richer row structure that CSV flattens away.
172
160
 
173
161
  Parameters:
174
- - `host` - - `Neat` instance exposing objective descriptors.
175
-
176
- Returns: Compact objective summaries in evaluation order.
177
-
178
- Example:
162
+ - `host` - - `Neat` instance whose species history should be serialized.
163
+ - `maxEntries` - - Maximum number of recent history entries to include.
179
164
 
180
- const objectives = getObjectives(neat);
181
- console.table(objectives);
165
+ Returns: JSONL payload describing recent species history snapshots.
182
166
 
183
- ### registerTelemetryObjective
167
+ ### exportTelemetryCSV
184
168
 
185
169
  ```ts
186
- registerTelemetryObjective(
170
+ exportTelemetryCSV(
187
171
  host: NeatTelemetryFacadeHost,
188
- key: string,
189
- direction: "max" | "min",
190
- accessor: (genome: default) => number,
191
- ): void
172
+ maxEntries: number,
173
+ ): string
192
174
  ```
193
175
 
194
- Register or replace a custom objective.
176
+ Export recent telemetry entries as CSV for quick spreadsheet inspection.
195
177
 
196
- This is the facade's write-side escape hatch for objective inspection flows.
197
- Use it when a dashboard, script, or experiment wants the telemetry and
198
- archive surfaces to start tracking a new tradeoff dimension without dropping
199
- into the lower-level objective modules first.
178
+ Prefer this when the reader is a person scanning a table instead of a script
179
+ parsing nested JSON. The helper intentionally focuses on a recent window so a
180
+ long run can still produce a compact worksheet.
200
181
 
201
182
  Parameters:
202
- - `host` - - `Neat` instance whose multi-objective registry should change.
203
- - `key` - - Unique objective key.
204
- - `direction` - - Whether lower or higher values are considered better.
205
- - `accessor` - - Function that reads the objective value from a genome.
183
+ - `host` - - `Neat` instance whose telemetry buffer should be exported.
184
+ - `maxEntries` - - Maximum number of recent entries to include.
206
185
 
207
- Returns: Nothing. The objective registry on `host` is updated in place.
186
+ Returns: CSV string containing the requested telemetry window.
208
187
 
209
- ### clearTelemetryObjectives
188
+ Example:
189
+
190
+ const csv = exportTelemetryCSV(neat, 100);
191
+ console.log(csv.split('\n').slice(0, 3).join('\n'));
192
+
193
+ ### exportTelemetryJSONL
210
194
 
211
195
  ```ts
212
- clearTelemetryObjectives(
196
+ exportTelemetryJSONL(
213
197
  host: NeatTelemetryFacadeHost,
214
- ): void
198
+ ): string
215
199
  ```
216
200
 
217
- Remove all registered custom objectives so only the default objective path remains.
201
+ Export telemetry as JSON Lines so logs can stream into files or post-processors.
218
202
 
219
- Read this as the reset companion to {@link registerTelemetryObjective}. It is
220
- useful when one inspection session temporarily added custom objectives and the
221
- caller wants to return the controller to its simpler baseline objective view.
203
+ JSONL is the most automation-friendly telemetry surface: one entry per line,
204
+ easy to append to a file, easy to pipe into scripts, and stable enough for
205
+ notebook or CLI post-processing.
222
206
 
223
207
  Parameters:
224
- - `host` - - `Neat` instance whose objective registry should be cleared.
208
+ - `host` - - `Neat` instance whose telemetry buffer should be serialized.
225
209
 
226
- Returns: Nothing. The helper mutates the objective registry in place.
210
+ Returns: JSONL payload with one telemetry object per line.
227
211
 
228
- ### getObjectiveEvents
212
+ ### getDiversityStats
229
213
 
230
214
  ```ts
231
- getObjectiveEvents(
215
+ getDiversityStats(
232
216
  host: NeatTelemetryFacadeHost,
233
- ): { gen: number; type: "add" | "remove"; key: string; }[]
217
+ ): DiversityStats
234
218
  ```
235
219
 
236
- Snapshot recent objective add/remove events for telemetry consumers.
220
+ Return cached diversity metrics, computing a fallback snapshot when needed.
237
221
 
238
- This gives read-side tooling a lightweight history of objective churn without
239
- forcing it to replay the full controller lifecycle. Use it when the question
240
- is "when did the objective set change?" rather than "what are the active
241
- objectives right now?"
222
+ This keeps the public facade resilient: callers can always ask for diversity
223
+ stats even before a full metrics pass has run.
224
+ The resulting snapshot is especially useful when you need to judge whether a
225
+ run is still exploring many structural alternatives or converging too hard.
242
226
 
243
227
  Parameters:
244
- - `host` - - `Neat` instance storing objective lifecycle events.
228
+ - `host` - - `Neat` instance exposing cached diversity state.
245
229
 
246
- Returns: Shallow copy of the recorded objective events.
230
+ Returns: Diversity metrics for the current population.
231
+
232
+ Example:
233
+
234
+ const diversity = getDiversityStats(neat);
235
+ console.log(diversity.structuralEntropy, diversity.uniqueStructures);
247
236
 
248
237
  ### getLineageSnapshot
249
238
 
@@ -270,136 +259,110 @@ Parameters:
270
259
 
271
260
  Returns: Array of `{ id, parents }` lineage entries.
272
261
 
273
- ### exportSpeciesHistoryCSV
262
+ ### getMultiObjectiveMetrics
274
263
 
275
264
  ```ts
276
- exportSpeciesHistoryCSV(
265
+ getMultiObjectiveMetrics(
277
266
  host: NeatTelemetryFacadeHost,
278
- maxEntries: number,
279
- ): string
267
+ ): { rank: number; crowding: number; score: number; nodes: number; connections: number; }[]
280
268
  ```
281
269
 
282
- Export species history as CSV rows.
270
+ Build compact multi-objective metrics for the current population snapshot.
283
271
 
284
- Prefer this when the reader is a person first and a program second. CSV is
285
- the quickest path from species history into spreadsheets, ad-hoc inspection,
286
- or lightweight experiment notes.
272
+ This helper is meant for inspection surfaces that need the shape of the
273
+ current Pareto landscape without pulling every genome field into view.
274
+
275
+ Read it as the facade's tradeoff-summary helper: enough information to see
276
+ rank layers, crowding pressure, and rough structural size, but not so much
277
+ detail that dashboards or quick diagnostics have to unpack whole genomes.
287
278
 
288
279
  Parameters:
289
- - `host` - - `Neat` instance whose species history should be exported.
290
- - `maxEntries` - - Maximum number of recent history entries to include.
280
+ - `host` - - `Neat` instance whose population should be summarized.
291
281
 
292
- Returns: CSV payload for offline species analysis.
282
+ Returns: Rank, crowding, score, and size metrics per genome.
293
283
 
294
- ### exportSpeciesHistoryJSONL
284
+ ### getNoveltyArchiveSize
295
285
 
296
286
  ```ts
297
- exportSpeciesHistoryJSONL(
287
+ getNoveltyArchiveSize(
298
288
  host: NeatTelemetryFacadeHost,
299
- maxEntries: number,
300
- ): string
289
+ ): number
301
290
  ```
302
291
 
303
- Export species history as JSON Lines.
292
+ Return the current novelty archive size.
304
293
 
305
- Prefer this when the next consumer is a script, notebook, or append-friendly
306
- file sink. JSONL keeps each generation independently parseable while still
307
- preserving the richer row structure that CSV flattens away.
294
+ This is the smallest novelty-health read in the facade. Use it when you do
295
+ not need descriptor payloads, only a quick sense of whether novelty search is
296
+ still collecting distinct behaviors or has gone quiet.
308
297
 
309
298
  Parameters:
310
- - `host` - - `Neat` instance whose species history should be serialized.
311
- - `maxEntries` - - Maximum number of recent history entries to include.
299
+ - `host` - - `Neat` instance tracking novelty behavior descriptors.
312
300
 
313
- Returns: JSONL payload describing recent species history snapshots.
301
+ Returns: Number of archived novelty descriptors.
314
302
 
315
- ### getSpeciesStats
303
+ ### getObjectiveEvents
316
304
 
317
305
  ```ts
318
- getSpeciesStats(
306
+ getObjectiveEvents(
319
307
  host: NeatTelemetryFacadeHost,
320
- ): { id: number; size: number; bestScore: number; lastImproved: number; }[]
308
+ ): { gen: number; type: "add" | "remove"; key: string; }[]
321
309
  ```
322
310
 
323
- Return a concise summary for each current species.
311
+ Snapshot recent objective add/remove events for telemetry consumers.
324
312
 
325
- This is the fastest species-level diagnostic when you want to see whether the
326
- population is still split across several improving families or collapsing
327
- toward one dominant cluster.
313
+ This gives read-side tooling a lightweight history of objective churn without
314
+ forcing it to replay the full controller lifecycle. Use it when the question
315
+ is "when did the objective set change?" rather than "what are the active
316
+ objectives right now?"
328
317
 
329
318
  Parameters:
330
- - `host` - - `Neat` instance whose live species registry should be summarized.
331
-
332
- Returns: Array of current species summaries.
333
-
334
- Example:
319
+ - `host` - - `Neat` instance storing objective lifecycle events.
335
320
 
336
- const speciesSummary = getSpeciesStats(neat);
337
- console.table(speciesSummary);
321
+ Returns: Shallow copy of the recorded objective events.
338
322
 
339
- ### getSpeciesHistory
323
+ ### getObjectiveKeys
340
324
 
341
325
  ```ts
342
- getSpeciesHistory(
326
+ getObjectiveKeys(
343
327
  host: NeatTelemetryFacadeHost,
344
- ): SpeciesHistoryEntry[]
328
+ ): string[]
345
329
  ```
346
330
 
347
- Return recorded species history, lazily backfilling extended metrics when enabled.
331
+ Return just the registered objective keys in stable order.
348
332
 
349
- Use this when you need the story across generations rather than the current
350
- snapshot. It is the better surface for plots, regressions, and post-run
351
- analysis of stagnation or speciation churn.
333
+ This is the shortest inspection surface for tests and quick diagnostics that
334
+ only need to confirm which objectives are active, not the full descriptor
335
+ payload.
352
336
 
353
337
  Parameters:
354
- - `host` - - `Neat` instance storing species history snapshots.
355
-
356
- Returns: Historical species entries for each recorded generation.
357
-
358
- Example:
338
+ - `host` - - `Neat` instance exposing objective descriptors.
359
339
 
360
- const historyWindow = getSpeciesHistory(neat).slice(-10);
361
- console.log(historyWindow.length);
340
+ Returns: Ordered list of active objective keys.
362
341
 
363
- ### getNoveltyArchiveSize
342
+ ### getObjectives
364
343
 
365
344
  ```ts
366
- getNoveltyArchiveSize(
345
+ getObjectives(
367
346
  host: NeatTelemetryFacadeHost,
368
- ): number
347
+ ): { key: string; direction: "max" | "min"; }[]
369
348
  ```
370
349
 
371
- Return the current novelty archive size.
350
+ Return a compact view of active objective descriptors.
372
351
 
373
- This is the smallest novelty-health read in the facade. Use it when you do
374
- not need descriptor payloads, only a quick sense of whether novelty search is
375
- still collecting distinct behaviors or has gone quiet.
352
+ The full objective descriptor includes accessors and internal metadata. This
353
+ read model trims that down to the pieces most useful in UI surfaces and
354
+ debugging output: the key and whether the objective is minimized or
355
+ maximized.
376
356
 
377
357
  Parameters:
378
- - `host` - - `Neat` instance tracking novelty behavior descriptors.
379
-
380
- Returns: Number of archived novelty descriptors.
381
-
382
- ### getMultiObjectiveMetrics
383
-
384
- ```ts
385
- getMultiObjectiveMetrics(
386
- host: NeatTelemetryFacadeHost,
387
- ): { rank: number; crowding: number; score: number; nodes: number; connections: number; }[]
388
- ```
389
-
390
- Build compact multi-objective metrics for the current population snapshot.
391
-
392
- This helper is meant for inspection surfaces that need the shape of the
393
- current Pareto landscape without pulling every genome field into view.
358
+ - `host` - - `Neat` instance exposing objective descriptors.
394
359
 
395
- Read it as the facade's tradeoff-summary helper: enough information to see
396
- rank layers, crowding pressure, and rough structural size, but not so much
397
- detail that dashboards or quick diagnostics have to unpack whole genomes.
360
+ Returns: Compact objective summaries in evaluation order.
398
361
 
399
- Parameters:
400
- - `host` - - `Neat` instance whose population should be summarized.
362
+ Example:
401
363
 
402
- Returns: Rank, crowding, score, and size metrics per genome.
364
+ const objectives = getObjectives(neat);
365
+ console.table(objectives);
403
366
 
404
367
  ### getOperatorStats
405
368
 
@@ -420,27 +383,6 @@ Parameters:
420
383
 
421
384
  Returns: Operator summaries suitable for dashboards and debugging.
422
385
 
423
- ### getParetoFronts
424
-
425
- ```ts
426
- getParetoFronts(
427
- host: NeatTelemetryFacadeHost,
428
- maxFronts: number | undefined,
429
- ): default[][]
430
- ```
431
-
432
- Reconstruct Pareto fronts from current rank annotations.
433
-
434
- Use this when the question is structural rather than historical: which fronts
435
- exist right now, and how many genomes are sitting on each layer of the
436
- current tradeoff surface?
437
-
438
- Parameters:
439
- - `host` - - `Neat` instance whose population should be partitioned.
440
- - `maxFronts` - - Maximum number of fronts to reconstruct.
441
-
442
- Returns: Pareto fronts ordered from best to worst.
443
-
444
386
  ### getParetoArchive
445
387
 
446
388
  ```ts
@@ -463,27 +405,26 @@ Parameters:
463
405
 
464
406
  Returns: Slice of the recent Pareto archive.
465
407
 
466
- ### exportParetoFrontJSONL
408
+ ### getParetoFronts
467
409
 
468
410
  ```ts
469
- exportParetoFrontJSONL(
411
+ getParetoFronts(
470
412
  host: NeatTelemetryFacadeHost,
471
- maxEntries: number | undefined,
472
- ): string
413
+ maxFronts: number | undefined,
414
+ ): default[][]
473
415
  ```
474
416
 
475
- Export recent Pareto archive entries as JSON Lines.
417
+ Reconstruct Pareto fronts from current rank annotations.
476
418
 
477
- Use this when the archive needs to leave the controller for offline analysis,
478
- regression fixtures, or notebook-driven frontier inspection. Compared with
479
- `getParetoArchive()`, the emphasis here is portability rather than immediate
480
- in-memory inspection.
419
+ Use this when the question is structural rather than historical: which fronts
420
+ exist right now, and how many genomes are sitting on each layer of the
421
+ current tradeoff surface?
481
422
 
482
423
  Parameters:
483
- - `host` - - `Neat` instance storing Pareto objective snapshots.
484
- - `maxEntries` - - Maximum number of entries to serialize.
424
+ - `host` - - `Neat` instance whose population should be partitioned.
425
+ - `maxFronts` - - Maximum number of fronts to reconstruct.
485
426
 
486
- Returns: JSONL payload for recent Pareto archive entries.
427
+ Returns: Pareto fronts ordered from best to worst.
487
428
 
488
429
  ### getPerformanceStats
489
430
 
@@ -508,67 +449,82 @@ Example:
508
449
  const timing = getPerformanceStats(neat);
509
450
  console.log(timing.lastEvalMs, timing.lastEvolveMs);
510
451
 
511
- ### getDiversityStats
452
+ ### getSpeciesHistory
512
453
 
513
454
  ```ts
514
- getDiversityStats(
455
+ getSpeciesHistory(
515
456
  host: NeatTelemetryFacadeHost,
516
- ): DiversityStats
457
+ ): SpeciesHistoryEntry[]
517
458
  ```
518
459
 
519
- Return cached diversity metrics, computing a fallback snapshot when needed.
460
+ Return recorded species history, lazily backfilling extended metrics when enabled.
520
461
 
521
- This keeps the public facade resilient: callers can always ask for diversity
522
- stats even before a full metrics pass has run.
523
- The resulting snapshot is especially useful when you need to judge whether a
524
- run is still exploring many structural alternatives or converging too hard.
462
+ Use this when you need the story across generations rather than the current
463
+ snapshot. It is the better surface for plots, regressions, and post-run
464
+ analysis of stagnation or speciation churn.
525
465
 
526
466
  Parameters:
527
- - `host` - - `Neat` instance exposing cached diversity state.
467
+ - `host` - - `Neat` instance storing species history snapshots.
528
468
 
529
- Returns: Diversity metrics for the current population.
469
+ Returns: Historical species entries for each recorded generation.
530
470
 
531
471
  Example:
532
472
 
533
- const diversity = getDiversityStats(neat);
534
- console.log(diversity.structuralEntropy, diversity.uniqueStructures);
473
+ const historyWindow = getSpeciesHistory(neat).slice(-10);
474
+ console.log(historyWindow.length);
535
475
 
536
- ### resetNoveltyArchive
476
+ ### getSpeciesStats
537
477
 
538
478
  ```ts
539
- resetNoveltyArchive(
479
+ getSpeciesStats(
540
480
  host: NeatTelemetryFacadeHost,
541
- ): void
481
+ ): { id: number; size: number; bestScore: number; lastImproved: number; }[]
542
482
  ```
543
483
 
544
- Clear the novelty archive.
484
+ Return a concise summary for each current species.
545
485
 
546
- This is useful when a caller wants to restart the novelty observation window
547
- without also resetting the rest of telemetry or the broader controller state.
486
+ This is the fastest species-level diagnostic when you want to see whether the
487
+ population is still split across several improving families or collapsing
488
+ toward one dominant cluster.
548
489
 
549
490
  Parameters:
550
- - `host` - - `Neat` instance whose novelty archive should be reset.
491
+ - `host` - - `Neat` instance whose live species registry should be summarized.
551
492
 
552
- Returns: Nothing. The archive is mutated in place.
493
+ Returns: Array of current species summaries.
553
494
 
554
- ### clearParetoArchive
495
+ Example:
496
+
497
+ const speciesSummary = getSpeciesStats(neat);
498
+ console.table(speciesSummary);
499
+
500
+ ### getTelemetry
555
501
 
556
502
  ```ts
557
- clearParetoArchive(
503
+ getTelemetry(
558
504
  host: NeatTelemetryFacadeHost,
559
- ): void
505
+ ): TelemetryEntry[]
560
506
  ```
561
507
 
562
- Clear the Pareto archive metadata stored on the host.
508
+ Return the in-memory telemetry buffer.
563
509
 
564
- Use this when multi-objective inspection should restart from a clean archive
565
- window, for example between experiments or before capturing a focused new
566
- frontier snapshot.
510
+ This is the fastest way to inspect the recent rhythm of a run: score trends,
511
+ diversity changes, objective snapshots, and timing evidence exactly as they
512
+ were recorded generation by generation.
567
513
 
568
514
  Parameters:
569
- - `host` - - `Neat` instance whose Pareto archive should be emptied.
515
+ - `host` - - `Neat` instance storing generation telemetry snapshots.
570
516
 
571
- Returns: Nothing. The archive buffer is reset in place.
517
+ Returns: Telemetry entries captured so far, or an empty array when telemetry
518
+ is not initialized.
519
+
520
+ Example:
521
+
522
+ const telemetryWindow = getTelemetry(neat).slice(-5);
523
+ console.table(telemetryWindow.map((entry) => ({
524
+ generation: entry.generation,
525
+ bestScore: entry.bestScore,
526
+ species: entry.species,
527
+ })));
572
528
 
573
529
  ### NeatTelemetryFacadeHost
574
530
 
@@ -580,3 +536,47 @@ read-heavy diagnostics and export helpers into one focused module without
580
536
  exposing the entire controller implementation. The host shape keeps the
581
537
  contract small: population snapshots, telemetry caches, objective accessors,
582
538
  and archive buffers.
539
+
540
+ ### registerTelemetryObjective
541
+
542
+ ```ts
543
+ registerTelemetryObjective(
544
+ host: NeatTelemetryFacadeHost,
545
+ key: string,
546
+ direction: "max" | "min",
547
+ accessor: (genome: default) => number,
548
+ ): void
549
+ ```
550
+
551
+ Register or replace a custom objective.
552
+
553
+ This is the facade's write-side escape hatch for objective inspection flows.
554
+ Use it when a dashboard, script, or experiment wants the telemetry and
555
+ archive surfaces to start tracking a new tradeoff dimension without dropping
556
+ into the lower-level objective modules first.
557
+
558
+ Parameters:
559
+ - `host` - - `Neat` instance whose multi-objective registry should change.
560
+ - `key` - - Unique objective key.
561
+ - `direction` - - Whether lower or higher values are considered better.
562
+ - `accessor` - - Function that reads the objective value from a genome.
563
+
564
+ Returns: Nothing. The objective registry on `host` is updated in place.
565
+
566
+ ### resetNoveltyArchive
567
+
568
+ ```ts
569
+ resetNoveltyArchive(
570
+ host: NeatTelemetryFacadeHost,
571
+ ): void
572
+ ```
573
+
574
+ Clear the novelty archive.
575
+
576
+ This is useful when a caller wants to restart the novelty observation window
577
+ without also resetting the rest of telemetry or the broader controller state.
578
+
579
+ Parameters:
580
+ - `host` - - `Neat` instance whose novelty archive should be reset.
581
+
582
+ Returns: Nothing. The archive is mutated in place.