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