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
@@ -0,0 +1,138 @@
1
+ #!/bin/bash
2
+ # sync-to-runtime.sh — Copies allowlisted system files from .aether/ to runtime/
3
+ #
4
+ # Purpose: In the Aether repo, .aether/ is the source of truth for system files.
5
+ # This script syncs those files INTO runtime/ (the npm staging directory)
6
+ # so that `npm install -g .` packages the latest versions.
7
+ #
8
+ # Usage: bash bin/sync-to-runtime.sh [--reverse]
9
+ # --reverse Copy FROM runtime/ TO .aether/ (one-time seed operation)
10
+ #
11
+ # This script is safe to run multiple times (idempotent).
12
+ # It only copies allowlisted files — it never deletes extras in runtime/.
13
+
14
+ set -e
15
+
16
+ # Resolve repo root (one level up from bin/)
17
+ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
18
+ AETHER_DIR="$REPO_ROOT/.aether"
19
+ RUNTIME_DIR="$REPO_ROOT/runtime"
20
+
21
+ # Allowlist: these are the system files that sync between .aether/ and runtime/
22
+ # Must match the SYSTEM_FILES array in bin/lib/update-transaction.js
23
+ SYSTEM_FILES=(
24
+ "aether-utils.sh"
25
+ "coding-standards.md"
26
+ "debugging.md"
27
+ "DISCIPLINES.md"
28
+ "learning.md"
29
+ "planning.md"
30
+ "QUEEN_ANT_ARCHITECTURE.md"
31
+ "tdd.md"
32
+ "verification-loop.md"
33
+ "verification.md"
34
+ "workers.md"
35
+ "workers-new-castes.md"
36
+ "CONTEXT.md"
37
+ "model-profiles.yaml"
38
+ "recover.sh"
39
+ "docs/biological-reference.md"
40
+ "docs/command-sync.md"
41
+ "docs/constraints.md"
42
+ "docs/namespace.md"
43
+ "docs/pathogen-schema-example.json"
44
+ "docs/pathogen-schema.md"
45
+ "docs/PHEROMONE-INJECTION.md"
46
+ "docs/PHEROMONE-INTEGRATION.md"
47
+ "docs/PHEROMONE-SYSTEM-DESIGN.md"
48
+ "docs/pheromones.md"
49
+ "docs/progressive-disclosure.md"
50
+ "docs/README.md"
51
+ "docs/VISUAL-OUTPUT-SPEC.md"
52
+ "docs/known-issues.md"
53
+ "docs/implementation-learnings.md"
54
+ "docs/codebase-review.md"
55
+ "docs/planning-discipline.md"
56
+ "utils/atomic-write.sh"
57
+ "utils/chamber-compare.sh"
58
+ "utils/chamber-utils.sh"
59
+ "utils/colorize-log.sh"
60
+ "utils/error-handler.sh"
61
+ "utils/file-lock.sh"
62
+ "utils/spawn-tree.sh"
63
+ "utils/spawn-with-model.sh"
64
+ "utils/state-loader.sh"
65
+ "utils/swarm-display.sh"
66
+ "utils/watch-spawn-tree.sh"
67
+ "utils/xml-utils.sh"
68
+ "utils/xml-core.sh"
69
+ "utils/xml-compose.sh"
70
+ "utils/queen-to-md.xsl"
71
+ "exchange/pheromone-xml.sh"
72
+ "exchange/wisdom-xml.sh"
73
+ "exchange/registry-xml.sh"
74
+ "schemas/aether-types.xsd"
75
+ "schemas/pheromone.xsd"
76
+ "schemas/queen-wisdom.xsd"
77
+ "schemas/colony-registry.xsd"
78
+ "schemas/worker-priming.xsd"
79
+ "schemas/prompt.xsd"
80
+ "templates/QUEEN.md.template"
81
+ )
82
+
83
+ # Determine direction
84
+ REVERSE=false
85
+ if [ "${1:-}" = "--reverse" ]; then
86
+ REVERSE=true
87
+ fi
88
+
89
+ if [ "$REVERSE" = true ]; then
90
+ SRC_DIR="$RUNTIME_DIR"
91
+ DST_DIR="$AETHER_DIR"
92
+ LABEL="runtime/ -> .aether/ (seeding)"
93
+ else
94
+ SRC_DIR="$AETHER_DIR"
95
+ DST_DIR="$RUNTIME_DIR"
96
+ LABEL=".aether/ -> runtime/ (staging)"
97
+ fi
98
+
99
+ # Check source directory exists
100
+ if [ ! -d "$SRC_DIR" ]; then
101
+ # Silently exit if source doesn't exist (e.g. installed from npm, no .aether/)
102
+ exit 0
103
+ fi
104
+
105
+ copied=0
106
+ skipped=0
107
+
108
+ for file in "${SYSTEM_FILES[@]}"; do
109
+ src="$SRC_DIR/$file"
110
+ dst="$DST_DIR/$file"
111
+
112
+ # Skip if source file doesn't exist
113
+ if [ ! -f "$src" ]; then
114
+ continue
115
+ fi
116
+
117
+ # Create destination directory if needed
118
+ dst_dir="$(dirname "$dst")"
119
+ mkdir -p "$dst_dir"
120
+
121
+ # Skip if files are identical (compare hashes)
122
+ if [ -f "$dst" ]; then
123
+ src_hash=$(shasum -a 256 "$src" 2>/dev/null | cut -d' ' -f1)
124
+ dst_hash=$(shasum -a 256 "$dst" 2>/dev/null | cut -d' ' -f1)
125
+ if [ "$src_hash" = "$dst_hash" ]; then
126
+ skipped=$((skipped + 1))
127
+ continue
128
+ fi
129
+ fi
130
+
131
+ cp "$src" "$dst"
132
+ copied=$((copied + 1))
133
+ done
134
+
135
+ # Only print output if not running in quiet mode (npm postinstall suppresses)
136
+ if [ -t 1 ] || [ "${VERBOSE:-}" = "1" ]; then
137
+ echo "Sync ($LABEL): $copied copied, $skipped unchanged"
138
+ fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aether-colony",
3
- "version": "3.1.5",
3
+ "version": "3.1.16",
4
4
  "description": "Multi-agent system using ant colony intelligence for Claude Code and OpenCode — workers self-organize via pheromone signals",
