aether-colony 3.1.5 → 3.1.16

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 (133) hide show
  1. package/.claude/commands/ant/archaeology.md +12 -0
  2. package/.claude/commands/ant/build.md +382 -319
  3. package/.claude/commands/ant/chaos.md +23 -1
  4. package/.claude/commands/ant/colonize.md +147 -87
  5. package/.claude/commands/ant/continue.md +213 -23
  6. package/.claude/commands/ant/council.md +22 -0
  7. package/.claude/commands/ant/dream.md +18 -0
  8. package/.claude/commands/ant/entomb.md +178 -6
  9. package/.claude/commands/ant/init.md +87 -13
  10. package/.claude/commands/ant/lay-eggs.md +45 -5
  11. package/.claude/commands/ant/oracle.md +82 -9
  12. package/.claude/commands/ant/organize.md +2 -2
  13. package/.claude/commands/ant/pause-colony.md +86 -28
  14. package/.claude/commands/ant/phase.md +26 -0
  15. package/.claude/commands/ant/plan.md +204 -111
  16. package/.claude/commands/ant/resume-colony.md +23 -1
  17. package/.claude/commands/ant/resume.md +159 -0
  18. package/.claude/commands/ant/seal.md +177 -3
  19. package/.claude/commands/ant/swarm.md +78 -97
  20. package/.claude/commands/ant/verify-castes.md +7 -7
  21. package/.claude/commands/ant/watch.md +17 -0
  22. package/.opencode/agents/aether-ambassador.md +97 -0
  23. package/.opencode/agents/aether-archaeologist.md +91 -0
  24. package/.opencode/agents/aether-architect.md +66 -0
  25. package/.opencode/agents/aether-auditor.md +111 -0
  26. package/.opencode/agents/aether-builder.md +28 -10
  27. package/.opencode/agents/aether-chaos.md +98 -0
  28. package/.opencode/agents/aether-chronicler.md +80 -0
  29. package/.opencode/agents/aether-gatekeeper.md +107 -0
  30. package/.opencode/agents/aether-guardian.md +107 -0
  31. package/.opencode/agents/aether-includer.md +108 -0
  32. package/.opencode/agents/aether-keeper.md +106 -0
  33. package/.opencode/agents/aether-measurer.md +119 -0
  34. package/.opencode/agents/aether-probe.md +91 -0
  35. package/.opencode/agents/aether-queen.md +72 -19
  36. package/.opencode/agents/aether-route-setter.md +85 -0
  37. package/.opencode/agents/aether-sage.md +98 -0
  38. package/.opencode/agents/aether-scout.md +33 -15
  39. package/.opencode/agents/aether-surveyor-disciplines.md +334 -0
  40. package/.opencode/agents/aether-surveyor-nest.md +272 -0
  41. package/.opencode/agents/aether-surveyor-pathogens.md +209 -0
  42. package/.opencode/agents/aether-surveyor-provisions.md +277 -0
  43. package/.opencode/agents/aether-tracker.md +91 -0
  44. package/.opencode/agents/aether-watcher.md +30 -12
  45. package/.opencode/agents/aether-weaver.md +87 -0
  46. package/.opencode/agents/workers.md +1034 -0
  47. package/.opencode/commands/ant/archaeology.md +44 -26
  48. package/.opencode/commands/ant/build.md +326 -294
  49. package/.opencode/commands/ant/chaos.md +32 -4
  50. package/.opencode/commands/ant/colonize.md +119 -93
  51. package/.opencode/commands/ant/continue.md +98 -10
  52. package/.opencode/commands/ant/council.md +28 -0
  53. package/.opencode/commands/ant/dream.md +24 -0
  54. package/.opencode/commands/ant/entomb.md +73 -1
  55. package/.opencode/commands/ant/feedback.md +8 -2
  56. package/.opencode/commands/ant/flag.md +9 -3
  57. package/.opencode/commands/ant/flags.md +8 -2
  58. package/.opencode/commands/ant/focus.md +8 -2
  59. package/.opencode/commands/ant/help.md +12 -0
  60. package/.opencode/commands/ant/init.md +49 -4
  61. package/.opencode/commands/ant/lay-eggs.md +30 -2
  62. package/.opencode/commands/ant/oracle.md +39 -7
  63. package/.opencode/commands/ant/organize.md +8 -2
  64. package/.opencode/commands/ant/pause-colony.md +54 -1
  65. package/.opencode/commands/ant/phase.md +36 -4
  66. package/.opencode/commands/ant/plan.md +224 -116
  67. package/.opencode/commands/ant/redirect.md +8 -2
  68. package/.opencode/commands/ant/resume-colony.md +51 -26
  69. package/.opencode/commands/ant/seal.md +76 -0
  70. package/.opencode/commands/ant/status.md +50 -20
  71. package/.opencode/commands/ant/swarm.md +108 -104
  72. package/.opencode/commands/ant/tunnels.md +107 -2
  73. package/CHANGELOG.md +16 -0
  74. package/README.md +199 -86
  75. package/bin/cli.js +142 -25
  76. package/bin/generate-commands.sh +100 -16
  77. package/bin/lib/caste-colors.js +5 -5
  78. package/bin/lib/errors.js +16 -0
  79. package/bin/lib/file-lock.js +279 -44
  80. package/bin/lib/state-sync.js +206 -23
  81. package/bin/lib/update-transaction.js +206 -24
  82. package/bin/sync-to-runtime.sh +138 -0
  83. package/package.json +2 -2
  84. package/runtime/CONTEXT.md +160 -0
  85. package/runtime/aether-utils.sh +1421 -55
  86. package/runtime/docs/AETHER-2.0-IMPLEMENTATION-PLAN.md +1343 -0
  87. package/runtime/docs/AETHER-PHEROMONE-SYSTEM-MASTER-SPEC.md +2642 -0
  88. package/runtime/docs/PHEROMONE-INJECTION.md +240 -0
  89. package/runtime/docs/PHEROMONE-INTEGRATION.md +192 -0
  90. package/runtime/docs/PHEROMONE-SYSTEM-DESIGN.md +426 -0
  91. package/runtime/docs/README.md +94 -0
  92. package/runtime/docs/VISUAL-OUTPUT-SPEC.md +219 -0
  93. package/runtime/docs/biological-reference.md +272 -0
  94. package/runtime/docs/codebase-review.md +399 -0
  95. package/runtime/docs/command-sync.md +164 -0
  96. package/runtime/docs/implementation-learnings.md +89 -0
  97. package/runtime/docs/known-issues.md +217 -0
  98. package/runtime/docs/namespace.md +148 -0
  99. package/runtime/docs/planning-discipline.md +159 -0
  100. package/runtime/exchange/pheromone-xml.sh +574 -0
  101. package/runtime/exchange/registry-xml.sh +269 -0
  102. package/runtime/exchange/wisdom-xml.sh +312 -0
  103. package/runtime/lib/queen-utils.sh +729 -0
  104. package/runtime/model-profiles.yaml +100 -0
  105. package/runtime/recover.sh +136 -0
  106. package/runtime/schemas/aether-types.xsd +255 -0
  107. package/runtime/schemas/colony-registry.xsd +309 -0
  108. package/runtime/schemas/pheromone.xsd +163 -0
  109. package/runtime/schemas/prompt.xsd +416 -0
  110. package/runtime/schemas/queen-wisdom.xsd +325 -0
  111. package/runtime/schemas/worker-priming.xsd +276 -0
  112. package/runtime/templates/QUEEN.md.template +79 -0
  113. package/runtime/utils/atomic-write.sh +5 -5
  114. package/runtime/utils/chamber-utils.sh +6 -3
  115. package/runtime/utils/error-handler.sh +200 -0
  116. package/runtime/utils/queen-to-md.xsl +395 -0
  117. package/runtime/utils/spawn-tree.sh +428 -0
  118. package/runtime/utils/spawn-with-model.sh +56 -0
  119. package/runtime/utils/state-loader.sh +215 -0
  120. package/runtime/utils/swarm-display.sh +5 -5
  121. package/runtime/utils/watch-spawn-tree.sh +90 -22
  122. package/runtime/utils/xml-compose.sh +247 -0
  123. package/runtime/utils/xml-core.sh +186 -0
  124. package/runtime/utils/xml-utils.sh +2196 -0
  125. package/runtime/verification-loop.md +1 -1
  126. package/runtime/workers-new-castes.md +516 -0
  127. package/runtime/workers.md +18 -6
  128. package/.aether/visualizations/anthill-stages/brood-stable.txt +0 -26
  129. package/.aether/visualizations/anthill-stages/crowned-anthill.txt +0 -30
  130. package/.aether/visualizations/anthill-stages/first-mound.txt +0 -18
  131. package/.aether/visualizations/anthill-stages/open-chambers.txt +0 -24
  132. package/.aether/visualizations/anthill-stages/sealed-chambers.txt +0 -28
  133. package/.aether/visualizations/anthill-stages/ventilated-nest.txt +0 -27
