aether-colony 5.1.0 → 5.2.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 (52) hide show
  1. package/.aether/aether-utils.sh +122 -42
  2. package/.aether/commands/colonize.yaml +4 -0
  3. package/.aether/commands/council.yaml +205 -0
  4. package/.aether/commands/init.yaml +46 -13
  5. package/.aether/commands/insert-phase.yaml +4 -0
  6. package/.aether/commands/plan.yaml +53 -2
  7. package/.aether/commands/quick.yaml +104 -0
  8. package/.aether/commands/resume-colony.yaml +6 -4
  9. package/.aether/commands/resume.yaml +9 -0
  10. package/.aether/commands/run.yaml +37 -1
  11. package/.aether/commands/seal.yaml +9 -0
  12. package/.aether/commands/status.yaml +45 -1
  13. package/.aether/docs/command-playbooks/build-full.md +2 -1
  14. package/.aether/docs/command-playbooks/build-prep.md +2 -1
  15. package/.aether/docs/command-playbooks/continue-full.md +1 -0
  16. package/.aether/docs/command-playbooks/continue-verify.md +1 -0
  17. package/.aether/utils/council.sh +425 -0
  18. package/.aether/utils/error-handler.sh +3 -3
  19. package/.aether/utils/flag.sh +23 -12
  20. package/.aether/utils/hive.sh +2 -2
  21. package/.aether/utils/immune.sh +508 -0
  22. package/.aether/utils/learning.sh +2 -2
  23. package/.aether/utils/midden.sh +178 -0
  24. package/.aether/utils/queen.sh +29 -17
  25. package/.aether/utils/session.sh +264 -0
  26. package/.aether/utils/spawn-tree.sh +7 -7
  27. package/.aether/utils/spawn.sh +2 -2
  28. package/.aether/utils/state-api.sh +191 -1
  29. package/.claude/commands/ant/colonize.md +2 -0
  30. package/.claude/commands/ant/council.md +205 -0
  31. package/.claude/commands/ant/init.md +46 -13
  32. package/.claude/commands/ant/insert-phase.md +4 -0
  33. package/.claude/commands/ant/plan.md +27 -1
  34. package/.claude/commands/ant/quick.md +100 -0
  35. package/.claude/commands/ant/resume-colony.md +3 -2
  36. package/.claude/commands/ant/resume.md +9 -0
  37. package/.claude/commands/ant/run.md +37 -1
  38. package/.claude/commands/ant/seal.md +9 -0
  39. package/.claude/commands/ant/status.md +45 -1
  40. package/.opencode/commands/ant/colonize.md +2 -0
  41. package/.opencode/commands/ant/council.md +143 -0
  42. package/.opencode/commands/ant/init.md +46 -13
  43. package/.opencode/commands/ant/insert-phase.md +4 -0
  44. package/.opencode/commands/ant/plan.md +26 -1
  45. package/.opencode/commands/ant/quick.md +91 -0
  46. package/.opencode/commands/ant/resume-colony.md +3 -2
  47. package/.opencode/commands/ant/resume.md +9 -0
  48. package/.opencode/commands/ant/run.md +37 -1
  49. package/.opencode/commands/ant/status.md +2 -0
  50. package/CHANGELOG.md +90 -0
  51. package/README.md +23 -0
  52. package/package.json +10 -2
@@ -43,6 +43,8 @@ Read `.aether/data/COLONY_STATE.json`.
43
43
 
44
44
  **If the file exists:** continue.
45
45
 
46
+ **If `milestone` == `"Crowned Anthill"`:** output "This colony has been sealed. Start a new colony with `/ant:init \"new goal\"`.", stop.
47
+
46
48
  **If `plan.phases` is not empty:** output "Colony already has phases. Use /ant:continue.", stop.
47
49
 
48
50
  ### Step 2: Quick Surface Scan (for session context)
@@ -15,9 +15,146 @@ You are the **Queen Ant Colony**. Convene the council to clarify user intent and
15
15
  ## Instructions
16
16
 
17
17
  Parse `$normalized_args`:
18
+ - If starts with `--deliberate`: set `deliberate_mode = true`, extract proposal text after `--deliberate`
18
19
  - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
19
20
  - Otherwise: set `visual_mode = true`
20
21
 
