@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.
- package/.github/copilot-instructions.md +11 -0
- package/.github/skills/trace-analyzer-extension/SKILL.md +3 -3
- package/.github/skills/trace-analyzer-extension/assets/extension-checklist.md +1 -1
- package/.github/skills/trace-analyzer-extension/references/analyzer-extension-workflow.md +1 -1
- package/.github/skills/trace-audit-reporting/SKILL.md +3 -3
- package/.github/skills/trace-audit-reporting/references/trace-analysis-workflow.md +1 -1
- package/package.json +19 -13
- package/plans/Flappy_Bird_Folder_Documentation_Pass.md +4 -4
- package/plans/README.md +24 -0
- package/plans/Roadmap.md +62 -40
- package/plans/analyze-trace-solid-split.plans.md +66 -0
- package/plans/architecture-solid-split.plans.md +9 -15
- package/plans/asciiMaze-typescript-repair.plans.md +1 -1
- package/plans/generate-docs-solid-split.plans.md +87 -0
- package/plans/methods-docs.plans.md +25 -1
- package/plans/methods-solid-split.plans.md +14 -14
- package/plans/neat-docs.plans.md +9 -1
- package/plans/neat-test-surface-repair.plans.md +1 -1
- package/plans/render-docs-html-solid-split.plans.md +68 -0
- package/plans/src-no-explicit-any-cleanup.plans.md +1 -1
- package/plans/utils-docs.plans.md +6 -1
- package/scripts/analyze-trace/analyze-trace.analysis.ts +479 -0
- package/scripts/analyze-trace/analyze-trace.constants.ts +35 -0
- package/scripts/analyze-trace/analyze-trace.io.ts +69 -0
- package/scripts/analyze-trace/analyze-trace.report.ts +100 -0
- package/scripts/analyze-trace/analyze-trace.shared.ts +116 -0
- package/scripts/analyze-trace/analyze-trace.ts +45 -0
- package/scripts/analyze-trace/analyze-trace.types.ts +72 -0
- package/scripts/assets/theme.css +80 -23
- package/scripts/copy-examples.ts +239 -0
- package/scripts/export-onnx.ts +223 -0
- package/scripts/generate-bench-tables.ts +378 -37
- package/scripts/generate-docs/generate-docs.constants.ts +107 -0
- package/scripts/generate-docs/generate-docs.order.ts +355 -0
- package/scripts/generate-docs/generate-docs.state.ts +31 -0
- package/scripts/generate-docs/generate-docs.targets.ts +165 -0
- package/scripts/generate-docs/generate-docs.ts +63 -0
- package/scripts/generate-docs/generate-docs.types.ts +112 -0
- package/scripts/generate-docs/output/generate-docs.output.folder-index.utils.ts +167 -0
- package/scripts/generate-docs/output/generate-docs.output.ordering.utils.ts +353 -0
- package/scripts/generate-docs/output/generate-docs.output.readme.utils.ts +420 -0
- package/scripts/generate-docs/output/generate-docs.output.ts +123 -0
- package/scripts/generate-docs/output/generate-docs.output.warnings.utils.ts +219 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.collection.utils.ts +365 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.jsdoc.utils.ts +373 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.normalize.utils.ts +155 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.render.utils.ts +149 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.signature.utils.ts +289 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.ts +11 -0
- package/scripts/mermaid-cli.mjs +102 -22
- package/scripts/mermaid-cli.ts +736 -0
- package/scripts/render-docs-html/render-docs-html.assets.ts +54 -0
- package/scripts/render-docs-html/render-docs-html.mermaid.ts +245 -0
- package/scripts/{render-docs-html.sidebar.ts → render-docs-html/render-docs-html.navigation.ts} +141 -144
- package/scripts/render-docs-html/render-docs-html.pages.ts +333 -0
- package/scripts/render-docs-html/render-docs-html.shared.ts +333 -0
- package/scripts/render-docs-html/render-docs-html.types.ts +42 -0
- package/scripts/render-docs-html.ts +23 -587
- package/scripts/run-docs.ts +238 -0
- package/scripts/write-dist-docs-pkg.ts +40 -0
- package/src/README.md +75 -75
- package/src/architecture/connection/README.md +5 -5
- package/src/architecture/layer/README.md +508 -508
- package/src/architecture/network/README.md +1458 -1458
- package/src/architecture/network/activate/README.md +694 -694
- package/src/architecture/network/bootstrap/README.md +77 -77
- package/src/architecture/network/connect/README.md +74 -74
- package/src/architecture/network/deterministic/README.md +135 -135
- package/src/architecture/network/evolve/README.md +364 -364
- package/src/architecture/network/gating/README.md +130 -130
- package/src/architecture/network/genetic/README.md +399 -399
- package/src/architecture/network/mutate/README.md +897 -897
- package/src/architecture/network/onnx/README.md +720 -720
- package/src/architecture/network/onnx/export/README.md +728 -728
- package/src/architecture/network/onnx/export/layers/README.md +450 -450
- package/src/architecture/network/onnx/import/README.md +618 -618
- package/src/architecture/network/onnx/schema/README.md +32 -32
- package/src/architecture/network/prune/README.md +245 -245
- package/src/architecture/network/remove/README.md +135 -135
- package/src/architecture/network/runtime/README.md +106 -106
- package/src/architecture/network/serialize/README.md +542 -542
- package/src/architecture/network/slab/README.md +608 -608
- package/src/architecture/network/standalone/README.md +212 -212
- package/src/architecture/network/stats/README.md +84 -84
- package/src/architecture/network/topology/README.md +465 -465
- package/src/architecture/network/training/README.md +200 -200
- package/src/architecture/node/README.md +5 -5
- package/src/architecture/nodePool/README.md +14 -14
- package/src/methods/README.md +99 -99
- package/src/methods/activation/README.md +189 -189
- package/src/methods/cost/README.md +131 -131
- package/src/methods/rate/README.md +86 -86
- package/src/multithreading/README.md +77 -77
- package/src/multithreading/workers/browser/README.md +8 -8
- package/src/multithreading/workers/node/README.md +8 -8
- package/src/neat/README.md +148 -148
- package/src/neat/adaptive/README.md +120 -120
- package/src/neat/adaptive/acceptance/README.md +40 -40
- package/src/neat/adaptive/complexity/README.md +137 -137
- package/src/neat/adaptive/core/README.md +197 -197
- package/src/neat/adaptive/lineage/README.md +90 -90
- package/src/neat/adaptive/mutation/README.md +284 -284
- package/src/neat/compat/README.md +43 -43
- package/src/neat/compat/core/README.md +90 -90
- package/src/neat/diversity/README.md +35 -35
- package/src/neat/diversity/core/README.md +88 -88
- package/src/neat/evaluate/README.md +85 -85
- package/src/neat/evaluate/auto-distance/README.md +75 -75
- package/src/neat/evaluate/entropy-compat/README.md +37 -37
- package/src/neat/evaluate/entropy-sharing/README.md +43 -43
- package/src/neat/evaluate/fitness/README.md +23 -23
- package/src/neat/evaluate/novelty/README.md +120 -120
- package/src/neat/evaluate/objectives/README.md +17 -17
- package/src/neat/evaluate/shared/README.md +94 -94
- package/src/neat/evolve/README.md +96 -96
- package/src/neat/evolve/adaptive/README.md +60 -60
- package/src/neat/evolve/objectives/README.md +63 -63
- package/src/neat/evolve/offspring/README.md +56 -56
- package/src/neat/evolve/population/README.md +171 -171
- package/src/neat/evolve/runtime/README.md +79 -79
- package/src/neat/evolve/speciation/README.md +74 -74
- package/src/neat/evolve/warnings/README.md +10 -10
- package/src/neat/export/README.md +114 -114
- package/src/neat/helpers/README.md +50 -50
- package/src/neat/init/README.md +9 -9
- package/src/neat/lineage/core/README.md +101 -101
- package/src/neat/multiobjective/category/README.md +74 -74
- package/src/neat/multiobjective/crowding/README.md +272 -272
- package/src/neat/multiobjective/dominance/README.md +171 -171
- package/src/neat/multiobjective/fronts/README.md +68 -68
- package/src/neat/multiobjective/metrics/README.md +43 -43
- package/src/neat/multiobjective/objectives/README.md +31 -31
- package/src/neat/multiobjective/shared/README.md +27 -27
- package/src/neat/mutation/README.md +97 -97
- package/src/neat/mutation/add-conn/README.md +115 -115
- package/src/neat/mutation/add-node/README.md +126 -126
- package/src/neat/mutation/flow/README.md +149 -149
- package/src/neat/mutation/repair/README.md +185 -185
- package/src/neat/mutation/select/README.md +117 -117
- package/src/neat/mutation/shared/README.md +32 -32
- package/src/neat/objectives/README.md +25 -25
- package/src/neat/objectives/core/README.md +67 -67
- package/src/neat/pruning/README.md +40 -40
- package/src/neat/pruning/core/README.md +171 -171
- package/src/neat/pruning/facade/README.md +32 -32
- package/src/neat/rng/README.md +104 -104
- package/src/neat/rng/core/README.md +137 -137
- package/src/neat/rng/facade/README.md +50 -50
- package/src/neat/selection/README.md +111 -111
- package/src/neat/selection/core/README.md +227 -227
- package/src/neat/selection/facade/README.md +61 -61
- package/src/neat/shared/README.md +163 -163
- package/src/neat/speciation/README.md +31 -31
- package/src/neat/speciation/threshold/README.md +35 -35
- package/src/neat/species/README.md +25 -25
- package/src/neat/species/core/README.md +20 -20
- package/src/neat/species/core/shared/README.md +18 -18
- package/src/neat/species/history/context/README.md +22 -22
- package/src/neat/telemetry/accessors/README.md +58 -58
- package/src/neat/telemetry/exports/README.md +233 -233
- package/src/neat/telemetry/facade/README.md +252 -252
- package/src/neat/telemetry/facade/archive/README.md +57 -57
- package/src/neat/telemetry/facade/buffer/README.md +43 -43
- package/src/neat/telemetry/facade/lineage/README.md +12 -12
- package/src/neat/telemetry/facade/objectives/README.md +44 -44
- package/src/neat/telemetry/facade/runtime/README.md +26 -26
- package/src/neat/telemetry/facade/species/README.md +27 -27
- package/src/neat/telemetry/metrics/README.md +696 -696
- package/src/neat/telemetry/recorder/README.md +57 -57
- package/src/neat/telemetry/types/README.md +32 -32
- package/src/neat/topology-intent/README.md +75 -75
- package/src/utils/README.md +193 -193
- package/test/examples/asciiMaze/browser-entry/README.md +92 -92
- package/test/examples/asciiMaze/dashboardManager/README.md +109 -109
- package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +28 -28
- package/test/examples/asciiMaze/evolutionEngine/README.md +1527 -1527
- package/test/examples/asciiMaze/mazeMovement/README.md +105 -105
- package/test/examples/asciiMaze/mazeMovement/finalization/README.md +16 -16
- package/test/examples/asciiMaze/mazeMovement/policy/README.md +57 -57
- package/test/examples/asciiMaze/mazeMovement/runtime/README.md +52 -52
- package/test/examples/asciiMaze/mazeMovement/shaping/README.md +46 -46
- package/test/examples/flappy_bird/browser-entry/README.md +508 -508
- package/test/examples/flappy_bird/browser-entry/host/README.md +101 -101
- package/test/examples/flappy_bird/browser-entry/host/resize/README.md +144 -144
- package/test/examples/flappy_bird/browser-entry/network-view/README.md +194 -194
- package/test/examples/flappy_bird/browser-entry/playback/README.md +278 -278
- package/test/examples/flappy_bird/browser-entry/playback/background/README.md +129 -129
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +502 -502
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +139 -139
- package/test/examples/flappy_bird/browser-entry/playback/snapshot/README.md +10 -10
- package/test/examples/flappy_bird/browser-entry/playback/trail/README.md +43 -43
- package/test/examples/flappy_bird/browser-entry/playback/worker-channel/README.md +30 -30
- package/test/examples/flappy_bird/browser-entry/runtime/README.md +59 -59
- package/test/examples/flappy_bird/browser-entry/visualization/README.md +276 -276
- package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +16 -16
- package/test/examples/flappy_bird/constants/README.md +1070 -1070
- package/test/examples/flappy_bird/environment/README.md +22 -22
- package/test/examples/flappy_bird/evaluation/README.md +32 -32
- package/test/examples/flappy_bird/evaluation/rollout/README.md +141 -141
- package/test/examples/flappy_bird/flappy-evolution-worker/README.md +425 -425
- package/test/examples/flappy_bird/simulation-shared/README.md +170 -170
- package/test/examples/flappy_bird/simulation-shared/observation/README.md +109 -109
- package/test/examples/flappy_bird/trainer/README.md +325 -325
- package/test/examples/flappy_bird/trainer/evaluation/README.md +74 -74
- package/scripts/analyze-trace.ts +0 -590
- package/scripts/copy-examples.mjs +0 -114
- package/scripts/export-onnx.mjs +0 -86
- package/scripts/generate-bench-tables.mjs +0 -182
- package/scripts/generate-docs.ts +0 -2900
- package/scripts/write-dist-docs-pkg.mjs +0 -16
|
@@ -42,28 +42,6 @@ A useful reading order is:
|
|
|
42
42
|
|
|
43
43
|
## neat/telemetry/recorder/telemetry.recorder.ts
|
|
44
44
|
|
|
45
|
-
### createTelemetryEntryBase
|
|
46
|
-
|
|
47
|
-
```ts
|
|
48
|
-
createTelemetryEntryBase(
|
|
49
|
-
generationIndex: number,
|
|
50
|
-
bestScore: number,
|
|
51
|
-
speciesCount: number,
|
|
52
|
-
): TelemetryEntry
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Create a strict baseline telemetry entry with required fields populated.
|
|
56
|
-
|
|
57
|
-
This helper centralizes defaults so downstream telemetry producers can
|
|
58
|
-
extend the entry while keeping the strict `TelemetryEntry` contract.
|
|
59
|
-
|
|
60
|
-
Parameters:
|
|
61
|
-
- `generationIndex` - Generation index for the telemetry snapshot.
|
|
62
|
-
- `bestScore` - Best fitness value observed in the generation.
|
|
63
|
-
- `speciesCount` - Number of extant species.
|
|
64
|
-
|
|
65
|
-
Returns: A strict telemetry entry with required fields populated.
|
|
66
|
-
|
|
67
45
|
### applyTelemetrySelect
|
|
68
46
|
|
|
69
47
|
```ts
|
|
@@ -92,33 +70,42 @@ neat._telemetrySelect = new Set(['diversity']);
|
|
|
92
70
|
applyTelemetrySelect.call(neat, entry);
|
|
93
71
|
```
|
|
94
72
|
|
|
95
|
-
###
|
|
73
|
+
### buildTelemetryEntry
|
|
96
74
|
|
|
97
75
|
```ts
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
):
|
|
76
|
+
buildTelemetryEntry(
|
|
77
|
+
fittest: Record<string, unknown>,
|
|
78
|
+
): TelemetryEntry
|
|
101
79
|
```
|
|
102
80
|
|
|
103
|
-
|
|
81
|
+
Build a comprehensive telemetry entry for the current generation.
|
|
104
82
|
|
|
105
|
-
This
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
83
|
+
This is the recorder's main orchestration surface. It gathers one coherent
|
|
84
|
+
explanation of the current generation by combining immediate state
|
|
85
|
+
(`generation`, `best`, `species`) with whichever optional evidence blocks the
|
|
86
|
+
controller has enabled: diversity, lineage, objective activity, Pareto-front
|
|
87
|
+
summaries, complexity growth, RNG state, and performance timing.
|
|
88
|
+
|
|
89
|
+
This function intentionally mirrors the legacy in-loop telemetry construction
|
|
90
|
+
to preserve behavior relied upon by tests and consumers.
|
|
109
91
|
|
|
110
92
|
Parameters:
|
|
111
|
-
- `
|
|
93
|
+
- `fittest` - - The currently fittest genome (used to report `best` score).
|
|
112
94
|
|
|
113
|
-
Returns: A
|
|
95
|
+
Returns: A TelemetryEntry object suitable for recording/streaming.
|
|
114
96
|
|
|
115
97
|
Example:
|
|
116
98
|
|
|
117
99
|
```ts
|
|
118
|
-
|
|
119
|
-
|
|
100
|
+
// build a telemetry snapshot for the current generation
|
|
101
|
+
const snapshot = neat.buildTelemetryEntry(neat.population[0]);
|
|
102
|
+
neat.recordTelemetryEntry(snapshot);
|
|
120
103
|
```
|
|
121
104
|
|
|
105
|
+
The function has two internal paths:
|
|
106
|
+
- multi-objective mode adds Pareto-front and hypervolume-oriented signals
|
|
107
|
+
- mono-objective mode keeps the payload smaller while preserving the same core fields
|
|
108
|
+
|
|
122
109
|
### computeDiversityStats
|
|
123
110
|
|
|
124
111
|
```ts
|
|
@@ -145,6 +132,28 @@ neat.computeDiversityStats();
|
|
|
145
132
|
console.log(neat._diversityStats.meanCompat);
|
|
146
133
|
```
|
|
147
134
|
|
|
135
|
+
### createTelemetryEntryBase
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
createTelemetryEntryBase(
|
|
139
|
+
generationIndex: number,
|
|
140
|
+
bestScore: number,
|
|
141
|
+
speciesCount: number,
|
|
142
|
+
): TelemetryEntry
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Create a strict baseline telemetry entry with required fields populated.
|
|
146
|
+
|
|
147
|
+
This helper centralizes defaults so downstream telemetry producers can
|
|
148
|
+
extend the entry while keeping the strict `TelemetryEntry` contract.
|
|
149
|
+
|
|
150
|
+
Parameters:
|
|
151
|
+
- `generationIndex` - Generation index for the telemetry snapshot.
|
|
152
|
+
- `bestScore` - Best fitness value observed in the generation.
|
|
153
|
+
- `speciesCount` - Number of extant species.
|
|
154
|
+
|
|
155
|
+
Returns: A strict telemetry entry with required fields populated.
|
|
156
|
+
|
|
148
157
|
### recordTelemetryEntry
|
|
149
158
|
|
|
150
159
|
```ts
|
|
@@ -178,42 +187,33 @@ Example:
|
|
|
178
187
|
neat.recordTelemetryEntry({ gen: neat.generation, best: neat.population[0].score });
|
|
179
188
|
```
|
|
180
189
|
|
|
181
|
-
###
|
|
190
|
+
### structuralEntropy
|
|
182
191
|
|
|
183
192
|
```ts
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
):
|
|
193
|
+
structuralEntropy(
|
|
194
|
+
graph: { [key: string]: unknown; nodes: { geneId: number; }[]; connections: { from: { geneId: number; }; to: { geneId: number; }; enabled: boolean; }[]; },
|
|
195
|
+
): number
|
|
187
196
|
```
|
|
188
197
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
This is the recorder's main orchestration surface. It gathers one coherent
|
|
192
|
-
explanation of the current generation by combining immediate state
|
|
193
|
-
(`generation`, `best`, `species`) with whichever optional evidence blocks the
|
|
194
|
-
controller has enabled: diversity, lineage, objective activity, Pareto-front
|
|
195
|
-
summaries, complexity growth, RNG state, and performance timing.
|
|
198
|
+
Lightweight proxy for structural entropy based on degree-distribution.
|
|
196
199
|
|
|
197
|
-
This function
|
|
198
|
-
|
|
200
|
+
This function computes an approximate entropy of a graph topology by
|
|
201
|
+
counting node degrees and computing the entropy of the degree histogram.
|
|
202
|
+
The result is cached on the graph object for the current generation in
|
|
203
|
+
`_entropyVal` to avoid repeated expensive recomputation.
|
|
199
204
|
|
|
200
205
|
Parameters:
|
|
201
|
-
- `
|
|
206
|
+
- `graph` - - A genome-like object with `nodes` and `connections` arrays.
|
|
202
207
|
|
|
203
|
-
Returns: A
|
|
208
|
+
Returns: A non-negative number approximating structural entropy.
|
|
204
209
|
|
|
205
210
|
Example:
|
|
206
211
|
|
|
207
212
|
```ts
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
neat.recordTelemetryEntry(snapshot);
|
|
213
|
+
const H = structuralEntropy.call(neat, genome);
|
|
214
|
+
console.log(`Structure entropy: ${H.toFixed(3)}`);
|
|
211
215
|
```
|
|
212
216
|
|
|
213
|
-
The function has two internal paths:
|
|
214
|
-
- multi-objective mode adds Pareto-front and hypervolume-oriented signals
|
|
215
|
-
- mono-objective mode keeps the payload smaller while preserving the same core fields
|
|
216
|
-
|
|
217
217
|
### TelemetryContext
|
|
218
218
|
|
|
219
219
|
Context view used within telemetry helpers to access optional internal
|
|
@@ -18,14 +18,29 @@ are narrow enough to stay telemetry-local.
|
|
|
18
18
|
|
|
19
19
|
## neat/telemetry/types/telemetry.types.ts
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### OperatorStatsMap
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Operator stats map shape for telemetry extraction.
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
Adaptive mutation telemetry records success and attempt counts per operator.
|
|
26
|
+
This map type names that contract so extraction helpers can stay specific
|
|
27
|
+
about what they read without depending on a broader controller class.
|
|
28
|
+
|
|
29
|
+
### TelemetryBufferContext
|
|
30
|
+
|
|
31
|
+
Minimal telemetry buffer context shape.
|
|
32
|
+
|
|
33
|
+
Runtime helpers only need a host that can expose or receive the in-memory
|
|
34
|
+
telemetry buffer. This tiny shape keeps those helpers reusable and easy to
|
|
35
|
+
test.
|
|
36
|
+
|
|
37
|
+
### TelemetryCoreFields
|
|
38
|
+
|
|
39
|
+
Core telemetry field keys used by selection helpers.
|
|
40
|
+
|
|
41
|
+
Some telemetry fields remain mandatory even when callers request a narrower
|
|
42
|
+
export or inspection surface. This alias documents that those core keys are
|
|
43
|
+
treated as a fixed protected set rather than arbitrary strings.
|
|
29
44
|
|
|
30
45
|
### TelemetryDiversityOptions
|
|
31
46
|
|
|
@@ -36,14 +51,6 @@ to the fields that matter for diversity-oriented telemetry decisions: whether
|
|
|
36
51
|
diversity metrics are enabled, how aggressively to sample in fast mode, and
|
|
37
52
|
which novelty-search defaults should influence telemetry output.
|
|
38
53
|
|
|
39
|
-
### TelemetryStreamOptions
|
|
40
|
-
|
|
41
|
-
Minimal telemetry stream options for streaming helpers.
|
|
42
|
-
|
|
43
|
-
The runtime layer only needs to know whether streaming is enabled and which
|
|
44
|
-
callback should receive each entry. This keeps the callback contract explicit
|
|
45
|
-
without forcing runtime helpers to depend on the entire controller option bag.
|
|
46
|
-
|
|
47
54
|
### TelemetryEntryRecord
|
|
48
55
|
|
|
49
56
|
Telemetry entry shape used for constructing snapshots.
|
|
@@ -52,21 +59,14 @@ Builders often need the strongly typed `TelemetryEntry` model plus temporary
|
|
|
52
59
|
access to additional dynamic fields while a snapshot is being assembled or
|
|
53
60
|
filtered. This alias keeps that construction-phase flexibility localized.
|
|
54
61
|
|
|
55
|
-
###
|
|
56
|
-
|
|
57
|
-
Operator stats map shape for telemetry extraction.
|
|
58
|
-
|
|
59
|
-
Adaptive mutation telemetry records success and attempt counts per operator.
|
|
60
|
-
This map type names that contract so extraction helpers can stay specific
|
|
61
|
-
about what they read without depending on a broader controller class.
|
|
62
|
-
|
|
63
|
-
### TelemetryBufferContext
|
|
62
|
+
### TelemetryGenome
|
|
64
63
|
|
|
65
|
-
Minimal
|
|
64
|
+
Minimal genome shape used by telemetry helpers.
|
|
66
65
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
Telemetry code rarely needs the entire `Network` surface. Most helpers only
|
|
67
|
+
care about structural size and a few optional lineage hints, so this type
|
|
68
|
+
captures the smallest genome contract needed for diversity, complexity, and
|
|
69
|
+
lineage-oriented telemetry work.
|
|
70
70
|
|
|
71
71
|
### TelemetrySelectContext
|
|
72
72
|
|
|
@@ -76,10 +76,10 @@ Selection helpers narrow telemetry entries to a configured subset of fields.
|
|
|
76
76
|
This context type names the single host capability they need: an optional set
|
|
77
77
|
of selected telemetry keys.
|
|
78
78
|
|
|
79
|
-
###
|
|
79
|
+
### TelemetryStreamOptions
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
Minimal telemetry stream options for streaming helpers.
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
The runtime layer only needs to know whether streaming is enabled and which
|
|
84
|
+
callback should receive each entry. This keeps the callback contract explicit
|
|
85
|
+
without forcing runtime helpers to depend on the entire controller option bag.
|
|
@@ -66,46 +66,61 @@ promoteGenomeToFeedForwardIntentWhenEligible(genome, shouldPromote);
|
|
|
66
66
|
|
|
67
67
|
## neat/topology-intent/neat.topology-intent.ts
|
|
68
68
|
|
|
69
|
-
###
|
|
69
|
+
### isGenomeEligibleForFeedForwardIntentPromotion
|
|
70
70
|
|
|
71
71
|
```ts
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
isGenomeEligibleForFeedForwardIntentPromotion(
|
|
73
|
+
genome: TopologyIntentGenome,
|
|
74
74
|
): boolean
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
Check whether a genome can safely adopt feed-forward topology intent.
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
Eligibility is intentionally conservative: the graph must already be free of
|
|
80
|
+
gates and self-connections, and every normal connection must follow the
|
|
81
|
+
current node ordering. This keeps the helper focused on preserving an
|
|
82
|
+
already-feed-forward structure instead of rewriting arbitrary graphs into a
|
|
83
|
+
different interpretation.
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
mutation semantics while still holding seed genomes whose current graphs are
|
|
88
|
-
recurrent, gated, or otherwise not yet eligible for the stricter runtime
|
|
89
|
-
contract.
|
|
85
|
+
The helper therefore answers a structural-preservation question, not a graph
|
|
86
|
+
repair question. A `false` result does not mean the genome is invalid. It
|
|
87
|
+
means only that this bridge should not relabel it as feed-forward yet.
|
|
90
88
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
This distinction is the chapter's core invariant. The helper is intentionally
|
|
90
|
+
willing to say "not yet" to valid genomes, because false positives would be
|
|
91
|
+
worse than conservative misses at this boundary.
|
|
94
92
|
|
|
95
93
|
Parameters:
|
|
96
|
-
- `
|
|
94
|
+
- `genome` - Genome candidate.
|
|
97
95
|
|
|
98
|
-
Returns: True when the
|
|
96
|
+
Returns: True when the genome can safely adopt feed-forward intent.
|
|
99
97
|
|
|
100
|
-
|
|
98
|
+
### matchesCanonicalFeedForwardPool
|
|
101
99
|
|
|
102
100
|
```ts
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
matchesCanonicalFeedForwardPool(
|
|
102
|
+
configuredPool: TopologyIntentMutationMethod[],
|
|
103
|
+
canonicalPool: TopologyIntentMutationMethod[],
|
|
104
|
+
): boolean
|
|
107
105
|
```
|
|
108
106
|
|
|
107
|
+
Check whether a configured mutation pool matches the canonical FFW pool.
|
|
108
|
+
|
|
109
|
+
This helper exists so callers can recognize the feed-forward mutation policy
|
|
110
|
+
even after options have been flattened, copied, or wrapped by legacy code.
|
|
111
|
+
The comparison deliberately stays order-sensitive because the canonical pool
|
|
112
|
+
is treated as one explicit public signal rather than as a fuzzy set of
|
|
113
|
+
approximately similar operators.
|
|
114
|
+
That strictness is a feature: it keeps the topology-intent story predictable
|
|
115
|
+
for readers and users instead of letting near-matches silently acquire a
|
|
116
|
+
stronger runtime meaning than they asked for.
|
|
117
|
+
|
|
118
|
+
Parameters:
|
|
119
|
+
- `configuredPool` - Mutation pool configured on the NEAT instance.
|
|
120
|
+
- `canonicalPool` - Canonical feed-forward mutation pool.
|
|
121
|
+
|
|
122
|
+
Returns: True when both pools align by operator name and order.
|
|
123
|
+
|
|
109
124
|
### promoteGenomeToFeedForwardIntentWhenEligible
|
|
110
125
|
|
|
111
126
|
```ts
|
|
@@ -145,17 +160,6 @@ const shouldPromote = usesFeedForwardMutationPolicy(neat.options.mutation);
|
|
|
145
160
|
promoteGenomeToFeedForwardIntentWhenEligible(candidateGenome, shouldPromote);
|
|
146
161
|
```
|
|
147
162
|
|
|
148
|
-
### TopologyIntentMutationMethod
|
|
149
|
-
|
|
150
|
-
Minimal mutation descriptor used by topology-intent helpers.
|
|
151
|
-
|
|
152
|
-
The bridge only needs one stable piece of information from a mutation entry:
|
|
153
|
-
its public name. That keeps the topology-intent checks aligned with the
|
|
154
|
-
canonical feed-forward pool without importing the full mutation subsystem.
|
|
155
|
-
Keeping the contract this small also makes the chapter's main teaching point
|
|
156
|
-
easier to see: topology intent recognition is a public-policy comparison, not
|
|
157
|
-
a second mutation-engine implementation.
|
|
158
|
-
|
|
159
163
|
### TopologyIntentGenome
|
|
160
164
|
|
|
161
165
|
Minimal genome surface required to promote feed-forward intent safely.
|
|
@@ -169,57 +173,53 @@ In other words, this contract captures just enough structure to answer the
|
|
|
169
173
|
chapter's one real question: "would a feed-forward runtime label preserve the
|
|
170
174
|
current graph's meaning, or would it over-promise?"
|
|
171
175
|
|
|
172
|
-
###
|
|
173
|
-
|
|
174
|
-
```ts
|
|
175
|
-
matchesCanonicalFeedForwardPool(
|
|
176
|
-
configuredPool: TopologyIntentMutationMethod[],
|
|
177
|
-
canonicalPool: TopologyIntentMutationMethod[],
|
|
178
|
-
): boolean
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
Check whether a configured mutation pool matches the canonical FFW pool.
|
|
182
|
-
|
|
183
|
-
This helper exists so callers can recognize the feed-forward mutation policy
|
|
184
|
-
even after options have been flattened, copied, or wrapped by legacy code.
|
|
185
|
-
The comparison deliberately stays order-sensitive because the canonical pool
|
|
186
|
-
is treated as one explicit public signal rather than as a fuzzy set of
|
|
187
|
-
approximately similar operators.
|
|
188
|
-
That strictness is a feature: it keeps the topology-intent story predictable
|
|
189
|
-
for readers and users instead of letting near-matches silently acquire a
|
|
190
|
-
stronger runtime meaning than they asked for.
|
|
176
|
+
### TopologyIntentMutationMethod
|
|
191
177
|
|
|
192
|
-
|
|
193
|
-
- `configuredPool` - Mutation pool configured on the NEAT instance.
|
|
194
|
-
- `canonicalPool` - Canonical feed-forward mutation pool.
|
|
178
|
+
Minimal mutation descriptor used by topology-intent helpers.
|
|
195
179
|
|
|
196
|
-
|
|
180
|
+
The bridge only needs one stable piece of information from a mutation entry:
|
|
181
|
+
its public name. That keeps the topology-intent checks aligned with the
|
|
182
|
+
canonical feed-forward pool without importing the full mutation subsystem.
|
|
183
|
+
Keeping the contract this small also makes the chapter's main teaching point
|
|
184
|
+
easier to see: topology intent recognition is a public-policy comparison, not
|
|
185
|
+
a second mutation-engine implementation.
|
|
197
186
|
|
|
198
|
-
###
|
|
187
|
+
### usesFeedForwardMutationPolicy
|
|
199
188
|
|
|
200
189
|
```ts
|
|
201
|
-
|
|
202
|
-
|
|
190
|
+
usesFeedForwardMutationPolicy(
|
|
191
|
+
mutationConfig: unknown,
|
|
203
192
|
): boolean
|
|
204
193
|
```
|
|
205
194
|
|
|
206
|
-
|
|
195
|
+
Determine whether the configured mutation policy communicates feed-forward intent.
|
|
207
196
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
different interpretation.
|
|
197
|
+
Accepts the canonical mutation pool reference, the legacy single-item array
|
|
198
|
+
wrapper, or a flattened pool that exactly matches the canonical feed-forward
|
|
199
|
+
operator order. The comparison stays strict on purpose so the controller does
|
|
200
|
+
not silently reinterpret custom mutation pools as feed-forward mode.
|
|
213
201
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
202
|
+
In practice this helper answers the policy question only. It does not inspect
|
|
203
|
+
a concrete genome, and it does not attempt runtime promotion by itself.
|
|
204
|
+
That separation is important because a caller may request feed-forward
|
|
205
|
+
mutation semantics while still holding seed genomes whose current graphs are
|
|
206
|
+
recurrent, gated, or otherwise not yet eligible for the stricter runtime
|
|
207
|
+
contract.
|
|
217
208
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
209
|
+
Treat this as the chapter's public signal decoder. It translates several
|
|
210
|
+
legacy and canonical configuration shapes into one yes-or-no answer that the
|
|
211
|
+
rest of the controller can reuse consistently.
|
|
221
212
|
|
|
222
213
|
Parameters:
|
|
223
|
-
- `
|
|
214
|
+
- `mutationConfig` - Configured mutation option.
|
|
224
215
|
|
|
225
|
-
Returns: True when the
|
|
216
|
+
Returns: True when the option expresses canonical feed-forward intent.
|
|
217
|
+
|
|
218
|
+
Example:
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
const shouldPromote = usesFeedForwardMutationPolicy(neat.options.mutation);
|
|
222
|
+
if (!shouldPromote) {
|
|
223
|
+
console.log('keep unconstrained topology intent');
|
|
224
|
+
}
|
|
225
|
+
```
|