@reicek/neataptic-ts 0.1.11 → 0.1.12

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 (71) hide show
  1. package/.github/copilot-instructions.md +76 -0
  2. package/README.md +247 -272
  3. package/STYLEGUIDE.md +513 -0
  4. package/dist-docs/scripts/generate-bench-tables.js +47 -18
  5. package/dist-docs/scripts/generate-bench-tables.js.map +1 -1
  6. package/dist-docs/scripts/generate-docs.js +1 -1
  7. package/dist-docs/scripts/generate-docs.js.map +1 -1
  8. package/dist-docs/scripts/render-docs-html.js +31 -10
  9. package/dist-docs/scripts/render-docs-html.js.map +1 -1
  10. package/docs/README.md +247 -272
  11. package/docs/architecture/index.html +2 -2
  12. package/docs/architecture/network/index.html +2 -2
  13. package/docs/assets/ascii-maze.bundle.js +10381 -4015
  14. package/docs/assets/ascii-maze.bundle.js.map +4 -4
  15. package/docs/assets/theme.css +45 -0
  16. package/docs/examples/README.md +82 -0
  17. package/docs/examples/asciiMaze/index.html +17 -118
  18. package/docs/examples/index.html +71 -0
  19. package/docs/index.html +330 -495
  20. package/docs/methods/index.html +2 -2
  21. package/docs/multithreading/index.html +2 -2
  22. package/docs/multithreading/workers/browser/index.html +2 -2
  23. package/docs/multithreading/workers/index.html +2 -2
  24. package/docs/multithreading/workers/node/index.html +2 -2
  25. package/docs/neat/index.html +2 -2
  26. package/docs/src/index.html +2 -2
  27. package/docs/utils/README.md +0 -6
  28. package/docs/utils/index.html +3 -4
  29. package/jest.config.mjs +39 -1
  30. package/package.json +25 -23
  31. package/plans/ASCII_MAZE_enhancements.md +0 -0
  32. package/plans/ES2023 migration +5 -10
  33. package/scripts/copy-examples.mjs +3 -1
  34. package/scripts/export-onnx.mjs +26 -6
  35. package/scripts/generate-bench-tables.mjs +115 -57
  36. package/scripts/generate-bench-tables.ts +101 -39
  37. package/scripts/generate-docs.ts +1 -1
  38. package/scripts/render-docs-html.ts +97 -46
  39. package/src/multithreading/workers/node/testworker.ts +102 -14
  40. package/src/neat/neat.evaluate.ts +18 -2
  41. package/src/utils/README.md +0 -6
  42. package/test/benchmarks/asciiMaze.micro.bench.ts +0 -0
  43. package/test/benchmarks/benchmark.asciiMaze.micro.bench.test.ts +0 -0
  44. package/test/benchmarks/benchmark.memory.test.ts +2 -2
  45. package/test/benchmarks/benchmark.neat.evaluate.hotspot.test.ts +0 -0
  46. package/test/examples/asciiMaze/asciiMaze.api.test.ts +174 -0
  47. package/test/examples/asciiMaze/asciiMaze.e2e.test.ts +50 -298
  48. package/test/examples/asciiMaze/browser-entry.ts +394 -133
  49. package/test/examples/asciiMaze/browserLogger.ts +412 -132
  50. package/test/examples/asciiMaze/browserTerminalUtility.ts +49 -17
  51. package/test/examples/asciiMaze/dashboardManager.ts +2026 -829
  52. package/test/examples/asciiMaze/evolutionEngine.ts +7370 -987
  53. package/test/examples/asciiMaze/fitness.ts +76 -34
  54. package/test/examples/asciiMaze/index.html +17 -118
  55. package/test/examples/asciiMaze/interfaces.ts +22 -2
  56. package/test/examples/asciiMaze/mazeMovement.ts +1345 -813
  57. package/test/examples/asciiMaze/mazeUtils.ts +440 -147
  58. package/test/examples/asciiMaze/mazeVision.ts +337 -337
  59. package/test/examples/asciiMaze/mazeVisualization.ts +74 -39
  60. package/test/examples/asciiMaze/mazes.ts +382 -0
  61. package/test/examples/asciiMaze/networkRefinement.ts +38 -6
  62. package/test/examples/asciiMaze/networkVisualization.ts +782 -600
  63. package/test/examples/asciiMaze/refineWinner.ts +65 -0
  64. package/test/examples/asciiMaze/terminalUtility.ts +17 -2
  65. package/test/types/es2023.d.ts +10 -0
  66. package/test/utils/pollUntil.test.ts +44 -0
  67. package/test/utils/pollUntil.ts +67 -0
  68. package/tsconfig.test.json +2 -1
  69. package/webpack.config.js +2 -8
  70. package/plans/network.slab.design.md +0 -67
  71. package/src/utils/deprecation.ts +0 -8