22
+ **If `deliberate_mode` is true:** Skip to [Deliberation Mode](#deliberation-mode) and stop after it.
23
+
24
+ ---
25
+
26
+ ## Deliberation Mode
27
+
28
+ When `--deliberate "<proposal>"` is passed, run a structured Advocate/Challenger/Sage deliberation.
29
+
30
+ ### Step D1: Check Budget
31
+
32
+ Run using the Bash tool with description "Checking deliberation budget...":
33
+ ```bash
34
+ bash .aether/aether-utils.sh council-budget-check
35
+ ```
36
+
37
+ Parse result. If `allowed` is `false`:
38
+ ```
39
+ 📜🐜🏛️🐜📜 COUNCIL — BUDGET EXHAUSTED
40
+
41
+ Spawn budget is fully allocated. Complete or close existing deliberations before starting new ones.
42
+ Run /ant:council to review existing deliberations.
43
+ ```
44
+ Stop here.
45
+
46
+ ### Step D2: Open Deliberation
47
+
48
+ Run using the Bash tool with description "Opening deliberation...":
49
+ ```bash
50
+ bash .aether/aether-utils.sh council-deliberate --proposal "<proposal>"
51
+ ```
52
+
53
+ Capture `deliberation_id` from `result.id`.
54
+
55
+ Display:
56
+ ```
57
+ 📜🐜🏛️🐜📜 COUNCIL DELIBERATION OPENED
58
+
59
+ Proposal: "<proposal>"
60
+ ID: {deliberation_id}
61
+ Budget: {budget} spawns available
62
+
63
+ Convening Advocate, Challenger, and Sage...
64
+ ```
65
+
66
+ ### Step D3: Spawn Advocate Scout
67
+
68
+ Spawn an Advocate scout to argue **in favor** of the proposal.
69
+
70
+
71
+
72
+ Record the argument:
73
+ ```bash
74
+ bash .aether/aether-utils.sh council-advocate \
75
+ --deliberation-id "<deliberation_id>" \
76
+ --argument "<advocate_argument>"
77
+ ```
78
+
79
+ Display:
80
+ ```
81
+ ⚖️ ADVOCATE:
82
+ {advocate_argument}
83
+ ```
84
+
85
+ ### Step D4: Spawn Challenger Scout
86
+
87
+ Spawn a Challenger scout to argue **against** the proposal.
88
+
89
+
90
+
91
+ Record the argument:
92
+ ```bash
93
+ bash .aether/aether-utils.sh council-challenger \
94
+ --deliberation-id "<deliberation_id>" \
95
+ --argument "<challenger_argument>"
96
+ ```
97
+
98
+ Display:
99
+ ```
100
+ ⚔️ CHALLENGER:
101
+ {challenger_argument}
102
+ ```
103
+
104
+ ### Step D5: Spawn Sage Scout
105
+
106
+ Spawn a Sage scout to synthesize both positions and provide a recommendation.
107
+
108
+
109
+
110
+ Record the sage synthesis:
111
+ ```bash
112
+ bash .aether/aether-utils.sh council-sage \
113
+ --deliberation-id "<deliberation_id>" \
114
+ --synthesis "<synthesis>" \
115
+ --recommendation "<recommendation>"
116
+ ```
117
+
118
+ ### Step D6: Display Result
119
+
120
+ ```
121
+ 📜🐜🏛️🐜📜 COUNCIL DELIBERATION COMPLETE
122
+
123
+ Proposal: "<proposal>"
124
+
125
+ ⚖️ Advocate:
126
+ {advocate_argument}
127
+
128
+ ⚔️ Challenger:
129
+ {challenger_argument}
130
+
131
+ 🧙 Sage Synthesis:
132
+ {synthesis}
133
+
134
+ Recommendation: {recommendation}
135
+ ```
136
+
137
+ If recommendation is `adopt` or `adopt-with-conditions`:
138
+ ```
139
+ ✅ Council recommends proceeding.
140
+ Run /ant:focus "<proposal summary>" to inject guidance for the colony.
141
+ ```
142
+
143
+ If recommendation is `reject`:
144
+ ```
145
+ ❌ Council recommends against this proposal.
146
+ Run /ant:redirect "<proposal summary>" if you want to make this a hard constraint.
147
+ ```
148
+
149
+ If recommendation is `defer`:
150
+ ```
151
+ ⏸️ Council recommends deferring this decision.
152
+ Return when more context is available.
153
+ ```
154
+
155
+ ---
156
+
157
+
21
158
 
22
159
  ### Step 1: Read Current State
23
160
 
@@ -31,6 +168,12 @@ No colony initialized. Run /ant:init first.
31
168
  ```
32
169
  Stop here.
33
170
 
171
+ If `milestone` == `"Crowned Anthill"`:
172
+ ```
173
+ This colony has been sealed. Start a new colony with /ant:init "new goal".
174
+ ```
175
+ Stop here.
176
+
34
177
  Capture the current state for context:
35
178
  - `prior_state` = state field value (READY, EXECUTING, PLANNING, etc.)
36
179
  - `current_phase` = current_phase field value
@@ -144,8 +144,14 @@ If `scan_result` is empty or `jq` fails, set all fields to fallback values (empt
144
144
 
145
145
  Use Read tool to check `.aether/data/COLONY_STATE.json`.
146
146
 
147
- - If file exists AND has a non-null `goal` field: set `reinit_mode = true`, store `existing_goal`
148
- - Otherwise: set `reinit_mode = false`
147
+ - If file exists AND has a non-null `goal` field:
148
+ - Check the `milestone` field. If `milestone == "Crowned Anthill"`:
149
+ - This is a **sealed colony**. Treat as **fresh init**, NOT re-init.
150
+ - Set `reinit_mode = false`
151
+ - Display: `Previous colony was sealed. Starting fresh colony.`
152
+ - The old COLONY_STATE.json will be overwritten in Step 7 (fresh init path).
153
+ - Otherwise (colony exists but is NOT sealed): set `reinit_mode = true`, store `existing_goal`
154
+ - If file does not exist or `goal` is null: set `reinit_mode = false`
149
155
 
150
156
  If re-init mode, read existing charter entries from `.aether/QUEEN.md`:
151
157
  ```bash
@@ -285,14 +291,29 @@ bash .aether/aether-utils.sh charter-write --intent "{approved_intent}" --vision
285
291
 
286
292
  2. Auto-apply approved pheromone suggestions (see pheromone auto-apply below).
287
293
 
288
- 3. Optionally update the goal field in COLONY_STATE.json in-place:
294
+ 3. Update the goal field in COLONY_STATE.json in-place using the state API:
289
295
  ```bash
290
- jq --arg new_goal "{approved_intent}" '.goal = $new_goal' .aether/data/COLONY_STATE.json > .aether/data/COLONY_STATE.json.tmp && mv .aether/data/COLONY_STATE.json.tmp .aether/data/COLONY_STATE.json
296
+ bash .aether/aether-utils.sh state-write "$(jq --arg new_goal "{approved_intent}" '.goal = $new_goal' .aether/data/COLONY_STATE.json)"
291
297
  ```
292
298
 
293
- 4. Run `bash .aether/aether-utils.sh session-init "$(jq -r '.session_id' .aether/data/COLONY_STATE.json)" "{approved_intent}"`
299
+ 4. **Verify the write** read back and confirm goal is set:
300
+ ```bash
301
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json)
302
+ if [[ "$verify_goal" == "null" || -z "$verify_goal" ]]; then
303
+ echo "ERROR: Colony state write failed — goal is still null after write. Re-run /ant:init."
304
+ # Attempt recovery: write goal directly
305
+ jq --arg g "{approved_intent}" '.goal = $g' .aether/data/COLONY_STATE.json > .aether/data/COLONY_STATE.json.tmp && mv .aether/data/COLONY_STATE.json.tmp .aether/data/COLONY_STATE.json
306
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json)
307
+ if [[ "$verify_goal" == "null" || -z "$verify_goal" ]]; then
308
+ echo "FATAL: Recovery write also failed. Colony state may be corrupted."
309
+ stop
310
+ fi
311
+ fi
312
+ ```
313
+
314
+ 5. Run `bash .aether/aether-utils.sh session-init "$(jq -r '.session_id' .aether/data/COLONY_STATE.json)" "{approved_intent}"`
294
315
 
295
- 5. Skip to Step 8 (display result). Do NOT write COLONY_STATE.json from template, do NOT write constraints.json, do NOT write pheromones.json.
316
+ 6. Skip to Step 8 (display result). Do NOT write COLONY_STATE.json from template, do NOT write constraints.json, do NOT write pheromones.json.
296
317
 
297
318
  **If fresh init:**
298
319
 
@@ -308,12 +329,24 @@ jq --arg new_goal "{approved_intent}" '.goal = $new_goal' .aether/data/COLONY_ST
308
329
  - Remove ALL keys starting with underscore
309
330
  - Write the resulting JSON to `.aether/data/COLONY_STATE.json` using the Write tool
310
331
 
311
- 5. Write constraints.json from template:
332
+ 5. **Verify the write** — read back and confirm COLONY_STATE.json is valid and goal is set:
333
+ ```bash
334
+ verify_goal=$(jq -r '.goal' .aether/data/COLONY_STATE.json 2>/dev/null)
335
+ verify_valid=$(jq -e . .aether/data/COLONY_STATE.json >/dev/null 2>&1 && echo "valid" || echo "invalid")
336
+ if [[ "$verify_valid" != "valid" || "$verify_goal" == "null" || -z "$verify_goal" ]]; then
337
+ echo "ERROR: Colony state write verification failed (valid=$verify_valid, goal=$verify_goal)"
338
+ echo "The colony file may be corrupted. Remove .aether/data/COLONY_STATE.json and re-run /ant:init."
339
+ stop
340
+ fi
341
+ echo "Colony state verified: goal=\"$verify_goal\""
342
+ ```
343
+
344
+ 6. Write constraints.json from template:
312
345
  - Resolve template: check `~/.aether/system/templates/constraints.template.json` first, then `.aether/templates/constraints.template.json`
313
346
  - If no template found: output "Template missing: constraints.template.json. Run aether update to fix." and stop
314
347
  - Read template, follow `_instructions`, remove `_` prefixed keys, write to `.aether/data/constraints.json`
315
348
 
316
- 6. Initialize runtime files from templates (non-blocking):
349
+ 7. Initialize runtime files from templates (non-blocking):
317
350
  ```bash
318
351
  for template in pheromones midden learning-observations; do
319
352
  if [[ "$template" == "midden" ]]; then
@@ -336,15 +369,15 @@ for template in pheromones midden learning-observations; do
336
369
  done
337
370
  ```
338
371
 
339
- 7. Run `bash .aether/aether-utils.sh context-update init "{approved_intent}"`
340
- 8. Run `bash .aether/aether-utils.sh validate-state colony`
341
- 9. Register repo (silent on failure):
372
+ 8. Run `bash .aether/aether-utils.sh context-update init "{approved_intent}"`
373
+ 9. Run `bash .aether/aether-utils.sh validate-state colony`
374
+ 10. Register repo (silent on failure):
342
375
  ```bash
343
376
  domain_tags=$(bash .aether/aether-utils.sh domain-detect 2>/dev/null | jq -r '.result.tags // ""' || echo "")
344
377
  bash .aether/aether-utils.sh registry-add "$(pwd)" "$(jq -r '.version // "unknown"' ~/.aether/version.json 2>/dev/null || echo 'unknown')" --goal "{approved_intent}" --active true --tags "$domain_tags" 2>/dev/null || true
345
378
  cp ~/.aether/version.json .aether/version.json 2>/dev/null || true
346
379
  ```
347
- 10. Seed QUEEN.md from hive (non-blocking):
380
+ 11. Seed QUEEN.md from hive (non-blocking):
348
381
  ```bash
349
382
  domain_tags=$(jq -r --arg repo "$(pwd)" \
350
383
  '[.repos[] | select(.path == $repo) | .domain_tags // []] | .[0] // [] | join(",")' \
@@ -354,7 +387,7 @@ seed_args="queen-seed-from-hive --limit 5"
354
387
  seed_result=$(bash .aether/aether-utils.sh $seed_args 2>/dev/null || echo '{}')
355
388
  seeded_count=$(echo "$seed_result" | jq -r '.result.seeded // 0' 2>/dev/null || echo "0")
356
389
  ```
357
- 11. Run `bash .aether/aether-utils.sh session-init "{session_id}" "{approved_intent}"`
390
+ 12. Run `bash .aether/aether-utils.sh session-init "{session_id}" "{approved_intent}"`
358
391
 
359
392
  **Pheromone auto-apply (referenced by both re-init and fresh init paths above):**
360
393
 
@@ -22,6 +22,10 @@ If `goal` is null:
22
22
  `No colony initialized. Run /ant:init first.`
23
23
  Stop.
24
24
 
25
+ If `milestone` == `"Crowned Anthill"`:
26
+ `This colony has been sealed. Start a new colony with /ant:init "new goal".`
27
+ Stop.
28
+
25
29
  If `plan.phases` is empty:
26
30
  `No project plan. Run /ant:plan first.`
27
31
  Stop.
@@ -30,7 +30,7 @@ If `version` field is missing, "1.0", or "2.0":
30
30
  3. Output: `State auto-upgraded to v3.0`
31
31
  4. Continue with command.
32
32
 
33
- Extract: `goal`, `plan.phases`
33
+ Extract: `goal`, `milestone`, `plan.phases`
34
34
 
35
35
  **Validate:** If `goal: null`:
36
36
  ```
@@ -38,6 +38,12 @@ No colony initialized. Run /ant:init "<goal>" first.
38
38
  ```
39
39
  Stop here.
40
40
 
41
+ If `milestone` == `"Crowned Anthill"`:
42
+ ```
43
+ This colony has been sealed. Start a new colony with /ant:init "new goal".
44
+ ```
45
+ Stop here.
46
+
41
47
  ### Step 1.5: Load State and Show Resumption Context
42
48
 
43
49
  Run using Bash tool: `bash .aether/aether-utils.sh load-state`
@@ -567,6 +573,25 @@ Read current COLONY_STATE.json, then update:
567
573
 
568
574
  Write COLONY_STATE.json.
569
575
 
576
+ **Verify the write** — read back and confirm the plan persisted:
577
+ ```bash
578
+ verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
579
+ verify_timestamp=$(jq -r '.plan.generated_at' .aether/data/COLONY_STATE.json)
580
+ verify_state=$(jq -r '.state' .aether/data/COLONY_STATE.json)
581
+ if [[ "$verify_phases" -lt 1 || "$verify_timestamp" == "null" || "$verify_state" != "READY" ]]; then
582
+ echo "ERROR: Plan write verification failed (phases=$verify_phases, generated_at=$verify_timestamp, state=$verify_state)"
583
+ echo "Attempting retry write..."
584
+ bash .aether/aether-utils.sh state-write "$(jq --argjson phases "$(echo '$PLAN_JSON' | jq '.plan.phases')" --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" '.plan.phases = $phases | .plan.generated_at = $ts | .state = "READY"' .aether/data/COLONY_STATE.json)"
585
+ verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
586
+ if [[ "$verify_phases" -lt 1 ]]; then
587
+ echo "FATAL: Retry write also failed. Plan was not persisted."
588
+ echo "Re-run /ant:plan to regenerate."
589
+ stop
590
+ fi
591
+ fi
592
+ echo "Plan verified: $verify_phases phases, generated_at=$verify_timestamp, state=$verify_state"
593
+ ```
594
+
570
595
  Log plan completion: `bash .aether/aether-utils.sh activity-log "PLAN_COMPLETE" "queen" "Plan finalized with {confidence}% confidence"`
571
596
 
572
597
  Update watch-status.txt:
@@ -0,0 +1,91 @@
1
+ <!-- Generated from .aether/commands/quick.yaml - DO NOT EDIT DIRECTLY -->
2
+ ---
3
+ name: ant:quick
4
+ description: "🔍🐜⚡🐜🔍 Quick scout query — fast answers without build ceremony"
5
+ ---
6
+
7
+ ### Step -1: Normalize Arguments
8
+
9
+ Run: `normalized_args=$(bash .aether/aether-utils.sh normalize-args "$@")`
10
+
11
+ This ensures arguments work correctly in both Claude Code and OpenCode. Use `$normalized_args` throughout this command.
12
+
13
+ You are the **Queen**. Execute `/ant:quick` — a lightweight scout mission.
14
+
15
+ The query is: `$normalized_args`
16
+
17
+ ## Purpose
18
+
19
+ Quick, focused answers to questions about the codebase, patterns, or implementation
20
+ details. No build ceremony, no state changes, no verification waves.
21
+
22
+ ## Instructions
23
+
24
+ ### Step 1: Validate Arguments
25
+
26
+ If `$normalized_args` is empty:
27
+ ```
28
+ Usage: /ant:quick "<question>"
29
+
30
+ Examples:
31
+ /ant:quick "how does the pheromone system work?"
32
+ /ant:quick "find all uses of acquire_lock"
33
+ /ant:quick "what tests cover midden-write?"
34
+ /ant:quick "show me the colony-prime token budget logic"
35
+ ```
36
+ Stop here.
37
+
38
+ ### Step 2: Generate Scout Name
39
+
40
+ Run:
41
+ ```bash
42
+ bash .aether/aether-utils.sh generate-ant-name "scout"
43
+ ```
44
+
45
+ Capture the output as `scout_name`.
46
+
47
+ ### Step 3: Spawn Scout
48
+
49
+ Display:
50
+ ```
51
+ ━━━ Quick Scout ━━━
52
+ Spawning {scout_name} — {query truncated to 50 chars}
53
+ ```
54
+
55
+ Run:
56
+ ```bash
57
+ bash .aether/aether-utils.sh spawn-log "Queen" "scout" "{scout_name}" "Quick query: {query}"
58
+ ```
59
+
60
+
61
+
62
+ Investigate the query directly using available tools (Grep, Glob, Read).
63
+ Search the codebase and provide a clear, focused answer with file paths and line numbers for key findings.
64
+ Keep your answer concise and actionable.
65
+
66
+
67
+ ### Step 4: Display Results
68
+
69
+
70
+
71
+ Display your findings directly to the user.
72
+
73
+
74
+ Run:
75
+ ```bash
76
+ bash .aether/aether-utils.sh spawn-complete "{scout_name}" "completed" "Quick query answered"
77
+ ```
78
+
79
+ ### Step 5: Update Session (lightweight)
80
+
81
+ Run:
82
+ ```bash
83
+ bash .aether/aether-utils.sh session-update "/ant:quick" "" "Quick query: {query truncated to 60 chars}" 2>/dev/null || true
84
+ ```
85
+
86
+ **NOTE:** This command does NOT:
87
+ - Modify COLONY_STATE.json
88
+ - Advance phases
89
+ - Create checkpoints
90
+ - Spawn watchers or chaos ants
91
+ - Run verification
@@ -31,8 +31,9 @@ Run using Bash tool: `bash .aether/aether-utils.sh load-state`
31
31
  If successful:
32
32
  1. Parse state from result
33
33
  2. If goal is null: Show "No colony state found..." message and stop
34
- 3. Check if paused flag is true - if not, note "Colony was not paused, but resuming anyway"
35
- 4. Extract all state fields for display
34
+ 3. If `milestone` == `"Crowned Anthill"`: Show "This colony has been sealed. Start a new colony with `/ant:init \"new goal\"`." and stop
35
+ 4. Check if paused flag is true - if not, note "Colony was not paused, but resuming anyway"
36
+ 5. Extract all state fields for display
36
37
 
37
38
  Keep state loaded (don't unload yet) - we'll need it for the full display.
38
39
 
@@ -68,6 +68,7 @@ Use the Read tool to read `.aether/data/COLONY_STATE.json`.
68
68
 
69
69
  COLONY_STATE.json is the authoritative source for goal and state (session.json may be stale). Extract:
70
70
  - `goal` (use this as authoritative, overriding session.json colony_goal)
71
+ - `milestone` (check for sealed colony)
71
72
  - `state` (READY, PLANNING, EXECUTING, PAUSED)
72
73
  - `current_phase`
73
74
  - `plan.phases` (array with id, name, status for each phase)
@@ -75,6 +76,14 @@ COLONY_STATE.json is the authoritative source for goal and state (session.json m
75
76
  - `memory.decisions` (flat list — do NOT distinguish user vs Claude origin)
76
77
  - `events` (last 5 for recent activity context)
77
78
 
79
+ **If `milestone` == `"Crowned Anthill"`:** This colony has been sealed. Display:
80
+ ```
81
+ This colony has been sealed (Crowned Anthill).
82
+
83
+ Start a new colony with /ant:init "new goal"
84
+ ```
85
+ Stop here — do NOT display stale phase data from the sealed colony.
86
+
78
87
  If the file is missing or the JSON cannot be parsed, **stop immediately** and display:
79
88
 
80
89
  ```
@@ -36,6 +36,7 @@ Parse `$normalized_args` for:
36
36
  - `--replan-interval N` — Pause for replan suggestion every N phases (default: 2)
37
37
  - `--continue` — Resume after a replan pause without replanning
38
38
  - `--dry-run` — Preview plan without executing
39
+ - `--headless` — Run without interactive prompts; queue decisions for later review
39
40
  - `--verbose` / `-v`, `--no-visual`, `--no-suggest` — Pass through to playbooks
40
41
 
41
42
  ```
@@ -44,6 +45,7 @@ Parse `$normalized_args` for:
44
45
  /ant:run --replan-interval 3 Suggest replan every 3 phases instead of 2
45
46
  /ant:run --continue Resume after replan pause without replanning
46
47
  /ant:run --dry-run Preview the autopilot plan
48
+ /ant:run --headless Run all phases without interactive prompts
47
49
  /ant:run --max-phases 3 -v Run 3 phases with verbose output
48
50
  ```
49
51
 
@@ -69,10 +71,14 @@ replan suggestion (every {replan_interval} phases)
69
71
  ### Step 0: Initialize
70
72
 
71
73
  1. Read `.aether/data/COLONY_STATE.json`; validate goal + plan.phases exist
74
+ - If `milestone` == `"Crowned Anthill"`: output "This colony has been sealed. Start a new colony with `/ant:init \"new goal\"`." and stop
72
75
  2. Determine remaining incomplete phases; apply `--max-phases` cap
73
76
  3. Set `phases_completed = 0`, `autopilot_start = $(date +%s)`
74
77
  4. Record pre-build blocker count: `bash .aether/aether-utils.sh flag-check-blockers {phase}`
75
- 5. Display: `AUTOPILOT ENGAGED | Goal: {goal} | Phase {N} | Max: {max or "all"}`
78
+ 5. If `--headless` flag is present:
79
+ - Run: `bash .aether/aether-utils.sh autopilot-set-headless true`
80
+ - Display: `Headless mode: ON — interactive prompts will be queued as pending decisions`
81
+ 6. Display: `AUTOPILOT ENGAGED | Goal: {goal} | Phase {N} | Max: {max or "all"}`
76
82
 
77
83
  ### Step 1: Build Phase
78
84
 
@@ -103,6 +109,19 @@ On pause, display the AUTOPILOT PAUSED banner with reason, affected phase,
103
109
  specific issues, and instruction: "Fix issues, then run /ant:run to resume."
104
110
  Log: `"<timestamp>|autopilot_paused|run|Paused at Phase {id}: {reason}"`
105
111
 
112
+ **Headless override for visual checkpoints:** If headless mode is active and a
113
+ visual checkpoint prompt would normally be shown to the user, instead queue it as
114
+ a pending decision:
115
+ ```bash
116
+ bash .aether/aether-utils.sh pending-decision-add \
117
+ --title "Visual checkpoint: Phase {id}" \
118
+ --type "checkpoint" \
119
+ --description "{checkpoint_description}" \
120
+ --phase "{id}" \
121
+ --source "build-pause-check"
122
+ ```
123
+ Then continue without pausing.
124
+
106
125
  **If no pause:** proceed to Step 3.
107
126
 
108
127
  ### Step 3: Continue (Verify + Advance)
@@ -120,6 +139,18 @@ Execute continue playbooks in order, carrying cross-stage state
120
139
  Skip the AskUserQuestion prompt. Instead, auto-PAUSE with reason
121
140
  "Runtime verification required" so the user can test manually before resuming.
122
141
 
142
+ **Headless override for runtime verification:** If headless mode is active and
143
+ runtime verification would normally pause, queue as a pending decision instead:
144
+ ```bash
145
+ bash .aether/aether-utils.sh pending-decision-add \
146
+ --title "Runtime verification needed: Phase {id}" \
147
+ --type "runtime-verification" \
148
+ --description "Manual testing required before advancing past Phase {id}" \
149
+ --phase "{id}" \
150
+ --source "continue-gates"
151
+ ```
152
+ Then continue without pausing.
153
+
123
154
  ### Step 4: Continue Pause Check
124
155
 
125
156
  **PAUSE if ANY of these are true:**
@@ -189,6 +220,11 @@ Phases completed: {N} | Elapsed: {Xm Ys} | Now at: Phase {current}
189
220
  {paused} -> Fix {reason}, then /ant:run to resume
190
221
  ```
191
222
 
223
+ If headless mode was active and pending decisions were queued, display:
224
+ ```
225
+ Pending decisions: {N} — run `pending-decision-list` to review
226
+ ```
227
+
192
228
  Update session:
193
229
  `bash .aether/aether-utils.sh session-update "/ant:run" "/ant:run" "Autopilot: {N} phases, now Phase {current}"`
194
230
 
@@ -286,6 +286,8 @@ Use the `phase_bar` and `task_bar` values computed in Step 2.7 for the actual ba
286
286
 
287
287
 
288
288
 
289
+
290
+
289
291
  **Edge cases:**
290
292
  - No phases yet: show `[░░░░░░░░░░░░░░░░░░░░] 0/0 phases`
291
293
  - No tasks in phase: show `[░░░░░░░░░░░░░░░░░░░░] 0/0 tasks in Phase 0`
package/CHANGELOG.md CHANGED
@@ -574,3 +574,93 @@ The following entries are automatically generated by the colony during work phas
574
574
 
575
575
  - **Files:** `.aether/data/AUDIT-REPORT.md`
576
576
  - **Decisions:** audit-report-corrected
577
+
578
+ ### Phase 0 — Plan 00
579
+
580
+ - **Files:** `COLONY_STATE.json`, `QUEEN.md`, `learning.sh`
581
+ - **Decisions:** Colony sealed at Crowned Anthill; Comprehensive audit colony
582
+ - **What Worked:** 6 phases completed; Colony wisdom promoted to QUEEN.md
583
+
584
+ ## 2026-03-30
585
+
586
+ ### Phase 0 — Plan 00
587
+
588
+ - **Files:** `aether-utils.sh`, `utils/immune.sh`, `utils/council.sh`, `utils/midden.sh`, `utils/session.sh`, `utils/state-api.sh`
589
+ - **Decisions:** Colony sealed at Crowned Anthill; Implement next-gen Aether features: immune response, headless autopilot, vital signs, quick scout, council expansion, midden library
590
+ - **What Worked:** 6 phases completed; Colony wisdom promoted to QUEEN.md
591
+
592
+ ### Phase 1 — Plan 01
593
+
594
+ - **Files:** `.aether/utils/spawn-tree.sh`, `tests/unit/spawn-tree.test.js`
595
+ - **Decisions:** gsub order is load-bearing for JSON escaping
596
+ - **What Worked:** awk gsub escaping with correct order; TDD with 4 new tests
597
+ - **Requirements:** spawn-tree.sh, spawn-tree.test.js addressed
598
+
599
+ ### Phase 2 — Plan 01
600
+
601
+ - **Files:** `.aether/utils/queen.sh`, `tests/bash/test-queen-module.sh`
602
+ - **Decisions:** use ENVIRON[] not awk -v for user content
603
+ - **What Worked:** ENVIRON-based awk approach; head/tail for multi-line replacement; orphan cleanup
604
+ - **Requirements:** .aether/utils/queen.sh addressed
605
+
606
+ ### Phase 3 — Plan 01
607
+
608
+ - **Files:** `.aether/utils/error-handler.sh`, `.aether/utils/spawn.sh`, `.aether/aether-utils.sh`
609
+ - **Decisions:** guard central subcommand plus individual sites
610
+ - **What Worked:** AETHER_TESTING env guard
611
+ - **Requirements:** error-handler.sh, spawn.sh, aether-utils.sh addressed
612
+
613
+ ### Phase 4 — Plan 01
614
+
615
+ - **Files:** `package.json`, `package-lock.json`
616
+ - **Decisions:** npm overrides for transitive deps
617
+ - **What Worked:** minimatch; path-to-regexp; picomatch; tar; brace-expansion; diff
618
+ - **Requirements:** package.json addressed
619
+
620
+ ### Phase 5 — Plan 01
621
+
622
+ - **Decisions:** final verification sweep confirms all fixes
623
+ - **What Worked:** midden acknowledgment; full test suite verification
624
+
625
+ ### Phase 0 — Plan 00
626
+
627
+ - **Files:** `.aether/utils/spawn-tree.sh`, `.aether/utils/queen.sh`, `.aether/utils/error-handler.sh`, `.aether/utils/spawn.sh`, `.aether/aether-utils.sh`, `package.json`
628
+ - **Decisions:** Colony sealed at Crowned Anthill; Fix critical midden entries and harden infrastructure
629
+ - **What Worked:** 5 phases completed; Colony wisdom promoted to QUEEN.md
630
+
631
+ ### Phase 1 — Plan 01
632
+
633
+ - **Files:** `.aether/aether-utils.sh`
634
+ - **Decisions:** context-update now fully jq-safe
635
+ - **What Worked:** 1 remaining raw json_ok fixed
636
+ - **Requirements:** .aether/aether-utils.sh addressed
637
+
638
+ ### Phase 03 — Plan 01
639
+
640
+ - **Files:** `.aether/aether-utils.sh`
641
+ - **Decisions:** Use jq -nc --arg for all json_ok calls; parallel builder verification catches fabricated completions
642
+
643
+ ### Phase 2 — Plan 01
644
+
645
+ - **Files:** `aether-utils.sh`, `package.json`
646
+ - **Decisions:** Use jq --arg for all json_ok sites with user strings
647
+ - **What Worked:** jq --arg escaping; empty-file guard in validate-state
648
+ - **Requirements:** json_ok safe escaping addressed
649
+
650
+ ### Phase 3 — Plan 01
651
+
652
+ - **Files:** `.aether/aether-utils.sh`, `.aether/utils/flag.sh`, `tests/bash/test-flag-module.sh`, `tests/bash/test-state-checkpoint.sh`
653
+ - **Decisions:** Fixed view-state jq filter injection; Fixed fallback json_err escaping; Converted 14+ json_ok sites to jq --arg
654
+ - **What Worked:** All 509 tests pass; Auditor score 73/100; No critical security issues
655
+
656
+ ### Phase 05 — Plan 01
657
+
658
+ - **Files:** `.aether/utils/hive.sh`, `tests/bash/test-hive-read.sh`, `tests/bash/test-learning-recovery.sh`
659
+ - **Decisions:** Compose null fallback with tonumber to preserve prior type coercion fix
660
+ - **What Worked:** Archaeology pre-build scan prevented regression; Stale grep targets identified by root cause analysis
661
+
662
+ ### Phase 0 — Plan 00
663
+
664
+ - **Files:** `aether-utils.sh`, `utils/hive.sh`, `utils/learning.sh`, `tests/`
665
+ - **Decisions:** Colony sealed at Crowned Anthill; hardened ~40 json_ok sites + checkpointing + hive null safety
666
+ - **What Worked:** 5 phases completed; 9 instincts created; 4 hive-eligible