aether-colony 3.1.17 → 5.0.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.
- package/{runtime → .aether}/CONTEXT.md +1 -1
- package/{runtime → .aether}/aether-utils.sh +1772 -98
- package/.aether/docs/QUEEN-SYSTEM.md +211 -0
- package/.aether/docs/QUEEN.md +84 -0
- package/.aether/docs/README.md +68 -0
- package/.aether/docs/caste-system.md +48 -0
- package/{runtime → .aether/docs/disciplines}/DISCIPLINES.md +8 -8
- package/.aether/docs/error-codes.md +268 -0
- package/{runtime → .aether}/docs/known-issues.md +42 -26
- package/.aether/docs/queen-commands.md +97 -0
- package/.aether/exchange/colony-registry.xml +11 -0
- package/{runtime → .aether}/exchange/pheromone-xml.sh +2 -1
- package/.aether/exchange/pheromones.xml +87 -0
- package/.aether/exchange/queen-wisdom.xml +14 -0
- package/{runtime → .aether}/exchange/registry-xml.sh +7 -3
- package/{runtime → .aether}/exchange/wisdom-xml.sh +11 -4
- package/.aether/rules/aether-colony.md +134 -0
- package/.aether/schemas/example-prompt-builder.xml +234 -0
- package/.aether/templates/colony-state-reset.jq.template +22 -0
- package/.aether/templates/colony-state.template.json +35 -0
- package/.aether/templates/constraints.template.json +9 -0
- package/.aether/templates/crowned-anthill.template.md +36 -0
- package/.aether/templates/handoff-build-error.template.md +30 -0
- package/.aether/templates/handoff-build-success.template.md +39 -0
- package/.aether/templates/handoff.template.md +40 -0
- package/{runtime → .aether}/utils/atomic-write.sh +5 -5
- package/{runtime → .aether}/utils/chamber-compare.sh +23 -10
- package/{runtime → .aether}/utils/chamber-utils.sh +32 -20
- package/{runtime → .aether}/utils/error-handler.sh +13 -1
- package/{runtime → .aether}/utils/file-lock.sh +49 -13
- package/.aether/utils/semantic-cli.sh +413 -0
- package/{runtime → .aether}/utils/xml-compose.sh +7 -1
- package/.aether/utils/xml-convert.sh +273 -0
- package/.aether/utils/xml-query.sh +201 -0
- package/.aether/utils/xml-utils.sh +110 -0
- package/{runtime → .aether}/workers.md +14 -17
- package/.claude/agents/ant/aether-ambassador.md +264 -0
- package/.claude/agents/ant/aether-archaeologist.md +322 -0
- package/.claude/agents/ant/aether-auditor.md +266 -0
- package/.claude/agents/ant/aether-builder.md +187 -0
- package/.claude/agents/ant/aether-chaos.md +268 -0
- package/.claude/agents/ant/aether-chronicler.md +304 -0
- package/.claude/agents/ant/aether-gatekeeper.md +325 -0
- package/.claude/agents/ant/aether-includer.md +373 -0
- package/.claude/agents/ant/aether-keeper.md +271 -0
- package/.claude/agents/ant/aether-measurer.md +317 -0
- package/.claude/agents/ant/aether-probe.md +210 -0
- package/.claude/agents/ant/aether-queen.md +325 -0
- package/.claude/agents/ant/aether-route-setter.md +173 -0
- package/.claude/agents/ant/aether-sage.md +353 -0
- package/.claude/agents/ant/aether-scout.md +142 -0
- package/.claude/agents/ant/aether-surveyor-disciplines.md +416 -0
- package/.claude/agents/ant/aether-surveyor-nest.md +354 -0
- package/.claude/agents/ant/aether-surveyor-pathogens.md +288 -0
- package/.claude/agents/ant/aether-surveyor-provisions.md +359 -0
- package/.claude/agents/ant/aether-tracker.md +265 -0
- package/.claude/agents/ant/aether-watcher.md +244 -0
- package/.claude/agents/ant/aether-weaver.md +247 -0
- package/.claude/commands/ant/archaeology.md +16 -7
- package/.claude/commands/ant/build.md +415 -284
- package/.claude/commands/ant/chaos.md +19 -10
- package/.claude/commands/ant/colonize.md +58 -24
- package/.claude/commands/ant/continue.md +155 -145
- package/.claude/commands/ant/council.md +15 -5
- package/.claude/commands/ant/dream.md +16 -7
- package/.claude/commands/ant/entomb.md +274 -157
- package/.claude/commands/ant/feedback.md +33 -29
- package/.claude/commands/ant/flag.md +18 -10
- package/.claude/commands/ant/flags.md +14 -6
- package/.claude/commands/ant/focus.md +29 -21
- package/.claude/commands/ant/help.md +11 -1
- package/.claude/commands/ant/history.md +10 -0
- package/.claude/commands/ant/init.md +91 -65
- package/.claude/commands/ant/interpret.md +15 -4
- package/.claude/commands/ant/lay-eggs.md +55 -7
- package/.claude/commands/ant/maturity.md +11 -1
- package/.claude/commands/ant/migrate-state.md +14 -2
- package/.claude/commands/ant/oracle.md +23 -15
- package/.claude/commands/ant/organize.md +29 -20
- package/.claude/commands/ant/pause-colony.md +17 -7
- package/.claude/commands/ant/phase.md +17 -8
- package/.claude/commands/ant/plan.md +20 -9
- package/.claude/commands/ant/redirect.md +29 -32
- package/.claude/commands/ant/resume-colony.md +19 -9
- package/.claude/commands/ant/resume.md +272 -96
- package/.claude/commands/ant/seal.md +201 -191
- package/.claude/commands/ant/status.md +71 -32
- package/.claude/commands/ant/swarm.md +26 -44
- package/.claude/commands/ant/tunnels.md +279 -105
- package/.claude/commands/ant/update.md +81 -20
- package/.claude/commands/ant/verify-castes.md +14 -4
- package/.claude/commands/ant/watch.md +13 -12
- package/.opencode/agents/aether-ambassador.md +63 -20
- package/.opencode/agents/aether-archaeologist.md +29 -12
- package/.opencode/agents/aether-auditor.md +51 -18
- package/.opencode/agents/aether-builder.md +69 -19
- package/.opencode/agents/aether-chaos.md +29 -12
- package/.opencode/agents/aether-chronicler.md +60 -18
- package/.opencode/agents/aether-gatekeeper.md +27 -18
- package/.opencode/agents/aether-includer.md +27 -18
- package/.opencode/agents/aether-keeper.md +89 -18
- package/.opencode/agents/aether-measurer.md +27 -18
- package/.opencode/agents/aether-probe.md +60 -18
- package/.opencode/agents/aether-queen.md +172 -24
- package/.opencode/agents/aether-route-setter.md +57 -12
- package/.opencode/agents/aether-sage.md +26 -18
- package/.opencode/agents/aether-scout.md +27 -19
- package/.opencode/agents/aether-surveyor-disciplines.md +53 -1
- package/.opencode/agents/aether-surveyor-nest.md +53 -1
- package/.opencode/agents/aether-surveyor-pathogens.md +51 -1
- package/.opencode/agents/aether-surveyor-provisions.md +53 -1
- package/.opencode/agents/aether-tracker.md +64 -18
- package/.opencode/agents/aether-watcher.md +66 -19
- package/.opencode/agents/aether-weaver.md +61 -18
- package/.opencode/commands/ant/build.md +406 -192
- package/.opencode/commands/ant/continue.md +66 -76
- package/.opencode/commands/ant/entomb.md +106 -45
- package/.opencode/commands/ant/init.md +46 -48
- package/.opencode/commands/ant/organize.md +5 -5
- package/.opencode/commands/ant/resume.md +334 -0
- package/.opencode/commands/ant/seal.md +33 -24
- package/.opencode/commands/ant/status.md +11 -0
- package/.opencode/commands/ant/tunnels.md +149 -0
- package/.opencode/commands/ant/update.md +59 -16
- package/CHANGELOG.md +79 -0
- package/README.md +135 -353
- package/bin/cli.js +243 -122
- package/bin/generate-commands.sh +2 -2
- package/bin/lib/init.js +13 -3
- package/bin/lib/update-transaction.js +119 -117
- package/bin/sync-to-runtime.sh +5 -137
- package/bin/validate-package.sh +84 -0
- package/package.json +9 -6
- package/.opencode/agents/aether-architect.md +0 -66
- package/.opencode/agents/aether-guardian.md +0 -107
- package/.opencode/agents/workers.md +0 -1034
- package/runtime/QUEEN_ANT_ARCHITECTURE.md +0 -402
- package/runtime/data/signatures.json +0 -41
- package/runtime/docs/AETHER-2.0-IMPLEMENTATION-PLAN.md +0 -1343
- package/runtime/docs/AETHER-PHEROMONE-SYSTEM-MASTER-SPEC.md +0 -2642
- package/runtime/docs/PHEROMONE-INJECTION.md +0 -240
- package/runtime/docs/PHEROMONE-INTEGRATION.md +0 -192
- package/runtime/docs/PHEROMONE-SYSTEM-DESIGN.md +0 -426
- package/runtime/docs/README.md +0 -94
- package/runtime/docs/VISUAL-OUTPUT-SPEC.md +0 -219
- package/runtime/docs/biological-reference.md +0 -272
- package/runtime/docs/codebase-review.md +0 -399
- package/runtime/docs/command-sync.md +0 -164
- package/runtime/docs/constraints.md +0 -116
- package/runtime/docs/implementation-learnings.md +0 -89
- package/runtime/docs/namespace.md +0 -148
- package/runtime/docs/pathogen-schema-example.json +0 -36
- package/runtime/docs/pathogen-schema.md +0 -111
- package/runtime/docs/planning-discipline.md +0 -159
- package/runtime/docs/progressive-disclosure.md +0 -184
- package/runtime/lib/queen-utils.sh +0 -729
- package/runtime/planning.md +0 -159
- package/runtime/recover.sh +0 -136
- package/runtime/utils/xml-utils.sh +0 -2196
- package/runtime/workers-new-castes.md +0 -516
- /package/{runtime → .aether/docs/disciplines}/coding-standards.md +0 -0
- /package/{runtime → .aether/docs/disciplines}/debugging.md +0 -0
- /package/{runtime → .aether/docs/disciplines}/learning.md +0 -0
- /package/{runtime → .aether/docs/disciplines}/tdd.md +0 -0
- /package/{runtime → .aether/docs/disciplines}/verification-loop.md +0 -0
- /package/{runtime → .aether/docs/disciplines}/verification.md +0 -0
- /package/{runtime → .aether}/docs/pheromones.md +0 -0
- /package/{runtime → .aether}/model-profiles.yaml +0 -0
- /package/{runtime → .aether}/schemas/aether-types.xsd +0 -0
- /package/{runtime → .aether}/schemas/colony-registry.xsd +0 -0
- /package/{runtime → .aether}/schemas/pheromone.xsd +0 -0
- /package/{runtime → .aether}/schemas/prompt.xsd +0 -0
- /package/{runtime → .aether}/schemas/queen-wisdom.xsd +0 -0
- /package/{runtime → .aether}/schemas/worker-priming.xsd +0 -0
- /package/{runtime → .aether}/templates/QUEEN.md.template +0 -0
- /package/{runtime → .aether}/utils/colorize-log.sh +0 -0
- /package/{runtime → .aether}/utils/queen-to-md.xsl +0 -0
- /package/{runtime → .aether}/utils/spawn-tree.sh +0 -0
- /package/{runtime → .aether}/utils/spawn-with-model.sh +0 -0
- /package/{runtime → .aether}/utils/state-loader.sh +0 -0
- /package/{runtime → .aether}/utils/swarm-display.sh +0 -0
- /package/{runtime → .aether}/utils/watch-spawn-tree.sh +0 -0
- /package/{runtime → .aether}/utils/xml-core.sh +0 -0
|
@@ -3,7 +3,7 @@ name: ant:seal
|
|
|
3
3
|
description: "🏺🐜🏺 Seal the colony with Crowned Anthill milestone"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are the **Queen**. Seal the colony
|
|
6
|
+
You are the **Queen**. Seal the colony with a ceremony — no archiving.
|
|
7
7
|
|
|
8
8
|
## Instructions
|
|
9
9
|
|
|
@@ -11,6 +11,37 @@ Parse `$ARGUMENTS`:
|
|
|
11
11
|
- If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
|
|
12
12
|
- Otherwise: set `visual_mode = true`
|
|
13
13
|
|
|
14
|
+
<failure_modes>
|
|
15
|
+
### Crowned Anthill Write Failure
|
|
16
|
+
If writing the Crowned Anthill milestone document fails:
|
|
17
|
+
- Do not mark the colony as sealed in state
|
|
18
|
+
- Report the error -- sealing is incomplete
|
|
19
|
+
- Recovery: user can re-run /ant:seal after fixing the issue
|
|
20
|
+
|
|
21
|
+
### State Update Failure After Seal
|
|
22
|
+
If COLONY_STATE.json update fails after seal document is written:
|
|
23
|
+
- The seal document exists but state doesn't reflect it
|
|
24
|
+
- Report the inconsistency
|
|
25
|
+
- Options: (1) Retry state update only, (2) Manual state fix, (3) Re-run /ant:seal
|
|
26
|
+
</failure_modes>
|
|
27
|
+
|
|
28
|
+
<success_criteria>
|
|
29
|
+
Command is complete when:
|
|
30
|
+
- Crowned Anthill milestone document is written
|
|
31
|
+
- COLONY_STATE.json reflects sealed status
|
|
32
|
+
- All phase evidence is summarized in the seal document
|
|
33
|
+
- User sees confirmation of successful seal
|
|
34
|
+
</success_criteria>
|
|
35
|
+
|
|
36
|
+
<read_only>
|
|
37
|
+
Do not touch during seal:
|
|
38
|
+
- .aether/dreams/ (user notes)
|
|
39
|
+
- .aether/chambers/ (archived colonies -- seal does NOT archive)
|
|
40
|
+
- Source code files
|
|
41
|
+
- .env* files
|
|
42
|
+
- .claude/settings.json
|
|
43
|
+
</read_only>
|
|
44
|
+
|
|
14
45
|
### Step 0: Initialize Visual Mode (if enabled)
|
|
15
46
|
|
|
16
47
|
If `visual_mode` is true:
|
|
@@ -18,9 +49,8 @@ If `visual_mode` is true:
|
|
|
18
49
|
# Generate session ID
|
|
19
50
|
seal_id="seal-$(date +%s)"
|
|
20
51
|
|
|
21
|
-
# Initialize swarm display
|
|
22
|
-
bash .aether/aether-utils.sh swarm-display-init "$seal_id"
|
|
23
|
-
bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "excavating" "Sealing colony" "Colony" '{"read":0,"grep":0,"edit":0,"bash":0}' 0 "fungus_garden" 0
|
|
52
|
+
# Initialize swarm display (consolidated)
|
|
53
|
+
bash .aether/aether-utils.sh swarm-display-init "$seal_id" && bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "excavating" "Sealing colony" "Colony" '{"read":0,"grep":0,"edit":0,"bash":0}' 0 "fungus_garden" 0
|
|
24
54
|
```
|
|
25
55
|
|
|
26
56
|
### Step 1: Read State
|
|
@@ -33,102 +63,64 @@ No colony initialized. Run /ant:init first.
|
|
|
33
63
|
```
|
|
34
64
|
Stop here.
|
|
35
65
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Capture session start time:
|
|
39
|
-
```bash
|
|
40
|
-
SEAL_START=$(date +%s)
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Check for existing seal operations (in-progress archives):
|
|
44
|
-
```bash
|
|
45
|
-
# Check for incomplete archive directories (no manifest.json)
|
|
46
|
-
incomplete_archives=$(find .aether/data/archive -type d -name "session_*_archive" 2>/dev/null | while read dir; do
|
|
47
|
-
if [[ ! -f "$dir/manifest.json" ]]; then
|
|
48
|
-
echo "$dir"
|
|
49
|
-
fi
|
|
50
|
-
done)
|
|
51
|
-
|
|
52
|
-
if [[ -n "$incomplete_archives" ]]; then
|
|
53
|
-
echo "Warning: Incomplete archive operations detected:"
|
|
54
|
-
echo "$incomplete_archives"
|
|
55
|
-
echo ""
|
|
56
|
-
echo "These may be from interrupted seal operations."
|
|
57
|
-
echo "Proceeding will create a new archive."
|
|
58
|
-
fi
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Step 2: Validate Colony Is Complete
|
|
66
|
+
Extract: `goal`, `state`, `current_phase`, `plan.phases`, `milestone`, `version`, `initialized_at`.
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
### Step 2: Maturity Gate
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
Run `bash .aether/aether-utils.sh milestone-detect` to get `milestone`, `phases_completed`, `total_phases`.
|
|
66
71
|
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
all_completed = all(phase.status == "completed" for phase in plan.phases)
|
|
72
|
+
**If milestone is already "Crowned Anthill":**
|
|
70
73
|
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
Cannot archive colony with incomplete phases.
|
|
75
|
-
|
|
76
|
-
Completed phases: X of Y
|
|
77
|
-
Remaining: {list of incomplete phase names}
|
|
78
|
-
|
|
79
|
-
Run /ant:continue to complete remaining phases first.
|
|
74
|
+
Colony already sealed at Crowned Anthill.
|
|
75
|
+
Run /ant:entomb to archive this colony to chambers.
|
|
80
76
|
```
|
|
81
77
|
Stop here.
|
|
82
78
|
|
|
83
|
-
**
|
|
84
|
-
|
|
85
|
-
If `state == "EXECUTING"`:
|
|
79
|
+
**If state is "EXECUTING":**
|
|
86
80
|
```
|
|
87
|
-
Colony is still executing. Run /ant:continue
|
|
81
|
+
Colony is still executing. Run /ant:continue first.
|
|
88
82
|
```
|
|
89
83
|
Stop here.
|
|
90
84
|
|
|
91
|
-
|
|
85
|
+
**If all phases complete** (phases_completed == total_phases, or milestone is "Sealed Chambers"):
|
|
86
|
+
- Set `incomplete_warning = ""` (no warning needed)
|
|
87
|
+
- Proceed to Step 3.
|
|
92
88
|
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
- **Brood Stable** — Tests consistently green
|
|
97
|
-
- **Ventilated Nest** — Perf/latency acceptable (build + lint clean)
|
|
98
|
-
- **Sealed Chambers** — All phases complete (interfaces frozen)
|
|
99
|
-
- **Crowned Anthill** — Release-ready (user confirms via /ant:seal)
|
|
89
|
+
**If phases are incomplete** (any other milestone — First Mound, Open Chambers, Brood Stable, Ventilated Nest, etc.):
|
|
90
|
+
- Set `incomplete_warning = "WARNING: {phases_completed} of {total_phases} phases complete. Sealing now will mark incomplete work as the final state."`
|
|
91
|
+
- Proceed to Step 3 (warn but DO NOT block).
|
|
100
92
|
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
Colony is already at Crowned Anthill milestone.
|
|
104
|
-
No further archiving needed.
|
|
93
|
+
### Step 3: Confirmation
|
|
105
94
|
|
|
106
|
-
|
|
95
|
+
Display what will be sealed:
|
|
107
96
|
```
|
|
108
|
-
|
|
97
|
+
SEAL COLONY
|
|
109
98
|
|
|
110
|
-
|
|
111
|
-
|
|
99
|
+
Goal: {goal}
|
|
100
|
+
Phases: {phases_completed} of {total_phases} completed
|
|
101
|
+
Current Milestone: {milestone}
|
|
112
102
|
|
|
113
|
-
|
|
114
|
-
- Since all phases are complete, the colony qualifies for both Sealed Chambers and Crowned Anthill
|
|
115
|
-
- The current logic allows proceeding to Step 4 (seal as Crowned Anthill)
|
|
116
|
-
- If user wants to explicitly achieve Sealed Chambers first, they can manually update milestone via COLONY_STATE.json
|
|
103
|
+
{If incomplete_warning is not empty, display it here}
|
|
117
104
|
|
|
118
|
-
|
|
105
|
+
This will:
|
|
106
|
+
- Award the Crowned Anthill milestone
|
|
107
|
+
- Write CROWNED-ANTHILL.md ceremony record
|
|
108
|
+
- Promote colony wisdom to QUEEN.md
|
|
109
|
+
|
|
110
|
+
Seal this colony? (yes/no)
|
|
119
111
|
```
|
|
120
|
-
Unknown milestone: {milestone}
|
|
121
112
|
|
|
122
|
-
|
|
123
|
-
Known milestones: First Mound, Open Chambers, Brood Stable, Ventilated Nest, Sealed Chambers, Crowned Anthill
|
|
113
|
+
Use `AskUserQuestion with yes/no options`.
|
|
124
114
|
|
|
125
|
-
|
|
115
|
+
If not "yes":
|
|
116
|
+
```
|
|
117
|
+
Sealing cancelled. Colony remains active.
|
|
126
118
|
```
|
|
127
119
|
Stop here.
|
|
128
120
|
|
|
129
121
|
### Step 4: Promote Colony Wisdom to QUEEN.md
|
|
130
122
|
|
|
131
|
-
|
|
123
|
+
Extract and promote significant patterns, decisions, and instincts from the colony:
|
|
132
124
|
|
|
133
125
|
```bash
|
|
134
126
|
# Ensure QUEEN.md exists
|
|
@@ -144,7 +136,7 @@ colony_name=$(jq -r '.session_id // empty' .aether/data/COLONY_STATE.json | sed
|
|
|
144
136
|
promotions_made=0
|
|
145
137
|
promotion_details=""
|
|
146
138
|
|
|
147
|
-
# Extract and promote phase learnings (validated learnings
|
|
139
|
+
# Extract and promote phase learnings (validated learnings)
|
|
148
140
|
while IFS= read -r learning; do
|
|
149
141
|
claim=$(echo "$learning" | jq -r '.claim // empty')
|
|
150
142
|
status=$(echo "$learning" | jq -r '.status // empty')
|
|
@@ -183,154 +175,172 @@ while IFS= read -r decision; do
|
|
|
183
175
|
fi
|
|
184
176
|
done < <(jq -c '.memory.decisions[]? // empty' .aether/data/COLONY_STATE.json 2>/dev/null)
|
|
185
177
|
|
|
178
|
+
# Promote high-confidence instincts
|
|
179
|
+
instinct_result=$(bash .aether/aether-utils.sh instinct-read --min-confidence 0.7 2>/dev/null || echo '{"ok":false}')
|
|
180
|
+
if echo "$instinct_result" | jq -e '.ok' >/dev/null 2>&1; then
|
|
181
|
+
while IFS= read -r instinct_action; do
|
|
182
|
+
if [[ -n "$instinct_action" && "$instinct_action" != "null" ]]; then
|
|
183
|
+
result=$(bash .aether/aether-utils.sh queen-promote "pattern" "$instinct_action" "$colony_name" 2>/dev/null)
|
|
184
|
+
if echo "$result" | jq -e '.ok' >/dev/null 2>&1; then
|
|
185
|
+
promotions_made=$((promotions_made + 1))
|
|
186
|
+
fi
|
|
187
|
+
fi
|
|
188
|
+
done < <(echo "$instinct_result" | jq -r '.result[]?.action // empty' 2>/dev/null)
|
|
189
|
+
fi
|
|
190
|
+
|
|
186
191
|
# Log promotion results to activity log
|
|
187
|
-
bash .aether/aether-utils.sh activity-log "MODIFIED" "Queen" "Promoted ${promotions_made} learnings/decisions to QUEEN.md from colony ${colony_name}"
|
|
192
|
+
bash .aether/aether-utils.sh activity-log "MODIFIED" "Queen" "Promoted ${promotions_made} learnings/decisions/instincts to QUEEN.md from colony ${colony_name}"
|
|
188
193
|
|
|
189
194
|
# Store promotion summary for display
|
|
190
195
|
promotion_summary="${promotions_made} wisdom entries promoted"
|
|
191
196
|
```
|
|
192
197
|
|
|
193
|
-
### Step 5:
|
|
198
|
+
### Step 5: Update Milestone to Crowned Anthill
|
|
194
199
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
```
|
|
200
|
+
Update COLONY_STATE.json:
|
|
201
|
+
1. Set `milestone` to `"Crowned Anthill"`
|
|
202
|
+
2. Set `milestone_updated_at` to current ISO-8601 timestamp
|
|
203
|
+
3. Append event: `"<timestamp>|milestone_reached|seal|Achieved Crowned Anthill milestone"`
|
|
200
204
|
|
|
201
|
-
|
|
202
|
-
1. `.aether/data/COLONY_STATE.json` → `$archive_dir/COLONY_STATE.json`
|
|
203
|
-
2. `.aether/data/activity.log` → `$archive_dir/activity.log`
|
|
204
|
-
3. `.aether/data/spawn-tree.txt` → `$archive_dir/spawn-tree.txt`
|
|
205
|
-
4. `.aether/data/flags.json` → `$archive_dir/flags.json` (if exists)
|
|
206
|
-
5. `.aether/data/constraints.json` → `$archive_dir/constraints.json` (if exists)
|
|
207
|
-
|
|
208
|
-
Create archive manifest file `$archive_dir/manifest.json`:
|
|
209
|
-
```json
|
|
210
|
-
{
|
|
211
|
-
"archived_at": "<ISO-8601 timestamp>",
|
|
212
|
-
"goal": "<colony goal>",
|
|
213
|
-
"total_phases": <number>,
|
|
214
|
-
"milestone": "Crowned Anthill",
|
|
215
|
-
"files": [
|
|
216
|
-
"COLONY_STATE.json",
|
|
217
|
-
"activity.log",
|
|
218
|
-
"spawn-tree.txt",
|
|
219
|
-
"flags.json",
|
|
220
|
-
"constraints.json"
|
|
221
|
-
]
|
|
222
|
-
}
|
|
223
|
-
```
|
|
205
|
+
Run `bash .aether/aether-utils.sh validate-state colony` after write.
|
|
224
206
|
|
|
225
|
-
|
|
207
|
+
### Step 6: Write CROWNED-ANTHILL.md
|
|
226
208
|
|
|
227
|
-
|
|
209
|
+
Calculate colony age:
|
|
228
210
|
```bash
|
|
229
|
-
|
|
230
|
-
|
|
211
|
+
initialized_at=$(jq -r '.initialized_at // empty' .aether/data/COLONY_STATE.json)
|
|
212
|
+
if [[ -n "$initialized_at" ]]; then
|
|
213
|
+
init_epoch=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$initialized_at" +%s 2>/dev/null || echo 0)
|
|
214
|
+
now_epoch=$(date +%s)
|
|
215
|
+
if [[ "$init_epoch" -gt 0 ]]; then
|
|
216
|
+
colony_age_days=$(( (now_epoch - init_epoch) / 86400 ))
|
|
217
|
+
else
|
|
218
|
+
colony_age_days=0
|
|
219
|
+
fi
|
|
231
220
|
else
|
|
232
|
-
|
|
233
|
-
# Don't proceed with milestone update
|
|
234
|
-
exit 1
|
|
221
|
+
colony_age_days=0
|
|
235
222
|
fi
|
|
236
223
|
```
|
|
237
224
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
Update COLONY_STATE.json:
|
|
241
|
-
1. Set `milestone` to `"Crowned Anthill"`
|
|
242
|
-
2. Set `milestone_updated_at` to current ISO-8601 timestamp
|
|
243
|
-
3. Append event: `"<timestamp>|milestone_reached|archive|Achieved Crowned Anthill milestone - colony archived"`
|
|
244
|
-
|
|
245
|
-
### Step 7: Write Final Handoff
|
|
246
|
-
|
|
247
|
-
After archiving and promoting wisdom, write the final handoff documenting the completed colony:
|
|
248
|
-
|
|
225
|
+
Extract phase recap:
|
|
249
226
|
```bash
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
## Archive Location
|
|
257
|
-
{archive_dir}
|
|
258
|
-
|
|
259
|
-
## Colony Summary
|
|
260
|
-
- Goal: "{goal}"
|
|
261
|
-
- Total Phases: {total_phases}
|
|
262
|
-
- Milestone: Crowned Anthill
|
|
263
|
-
- Sealed At: {timestamp}
|
|
264
|
-
- Wisdom Promoted: {promotion_summary}
|
|
265
|
-
|
|
266
|
-
## Files Archived
|
|
267
|
-
- COLONY_STATE.json
|
|
268
|
-
- activity.log
|
|
269
|
-
- spawn-tree.txt
|
|
270
|
-
- flags.json (if existed)
|
|
271
|
-
- constraints.json (if existed)
|
|
272
|
-
|
|
273
|
-
## Session Note
|
|
274
|
-
This colony has been sealed and archived. The anthill stands crowned.
|
|
275
|
-
To start anew, run: /ant:lay-eggs "<new goal>"
|
|
276
|
-
HANDOFF_EOF
|
|
227
|
+
phase_recap=""
|
|
228
|
+
while IFS= read -r phase_line; do
|
|
229
|
+
phase_name=$(echo "$phase_line" | jq -r '.name')
|
|
230
|
+
phase_status=$(echo "$phase_line" | jq -r '.status')
|
|
231
|
+
phase_recap="${phase_recap} - ${phase_name}: ${phase_status}\n"
|
|
232
|
+
done < <(jq -c '.plan.phases[]' .aether/data/COLONY_STATE.json 2>/dev/null)
|
|
277
233
|
```
|
|
278
234
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
### Step 8: Display Result
|
|
282
|
-
|
|
283
|
-
**If visual_mode is true, render final swarm display:**
|
|
235
|
+
Write the seal document:
|
|
284
236
|
```bash
|
|
285
|
-
|
|
286
|
-
|
|
237
|
+
version=$(jq -r '.version // "3.0"' .aether/data/COLONY_STATE.json)
|
|
238
|
+
seal_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
287
239
|
```
|
|
288
240
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
241
|
+
Resolve the crowned-anthill template path:
|
|
242
|
+
Check ~/.aether/system/templates/crowned-anthill.template.md first,
|
|
243
|
+
then .aether/templates/crowned-anthill.template.md.
|
|
244
|
+
|
|
245
|
+
If no template found: output "Template missing: crowned-anthill.template.md. Run aether update to fix." and stop.
|
|
294
246
|
|
|
295
|
-
|
|
247
|
+
Read the template file. Fill all {{PLACEHOLDER}} values:
|
|
248
|
+
- {{GOAL}} → goal (from colony state)
|
|
249
|
+
- {{SEAL_DATE}} → seal_date (ISO-8601 UTC timestamp)
|
|
250
|
+
- {{VERSION}} → version (from colony state)
|
|
251
|
+
- {{TOTAL_PHASES}} → total_phases
|
|
252
|
+
- {{PHASES_COMPLETED}} → phases_completed
|
|
253
|
+
- {{COLONY_AGE_DAYS}} → colony_age_days
|
|
254
|
+
- {{PROMOTIONS_MADE}} → promotions_made
|
|
255
|
+
- {{PHASE_RECAP}} → phase recap list (one entry per line, formatted from the bash loop above)
|
|
296
256
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
🏆 Milestone: Crowned Anthill
|
|
300
|
-
📚 Wisdom Promoted: {promotion_summary}
|
|
257
|
+
Remove the HTML comment lines at the top of the template (lines starting with <!--).
|
|
258
|
+
Write the result to .aether/CROWNED-ANTHILL.md using the Write tool.
|
|
301
259
|
|
|
302
|
-
|
|
303
|
-
- COLONY_STATE.json
|
|
304
|
-
- activity.log
|
|
305
|
-
- spawn-tree.txt
|
|
306
|
-
- flags.json (if existed)
|
|
307
|
-
- constraints.json (if existed)
|
|
260
|
+
### Step 6.5: Export XML Archive (best-effort)
|
|
308
261
|
|
|
309
|
-
|
|
310
|
-
The anthill stands crowned and sealed.
|
|
311
|
-
History is preserved. The colony rests.
|
|
262
|
+
Export colony data as a combined XML archive. This is best-effort — seal proceeds even if XML export fails.
|
|
312
263
|
|
|
313
|
-
|
|
264
|
+
```bash
|
|
265
|
+
# Check if xmllint is available
|
|
266
|
+
if command -v xmllint >/dev/null 2>&1; then
|
|
267
|
+
xml_result=$(bash .aether/aether-utils.sh colony-archive-xml ".aether/exchange/colony-archive.xml" 2>&1)
|
|
268
|
+
xml_ok=$(echo "$xml_result" | jq -r '.ok // false' 2>/dev/null)
|
|
269
|
+
if [[ "$xml_ok" == "true" ]]; then
|
|
270
|
+
xml_pheromone_count=$(echo "$xml_result" | jq -r '.result.pheromone_count // 0' 2>/dev/null)
|
|
271
|
+
xml_export_line="XML Archive: colony-archive.xml (${xml_pheromone_count} active signals)"
|
|
272
|
+
else
|
|
273
|
+
xml_export_line="XML Archive: export failed (non-blocking)"
|
|
274
|
+
fi
|
|
275
|
+
else
|
|
276
|
+
xml_export_line="XML Archive: skipped (xmllint not available)"
|
|
277
|
+
fi
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Step 7: Display Ceremony
|
|
314
281
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
282
|
+
**If visual_mode is true, render swarm display BEFORE the ASCII art (consolidated):**
|
|
283
|
+
```bash
|
|
284
|
+
bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "completed" "Colony sealed" "Colony" '{"read":3,"grep":0,"edit":2,"bash":3}' 100 "fungus_garden" 100 && bash .aether/aether-utils.sh swarm-display-inline "$seal_id"
|
|
285
|
+
```
|
|
319
286
|
|
|
320
|
-
|
|
287
|
+
Display the ASCII art ceremony:
|
|
288
|
+
```
|
|
289
|
+
. .
|
|
290
|
+
/|\ /|\
|
|
291
|
+
/ | \ / | \
|
|
292
|
+
/ | X | \
|
|
293
|
+
/ | / \ | \
|
|
294
|
+
/ |/ \| \
|
|
295
|
+
/ / \ \
|
|
296
|
+
/____ / ___ \ ____\
|
|
297
|
+
/ / \ \
|
|
298
|
+
/ / \ \
|
|
299
|
+
/_/ \_\
|
|
300
|
+
| CROWNED |
|
|
301
|
+
| ANTHILL |
|
|
302
|
+
|__________|
|
|
303
|
+
```
|
|
321
304
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
305
|
+
Below the ASCII art, display:
|
|
306
|
+
```
|
|
307
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
308
|
+
C R O W N E D A N T H I L L
|
|
309
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
310
|
+
|
|
311
|
+
Goal: {goal}
|
|
312
|
+
Phases: {phases_completed} of {total_phases} completed
|
|
313
|
+
{If incomplete_warning is not empty: display it}
|
|
314
|
+
Wisdom Promoted: {promotion_summary}
|
|
315
|
+
|
|
316
|
+
Seal Document: .aether/CROWNED-ANTHILL.md
|
|
317
|
+
{xml_export_line}
|
|
318
|
+
|
|
319
|
+
The colony stands crowned and sealed.
|
|
320
|
+
Its wisdom lives on in QUEEN.md.
|
|
321
|
+
The anthill has reached its final form.
|
|
322
|
+
|
|
323
|
+
──────────────────────────────────────────────────
|
|
324
|
+
🐜 Next Up
|
|
325
|
+
──────────────────────────────────────────────────
|
|
326
|
+
/ant:entomb 🏺 Archive colony to chambers
|
|
327
|
+
/ant:lay-eggs 🥚 Start a new colony
|
|
328
|
+
/ant:tunnels 🗄️ Browse archived chambers
|
|
325
329
|
```
|
|
326
330
|
|
|
327
331
|
### Edge Cases
|
|
328
332
|
|
|
329
|
-
**
|
|
330
|
-
-
|
|
333
|
+
**Colony already at Crowned Anthill:**
|
|
334
|
+
- Display message and guide to /ant:entomb. Do NOT re-seal.
|
|
335
|
+
|
|
336
|
+
**Phases incomplete:**
|
|
337
|
+
- Warn but allow. The seal proceeds after confirmation.
|
|
338
|
+
|
|
339
|
+
**Missing QUEEN.md:**
|
|
340
|
+
- queen-init creates it. If that fails, skip promotion (non-fatal).
|
|
331
341
|
|
|
332
|
-
**
|
|
333
|
-
-
|
|
342
|
+
**Missing initialized_at:**
|
|
343
|
+
- Colony age defaults to 0 days.
|
|
334
344
|
|
|
335
|
-
**
|
|
336
|
-
-
|
|
345
|
+
**Empty phases array:**
|
|
346
|
+
- Can seal a colony with 0 phases (rare but valid). phases_completed = 0, total_phases = 0.
|