@matt82198/aesop 0.1.0-beta.4 → 0.1.0-rc.1

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 (134) hide show
  1. package/CHANGELOG.md +187 -5
  2. package/LICENSE +66 -21
  3. package/README.md +143 -23
  4. package/aesop.config.example.json +14 -1
  5. package/bin/CLAUDE.md +42 -5
  6. package/bin/cli.js +479 -95
  7. package/daemons/CLAUDE.md +5 -2
  8. package/daemons/backup-fleet.sh +209 -51
  9. package/daemons/run-watchdog.sh +211 -62
  10. package/dash/dash-extra.mjs +73 -4
  11. package/dash/watchdog-gui.sh +41 -35
  12. package/docs/ARCHITECTURE.md +296 -0
  13. package/docs/CONCEPTS.md +254 -0
  14. package/docs/CONFIGURE.md +256 -0
  15. package/docs/FIRST-WAVE.md +276 -0
  16. package/docs/INSTALL.md +224 -0
  17. package/docs/README.md +176 -27
  18. package/docs/RELEASING.md +159 -0
  19. package/docs/archive/README.md +3 -0
  20. package/docs/{spikes → archive/spikes}/tiered-cognition/README.md +1 -3
  21. package/docs/autonomous-swe.md +149 -0
  22. package/docs/case-study-portfolio.md +61 -0
  23. package/docs/reproduce.md +121 -0
  24. package/docs/self-stats-data.json +11 -0
  25. package/docs/templates/FLEET-OPS-ANALYSIS.example.md +27 -0
  26. package/docs/templates/FLEET-OPS-RECOMMENDATIONS.example.md +24 -0
  27. package/docs/templates/PROPOSALS-LOG.example.md +64 -0
  28. package/hooks/CLAUDE.md +51 -0
  29. package/hooks/install-waveguard.sh +68 -0
  30. package/hooks/pre-commit-waveguard.sh +26 -0
  31. package/hooks/pre-push-policy.sh +253 -15
  32. package/mcp/CLAUDE.md +213 -0
  33. package/mcp/package.json +26 -0
  34. package/mcp/server.mjs +543 -0
  35. package/monitor/CHARTER.md +76 -110
  36. package/monitor/CLAUDE.md +3 -3
  37. package/monitor/collect-signals.mjs +218 -20
  38. package/package.json +17 -6
  39. package/scan/CLAUDE.md +30 -0
  40. package/scan/fleet-scan.example.mjs +292 -0
  41. package/skills/CLAUDE.md +1 -0
  42. package/skills/healthcheck/SKILL.md +44 -0
  43. package/state_store/CLAUDE.md +39 -0
  44. package/state_store/__init__.py +24 -0
  45. package/state_store/api.py +35 -0
  46. package/state_store/export.py +19 -0
  47. package/state_store/ingest.py +41 -0
  48. package/state_store/projections.py +126 -0
  49. package/state_store/store.py +197 -0
  50. package/tools/CLAUDE.md +37 -149
  51. package/tools/alert_bridge.py +453 -0
  52. package/tools/bench_runner.py +438 -0
  53. package/tools/buildlog.py +4 -7
  54. package/tools/ci_merge_wait.py +308 -14
  55. package/tools/common.py +62 -0
  56. package/tools/cost_ceiling.py +191 -0
  57. package/tools/dash.js +102 -0
  58. package/tools/doctor.js +220 -0
  59. package/tools/fleet_ledger.py +189 -17
  60. package/tools/fleet_prompt_extractor.py +134 -0
  61. package/tools/halt.py +172 -0
  62. package/tools/healthcheck.py +299 -0
  63. package/tools/heartbeat.py +4 -7
  64. package/tools/metrics_gate.py +8 -2
  65. package/tools/orchestrator_status.py +4 -9
  66. package/tools/reconcile.py +277 -0
  67. package/tools/rotate_logs.py +152 -62
  68. package/tools/scanner_selftest.py +28 -3
  69. package/tools/secret_scan.py +367 -91
  70. package/tools/self_stats.py +797 -0
  71. package/tools/session_usage_summary.py +198 -0
  72. package/tools/status.js +187 -0
  73. package/tools/svg_to_png.mjs +50 -0
  74. package/tools/transcript_replay.py +236 -0
  75. package/tools/transcript_timeline.py +184 -0
  76. package/tools/verify_agent_inspector.py +289 -0
  77. package/tools/verify_dash.py +361 -542
  78. package/tools/verify_prboard.py +344 -0
  79. package/tools/verify_submit_encoding.py +12 -4
  80. package/tools/watch.js +49 -0
  81. package/ui/CLAUDE.md +59 -41
  82. package/ui/agents.py +337 -34
  83. package/ui/api/submit.py +44 -5
  84. package/ui/api/tracker.py +15 -7
  85. package/ui/collectors.py +294 -52
  86. package/ui/config.py +31 -2
  87. package/ui/cost.py +355 -0
  88. package/ui/csrf.py +9 -4
  89. package/ui/handler.py +450 -12
  90. package/ui/render.py +26 -6
  91. package/ui/sse.py +114 -13
  92. package/ui/wave_prs.py +230 -0
  93. package/ui/web/dist/assets/index-0qQYnvMC.js +9 -0
  94. package/ui/web/dist/assets/index-BdIlFieV.css +1 -0
  95. package/ui/web/dist/index.html +14 -0
  96. package/monitor/.signal-state.json +0 -3
  97. package/monitor/ACTIONS.log +0 -1
  98. package/monitor/BRIEF.md +0 -24
  99. package/monitor/SIGNALS.json +0 -54
  100. package/tools/__pycache__/buildlog.cpython-314.pyc +0 -0
  101. package/tools/__pycache__/ci_merge_wait.cpython-314.pyc +0 -0
  102. package/tools/__pycache__/ensure_state.cpython-314.pyc +0 -0
  103. package/tools/__pycache__/eod_sweep.cpython-314.pyc +0 -0
  104. package/tools/__pycache__/fleet_ledger.cpython-314.pyc +0 -0
  105. package/tools/__pycache__/heartbeat.cpython-314.pyc +0 -0
  106. package/tools/__pycache__/inbox_drain.cpython-314.pyc +0 -0
  107. package/tools/__pycache__/launch_tui.cpython-314.pyc +0 -0
  108. package/tools/__pycache__/orchestrator_status.cpython-314.pyc +0 -0
  109. package/tools/__pycache__/power_selftest.cpython-314.pyc +0 -0
  110. package/tools/__pycache__/prepublish_scan.cpython-314.pyc +0 -0
  111. package/tools/__pycache__/rotate_logs.cpython-314.pyc +0 -0
  112. package/tools/__pycache__/scanner_selftest.cpython-314.pyc +0 -0
  113. package/tools/__pycache__/secret_scan.cpython-314.pyc +0 -0
  114. package/tools/__pycache__/stall_check.cpython-314.pyc +0 -0
  115. package/tools/__pycache__/verify_dash.cpython-314.pyc +0 -0
  116. package/tools/__pycache__/verify_submit_encoding.cpython-314.pyc +0 -0
  117. package/ui/__pycache__/agents.cpython-314.pyc +0 -0
  118. package/ui/__pycache__/collectors.cpython-314.pyc +0 -0
  119. package/ui/__pycache__/config.cpython-314.pyc +0 -0
  120. package/ui/__pycache__/csrf.cpython-314.pyc +0 -0
  121. package/ui/__pycache__/handler.cpython-314.pyc +0 -0
  122. package/ui/__pycache__/render.cpython-314.pyc +0 -0
  123. package/ui/__pycache__/serve.cpython-314.pyc +0 -0
  124. package/ui/__pycache__/sse.cpython-314.pyc +0 -0
  125. package/ui/api/__pycache__/__init__.cpython-314.pyc +0 -0
  126. package/ui/api/__pycache__/submit.cpython-314.pyc +0 -0
  127. package/ui/api/__pycache__/tracker.cpython-314.pyc +0 -0
  128. package/ui/templates/dashboard.html +0 -1202
  129. /package/docs/{spikes → archive/spikes}/tiered-cognition/ACTIVATION.md +0 -0
  130. /package/docs/{spikes → archive/spikes}/tiered-cognition/DESIGN.md +0 -0
  131. /package/docs/{spikes → archive/spikes}/tiered-cognition/FINDINGS.md +0 -0
  132. /package/docs/{spikes → archive/spikes}/tiered-cognition/aesop-cognition.example.md +0 -0
  133. /package/docs/{spikes → archive/spikes}/tiered-cognition/force-model-policy.merged.mjs +0 -0
  134. /package/docs/{spikes → archive/spikes}/tiered-cognition/strip-tools-hook.mjs +0 -0
