@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
@@ -12,89 +12,89 @@ high-level control surface for mutation flow.
12
12
 
13
13
  ## architecture/network/mutate/network.mutate.utils.types.ts
14
14
 
15
- ### NODE_TYPE_INPUT
16
-
17
- Canonical node-type literal for input nodes.
18
-
19
- ### NODE_TYPE_OUTPUT
15
+ ### BATCH_NORM_FLAG_KEY
20
16
 
21
- Canonical node-type literal for output nodes.
17
+ Internal node field used to enable batch normalization.
22
18
 
23
- ### NODE_TYPE_HIDDEN
19
+ ### DEFAULT_MUTATION_MAX
24
20
 
25
- Canonical node-type literal for hidden nodes.
21
+ Default maximum mutation value when no method override is provided.
26
22
 
27
- ### RECURRENT_BLOCK_LSTM
23
+ ### DEFAULT_MUTATION_MIN
28
24
 
29
- Canonical recurrent block literal for LSTM expansion.
25
+ Default minimum mutation value when no method override is provided.
30
26
 
31
- ### RECURRENT_BLOCK_GRU
27
+ ### ERROR_NO_MUTATE_METHOD
32
28
 
33
- Canonical recurrent block literal for GRU expansion.
29
+ Error emitted when mutate is called without a valid method.
34
30
 
35
- ### SINGLE_UNIT_RECURRENT_BLOCK_WIDTH
31
+ ### GATE_REASSIGN_THRESHOLD
36
32
 
37
- Width used when creating a minimal recurrent block.
33
+ Threshold used for random 50/50 gating decisions.
38
34
 
39
- ### SUB_NODE_STABILITY_WEIGHT_DELTA
35
+ ### MIN_REDUNDANT_CONNECTION_COUNT
40
36
 
41
- Weight delta used to keep mutation side effects numerically observable.
37
+ Minimum redundant in/out degree required before removing a connection.
42
38
 
43
- ### GATE_REASSIGN_THRESHOLD
39
+ ### MIN_SWAPPABLE_NODE_COUNT
44
40
 
45
- Threshold used for random 50/50 gating decisions.
41
+ Minimum node count required to perform swap-node mutation.
46
42
 
47
- ### DEFAULT_MUTATION_MIN
43
+ ### NODE_TYPE_HIDDEN
48
44
 
49
- Default minimum mutation value when no method override is provided.
45
+ Canonical node-type literal for hidden nodes.
50
46
 
51
- ### DEFAULT_MUTATION_MAX
47
+ ### NODE_TYPE_INPUT
52
48
 
53
- Default maximum mutation value when no method override is provided.
49
+ Canonical node-type literal for input nodes.
54
50
 
55
- ### MIN_REDUNDANT_CONNECTION_COUNT
51
+ ### NODE_TYPE_OUTPUT
56
52
 
57
- Minimum redundant in/out degree required before removing a connection.
53
+ Canonical node-type literal for output nodes.
58
54
 
59
- ### MIN_SWAPPABLE_NODE_COUNT
55
+ ### RECURRENT_BLOCK_GRU
60
56
 
61
- Minimum node count required to perform swap-node mutation.
57
+ Canonical recurrent block literal for GRU expansion.
62
58
 
63
- ### WARNING_NO_HIDDEN_NODES_TO_REMOVE
59
+ ### RECURRENT_BLOCK_LSTM
64
60
 
65
- Message emitted when no hidden node can be removed.
61
+ Canonical recurrent block literal for LSTM expansion.
66
62
 
67
- ### WARNING_NO_ACTIVATION_MUTATION_TARGETS
63
+ ### SINGLE_UNIT_RECURRENT_BLOCK_WIDTH
68
64
 
69
- Message emitted when activation mutation has no eligible nodes.
65
+ Width used when creating a minimal recurrent block.
70
66
 
71
- ### WARNING_SELF_CONNECTIONS_ALREADY_PRESENT
67
+ ### SUB_NODE_STABILITY_WEIGHT_DELTA
72
68
 
73
- Message emitted when all self-connection candidates are already occupied.
69
+ Weight delta used to keep mutation side effects numerically observable.
74
70
 
75
- ### WARNING_NO_SELF_CONNECTIONS_TO_REMOVE
71
+ ### UNKNOWN_MUTATION_WARNING_PREFIX
76
72
 
77
- Message emitted when no self-connections are available to remove.
73
+ Prefix for unknown-mutation warning logs.
78
74
 
79
75
  ### WARNING_ALL_CONNECTIONS_GATED
80
76
 
81
77
  Message emitted when gating cannot be added because all are already gated.
82
78
 
79
+ ### WARNING_NO_ACTIVATION_MUTATION_TARGETS
80
+
81
+ Message emitted when activation mutation has no eligible nodes.
82
+
83
83
  ### WARNING_NO_GATED_CONNECTIONS_TO_REMOVE
84
84
 
85
85
  Message emitted when no gate exists to remove.
86
86
 
87
- ### UNKNOWN_MUTATION_WARNING_PREFIX
87
+ ### WARNING_NO_HIDDEN_NODES_TO_REMOVE
88
88
 
89
- Prefix for unknown-mutation warning logs.
89
+ Message emitted when no hidden node can be removed.
90
90
 
91
- ### ERROR_NO_MUTATE_METHOD
91
+ ### WARNING_NO_SELF_CONNECTIONS_TO_REMOVE
92
92
 
93
- Error emitted when mutate is called without a valid method.
93
+ Message emitted when no self-connections are available to remove.
94
94
 
95
- ### BATCH_NORM_FLAG_KEY
95
+ ### WARNING_SELF_CONNECTIONS_ALREADY_PRESENT
96
96
 
97
- Internal node field used to enable batch normalization.
97
+ Message emitted when all self-connection candidates are already occupied.
98
98
 
99
99
  ## architecture/network/mutate/network.mutate.utils.ts
100
100
 
@@ -172,49 +172,20 @@ Responsibilities:
172
172
  The helpers in this module are intentionally side-effect-light, except for optional
173
173
  warning emission, so orchestration code can remain deterministic and easy to inspect.
174
174
 
175
- ### resolveMutationKey
175
+ ### findMutationKeyByIdentityReference
176
176
 
177
177
  ```ts
178
- resolveMutationKey(
178
+ findMutationKeyByIdentityReference(
179
179
  method: MutationMethod,
180
180
  ): string | undefined
181
181
  ```
182
182
 
183
- Resolves a mutation dispatch key from user-provided method input.
184
-
185
- Resolution order:
186
- 1. Use string input directly.
187
- 2. Use direct object identity fields (`name`, `type`, `identity`).
188
- 3. Fall back to identity-reference comparison against known mutation objects.
189
-
190
- Parameters:
191
- - `method` - - Mutation method input.
192
-
193
- Returns: Dispatch key or undefined.
194
-
195
- Example:
196
-
197
- ```ts
198
- const key = resolveMutationKey('ADD_NODE');
199
- ```
200
-
201
- ### warnUnknownMutation
202
-
203
- ```ts
204
- warnUnknownMutation(
205
- mutationKey: string | undefined,
206
- ): void
207
- ```
208
-
209
- Emits unknown-mutation warning when configured.
210
-
211
- This helper intentionally no-ops when warnings are disabled so callers can invoke it
212
- without repeating feature-flag checks.
183
+ Resolves a mutation key by direct identity-reference comparison.
213
184
 
214
185
  Parameters:
215
- - `mutationKey` - - Resolved mutation key.
186
+ - `method` - - Mutation object reference.
216
187
 
217
- Returns: Nothing.
188
+ Returns: Matching mutation key or undefined.
218
189
 
219
190
  ### isMutationMethodKeyString
220
191
 
@@ -231,50 +202,79 @@ Parameters:
231
202
 
232
203
  Returns: True when method is a key string.
233
204
 
234
- ### resolveMutationKeyFromObject
205
+ ### resolveDirectMutationKey
235
206
 
236
207
  ```ts
237
- resolveMutationKeyFromObject(
208
+ resolveDirectMutationKey(
238
209
  methodObject: { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; },
239
210
  ): string | undefined
240
211
  ```
241
212
 
242
- Resolves mutation key from object-form descriptor.
213
+ Resolves direct object fields that can represent a mutation key.
243
214
 
244
215
  Parameters:
245
216
  - `methodObject` - - Mutation method object.
246
217
 
218
+ Returns: Direct key or undefined.
219
+
220
+ ### resolveMutationKey
221
+
222
+ ```ts
223
+ resolveMutationKey(
224
+ method: MutationMethod,
225
+ ): string | undefined
226
+ ```
227
+
228
+ Resolves a mutation dispatch key from user-provided method input.
229
+
230
+ Resolution order:
231
+ 1. Use string input directly.
232
+ 2. Use direct object identity fields (`name`, `type`, `identity`).
233
+ 3. Fall back to identity-reference comparison against known mutation objects.
234
+
235
+ Parameters:
236
+ - `method` - - Mutation method input.
237
+
247
238
  Returns: Dispatch key or undefined.
248
239
 
249
- ### resolveDirectMutationKey
240
+ Example:
250
241
 
251
242
  ```ts
252
- resolveDirectMutationKey(
243
+ const key = resolveMutationKey('ADD_NODE');
244
+ ```
245
+
246
+ ### resolveMutationKeyFromObject
247
+
248
+ ```ts
249
+ resolveMutationKeyFromObject(
253
250
  methodObject: { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; },
254
251
  ): string | undefined
255
252
  ```
256
253
 
257
- Resolves direct object fields that can represent a mutation key.
254
+ Resolves mutation key from object-form descriptor.
258
255
 
259
256
  Parameters:
260
257
  - `methodObject` - - Mutation method object.
261
258
 
262
- Returns: Direct key or undefined.
259
+ Returns: Dispatch key or undefined.
263
260
 
264
- ### findMutationKeyByIdentityReference
261
+ ### warnUnknownMutation
265
262
 
266
263
  ```ts
267
- findMutationKeyByIdentityReference(
268
- method: MutationMethod,
269
- ): string | undefined
264
+ warnUnknownMutation(
265
+ mutationKey: string | undefined,
266
+ ): void
270
267
  ```
271
268
 
272
- Resolves a mutation key by direct identity-reference comparison.
269
+ Emits unknown-mutation warning when configured.
270
+
271
+ This helper intentionally no-ops when warnings are disabled so callers can invoke it
272
+ without repeating feature-flag checks.
273
273
 
274
274
  Parameters:
275
- - `method` - - Mutation object reference.
275
+ - `mutationKey` - - Resolved mutation key.
276
276
 
277
- Returns: Matching mutation key or undefined.
277
+ Returns: Nothing.
278
278
 
279
279
  ## architecture/network/mutate/network.mutate.handlers.utils.ts
280
280
 
@@ -291,911 +291,894 @@ Behavioral notes:
291
291
  - Acyclic mode checks are enforced in handlers that could introduce recurrence.
292
292
  - Randomness is sourced from network mutation internals for reproducible deterministic flows.
293
293
 
294
- ### addNode
294
+ ### addBackConn
295
295
 
296
296
  ```ts
297
- addNode(): void
297
+ addBackConn(): void
298
298
  ```
299
299
 
300
- Adds one hidden node by splitting an existing connection.
300
+ Adds one backward (recurrent) connection between eligible node pairs.
301
301
 
302
- Execution modes:
303
- - Deterministic chain mode grows a linear input→...→output chain.
304
- - Standard mode splits a randomly selected forward connection.
302
+ This operation is skipped in acyclic mode.
305
303
 
306
304
  Parameters:
307
305
  - `this` - - Bound network.
308
306
 
309
307
  Returns: Nothing.
310
308
 
311
- ### subNode
309
+ ### addConn
312
310
 
313
311
  ```ts
314
- subNode(): void
312
+ addConn(): void
315
313
  ```
316
314
 
317
- Removes one hidden node and applies a tiny weight nudge for numerical continuity.
315
+ Adds one forward connection between currently unconnected eligible node pairs.
318
316
 
319
- The stability nudge helps keep downstream mutation effects observable in edge cases
320
- where node removal substantially changes effective signal flow.
317
+ Candidate generation respects node ordering so the added edge is feed-forward.
321
318
 
322
319
  Parameters:
323
320
  - `this` - - Bound network.
324
321
 
325
322
  Returns: Nothing.
326
323
 
327
- ### addConn
324
+ ### addGate
328
325
 
329
326
  ```ts
330
- addConn(): void
327
+ addGate(): void
331
328
  ```
332
329
 
333
- Adds one forward connection between currently unconnected eligible node pairs.
330
+ Assigns a random eligible node as gater for a random ungated connection.
334
331
 
335
- Candidate generation respects node ordering so the added edge is feed-forward.
332
+ Candidate pool includes normal and self-connections.
336
333
 
