kodelyth-ecc 1.5.9 → 1.7.0

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 (123) hide show
  1. package/.github/workflows/publish.yml +19 -0
  2. package/AGENTS.md +1 -1
  3. package/CHANGELOG.md +455 -0
  4. package/CLAUDE.md +48 -16
  5. package/README.md +265 -81
  6. package/VERSION +1 -1
  7. package/actions/ecc-review/README.md +243 -0
  8. package/actions/ecc-review/action.yml +158 -0
  9. package/actions/ecc-review/post-comment.js +171 -0
  10. package/actions/ecc-review/run-review.js +285 -0
  11. package/agents/backdoor-hunter.md +260 -0
  12. package/agents/chaos-engineer.md +251 -0
  13. package/agents/code-stealer-detector.md +228 -0
  14. package/agents/jailbreak-tester.md +222 -0
  15. package/agents/license-violation-finder.md +212 -0
  16. package/agents/prompt-injection-hunter.md +126 -0
  17. package/agents/secret-hunter.md +209 -0
  18. package/agents/supply-chain-auditor.md +195 -0
  19. package/bin/kodelyth-ecc.js +875 -1
  20. package/bundles/enterprise.md +172 -0
  21. package/bundles/indie-hacker.md +106 -0
  22. package/bundles/red-team.md +138 -0
  23. package/cat +0 -0
  24. package/commands/dashboard.md +67 -0
  25. package/commands/devil-mode.md +121 -0
  26. package/commands/memory-evolve.md +71 -0
  27. package/commands/replay.md +61 -0
  28. package/commands/route-model.md +48 -0
  29. package/commands/swarm.md +68 -0
  30. package/commands/verify-supply-chain.md +59 -0
  31. package/docs/dashboard.md +211 -0
  32. package/docs/evolve.md +303 -0
  33. package/docs/mcp-clients.md +167 -0
  34. package/docs/mcp.md +178 -0
  35. package/docs/replay.md +244 -0
  36. package/docs/supply-chain.md +207 -0
  37. package/docs/swarm.md +243 -0
  38. package/hooks/hooks.json +52 -0
  39. package/hooks/memory/auto-recall.js +29 -1
  40. package/hooks/safety/README.md +124 -0
  41. package/hooks/safety/lib/patterns.js +179 -0
  42. package/hooks/safety/prompt-injection-guard.js +179 -0
  43. package/hooks/safety/token-budget.js +229 -0
  44. package/install.ps1 +199 -2
  45. package/install.sh +286 -4
  46. package/package.json +30 -4
  47. package/rules/common/agent-intent-routing.md +182 -0
  48. package/rules/common/cost-aware-model-routing.md +152 -0
  49. package/scripts/dashboard/data.js +353 -0
  50. package/scripts/dashboard/server.js +324 -0
  51. package/scripts/dashboard/static/index.html +645 -0
  52. package/scripts/evolve/analyze.js +303 -0
  53. package/scripts/evolve/proposals.js +162 -0
  54. package/scripts/evolve/stats.js +219 -0
  55. package/scripts/mcp/catalog.js +244 -0
  56. package/scripts/mcp/client.js +181 -0
  57. package/scripts/mcp/prompts.js +133 -0
  58. package/scripts/mcp/resources.js +94 -0
  59. package/scripts/mcp/server.js +153 -0
  60. package/scripts/mcp/tools.js +465 -0
  61. package/scripts/replay/bundle.js +191 -0
  62. package/scripts/replay/replay.js +107 -0
  63. package/scripts/router/classify.js +232 -0
  64. package/scripts/supply-chain/manifest.js +154 -0
  65. package/scripts/supply-chain/sbom.js +202 -0
  66. package/scripts/supply-chain/verify.js +102 -0
  67. package/scripts/swarm/build-plan.js +193 -0
  68. package/skills/cost-aware-model-routing/SKILL.md +153 -0
  69. package/skills/kodelyth-quickstart/SKILL.md +7 -0
  70. package/skills/observability-dashboard/SKILL.md +119 -0
  71. package/skills/self-evolving-memory/SKILL.md +175 -0
  72. package/skills/session-replay/SKILL.md +199 -0
  73. package/skills/supply-chain-verification/SKILL.md +201 -0
  74. package/skills/swarm-orchestrator/SKILL.md +177 -0
  75. package/social/card-install.svg +1 -1
  76. package/social/facebook-group/POST.md +121 -0
  77. package/social/facebook-group/fb-1-3am-debug.png +0 -0
  78. package/social/facebook-group/fb-1-3am-debug.svg +97 -0
  79. package/social/facebook-group/fb-2-cpu-upgrade.png +0 -0
  80. package/social/facebook-group/fb-2-cpu-upgrade.svg +132 -0
  81. package/social/facebook-group/fb-3-before-after.png +0 -0
  82. package/social/facebook-group/fb-3-before-after.svg +94 -0
  83. package/social/facebook-v150.svg +5 -5
  84. package/social/github-social-preview.svg +119 -100
  85. package/social/readme-hero.svg +11 -11
  86. package/social/section-agents.svg +57 -0
  87. package/social/section-author.svg +54 -0
  88. package/social/section-dashboard.svg +59 -0
  89. package/social/section-devil.svg +54 -0
  90. package/social/section-hooks.svg +51 -0
  91. package/social/section-install.svg +42 -0
  92. package/social/section-learning.svg +52 -0
  93. package/social/section-mcp.svg +46 -0
  94. package/social/section-memory.svg +57 -0
  95. package/social/section-parallel.svg +72 -0
  96. package/social/section-routing.svg +51 -0
  97. package/social/x-card-agents-grid.svg +6 -6
  98. package/tests/dashboard/data.test.js +235 -0
  99. package/tests/dashboard/server.test.js +240 -0
  100. package/tests/evolve/analyze.test.js +169 -0
  101. package/tests/evolve/proposals.test.js +173 -0
  102. package/tests/evolve/stats.test.js +159 -0
  103. package/tests/mcp/catalog.test.js +98 -0
  104. package/tests/mcp/client.test.js +109 -0
  105. package/tests/mcp/resources-prompts.test.js +70 -0
  106. package/tests/mcp/tools.test.js +159 -0
  107. package/tests/replay/bundle.test.js +181 -0
  108. package/tests/replay/replay.test.js +131 -0
  109. package/tests/router/classify.test.js +164 -0
  110. package/tests/safety/patterns.test.js +94 -0
  111. package/tests/safety/prompt-injection-guard.test.js +111 -0
  112. package/tests/safety/token-budget.test.js +119 -0
  113. package/tests/supply-chain/manifest.test.js +147 -0
  114. package/tests/supply-chain/sbom.test.js +170 -0
  115. package/tests/supply-chain/verify.test.js +146 -0
  116. package/tests/swarm/build-plan.test.js +188 -0
  117. package/wiki/Agent-Reference.md +58 -7
  118. package/wiki/FAQ.md +204 -7
  119. package/wiki/Home.md +104 -28
  120. package/wiki/Hook-Reference.md +1 -1
  121. package/wiki/Installation-Guide.md +109 -6
  122. package/wiki/Platform-Support.md +239 -25
  123. package/wiki/Skill-Reference.md +101 -6