@@ -0,0 +1,76 @@
1
+ # Repo Copilot Instructions — NeatapticTS
2
+
3
+ Purpose
4
+ -------
5
+ When generating, modifying, or suggesting code that touches files under `src/` or `test/`, follow the project `STYLEGUIDE.md` rules and perform the quick validations listed below before returning suggestions.
6
+
7
+ How to use these instructions
8
+ -----------------------------
9
+ - Always prefer to produce code that already satisfies the style guide.
10
+ - If you cannot fully transform a file (large refactor), return a patch with clear TODO comments, an explicit list of remaining violations, and small, safe automated fixes where possible.
11
+ - If you propose changes that alter public behavior, include tests and TypeScript typechecks.
12
+
13
+ Strict rules to enforce (apply to any suggestion touching `src/` or `test/`)
14
+ ---------------------------------------------------------------------
15
+ 1. Naming: avoid short local identifiers. Do not use these short names for non-trivial locals: `dx`, `dy`, `d`, `i`, `a`, `b`, `c`, `p`, `o`, `cand`, `tries`, `idx`.
16
+ - If the original code uses a short name in a tiny loop (1–3 lines) and it is clearly idiomatic, allow `i`, `j` only.
17
+ - Prefer descriptive names: `candidateDirection`, `bestDistance`, `currentPosition`.
18
+
19
+ 2. JSDoc: exported classes/functions/constants and public methods must have JSDoc with `@param` and `@returns` where appropriate. Add short `@example` when behavior is non-obvious.
20
+
21
+ 3. Tests: follow the single-expect rule. Each `it()` (or `test()`) must have exactly one top-level `expect(...)` statement. If multiple assertions are needed, split into multiple `it()` cases or use helper assertions.
22
+
23
+ 4. Constants: replace magic numbers with named `export const` or class-private `static #` constants with a short JSDoc.
24
+
25
+ 5. Comments: methods should have step-level inline comments explaining intent (not every line). Use numbered steps where helpful.
26
+
27
+ 6. Lookup tables and enums: prefer a single table/enum for small fixed mappings (for example direction deltas) and helper methods like `#opposite(direction)` rather than scattered arithmetic.
28
+
29
+ Automated validations to run before finalizing a suggestion
30
+ -------------------------------------------------------
31
+ When you modify or create files under `src/` or `test/`, run (or advise running) these quick validations. If you cannot run them, still make sure your suggestion would pass them.
32
+
33
+ 1) TypeScript diagnostics
34
+
35
+ # Copilot instructions — STYLEGUIDE light checks
36
+
37
+ Purpose
38
+ -------
39
+ Give brief, actionable guidance so suggestions touching `src/` or `test/` prioritize compliance with `STYLEGUIDE.md`.
40
+
41
+ Keep it light: prefer small, automated checks and a short validation summary with every patch.
42
+
43
+ Quick checks to run (recommended)
44
+ --------------------------------
45
+ - TypeScript: run `npm run build` and report pass/fail.
46
+ - Short-id scan: flag uses of the short identifiers regex `\b(dx|dy|d|i|a|b|c|p|o|idx|cand|tries)\b` in changed files.
47
+ - Tests heuristic: flag test files that contain more than one `expect(` occurrence (these should be split into multiple `it()` blocks).
48
+ - JSDoc: for new exported symbols, ensure a JSDoc block with `@param`/`@returns` exists (or flag if missing).
49
+
50
+ PowerShell examples (local validation)
51
+ -------------------------------------
52
+ Typecheck:
53
+ ```powershell
54
+ npx tsc --noEmit -p tsconfig.json
55
+ ```
56
+
57
+ Short-id scan:
58
+ ```powershell
59
+ Get-ChildItem -Path src,test -Recurse -Include *.ts,*.tsx | Select-String -Pattern '\b(dx|dy|d|i|a|b|c|p|o|idx|cand|tries)\b' -NotMatch '\b(i|j)\b' -List
60
+ ```
61
+
62
+ Test heuristic:
63
+ ```powershell
64
+ Get-ChildItem -Path test -Recurse -Include *.ts,*.tsx | ForEach-Object {
65
+ $count = (Get-Content $_.FullName | Select-String 'expect\(' -AllMatches).Matches.Count
66
+ if ($count -gt 1) { Write-Output "$($_.FullName): $count expects" }
67
+ }
68
+ ```
69
+
70
+ What to include with a suggestion
71
+ --------------------------------
72
+ - A short validation summary (TypeScript: pass/fail, short-id matches: list or 0, test-expect heuristic: list or 0, JSDoc missing: list or 0).
73
+ - If any issue can't be safely fixed automatically, include a TODO comment at the top of the changed file and a one-line explanation in the patch.
74
+
75
+ - A runnable patch or new file content that follows the rules above.
76
+