aether-colony 3.1.4 → 3.1.15

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 (124) 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 +327 -295
  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 +9 -3
  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 +225 -117
  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 +21 -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 +129 -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/lib/queen-utils.sh +729 -0
  101. package/runtime/model-profiles.yaml +100 -0
  102. package/runtime/recover.sh +136 -0
  103. package/runtime/templates/QUEEN.md.template +79 -0
  104. package/runtime/utils/atomic-write.sh +5 -5
  105. package/runtime/utils/chamber-utils.sh +6 -3
  106. package/runtime/utils/error-handler.sh +200 -0
  107. package/runtime/utils/queen-to-md.xsl +395 -0
  108. package/runtime/utils/spawn-tree.sh +428 -0
  109. package/runtime/utils/spawn-with-model.sh +56 -0
  110. package/runtime/utils/state-loader.sh +215 -0
  111. package/runtime/utils/swarm-display.sh +5 -5
  112. package/runtime/utils/watch-spawn-tree.sh +90 -22
  113. package/runtime/utils/xml-compose.sh +247 -0
  114. package/runtime/utils/xml-core.sh +186 -0
  115. package/runtime/utils/xml-utils.sh +2161 -0
  116. package/runtime/verification-loop.md +1 -1
  117. package/runtime/workers-new-castes.md +516 -0
  118. package/runtime/workers.md +20 -8
  119. package/.aether/visualizations/anthill-stages/brood-stable.txt +0 -26
  120. package/.aether/visualizations/anthill-stages/crowned-anthill.txt +0 -30
  121. package/.aether/visualizations/anthill-stages/first-mound.txt +0 -18
  122. package/.aether/visualizations/anthill-stages/open-chambers.txt +0 -24
  123. package/.aether/visualizations/anthill-stages/sealed-chambers.txt +0 -28
  124. package/.aether/visualizations/anthill-stages/ventilated-nest.txt +0 -27
@@ -0,0 +1,129 @@
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
+ "templates/QUEEN.md.template"
72
+ )
73
+
74
+ # Determine direction
75
+ REVERSE=false
76
+ if [ "${1:-}" = "--reverse" ]; then
77
+ REVERSE=true
78
+ fi
79
+
80
+ if [ "$REVERSE" = true ]; then
81
+ SRC_DIR="$RUNTIME_DIR"
82
+ DST_DIR="$AETHER_DIR"
83
+ LABEL="runtime/ -> .aether/ (seeding)"
84
+ else
85
+ SRC_DIR="$AETHER_DIR"
86
+ DST_DIR="$RUNTIME_DIR"
87
+ LABEL=".aether/ -> runtime/ (staging)"
88
+ fi
89
+
90
+ # Check source directory exists
91
+ if [ ! -d "$SRC_DIR" ]; then
92
+ # Silently exit if source doesn't exist (e.g. installed from npm, no .aether/)
93
+ exit 0
94
+ fi
95
+
96
+ copied=0
97
+ skipped=0
98
+
99
+ for file in "${SYSTEM_FILES[@]}"; do
100
+ src="$SRC_DIR/$file"
101
+ dst="$DST_DIR/$file"
102
+
103
+ # Skip if source file doesn't exist
104
+ if [ ! -f "$src" ]; then
105
+ continue
106
+ fi
107
+
108
+ # Create destination directory if needed
109
+ dst_dir="$(dirname "$dst")"
110
+ mkdir -p "$dst_dir"
111
+
112
+ # Skip if files are identical (compare hashes)
113
+ if [ -f "$dst" ]; then
114
+ src_hash=$(shasum -a 256 "$src" 2>/dev/null | cut -d' ' -f1)
115
+ dst_hash=$(shasum -a 256 "$dst" 2>/dev/null | cut -d' ' -f1)
116
+ if [ "$src_hash" = "$dst_hash" ]; then
117
+ skipped=$((skipped + 1))
118
+ continue
119
+ fi
120
+ fi
121
+
122
+ cp "$src" "$dst"
123
+ copied=$((copied + 1))
124
+ done
125
+
126
+ # Only print output if not running in quiet mode (npm postinstall suppresses)
127
+ if [ -t 1 ] || [ "${VERBOSE:-}" = "1" ]; then
128
+ echo "Sync ($LABEL): $copied copied, $skipped unchanged"
129
+ fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aether-colony",
3
- "version": "3.1.4",
3
+ "version": "3.1.15",
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
+