@@ -0,0 +1,61 @@
1
+ ---
2
+ description: Replay a finished swarm session — same task, optional A/B variations (different harness, agents, base ref).
3
+ argument-hint: "[bundle.json|session-name] [--harness h] [--agents a,b] [--base-ref ref] [--execute]"
4
+ ---
5
+
6
+ # /replay
7
+
8
+ Re-run a completed swarm session for regression testing, A/B comparison, or post-mortem analysis.
9
+
10
+ ## Quick examples
11
+
12
+ ```
13
+ /replay swarm-2026-05-10-4a
14
+ /replay oauth-audit.bundle.json --execute
15
+ /replay swarm-2026-05-10-4a --harness codex --execute
16
+ /replay oauth-audit.bundle.json --agents security-reviewer,supply-chain-auditor --execute
17
+ /replay swarm-baseline --base-ref refactor-branch --execute
18
+ ```
19
+
20
+ ## Behavior
21
+
22
+ By default, prints the dry-run plan. Add `--execute` to actually create worktrees, spawn the tmux session, and launch agents. The replay session is auto-named `<original>-replay-<n>` so it never collides with the source.
23
+
24
+ | Flag | Effect |
25
+ |---|---|
26
+ | `<target>` | Required. Either a bundle file path (`*.json`) or a session name in `.orchestration/`. |
27
+ | `--harness <h>` | Override the launcher harness (claude / codex / opencode / windsurf / echo). |
28
+ | `--agents a,b,c` | Replace the original agent list. |
29
+ | `--base-ref <ref>` | Branch base for replay worktrees (default: from bundle.meta or HEAD). |
30
+ | `--session <name>` | Override the auto-generated `-replay-N` suffix. |
31
+ | `--replace` | Tear down any existing session/worktrees with the same names. |
32
+ | `--execute` | Spawn worktrees + tmux + launch agents. |
33
+ | `--write-only` | Just materialize coordination files. |
34
+ | `--json` | Print the full plan + planConfig as JSON. |
35
+
36
+ ## Use cases
37
+
38
+ - **Regression test prompts** — capture a baseline, replay after agent rev, compare handoffs.
39
+ - **Reproducible bug reports** — bundle a buggy session, ship to maintainers, they can `replay --execute` locally.
40
+ - **Model A/B test** — same task, two harnesses, side-by-side handoff diff.
41
+ - **Re-test against new code** — `--base-ref refactor-branch` re-runs the same audit on the new code.
42
+ - **Post-mortem** — replay an incident response swarm with new agents to see what they would have caught.
43
+
44
+ ## Companion commands
45
+
46
+ - `/session-export <name>` — export a coordination dir as a bundle JSON.
47
+ - `/session-import <bundle>` — restore a bundle into `.orchestration/`.
48
+
49
+ ## Hard rules
50
+
51
+ - Never `--execute` without dry-running first.
52
+ - Bundles are public artifacts — strip secrets before sharing externally.
53
+ - A/B comparisons require human review; never auto-pick winners.
54
+
55
+ ## Implementation
56
+
57
+ - Skill: `session-replay`
58
+ - Bundle library: `scripts/replay/bundle.js`
59
+ - Replay engine: `scripts/replay/replay.js`
60
+ - CLI: `npx kodelyth-ecc replay`
61
+ - Full docs: `docs/replay.md`
@@ -0,0 +1,48 @@
1
+ ---
2
+ description: Recommend the right model tier (trivial/standard/hard) for the current task. Surfaces the cost-aware-model-routing rule on demand.
3
+ argument-hint: "[task description]"
4
+ ---
5
+
6
+ # /route-model
7
+
8
+ Get an immediate model-tier recommendation for the current task. Combines the `cost-aware-model-routing` rule, the project's `.kodelyth/router.json` config, and the active session's token-budget pressure.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /route-model
14
+ /route-model rename getUserName to getUserDisplayName
15
+ /route-model audit the new oauth flow for vulnerabilities
16
+ /route-model devil-mode adversarial sweep on the payments module
17
+ ```
18
+
19
+ If you don't pass a task, the AI infers it from the most recent user turn.
20
+
21
+ ## What you get back
22
+
23
+ A single, scannable block:
24
+
25
+ ```
26
+ [model-router] task=<tier> · suggested=<model-id> · current=<active>
27
+ why: <one-line reason>
28
+ next: <how to switch>
29
+ ```
30
+
31
+ If you're already on the right tier, the AI routes silently and confirms in one line.
32
+
33
+ ## Behind the scenes
34
+
35
+ - Pure deterministic classifier (no LLM call) at `scripts/router/classify.js`.
36
+ - Project config: `.kodelyth/router.json` (override per team).
37
+ - Env-var overrides: `KODELYTH_ROUTER_{TRIVIAL,STANDARD,HARD,DEFAULT}`.
38
+ - Disable with `KODELYTH_ROUTER=off`.
39
+ - Pairs with the `token-budget` safety hook for spend control.
40
+
41
+ ## Hard rules
42
+
43
+ - Security / incident / adversarial agents never downgrade.
44
+ - Production framing ("down", "leaking", "outage") → hard tier.
45
+ - Multi-file refactors (3+) never go to trivial.
46
+ - Respect explicit user model choices unless new signals conflict.
47
+
48
+ See: `rules/common/cost-aware-model-routing.md`, `skills/cost-aware-model-routing/SKILL.md`.
@@ -0,0 +1,68 @@
1
+ ---
2
+ description: Spawn N specialist agents in parallel inside isolated git worktrees + a tmux session. Generalized /devil-mode.
3
+ argument-hint: "[task description] [--agents N|name1,name2,...] [--harness claude|codex|opencode|windsurf]"
4
+ ---
5
+
6
+ # /swarm
7
+
8
+ Run a parallel team of ECC specialists on the same task in isolated git worktrees coordinated by a tmux session. The generalized form of `/devil-mode`, `/team-review`, `/security-audit`, and `/pre-release` — pick any task, pick any agents, get N panes ready to attach.
9
+
10
+ ## Quick examples
11
+
12
+ ```
13
+ /swarm audit oauth flow for security regressions
14
+ /swarm ship v2.0 --agents release-captain,security-reviewer,e2e-runner --execute
15
+ /swarm refactor payments module --agents 6 --harness codex --execute
16
+ /swarm production is down, auth service 502s --agents incident-commander,debug-detective,silent-failure-hunter --execute
17
+ ```
18
+
19
+ ## Behavior
20
+
21
+ By default, prints the dry-run plan (safe to inspect). Add `--execute` to actually create worktrees, spawn the tmux session, and launch agents.
22
+
23
+ | Flag | Effect |
24
+ |---|---|
25
+ | `--task "..."` | Required (or use `--plan plan.json`). |
26
+ | `--agents N` | Smart-pick N specialists from task signals + baseline anchors + rotation. |
27
+ | `--agents name1,name2,...` | Explicit agent list. |
28
+ | `--harness claude\|codex\|opencode\|windsurf\|echo` | Launcher template (default `claude`). |
29
+ | `--seed <path>` | Overlay path from main repo into each worktree (e.g. `--seed .env`). |
30
+ | `--base-ref <ref>` | Branch base for all worktrees (default `HEAD`). |
31
+ | `--session <name>` | Override the auto-generated tmux session name. |
32
+ | `--replace` | Tear down any existing session/worktrees with the same names. |
33
+ | `--execute` | Create worktrees + tmux + launch agents. |
34
+ | `--write-only` | Just write coordination files without spawning. |
35
+ | `--json` | Print the full plan as JSON. |
36
+
37
+ ## Smart agent picking
38
+
39
+ If you pass `--agents N` (a number), the swarm picks specialists in this order:
40
+
41
+ 1. **Signal-driven** — task keywords match specialist (security → `security-reviewer`, perf → `performance-optimizer`, API → `api-guardian`, …).
42
+ 2. **Baseline anchors** — `code-reviewer` + `pair-programmer` get added (every task benefits).
43
+ 3. **Rotation fill** — 4/6/8-agent default rotations tuned for breadth.
44
+
45
+ ## Hard rules
46
+
47
+ - Never `--execute` without inspecting the dry-run first.
48
+ - Cap N at 8 for a single repo (worktree + pane contention past 8).
49
+ - Always human-merge handoffs from N parallel agents — don't auto-apply.
50
+ - Use `--session NAME` if running multiple swarms in parallel.
51
+
52
+ ## Coordination protocol
53
+
54
+ Each worker gets three files in `<repo>/.orchestration/<session>/<worker-slug>/`:
55
+
56
+ - `task.md` — agent-shaped task with required handoff sections
57
+ - `handoff.md` — where the agent writes its output
58
+ - `status.md` — running/completed/failed marker
59
+
60
+ Inspect any worker's progress with `cat .orchestration/<session>/<slug>/status.md`.
61
+
62
+ ## Implementation
63
+
64
+ - Skill: `swarm-orchestrator`
65
+ - Builder: `scripts/swarm/build-plan.js`
66
+ - Orchestrator: `scripts/lib/tmux-worktree-orchestrator.js`
67
+ - CLI: `npx kodelyth-ecc swarm`
68
+ - Full docs: `docs/swarm.md`
@@ -0,0 +1,59 @@
1
+ ---
2
+ description: Generate / verify SBOM, content manifest, and SLSA provenance for kodelyth-ecc. Use for compliance, audit, or tamper checks.
3
+ ---
4
+
5
+ # /verify-supply-chain
6
+
7
+ Run the supply-chain verification surface in one shot.
8
+
9
+ ## Usage
10
+
11
+ ```
12
+ /verify-supply-chain # quick: verify current install against shipped manifest
13
+ /verify-supply-chain --emit # generate SBOM + manifest in cwd
14
+ /verify-supply-chain --root /path/to/ecc --manifest /path/to/manifest.json
15
+ ```
16
+
17
+ ## Behavior
18
+
19
+ 1. If a manifest is provided (or the default `manifest.json` exists in `--root`), runs `verify` against it. Reports modified, missing, and extra files. Exits **non-zero** on any tamper.
20
+ 2. If `--emit` is set, generates fresh `kodelyth-ecc-sbom.cdx.json` and `kodelyth-ecc-manifest.json` in the current directory.
21
+ 3. If neither, prints a quick summary of what's available and what to do next.
22
+
23
+ ## Flags
24
+
25
+ | Flag | Effect |
26
+ |---|---|
27
+ | `--root DIR` | Treat DIR as the kodelyth-ecc install root (default: package root). |
28
+ | `--manifest FILE` | Path to a manifest to verify against (default: `<root>/manifest.json`). |
29
+ | `--emit` | Generate fresh `sbom.cdx.json` + `manifest.json` in cwd. |
30
+ | `--json` | Machine-readable output (verify report or generated docs). |
31
+
32
+ ## Use cases
33
+
34
+ - **Audit response.** Generate fresh SBOM + manifest for a SOC 2 / ISO 27001 review.
35
+ - **Tamper check.** Confirm that an installed copy hasn't been modified after install (matches the manifest shipped with the release).
36
+ - **Reproducibility check.** Compare the manifest of an arbitrary downloaded release archive against the one published on GitHub.
37
+ - **CI gate.** Pair with `--json` to fail a build when an installed dependency is tampered.
38
+
39
+ ## Companion commands
40
+
41
+ - **`/security-audit`** — full red-team sweep using the devil-mode crew (focuses on app code).
42
+ - **`/devil-mode`** — adversarial review of recent changes.
43
+ - **`/release`** — release-captain handoff. Should always run `/verify-supply-chain --emit` before tagging.
44
+
45
+ ## Hard rules
46
+
47
+ 1. **Never** suppress a non-zero exit from `verify`. If a tamper is found, escalate.
48
+ 2. **Don't** publish without the SBOM + manifest attached to the GitHub release. The publish workflow handles this automatically.
49
+ 3. **Treat** the on-release manifest as authoritative — don't substitute a freshly-generated one when verifying a customer's install.
50
+
51
+ ## Implementation
52
+
53
+ Backed by:
54
+
55
+ - `scripts/supply-chain/sbom.js` — CycloneDX 1.5 generator
56
+ - `scripts/supply-chain/manifest.js` — sha256 content manifest
57
+ - `scripts/supply-chain/verify.js` — pure-function verifier
58
+
59
+ CLI surface: `kodelyth-ecc sbom`, `kodelyth-ecc manifest`, `kodelyth-ecc verify`. See `docs/supply-chain.md` for the full reference.
@@ -0,0 +1,211 @@
1
+ # Local observability dashboard
2
+
3
+ > A localhost-only single-page web UI that renders every local data source Kodelyth ECC produces. Zero telemetry. Zero external runtime dependencies. Read-only.
4
+
5
+ ---
6
+
7
+ ## Why it exists
8
+
9
+ ECC produces a lot of local state by default:
10
+
11
+ - BM25 memory captures (`~/.kodelyth/memory/`)
12
+ - Self-evolving memory signals + proposals (`~/.kodelyth/evolve/`)
13
+ - Token-budget hook state (`~/.kodelyth/token-budget/`)
14
+ - Swarm/orchestration session dirs (`.orchestration/<session>/`)
15
+ - The full catalog of shipped agents / skills / commands / rules / bundles
16
+
17
+ The only way to see all of this was to read JSON files by hand or run six different CLI subcommands. The dashboard is the one-glance answer.
18
+
19
+ ---
20
+
21
+ ## Boot
22
+
23
+ ```bash
24
+ npx kodelyth-ecc dashboard # default: 127.0.0.1:5747, auto-opens browser
25
+ npx kodelyth-ecc dashboard --port 8088 # custom port
26
+ npx kodelyth-ecc dashboard --no-open # don't auto-open browser (CI / remote shells)
27
+ npx kodelyth-ecc dashboard --host localhost # explicit localhost binding
28
+ ```
29
+
30
+ Press `Ctrl+C` to stop. The server has no daemon mode by design — it lives only as long as your terminal session.
31
+
32
+ ---
33
+
34
+ ## Localhost lock
35
+
36
+ The dashboard exposes everything the BM25 store and evolve log have ever recorded. Memories may contain code, problem statements, project paths, gotchas. The default bind is `127.0.0.1` and the server **refuses** to start on any other interface unless you explicitly opt out:
37
+
38
+ ```bash
39
+ KODELYTH_DASHBOARD_ALLOW_REMOTE=1 \
40
+ npx kodelyth-ecc dashboard --host 0.0.0.0
41
+ ```
42
+
43
+ This escape hatch is intentionally inconvenient. Don't use it on a network you don't fully control.
44
+
45
+ Without the env var, attempting any non-localhost host produces:
46
+
47
+ ```
48
+ [dashboard] refusing to bind host=0.0.0.0. Dashboard is localhost-only by default.
49
+ To override (UNSAFE — exposes your memory + evolve data), set KODELYTH_DASHBOARD_ALLOW_REMOTE=1.
50
+ ```
51
+
52
+ ---
53
+
54
+ ## What you see
55
+
56
+ ### Overview tab
57
+
58
+ A wall of stat cards: agents · skills · commands · rules · bundles · captured memories · surfaces · routing misses · pending proposals · swarm sessions. Plus storage paths and a token-budget snapshot.
59
+
60
+ ### Memory tab
61
+
62
+ - Stats: total / projects / language count / tag classes
63
+ - BM25 search box (proxies through `/api/memory/search`)
64
+ - Recent captures table with tags + source
65
+
66
+ ### Evolve tab
67
+
68
+ - Reuse + miss + proposal counts
69
+ - Top 10 reused memories with surface count and last-seen
70
+ - Top 10 miss clusters with token tags and a sample prompt
71
+ - Proposals table with status pills (`pending` / `accepted` / `rejected` / `applied`)
72
+
73
+ ### Catalog tab
74
+
75
+ - Selector for agents / skills / commands / rules / bundles
76
+ - Free-text filter across name, description, tags
77
+ - Tabular results with up to 200 entries per page
78
+
79
+ ### Sessions tab
80
+
81
+ - Lists every swarm session in `.orchestration/`
82
+ - Per-session: workers, modified time, expandable detail with `task.md` + `handoff.md` + `status.md` excerpts
83
+
84
+ ---
85
+
86
+ ## API surface
87
+
88
+ The frontend is just a consumer of these endpoints. They're curl-friendly:
89
+
90
+ | Endpoint | Returns |
91
+ |---|---|
92
+ | `GET /api/health` | `{ ok: true, time: <iso> }` — liveness probe |
93
+ | `GET /api/overview` | counts + storage paths |
94
+ | `GET /api/memory[?limit=N]` | `{ stats, recent }` |
95
+ | `GET /api/memory/search?q=…[&limit=N]` | `{ query, results }` |
96
+ | `GET /api/evolve[?limit=N]` | `{ reuse, miss, proposals }` |
97
+ | `GET /api/catalog?kind=…[&q=…&limit=N]` | `{ kind, counts, items }` (kind ∈ agents/skills/commands/rules/bundles) |
98
+ | `GET /api/sessions[?limit=N]` | `{ sessions }` |
99
+ | `GET /api/sessions/:name` | `{ session, path, workers }` |
100
+ | `GET /api/token-budget` | `{ sessions, total_tokens }` |
101
+
102
+ ### Examples
103
+
104
+ ```bash
105
+ # Last 5 captured memories
106
+ curl -s http://127.0.0.1:5747/api/memory?limit=5 | jq '.recent'
107
+
108
+ # Search memory for "tailwind v4"
109
+ curl -s 'http://127.0.0.1:5747/api/memory/search?q=tailwind+v4' | jq '.results'
110
+
111
+ # Pending proposals
112
+ curl -s http://127.0.0.1:5747/api/evolve | jq '.proposals[] | select(.status == "pending")'
113
+
114
+ # All agents whose tags include "security"
115
+ curl -s 'http://127.0.0.1:5747/api/catalog?kind=agents&q=security'
116
+ ```
117
+
118
+ ---
119
+
120
+ ## Hard rules (enforced by the server)
121
+
122
+ 1. **GET-only.** Any other method returns `405 method not allowed`. The dashboard CANNOT mutate state.
123
+ 2. **Localhost lock.** Non-localhost binds refused without `KODELYTH_DASHBOARD_ALLOW_REMOTE=1`.
124
+ 3. **Path-traversal-safe.** Static file resolution is sandboxed under `scripts/dashboard/static/`. `../` and similar are rejected.
125
+ 4. **No cache.** Every response carries `Cache-Control: no-store`. Data is always fresh.
126
+ 5. **Hardened headers.** `X-Frame-Options: DENY`, `X-Content-Type-Options: nosniff`, `Referrer-Policy: no-referrer` on every response.
127
+ 6. **No external assets.** No CDNs, no Google Fonts, no analytics. Works fully offline.
128
+ 7. **Defensive aggregation.** Every data-source read is wrapped in try/catch with empty-default fallback. A broken memory store renders empty cards, never a 500.
129
+
130
+ ---
131
+
132
+ ## Architecture
133
+
134
+ ```
135
+ scripts/dashboard/
136
+ ├── server.js ← HTTP server. Routes API + static files.
137
+ ├── data.js ← Pure aggregators. Reads memory + evolve + catalog + sessions + budget.
138
+ └── static/
139
+ └── index.html ← Single-page UI. Hand-rolled CSS + vanilla JS. No build step.
140
+ ```
141
+
142
+ ### `data.js`
143
+
144
+ Pure functions only. Every aggregator:
145
+
146
+ - Accepts its data-source paths as explicit arguments OR uses well-defined env-overridable defaults
147
+ - Returns sane empty defaults on failure (never throws)
148
+ - Has no global mutable state
149
+ - Is unit-testable in isolation
150
+
151
+ ### `server.js`
152
+
153
+ Uses only Node built-ins:
154
+
155
+ - `http` for the listener
156
+ - `fs`, `path` for static files
157
+ - `child_process.execFileSync` for browser auto-open (`open` / `xdg-open` / `cmd /c start`) — no shell interpolation
158
+
159
+ No `express`, no `koa`, no third-party static-file middleware. All hardening is hand-rolled and auditable in ~290 lines.
160
+
161
+ ### `index.html`
162
+
163
+ - Hand-rolled CSS (no Tailwind, no CDN)
164
+ - Vanilla JS with `fetch` → no build step, no transpilation
165
+ - Tabs are simple data-attribute toggles
166
+ - Lazy-loads each tab's data only when shown
167
+ - SSE (`/api/events`) pushes `data-changed` events when watched files change; a `heartbeat` every 10 s keeps the green dot alive without triggering data reloads
168
+
169
+ ---
170
+
171
+ ## Worked example
172
+
173
+ ```bash
174
+ $ npx kodelyth-ecc dashboard --port 5747
175
+ ✓ Kodelyth ECC dashboard
176
+ http://127.0.0.1:5747/
177
+ Press Ctrl+C to stop. Localhost only — zero telemetry.
178
+ ```
179
+
180
+ In another shell:
181
+
182
+ ```bash
183
+ $ curl -s http://127.0.0.1:5747/api/overview | jq '.catalog'
184
+ {
185
+ "agents": 70,
186
+ "skills": 193,
187
+ "commands": 96,
188
+ "rules": 14,
189
+ "bundles": 3
190
+ }
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Composition with other features
196
+
197
+ | Feature | Effect on the dashboard |
198
+ |---|---|
199
+ | **Memory store** | Source of the Memory tab. |
200
+ | **Swarm orchestrator** | Source of the Sessions tab. |
201
+ | **Token-budget hook** | Source of the budget snapshot card. |
202
+ | **Self-evolving memory** | Source of the Evolve tab. Proposals appear automatically as they're generated. |
203
+
204
+ ---
205
+
206
+ ## See also
207
+
208
+ - `skills/observability-dashboard/SKILL.md` — explicit-invocation skill
209
+ - `commands/dashboard.md` — `/dashboard` slash command
210
+ - `scripts/dashboard/{server,data}.js` — implementation
211
+ - `tests/dashboard/` — aggregator + server smoke tests