@@ -0,0 +1,276 @@
1
+ # Your First Wave
2
+
3
+ **TL;DR**: Run `/power` to prime your orchestrator brain, then `/buildsystem` to run a complete wave cycle. This guide walks you through what to expect.
4
+
5
+ ---
6
+
7
+ ## Before You Start
8
+
9
+ Make sure you've completed:
10
+
11
+ 1. **[INSTALL.md](INSTALL.md)** — Installed Aesop and verified with `bash daemons/run-watchdog.sh --once`
12
+ 2. **[CONFIGURE.md](CONFIGURE.md)** — Created and validated `aesop.config.json`
13
+ 3. **Skills installed** — Copied `skills/power/` and `skills/buildsystem/` to `~/.claude/skills/`
14
+
15
+ ---
16
+
17
+ ## Step 1: Prime Your Orchestrator Brain (/power)
18
+
19
+ Open Claude Code and type:
20
+
21
+ ```
22
+ /power
23
+ ```
24
+
25
+ The `/power` skill reads your orchestrator brain files from disk:
26
+
27
+ - `~/.claude/CLAUDE.md` — Your global rules (cardinal rules, dispatch model, reliability principles)
28
+ - `~/.claude/MEMORY.md` — Team facts, learnings, project context
29
+ - `aesop.config.json` — Your configuration
30
+ - `state/STATE.md` — Current phase and NEXT STEPS
31
+ - `state/BUILDLOG.md` — Recent progress
32
+
33
+ **Output**: A **health brief** telling you:
34
+
35
+ ```
36
+ ✓ Orchestrator brain loaded
37
+ ✓ Repos configured: my-api (clean), my-frontend (clean)
38
+ ✓ Fleet daemons healthy (watchdog heartbeat ~10s old)
39
+ ✓ STATE.md: Phase 1 (setup), NEXT STEPS: (1) create initial backlog
40
+ ```
41
+
42
+ This tells you the orchestrator is ready.
43
+
44
+ ---
45
+
46
+ ## Step 2: Prepare a Backlog
47
+
48
+ Before running a wave, you need ranked work. The orchestrator needs to know what to build.
49
+
50
+ ### Create an initial backlog
51
+
52
+ In your orchestrator (Claude Code) or in a scratch file, write down 2–5 small tasks:
53
+
54
+ **Example backlog**:
55
+ ```
56
+ P1: Add README docs for orchestration
57
+ P2: Fix typo in dashboard title
58
+ P2: Add unit test coverage for config loader
59
+ P3: Document the watchdog daemon
60
+ ```
61
+
62
+ **Backlog principles**:
63
+
64
+ - **Sized for Haiku**: Each task should take 1 Haiku agent 3–10 minutes (not 30 minutes)
65
+ - **Scoped**: "Fix auth timeout" is better than "Refactor auth system"
66
+ - **Ranked**: P1 (blockers/critical), P2 (quality/features), P3 (tech debt/docs)
67
+ - **Typed**: Assign each to an agent type (backend-dev, frontend-dev, test-bot, docs-agent)
68
+
69
+ If your backlog items are too big, split them. If too many, rank and pick the top 3–4 for this wave.
70
+
71
+ ---
72
+
73
+ ## Step 3: Run the Wave (/buildsystem)
74
+
75
+ Type:
76
+
77
+ ```
78
+ /buildsystem
79
+ ```
80
+
81
+ The `/buildsystem` skill runs the complete wave cycle. Here's what happens:
82
+
83
+ ### Phase 1: Rank & Assign (~5 min)
84
+
85
+ The orchestrator reads your backlog and assigns agents to each item. You'll see:
86
+
87
+ ```
88
+ Wave 23 backlog:
89
+ ✓ Task 1: Add README docs (docs-agent)
90
+ ✓ Task 2: Fix typo (frontend-dev)
91
+ ✓ Task 3: Unit tests (test-bot)
92
+ → Dispatching 3 Haiku agents in parallel...
93
+ ```
94
+
95
+ ### Phase 2: Agent Fleet (60–90 min)
96
+
97
+ The orchestrator spawns 3–8 Haiku agents in parallel. Each works in its own worktree (no conflicts).
98
+
99
+ **What you see**:
100
+
101
+ ```
102
+ [Haiku-1] Docs agent: writing README...
103
+ [Haiku-2] Frontend: fixing typo...
104
+ [Haiku-3] Test: adding coverage...
105
+ ```
106
+
107
+ **Meanwhile**: The orchestrator doesn't idle. It reads the monitor for health signals, gathers fleet status for next phase, or extends the backlog with ideas.
108
+
109
+ **Watchdog**: Runs every 10s in the background, checking heartbeats and respawning any hung agents (max 3 retries).
110
+
111
+ ### Phase 3: Verify & Merge (~30 min)
112
+
113
+ Once agents finish (or hit retry cap), the orchestrator:
114
+
115
+ 1. Reviews each PR
116
+ 2. Runs tests
117
+ 3. Approves + merges
118
+ 4. Updates main
119
+
120
+ **Output**:
121
+ ```
122
+ ✓ PR #101: Add README docs (MERGED)
123
+ ✓ PR #102: Fix typo (MERGED)
124
+ ✓ PR #103: Unit tests (MERGED)
125
+ → All 3 PRs merged to main
126
+ → Integration tests: PASSED ✓
127
+ ```
128
+
129
+ ### Phase 4: Close & Audit (~15 min)
130
+
131
+ The orchestrator wraps up:
132
+
133
+ 1. **Audit**: Did agents follow rules? (branch discipline, secret-scan, test coverage)
134
+ 2. **Findings**: What went well? What bottlenecked?
135
+ 3. **Backlog for next wave**: Any learnings to feed the next cycle?
136
+
137
+ **Output**:
138
+ ```
139
+ Wave 23 complete:
140
+ ✓ 3/3 agents finished (avg 45 min each)
141
+ ✓ All PRs merged and tests green
142
+ ✓ Findings: (1) docs task took 12 min, consider breaking smaller
143
+ (2) test coverage suggestion: add integration tests
144
+ → Next wave backlog suggestions: (1) expand dashboard tests (2) cache refactor
145
+ ```
146
+
147
+ ---
148
+
149
+ ## What Happens If an Agent Hangs
150
+
151
+ **Watchdog protocol** (no human intervention needed):
152
+
153
+ 1. **First hang** (>200s idle): Watchdog auto-restarts the agent
154
+ 2. **Second hang**: Watchdog auto-restarts again
155
+ 3. **Third hang**: Watchdog auto-restarts (last automatic attempt)
156
+ 4. **Fourth hang**: Mark BLOCKED in BUILDLOG.md and surface to you
157
+
158
+ You then decide: break the task smaller, escalate to Sonnet, or park it and move on.
159
+
160
+ ---
161
+
162
+ ## Monitoring the Wave
163
+
164
+ ### Watch the dashboard
165
+
166
+ While agents work, open the dashboard:
167
+
168
+ ```bash
169
+ python ui/serve.py
170
+ ```
171
+
172
+ Then open http://localhost:8770 in your browser. You'll see:
173
+
174
+ - **Overview**: Fleet agents (running/done), recent events
175
+ - **Work** (#/work): Task kanban (proposed → ranked → in-progress → done)
176
+ - **Activity** (#/activity): Agent timeline, main-thread reasoning
177
+ - **Cost** (#/cost): Token spend, cost breakdown by model
178
+
179
+ ### Watch the TUI (Optional)
180
+
181
+ If you have `jq` installed, open the watchdog dashboard in another terminal:
182
+
183
+ ```bash
184
+ bash dash/watchdog-gui.sh
185
+ ```
186
+
187
+ This shows real-time fleet health: agents, worktrees, heartbeats, cost (refreshes every 3s, Ctrl-C to exit).
188
+
189
+ ---
190
+
191
+ ## After the Wave: Review & Learn
192
+
193
+ Once all phases complete:
194
+
195
+ 1. **Check the BUILDLOG** — Read `state/BUILDLOG.md` for timestamped progress
196
+ 2. **Review findings** — What went well? What slowed us down?
197
+ 3. **Plan the next wave** — Use audit findings to rank next backlog
198
+
199
+ **Example learnings**:
200
+
201
+ ```
202
+ ✓ Fast: docs agent (12 min) — tasks are right-sized
203
+ ⚠ Slow: test coverage took 35 min — consider pre-writing test scaffold
204
+ → Next wave: prioritize cache refactor (high-value, good for Haiku scoping)
205
+ ```
206
+
207
+ ---
208
+
209
+ ## Common Questions
210
+
211
+ ### "How long does a wave take?"
212
+
213
+ **Typical**: 2–3 hours wall-clock (agents run in parallel).
214
+
215
+ - Phase 1 (rank): 5–10 min
216
+ - Phase 2 (agents): 60–90 min
217
+ - Phase 3 (verify): 20–30 min
218
+ - Phase 4 (close): 10–20 min
219
+
220
+ If you have 8 agents, you might see 2–4 hours. If 3 agents, closer to 1.5–2 hours.
221
+
222
+ ### "What if I'm not ready for a wave?"
223
+
224
+ No problem! Run `/power` to check your health, then come back when you have a ranked backlog. Waves are optional — only run `/buildsystem` when you have work to ship.
225
+
226
+ ### "Can I cancel a wave in progress?"
227
+
228
+ Yes, type `/stop` in Claude Code to halt the orchestrator. Any agents still running will be TaskStop'd. Work in progress (open PRs) will remain on the branch for you to handle manually.
229
+
230
+ ### "How much does this cost?"
231
+
232
+ **Typical wave cost**: ~$0.03–$0.05 USD.
233
+
234
+ - 1 Opus orchestrator + 5 Haiku agents
235
+ - Haiku is ~1/5 the per-token cost of Opus
236
+ - Result: much cheaper than an all-Opus fleet
237
+
238
+ See [CONCEPTS.md](CONCEPTS.md) for the full cost model.
239
+
240
+ ### "What if an agent fails?"
241
+
242
+ The watchdog handles it:
243
+
244
+ 1. Agent task fails → watchdog detects (heartbeat stale)
245
+ 2. Watchdog TaskStop's agent and relaunches (up to 3 times)
246
+ 3. After 3 retries → mark BLOCKED and surface to you
247
+
248
+ You can then:
249
+ - Break the task smaller
250
+ - Escalate to Sonnet (rare)
251
+ - Park it and move on
252
+
253
+ ---
254
+
255
+ ## Next Steps
256
+
257
+ 1. **Refine your backlog** — Add 3–4 tasks sized for Haiku
258
+ 2. **Run your first wave** — Type `/buildsystem`
259
+ 3. **Review the findings** — Check `state/BUILDLOG.md` and audit output
260
+ 4. **Plan wave 2** — Use learnings to rank next backlog
261
+
262
+ For deeper understanding of the concepts, see [CONCEPTS.md](CONCEPTS.md). For governance and operational principles, see [GOVERNANCE.md](GOVERNANCE.md).
263
+
264
+ ---
265
+
266
+ ## Troubleshooting
267
+
268
+ | Issue | Fix |
269
+ |-------|-----|
270
+ | `/power` returns "brain not found" | Check `~/.claude/CLAUDE.md` exists; copy the skills with `cp -r skills/power/ ~/.claude/skills/power/` |
271
+ | `/buildsystem` says "no backlog" | Create a ranked backlog before running; orchestrator needs work items |
272
+ | Watchdog doesn't start | Check `AESOP_ROOT` env var is set; verify `daemons/run-watchdog.sh` is executable |
273
+ | Agents stuck at "initializing" | Check agent model exists (Haiku); monitor `/events` endpoint in dashboard for errors |
274
+ | Dashboard shows "unavailable" | Install Node.js v18+; check `dash-extra.mjs` exists in root |
275
+
276
+ For more help, see [../README.md#troubleshooting](../README.md#troubleshooting).
@@ -0,0 +1,224 @@
1
+ # Installation & Setup
2
+
3
+ **TL;DR**: Install Aesop in ~5 minutes using `npx`, set your repos, then verify with a single watchdog test run.
4
+
5
+ ---
6
+
7
+ ## Prerequisites
8
+
9
+ Before you start, make sure you have:
10
+
11
+ - **Claude Code CLI** (v0.1+) — the orchestration harness integration
12
+ - **Git** (v2.40+) — version control and worktree support
13
+ - **Bash** (v4+) or Git Bash on Windows — shell scripting support
14
+ - **Node.js** (v18+) — for dashboard and monitor signals
15
+ - **Python** (v3.10+) — for secret-scan and log rotation
16
+ - **jq** (optional) — for TUI dashboard parsing
17
+
18
+ Check your versions:
19
+ ```bash
20
+ claude --version
21
+ git --version
22
+ bash --version
23
+ node --version
24
+ python3 --version
25
+ ```
26
+
27
+ ---
28
+
29
+ ## Quick Start: npx Scaffold (Recommended)
30
+
31
+ The fastest way to get started is to use the Aesop template scaffolder. It creates a preconfigured aesop harness in a new directory.
32
+
33
+ ### Step 1: Scaffold the harness
34
+
35
+ ```bash
36
+ npx @matt82198/aesop@beta my-fleet \
37
+ --name "my-api" \
38
+ --repos "/path/to/repo1,/path/to/repo2"
39
+ ```
40
+
41
+ This creates a `my-fleet/` directory with:
42
+ - `daemons/` — watchdog, backup, secret-scan
43
+ - `skills/` — /power and /buildsystem skill templates
44
+ - `monitor/` — signal collectors
45
+ - `ui/` — web dashboard
46
+ - `aesop.config.json` — your configuration
47
+ - `state/` — runtime checkpoints (git-ignored)
48
+ - Pre-installed pre-push hook in `.git/hooks/`
49
+
50
+ ### Step 2: Install orchestrator skills
51
+
52
+ Copy the skill definitions to your Claude Code home directory:
53
+
54
+ ```bash
55
+ cd my-fleet
56
+
57
+ # Copy /power skill (orchestrator brain)
58
+ cp -r skills/power/ ~/.claude/skills/power/
59
+
60
+ # Copy /buildsystem skill (wave cycle automation)
61
+ cp -r skills/buildsystem/ ~/.claude/skills/buildsystem/
62
+ ```
63
+
64
+ ### Step 3: Verify the installation
65
+
66
+ Run the watchdog once to test everything:
67
+
68
+ ```bash
69
+ bash daemons/run-watchdog.sh --once
70
+ ```
71
+
72
+ Expected output:
73
+ ```
74
+ [watchdog] backing up fleet state...
75
+ [watchdog] scanning for secrets...
76
+ [watchdog] drift check: (files checked) ✓
77
+ [watchdog] all clear
78
+ ```
79
+
80
+ If you see errors, check the logs in `state/FLEET-BACKUP.log`.
81
+
82
+ ---
83
+
84
+ ## Manual Setup: Git Clone (For Development)
85
+
86
+ If you're hacking on Aesop itself, clone the repo and set up manually:
87
+
88
+ ### Step 1: Clone and configure
89
+
90
+ ```bash
91
+ git clone https://github.com/matt82198/aesop ~/my-aesop
92
+ cd ~/my-aesop
93
+
94
+ # Create your configuration
95
+ cp aesop.config.example.json aesop.config.json
96
+ ```
97
+
98
+ ### Step 2: Edit aesop.config.json
99
+
100
+ Open `aesop.config.json` and customize for your repos (see [CONFIGURE.md](CONFIGURE.md) for full details):
101
+
102
+ ```json
103
+ {
104
+ "aesopRoot": "/home/user/my-aesop",
105
+ "braindRoot": "/home/user/.claude",
106
+ "repos": [
107
+ {
108
+ "path": "/home/user/my-repo1",
109
+ "name": "my-api"
110
+ },
111
+ {
112
+ "path": "/home/user/my-repo2",
113
+ "name": "my-frontend"
114
+ }
115
+ ],
116
+ "dashboardPort": 8770,
117
+ "dashboardOrigin": "http://localhost:8770"
118
+ }
119
+ ```
120
+
121
+ ### Step 3: Install skills and test
122
+
123
+ ```bash
124
+ # Copy skills to Claude Code
125
+ cp -r skills/power/ ~/.claude/skills/power/
126
+ cp -r skills/buildsystem/ ~/.claude/skills/buildsystem/
127
+
128
+ # Set environment variable (add to ~/.bashrc or ~/.zprofile)
129
+ export AESOP_ROOT=/home/user/my-aesop
130
+
131
+ # Verify
132
+ bash $AESOP_ROOT/daemons/run-watchdog.sh --once
133
+ ```
134
+
135
+ ---
136
+
137
+ ## What Gets Created
138
+
139
+ After setup, you'll have:
140
+
141
+ ### Main directories
142
+
143
+ - **daemons/** — Background watchdog (runs every 150s)
144
+ - `run-watchdog.sh` — main daemon loop
145
+ - `backup-fleet.sh` — backs up work to a safe branch
146
+ - `secret-scan.py` — blocks pushes with detected credentials
147
+
148
+ - **state/** — Runtime checkpoints (git-ignored)
149
+ - `STATE.md` — current phase and NEXT STEPS
150
+ - `BUILDLOG.md` — append-only progress log
151
+ - `.watchdog-heartbeat` — daemon liveness marker
152
+
153
+ - **skills/** — Claude Code orchestration skills
154
+ - `power/` — /power skill template (prime orchestrator brain)
155
+ - `buildsystem/` — /buildsystem skill template (wave cycle automation)
156
+
157
+ - **monitor/** — Signal collectors
158
+ - `collect-signals.mjs` — health checks (extensible)
159
+
160
+ - **ui/** — Web dashboard
161
+ - `serve.py` — Python backend (JSON/SSE APIs)
162
+ - `web/` — React frontend (hash-routed SPA)
163
+
164
+ - **hooks/** — Git pre-push policies
165
+ - `pre-push-policy.sh` — branch discipline + secret-scan enforcement
166
+
167
+ - **.git/hooks/pre-push** — Auto-installed pre-push hook (configured during setup)
168
+
169
+ ### Configuration files
170
+
171
+ - **aesop.config.json** — Main configuration (git-ignored, never commit credentials)
172
+ - `aesopRoot` — path to this harness directory
173
+ - `braindRoot` — path to Claude Code home (`~/.claude`)
174
+ - `repos` — list of monitored repositories
175
+ - `dashboardPort` — web dashboard port (default: 8770)
176
+ - `dashboardOrigin` — CORS origin validation
177
+
178
+ - **aesop.config.example.json** — Template with defaults (commit this, use as reference)
179
+
180
+ ---
181
+
182
+ ## Environment Variables
183
+
184
+ Optional environment variables you can set in your shell:
185
+
186
+ ```bash
187
+ # Point to the Aesop harness root (used by daemons)
188
+ export AESOP_ROOT=/home/user/my-aesop
189
+
190
+ # Optional: custom location for Claude Code home
191
+ export CLAUDE_CODE_HOME=/home/user/.claude
192
+
193
+ # Optional: enable debug output in daemons
194
+ export DEBUG=1
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Pre-push Hook Installation
200
+
201
+ The `npx` scaffold installs the pre-push hook automatically. If you cloned the repo manually, install it:
202
+
203
+ ```bash
204
+ mkdir -p .git/hooks
205
+ cp hooks/pre-push-policy.sh .git/hooks/pre-push
206
+ chmod +x .git/hooks/pre-push
207
+ ```
208
+
209
+ The hook enforces:
210
+ - Feature branches only (never direct pushes to `main`/`master`)
211
+ - Secret scanning (blocks commits with detected credentials)
212
+
213
+ To bypass during testing: `git push --no-verify` (not recommended for production).
214
+
215
+ ---
216
+
217
+ ## Next Steps
218
+
219
+ 1. **Read [CONFIGURE.md](CONFIGURE.md)** — Customize repos, ports, and brain root
220
+ 2. **Run [FIRST-WAVE.md](FIRST-WAVE.md)** — Test a full `/power` → `/buildsystem` cycle
221
+ 3. **Understand [CONCEPTS.md](CONCEPTS.md)** — Learn the dispatch model and state model
222
+ 4. **Explore the dashboard** — `python3 ui/serve.py` then open http://localhost:8770
223
+
224
+ For troubleshooting, see the [Aesop README](../README.md#troubleshooting) or [GOVERNANCE.md](GOVERNANCE.md) for operational policies.