5
5
  "bin": {
6
6
  "aether": "bin/cli.js"
@@ -12,13 +12,13 @@
12
12
  ".opencode/agents/",
13
13
  ".opencode/opencode.json",
14
14
  "runtime/",
15
- ".aether/visualizations/",
16
15
  "README.md",
17
16
  "LICENSE",
18
17
  "DISCLAIMER.md",
19
18
  "CHANGELOG.md"
20
19
  ],
21
20
  "scripts": {
21
+ "preinstall": "bash bin/sync-to-runtime.sh 2>/dev/null || true",
22
22
  "postinstall": "node bin/cli.js install --quiet",
23
23
  "test": "npm run test:unit && npm run test:bash",
24
24
  "test:unit": "ava",
@@ -0,0 +1,160 @@
1
+ # Aether Colony — Current Context
2
+
3
+ > **This document is the colony's memory. If context collapses, read this file first.**
4
+
5
+ ---
6
+
7
+ ## 🚦 System Status
8
+
9
+ | Field | Value |
10
+ |-------|-------|
11
+ | **Last Updated** | 2026-02-16T20:49:16Z |
12
+ | **Current Phase** | - |
13
+ | **Phase Name** | Shellcheck Fixes |
14
+ | **Milestone** | Open Chambers |
15
+ | **Colony Status** | IDLE (No active colony) |
16
+ | **Safe to Clear?** | YES — No active colony - test fixes complete, hooks simplified |
17
+
18
+ ---
19
+
20
+ ## 📝 Session Notes (2026-02-21)
21
+
22
+ ### Completed This Session
23
+ - Fixed shellcheck SC2168 warnings in `.aether/aether-utils.sh`
24
+ - Removed duplicate context-update code (~388 lines)
25
+ - Fixed 8 remaining `local` keyword errors in case handlers
26
+ - All 383 tests pass, 0 SC2168 errors
27
+
28
+ ### Pending Work
29
+ - Commit the shellcheck fixes
30
+ - Resume XML integration work (see prior session handoff)
31
+
32
+ ---
33
+
34
+ ## 🎯 Prior Goal (2026-02-16)
35
+
36
+ Implement XML exchange system integration into existing colony lifecycle (pause/resume/seal/init) rather than as separate commands.
37
+
38
+ **Decision needed:** Choose integration approach:
39
+ - **Option A:** Auto-export on pause, auto-import on resume
40
+ - **Option B:** Export to eternal memory on seal, import on init
41
+ - **Option C:** Hybrid approach (recommended)
42
+
43
+ ---
44
+
45
+ ## 📍 What's In Progress
46
+
47
+ ### Phase 4: XML Exchange System ✅ COMPLETE
48
+
49
+ **Built but not yet integrated:**
50
+
51
+ 1. **Exchange Modules** (`.aether/exchange/`)
52
+ - `pheromone-xml.sh` - Signal export/import/merge with namespace prefixing
53
+ - `wisdom-xml.sh` - Queen wisdom with promotion pipeline (0.8 threshold)
54
+ - `registry-xml.sh` - Colony lineage and ancestry tracking
55
+
56
+ 2. **Core Utilities** (`.aether/utils/xml-core.sh`)
57
+ - Feature detection for xmllint/xmlstarlet/xsltproc
58
+ - JSON output helpers
59
+ - Validation, formatting, escaping
60
+
61
+ 3. **Schemas** (`.aether/schemas/`)
62
+ - `pheromone.xsd` - 22 castes, 4 priority levels
63
+ - `queen-wisdom.xsd` - Philosophy/pattern validation
64
+ - `colony-registry.xsd` - Lineage validation
65
+ - `aether-types.xsd` - Shared types
66
+
67
+ 4. **Tests**
68
+ - `tests/bash/test-xml-roundtrip.sh` - 19/19 tests passing
69
+
70
+ ---
71
+
72
+ ## ✅ Completed Work
73
+
74
+ ### Phase 1: Foundation ✅
75
+ - XML validation utilities (xml-validate, xml-query, xml-convert)
76
+ - XSD schemas (pheromone.xsd, queen-wisdom.xsd, colony-registry.xsd)
77
+ - 20/20 tests passing
78
+
79
+ ### Phase 2: Pheromone XML ✅
80
+ - Pheromone export to XML with namespaces
81
+ - XInclude composition for worker priming
82
+ - Colony namespace generation functions
83
+ - 15/15 pheromone tests + 6/6 XInclude tests passing
84
+
85
+ ### Phase 3: Wisdom Evolution ✅
86
+ - XSLT transformation queen-wisdom.xml → QUEEN.md
87
+ - Validation workflow using queen-wisdom.xsd
88
+ - Wisdom promotion pipeline (pattern → philosophy at 0.8 confidence)
89
+
90
+ ### Phase 4: Exchange System ✅
91
+ - Round-trip conversion (JSON ↔ XML)
92
+ - Namespace prefixing for collision prevention
93
+ - Merge with deduplication
94
+ - 19/19 round-trip tests passing
95
+
96
+ ---
97
+
98
+ ## ⚠️ Active Constraints (REDIRECT Signals)
99
+
100
+ | Constraint | Source | Date Set |
101
+ |------------|--------|----------|
102
+ | In the Aether repo, `.aether/` IS the source of truth — `runtime/` is auto-populated on publish | CLAUDE.md | Permanent |
103
+ | Never push without explicit user approval | CLAUDE.md Safety | Permanent |
104
+ | XML exchange should be automatic, not separate commands | User | 2026-02-16 |
105
+
106
+ ---
107
+
108
+ ## 💭 Active Pheromones (FOCUS Signals)
109
+
110
+ *None active*
111
+
112
+ ---
113
+
114
+ ## 📝 Recent Decisions
115
+
116
+ | Date | Decision | Rationale | Made By |
117
+ |------|----------|-----------|---------|
118
+ | 2026-02-16 | Remove /ant:export and /ant:import commands | User wants system integration, not new commands | User |
119
+ | 2026-02-16 | Complete Phase 4 | All exchange modules built and tested | Queen |
120
+ | 2026-02-16 | Pause for integration decision | Need user input on approach (A, B, or C) | Queen |
121
+
122
+ ---
123
+
124
+ ## 📊 Recent Activity (Last 10 Actions)
125
+
126
+ | Timestamp | Command | Result | Files Changed |
127
+ |-----------|---------|--------|---------------|
128
+ | 2026-02-16T20:49:04Z | pause-colony | Colony paused — test fixes and hook debugging completed | tests fixed: 18→0, hooks simplified |
129
+ | 2026-02-16T20:20:00Z | export/import removed | Commands deleted as requested | -2 files |
130
+ | 2026-02-16T20:18:00Z | registry-xml.sh | Created registry exchange module | +1 file |
131
+ | 2026-02-16T20:15:00Z | wisdom-xml.sh | Created wisdom exchange module | +1 file |
132
+ | 2026-02-16T20:14:00Z | pheromone-xml.sh | Fixed merge tests, 19/19 passing | 1 file |
133
+ | 2026-02-16T20:10:00Z | test-xml-roundtrip.sh | Comprehensive test suite | +1 file |
134
+ | 2026-02-16T20:00:00Z | xml-core.sh | Core XML utilities | +1 file |
135
+ | 2026-02-16T19:50:00Z | schemas/* | XSD schemas for validation | +4 files |
136
+
137
+ ---
138
+
139
+ ## 🔄 Next Steps
140
+
141
+ **AWAITING USER DECISION:**
142
+
143
+ How should XML exchange integrate into existing commands?
144
+
145
+ ### Option A: Pause/Resume Integration
146
+ - `/ant:pause-colony` → Auto-export to `.aether/exports/`
147
+ - `/ant:resume-colony` → Check for exports, offer to import
148
+
149
+ ### Option B: Seal/Init Integration
150
+ - `/ant:seal` → Export to `~/.aether/eternal/` (cross-colony)
151
+ - `/ant/init` → Check eternal memory, offer to seed new colony
152
+
153
+ ### Option C: Hybrid (Recommended)
154
+ - **Pause** → Export to `.aether/exports/` (local handoff)
155
+ - **Seal** → Export to `~/.aether/eternal/` (eternal memory)
156
+ - **Resume** → Import from both locations
157
+ - **Init** → Offer eternal memory as seed
158
+
159
+ ---
160
+