337
334
  Parameters:
338
335
  - `this` - - Bound network.
339
336
 
340
337
  Returns: Nothing.
341
338
 
342
- ### subConn
339
+ ### addGRUNode
343
340
 
344
341
  ```ts
345
- subConn(): void
342
+ addGRUNode(): void
346
343
  ```
347
344
 
348
- Removes one forward connection when structural redundancy constraints are satisfied.
349
-
350
- Constraints require endpoint redundancy and avoid disconnecting peer-layer groups.
345
+ Replaces one connection by inserting a minimal GRU recurrent block.
351
346
 
352
347
  Parameters:
353
348
  - `this` - - Bound network.
354
349
 
355
350
  Returns: Nothing.
356
351
 
357
- ### modWeight
352
+ ### addLSTMNode
358
353
 
359
354
  ```ts
360
- modWeight(
361
- method: MutationMethod | undefined,
362
- ): void
355
+ addLSTMNode(): void
363
356
  ```
364
357
 
365
- Perturbs one connection weight using a uniform delta sampled from configured bounds.
366
-
367
- The candidate pool includes standard and self-connections.
358
+ Replaces one connection by inserting a minimal LSTM recurrent block.
368
359
 
369
360
  Parameters:
370
361
  - `this` - - Bound network.
371
- - `method` - - Optional method descriptor.
372
362
 
373
363
  Returns: Nothing.
374
364
 
375
- ### modBias
365
+ ### addNode
376
366
 
377
367
  ```ts
378
- modBias(
379
- method: MutationMethod | undefined,
380
- ): void
368
+ addNode(): void
381
369
  ```
382
370
 
383
- Mutates bias parameters on one random non-input node.
371
+ Adds one hidden node by splitting an existing connection.
384
372
 
385
- Output nodes remain eligible for this operator.
373
+ Execution modes:
374
+ - Deterministic chain mode grows a linear input→...→output chain.
375
+ - Standard mode splits a randomly selected forward connection.
386
376
 
387
377
  Parameters:
388
378
  - `this` - - Bound network.
389
- - `method` - - Optional method descriptor.
390
379
 
391
380
  Returns: Nothing.
392
381
 
393
- ### modActivation
382
+ ### addNodeDeterministicChain
394
383
 
395
384
  ```ts
396
- modActivation(
397
- method: MutationMethod | undefined,
385
+ addNodeDeterministicChain(
386
+ network: default,
387
+ mutationProps: NetworkMutationProps,
398
388
  ): void
399
389
  ```
400
390
 
401
- Mutates activation function on one random non-input node.
402
-
403
- Output-node eligibility is controlled by `method.mutateOutput` when provided.
391
+ Applies deterministic chain-growth ADD_NODE mutation.
404
392
 
405
393
  Parameters:
406
- - `this` - - Bound network.
407
- - `method` - - Optional method descriptor.
394
+ - `network` - - Target network.
395
+ - `mutationProps` - - Runtime mutation props.
408
396
 
409
397
  Returns: Nothing.
410
398
 
411
- ### addSelfConn
399
+ ### addNodeRandomSplit
412
400
 
413
401
  ```ts
414
- addSelfConn(): void
415
- ```
416
-
417
- Adds one self-connection on an eligible node that does not already have one.
402
+ addNodeRandomSplit(
403
+ network: default,
404
+ mutationProps: NetworkMutationProps,
405
+ ): void
406
+ ```
418
407
 
419
- This operation is skipped in acyclic mode.
408
+ Applies non-deterministic ADD_NODE by splitting a random connection.
420
409
 
421
410
  Parameters:
422
- - `this` - - Bound network.
411
+ - `network` - - Target network.
412
+ - `mutationProps` - - Runtime mutation props.
423
413
 
424
414
  Returns: Nothing.
425
415
 
426
- ### subSelfConn
416
+ ### addRecurrentNode
427
417
 
428
418
  ```ts
429
- subSelfConn(): void
419
+ addRecurrentNode(
420
+ network: default,
421
+ blockType: "lstm" | "gru",
422
+ ): void
430
423
  ```
431
424
 
432
- Removes one existing self-connection chosen at random.
425
+ Shared orchestrator for recurrent-node mutation variants.
433
426
 
434
427
  Parameters:
435
- - `this` - - Bound network.
428
+ - `network` - - Target network.
429
+ - `blockType` - - Recurrent block type.
436
430
 
437
431
  Returns: Nothing.
438
432
 
439
- ### addGate
433
+ ### addSelfConn
440
434
 
441
435
  ```ts
442
- addGate(): void
436
+ addSelfConn(): void
443
437
  ```
444
438
 
445
- Assigns a random eligible node as gater for a random ungated connection.
439
+ Adds one self-connection on an eligible node that does not already have one.
446
440
 
447
- Candidate pool includes normal and self-connections.
441
+ This operation is skipped in acyclic mode.
448
442
 
449
443
  Parameters:
450
444
  - `this` - - Bound network.
451
445
 
452
446
  Returns: Nothing.
453
447
 
454
- ### subGate
448
+ ### appendRecurrentLayerNodes
455
449
 
456
450
  ```ts
457
- subGate(): void
451
+ appendRecurrentLayerNodes(
452
+ network: default,
453
+ layerNodes: default[],
454
+ ): void
458
455
  ```
459
456
 
460
- Removes gating from one randomly selected gated connection.
457
+ Appends recurrent layer nodes as hidden nodes.
461
458
 
462
459
  Parameters:
463
- - `this` - - Bound network.
460
+ - `network` - - Target network.
461
+ - `layerNodes` - - Layer nodes.
464
462
 
465
463
  Returns: Nothing.
466
464
 
467
- ### addBackConn
465
+ ### applyFirstConnectionStabilityNudge
468
466
 
469
467
  ```ts
470
- addBackConn(): void
468
+ applyFirstConnectionStabilityNudge(
469
+ network: default,
470
+ ): void
471
471
  ```
472
472
 
473
- Adds one backward (recurrent) connection between eligible node pairs.
474
-
475
- This operation is skipped in acyclic mode.
473
+ Applies tiny stability nudge to the first remaining connection.
476
474
 
477
475
  Parameters:
478
- - `this` - - Bound network.
476
+ - `network` - - Target network.
479
477
 
480
478
  Returns: Nothing.
481
479
 
482
- ### subBackConn
480
+ ### asMutationProps
483
481
 
484
482
  ```ts
485
- subBackConn(): void
483
+ asMutationProps(
484
+ network: default,
485
+ ): NetworkMutationProps
486
486
  ```
487
487
 
488
- Removes one backward connection that satisfies redundancy constraints.
488
+ Converts a network to its internal mutation runtime shape.
489
489
 
490
490
  Parameters:
491
- - `this` - - Bound network.
491
+ - `network` - - Network to convert.
492
492
 
493
- Returns: Nothing.
493
+ Returns: Runtime mutation props.
494
494
 
495
- ### swapNodes
495
+ ### batchNorm
496
496
 
497
497
  ```ts
498
- swapNodes(
499
- method: MutationMethod | undefined,
500
- ): void
498
+ batchNorm(): void
501
499
  ```
502
500
 
503
- Swaps bias and activation squash functions between two distinct mutable nodes.
504
-
505
- This provides a lightweight structural-parameter recombination without changing
506
- graph connectivity.
501
+ Enables the internal batch-normalization flag on one random hidden node.
507
502
 
508
503
  Parameters:
509
504
  - `this` - - Bound network.
510
- - `method` - - Optional method descriptor.
511
505
 
512
506
  Returns: Nothing.
513
507
 
514
- ### addLSTMNode
508
+ ### collectAllConnections
515
509
 
516
510
  ```ts
517
- addLSTMNode(): void
511
+ collectAllConnections(
512
+ network: default,
513
+ ): default[]
518
514
  ```
519
515
 
520
- Replaces one connection by inserting a minimal LSTM recurrent block.
516
+ Collects normal and self connections.
521
517
 
522
518
  Parameters:
523
- - `this` - - Bound network.
519
+ - `network` - - Target network.
524
520
 
525
- Returns: Nothing.
521
+ Returns: Combined connections.
526
522
 
527
- ### addGRUNode
523
+ ### collectBackwardCandidatesForLaterNode
528
524
 
529
525
  ```ts
530
- addGRUNode(): void
526
+ collectBackwardCandidatesForLaterNode(
527
+ traversalContext: BackwardCandidateTraversalContext,
528
+ ): NodePair[]
531
529
  ```
532
530
 
533
- Replaces one connection by inserting a minimal GRU recurrent block.
531
+ Collects all backward candidates for one later-node traversal context.
534
532
 
535
533
  Parameters:
536
- - `this` - - Bound network.
534
+ - `traversalContext` - - Later-node traversal context.
537
535
 
538
- Returns: Nothing.
536
+ Returns: Candidate source/target pairs.
539
537
 
540
- ### reinitWeight
538
+ ### collectBackwardCandidatesFromContext
541
539
 
542
540
  ```ts
543
- reinitWeight(
544
- method: MutationMethod | undefined,
545
- ): void
541
+ collectBackwardCandidatesFromContext(
542
+ backwardConnectionCandidates: NodePair[],
543
+ traversalContext: BackwardCandidateTraversalContext,
544
+ ): NodePair[]
546
545
  ```
547
546
 
548
- Reinitializes incoming, outgoing, and self-connection weights for one target node.
549
-
550
- Weight sampling bounds come from method overrides or default mutation bounds.
547
+ Reduces one backward traversal context into candidate connection pairs.
551
548
 
552
549
  Parameters:
553
- - `this` - - Bound network.
554
- - `method` - - Optional method descriptor.
550
+ - `backwardConnectionCandidates` - - Existing candidate pairs.
551
+ - `traversalContext` - - Later-node traversal context.
555
552
 
556
- Returns: Nothing.
553
+ Returns: Updated candidate pairs.
557
554
 
558
- ### batchNorm
555
+ ### collectBackwardConnectionCandidates
559
556
 
560
557
  ```ts
561
- batchNorm(): void
558
+ collectBackwardConnectionCandidates(
559
+ network: default,
560
+ ): NodePair[]
562
561
  ```
563
562
 
564
- Enables the internal batch-normalization flag on one random hidden node.
563
+ Collects backward (recurrent) connection candidates.
565
564
 
566
565
  Parameters:
567
- - `this` - - Bound network.
566
+ - `network` - - Target network.
568
567
 
569
- Returns: Nothing.
568
+ Returns: Candidate source/target pairs.
570
569
 
571
- ### asMutationProps
570
+ ### collectBackwardTraversalContexts
572
571
 
573
572
  ```ts
574
- asMutationProps(
573
+ collectBackwardTraversalContexts(
575
574
  network: default,
576
- ): NetworkMutationProps
575
+ ): BackwardCandidateTraversalContext[]
577
576
  ```
578
577
 
579
- Converts a network to its internal mutation runtime shape.
578
+ Collects backward traversal contexts for all eligible later nodes.
580
579
 
581
580
  Parameters:
582
- - `network` - - Network to convert.
581
+ - `network` - - Target network.
583
582
 
584
- Returns: Runtime mutation props.
583
+ Returns: Backward traversal contexts.
585
584
 
586
- ### markTopoDirtyIfAcyclic
585
+ ### collectConnectionGroupsForReinit
587
586
 
588
587
  ```ts
589
- markTopoDirtyIfAcyclic(
590
- mutationProps: NetworkMutationProps,
591
- ): void
588
+ collectConnectionGroupsForReinit(
589
+ targetNode: default,
590
+ ): default[][]
592
591
  ```
593
592
 
594
- Marks topology caches dirty when acyclic mode is enforced.
593
+ Collects all connection groups affected by REINIT_WEIGHT.
595
594
 
596
595
  Parameters:
597
- - `mutationProps` - - Runtime mutation props.
596
+ - `targetNode` - - Node receiving the reinitialization.
598
597
 
599
- Returns: Nothing.
598
+ Returns: Mutable connection groups.
600
599
 
601
- ### findFirstNodeByType
600
+ ### collectDistinctNodeCandidates
602
601
 
603
602
  ```ts
604
- findFirstNodeByType(
605
- network: default,
606
- nodeType: string,
607
- ): default | undefined
603
+ collectDistinctNodeCandidates(
604
+ nodeCandidates: default[],
605
+ excludedNode: default,
606
+ ): default[]
608
607
  ```
609
608
 
610
- Returns the first node by type.
609
+ Collects candidates that are distinct from an excluded node.
611
610
 
612
611
  Parameters:
613
- - `network` - - Target network.
614
- - `nodeType` - - Node type to match.
612
+ - `nodeCandidates` - - Candidate nodes.
613
+ - `excludedNode` - - Node to exclude.
615
614
 
616
- Returns: Matching node or undefined.
615
+ Returns: Distinct candidates.
617
616
 
618
- ### pickRandomEntry
617
+ ### collectForwardCandidatesForSource
619
618
 
620
619
  ```ts
