@matt82198/aesop 0.1.0-beta.3 → 0.1.0-beta.4

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 (108) hide show
  1. package/CHANGELOG.md +37 -94
  2. package/CLAUDE-TEMPLATE.md +115 -0
  3. package/README.md +89 -264
  4. package/aesop.config.example.json +27 -26
  5. package/bin/CLAUDE.md +39 -0
  6. package/bin/cli.js +368 -24
  7. package/daemons/CLAUDE.md +33 -0
  8. package/daemons/backup-fleet.sh +92 -21
  9. package/daemons/run-watchdog.sh +90 -10
  10. package/dash/CLAUDE.md +32 -0
  11. package/dash/dash-extra.mjs +194 -21
  12. package/dash/watchdog-gui.sh +23 -6
  13. package/docs/BEHAVIORAL-PR-REVIEW.md +86 -0
  14. package/docs/CHECKPOINTING.md +100 -0
  15. package/docs/DISPATCH-MODEL.md +11 -7
  16. package/docs/FORENSICS.md +204 -0
  17. package/docs/GOVERNANCE.md +4 -2
  18. package/docs/HOOK-INSTALL.md +307 -0
  19. package/docs/HOW-THE-LOOP-WORKS.md +175 -0
  20. package/docs/MEMORY-TEMPLATE.md +61 -0
  21. package/docs/README.md +44 -0
  22. package/docs/RELIABILITY.md +61 -0
  23. package/docs/RESTORE.md +397 -0
  24. package/docs/SCRIPTS-POLICY.md +97 -0
  25. package/docs/spikes/tiered-cognition/ACTIVATION.md +125 -0
  26. package/docs/spikes/tiered-cognition/DESIGN.md +287 -0
  27. package/docs/spikes/tiered-cognition/FINDINGS.md +113 -0
  28. package/docs/spikes/tiered-cognition/README.md +29 -0
  29. package/docs/spikes/tiered-cognition/aesop-cognition.example.md +32 -0
  30. package/docs/spikes/tiered-cognition/force-model-policy.merged.mjs +673 -0
  31. package/docs/spikes/tiered-cognition/strip-tools-hook.mjs +434 -0
  32. package/hooks/CLAUDE.md +38 -0
  33. package/hooks/claude/force-model-policy.mjs +159 -0
  34. package/hooks/pre-push-policy.sh +753 -0
  35. package/monitor/.signal-state.json +3 -0
  36. package/monitor/ACTIONS.log +1 -0
  37. package/monitor/BRIEF.md +24 -0
  38. package/monitor/CHARTER.md +29 -8
  39. package/monitor/CLAUDE.md +40 -0
  40. package/monitor/SIGNALS.json +54 -0
  41. package/monitor/collect-signals.mjs +529 -62
  42. package/package.json +12 -3
  43. package/skills/CLAUDE.md +3 -0
  44. package/skills/power/SKILL.md +161 -0
  45. package/tools/CLAUDE.md +191 -0
  46. package/tools/__pycache__/buildlog.cpython-314.pyc +0 -0
  47. package/tools/__pycache__/ci_merge_wait.cpython-314.pyc +0 -0
  48. package/tools/__pycache__/ensure_state.cpython-314.pyc +0 -0
  49. package/tools/__pycache__/eod_sweep.cpython-314.pyc +0 -0
  50. package/tools/__pycache__/fleet_ledger.cpython-314.pyc +0 -0
  51. package/tools/__pycache__/heartbeat.cpython-314.pyc +0 -0
  52. package/tools/__pycache__/inbox_drain.cpython-314.pyc +0 -0
  53. package/tools/__pycache__/launch_tui.cpython-314.pyc +0 -0
  54. package/tools/__pycache__/orchestrator_status.cpython-314.pyc +0 -0
  55. package/tools/__pycache__/power_selftest.cpython-314.pyc +0 -0
  56. package/tools/__pycache__/prepublish_scan.cpython-314.pyc +0 -0
  57. package/tools/__pycache__/rotate_logs.cpython-314.pyc +0 -0
  58. package/tools/__pycache__/scanner_selftest.cpython-314.pyc +0 -0
  59. package/tools/__pycache__/secret_scan.cpython-314.pyc +0 -0
  60. package/tools/__pycache__/stall_check.cpython-314.pyc +0 -0
  61. package/tools/__pycache__/verify_dash.cpython-314.pyc +0 -0
  62. package/tools/__pycache__/verify_submit_encoding.cpython-314.pyc +0 -0
  63. package/tools/agent-forensics.sh +186 -0
  64. package/tools/buildlog.py +182 -0
  65. package/tools/ci_merge_wait.py +204 -0
  66. package/tools/ensure_state.py +94 -0
  67. package/tools/eod_sweep.py +239 -0
  68. package/tools/fleet_ledger.py +272 -0
  69. package/tools/heartbeat.py +131 -0
  70. package/tools/inbox_drain.py +249 -0
  71. package/tools/launch_tui.py +51 -3
  72. package/tools/lock.mjs +211 -0
  73. package/tools/metrics_gate.py +205 -0
  74. package/tools/orchestrator_status.py +99 -0
  75. package/tools/power_selftest.py +386 -0
  76. package/tools/prepublish_scan.py +84 -0
  77. package/tools/proposals.mjs +248 -0
  78. package/tools/reconstitute.sh +467 -0
  79. package/tools/rotate_logs.py +228 -0
  80. package/tools/scanner_selftest.py +303 -0
  81. package/tools/secret_scan.py +131 -31
  82. package/tools/stall_check.py +172 -0
  83. package/tools/verify_dash.py +694 -0
  84. package/tools/verify_submit_encoding.py +194 -0
  85. package/ui/CLAUDE.md +109 -0
  86. package/ui/__pycache__/agents.cpython-314.pyc +0 -0
  87. package/ui/__pycache__/collectors.cpython-314.pyc +0 -0
  88. package/ui/__pycache__/config.cpython-314.pyc +0 -0
  89. package/ui/__pycache__/csrf.cpython-314.pyc +0 -0
  90. package/ui/__pycache__/handler.cpython-314.pyc +0 -0
  91. package/ui/__pycache__/render.cpython-314.pyc +0 -0
  92. package/ui/__pycache__/serve.cpython-314.pyc +0 -0
  93. package/ui/__pycache__/sse.cpython-314.pyc +0 -0
  94. package/ui/agents.py +179 -0
  95. package/ui/api/__init__.py +84 -0
  96. package/ui/api/__pycache__/__init__.cpython-314.pyc +0 -0
  97. package/ui/api/__pycache__/submit.cpython-314.pyc +0 -0
  98. package/ui/api/__pycache__/tracker.cpython-314.pyc +0 -0
  99. package/ui/api/submit.py +58 -0
  100. package/ui/api/tracker.py +116 -0
  101. package/ui/collectors.py +586 -0
  102. package/ui/config.py +114 -0
  103. package/ui/csrf.py +140 -0
  104. package/ui/handler.py +426 -0
  105. package/ui/render.py +29 -0
  106. package/ui/serve.py +68 -796
  107. package/ui/sse.py +168 -0
  108. package/ui/templates/dashboard.html +1202 -0