package/CHANGELOG.md CHANGED
@@ -41,6 +41,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
41
41
 
42
42
  ## [Unreleased]
43
43
 
44
+ ### Added
45
+ - **Session Freshness Detection System** — Global system to prevent stale session files from silently breaking Aether workflows. Implements `session-verify-fresh` and `session-clear` commands with support for 7 commands (survey, oracle, watch, swarm, init, seal, entomb). Features cross-platform timestamp detection (macOS/Linux), environment variable overrides for testing, and protected operations (init/seal/entomb never auto-clear). Backward compatibility maintained with `survey-verify-fresh` and `survey-clear` wrappers. Added comprehensive test suite (`tests/bash/test-session-freshness.sh`) and API documentation (`docs/session-freshness-api.md`). (`.aether/aether-utils.sh`, `tests/bash/test-session-freshness.sh`, `docs/session-freshness-api.md`)
46
+ - `/ant:colonize` — Added `--force-resurvey` flag, stale survey detection, and verification
47
+ - `/ant:oracle` — Added `--force` flag, stale session detection with user options
48
+ - `/ant:watch` — Added session timestamp capture and stale file handling
49
+ - `/ant:swarm` — Added auto-clear for stale findings with verification
50
+ - `/ant:init` — Added freshness check with protected state (no auto-clear)
51
+ - `/ant:seal` — Added incomplete archive detection and integrity verification
52
+ - `/ant:entomb` — Added incomplete chamber detection and integrity verification
53
+
54
+ ### Fixed
55
+ - **Architecture Cleanup: Source of Truth Flipped** — Complete review and cleanup of the flipped source-of-truth architecture. `.aether/` is now the source of truth for system files, with `runtime/` auto-populated by `bin/sync-to-runtime.sh` during npm install. Fixed 6 stale documentation files, updated 5 planning files, expanded allowlist from 20 to 36 files, handled 4 orphan files, and verified zero drift between directories. (`.aether/recover.sh`, `.aether/RECOVERY-PLAN.md`, `.planning/codebase/STRUCTURE.md`, `.planning/codebase/ARCHITECTURE.md`, `.planning/codebase/CONVENTIONS.md`, `TO-DOS.md`, `bin/sync-to-runtime.sh`, `bin/lib/update-transaction.js`)
56
+
57
+ ### Changed
58
+ - **Phase 4: UX Improvements to Lay-Eggs** — Enhanced lay-eggs.md with visual lifecycle diagrams (🟢 ACTIVE COLONY → 🏺 SEAL/ENTOMB → 🥚 LAY EGGS) in error messages to clarify workflow progression. Updated success output to explicitly distinguish between sealing vs laying eggs for new projects, preserving wisdom across colony lifecycles. (`.claude/commands/ant/lay-eggs.md`)
59
+
44
60
  ### Fixed