621
- pickRandomEntry(
622
- entries: T[],
623
- randomValue: () => number,
624
- ): T | undefined
620
+ collectForwardCandidatesForSource(
621
+ traversalContext: ForwardCandidateTraversalContext,
622
+ ): NodePair[]
625
623
  ```
626
624
 
627
- Selects a random array element.
625
+ Collects all forward candidates for one source traversal context.
628
626
 
629
627
  Parameters:
630
- - `entries` - - Source entries.
631
- - `randomValue` - - Random generator.
628
+ - `traversalContext` - - Source traversal context.
632
629
 
633
- Returns: Random entry or undefined when empty.
630
+ Returns: Candidate source/target pairs.
634
631
 
635
- ### createHiddenNode
632
+ ### collectForwardCandidatesFromContext
636
633
 
637
634
  ```ts
638
- createHiddenNode(
639
- randomValue: () => number,
640
- ): default
635
+ collectForwardCandidatesFromContext(
636
+ forwardConnectionCandidates: NodePair[],
637
+ traversalContext: ForwardCandidateTraversalContext,
638
+ ): NodePair[]
641
639
  ```
642
640
 
643
- Creates a hidden node with random activation mutation.
641
+ Reduces one forward traversal context into candidate connection pairs.
644
642
 
645
643
  Parameters:
646
- - `randomValue` - - Random generator.
644
+ - `forwardConnectionCandidates` - - Existing candidate pairs.
645
+ - `traversalContext` - - Source traversal context.
647
646
 
648
- Returns: Hidden node.
647
+ Returns: Updated candidate pairs.
649
648
 
650
- ### insertNodeBeforeOutputTail
649
+ ### collectForwardConnectionCandidates
651
650
 
652
651
  ```ts
653
- insertNodeBeforeOutputTail(
652
+ collectForwardConnectionCandidates(
654
653
  network: default,
655
- nodeToInsert: default,
656
- targetNode: default,
657
- mutationProps: NetworkMutationProps,
658
- ): void
654
+ ): NodePair[]
659
655
  ```
660
656
 
661
- Inserts a node before output tail while preserving output block ordering.
657
+ Collects forward connection candidates.
662
658
 
663
659
  Parameters:
664
660
  - `network` - - Target network.
665
- - `nodeToInsert` - - Node to insert.
666
- - `targetNode` - - Target node for insertion alignment.
667
- - `mutationProps` - - Runtime mutation props.
668
661
 
669
- Returns: Nothing.
662
+ Returns: Candidate source/target pairs.
670
663
 
671
- ### findConnection
664
+ ### collectForwardTraversalContexts
672
665
 
673
666
  ```ts
674
- findConnection(
667
+ collectForwardTraversalContexts(
675
668
  network: default,
676
- fromNode: default,
677
- toNode: default,
678
- ): default | undefined
669
+ ): ForwardCandidateTraversalContext[]
679
670
  ```
680
671
 
681
- Gets a connection between two nodes when it exists.
672
+ Collects forward traversal contexts for all eligible source nodes.
682
673
 
683
674
  Parameters:
684
675
  - `network` - - Target network.
685
- - `fromNode` - - Source node.
686
- - `toNode` - - Target node.
687
676
 
688
- Returns: Matching connection or undefined.
677
+ Returns: Forward traversal contexts.
689
678
 
690
- ### ensureConnection
679
+ ### collectMutableNonInputNodes
691
680
 
692
681
  ```ts
693
- ensureConnection(
682
+ collectMutableNonInputNodes(
694
683
  network: default,
695
- fromNode: default,
696
- toNode: default,
697
- ): default | undefined
684
+ excludeOutputNodes: boolean,
685
+ ): default[]
698
686
  ```
699
687
 
700
- Ensures a connection exists and returns it.
688
+ Collects mutable non-input nodes.
701
689
 
702
690
  Parameters:
703
691
  - `network` - - Target network.
704
- - `fromNode` - - Source node.
705
- - `toNode` - - Target node.
692
+ - `excludeOutputNodes` - - True to exclude output nodes.
706
693
 
707
- Returns: Existing or created connection.
694
+ Returns: Mutable nodes.
708
695
 
709
- ### tryDisconnectConnection
696
+ ### collectNodesByType
710
697
 
711
698
  ```ts
712
- tryDisconnectConnection(
699
+ collectNodesByType(
713
700
  network: default,
714
- connection: default,
715
- ): void
701
+ nodeType: string,
702
+ ): default[]
716
703
  ```
717
704
 
718
- Disconnects a connection pair while suppressing errors.
705
+ Collects nodes by type.
719
706
 
720
707
  Parameters:
721
- - `network` - - Target network.
722
- - `connection` - - Connection to remove.
708
+ - `network` - - Source network.
709
+ - `nodeType` - - Desired node type.
723
710
 
724
- Returns: Nothing.
711
+ Returns: Matching nodes.
725
712
 
726
- ### addNodeDeterministicChain
713
+ ### collectNodesWithoutSelfLoop
727
714
 
728
715
  ```ts
729
- addNodeDeterministicChain(
716
+ collectNodesWithoutSelfLoop(
730
717
  network: default,
731
- mutationProps: NetworkMutationProps,
732
- ): void
718
+ ): default[]
733
719
  ```
734
720
 
735
- Applies deterministic chain-growth ADD_NODE mutation.
721
+ Collects non-input nodes that do not have self loops.
736
722
 
737
723
  Parameters:
738
724
  - `network` - - Target network.
739
- - `mutationProps` - - Runtime mutation props.
740
725
 
741
- Returns: Nothing.
726
+ Returns: Eligible nodes.
742
727
 
743
- ### resolveDeterministicChainMutationContext
728
+ ### collectRemovableBackwardConnections
744
729
 
745
730
  ```ts
746
- resolveDeterministicChainMutationContext(
731
+ collectRemovableBackwardConnections(
747
732
  network: default,
748
- mutationProps: NetworkMutationProps,
749
- ): DeterministicChainMutationContext | undefined
733
+ ): default[]
750
734
  ```
751
735
 
752
- Resolves all deterministic add-node prerequisites into one context object.
736
+ Collects removable backward connections using redundancy constraints.
753
737
 
754
738
  Parameters:
755
739
  - `network` - - Target network.
756
- - `mutationProps` - - Runtime mutation props.
757
740
 
758
- Returns: Deterministic context or undefined when one or more prerequisites fail.
741
+ Returns: Removable backward connections.
759
742
 
760
- ### resolveInputOutputEndpoints
743
+ ### collectRemovableForwardConnections
761
744
 
762
745
  ```ts
763
- resolveInputOutputEndpoints(
746
+ collectRemovableForwardConnections(
764
747
  network: default,
765
- ): InputOutputEndpoints | undefined
748
+ ): default[]
766
749
  ```
767
750
 
768
- Resolves input/output endpoints required for seed and deterministic flows.
751
+ Collects removable forward connections using redundancy constraints.
769
752
 
770
753
  Parameters:
771
754
  - `network` - - Target network.
772
755
 
773
- Returns: Endpoint nodes or undefined when missing.
756
+ Returns: Removable forward connections.
774
757
 
775
- ### initializeDeterministicChain
758
+ ### collectSwappableNodesForMutation
776
759
 
777
760
  ```ts
778
- initializeDeterministicChain(
761
+ collectSwappableNodesForMutation(
779
762
  network: default,
780
- mutationProps: NetworkMutationProps,
781
- inputNode: default,
782
- outputNode: default,
783
- ): void
763
+ method: MutationMethod | undefined,
764
+ ): default[]
784
765
  ```
785
766
 
786
- Initializes deterministic chain storage and seed edge.
767
+ Collects swap-eligible nodes based on mutation configuration.
787
768
 
788
769
  Parameters:
789
770
  - `network` - - Target network.
790
- - `mutationProps` - - Runtime mutation props.
791
- - `inputNode` - - Input node.
792
- - `outputNode` - - Output node.
771
+ - `method` - - Optional method descriptor.
793
772
 
794
- Returns: Nothing.
773
+ Returns: Swap-eligible nodes.
795
774
 
796
- ### pruneDeterministicChainExtraEdges
775
+ ### collectTargetLayerPeers
797
776
 
798
777
  ```ts
799
- pruneDeterministicChainExtraEdges(
778
+ collectTargetLayerPeers(
800
779
  network: default,
801
- deterministicChain: default[],
802
- outputNode: default,
803
- ): void
780
+ targetNode: default,
781
+ ): default[]
804
782
  ```
805
783
 
806
- Prunes side edges from chain nodes to preserve linear deterministic depth.
784
+ Collects peers around a target node in the same type/layer neighborhood.
807
785
 
808
786
  Parameters:
809
787
  - `network` - - Target network.
810
- - `deterministicChain` - - Chain node list.
811
- - `outputNode` - - Output node.
788
+ - `targetNode` - - Node whose peers are collected.
812
789
 
813
- Returns: Nothing.
790
+ Returns: Peer nodes.
814
791
 
815
- ### resolveExpectedChainTarget
792
+ ### collectUngatedConnections
816
793
 
817
794
  ```ts
818
- resolveExpectedChainTarget(
819
- deterministicChain: default[],
820
- chainNodeIndex: number,
821
- outputNode: default,
822
- ): default
795
+ collectUngatedConnections(
796
+ network: default,
797
+ ): default[]
823
798
  ```
824
799
 
825
- Resolves the expected outgoing target for a chain node position.
800
+ Collects ungated connections including self-connections.
826
801
 
827
802
  Parameters:
828
- - `deterministicChain` - - Chain node list.
829
- - `chainNodeIndex` - - Current chain index.
830
- - `outputNode` - - Terminal output node.
803
+ - `network` - - Target network.
831
804
 
832
- Returns: Expected successor target.
805
+ Returns: Ungated connections.
833
806
 
834
- ### disconnectUnexpectedOutgoingConnections
807
+ ### connectPair
835
808
 
836
809
  ```ts