package/README.md CHANGED
@@ -9,345 +9,170 @@
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/@matt82198/aesop"><img src="https://img.shields.io/npm/v/@matt82198/aesop/beta" alt="npm"></a>
11
11
  <a href="LICENSE"><img src="https://img.shields.io/npm/l/@matt82198/aesop" alt="license"></a>
12
+ <a href="https://github.com/matt82198/aesop/actions/workflows/ci.yml"><img src="https://github.com/matt82198/aesop/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
12
13
  </p>
13
14
 
14
- **Aesop** is an open-source orchestration harness for Claude Code, implementing a cost-optimized, self-healing multi-agent dispatch system. One orchestrator model (Opus/Sonnet) directs a fleet of cheap subagents (Haiku) across durable, observable machinery.
15
+ **Aesop** is an open-source orchestration harness for Claude Code that builds itself. It runs a `/buildsystem` wave cycle—ranking a backlog, fanning out parallel Haiku agents (1/3 the cost of Opus), watchdogging them, verifying merges, then feeding the next wave via audit + ideation + fleet-ops monitoring. **This repo's own PRs are built by Aesop's own loop.** Dogfooding, not doctrine.
15
16
 
16
- The naming is a conceit: Aesop directs the Fables (the AI models). Like the tortoise and the hare, Aesop favors the slow, deliberate orchestrator directing a fleet of fast, cheap agents toward reliable outcomes.
17
+ What you get: **cost-optimized multi-agent dispatch** (Haiku-first subagents, lean orchestrator), **durable state** (git-committed checkpoints survive wipes), **observable machinery** (every agent run logged, every cost tracked), **live dashboard** (real-time fleet health at http://localhost:8770), and **security gates** (secret-scan blocks pushes, CI validates each merge).
17
18
 
18
- ## Origin
19
+ ## What You Get
19
20
 
20
- Aesop began as damage control: an endpoint-security agent kept deleting work mid-session, so everything was forced into gitcommitted continuously, pushed constantly, reconstructable from nothing but the remotes. What started as a survival mechanism against a machine that wiped itself grew into a full multi-agent orchestration system—and one worth sharing.
21
+ - **Parallel Haiku fleets**Cheap, scoped subagents dispatch in parallel; orchestrator stays lean on main thread.
22
+ - **Durable state** — STATE.md + BUILDLOG.md checkpoints survive machine wipes; re-sync on resume, zero data loss.
23
+ - **Observable & auditable** — Every agent run logged, every cost tracked, every security event triaged.
24
+ - **Self-healing watchdog** — Runs every 150s: backs up work, scans for secrets, detects drift, restores on reboot.
25
+ - **Live web dashboard** — Real-time fleet health, security alerts, work-item kanban at `http://localhost:8770`.
26
+ - **Secret-scan gates** — Pre-push hook blocks leaks; audit trail logged. Pair with GitHub branch protection for enforcement.
21
27
 
22
- ## What it is
28
+ ## Get Started (3 steps, 5 min)
23
29
 
24
- A filesystem-first orchestration system that:
30
+ **Note:** Aesop is in beta. Install the `@beta` tag for the latest prerelease (0.1.0-beta.1+).
25
31
 
26
- - **Dispatch pattern**: Opus orchestrator on the main thread coordinates tiny scoped tasks to Haiku subagents (1/3 the token cost).
27
- - **Durable state**: git-committed checkpoints (STATE.md, BUILDLOG.md) survive machine wipes and interruptions.
28
- - **Observable machinery**: every agent run logged, every cost tracked, every security breach detected.
29
- - **Self-healing watchdog**: runs every 150s, backs up work, scans for secrets and drift, restores on reboot.
30
- - **Refinement monitor**: standing Haiku loop that watches orchestration health and auto-acts on rule friction.
31
- - **TUI dashboard**: real-time fleet status, security alerts, heartbeat liveness.
32
-
33
- ## Install & Quick Start
34
-
35
- ### Option 1: npm (Recommended for quick scaffolding)
36
-
37
- **Note:** Aesop is currently in beta. Install the prerelease version:
32
+ ### Quickest path: npx scaffold
38
33
 
39
34
  ```bash
40
- # Create a new aesop fleet directory
41
- # Using @beta tag to install the latest prerelease version (0.1.0-beta.1)
42
- npx @matt82198/aesop@beta my-fleet
35
+ npx @matt82198/aesop@beta my-fleet \
36
+ --name "my-api" \
37
+ --repos "/path/to/repo1,/path/to/repo2"
43
38
  cd my-fleet
44
39
 
45
- # Configure
46
- cp aesop.config.example.json aesop.config.json
47
- # Edit aesop.config.json with your paths and repos
48
-
49
40
  # Start the daemon
50
41
  bash daemons/run-watchdog.sh --once
51
42
 
52
- # Launch the dashboard
43
+ # Launch dashboard on localhost:8770
53
44
  python ui/serve.py
54
45
  ```
55
46
 
56
- Open `http://localhost:8770` to monitor your fleet.
47
+ Pre-push hook auto-installed. See [docs/HOOK-INSTALL.md](./docs/HOOK-INSTALL.md) for branch protection pairing.
57
48
 
58
- Alternatively, install globally:
59
- ```bash
60
- npm install -g @matt82198/aesop@beta
61
- aesop my-fleet
62
- ```
63
-
64
- ### Option 2: git clone (For development or full customization)
49
+ ### Or: git clone for hacking
65
50
 
66
51
  ```bash
67
52
  git clone https://github.com/matt82198/aesop ~/aesop
68
53
  cd ~/aesop
69
54
  cp aesop.config.example.json aesop.config.json
70
- # Edit aesop.config.json with your paths and repos
55
+ # Edit paths and repos
71
56
 
72
- # Start the daemon
73
57
  export AESOP_ROOT=$HOME/aesop
74
58
  bash $AESOP_ROOT/daemons/run-watchdog.sh --once
75
-
76
- # Launch the dashboard
77
59
  python ui/serve.py
78
60
  ```
79
61
 
80
- ## Architecture
81
-
82
- ### Directory layout
83
-
84
- ```
85
- aesop/
86
- daemons/ # Watchdog daemon + backup scripts
87
- dash/ # TUI dashboard (watchdog-gui.sh)
88
- monitor/ # Orchestration monitor (collect-signals.mjs, CHARTER.md)
89
- tools/ # Build utilities (stubs for extend)
90
- docs/ # Migration guides, deep-dives
91
- state/ # Durable checkpoints (created at runtime)
92
- aesop.config.json # Your local configuration (git-ignored)
93
- ```
94
-
95
- ### Operating the harness
96
-
97
- #### 1. Bootstrap
98
-
99
- ```bash
100
- git clone <aesop-repo> ~/aesop
101
- cd ~/aesop
102
- cp aesop.config.example.json aesop.config.json
103
- # Edit aesop.config.json with your paths and repos
104
- ```
105
-
106
- #### 2. Start the watchdog daemon
62
+ ## How It Works
107
63
 
108
- ```bash
109
- export AESOP_ROOT=$HOME/aesop
110
- bash $AESOP_ROOT/daemons/run-watchdog.sh &
111
64
  ```
112
-
113
- Runs every 150s: discovers changed repos, stashes uncommitted work, pushes backups to `backup/wip-*` branches, runs secret-scan gate.
114
-
115
- #### 3. Launch the Web Dashboard (Primary Interface)
116
-
117
- The web dashboard is the recommended way to monitor your fleet. It provides real-time observability, security alerts, and inbox integration in a modern, responsive interface.
118
-
119
- ```bash
120
- python $AESOP_ROOT/ui/serve.py
65
+ daemons/run-watchdog.sh Every 150s: backs up work, scans secrets, detects drift
66
+
67
+ orchestrator (via Claude Code) Reads backlog, dispatches Haiku subagents in parallel
68
+
69
+ parallel Haiku fleet Tiny, scoped domains (tests, build, review, docs, etc.)
70
+
71
+ watchdog verifies & merges GREEN → push to main
72
+
73
+ monitor/collect-signals.mjs Audits orchestration health, feeds next wave's backlog
74
+
75
+ STATE.md + BUILDLOG.md Git-committed, survives machine wipes
121
76
  ```
122
77
 
123
- Opens `http://localhost:8770` with:
124
- - Real-time daemon heartbeats and liveness
125
- - Active subagent tracking
126
- - Security alerts panel
127
- - Recent events log
128
- - Inbox for orchestrator communication
129
- - Repository sync status
130
-
131
- See `ui/README.md` for configuration, environment variables, and troubleshooting.
78
+ See [docs/DISPATCH-MODEL.md](./docs/DISPATCH-MODEL.md) for cost analysis and parallel patterns.
132
79
 
133
- #### (Optional) Legacy TUI Dashboard
80
+ ## Use with Claude Code
134
81
 
135
- If you prefer a terminal-based interface:
82
+ If you're using **Claude Code**, invoke `/power` at the start of each session. It loads your orchestrator brain (cardinal rules, domain map, team memory, system state) and outputs a health brief. Setup once:
136
83
 
137
84
  ```bash
138
- # On Windows (in a dedicated terminal):
139
- Start-Process "C:\Program Files\Git\git-bash.exe" -ArgumentList '-c', 'bash /c/Users/you/aesop/dash/watchdog-gui.sh'
140
-
141
- # On Unix:
142
- bash ~/aesop/dash/watchdog-gui.sh &
85
+ # Copy the /power skill
86
+ cp -r skills/power/ ~/.claude/skills/power/
143
87
  ```
144
88
 
145
- Note: The TUI is maintained for backward compatibility but is not actively developed. The web dashboard is recommended for new deployments.
89
+ Then in Claude Code, type `/power` or `/buildsystem` to start a wave cycle. See [skills/power/SKILL.md](./skills/power/SKILL.md) for details.
146
90
 
147
- #### 4. Arm the monitor loop
91
+ ## Core Principles
148
92
 
149
- ```bash
150
- # If using Claude Code, add to your CLAUDE.md or invoke via /power:
151
- # Runs collect-signals.mjs every cycle, emits BRIEF.md + SIGNALS.json,
152
- # then acts on AUTO-tier findings or stages PROPOSE-tier changes.
153
- ```
154
-
155
- ## Cardinal Rules (abridged)
156
-
157
- Read `docs/CARDINAL-RULES.md` for the full text. Core principles:
93
+ 1. **Haiku-first dispatch** — Subagents always cheap; orchestrator stays lean on main thread.
94
+ 2. **Durable state** STATE.md + BUILDLOG.md survive wipes; re-sync on resume.
95
+ 3. **Observable** Every agent run logged, every cost tracked, every security event triaged.
96
+ 4. **TDD-first** Fail tests before implementation; one Haiku per scoped domain.
97
+ 5. **Never wait** — Dispatch work in parallel; connect with heartbeats, not polling.
98
+ 6. **Push discipline** — feature/* branches only; secret-scan gates every push.
158
99
 
159
- 1. **Dispatch**: Haiku subagents only (cost lever). Opus orchestrates main-thread only.
160
- 2. **TDD-first**: Fail tests before implementation. Tiny scoped domains; one Haiku per domain.
161
- 3. **Reliability**: Every input produces output (brief/log/heartbeat/FAILED). Never wait.
162
- 4. **Durable state**: STATE.md + BUILDLOG.md checkpoints survive wipes. Re-sync on resume.
163
- 5. **Push discipline**: feature/branch → PR (never main). Continuously push green work.
164
- 6. **Control files**: Single-writer discipline (STATE.md orchestrator, MEMORY.md keeper, BUILDLOG.md append-only).
165
- 7. **Local execution**: Python runs locally only (no cloud runners). Reusable scripts in ~/scripts.
166
- 8. **Secret gates**: `secret_scan.py` blocks every push. No credentials in repos.
167
- 9. **Observability**: Every agent run logged, every cost tracked, every security event triaged.
100
+ Read [docs/CARDINAL-RULES.md](./docs/CARDINAL-RULES.md) for the full text.
168
101
 
169
102
  ## Requirements
170
103
 
171
- - **Claude Code CLI** (v0.1+): the agent-spawning harness.
172
- - **Git** (v2.40+): version control for durable state.
173
- - **Bash** (v4+): scripting (Git Bash on Windows, bash on Unix).
174
- - **Node.js** (v18+): for monitor signal collection and dashboard extras.
175
- - **Python** (v3.10+): for log rotation, secret-scan, and custom tooling.
176
- - **jq** (optional): JSON parsing in TUI dashboard.
104
+ - Claude Code CLI (v0.1+)
105
+ - Git (v2.40+)
106
+ - Bash (v4+) or Git Bash on Windows
107
+ - Node.js (v18+) for dashboard and monitor
108
+ - Python (v3.10+) for log rotation and secret-scan
109
+ - jq (optional) for TUI dashboard
177
110
 
178
- ## Setup Walkthrough
111
+ ## Scaling Cheaply
179
112
 
180
- ### 1. Edit your configuration
113
+ The **dispatch model** fans work across parallel Haiku subagents (each 1/3 the cost of Opus). The orchestrator stays lean on the main thread, coordinating via durable STATE.md. Result: ~25% the cost of an all-Opus fleet.
181
114
 
182
- ```bash
183
- cp aesop.config.example.json aesop.config.json
184
- ```
115
+ **Action tiers**: AUTO (immediate, logged) for read-only checks and appends; PROPOSE (staged in `monitor/PROPOSALS.md`) for changes requiring approval. See [docs/GOVERNANCE.md](./docs/GOVERNANCE.md).
185
116
 
186
- Edit `aesop.config.json`:
187
- - Set `aesop_root`, `brain_root`, `scripts_root`, `temp_root` to your paths.
188
- - List your project repos under `repos[]`.
189
- - Tune watchdog and monitor cycle times.
190
- - Disable secret-scan if you don't have `tools/secret_scan.py` yet.
117
+ ## Security
191
118
 
192
- ### 2. Create required directories
119
+ The pre-push hook (`hooks/pre-push-policy.sh`) enforces branch discipline and secret scanning locally. It is bypassable (use `--no-verify` to skip), so **pair it with GitHub branch protection** for real enforcement:
193
120
 
194
- ```bash
195
- mkdir -p ~/aesop/state
196
- mkdir -p ~/.heartbeats
197
121
  ```
198
-
199
- ### 3. (Optional) Add your secret-scan script
200
-
201
- If you have a security scanner, drop it at `aesop/tools/secret_scan.py`. The watchdog will call it before pushing.
202
-
203
- Example stub:
204
- ```python
205
- #!/usr/bin/env python3
206
- import sys
207
- sys.exit(0) # TODO: implement secret scanning
122
+ Settings > Branches > main
123
+ Require pull request reviews
124
+ ✓ Require status checks to pass
125
+ Dismiss stale PR approvals
126
+ ✓ Restrict pushes to (Admins only)
208
127
  ```
209
128
 
210
- ### 4. Start the daemon
129
+ Private brain (`~/.claude`) is never committed to this repo. Keep `aesop.config.json` git-ignored. Implement `tools/secret_scan.py` with your security rules. See [docs/HOOK-INSTALL.md](./docs/HOOK-INSTALL.md) for setup.
211
130
 
212
- ```bash
213
- export AESOP_ROOT=$HOME/aesop
214
- bash $AESOP_ROOT/daemons/run-watchdog.sh &
215
- ```
216
-
217
- Test mode: `bash $AESOP_ROOT/daemons/run-watchdog.sh --once`
218
-
219
- ### 5. Launch the dashboard
220
-
221
- ```bash
222
- bash ~/aesop/dash/watchdog-gui.sh
223
- ```
224
-
225
- ### 6. Arm the monitor (optional)
226
-
227
- If you're using Claude Code, add this to your orchestrator loop:
228
- ```bash
229
- export AESOP_ROOT=$HOME/aesop
230
- node $AESOP_ROOT/monitor/collect-signals.mjs
231
- ```
232
-
233
- The monitor will read `BRIEF.md` and `SIGNALS.json` each cycle and act on findings.
234
-
235
- ## Usage Patterns
236
-
237
- ### Dispatch model (how to scale cheaply)
238
-
239
- ```plaintext
240
- Orchestrator (main thread)
241
- ├─ Haiku subagent 1 (domain A: tests)
242
- ├─ Haiku subagent 2 (domain B: build)
243
- ├─ Haiku subagent 3 (domain C: review)
244
- └─ Haiku subagent 4 (domain D: docs)
245
- ```
246
-
247
- Each subagent is **tiny**, **scoped**, and **disposable**. Total cost: ~25% of all-Opus fleet.
248
-
249
- ### Action tiers (AUTO vs PROPOSE)
250
-
251
- - **AUTO**: immediate + logged (read-only checks, appends to logs, heartbeat updates).
252
- - **PROPOSE**: staged in `monitor/PROPOSALS.md`, requires user approval before execution.
131
+ ## Extending Aesop
253
132
 
254
- ### Heartbeat pattern
133
+ **Custom signal collectors**: Edit `monitor/collect-signals.mjs` to add domain-specific health checks.
255
134
 
256
- Daemons write epoch-seconds to `.heartbeat` files. The dashboard reads these to detect stalls:
257
- - Watchdog: alert if >300s old.
258
- - Monitor: alert if >3600s old.
259
- - Custom loops: check before spawning (skip if <200s).
135
+ **Custom watchdog hooks**: Edit `daemons/backup-fleet.sh` to run linters, integrate with your CI, or customize secret-scan logic.
260
136
 
261
- ## Security & Privacy
262
-
263
- **⚠️ Important**: This harness assumes a **private brain directory** (`~/.claude`) that is **NEVER committed** to this repo. Your cardinal rules, agent catalog, and memory belong in your private remote (e.g., `claude-config`).
264
-
265
- - `aesop.config.json` is git-ignored (keep your paths secret).
266
- - `state/` and `.log` files are git-ignored (keep runtime data local).
267
- - Implement `tools/secret_scan.py` with your own security rules.
268
- - Use `secret_scan.py` as a gate on every push (don't bypass).
269
-
270
- ## Extension points
271
-
272
- ### Add a custom signal collector
273
-
274
- Edit `monitor/collect-signals.mjs`:
275
- ```javascript
276
- // Example: detect junk scripts
277
- function findJunkScripts() {
278
- const junk = fs.readdirSync('/tmp').filter(f => f.endsWith('.py'));
279
- return junk;
280
- }
281
-
282
- // Then add to signals:
283
- signals.junkScripts = findJunkScripts();
284
- ```
285
-
286
- ### Customize the watchdog
287
-
288
- Edit `daemons/backup-fleet.sh`:
289
- - Parse `aesop.config.json` to discover repos dynamically.
290
- - Add per-repo hooks (e.g., run linters before backup).
291
- - Implement your own secret-scan gate.
292
-
293
- ### Extend the dashboard
294
-
295
- Edit `dash/watchdog-gui.sh`:
296
- - Add panels for CPU/memory/disk usage.
297
- - Integrate with your monitoring system.
298
- - Color-code alerts by severity.
137
+ **Dashboard panels**: Edit `ui/serve.py` or `dash/watchdog-gui.sh` to surface your metrics.
299
138
 
300
139
  ## Troubleshooting
301
140
 
302
- ### Watchdog doesn't start
303
-
304
- Check `state/FLEET-BACKUP.log` for errors. Verify `AESOP_ROOT` is set correctly.
305
-
306
- ### Dashboard shows "unavailable"
141
+ | Issue | Check |
142
+ |-------|-------|
143
+ | Watchdog doesn't start | `state/FLEET-BACKUP.log` for errors; verify `AESOP_ROOT` is set |
144
+ | Dashboard shows "unavailable" | Install Node.js v18+; check `dash-extra.mjs` is in sync |
145
+ | Secret-scan blocks push | Add suppression to `tools/secret_scan.py`; no auto-bypass (by design) |
146
+ | Monitor doesn't start | Verify Node.js on PATH; check `monitor/BRIEF.md` for logs |
307
147
 
308
- - If you see `(agents/processes panel unavailable)`, `node` is missing or `dash-extra.mjs` is not in sync.
309
- - Install Node.js v18+ and re-run.
148
+ For deeper docs, see `docs/`:
149
+ - `CARDINAL-RULES.md` full 10 principles
150
+ - `DISPATCH-MODEL.md` — cost analysis and patterns
151
+ - `CHECKPOINTING.md` — how STATE.md + BUILDLOG.md survive wipes
152
+ - `GOVERNANCE.md` — AUTO/PROPOSE tiers
310
153
 
311
- ### Secret-scan blocks a legitimate push
154
+ See [CHANGELOG.md](./CHANGELOG.md) for release notes.
312
155
 
313
- Add a suppression to your `tools/secret_scan.py`. Aesop never auto-bypasses gates (by design).
314
-
315
- ### Monitor doesn't start
156
+ ## Contributing
316
157
 
317
- Ensure Node.js is on PATH and `collect-signals.mjs` has execute permissions. Check `monitor/BRIEF.md` for the latest cycle log.
158
+ Aesop welcomes improvements. The repo uses its own `/buildsystem` loop for development—PRs from `feature/*` branches are built, tested, and merged by Aesop itself. To contribute:
318
159
 
319
- ## Architecture deep-dives
160
+ 1. Fork and create a `feature/*` branch.
161
+ 2. Write failing tests first (TDD).
162
+ 3. Open a PR; Aesop's wave cycle will verify and merge.
320
163
 
321
- See `docs/` for detailed guides:
322
- - `CARDINAL-RULES.md` — full text of the 10 cardinal rules.
323
- - `DISPATCH-MODEL.md` — cost analysis and parallel orchestration patterns.
324
- - `STATE-MACHINE.md` — how STATE.md and BUILDLOG.md survive wipes.
325
- - `MONITOR-GOVERNANCE.md` — monitor AUTO/PROPOSE tiers and approval flow.
164
+ Maintain the core principles: **Haiku-first** subagents, **lean** orchestrator, **durable** state, **observable** machinery.
326
165
 
327
166
  ## License
328
167
 
329
- MIT License. See `LICENSE` file.
330
-
331
- ## Contributing
332
-
333
- Aesop is open-source and welcomes improvements. To contribute:
334
-
335
- 1. Fork this repo.
336
- 2. Create a feature branch: `git checkout -b feature/your-idea`.
337
- 3. Add tests (TDD first).
338
- 4. Commit with clear messages.
339
- 5. Push to origin and open a PR.
340
-
341
- Maintain the cardinal rules: keep subagents cheap (Haiku), orchestrator lean, state durable, and machinery observable.
168
+ MIT. See `LICENSE`.
342
169
 
343
170
  ## References
344
171
 
345
- - [Anthropic Claude API](https://docs.anthropic.com)
172
+ - [Anthropic Claude API docs](https://docs.anthropic.com)
346
173
  - [Claude Code CLI](https://github.com/anthropics/claude-code)
347
- - [Git documentation](https://git-scm.com/doc)
348
- - Inspiration: "The Missing Memory Layer", "Agent Cost Trauma", "120 Words to Shipped" (publications on AI orchestration patterns).
174
+ - [Git docs](https://git-scm.com/doc)
349
175
 
350
176
  ---
351
177
 
352
- **Aesop Contributors**
353
- Built with the fable-fleet dispatch model in mind. May your orchestrator be wise and your subagents swift.
178
+ **Aesop**: Fable-fleet orchestration, built by Aesop itself. May your orchestrator be wise and your subagents swift.
@@ -1,47 +1,48 @@
1
1
  {
2
- "description": "Aesop configuration example. Copy to aesop.config.json and customize for your setup.",
3
- "aesop_root": "/path/to/aesop",
4
- "brain_root": "/path/to/your/brain",
5
- "scripts_root": "/path/to/your/scripts",
6
- "temp_root": "/path/to/temp/scratch",
2
+ "description": "Aesop configuration. Precedence: environment variables > config file > built-in defaults.",
3
+ "_paths": {
4
+ "aesop_root": "Set via AESOP_ROOT env var (no config key)",
5
+ "brain_root": "Override via BRAIN_ROOT env var or config; default: {aesop_root}/../.claude",
6
+ "scripts_root": "Override via SCRIPTS_ROOT env var or config; default: {aesop_root}/../scripts",
7
+ "temp_root": "Override via TEMP_ROOT env var or config; default: system temp + /claude",
8
+ "state_root": "Override via AESOP_STATE_ROOT env var or config; default: {aesop_root}/state",
9
+ "fleet_root": "Override via AESOP_FLEET_ROOT env var or config; default: $HOME (security: validate clone targets remain under this root)",
10
+ "transcripts_root": "Override via AESOP_TRANSCRIPTS_ROOT env var or config; default: ~/.claude/projects"
11
+ },
12
+ "brain_root": "~/.claude",
13
+ "scripts_root": "~/scripts",
14
+ "temp_root": "~/.aesop-temp",
15
+ "_temp_root_notes": "Portable path for temporary aesop files. ~ expands to home directory on both Windows and POSIX. Alternatively, on Windows set to %TEMP%/aesop, on POSIX set to /tmp/aesop. Config loaders expand ~ at runtime.",
16
+ "state_root": "./state",
17
+ "fleet_root": "/path/to/fleet",
18
+ "transcripts_root": "~/.claude/projects",
7
19
  "repos": [
8
20
  {
9
21
  "path": "/path/to/project1",
10
22
  "name": "project1",
23
+ "url": "https://github.com/user/project1.git",
11
24
  "primary_branch": "main",
12
25
  "backup_branch": "backup/wip"
13
26
  },
14
27
  {
15
28
  "path": "/path/to/project2",
16
29
  "name": "project2",
30
+ "url": "git@github.com:user/project2.git",
17
31
  "primary_branch": "main",
18
32
  "backup_branch": "backup/wip"
19
33
  }
20
34
  ],
21
- "watchdog": {
22
- "cycle_seconds": 150,
23
- "heartbeat_threshold_seconds": 200,
24
- "enable_secret_scan": true,
25
- "secret_scan_script": "tools/secret_scan.py"
26
- },
27
35
  "monitor": {
28
- "enable": true,
29
- "cycle_seconds": 3600,
30
- "heartbeat_threshold_seconds": 3600,
31
- "memory_staleness_days": 30,
32
36
  "log_max_lines": 500,
33
- "log_max_kb": 40
34
- },
35
- "dashboard": {
36
- "refresh_seconds": 1,
37
- "enable_jq_parsing": true,
38
- "theme": "dark"
37
+ "log_max_kb": 40,
38
+ "extended_signals": false,
39
+ "heartbeat_thresholds": {
40
+ "monitor": 3600,
41
+ "watchdog": 300,
42
+ "default": 1800
43
+ }
39
44
  },
40
45
  "cardinal_rules": {
41
- "subagent_model": "haiku",
42
- "orchestrator_model": "opus",
43
- "tdd_first": true,
44
- "never_push_main": true,
45
- "secret_scan_gates_push": true
46
+ "subagent_model": "haiku"
46
47
  }
47
48
  }
package/bin/CLAUDE.md ADDED
@@ -0,0 +1,39 @@
1
+ # bin/ — CLI scaffolder
2
+
3
+ **Purpose**: Node.js CLI entry point that clones the aesop orchestration template into a target directory with idempotent validation.
4
+
5
+ ## Invocation
6
+
7
+ - **npm registry**: `npx @matt82198/aesop [target-dir]` (default: `aesop-fleet`)
8
+ - **Local dev**: `node bin/cli.js [target-dir]`
9
+ - **Help**: `npx @matt82198/aesop --help` or `-h`
10
+
11
+ ## What gets copied
12
+
13
+ Files in `filesToCopy` array (cli.js line 57–69):
14
+ - **Directories**: `daemons/`, `dash/`, `monitor/`, `tools/`, `ui/`, `docs/`
15
+ - **Files**: `aesop.config.example.json`, `README.md`, `LICENSE`, `CHANGELOG.md`, `CLAUDE-TEMPLATE.md`
16
+ - **Brain templates** (in docs/): `MEMORY-TEMPLATE.md` (via docs/ directory copy)
17
+
18
+ ## What does NOT get copied
19
+
20
+ - `aesop.config.json` (users must `cp aesop.config.example.json` and edit)
21
+ - `state/` (runtime durable state, git-ignored, created by daemons)
22
+ - `.git/`, `node_modules/`, build artifacts
23
+
24
+ ## Post-scaffold guidance
25
+
26
+ Scaffolder prints steps for users:
27
+ 1. `cd target-dir && cp aesop.config.example.json aesop.config.json`
28
+ 2. Edit config with paths and repos
29
+ 3. Initialize brain: `cp CLAUDE-TEMPLATE.md ~/.claude/CLAUDE.md` (edit)
30
+ 4. Initialize memory: `cp docs/MEMORY-TEMPLATE.md ~/.claude/MEMORY.md` (edit)
31
+ 5. Test daemon: `bash daemons/run-watchdog.sh --once`
32
+ 6. Launch dashboard: `python ui/serve.py`
33
+
34
+ ## Invariants & gotchas
35
+
36
+ - **Idempotent on empty targets**: Fails if `targetDir` exists and is non-empty (non-destructive). Safe to retry.
37
+ - **Adding shipped files**: Any new file/dir added to `filesToCopy` array must also be added to `package.json` `files` array (lines 9–21 in package.json) so npm publish includes it.
38
+ - **No machine-specific paths**: Use relative paths only; `__dirname` and `path.join()` handle cross-platform resolution.
39
+ - **Help text accuracy**: If invocation steps or output paths change, update help text (lines 27–31).