45
61
  - **Phase 2: Fix Blocker Severity and Auto-Resolve Logic** — Made auto_resolve_on conditional by flag source: chaos-sourced blockers require manual resolution (auto_resolve_on: null), verification blockers auto-resolve on build pass. Reordered continue.md Flags Gate to run auto-resolve before blocker count check. Added advisory blocker warning (Step 1.5) to build.md so builders see active blockers before execution. (`.aether/aether-utils.sh`, `runtime/aether-utils.sh`, `.claude/commands/ant/continue.md`, `.opencode/commands/ant/continue.md`, `.claude/commands/ant/build.md`, `.opencode/commands/ant/build.md`)
46
62
  - **Phase 1: Fix Chaos Ant Duplicate Flagging** — Eliminated duplicate flag creation during build-rebuild cycles by removing redundant chaos flagging from build.md Step 5.5 (Step 5.4.2 already handles it), injected existing flag titles into Chaos Ant spawn prompt to prevent re-investigating known issues, and added flag persistence to standalone /ant:chaos for critical/high findings using source 'chaos-standalone'. (`.claude/commands/ant/build.md`, `.opencode/commands/ant/build.md`, `.claude/commands/ant/chaos.md`, `.opencode/commands/ant/chaos.md`)
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
  [![npm version](https://img.shields.io/npm/v/aether-colony.svg)](https://www.npmjs.com/package/aether-colony)
19
19
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
20
20
 
21
- **v1.1.0** — Production ready with model routing
21
+ **v3.1.14** — Production ready with model routing
22
22
  </div>
23
23
 
24
24
  ---
@@ -43,9 +43,9 @@ Aether brings **ant colony intelligence** to Claude Code. Instead of one agent d
43
43
  ├── 🔍 Scouts — research docs
44
44
  ├── 🗺️ Colonizers — explore codebases
45
45
  ├── 📋 Route-setters — plan phases
46
- ├── 🏛️ Architects — extract patterns
46
+ ├── 🏗️ Architects — extract patterns
47
47
  ├── 🏺 Archaeologists — excavate git history
48
- ├── 🔮 Oracles — deep research
48
+ ├── 🔮 Oracles — deep research (RALF pattern)
49
49
  └── 🎲 Chaos Ants — resilience testing
50
50
  ```
51
51
 
@@ -59,6 +59,8 @@ When a Builder hits something complex, it spawns a Scout to research. When code
59
59
  - **6-Phase Verification** — Build, types, lint, tests, security, diff before advancing
60
60
  - **Colony Memory** — Learnings and instincts persist across sessions
61
61
  - **Pause/Resume** — Full state serialization for context breaks
62
+ - **Oracle Deep Research** — 50+ iteration autonomous research loop (RALF pattern)
63
+ - **Multi-Agent Surveys** — 4 parallel scouts for codebase analysis
62
64
 
63
65
  ---
64
66
 
@@ -96,74 +98,101 @@ That's it. The colony takes over from there.
96
98
 
97
99
  ---
98
100
 
99
- ## Commands
101
+ ## Complete Command Reference (33 Commands)
100
102
 
101
- Aether has **33 slash commands** organized into categories.
103
+ ### 🌱 Core Lifecycle Commands
102
104
 
103
- ### Core Lifecycle
105
+ | Command | Emoji | Description |
106
+ |---------|-------|-------------|
107
+ | `/ant:init "goal"` | 🌱 | Initialize colony with mission |
108
+ | `/ant:plan` | 📝 | Generate phased roadmap (50-iteration research loop) |
109
+ | `/ant:build N` | 🔨 | Execute phase N with worker waves |
110
+ | `/ant:continue` | ➡️ | 6-phase verification, then advance to next phase |
111
+ | `/ant:pause-colony` | 💾 | Save state for context break |
112
+ | `/ant:resume-colony` | ▶️ | Restore from pause |
113
+ | `/ant:lay-eggs "new goal"` | 🥚 | Start fresh colony (preserves instincts) |
114
+ | `/ant:seal` | 🏺 | Complete and archive colony |
115
+ | `/ant:entomb` | ⚰️ | Create chamber from completed colony |
104
116
 
105
- | Command | Purpose |
106
- |---------|---------|
107
- | `/ant:init "goal"` | Initialize colony with mission |
108
- | `/ant:plan` | Generate phased roadmap (50-iteration research loop) |
109
- | `/ant:build N` | Execute phase N with worker waves |
110
- | `/ant:continue` | 6-phase verification, then advance |
111
- | `/ant:status` | Colony overview |
112
- | `/ant:pause-colony` | Save state for context break |
113
- | `/ant:resume-colony` | Restore from pause |
114
-
115
- ### Pheromone Signals
116
-
117
- | Command | Purpose |
118
- |---------|---------|
119
- | `/ant:focus "area"` | Guide colony attention |
120
- | `/ant:redirect "pattern"` | Warn away from approaches |
121
- | `/ant:feedback "msg"` | Teach preferences |
122
-
123
- ### Power Commands
124
-
125
- | Command | Purpose |
126
- |---------|---------|
127
- | `/ant:swarm "problem"` | Deploy 4 parallel scouts for stubborn bugs |
128
- | `/ant:council` | Clarify intent via multi-choice questions |
129
- | `/ant:oracle` | Deep research with 50+ iterations |
130
-
131
- ### Research & Analysis
132
-
133
- | Command | Purpose |
134
- |---------|---------|
135
- | `/ant:colonize` | Analyze existing codebase |
136
- | `/ant:archaeology <path>` | Excavate git history |
137
- | `/ant:chaos <target>` | Resilience testing |
138
- | `/ant:organize` | Codebase hygiene report |
139
- | `/ant:dream` | Philosophical codebase wanderer |
140
- | `/ant:interpret` | Ground dreams in reality |
141
-
142
- ### Issue Tracking
143
-
144
- | Command | Purpose |
145
- |---------|---------|
146
- | `/ant:flag "issue"` | Create blocker/issue/note |
147
- | `/ant:flags` | List and manage flags |
148
-
149
- ### Visibility
150
-
151
- | Command | Purpose |
152
- |---------|---------|
153
- | `/ant:watch` | Live tmux monitoring |
154
- | `/ant:phase N` | View phase details |
155
- | `/ant:history` | Recent colony activity |
156
- | `/ant:help` | Full command reference |
157
-
158
- ### System
117
+ **Core Lifecycle Flow:**
118
+ ```
119
+ /ant:init /ant:plan /ant:build 1 /ant:continue → /ant:build 2 → ... → /ant:seal → /ant:entomb
120
+ ```
159
121
 
160
- | Command | Purpose |
161
- |---------|---------|
162
- | `/ant:update` | Sync system files from hub |
163
- | `/ant:migrate-state` | Upgrade old state format |
164
- | `/ant:verify-castes` | Check model routing |
165
- | `/ant:seal` | Complete and archive colony |
166
- | `/ant:entomb` | Create chamber from completed colony |
122
+ ### 📊 Research & Analysis Commands
123
+
124
+ | Command | Emoji | Description |
125
+ |---------|-------|-------------|
126
+ | `/ant:colonize` | 🗺️ | **Multi-agent territory survey** — 4 parallel scouts analyze your codebase and produce: `STRUCTURE.md`, `INTEGRATIONS.md`, `CONVENTIONS.md`, `ARCHITECTURE.md`, `CONCERNS.md` |
127
+ | `/ant:archaeology <path>` | 🏺 | Excavate git history for any file/directory — traces why code exists, surfaces tribal knowledge, identifies "don't touch" areas |
128
+ | `/ant:oracle ["topic"]` | 🔮 | **Deep research with RALF pattern** — 50+ iteration autonomous research loop. Use `stop` or `status` as arguments |
129
+ | `/ant:chaos <target>` | 🎲 | Resilience testing — probes edge cases, boundary conditions, finds cracks before they break |
130
+ | `/ant:swarm ["problem"]` | 🔥 | Deploy 4 parallel scouts for stubborn bugs OR view real-time swarm display |
131
+ | `/ant:dream` | 💭 | The Dreamer — philosophical codebase wanderer that observes and imagines |
132
+ | `/ant:interpret` | 🔍 | Ground dreams in reality — validates observations against actual code |
133
+ | `/ant:organize` | 🧹 | Codebase hygiene report — scans for stale files, dead code, orphaned configs |
134
+
135
+ **Research Command Details:**
136
+
137
+ #### `/ant:colonize` — Territory Survey
138
+ Dispatches 4 parallel Scout agents to analyze your codebase:
139
+ - **Scout 1**: Maps directory structure, identifies entry points, dependencies
140
+ - **Scout 2**: Maps integrations (databases, APIs, third-party services)
141
+ - **Scout 3**: Documents conventions (naming, patterns, architecture decisions)
142
+ - **Scout 4**: Identifies concerns (tech debt, risks, areas needing attention)
143
+
144
+ Produces 5 documentation files in `.aether/docs/`.
145
+
146
+ #### `/ant:oracle` — Deep Research (RALF Pattern)
147
+ The Oracle runs autonomously in a separate process using the Recursive Agent Loop Framework:
148
+ 1. Configure research topic via interactive wizard
149
+ 2. Oracle iterates 50+ times, accumulating knowledge
150
+ 3. Each iteration reads previous progress, researches gaps
151
+ 4. Produces comprehensive findings in `.aether/oracle/discoveries/`
152
+
153
+ Non-invasive: Never touches colony state, only writes to `.aether/oracle/`.
154
+
155
+ ### 🧭 Planning & Coordination Commands
156
+
157
+ | Command | Emoji | Description |
158
+ |---------|-------|-------------|
159
+ | `/ant:council` | 🏛️ | Clarify intent via multi-choice questions |
160
+ | `/ant:focus "area"` | 🔦 | Emit FOCUS signal — guide colony attention |
161
+ | `/ant:redirect "pattern"` | ⚠️ | Emit REDIRECT signal — warn away from approaches |
162
+ | `/ant:feedback "msg"` | 💬 | Emit FEEDBACK signal — teach preferences |
163
+
164
+ **Pheromone Signals:**
165
+ - **FOCUS** (normal priority): "Pay attention here"
166
+ - **REDIRECT** (high priority): "Don't do this" (hard constraint)
167
+ - **FEEDBACK** (low priority): "Adjust based on this"
168
+
169
+ ### 📋 Visibility & Status Commands
170
+
171
+ | Command | Emoji | Description |
172
+ |---------|-------|-------------|
173
+ | `/ant:status` | 📈 | Colony overview — current phase, progress, active workers |
174
+ | `/ant:phase N` | 📝 | View phase details — tasks, status, assignments |
175
+ | `/ant:history` | 📜 | Recent colony activity log |
176
+ | `/ant:maturity` | 👑 | View colony maturity journey with ASCII art anthill |
177
+ | `/ant:watch` | 👁️ | Set up tmux session to watch ants working in real-time |
178
+ | `/ant:tunnels [ch1] [ch2]` | 🕳️ | Explore tunnels — browse archived colonies, compare chambers |
179
+ | `/ant:flags` | 🚩 | List and manage flags (blockers, issues, notes) |
180
+ | `/ant:help` | 📖 | Full command reference |
181
+
182
+ ### 🚩 Issue Tracking Commands
183
+
184
+ | Command | Emoji | Description |
185
+ |---------|-------|-------------|
186
+ | `/ant:flag "issue"` | 🚩 | Create blocker/issue/note |
187
+ | `/ant:flags` | 📋 | List and manage flags |
188
+
189
+ ### ⚙️ System Commands
190
+
191
+ | Command | Emoji | Description |
192
+ |---------|-------|-------------|
193
+ | `/ant:update` | 🔄 | Sync system files from global hub |
194
+ | `/ant:verify-castes` | ✓ | Check caste model assignments and system status |
195
+ | `/ant:migrate-state` | 🚚 | One-time state migration from v1 to v2.0 format |
167
196
 
168
197
  ---
169
198
 
@@ -175,20 +204,36 @@ The `aether` CLI provides additional utilities:
175
204
  # View version and status
176
205
  aether version
177
206
 
207
+ # Update all registered repos
208
+ aether update --all
209
+ aether update --all --force # Force even with dirty repos
210
+
178
211
  # Manage model routing
179
212
  aether caste-models list
180
213
  aether caste-models set builder=kimi-k2.5
214
+ aether caste-models reset builder
181
215
 
182
- # Checkpoints
216
+ # Checkpoints (safe snapshots)
183
217
  aether checkpoint create "before refactor"
184
218
  aether checkpoint list
185
219
  aether checkpoint restore <id>
220
+ aether checkpoint verify <id>
186
221
 
187
222
  # View telemetry
188
223
  aether telemetry
224
+ aether telemetry model kimi-k2.5
225
+ aether telemetry performance
189
226
 
190
227
  # Sync state with planning docs
191
228
  aether sync-state
229
+
230
+ # Context
231
+ aether context # Show auto-loaded context including nestmates
232
+ aether nestmates # List sibling colonies
233
+ aether spawn-tree # Display worker spawn tree
234
+
235
+ # Initialize in current repo
236
+ aether init --goal "My project"
192
237
  ```
193
238
 
194
239
  ---
@@ -226,18 +271,18 @@ Set `LITELLM_AUTH_TOKEN` environment variable for custom auth.
226
271
 
227
272
  ## The Castes
228
273
 
229
- | Caste | Role | Model |
230
- |-------|------|-------|
231
- | 👑 **Queen** | Orchestrates, spawns workers, synthesizes | glm-5 |
232
- | 🔨 **Builder** | Writes code, TDD-first | kimi-k2.5 |
233
- | 👁️ **Watcher** | Tests, validates, quality gates | kimi-k2.5 |
234
- | 🔍 **Scout** | Researches docs, finds answers | minimax-2.5 |
235
- | 🗺️ **Colonizer** | Explores codebases, maps structure | minimax-2.5 |
236
- | 🏛️ **Architect** | Synthesizes patterns, coordinates docs | glm-5 |
237
- | 📋 **Route-Setter** | Plans phases, breaks down goals | kimi-k2.5 |
238
- | 🏺 **Archaeologist** | Excavates git history | glm-5 |
239
- | 🔮 **Oracle** | Deep research, architecture analysis | minimax-2.5 |
240
- | 🎲 **Chaos** | Resilience testing, adversarial probing | kimi-k2.5 |
274
+ | Caste | Emoji | Role | Model |
275
+ |-------|-------|------|-------|
276
+ | 👑 **Queen** | — | Orchestrates, spawns workers, synthesizes | glm-5 |
277
+ | 🔨 **Builder** | 🛠️ | Writes code, TDD-first | kimi-k2.5 |
278
+ | 👁️ **Watcher** | 👀 | Tests, validates, quality gates | kimi-k2.5 |
279
+ | 🔍 **Scout** | 🗺️ | Researches docs, finds answers | minimax-2.5 |
280
+ | 🗺️ **Colonizer** | 📊 | Explores codebases, maps structure | minimax-2.5 |
281
+ | 🏗️ **Architect** | 🏛️ | Synthesizes patterns, coordinates docs | glm-5 |
282
+ | 📋 **Route-Setter** | 🧭 | Plans phases, breaks down goals | kimi-k2.5 |
283
+ | 🏺 **Archaeologist** | 📜 | Excavates git history | glm-5 |
284
+ | 🔮 **Oracle** | 🔮 | Deep research, architecture analysis | minimax-2.5 |
285
+ | 🎲 **Chaos** | 🎲 | Resilience testing, adversarial probing | kimi-k2.5 |
241
286
 
242
287
  ---
243
288
 
@@ -328,8 +373,33 @@ Detected automatically via `milestone-detect` utility.
328
373
  ├── aether-utils.sh # Utility layer (50+ subcommands)
329
374
  ├── model-profiles.yaml # Caste-to-model routing
330
375
  ├── verification-loop.md # 6-phase verification reference
376
+ ├── QUEEN_ANT_ARCHITECTURE.md # Complete system architecture
377
+ ├── coding-standards.md # Coding standards reference
378
+ ├── debugging.md # Debugging discipline
379
+ ├── tdd.md # TDD discipline
380
+
381
+ ├── docs/ # Documentation
382
+ │ ├── known-issues.md # Known bugs and workarounds
383
+ │ ├── implementation-learnings.md # Workflow patterns
384
+ │ ├── codebase-review.md # Command inventory
385
+ │ ├── planning-discipline.md # Planning guidelines
386
+ │ └── ...
331
387
 
332
- ├── data/ # Per-project state
388
+ ├── utils/ # Utility scripts
389
+ │ ├── atomic-write.sh
390
+ │ ├── colorize-log.sh
391
+ │ ├── file-lock.sh
392
+ │ ├── spawn-tree.sh
393
+ │ └── ...
394
+
395
+ ├── oracle/ # Oracle research infrastructure
396
+ │ ├── oracle.sh # RALF loop script
397
+ │ ├── oracle.md # Oracle agent prompt
398
+ │ ├── research.json # Active research config
399
+ │ ├── progress.md # Research progress
400
+ │ └── discoveries/ # Research findings
401
+
402
+ ├── data/ # Per-project state (NEVER synced)
333
403
  │ ├── COLONY_STATE.json # Goal, plan, memory, instincts
334
404
  │ ├── flags.json # Blockers, issues, notes
335
405
  │ ├── constraints.json # Focus areas and redirects
@@ -338,7 +408,8 @@ Detected automatically via `milestone-detect` utility.
338
408
  │ ├── telemetry.json # Model performance data
339
409
  │ └── completion-report.md # End-of-project summary
340
410
 
341
- ├── dreams/ # Dream session files
411
+ ├── dreams/ # Dream session files (NEVER synced)
412
+ ├── checkpoints/ # Update rollback data (NEVER synced)
342
413
  └── chambers/ # Entombed (archived) colonies
343
414
 
344
415
  bin/ # CLI
@@ -354,7 +425,9 @@ bin/ # CLI
354
425
 
355
426
  ---
356
427
 
357
- ## Typical Workflow
428
+ ## Typical Workflows
429
+
430
+ ### Starting a New Project
358
431
 
359
432
  ```
360
433
  1. /ant:init "Build feature X" # Set the goal
@@ -367,6 +440,26 @@ bin/ # CLI
367
440
  8. /ant:seal # Complete and archive
368
441
  ```
369
442
 
443
+ ### Deep Research Workflow
444
+
445
+ ```
446
+ /ant:oracle "research topic" # Configure and launch Oracle
447
+ # Oracle runs autonomously for 50+ iterations
448
+ /ant:oracle status # Check progress
449
+ /ant:oracle stop # Stop if needed
450
+ # Read findings in .aether/oracle/discoveries/
451
+ ```
452
+
453
+ ### Codebase Analysis Workflow
454
+
455
+ ```
456
+ /ant:colonize # 4 scouts survey territory
457
+ # Read generated docs in .aether/docs/
458
+ /ant:archaeology src/legacy/ # Excavate git history
459
+ /ant:organize # Hygiene report
460
+ /ant:chaos "auth module" # Resilience test
461
+ ```
462
+
370
463
  ### Between Sessions
371
464
 
372
465
  ```bash
@@ -390,7 +483,7 @@ bin/ # CLI
390
483
 
391
484
  ## OpenCode Agents
392
485
 
393
- Aether includes 4 specialized OpenCode agents:
486
+ Aether includes specialized OpenCode agents:
394
487
 
395
488
  | Agent | Purpose | Temperature |
396
489
  |-------|---------|-------------|
@@ -424,15 +517,30 @@ Aether includes 4 specialized OpenCode agents:
424
517
  └─────────────────────────────────────────────────────────────┘
425
518
  ```
426
519
 
520
+ ### Three-Tier Distribution
521
+
522
+ ```
523
+ Aether Repo (.aether/) → Hub (~/.aether/) → Target Repos (.aether/)
524
+ │ │ │
525
+ │ npm install -g . │ aether update │
526
+ └───────────────────────→┴───────────────────────→┘
527
+ (excluding user data)
528
+ ```
529
+
530
+ **User data directories are NEVER synced:** `data/`, `dreams/`, `checkpoints/`, `locks/`, `temp/`
531
+
427
532
  ---
428
533
 
429
534
  ## Safety Features
430
535
 
431
- - **File Locking** — Prevents concurrent modification of state
536
+ - **File Locking** — Prevents concurrent modification of state with configurable stale lock detection
432
537
  - **Atomic Writes** — Temp file + rename pattern
433
538
  - **Update Transactions** — Two-phase commit with rollback
539
+ - **State Validation** — Schema validation before any state modifications
540
+ - **Event Pruning** — Automatic cleanup prevents unbounded event history
434
541
  - **Git Checkpoints** — Automatic commits before phases
435
542
  - **Ant Graveyards** — Failed files marked for future caution
543
+ - **Checkpoint System** — Safe snapshots before updates with `aether checkpoint`
436
544
 
437
545
  ---
438
546
 
@@ -459,11 +567,16 @@ npm install -g aether-colony
459
567
  # Verify install
460
568
  aether version
461
569
  ls ~/.claude/commands/ant/
570
+ ls ~/.aether/ # Check hub structure
462
571
 
463
572
  # Verify runtime (from inside any repo)
464
573
  ls .aether/
465
574
 
466
- # Update
575
+ # Update system files in all registered repos
576
+ aether update --all
577
+ aether update --all --force # Force even with dirty repos
578
+
579
+ # Update npm package
467
580
  npm update -g aether-colony
468
581
 
469
582
  # Uninstall (preserves project state)
package/bin/cli.js CHANGED
@@ -70,11 +70,9 @@ const COMMANDS_DEST = path.join(HOME, '.claude', 'commands', 'ant');
70
70
 
71
71
  // Hub paths
72
72
  const HUB_DIR = path.join(HOME, '.aether');
73
- const HUB_SYSTEM = path.join(HUB_DIR, 'system');
74
73
  const HUB_COMMANDS_CLAUDE = path.join(HUB_DIR, 'commands', 'claude');
75
74
  const HUB_COMMANDS_OPENCODE = path.join(HUB_DIR, 'commands', 'opencode');
76
75
  const HUB_AGENTS = path.join(HUB_DIR, 'agents');
77
- const HUB_VISUALIZATIONS = path.join(HUB_DIR, 'visualizations');
78
76
  const HUB_REGISTRY = path.join(HUB_DIR, 'registry.json');
79
77
  const HUB_VERSION = path.join(HUB_DIR, 'version.json');
80
78
 
@@ -836,6 +834,122 @@ function gitStashFiles(repoPath, files) {
836
834
  }
837
835
  }
838
836
 
837
+ // Directories to exclude from hub sync (user data, local state)
838
+ const HUB_EXCLUDE_DIRS = ['data', 'dreams', 'checkpoints', 'locks', 'temp'];
839
+
840
+ /**
841
+ * Check if a path should be excluded from hub sync
842
+ * @param {string} relPath - Relative path from .aether/
843
+ * @returns {boolean} True if should be excluded
844
+ */
845
+ function shouldExcludeFromHub(relPath) {
846
+ const parts = relPath.split(path.sep);
847
+ // Exclude if any part of the path is in the exclude list
848
+ return parts.some(part => HUB_EXCLUDE_DIRS.includes(part));
849
+ }
850
+
851
+ /**
852
+ * Sync .aether/ directory to hub, excluding user data directories
853
+ * @param {string} srcDir - Source .aether/ directory
854
+ * @param {string} destDir - Destination hub directory
855
+ * @returns {object} Sync result with copied, removed, skipped counts
856
+ */
857
+ function syncAetherToHub(srcDir, destDir) {
858
+ if (!fs.existsSync(srcDir)) {
859
+ return { copied: 0, removed: 0, skipped: 0 };
860
+ }
861
+
862
+ fs.mkdirSync(destDir, { recursive: true });
863
+
864
+ // Get all files in source, filtering out excluded directories
865
+ const srcFiles = [];
866
+ function collectFiles(dir, base) {
867
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
868
+ for (const entry of entries) {
869
+ if (entry.name.startsWith('.')) continue;
870
+ const fullPath = path.join(dir, entry.name);
871
+ const relPath = path.relative(base, fullPath);
872
+
873
+ if (shouldExcludeFromHub(relPath)) continue;
874
+
875
+ if (entry.isDirectory()) {
876
+ collectFiles(fullPath, base);
877
+ } else {
878
+ srcFiles.push(relPath);
879
+ }
880
+ }
881
+ }
882
+ collectFiles(srcDir, srcDir);
883
+
884
+ // Copy files with hash comparison
885
+ let copied = 0;
886
+ let skipped = 0;
887
+ for (const relPath of srcFiles) {
888
+ const srcPath = path.join(srcDir, relPath);
889
+ const destPath = path.join(destDir, relPath);
890
+
891
+ fs.mkdirSync(path.dirname(destPath), { recursive: true });
892
+
893
+ // Hash comparison
894
+ let shouldCopy = true;
895
+ if (fs.existsSync(destPath)) {
896
+ const srcHash = hashFileSync(srcPath);
897
+ const destHash = hashFileSync(destPath);
898
+ if (srcHash === destHash) {
899
+ shouldCopy = false;
900
+ skipped++;
901
+ }
902
+ }
903
+
904
+ if (shouldCopy) {
905
+ fs.copyFileSync(srcPath, destPath);
906
+ if (relPath.endsWith('.sh')) {
907
+ fs.chmodSync(destPath, 0o755);
908
+ }
909
+ copied++;
910
+ }
911
+ }
912
+
913
+ // Cleanup: remove files in dest that aren't in source (and aren't excluded)
914
+ const destFiles = [];
915
+ function collectDestFiles(dir, base) {
916
+ if (!fs.existsSync(dir)) return;
917
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
918
+ for (const entry of entries) {
919
+ if (entry.name.startsWith('.') || entry.name === 'registry.json' || entry.name === 'version.json' || entry.name === 'manifest.json') continue;
920
+ const fullPath = path.join(dir, entry.name);
921
+ const relPath = path.relative(base, fullPath);
922
+
923
+ if (shouldExcludeFromHub(relPath)) continue;
924
+
925
+ if (entry.isDirectory()) {
926
+ collectDestFiles(fullPath, base);
927
+ } else {
928
+ destFiles.push(relPath);
929
+ }
930
+ }
931
+ }
932
+ collectDestFiles(destDir, destDir);
933
+
934
+ const srcSet = new Set(srcFiles);
935
+ const removed = [];
936
+ for (const relPath of destFiles) {
937
+ if (!srcSet.has(relPath)) {
938
+ removed.push(relPath);
939
+ try {
940
+ fs.unlinkSync(path.join(destDir, relPath));
941
+ } catch (err) {
942
+ // Ignore cleanup errors
943
+ }
944
+ }
945
+ }
946
+
947
+ // Clean up empty directories
948
+ cleanEmptyDirs(destDir);
949
+
950
+ return { copied, removed, skipped };
951
+ }
952
+
839
953
  function setupHub() {
840
954
  // Create ~/.aether/ directory structure and populate from package
841
955
  try {
@@ -848,17 +962,35 @@ function setupHub() {
848
962
  log(` Warning: previous manifest is invalid, regenerating`);
849
963
  }
850
964
 
851
- // Sync runtime/ -> ~/.aether/system/
965
+ // Sync runtime/ -> ~/.aether/ (clean production files)
966
+ // runtime/ is the staging area - explicit allowlist via sync-to-runtime.sh
852
967
  const runtimeSrc = path.join(PACKAGE_DIR, 'runtime');
853
968
  if (fs.existsSync(runtimeSrc)) {
854
- const result = syncDirWithCleanup(runtimeSrc, HUB_SYSTEM);
855
- log(` Hub system: ${result.copied} files -> ${HUB_SYSTEM}`);
969
+ const result = syncAetherToHub(runtimeSrc, HUB_DIR);
970
+ log(` Hub system: ${result.copied} files, ${result.skipped} unchanged -> ${HUB_DIR}`);
856
971
  if (result.removed.length > 0) {
857
972
  log(` Hub system: removed ${result.removed.length} stale files`);
858
973
  for (const f of result.removed) log(` - ${f}`);
859
974
  }
860
975
  }
861
976
 
977
+ // Clean up legacy directories from old hub structure
978
+ const legacyDirs = [
979
+ path.join(HUB_DIR, 'system'),
980
+ path.join(HUB_DIR, '.aether'),
981
+ path.join(HUB_DIR, 'visualizations'),
982
+ ];
983
+ for (const legacyDir of legacyDirs) {
984
+ if (fs.existsSync(legacyDir)) {
985
+ try {
986
+ removeDirSync(legacyDir);
987
+ log(` Cleaned up legacy: ${path.basename(legacyDir)}/`);
988
+ } catch (err) {
989
+ // Ignore cleanup errors
990
+ }
991
+ }
992
+ }
993
+
862
994
  // Sync .claude/commands/ant/ -> ~/.aether/commands/claude/
863
995
  const claudeCmdSrc = fs.existsSync(COMMANDS_SRC)
864
996
  ? COMMANDS_SRC
@@ -894,17 +1026,6 @@ function setupHub() {
894
1026
  }
895
1027
  }
896
1028
 
897
- // Sync .aether/visualizations/ -> ~/.aether/visualizations/
898
- const visualizationsSrc = path.join(PACKAGE_DIR, '.aether', 'visualizations');
899
- if (fs.existsSync(visualizationsSrc)) {
900
- const result = syncDirWithCleanup(visualizationsSrc, HUB_VISUALIZATIONS);
901
- log(` Hub visualizations: ${result.copied} files -> ${HUB_VISUALIZATIONS}`);
902
- if (result.removed.length > 0) {
903
- log(` Hub visualizations: removed ${result.removed.length} stale files`);
904
- for (const f of result.removed) log(` - ${f}`);
905
- }
906
- }
907
-
908
1029
  // Create/preserve registry.json
909
1030
  if (!fs.existsSync(HUB_REGISTRY)) {
910
1031
  writeJsonSync(HUB_REGISTRY, { schema_version: 1, repos: [] });
@@ -971,7 +1092,7 @@ async function updateRepo(repoPath, sourceVersion, opts) {
971
1092
  }
972
1093
 
973
1094
  // Use UpdateTransaction for two-phase commit with automatic rollback
974
- const transaction = new UpdateTransaction(repoPath, { sourceVersion, quiet });
1095
+ const transaction = new UpdateTransaction(repoPath, { sourceVersion, quiet, force });
975
1096
 
976
1097
  try {
977
1098
  const result = await transaction.execute(sourceVersion, { dryRun });
@@ -980,18 +1101,15 @@ async function updateRepo(repoPath, sourceVersion, opts) {
980
1101
  const systemCopied = result.sync_result?.system?.copied || 0;
981
1102
  const commandsCopied = (result.sync_result?.commands?.copied || 0);
982
1103
  const agentsCopied = result.sync_result?.agents?.copied || 0;
983
- const visualizationsCopied = result.sync_result?.visualizations?.copied || 0;
984
1104
 
985
1105
  const systemRemoved = result.sync_result?.system?.removed?.length || 0;
986
1106
  const commandsRemoved = result.sync_result?.commands?.removed?.length || 0;
987
1107
  const agentsRemoved = result.sync_result?.agents?.removed?.length || 0;
988
- const visualizationsRemoved = result.sync_result?.visualizations?.removed?.length || 0;
989
1108
 
990
1109
  const allRemovedFiles = [
991
1110
  ...(result.sync_result?.system?.removed || []),
992
1111
  ...(result.sync_result?.commands?.removed || []).map(f => `.claude/commands/ant/${f}`),
993
1112
  ...(result.sync_result?.agents?.removed || []).map(f => `.opencode/agents/${f}`),
994
- ...(result.sync_result?.visualizations?.removed || []).map(f => `.aether/visualizations/${f}`),
995
1113
  ];
996
1114
 
997
1115
  return {
@@ -1001,8 +1119,7 @@ async function updateRepo(repoPath, sourceVersion, opts) {
1001
1119
  system: systemCopied,
1002
1120
  commands: commandsCopied,
1003
1121
  agents: agentsCopied,
1004
- visualizations: visualizationsCopied,
1005
- removed: systemRemoved + commandsRemoved + agentsRemoved + visualizationsRemoved,
1122
+ removed: systemRemoved + commandsRemoved + agentsRemoved,
1006
1123
  removedFiles: allRemovedFiles,
1007
1124
  stashCreated: !!transaction.checkpoint?.stashRef,
1008
1125
  checkpoint_id: result.checkpoint_id,
@@ -1171,14 +1288,14 @@ program
1171
1288
  console.error(` Skipping. Use --force to stash and update.`);
1172
1289
  dirty++;
1173
1290
  } else if (result.status === 'dry-run') {
1174
- log(` Would update: ${repo.path} (${result.from} -> ${result.to}) [${result.system} system, ${result.commands} commands, ${result.agents} agents, ${result.visualizations} visualizations]`);
1291
+ log(` Would update: ${repo.path} (${result.from} -> ${result.to}) [${result.system} system, ${result.commands} commands, ${result.agents} agents]`);
1175
1292
  if (result.removed > 0) {
1176
1293
  log(` Would remove ${result.removed} stale files:`);
1177
1294
  for (const f of result.removedFiles) log(` - ${f}`);
1178
1295
  }
1179
1296
  updated++;
1180
1297
  } else if (result.status === 'updated') {
1181
- log(` ${c.success('Updated:')} ${repo.path} (${result.from} -> ${result.to}) [${result.system} system, ${result.commands} commands, ${result.agents} agents, ${result.visualizations} visualizations]`);
1298
+ log(` ${c.success('Updated:')} ${repo.path} (${result.from} -> ${result.to}) [${result.system} system, ${result.commands} commands, ${result.agents} agents]`);
1182
1299
  if (result.removed > 0) {
1183
1300
  log(` Removed ${result.removed} stale files:`);
1184
1301
  for (const f of result.removedFiles) log(` - ${f}`);
@@ -1254,7 +1371,7 @@ program
1254
1371
 
1255
1372
  if (result.status === 'dry-run') {
1256
1373
  console.log(`Would update: ${result.from} -> ${result.to}`);
1257
- console.log(` ${result.system} system files, ${result.commands} command files, ${result.agents} agent files, ${result.visualizations} visualization files`);
1374
+ console.log(` ${result.system} system files, ${result.commands} command files, ${result.agents} agent files`);
1258
1375
  if (result.removed > 0) {
1259
1376
  console.log(` Would remove ${result.removed} stale files:`);
1260
1377
  for (const f of result.removedFiles) console.log(` - ${f}`);