837
- disconnectUnexpectedOutgoingConnections(
810
+ connectPair(
838
811
  network: default,
839
- chainNode: default,
840
- expectedTargetNode: default,
812
+ selectedConnectionPair: NodePair,
841
813
  ): void
842
814
  ```
843
815
 
844
- Removes outgoing connections that do not match the expected chain target.
816
+ Connects source/target node pair.
845
817
 
846
818
  Parameters:
847
819
  - `network` - - Target network.
848
- - `chainNode` - - Node whose outgoing edges are validated.
849
- - `expectedTargetNode` - - Allowed outgoing target.
820
+ - `selectedConnectionPair` - - Source/target pair.
850
821
 
851
822
  Returns: Nothing.
852
823
 
853
- ### addNodeRandomSplit
824
+ ### containsNode
854
825
 
855
826
  ```ts
856
- addNodeRandomSplit(
857
- network: default,
858
- mutationProps: NetworkMutationProps,
859
- ): void
827
+ containsNode(
828
+ nodes: default[],
829
+ node: default,
830
+ ): boolean
860
831
  ```
861
832
 
862
- Applies non-deterministic ADD_NODE by splitting a random connection.
833
+ Checks whether a node list contains a node reference.
863
834
 
864
835
  Parameters:
865
- - `network` - - Target network.
866
- - `mutationProps` - - Runtime mutation props.
836
+ - `nodes` - - Node list.
837
+ - `node` - - Node reference.
867
838
 
868
- Returns: Nothing.
839
+ Returns: True when contained.
869
840
 
870
- ### splitConnectionThroughHiddenNode
841
+ ### countConnectionWhenSourceTargetsPeer
871
842
 
872
843
  ```ts
873
- splitConnectionThroughHiddenNode(
874
- network: default,
875
- mutationProps: NetworkMutationProps,
876
- connectionToSplit: default,
877
- ): ConnectionSplitResult
844
+ countConnectionWhenSourceTargetsPeer(
845
+ peerConnectionsFromSource: number,
846
+ existingConnection: default,
847
+ countContext: SourcePeerConnectionCountContext,
848
+ ): number
878
849
  ```
879
850
 
880
- Replaces one connection by inserting a hidden node and reconnecting edges.
851
+ Counts one connection when it originates from source and targets a peer.
881
852
 
882
853
  Parameters:
883
- - `network` - - Target network.
884
- - `mutationProps` - - Runtime mutation props.
885
- - `connectionToSplit` - - Connection to split.
854
+ - `peerConnectionsFromSource` - - Current count.
855
+ - `existingConnection` - - Existing network connection.
856
+ - `countContext` - - Count context.
886
857
 
887
- Returns: Split result values.
858
+ Returns: Updated count.
888
859
 
889
- ### tryReassignGateAfterSplit
860
+ ### countSourceConnectionsIntoPeerSet
890
861
 
891
862
  ```ts
892
- tryReassignGateAfterSplit(
863
+ countSourceConnectionsIntoPeerSet(
893
864
  network: default,
894
- randomValue: () => number,
895
- splitResult: ConnectionSplitResult,
896
- ): void
865
+ candidateConnection: default,
866
+ targetLayerPeers: default[],
867
+ ): number
897
868
  ```
898
869
 
899
- Reassigns prior gater to one of the new split connections when possible.
870
+ Counts source-originated connections that end inside the target peer set.
900
871
 
901
872
  Parameters:
902
873
  - `network` - - Target network.
903
- - `randomValue` - - Random generator.
904
- - `splitResult` - - Split result values.
874
+ - `candidateConnection` - - Candidate connection.
875
+ - `targetLayerPeers` - - Peer-set nodes.
905
876
 
906
- Returns: Nothing.
877
+ Returns: Number of source-to-peer connections.
907
878
 
908
- ### ensureSeedForwardConnectionWhenEmpty
879
+ ### createBackwardCandidateTraversalContext
909
880
 
910
881
  ```ts
911
- ensureSeedForwardConnectionWhenEmpty(
882
+ createBackwardCandidateTraversalContext(
912
883
  network: default,
913
- ): boolean
884
+ laterNodeIndex: number,
885
+ ): BackwardCandidateTraversalContext
914
886
  ```
915
887
 
916
- Ensures a seed input->output connection exists when connection list is empty.
888
+ Creates context for one backward-candidate traversal pass.
917
889
 
918
890
  Parameters:
919
891
  - `network` - - Target network.
892
+ - `laterNodeIndex` - - Current later-node index.
920
893
 
921
- Returns: True when mutation may continue.
894
+ Returns: Immutable traversal context.
922
895
 
923
- ### selectHiddenNodeForRemoval
896
+ ### createConnectionGroupReinitContext
924
897
 
925
898
  ```ts
926
- selectHiddenNodeForRemoval(
927
- network: default,
928
- hiddenNodes: default[],
929
- ): default | undefined
899
+ createConnectionGroupReinitContext(
900
+ randomValue: () => number,
901
+ methodObject: { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; },
902
+ ): ConnectionGroupReinitContext
930
903
  ```
931
904
 
932
- Selects a hidden node candidate for SUB_NODE mutation.
905
+ Creates immutable context for connection-group reinitialization.
933
906
 
934
907
  Parameters:
935
- - `network` - - Target network.
936
- - `hiddenNodes` - - Hidden nodes.
908
+ - `randomValue` - - Random generator.
909
+ - `methodObject` - - Method override object.
937
910
 
938
- Returns: Selected hidden node.
911
+ Returns: Reinitialization context.
939
912
 
940
- ### removeHiddenNodeAndApplyStabilityNudge
913
+ ### createDirectionalConnectionContext
941
914
 
942
915
  ```ts
943
- removeHiddenNodeAndApplyStabilityNudge(
916
+ createDirectionalConnectionContext(
944
917
  network: default,
945
- hiddenNode: default,
946
- ): void
918
+ candidateConnection: default,
919
+ ): DirectionalConnectionContext
947
920
  ```
948
921
 
949
- Removes selected hidden node and applies stability nudge.
922
+ Creates indexed directional context for a connection candidate.
950
923
 
951
924
  Parameters:
952
925
  - `network` - - Target network.
953
- - `hiddenNode` - - Hidden node to remove.
926
+ - `candidateConnection` - - Candidate connection.
954
927
 
955
- Returns: Nothing.
928
+ Returns: Directional context.
956
929
 
957
- ### applyFirstConnectionStabilityNudge
930
+ ### createForwardCandidateTraversalContext
958
931
 
959
932
  ```ts
960
- applyFirstConnectionStabilityNudge(
933
+ createForwardCandidateTraversalContext(
961
934
  network: default,
962
- ): void
935
+ sourceNodeIndex: number,
936
+ ): ForwardCandidateTraversalContext
963
937
  ```
964
938
 
965
- Applies tiny stability nudge to the first remaining connection.
939
+ Creates context for one forward-candidate source traversal pass.
966
940
 
967
941
  Parameters:
968
942
  - `network` - - Target network.
943
+ - `sourceNodeIndex` - - Current source index.
969
944
 
970
- Returns: Nothing.
945
+ Returns: Immutable traversal context.
971
946
 
972
- ### collectNodesByType
947
+ ### createHiddenNode
973
948
 
974
949
  ```ts
975
- collectNodesByType(
976
- network: default,
977
- nodeType: string,
978
- ): default[]
950
+ createHiddenNode(
951
+ randomValue: () => number,
952
+ ): default
979
953
  ```
980
954
 
981
- Collects nodes by type.
955
+ Creates a hidden node with random activation mutation.
982
956
 
983
957
  Parameters:
984
- - `network` - - Source network.
985
- - `nodeType` - - Desired node type.
958
+ - `randomValue` - - Random generator.
986
959
 
987
- Returns: Matching nodes.
960
+ Returns: Hidden node.
988
961
 
989
- ### warnWhenEnabled
962
+ ### createRecurrentLayer
990
963
 
991
964
  ```ts
992
- warnWhenEnabled(
993
- message: string,
994
- ): void
965
+ createRecurrentLayer(
966
+ blockType: "lstm" | "gru",
967
+ ): RecurrentLayerShape
995
968
  ```
996
969
 
997
- Emits a warning when warning mode is enabled.
970
+ Creates recurrent layer by type.
998
971
 
999
972
  Parameters:
1000
- - `message` - - Warning message.
973
+ - `blockType` - - Recurrent block type.
1001
974
 
1002
- Returns: Nothing.
975
+ Returns: Created recurrent layer.
1003
976
 
1004
- ### resolveSelectedForwardConnectionPair
977
+ ### createSourcePeerConnectionCountContext
1005
978
 
1006
979
  ```ts
1007
- resolveSelectedForwardConnectionPair(
1008
- network: default,
1009
- randomValue: () => number,
1010
- ): NodePair | undefined
980
+ createSourcePeerConnectionCountContext(
981
+ candidateConnection: default,
982
+ targetLayerPeers: default[],
983
+ ): SourcePeerConnectionCountContext
1011
984
  ```
1012
985
 
1013
- Resolves random selected forward connection pair.
986
+ Creates immutable context for source-to-peer connection counting.
1014
987
 
1015
988
  Parameters:
1016
- - `network` - - Target network.
1017
- - `randomValue` - - Random generator.
989
+ - `candidateConnection` - - Candidate connection.
990
+ - `targetLayerPeers` - - Peer-set nodes.
1018
991
 
1019
- Returns: Selected source/target pair.
992
+ Returns: Count context.
1020
993
 
1021
- ### collectForwardConnectionCandidates
994
+ ### createTargetLayerPeerContext
1022
995
 
1023
996
  ```ts
1024
- collectForwardConnectionCandidates(
997
+ createTargetLayerPeerContext(
1025
998
  network: default,
1026
- ): NodePair[]
999
+ targetNode: default,
1000
+ ): TargetLayerPeerContext
1027
1001
  ```
1028
1002
 
1029
- Collects forward connection candidates.
1003
+ Creates immutable context for peer-layer collection.
1030
1004
 
1031
1005
  Parameters:
1032
1006
  - `network` - - Target network.
1007
+ - `targetNode` - - Peer anchor node.
1033
1008
 
1034
- Returns: Candidate source/target pairs.
1009
+ Returns: Peer traversal context.
1035
1010
 
1036
- ### collectForwardTraversalContexts
1011
+ ### createWeightSamplingRangeContext
1037
1012
 
1038
1013
  ```ts
1039
- collectForwardTraversalContexts(
1040
- network: default,
1041
- ): ForwardCandidateTraversalContext[]
1014
+ createWeightSamplingRangeContext(
1015
+ reinitContext: ConnectionGroupReinitContext,
1016
+ ): WeightSamplingRangeContext
1042
1017
  ```
1043
1018
 
1044
- Collects forward traversal contexts for all eligible source nodes.
1019
+ Creates immutable sampling range context.
1045
1020
 
1046
1021
  Parameters:
1047
- - `network` - - Target network.
1022
+ - `reinitContext` - - Reinitialization context.
1048
1023
 
1049
- Returns: Forward traversal contexts.
1024
+ Returns: Sampling range context.
1050
1025
 
1051
- ### collectForwardCandidatesFromContext
1026
+ ### disconnectConnectionAndGetGater
1052
1027
 
1053
1028
  ```ts
1054
- collectForwardCandidatesFromContext(
1055
- forwardConnectionCandidates: NodePair[],
1056
- traversalContext: ForwardCandidateTraversalContext,
1057
- ): NodePair[]
1029
+ disconnectConnectionAndGetGater(
1030
+ network: default,
1031
+ connectionToExpand: default,
1032
+ ): default | null
1058
1033
  ```
1059
1034
 
1060
- Reduces one forward traversal context into candidate connection pairs.
1035
+ Disconnects a connection and returns its previous gater.
1061
1036
 
1062
1037
  Parameters:
1063
- - `forwardConnectionCandidates` - - Existing candidate pairs.
1064
- - `traversalContext` - - Source traversal context.
1038
+ - `network` - - Target network.
1039
+ - `connectionToExpand` - - Connection being expanded.
1065
1040
 
1066
- Returns: Updated candidate pairs.
1041
+ Returns: Previous gater reference.
1067
1042
 
1068
- ### createForwardCandidateTraversalContext
1043
+ ### disconnectConnectionPair
1069
1044
 
1070
1045
  ```ts
1071
- createForwardCandidateTraversalContext(
1046
+ disconnectConnectionPair(
1072
1047
  network: default,
1073
- sourceNodeIndex: number,
1074
- ): ForwardCandidateTraversalContext
1048
+ selectedConnection: default,
1049
+ ): void
1075
1050
  ```
1076
1051
 
1077
- Creates context for one forward-candidate source traversal pass.
1052
+ Disconnects selected connection by endpoints.
1078
1053
 
1079
1054
  Parameters:
1080
1055
  - `network` - - Target network.
1081
- - `sourceNodeIndex` - - Current source index.
1056
+ - `selectedConnection` - - Connection to disconnect.
1082
1057
 
1083
- Returns: Immutable traversal context.
1058
+ Returns: Nothing.
1084
1059
 
1085
- ### collectForwardCandidatesForSource
1060
+ ### disconnectUnexpectedOutgoingConnections
1086
1061
 
1087
1062
  ```ts
1088
- collectForwardCandidatesForSource(
1089
- traversalContext: ForwardCandidateTraversalContext,
1090
- ): NodePair[]
1063
+ disconnectUnexpectedOutgoingConnections(
1064
+ network: default,
1065
+ chainNode: default,
1066
+ expectedTargetNode: default,
1067
+ ): void
1091
1068
  ```
1092
1069
 
1093
- Collects all forward candidates for one source traversal context.
1070
+ Removes outgoing connections that do not match the expected chain target.
1094
1071
 
1095
1072
  Parameters:
1096
- - `traversalContext` - - Source traversal context.
1073
+ - `network` - - Target network.
1074
+ - `chainNode` - - Node whose outgoing edges are validated.
1075
+ - `expectedTargetNode` - - Allowed outgoing target.
1097
1076
 
1098
- Returns: Candidate source/target pairs.
1077
+ Returns: Nothing.
1099
1078
 
1100
- ### isForwardCandidateTargetAvailable
1079
+ ### enableNodeBatchNorm
1101
1080
 
1102
1081
  ```ts
1103
- isForwardCandidateTargetAvailable(
1104
- sourceNode: default,
1105
- targetNode: default,
1106
- ): boolean
1082
+ enableNodeBatchNorm(
1083
+ node: default,
1084
+ ): void
1107
1085
  ```
1108
1086
 
1109
- Checks whether a forward candidate target is not already projected.
1087
+ Enables internal batch-norm flag on a node.
1110
1088
 
1111
1089
  Parameters:
1112
- - `sourceNode` - - Candidate source node.
1113
- - `targetNode` - - Candidate target node.
1090
+ - `node` - - Node to flag.
1114
1091
 
1115
- Returns: True when connection may be added.
1092
+ Returns: Nothing.
1116
1093
 
1117
- ### disconnectConnectionPair
1094
+ ### ensureConnection
1118
1095
 
1119
1096
  ```ts
1120
- disconnectConnectionPair(
1097
+ ensureConnection(
1121
1098
  network: default,
1122
- selectedConnection: default,
1123
- ): void
1099
+ fromNode: default,
1100
+ toNode: default,
1101
+ ): default | undefined
1124
1102
  ```
1125
1103
 
1126
- Disconnects selected connection by endpoints.
1104
+ Ensures a connection exists and returns it.
1127
1105
 
1128
1106
  Parameters:
1129
1107
  - `network` - - Target network.
1130
- - `selectedConnection` - - Connection to disconnect.
1108
+ - `fromNode` - - Source node.
1109
+ - `toNode` - - Target node.
1131
1110
 
1132
- Returns: Nothing.
1111
+ Returns: Existing or created connection.
1133
1112
 
1134
- ### collectRemovableForwardConnections
1113
+ ### ensureSeedForwardConnectionWhenEmpty
1135
1114
 
1136
1115
  ```ts
1137
- collectRemovableForwardConnections(
1116
+ ensureSeedForwardConnectionWhenEmpty(
1138
1117
  network: default,
1139
- ): default[]
1118
+ ): boolean
1140
1119
  ```
1141
1120
 
1142
- Collects removable forward connections using redundancy constraints.
1121
+ Ensures a seed input->output connection exists when connection list is empty.
1143
1122
 
1144
1123
  Parameters:
1145
1124
  - `network` - - Target network.
1146
1125
 
1147
- Returns: Removable forward connections.
1126
+ Returns: True when mutation may continue.
1148
1127
 
1149
- ### isRemovableForwardConnection
1128
+ ### expandConnectionWithRecurrentBlock
1150
1129
 
1151
1130
  ```ts
1152
- isRemovableForwardConnection(
1131
+ expandConnectionWithRecurrentBlock(
1153
1132
  network: default,
1154
- candidateConnection: default,
1155
- ): boolean
1133
+ connectionToExpand: default,
1134
+ blockType: "lstm" | "gru",
1135
+ ): void
1156
1136
  ```
1157
1137
 
1158
- Evaluates whether a forward connection is safe to remove.
1138
+ Replaces one connection with a minimal recurrent block.
1159
1139
 
1160
1140
  Parameters:
1161
1141
  - `network` - - Target network.
1162
- - `candidateConnection` - - Connection under evaluation.
1142
+ - `connectionToExpand` - - Connection to replace.
1143
+ - `blockType` - - Recurrent block type.
1163
1144
 
1164
- Returns: True when removable.
1145
+ Returns: Nothing.
1165
1146
 
1166
- ### isForwardConnectionStructurallyRemovable
1147
+ ### findConnection
1167
1148
 
1168
1149
  ```ts
1169
- isForwardConnectionStructurallyRemovable(
1150
+ findConnection(
1170
1151
  network: default,
1171
- candidateConnection: default,
1172
- ): boolean
1152
+ fromNode: default,
1153
+ toNode: default,
1154
+ ): default | undefined
1173
1155
  ```
1174
1156
 
1175
- Checks structural preconditions for removable forward connections.
1157
+ Gets a connection between two nodes when it exists.
1176
1158
 
1177
1159
  Parameters:
1178
1160
  - `network` - - Target network.
1179
- - `candidateConnection` - - Candidate connection.
1161
+ - `fromNode` - - Source node.
1162
+ - `toNode` - - Target node.
1180
1163
 
1181
- Returns: True when the connection is a forward edge with redundant endpoints.
1164
+ Returns: Matching connection or undefined.
1182
1165
 
1183
- ### createDirectionalConnectionContext
1166
+ ### findFirstNodeByType
1184
1167
 
1185
1168
  ```ts
1186
- createDirectionalConnectionContext(
1169
+ findFirstNodeByType(
1187
1170
  network: default,
1188
- candidateConnection: default,
1189
- ): DirectionalConnectionContext
1171
+ nodeType: string,
1172
+ ): default | undefined
1190
1173
  ```
1191
1174
 
1192
- Creates indexed directional context for a connection candidate.
1175
+ Returns the first node by type.
1193
1176
 
1194
1177
  Parameters:
1195
1178
  - `network` - - Target network.
1196
- - `candidateConnection` - - Candidate connection.
1179
+ - `nodeType` - - Node type to match.
1197
1180
 
1198
- Returns: Directional context.
1181
+ Returns: Matching node or undefined.
1199
1182
 
1200
1183
  ### hasRedundantEndpoints
1201
1184
 
@@ -1212,145 +1195,196 @@ Parameters:
1212
1195
 
1213
1196
  Returns: True when endpoint redundancy exists.
1214
1197
 
1215
- ### isForwardDirectionalContext
1198
+ ### initializeDeterministicChain
1216
1199
 
1217
1200
  ```ts
1218
- isForwardDirectionalContext(
1219
- directionContext: DirectionalConnectionContext,
1220
- ): boolean
1201
+ initializeDeterministicChain(
1202
+ network: default,
1203
+ mutationProps: NetworkMutationProps,
1204
+ inputNode: default,
1205
+ outputNode: default,
1206
+ ): void
1221
1207
  ```
1222
1208
 
1223
- Checks whether a directional context represents a forward edge.
1209
+ Initializes deterministic chain storage and seed edge.
1224
1210
 
1225
1211
  Parameters:
1226
- - `directionContext` - - Directional context.
1212
+ - `network` - - Target network.
1213
+ - `mutationProps` - - Runtime mutation props.
1214
+ - `inputNode` - - Input node.
1215
+ - `outputNode` - - Output node.
1227
1216
 
1228
- Returns: True when forward.
1217
+ Returns: Nothing.
1229
1218
 
1230
- ### wouldDisconnectTargetPeerLayerGroup
1219
+ ### insertNodeBeforeOutputTail
1231
1220
 
1232
1221
  ```ts
1233
- wouldDisconnectTargetPeerLayerGroup(
1222
+ insertNodeBeforeOutputTail(
1234
1223
  network: default,
1235
- candidateConnection: default,
1236
- ): boolean
1224
+ nodeToInsert: default,
1225
+ targetNode: default,
1226
+ mutationProps: NetworkMutationProps,
1227
+ ): void
1237
1228
  ```
1238
1229
 
1239
- Determines whether removal would disconnect a target peer-layer group.
1230
+ Inserts a node before output tail while preserving output block ordering.
1240
1231
 
1241
1232
  Parameters:
1242
1233
  - `network` - - Target network.
1243
- - `candidateConnection` - - Connection under evaluation.
1234
+ - `nodeToInsert` - - Node to insert.
1235
+ - `targetNode` - - Target node for insertion alignment.
1236
+ - `mutationProps` - - Runtime mutation props.
1244
1237
 
1245
- Returns: True when peer group would be disconnected.
1238
+ Returns: Nothing.
1246
1239
 
1247
- ### countSourceConnectionsIntoPeerSet
1240
+ ### isBackwardCandidateTargetAvailable
1248
1241
 
1249
1242
  ```ts
1250
- countSourceConnectionsIntoPeerSet(
1251
- network: default,
1252
- candidateConnection: default,
1253
- targetLayerPeers: default[],
1254
- ): number
1243
+ isBackwardCandidateTargetAvailable(
1244
+ laterNode: default,
1245
+ earlierNode: default,
1246
+ ): boolean
1255
1247
  ```
1256
1248
 
1257
- Counts source-originated connections that end inside the target peer set.
1249
+ Checks whether a backward candidate target is not already projected.
1258
1250
 
1259
1251
  Parameters:
1260
- - `network` - - Target network.
1261
- - `candidateConnection` - - Candidate connection.
1262
- - `targetLayerPeers` - - Peer-set nodes.
1252
+ - `laterNode` - - Candidate source node.
1253
+ - `earlierNode` - - Candidate target node.
1263
1254
 
1264
- Returns: Number of source-to-peer connections.
1255
+ Returns: True when connection may be added.
1265
1256
 
1266
- ### createSourcePeerConnectionCountContext
1257
+ ### isBackwardDirectionalContext
1267
1258
 
1268
1259
  ```ts
1269
- createSourcePeerConnectionCountContext(
1270
- candidateConnection: default,
1271
- targetLayerPeers: default[],
1272
- ): SourcePeerConnectionCountContext
1260
+ isBackwardDirectionalContext(
1261
+ directionContext: DirectionalConnectionContext,
1262
+ ): boolean
1273
1263
  ```
1274
1264
 
1275
- Creates immutable context for source-to-peer connection counting.
1265
+ Checks whether a directional context represents a backward edge.
1276
1266
 
1277
1267
  Parameters:
1278
- - `candidateConnection` - - Candidate connection.
1279
- - `targetLayerPeers` - - Peer-set nodes.
1268
+ - `directionContext` - - Directional context.
1280
1269
 
1281
- Returns: Count context.
1270
+ Returns: True when backward.
1282
1271
 
1283
- ### countConnectionWhenSourceTargetsPeer
1272
+ ### isForwardCandidateTargetAvailable
1284
1273
 
1285
1274
  ```ts
1286
- countConnectionWhenSourceTargetsPeer(
1287
- peerConnectionsFromSource: number,
1288
- existingConnection: default,
1289
- countContext: SourcePeerConnectionCountContext,
1290
- ): number
1275
+ isForwardCandidateTargetAvailable(
1276
+ sourceNode: default,
1277
+ targetNode: default,
1278
+ ): boolean
1291
1279
  ```
1292
1280
 
1293
- Counts one connection when it originates from source and targets a peer.
1281
+ Checks whether a forward candidate target is not already projected.
1294
1282
 
1295
1283
  Parameters:
1296
- - `peerConnectionsFromSource` - - Current count.
1297
- - `existingConnection` - - Existing network connection.
1298
- - `countContext` - - Count context.
1284
+ - `sourceNode` - - Candidate source node.
1285
+ - `targetNode` - - Candidate target node.
1299
1286
 
1300
- Returns: Updated count.
1287
+ Returns: True when connection may be added.
1301
1288
 
1302
- ### collectTargetLayerPeers
1289
+ ### isForwardConnectionStructurallyRemovable
1303
1290
 
1304
1291
  ```ts
1305
- collectTargetLayerPeers(
1292
+ isForwardConnectionStructurallyRemovable(
1306
1293
  network: default,
1307
- targetNode: default,
1308
- ): default[]
1294
+ candidateConnection: default,
1295
+ ): boolean
1309
1296
  ```
1310
1297
 
1311
- Collects peers around a target node in the same type/layer neighborhood.
1298
+ Checks structural preconditions for removable forward connections.
1312
1299
 
1313
1300
  Parameters:
1314
1301
  - `network` - - Target network.
1315
- - `targetNode` - - Node whose peers are collected.
1302
+ - `candidateConnection` - - Candidate connection.
1316
1303
 
1317
- Returns: Peer nodes.
1304
+ Returns: True when the connection is a forward edge with redundant endpoints.
1318
1305
 
1319
- ### isTargetLayerPeer
1306
+ ### isForwardDirectionalContext
1320
1307
 
1321
1308
  ```ts
1322
- isTargetLayerPeer(
1309
+ isForwardDirectionalContext(
1310
+ directionContext: DirectionalConnectionContext,
1311
+ ): boolean
1312
+ ```
1313
+
1314
+ Checks whether a directional context represents a forward edge.
1315
+
1316
+ Parameters:
1317
+ - `directionContext` - - Directional context.
1318
+
1319
+ Returns: True when forward.
1320
+
1321
+ ### isNodeWithoutSelfLoop
1322
+
1323
+ ```ts
1324
+ isNodeWithoutSelfLoop(
1323
1325
  candidateNode: default,
1324
- candidateNodeIndex: number,
1325
- peerContext: TargetLayerPeerContext,
1326
1326
  ): boolean
1327
1327
  ```
1328
1328
 
1329
- Checks whether candidate node belongs to the target peer-layer set.
1329
+ Checks whether a node currently has no self-loop connections.
1330
1330
 
1331
1331
  Parameters:
1332
- - `candidateNode` - - Candidate node.
1333
- - `candidateNodeIndex` - - Candidate node index.
1334
- - `peerContext` - - Peer traversal context.
1332
+ - `candidateNode` - - Node under evaluation.
1335
1333
 
1336
- Returns: True when candidate is an eligible peer.
1334
+ Returns: True when the node has no self-loop.
1337
1335
 
1338
- ### createTargetLayerPeerContext
1336
+ ### isRemovableBackwardConnection
1339
1337
 
1340
1338
  ```ts
1341
- createTargetLayerPeerContext(
1339
+ isRemovableBackwardConnection(
1342
1340
  network: default,
1343
- targetNode: default,
1344
- ): TargetLayerPeerContext
1341
+ candidateConnection: default,
1342
+ ): boolean
1345
1343
  ```
1346
1344
 
1347
- Creates immutable context for peer-layer collection.
1345
+ Evaluates whether a backward connection is safe to remove.
1348
1346
 
1349
1347
  Parameters:
1350
1348
  - `network` - - Target network.
1351
- - `targetNode` - - Peer anchor node.
1349
+ - `candidateConnection` - - Connection under evaluation.
1352
1350
 
1353
- Returns: Peer traversal context.
1351
+ Returns: True when removable.
1352
+
1353
+ ### isRemovableForwardConnection
1354
+
1355
+ ```ts
1356
+ isRemovableForwardConnection(
1357
+ network: default,
1358
+ candidateConnection: default,
1359
+ ): boolean
1360
+ ```
1361
+
1362
+ Evaluates whether a forward connection is safe to remove.
1363
+
1364
+ Parameters:
1365
+ - `network` - - Target network.
1366
+ - `candidateConnection` - - Connection under evaluation.
1367
+
1368
+ Returns: True when removable.
1369
+
1370
+ ### isTargetLayerPeer
1371
+
1372
+ ```ts
1373
+ isTargetLayerPeer(
1374
+ candidateNode: default,
1375
+ candidateNodeIndex: number,
1376
+ peerContext: TargetLayerPeerContext,
1377
+ ): boolean
1378
+ ```
1379
+
1380
+ Checks whether candidate node belongs to the target peer-layer set.
1381
+
1382
+ Parameters:
1383
+ - `candidateNode` - - Candidate node.
1384
+ - `candidateNodeIndex` - - Candidate node index.
1385
+ - `peerContext` - - Peer traversal context.
1386
+
1387
+ Returns: True when candidate is an eligible peer.
1354
1388
 
1355
1389
  ### isTargetLayerPeerTypeMatch
1356
1390
 
@@ -1386,683 +1420,649 @@ Parameters:
1386
1420
 
1387
1421
  Returns: True when within distance.
1388
1422
 
1389
- ### containsNode
1423
+ ### isUngatedConnection
1390
1424
 
1391
1425
  ```ts
1392
- containsNode(
1393
- nodes: default[],
1394
- node: default,
1426
+ isUngatedConnection(
1427
+ candidateConnection: default,
1395
1428
  ): boolean
1396
1429
  ```
1397
1430
 
1398
- Checks whether a node list contains a node reference.
1431
+ Checks whether a connection has no gater attached.
1399
1432
 
1400
1433
  Parameters:
1401
- - `nodes` - - Node list.
1402
- - `node` - - Node reference.
1434
+ - `candidateConnection` - - Connection under evaluation.
1403
1435
 
1404
- Returns: True when contained.
1436
+ Returns: True when ungated.
1405
1437
 
1406
- ### collectAllConnections
1438
+ ### markTopoDirtyIfAcyclic
1407
1439
 
1408
1440
  ```ts
1409
- collectAllConnections(
1410
- network: default,
1411
- ): default[]
1441
+ markTopoDirtyIfAcyclic(
1442
+ mutationProps: NetworkMutationProps,
1443
+ ): void
1412
1444
  ```
1413
1445
 
1414
- Collects normal and self connections.
1446
+ Marks topology caches dirty when acyclic mode is enforced.
1415
1447
 
1416
1448
  Parameters:
1417
- - `network` - - Target network.
1449
+ - `mutationProps` - - Runtime mutation props.
1418
1450
 
1419
- Returns: Combined connections.
1451
+ Returns: Nothing.
1420
1452
 
1421
- ### resolveMethodObject
1453
+ ### modActivation
1422
1454
 
1423
1455
  ```ts
1424
- resolveMethodObject(
1456
+ modActivation(
1425
1457
  method: MutationMethod | undefined,
1426
- ): { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; }
1458
+ ): void
1427
1459
  ```
1428
1460
 
1429
- Extracts method-object form when provided.
1461
+ Mutates activation function on one random non-input node.
1462
+
1463
+ Output-node eligibility is controlled by `method.mutateOutput` when provided.
1430
1464
 
1431
1465
  Parameters:
1432
- - `method` - - Optional mutation method.
1466
+ - `this` - - Bound network.
1467
+ - `method` - - Optional method descriptor.
1433
1468
 
1434
- Returns: Method object view.
1469
+ Returns: Nothing.
1435
1470
 
1436
- ### sampleUniform
1471
+ ### modBias
1437
1472
 
1438
1473
  ```ts
1439
- sampleUniform(
1440
- randomValue: () => number,
1441
- minValue: number,
1442
- maxValue: number,
1443
- ): number
1474
+ modBias(
1475
+ method: MutationMethod | undefined,
1476
+ ): void
1444
1477
  ```
1445
1478
 
1446
- Samples a uniform value from [minValue, maxValue].
1479
+ Mutates bias parameters on one random non-input node.
1480
+
1481
+ Output nodes remain eligible for this operator.
1447
1482
 
1448
1483
  Parameters:
1449
- - `randomValue` - - Random generator.
1450
- - `minValue` - - Minimum value.
1451
- - `maxValue` - - Maximum value.
1484
+ - `this` - - Bound network.
1485
+ - `method` - - Optional method descriptor.
1452
1486
 
1453
- Returns: Sampled value.
1487
+ Returns: Nothing.
1454
1488
 
1455
- ### pickRandomNonInputNode
1489
+ ### modWeight
1456
1490
 
1457
1491
  ```ts
1458
- pickRandomNonInputNode(
1459
- network: default,
1460
- excludeOutputNodes: boolean,
1461
- randomValue: () => number,
1462
- ): default | undefined
1492
+ modWeight(
1493
+ method: MutationMethod | undefined,
1494
+ ): void
1463
1495
  ```
1464
1496
 
1465
- Selects a random mutable non-input node.
1497
+ Perturbs one connection weight using a uniform delta sampled from configured bounds.
1498
+
1499
+ The candidate pool includes standard and self-connections.
1466
1500
 
1467
1501
  Parameters:
1468
- - `network` - - Target network.
1469
- - `excludeOutputNodes` - - True to exclude outputs.
1470
- - `randomValue` - - Random generator.
1502
+ - `this` - - Bound network.
1503
+ - `method` - - Optional method descriptor.
1471
1504
 
1472
- Returns: Selected mutable node.
1505
+ Returns: Nothing.
1473
1506
 
1474
- ### collectMutableNonInputNodes
1507
+ ### pickDistinctNodePair
1475
1508
 
1476
1509
  ```ts
1477
- collectMutableNonInputNodes(
1478
- network: default,
1479
- excludeOutputNodes: boolean,
1480
- ): default[]
1510
+ pickDistinctNodePair(
1511
+ swappableNodes: default[],
1512
+ randomValue: () => number,
1513
+ ): DistinctNodePair | undefined
1481
1514
  ```
1482
1515
 
1483
- Collects mutable non-input nodes.
1516
+ Picks two distinct nodes from a candidate set.
1484
1517
 
1485
1518
  Parameters:
1486
- - `network` - - Target network.
1487
- - `excludeOutputNodes` - - True to exclude output nodes.
1519
+ - `swappableNodes` - - Swap candidate nodes.
1520
+ - `randomValue` - - Random generator.
1488
1521
 
1489
- Returns: Mutable nodes.
1522
+ Returns: Distinct pair or undefined.
1490
1523
 
1491
- ### resolveSelfConnectionTargetNode
1524
+ ### pickDistinctRandomNode
1492
1525
 
1493
1526
  ```ts
1494
- resolveSelfConnectionTargetNode(
1495
- network: default,
1527
+ pickDistinctRandomNode(
1528
+ nodeCandidates: default[],
1529
+ excludedNode: default,
1496
1530
  randomValue: () => number,
1497
1531
  ): default | undefined
1498
1532
  ```
1499
1533
 
1500
- Resolves random node eligible for self-connection creation.
1534
+ Picks a random node distinct from a given reference.
1501
1535
 
1502
1536
  Parameters:
1503
- - `network` - - Target network.
1537
+ - `nodeCandidates` - - Candidate nodes.
1538
+ - `excludedNode` - - Node to exclude.
1504
1539
  - `randomValue` - - Random generator.
1505
1540
 
1506
- Returns: Selected node.
1541
+ Returns: Distinct node or undefined.
1507
1542
 
1508
- ### collectNodesWithoutSelfLoop
1543
+ ### pickRandomEntry
1509
1544
 
1510
1545
  ```ts
1511
- collectNodesWithoutSelfLoop(
1512
- network: default,
1513
- ): default[]
1546
+ pickRandomEntry(
1547
+ entries: T[],
1548
+ randomValue: () => number,
1549
+ ): T | undefined
1514
1550
  ```
1515
1551
 
1516
- Collects non-input nodes that do not have self loops.
1552
+ Selects a random array element.
1517
1553
 
1518
1554
  Parameters:
1519
- - `network` - - Target network.
1555
+ - `entries` - - Source entries.
1556
+ - `randomValue` - - Random generator.
1520
1557
 
1521
- Returns: Eligible nodes.
1558
+ Returns: Random entry or undefined when empty.
1522
1559
 
1523
- ### isNodeWithoutSelfLoop
1560
+ ### pickRandomNonInputNode
1524
1561
 
1525
1562
  ```ts
1526
- isNodeWithoutSelfLoop(
1527
- candidateNode: default,
1528
- ): boolean
1529
- ```
1530
-
1531
- Checks whether a node currently has no self-loop connections.
1532
-
1533
- Parameters:
1534
- - `candidateNode` - - Node under evaluation.
1535
-
1536
- Returns: True when the node has no self-loop.
1537
-
1538
- ### collectUngatedConnections
1539
-
1540
- ```ts
1541
- collectUngatedConnections(
1563
+ pickRandomNonInputNode(
1542
1564
  network: default,
1543
- ): default[]
1565
+ excludeOutputNodes: boolean,
1566
+ randomValue: () => number,
1567
+ ): default | undefined
1544
1568
  ```
1545
1569
 
1546
- Collects ungated connections including self-connections.
1570
+ Selects a random mutable non-input node.
1547
1571
 
1548
1572
  Parameters:
1549
1573
  - `network` - - Target network.
1574
+ - `excludeOutputNodes` - - True to exclude outputs.
1575
+ - `randomValue` - - Random generator.
1550
1576
 
1551
- Returns: Ungated connections.
1577
+ Returns: Selected mutable node.
1552
1578
 
1553
- ### isUngatedConnection
1579
+ ### pruneDeterministicChainExtraEdges
1554
1580
 
1555
1581
  ```ts
1556
- isUngatedConnection(
1557
- candidateConnection: default,
1558
- ): boolean
1582
+ pruneDeterministicChainExtraEdges(
1583
+ network: default,
1584
+ deterministicChain: default[],
1585
+ outputNode: default,
1586
+ ): void
1559
1587
  ```
1560
1588
 
1561
- Checks whether a connection has no gater attached.
1589
+ Prunes side edges from chain nodes to preserve linear deterministic depth.
1562
1590
 
1563
1591
  Parameters:
1564
- - `candidateConnection` - - Connection under evaluation.
1592
+ - `network` - - Target network.
1593
+ - `deterministicChain` - - Chain node list.
1594
+ - `outputNode` - - Output node.
1565
1595
 
1566
- Returns: True when ungated.
1596
+ Returns: Nothing.
1567
1597
 
1568
- ### resolveSelectedBackwardConnectionPair
1598
+ ### reconnectThroughRecurrentLayer
1569
1599
 
1570
1600
  ```ts
1571
- resolveSelectedBackwardConnectionPair(
1601
+ reconnectThroughRecurrentLayer(
1572
1602
  network: default,
1573
- randomValue: () => number,
1574
- ): NodePair | undefined
1603
+ connectionToExpand: default,
1604
+ recurrentLayer: RecurrentLayerShape,
1605
+ ): default | undefined
1575
1606
  ```
1576
1607
 
1577
- Resolves random selected backward connection pair.
1608
+ Reconnects a source/target pair through a recurrent layer.
1578
1609
 
1579
1610
  Parameters:
1580
1611
  - `network` - - Target network.
1581
- - `randomValue` - - Random generator.
1612
+ - `connectionToExpand` - - Original connection.
1613
+ - `recurrentLayer` - - Recurrent-layer shape.
1582
1614
 
1583
- Returns: Selected source/target pair.
1615
+ Returns: Latest newly created connection or undefined.
1584
1616
 
1585
- ### collectBackwardConnectionCandidates
1617
+ ### reinitializeConnectionGroupWeights
1586
1618
 
1587
1619
  ```ts
1588
- collectBackwardConnectionCandidates(
1589
- network: default,
1590
- ): NodePair[]
1620
+ reinitializeConnectionGroupWeights(
1621
+ connections: default[],
1622
+ reinitContext: ConnectionGroupReinitContext,
1623
+ ): void
1591
1624
  ```
1592
1625
 
1593
- Collects backward (recurrent) connection candidates.
1626
+ Reinitializes all weights in a connection group.
1594
1627
 
1595
1628
  Parameters:
1596
- - `network` - - Target network.
1629
+ - `connections` - - Connection group.
1630
+ - `randomValue` - - Random generator.
1631
+ - `minWeight` - - Minimum sampled weight.
1632
+ - `maxWeight` - - Maximum sampled weight.
1597
1633
 
1598
- Returns: Candidate source/target pairs.
1634
+ Returns: Nothing.
1599
1635
 
1600
- ### collectBackwardTraversalContexts
1636
+ ### reinitWeight
1601
1637
 
1602
1638
  ```ts
1603
- collectBackwardTraversalContexts(
1604
- network: default,
1605
- ): BackwardCandidateTraversalContext[]
1639
+ reinitWeight(
1640
+ method: MutationMethod | undefined,
1641
+ ): void
1606
1642
  ```
1607
1643
 
1608
- Collects backward traversal contexts for all eligible later nodes.
1644
+ Reinitializes incoming, outgoing, and self-connection weights for one target node.
1645
+
1646
+ Weight sampling bounds come from method overrides or default mutation bounds.
1609
1647
 
1610
1648
  Parameters:
1611
- - `network` - - Target network.
1649
+ - `this` - - Bound network.
1650
+ - `method` - - Optional method descriptor.
1612
1651
 
1613
- Returns: Backward traversal contexts.
1652
+ Returns: Nothing.
1614
1653
 
1615
- ### collectBackwardCandidatesFromContext
1654
+ ### removeHiddenNodeAndApplyStabilityNudge
1616
1655
 
1617
1656
  ```ts
1618
- collectBackwardCandidatesFromContext(
1619
- backwardConnectionCandidates: NodePair[],
1620
- traversalContext: BackwardCandidateTraversalContext,
1621
- ): NodePair[]
1657
+ removeHiddenNodeAndApplyStabilityNudge(
1658
+ network: default,
1659
+ hiddenNode: default,
1660
+ ): void
1622
1661
  ```
1623
1662
 
1624
- Reduces one backward traversal context into candidate connection pairs.
1663
+ Removes selected hidden node and applies stability nudge.
1625
1664
 
1626
1665
  Parameters:
1627
- - `backwardConnectionCandidates` - - Existing candidate pairs.
1628
- - `traversalContext` - - Later-node traversal context.
1666
+ - `network` - - Target network.
1667
+ - `hiddenNode` - - Hidden node to remove.
1629
1668
 
1630
- Returns: Updated candidate pairs.
1669
+ Returns: Nothing.
1631
1670
 
1632
- ### createBackwardCandidateTraversalContext
1671
+ ### resolveDeterministicChainMutationContext
1633
1672
 
1634
1673
  ```ts
1635
- createBackwardCandidateTraversalContext(
1674
+ resolveDeterministicChainMutationContext(
1636
1675
  network: default,
1637
- laterNodeIndex: number,
1638
- ): BackwardCandidateTraversalContext
1676
+ mutationProps: NetworkMutationProps,
1677
+ ): DeterministicChainMutationContext | undefined
1639
1678
  ```
1640
1679
 
1641
- Creates context for one backward-candidate traversal pass.
1680
+ Resolves all deterministic add-node prerequisites into one context object.
1642
1681
 
1643
1682
  Parameters:
1644
1683
  - `network` - - Target network.
1645
- - `laterNodeIndex` - - Current later-node index.
1684
+ - `mutationProps` - - Runtime mutation props.
1646
1685
 
1647
- Returns: Immutable traversal context.
1686
+ Returns: Deterministic context or undefined when one or more prerequisites fail.
1648
1687
 
1649
- ### collectBackwardCandidatesForLaterNode
1688
+ ### resolveDistinctPairWithKnownFirstNode
1650
1689
 
1651
1690
  ```ts
1652
- collectBackwardCandidatesForLaterNode(
1653
- traversalContext: BackwardCandidateTraversalContext,
1654
- ): NodePair[]
1691
+ resolveDistinctPairWithKnownFirstNode(
1692
+ swappableNodes: default[],
1693
+ firstNode: default,
1694
+ randomValue: () => number,
1695
+ ): DistinctNodePair | undefined
1655
1696
  ```
1656
1697
 
1657
- Collects all backward candidates for one later-node traversal context.
1698
+ Resolves a distinct pair when first node is already known.
1658
1699
 
1659
1700
  Parameters:
1660
- - `traversalContext` - - Later-node traversal context.
1701
+ - `swappableNodes` - - Swap candidate nodes.
1702
+ - `firstNode` - - Chosen first node.
1703
+ - `randomValue` - - Random generator.
1661
1704
 
1662
- Returns: Candidate source/target pairs.
1705
+ Returns: Distinct pair or undefined.
1663
1706
 
1664
- ### isBackwardCandidateTargetAvailable
1707
+ ### resolveExpectedChainTarget
1665
1708
 
1666
1709
  ```ts
1667
- isBackwardCandidateTargetAvailable(
1668
- laterNode: default,
1669
- earlierNode: default,
1670
- ): boolean
1710
+ resolveExpectedChainTarget(
1711
+ deterministicChain: default[],
1712
+ chainNodeIndex: number,
1713
+ outputNode: default,
1714
+ ): default
1671
1715
  ```
1672
1716
 
1673
- Checks whether a backward candidate target is not already projected.
1717
+ Resolves the expected outgoing target for a chain node position.
1674
1718
 
1675
1719
  Parameters:
1676
- - `laterNode` - - Candidate source node.
1677
- - `earlierNode` - - Candidate target node.
1720
+ - `deterministicChain` - - Chain node list.
1721
+ - `chainNodeIndex` - - Current chain index.
1722
+ - `outputNode` - - Terminal output node.
1678
1723
 
1679
- Returns: True when connection may be added.
1724
+ Returns: Expected successor target.
1680
1725
 
1681
- ### connectPair
1726
+ ### resolveInputOutputEndpoints
1682
1727
 
1683
1728
  ```ts
1684
- connectPair(
1729
+ resolveInputOutputEndpoints(
1685
1730
  network: default,
1686
- selectedConnectionPair: NodePair,
1687
- ): void
1731
+ ): InputOutputEndpoints | undefined
1688
1732
  ```
1689
1733
 
1690
- Connects source/target node pair.
1734
+ Resolves input/output endpoints required for seed and deterministic flows.
1691
1735
 
1692
1736
  Parameters:
1693
1737
  - `network` - - Target network.
1694
- - `selectedConnectionPair` - - Source/target pair.
1695
1738
 
1696
- Returns: Nothing.
1739
+ Returns: Endpoint nodes or undefined when missing.
1697
1740
 
1698
- ### collectRemovableBackwardConnections
1741
+ ### resolveMethodObject
1699
1742
 
1700
1743
  ```ts
1701
- collectRemovableBackwardConnections(
1702
- network: default,
1703
- ): default[]
1744
+ resolveMethodObject(
1745
+ method: MutationMethod | undefined,
1746
+ ): { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; }
1704
1747
  ```
1705
1748
 
1706
- Collects removable backward connections using redundancy constraints.
1749
+ Extracts method-object form when provided.
1707
1750
 
1708
1751
  Parameters:
1709
- - `network` - - Target network.
1752
+ - `method` - - Optional mutation method.
1710
1753
 
1711
- Returns: Removable backward connections.
1754
+ Returns: Method object view.
1712
1755
 
1713
- ### isRemovableBackwardConnection
1756
+ ### resolveSelectedBackwardConnectionPair
1714
1757
 
1715
1758
  ```ts
1716
- isRemovableBackwardConnection(
1759
+ resolveSelectedBackwardConnectionPair(
1717
1760
  network: default,
1718
- candidateConnection: default,
1719
- ): boolean
1761
+ randomValue: () => number,
1762
+ ): NodePair | undefined
1720
1763
  ```
1721
1764
 
1722
- Evaluates whether a backward connection is safe to remove.
1765
+ Resolves random selected backward connection pair.
1723
1766
 
1724
1767
  Parameters:
1725
1768
  - `network` - - Target network.
1726
- - `candidateConnection` - - Connection under evaluation.
1769
+ - `randomValue` - - Random generator.
1727
1770
 
1728
- Returns: True when removable.
1771
+ Returns: Selected source/target pair.
1729
1772
 
1730
- ### isBackwardDirectionalContext
1773
+ ### resolveSelectedForwardConnectionPair
1731
1774
 
1732
1775
  ```ts
1733
- isBackwardDirectionalContext(
1734
- directionContext: DirectionalConnectionContext,
1735
- ): boolean
1776
+ resolveSelectedForwardConnectionPair(
1777
+ network: default,
1778
+ randomValue: () => number,
1779
+ ): NodePair | undefined
1736
1780
  ```
1737
1781
 
1738
- Checks whether a directional context represents a backward edge.
1782
+ Resolves random selected forward connection pair.
1739
1783
 
1740
1784
  Parameters:
1741
- - `directionContext` - - Directional context.
1785
+ - `network` - - Target network.
1786
+ - `randomValue` - - Random generator.
1742
1787
 
1743
- Returns: True when backward.
1788
+ Returns: Selected source/target pair.
1744
1789
 
1745
- ### collectSwappableNodesForMutation
1790
+ ### resolveSelfConnectionTargetNode
1746
1791
 
1747
1792
  ```ts
1748
- collectSwappableNodesForMutation(
1793
+ resolveSelfConnectionTargetNode(
1749
1794
  network: default,
1750
- method: MutationMethod | undefined,
1751
- ): default[]
1795
+ randomValue: () => number,
1796
+ ): default | undefined
1752
1797
  ```
1753
1798
 
1754
- Collects swap-eligible nodes based on mutation configuration.
1799
+ Resolves random node eligible for self-connection creation.
1755
1800
 
1756
1801
  Parameters:
1757
1802
  - `network` - - Target network.
1758
- - `method` - - Optional method descriptor.
1803
+ - `randomValue` - - Random generator.
1759
1804
 
1760
- Returns: Swap-eligible nodes.
1805
+ Returns: Selected node.
1761
1806
 
1762
- ### pickDistinctNodePair
1807
+ ### sampleUniform
1763
1808
 
1764
1809
  ```ts
1765
- pickDistinctNodePair(
1766
- swappableNodes: default[],
1810
+ sampleUniform(
1767
1811
  randomValue: () => number,
1768
- ): DistinctNodePair | undefined
1812
+ minValue: number,
1813
+ maxValue: number,
1814
+ ): number
1769
1815
  ```
1770
1816
 
1771
- Picks two distinct nodes from a candidate set.
1817
+ Samples a uniform value from [minValue, maxValue].
1772
1818
 
1773
1819
  Parameters:
1774
- - `swappableNodes` - - Swap candidate nodes.
1775
1820
  - `randomValue` - - Random generator.
1821
+ - `minValue` - - Minimum value.
1822
+ - `maxValue` - - Maximum value.
1776
1823
 
1777
- Returns: Distinct pair or undefined.
1824
+ Returns: Sampled value.
1778
1825
 
1779
- ### resolveDistinctPairWithKnownFirstNode
1826
+ ### sampleUniformFromContext
1780
1827
 
1781
1828
  ```ts
1782
- resolveDistinctPairWithKnownFirstNode(
1783
- swappableNodes: default[],
1784
- firstNode: default,
1785
- randomValue: () => number,
1786
- ): DistinctNodePair | undefined
1829
+ sampleUniformFromContext(
1830
+ samplingContext: WeightSamplingRangeContext,
1831
+ ): number
1787
1832
  ```
1788
1833
 
1789
- Resolves a distinct pair when first node is already known.
1834
+ Samples one weight using a prebuilt range context.
1790
1835
 
1791
1836
  Parameters:
1792
- - `swappableNodes` - - Swap candidate nodes.
1793
- - `firstNode` - - Chosen first node.
1794
- - `randomValue` - - Random generator.
1837
+ - `samplingContext` - - Sampling range context.
1795
1838
 
1796
- Returns: Distinct pair or undefined.
1839
+ Returns: Sampled weight.
1797
1840
 
1798
- ### pickDistinctRandomNode
1841
+ ### selectHiddenNodeForRemoval
1799
1842
 
1800
1843
  ```ts
1801
- pickDistinctRandomNode(
1802
- nodeCandidates: default[],
1803
- excludedNode: default,
1804
- randomValue: () => number,
1844
+ selectHiddenNodeForRemoval(
1845
+ network: default,
1846
+ hiddenNodes: default[],
1805
1847
  ): default | undefined
1806
1848
  ```
1807
1849
 
1808
- Picks a random node distinct from a given reference.
1850
+ Selects a hidden node candidate for SUB_NODE mutation.
1809
1851
 
1810
1852
  Parameters:
1811
- - `nodeCandidates` - - Candidate nodes.
1812
- - `excludedNode` - - Node to exclude.
1813
- - `randomValue` - - Random generator.
1853
+ - `network` - - Target network.
1854
+ - `hiddenNodes` - - Hidden nodes.
1814
1855
 
1815
- Returns: Distinct node or undefined.
1856
+ Returns: Selected hidden node.
1816
1857
 
1817
- ### collectDistinctNodeCandidates
1858
+ ### splitConnectionThroughHiddenNode
1818
1859
 
1819
1860
  ```ts
1820
- collectDistinctNodeCandidates(
1821
- nodeCandidates: default[],
1822
- excludedNode: default,
1823
- ): default[]
1861
+ splitConnectionThroughHiddenNode(
1862
+ network: default,
1863
+ mutationProps: NetworkMutationProps,
1864
+ connectionToSplit: default,
1865
+ ): ConnectionSplitResult
1824
1866
  ```
1825
1867
 
1826
- Collects candidates that are distinct from an excluded node.
1868
+ Replaces one connection by inserting a hidden node and reconnecting edges.
1827
1869
 
1828
1870
  Parameters:
1829
- - `nodeCandidates` - - Candidate nodes.
1830
- - `excludedNode` - - Node to exclude.
1871
+ - `network` - - Target network.
1872
+ - `mutationProps` - - Runtime mutation props.
1873
+ - `connectionToSplit` - - Connection to split.
1831
1874
 
1832
- Returns: Distinct candidates.
1875
+ Returns: Split result values.
1833
1876
 
1834
- ### swapNodeBiasAndSquash
1877
+ ### subBackConn
1835
1878
 
1836
1879
  ```ts
1837
- swapNodeBiasAndSquash(
1838
- firstNode: default,
1839
- secondNode: default,
1840
- ): void
1880
+ subBackConn(): void
1841
1881
  ```
1842
1882
 
1843
- Swaps bias and squash values between two nodes.
1883
+ Removes one backward connection that satisfies redundancy constraints.
1844
1884
 
1845
1885
  Parameters:
1846
- - `firstNode` - - First node.
1847
- - `secondNode` - - Second node.
1886
+ - `this` - - Bound network.
1848
1887
 
1849
1888
  Returns: Nothing.
1850
1889
 
1851
- ### addRecurrentNode
1890
+ ### subConn
1852
1891
 
1853
1892
  ```ts
1854
- addRecurrentNode(
1855
- network: default,
1856
- blockType: "lstm" | "gru",
1857
- ): void
1893
+ subConn(): void
1858
1894
  ```
1859
1895
 
1860
- Shared orchestrator for recurrent-node mutation variants.
1896
+ Removes one forward connection when structural redundancy constraints are satisfied.
1897
+
1898
+ Constraints require endpoint redundancy and avoid disconnecting peer-layer groups.
1861
1899
 
1862
1900
  Parameters:
1863
- - `network` - - Target network.
1864
- - `blockType` - - Recurrent block type.
1901
+ - `this` - - Bound network.
1865
1902
 
1866
1903
  Returns: Nothing.
1867
1904
 
1868
- ### expandConnectionWithRecurrentBlock
1905
+ ### subGate
1869
1906
 
1870
1907
  ```ts
1871
- expandConnectionWithRecurrentBlock(
1872
- network: default,
1873
- connectionToExpand: default,
1874
- blockType: "lstm" | "gru",
1875
- ): void
1908
+ subGate(): void
1876
1909
  ```
1877
1910
 
1878
- Replaces one connection with a minimal recurrent block.
1911
+ Removes gating from one randomly selected gated connection.
1879
1912
 
1880
1913
  Parameters:
1881
- - `network` - - Target network.
1882
- - `connectionToExpand` - - Connection to replace.
1883
- - `blockType` - - Recurrent block type.
1914
+ - `this` - - Bound network.
1884
1915
 
1885
1916
  Returns: Nothing.
1886
1917
 
1887
- ### disconnectConnectionAndGetGater
1918
+ ### subNode
1888
1919
 
1889
1920
  ```ts
1890
- disconnectConnectionAndGetGater(
1891
- network: default,
1892
- connectionToExpand: default,
1893
- ): default | null
1921
+ subNode(): void
1894
1922
  ```
1895
1923
 
1896
- Disconnects a connection and returns its previous gater.
1924
+ Removes one hidden node and applies a tiny weight nudge for numerical continuity.
1925
+
1926
+ The stability nudge helps keep downstream mutation effects observable in edge cases
1927
+ where node removal substantially changes effective signal flow.
1897
1928
 
1898
1929
  Parameters:
1899
- - `network` - - Target network.
1900
- - `connectionToExpand` - - Connection being expanded.
1930
+ - `this` - - Bound network.
1901
1931
 
1902
- Returns: Previous gater reference.
1932
+ Returns: Nothing.
1903
1933
 
1904
- ### reconnectThroughRecurrentLayer
1934
+ ### subSelfConn
1905
1935
 
1906
1936
  ```ts
1907
- reconnectThroughRecurrentLayer(
1908
- network: default,
1909
- connectionToExpand: default,
1910
- recurrentLayer: RecurrentLayerShape,
1911
- ): default | undefined
1937
+ subSelfConn(): void
1912
1938
  ```
1913
1939
 
1914
- Reconnects a source/target pair through a recurrent layer.
1940
+ Removes one existing self-connection chosen at random.
1915
1941
 
1916
1942
  Parameters:
1917
- - `network` - - Target network.
1918
- - `connectionToExpand` - - Original connection.
1919
- - `recurrentLayer` - - Recurrent-layer shape.
1943
+ - `this` - - Bound network.
1920
1944
 
1921
- Returns: Latest newly created connection or undefined.
1945
+ Returns: Nothing.
1922
1946
 
1923
- ### tryGateLatestConnection
1947
+ ### swapNodeBiasAndSquash
1924
1948
 
1925
1949
  ```ts
1926
- tryGateLatestConnection(
1927
- network: default,
1928
- previousGater: default | null,
1929
- latestConnection: default | undefined,
1950
+ swapNodeBiasAndSquash(
1951
+ firstNode: default,
1952
+ secondNode: default,
1930
1953
  ): void
1931
1954
  ```
1932
1955
 
1933
- Gates the latest connection when both previous gater and target exist.
1956
+ Swaps bias and squash values between two nodes.
1934
1957
 
1935
1958
  Parameters:
1936
- - `network` - - Target network.
1937
- - `previousGater` - - Previously assigned gater.
1938
- - `latestConnection` - - Connection to receive the gater.
1959
+ - `firstNode` - - First node.
1960
+ - `secondNode` - - Second node.
1939
1961
 
1940
1962
  Returns: Nothing.
1941
1963
 
1942
- ### createRecurrentLayer
1964
+ ### swapNodes
1943
1965
 
1944
1966
  ```ts
1945
- createRecurrentLayer(
1946
- blockType: "lstm" | "gru",
1947
- ): RecurrentLayerShape
1967
+ swapNodes(
1968
+ method: MutationMethod | undefined,
1969
+ ): void
1948
1970
  ```
1949
1971
 
1950
- Creates recurrent layer by type.
1972
+ Swaps bias and activation squash functions between two distinct mutable nodes.
1973
+
1974
+ This provides a lightweight structural-parameter recombination without changing
1975
+ graph connectivity.
1951
1976
 
1952
1977
  Parameters:
1953
- - `blockType` - - Recurrent block type.
1978
+ - `this` - - Bound network.
1979
+ - `method` - - Optional method descriptor.
1954
1980
 
1955
- Returns: Created recurrent layer.
1981
+ Returns: Nothing.
1956
1982
 
1957
- ### appendRecurrentLayerNodes
1983
+ ### tryDisconnectConnection
1958
1984
 
1959
1985
  ```ts
1960
- appendRecurrentLayerNodes(
1986
+ tryDisconnectConnection(
1961
1987
  network: default,
1962
- layerNodes: default[],
1988
+ connection: default,
1963
1989
  ): void
1964
1990
  ```
1965
1991
 
1966
- Appends recurrent layer nodes as hidden nodes.
1992
+ Disconnects a connection pair while suppressing errors.
1967
1993
 
1968
1994
  Parameters:
1969
1995
  - `network` - - Target network.
1970
- - `layerNodes` - - Layer nodes.
1996
+ - `connection` - - Connection to remove.
1971
1997
 
1972
1998
  Returns: Nothing.
1973
1999
 
1974
- ### createConnectionGroupReinitContext
1975
-
1976
- ```ts
1977
- createConnectionGroupReinitContext(
1978
- randomValue: () => number,
1979
- methodObject: { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; },
1980
- ): ConnectionGroupReinitContext
1981
- ```
1982
-
1983
- Creates immutable context for connection-group reinitialization.
1984
-
1985
- Parameters:
1986
- - `randomValue` - - Random generator.
1987
- - `methodObject` - - Method override object.
1988
-
1989
- Returns: Reinitialization context.
1990
-
1991
- ### collectConnectionGroupsForReinit
2000
+ ### tryGateLatestConnection
1992
2001
 
1993
2002
  ```ts
1994
- collectConnectionGroupsForReinit(
1995
- targetNode: default,
1996
- ): default[][]
2003
+ tryGateLatestConnection(
2004
+ network: default,
2005
+ previousGater: default | null,
2006
+ latestConnection: default | undefined,
2007
+ ): void
1997
2008
  ```
1998
2009
 
1999
- Collects all connection groups affected by REINIT_WEIGHT.
2010
+ Gates the latest connection when both previous gater and target exist.
2000
2011
 
2001
2012
  Parameters:
2002
- - `targetNode` - - Node receiving the reinitialization.
2013
+ - `network` - - Target network.
2014
+ - `previousGater` - - Previously assigned gater.
2015
+ - `latestConnection` - - Connection to receive the gater.
2003
2016
 
2004
- Returns: Mutable connection groups.
2017
+ Returns: Nothing.
2005
2018
 
2006
- ### reinitializeConnectionGroupWeights
2019
+ ### tryReassignGateAfterSplit
2007
2020
 
2008
2021
  ```ts
2009
- reinitializeConnectionGroupWeights(
2010
- connections: default[],
2011
- reinitContext: ConnectionGroupReinitContext,
2022
+ tryReassignGateAfterSplit(
2023
+ network: default,
2024
+ randomValue: () => number,
2025
+ splitResult: ConnectionSplitResult,
2012
2026
  ): void
2013
2027
  ```
2014
2028
 
2015
- Reinitializes all weights in a connection group.
2029
+ Reassigns prior gater to one of the new split connections when possible.
2016
2030
 
2017
2031
  Parameters:
2018
- - `connections` - - Connection group.
2032
+ - `network` - - Target network.
2019
2033
  - `randomValue` - - Random generator.
2020
- - `minWeight` - - Minimum sampled weight.
2021
- - `maxWeight` - - Maximum sampled weight.
2034
+ - `splitResult` - - Split result values.
2022
2035
 
2023
2036
  Returns: Nothing.
2024
2037
 
2025
- ### createWeightSamplingRangeContext
2026
-
2027
- ```ts
2028
- createWeightSamplingRangeContext(
2029
- reinitContext: ConnectionGroupReinitContext,
2030
- ): WeightSamplingRangeContext
2031
- ```
2032
-
2033
- Creates immutable sampling range context.
2034
-
2035
- Parameters:
2036
- - `reinitContext` - - Reinitialization context.
2037
-
2038
- Returns: Sampling range context.
2039
-
2040
- ### sampleUniformFromContext
2038
+ ### warnWhenEnabled
2041
2039
 
2042
2040
  ```ts
2043
- sampleUniformFromContext(
2044
- samplingContext: WeightSamplingRangeContext,
2045
- ): number
2041
+ warnWhenEnabled(
2042
+ message: string,
2043
+ ): void
2046
2044
  ```
2047
2045
 
2048
- Samples one weight using a prebuilt range context.
2046
+ Emits a warning when warning mode is enabled.
2049
2047
 
2050
2048
  Parameters:
2051
- - `samplingContext` - - Sampling range context.
2049
+ - `message` - - Warning message.
2052
2050
 
2053
- Returns: Sampled weight.
2051
+ Returns: Nothing.
2054
2052
 
2055
- ### enableNodeBatchNorm
2053
+ ### wouldDisconnectTargetPeerLayerGroup
2056
2054
 
2057
2055
  ```ts
2058
- enableNodeBatchNorm(
2059
- node: default,
2060
- ): void
2056
+ wouldDisconnectTargetPeerLayerGroup(
2057
+ network: default,
2058
+ candidateConnection: default,
2059
+ ): boolean
2061
2060
  ```
2062
2061
 
2063
- Enables internal batch-norm flag on a node.
2062
+ Determines whether removal would disconnect a target peer-layer group.
2064
2063
 
2065
2064
  Parameters:
2066
- - `node` - - Node to flag.
2065
+ - `network` - - Target network.
2066
+ - `candidateConnection` - - Connection under evaluation.
2067
2067
 
2068
- Returns: Nothing.
2068
+ Returns: True when peer group would be disconnected.