aether-colony 3.1.16 → 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.
Files changed (183) hide show
  1. package/{runtime → .aether}/CONTEXT.md +1 -1
  2. package/{runtime → .aether}/aether-utils.sh +2087 -142
  3. package/.aether/docs/QUEEN-SYSTEM.md +211 -0
  4. package/.aether/docs/QUEEN.md +84 -0
  5. package/.aether/docs/README.md +68 -0
  6. package/.aether/docs/caste-system.md +48 -0
  7. package/{runtime → .aether/docs/disciplines}/DISCIPLINES.md +8 -8
  8. package/.aether/docs/error-codes.md +268 -0
  9. package/{runtime → .aether}/docs/known-issues.md +42 -26
  10. package/.aether/docs/queen-commands.md +97 -0
  11. package/.aether/exchange/colony-registry.xml +11 -0
  12. package/{runtime → .aether}/exchange/pheromone-xml.sh +2 -1
  13. package/.aether/exchange/pheromones.xml +87 -0
  14. package/.aether/exchange/queen-wisdom.xml +14 -0
  15. package/{runtime → .aether}/exchange/registry-xml.sh +7 -3
  16. package/{runtime → .aether}/exchange/wisdom-xml.sh +11 -4
  17. package/.aether/rules/aether-colony.md +134 -0
  18. package/.aether/schemas/example-prompt-builder.xml +234 -0
  19. package/.aether/templates/colony-state-reset.jq.template +22 -0
  20. package/.aether/templates/colony-state.template.json +35 -0
  21. package/.aether/templates/constraints.template.json +9 -0
  22. package/.aether/templates/crowned-anthill.template.md +36 -0
  23. package/.aether/templates/handoff-build-error.template.md +30 -0
  24. package/.aether/templates/handoff-build-success.template.md +39 -0
  25. package/.aether/templates/handoff.template.md +40 -0
  26. package/{runtime → .aether}/utils/atomic-write.sh +5 -5
  27. package/{runtime → .aether}/utils/chamber-compare.sh +23 -10
  28. package/{runtime → .aether}/utils/chamber-utils.sh +32 -20
  29. package/{runtime → .aether}/utils/error-handler.sh +13 -1
  30. package/{runtime → .aether}/utils/file-lock.sh +49 -13
  31. package/.aether/utils/semantic-cli.sh +413 -0
  32. package/{runtime → .aether}/utils/xml-compose.sh +7 -1
  33. package/.aether/utils/xml-convert.sh +273 -0
  34. package/.aether/utils/xml-query.sh +201 -0
  35. package/.aether/utils/xml-utils.sh +110 -0
  36. package/{runtime → .aether}/workers.md +14 -17
  37. package/.claude/agents/ant/aether-ambassador.md +264 -0
  38. package/.claude/agents/ant/aether-archaeologist.md +322 -0
  39. package/.claude/agents/ant/aether-auditor.md +266 -0
  40. package/.claude/agents/ant/aether-builder.md +187 -0
  41. package/.claude/agents/ant/aether-chaos.md +268 -0
  42. package/.claude/agents/ant/aether-chronicler.md +304 -0
  43. package/.claude/agents/ant/aether-gatekeeper.md +325 -0
  44. package/.claude/agents/ant/aether-includer.md +373 -0
  45. package/.claude/agents/ant/aether-keeper.md +271 -0
  46. package/.claude/agents/ant/aether-measurer.md +317 -0
  47. package/.claude/agents/ant/aether-probe.md +210 -0
  48. package/.claude/agents/ant/aether-queen.md +325 -0
  49. package/.claude/agents/ant/aether-route-setter.md +173 -0
  50. package/.claude/agents/ant/aether-sage.md +353 -0
  51. package/.claude/agents/ant/aether-scout.md +142 -0
  52. package/.claude/agents/ant/aether-surveyor-disciplines.md +416 -0
  53. package/.claude/agents/ant/aether-surveyor-nest.md +354 -0
  54. package/.claude/agents/ant/aether-surveyor-pathogens.md +288 -0
  55. package/.claude/agents/ant/aether-surveyor-provisions.md +359 -0
  56. package/.claude/agents/ant/aether-tracker.md +265 -0
  57. package/.claude/agents/ant/aether-watcher.md +244 -0
  58. package/.claude/agents/ant/aether-weaver.md +247 -0
  59. package/.claude/commands/ant/archaeology.md +17 -8
  60. package/.claude/commands/ant/build.md +415 -284
  61. package/.claude/commands/ant/chaos.md +20 -11
  62. package/.claude/commands/ant/colonize.md +58 -24
  63. package/.claude/commands/ant/continue.md +155 -145
  64. package/.claude/commands/ant/council.md +15 -5
  65. package/.claude/commands/ant/dream.md +16 -7
  66. package/.claude/commands/ant/entomb.md +274 -157
  67. package/.claude/commands/ant/feedback.md +33 -29
  68. package/.claude/commands/ant/flag.md +18 -10
  69. package/.claude/commands/ant/flags.md +14 -6
  70. package/.claude/commands/ant/focus.md +29 -21
  71. package/.claude/commands/ant/help.md +11 -1
  72. package/.claude/commands/ant/history.md +10 -0
  73. package/.claude/commands/ant/init.md +91 -65
  74. package/.claude/commands/ant/interpret.md +15 -4
  75. package/.claude/commands/ant/lay-eggs.md +55 -7
  76. package/.claude/commands/ant/maturity.md +11 -1
  77. package/.claude/commands/ant/migrate-state.md +14 -2
  78. package/.claude/commands/ant/oracle.md +23 -15
  79. package/.claude/commands/ant/organize.md +29 -20
  80. package/.claude/commands/ant/pause-colony.md +17 -7
  81. package/.claude/commands/ant/phase.md +17 -8
  82. package/.claude/commands/ant/plan.md +20 -9
  83. package/.claude/commands/ant/redirect.md +29 -32
  84. package/.claude/commands/ant/resume-colony.md +19 -9
  85. package/.claude/commands/ant/resume.md +272 -96
  86. package/.claude/commands/ant/seal.md +201 -191
  87. package/.claude/commands/ant/status.md +71 -32
  88. package/.claude/commands/ant/swarm.md +26 -44
  89. package/.claude/commands/ant/tunnels.md +279 -105
  90. package/.claude/commands/ant/update.md +81 -20
  91. package/.claude/commands/ant/verify-castes.md +14 -4
  92. package/.claude/commands/ant/watch.md +13 -12
  93. package/.opencode/agents/aether-ambassador.md +63 -20
  94. package/.opencode/agents/aether-archaeologist.md +29 -12
  95. package/.opencode/agents/aether-auditor.md +51 -18
  96. package/.opencode/agents/aether-builder.md +69 -19
  97. package/.opencode/agents/aether-chaos.md +29 -12
  98. package/.opencode/agents/aether-chronicler.md +60 -18
  99. package/.opencode/agents/aether-gatekeeper.md +27 -18
  100. package/.opencode/agents/aether-includer.md +27 -18
  101. package/.opencode/agents/aether-keeper.md +89 -18
  102. package/.opencode/agents/aether-measurer.md +27 -18
  103. package/.opencode/agents/aether-probe.md +60 -18
  104. package/.opencode/agents/aether-queen.md +172 -24
  105. package/.opencode/agents/aether-route-setter.md +57 -12
  106. package/.opencode/agents/aether-sage.md +26 -18
  107. package/.opencode/agents/aether-scout.md +27 -19
  108. package/.opencode/agents/aether-surveyor-disciplines.md +53 -1
  109. package/.opencode/agents/aether-surveyor-nest.md +53 -1
  110. package/.opencode/agents/aether-surveyor-pathogens.md +51 -1
  111. package/.opencode/agents/aether-surveyor-provisions.md +53 -1
  112. package/.opencode/agents/aether-tracker.md +64 -18
  113. package/.opencode/agents/aether-watcher.md +66 -19
  114. package/.opencode/agents/aether-weaver.md +61 -18
  115. package/.opencode/commands/ant/build.md +406 -192
  116. package/.opencode/commands/ant/continue.md +66 -76
  117. package/.opencode/commands/ant/entomb.md +106 -45
  118. package/.opencode/commands/ant/init.md +46 -48
  119. package/.opencode/commands/ant/organize.md +5 -5
  120. package/.opencode/commands/ant/resume.md +334 -0
  121. package/.opencode/commands/ant/seal.md +33 -24
  122. package/.opencode/commands/ant/status.md +11 -0
  123. package/.opencode/commands/ant/tunnels.md +149 -0
  124. package/.opencode/commands/ant/update.md +59 -16
  125. package/CHANGELOG.md +79 -0
  126. package/README.md +135 -353
  127. package/bin/cli.js +243 -122
  128. package/bin/generate-commands.sh +2 -2
  129. package/bin/lib/init.js +13 -3
  130. package/bin/lib/update-transaction.js +119 -117
  131. package/bin/sync-to-runtime.sh +5 -137
  132. package/bin/validate-package.sh +84 -0
  133. package/package.json +9 -6
  134. package/.opencode/agents/aether-architect.md +0 -66
  135. package/.opencode/agents/aether-guardian.md +0 -107
  136. package/.opencode/agents/workers.md +0 -1034
  137. package/runtime/QUEEN_ANT_ARCHITECTURE.md +0 -402
  138. package/runtime/data/signatures.json +0 -41
  139. package/runtime/docs/AETHER-2.0-IMPLEMENTATION-PLAN.md +0 -1343
  140. package/runtime/docs/AETHER-PHEROMONE-SYSTEM-MASTER-SPEC.md +0 -2642
  141. package/runtime/docs/PHEROMONE-INJECTION.md +0 -240
  142. package/runtime/docs/PHEROMONE-INTEGRATION.md +0 -192
  143. package/runtime/docs/PHEROMONE-SYSTEM-DESIGN.md +0 -426
  144. package/runtime/docs/README.md +0 -94
  145. package/runtime/docs/VISUAL-OUTPUT-SPEC.md +0 -219
  146. package/runtime/docs/biological-reference.md +0 -272
  147. package/runtime/docs/codebase-review.md +0 -399
  148. package/runtime/docs/command-sync.md +0 -164
  149. package/runtime/docs/constraints.md +0 -116
  150. package/runtime/docs/implementation-learnings.md +0 -89
  151. package/runtime/docs/namespace.md +0 -148
  152. package/runtime/docs/pathogen-schema-example.json +0 -36
  153. package/runtime/docs/pathogen-schema.md +0 -111
  154. package/runtime/docs/planning-discipline.md +0 -159
  155. package/runtime/docs/progressive-disclosure.md +0 -184
  156. package/runtime/lib/queen-utils.sh +0 -729
  157. package/runtime/planning.md +0 -159
  158. package/runtime/recover.sh +0 -136
  159. package/runtime/utils/xml-utils.sh +0 -2196
  160. package/runtime/workers-new-castes.md +0 -516
  161. /package/{runtime → .aether/docs/disciplines}/coding-standards.md +0 -0
  162. /package/{runtime → .aether/docs/disciplines}/debugging.md +0 -0
  163. /package/{runtime → .aether/docs/disciplines}/learning.md +0 -0
  164. /package/{runtime → .aether/docs/disciplines}/tdd.md +0 -0
  165. /package/{runtime → .aether/docs/disciplines}/verification-loop.md +0 -0
  166. /package/{runtime → .aether/docs/disciplines}/verification.md +0 -0
  167. /package/{runtime → .aether}/docs/pheromones.md +0 -0
  168. /package/{runtime → .aether}/model-profiles.yaml +0 -0
  169. /package/{runtime → .aether}/schemas/aether-types.xsd +0 -0
  170. /package/{runtime → .aether}/schemas/colony-registry.xsd +0 -0
  171. /package/{runtime → .aether}/schemas/pheromone.xsd +0 -0
  172. /package/{runtime → .aether}/schemas/prompt.xsd +0 -0
  173. /package/{runtime → .aether}/schemas/queen-wisdom.xsd +0 -0
  174. /package/{runtime → .aether}/schemas/worker-priming.xsd +0 -0
  175. /package/{runtime → .aether}/templates/QUEEN.md.template +0 -0
  176. /package/{runtime → .aether}/utils/colorize-log.sh +0 -0
  177. /package/{runtime → .aether}/utils/queen-to-md.xsl +0 -0
  178. /package/{runtime → .aether}/utils/spawn-tree.sh +0 -0
  179. /package/{runtime → .aether}/utils/spawn-with-model.sh +0 -0
  180. /package/{runtime → .aether}/utils/state-loader.sh +0 -0
  181. /package/{runtime → .aether}/utils/swarm-display.sh +0 -0
  182. /package/{runtime → .aether}/utils/watch-spawn-tree.sh +0 -0
  183. /package/{runtime → .aether}/utils/xml-core.sh +0 -0
@@ -1,89 +0,0 @@
1
- # Implementation Learnings
2
-
3
- Valuable findings from Aether v3.1 development that apply to other projects.
4
-
5
- ## Workflow Patterns
6
-
7
- 1. **Claude Code global sync** works by copying commands from `.claude/commands/` to `~/.claude/commands/`
8
- - This enables sharing commands across all projects
9
- - Source of truth is the repo, hub is the distribution mechanism
10
-
11
- 2. **OpenCode requires repo-local setup**
12
- - Each repo that wants ant commands must set them up locally
13
- - Unlike Claude Code, there's no global command directory
14
-
15
- 3. **Hash comparison prevents unnecessary file writes**
16
- - Comparing SHA-1 hashes before writes preserves file timestamps
17
- - Reduces git noise from unchanged files
18
-
19
- 4. **Namespace isolation via 'ant:' prefix**
20
- - Prevents collisions with other agents
21
- - Creates clear command ownership
22
-
23
- 5. **CLI sync verification catches content drift**
24
- - `generate-commands.sh check` uses SHA-1 checksums
25
- - Detects when .claude/ and .opencode/ mirrors diverge
26
-
27
- ## Error Handling Patterns
28
-
29
- - Use `json_err "$E_*" "message"` consistently (not bare strings)
30
- - Always release locks in error paths (use trap or explicit release)
31
- - Validate JSON before atomic writes
32
- - Use fallback json_err for backward compatibility
33
-
34
- ## File Operation Patterns
35
-
36
- - Use `atomic_write()` for all state modifications
37
- - Acquire locks before reading/writing shared state
38
- - Create backups BEFORE validation for true atomicity
39
- - Use temp file + mv pattern for atomic operations
40
-
41
- ## Model Routing Patterns
42
-
43
- - Validate LiteLLM proxy health before spawning
44
- - Support CLI --model override for one-time changes
45
- - Log actual model used per spawn for telemetry
46
- - Use task-based routing keywords for automatic selection
47
-
48
- ## Codebase Patterns Discovered
49
-
50
- ### Pattern 1: JSON Error Response Standard
51
- All commands output JSON with `{"ok": true/false, "result": ...}` or `{"ok": false, "error": ...}`
52
-
53
- ### Pattern 2: Feature Degradation Pattern
54
- ```bash
55
- if type feature_enabled &>/dev/null && ! feature_enabled "file_locking"; then
56
- json_warn "W_DEGRADED" "File locking disabled - proceeding without lock"
57
- else
58
- acquire_lock ...
59
- fi
60
- ```
61
-
62
- ### Pattern 3: Atomic Write Pattern
63
- All state modifications use `atomic_write()` from atomic-write.sh (temp file + mv)
64
-
65
- ### Pattern 4: Trap-based Cleanup
66
- file-lock.sh uses `trap cleanup_locks EXIT TERM INT` for lock cleanup
67
-
68
- ### Pattern 5: Inconsistent Error Code Evolution
69
- Commands added early use hardcoded strings; commands added later use `$E_VALIDATION_FAILED` constant. This creates inconsistency that should be standardized.
70
-
71
- ## Connections Between Issues
72
-
73
- 1. **BUG-005** (flag-auto-resolve lock leak) and **BUG-002** (flag-add lock leak) share the same root cause: inconsistent error handling patterns
74
- 2. **BUG-004** and **ISSUE-001** are the same issue: missing error code constants
75
- 3. **ISSUE-004** (template path) affects **GAP-006** (missing docs) - both relate to queen-* command usability
76
- 4. **BUG-001** (awk apostrophes) affects the same lines that use Pattern 2 (feature degradation)
77
-
78
- ## Fix Priority Matrix
79
-
80
- | Priority | Issues | Effort | Impact |
81
- |----------|--------|--------|--------|
82
- | Critical | BUG-005, BUG-011 | Low | Deadlock prevention |
83
- | High | BUG-002, BUG-008 | Low | Lock safety |
84
- | Medium | BUG-003, BUG-006, BUG-007 | Medium | Code quality |
85
- | Low | ISSUE-001 through ISSUE-007 | Medium | Consistency |
86
-
87
- ---
88
-
89
- *Preserved from Phase 0 cleanup - 2026-02-15*
@@ -1,148 +0,0 @@
1
- # Namespace Distinctiveness -- Command System
2
-
3
- This document explains how Aether's command namespace (`ant`) is distinct from other agent namespaces in the global Claude Code configuration, ensuring bulletproof isolation and preventing command collisions.
4
-
5
- ---
6
-
7
- ## Overview
8
-
9
- Aether uses a directory-based command namespace system that is distinct from other agent systems. The namespace is designed to be bulletproof against collisions with other agent frameworks.
10
-
11
- ---
12
-
13
- ## Existing Agent Namespaces
14
-
15
- The global Claude Code commands directory (`~/.claude/commands/`) contains multiple agent namespaces:
16
-
17
- | Namespace | Type | Location | Example Commands |
18
- |-----------|------|----------|-------------------|
19
- | `ant` | Directory | `ant/` | `/ant:build`, `/ant:plan`, `/ant:focus` |
20
- | `cds` | Directory | `cds/` | `/cds:new-project`, `/cds:execute-phase` |
21
- | `mds` | Directory | `mds/` | `/mds:build`, `/mds:plan`, `/mds:test` |
22
- | `st:` | Prefix | Root files | `/st:caption`, `/st:research` |
23
-
24
- ---
25
-
26
- ## How Commands Are Invoked
27
-
28
- ### Claude Code (Slash Commands)
29
-
30
- Claude Code uses a slash-based command syntax with namespace prefixing:
31
-
32
- ```
33
- /ant:build 1 # Aether build command
34
- /ant:focus "auth" # Aether focus command
35
- /ant:plan # Aether plan command
36
-
37
- /cds:new-project "myapp" # Claude Development System
38
- /mds:build # MDS system
39
- /st:caption "image.png" # ST system (prefix in filename)
40
- ```
41
-
42
- **Format:** `/<namespace>:<command> <arguments>`
43
-
44
- ### OpenCode
45
-
46
- OpenCode uses a different syntax with namespace prefixes:
47
-
48
- ```
49
- mds:ant:build 1 # Build using Aether in OpenCode
50
- mds:cds:new-project myapp # CDS in OpenCode
51
- ```
52
-
53
- **Format:** `<tool>:<namespace>:<command> <arguments>`
54
-
55
- ---
56
-
57
- ## Why 'ant' Won't Collide
58
-
59
- ### 1. Directory-Based Isolation
60
-
61
- The `ant` namespace is stored in a dedicated directory (`~/.claude/commands/ant/`). This provides:
62
-
63
- - **Physical separation**: Files exist in a distinct directory, not mixed with other commands
64
- - **Clear ownership**: The `ant/` directory is explicitly owned by Aether
65
- - **No filename conflicts**: Each command is a separate file in the `ant/` subdirectory
66
-
67
- ### 2. Unique Naming Convention
68
-
69
- Aether commands use biological/colony metaphors that don't overlap with other systems:
70
-
71
- | Aether Commands | Other Systems |
72
- |-----------------|---------------|
73
- | `/ant:build` | `/cds:execute-phase` |
74
- | `/ant:plan` | `/mds:plan` |
75
- | `/ant:focus` | `/st:research` |
76
- | `/ant:colonize` | `/cds:new-milestone` |
77
-
78
- **Key distinction:** The `ant:` prefix is unique to Aether. No other agent system uses this prefix.
79
-
80
- ### 3. File Extension Pattern
81
-
82
- Aether commands are `.md` files within the `ant/` directory:
83
-
84
- ```
85
- .claude/commands/ant/build.md # Invoked as /ant:build
86
- .claude/commands/ant/plan.md # Invoked as /ant:plan
87
- .claude/commands/ant/focus.md # Invoked as /ant:focus
88
- ```
89
-
90
- This is distinct from:
91
- - `st:*` commands which use prefixes in filenames (e.g., `st:caption.md`)
92
- - Root-level commands which have no namespace prefix (e.g., `create-prompt.md`)
93
-
94
- ### 4. Sync Mechanism Provides Safety
95
-
96
- The Aether CLI (`bin/cli.js`) implements hash-based idempotent sync:
97
-
98
- - **Source**: `.claude/commands/ant/` in the package
99
- - **Destination**: `~/.aether/commands/claude/` (hub) and `~/.claude/commands/ant/` (global)
100
- - **Behavior**: Files are only copied when content changes (hash comparison)
101
- - **Cleanup**: Stale files are automatically removed
102
-
103
- This ensures:
104
- - Local modifications are preserved
105
- - Only Aether-owned files exist in the `ant/` directory
106
- - No cross-contamination from other namespaces
107
-
108
- ---
109
-
110
- ## Collision Prevention Checklist
111
-
112
- When adding new commands to Aether, verify:
113
-
114
- - [ ] Command file is in `.claude/commands/ant/` directory
115
- - [ ] Filename uses lowercase alphanumeric with hyphens (e.g., `build.md`)
116
- - [ ] Frontmatter uses `ant:` prefix (e.g., `name: ant:build`)
117
- - [ ] No naming overlap with existing commands in `cds/`, `mds/`, or root
118
-
119
- ---
120
-
121
- ## Command Count
122
-
123
- | Namespace | Command Count | Files |
124
- |-----------|---------------|-------|
125
- | `ant` | 29 commands | `ant/*.md` |
126
- | `cds` | 20 commands | `cds/*.md` |
127
- | `mds` | 19 commands | `mds/*.md` |
128
- | `st:` | 13 commands | `st:*.md` |
129
-
130
- ---
131
-
132
- ## Best Practices
133
-
134
- 1. **Never modify commands outside the `ant/` directory** - This maintains clear ownership
135
- 2. **Use the sync mechanism** - Let `aether-cli` handle global distribution
136
- 3. **Follow naming conventions** - Use lowercase, hyphens, biological metaphors
137
- 4. **Keep commands atomic** - Each command should do one thing well
138
-
139
- ---
140
-
141
- ## Summary
142
-
143
- The `ant` namespace is bulletproof because:
144
-
145
- 1. **Directory isolation** - Commands live in `~/.claude/commands/ant/`, separate from other namespaces
146
- 2. **Unique prefix** - `/ant:` is exclusively used by Aether
147
- 3. **Hash-based sync** - Idempotent updates prevent drift and contamination
148
- 4. **Clear ownership** - No other system uses the `ant` prefix or directory
@@ -1,36 +0,0 @@
1
- {
2
- "pathogens": [
3
- {
4
- "name": "unchecked_error_return",
5
- "description": "Function return value not checked for error condition",
6
- "severity": "critical",
7
- "first_seen": "2026-02-11T12:00:00Z",
8
- "last_seen": "2026-02-11T14:30:00Z",
9
- "occurrences": 5,
10
- "projects": ["Aether"],
11
- "resolved": false,
12
- "signature_type": "fuzzy",
13
- "pattern_string": "\\|\\| true$",
14
- "confidence_threshold": 0.9,
15
- "escalation_level": "swarm"
16
- },
17
- {
18
- "name": "hardcoded_path",
19
- "description": "Absolute path hardcoded instead of using variable",
20
- "severity": "warning",
21
- "first_seen": "2026-02-11T12:00:00Z",
22
- "last_seen": "2026-02-11T12:00:00Z",
23
- "occurrences": 1,
24
- "projects": ["Aether"],
25
- "resolved": false,
26
- "signature_type": "exact",
27
- "pattern_string": "/Users/",
28
- "confidence_threshold": 0.5,
29
- "escalation_level": "log"
30
- }
31
- ],
32
- "metadata": {
33
- "version": "1.0",
34
- "last_updated": "2026-02-11T14:30:00Z"
35
- }
36
- }
@@ -1,111 +0,0 @@
1
- # Pathogen Signature Schema
2
-
3
- ## Overview
4
-
5
- Pathogen signatures extend the existing error pattern format (`.aether/error-patterns.json`) with fields for automated detection and escalation. The schema is backward-compatible: existing jq queries on core fields (`name`, `description`, `severity`, `occurrences`, etc.) work unchanged on pathogen entries.
6
-
7
- ## Storage
8
-
9
- - **File:** `.aether/data/pathogens.json` (project-local)
10
- - **Format:** JSON, jq-compatible
11
- - **Relationship:** Extends `error-patterns.json` field set; stored separately to avoid polluting global pattern data
12
-
13
- ## Schema
14
-
15
- ### Root Object
16
-
17
- | Field | Type | Description |
18
- |-------|------|-------------|
19
- | `pathogens` | array | Array of pathogen signature objects |
20
- | `metadata` | object | File-level metadata |
21
-
22
- ### Metadata Object
23
-
24
- | Field | Type | Description |
25
- |-------|------|-------------|
26
- | `version` | string | Schema version (currently `"1.0"`) |
27
- | `last_updated` | string\|null | ISO 8601 UTC timestamp of last modification |
28
-
29
- ### Pathogen Signature Object
30
-
31
- #### Inherited Fields (from error-patterns format)
32
-
33
- These fields match the existing `error-patterns.json` schema exactly. Any jq query that works on error patterns will work on pathogen entries.
34
-
35
- | Field | Type | Description |
36
- |-------|------|-------------|
37
- | `name` | string | Unique identifier for the pathogen |
38
- | `description` | string | Human-readable description |
39
- | `severity` | string | `"warning"` \| `"critical"` |
40
- | `first_seen` | string | ISO 8601 UTC timestamp |
41
- | `last_seen` | string | ISO 8601 UTC timestamp |
42
- | `occurrences` | number | Count of times detected |
43
- | `projects` | array[string] | Project names where detected |
44
- | `resolved` | boolean | Whether the pathogen has been resolved |
45
-
46
- #### New Fields (pathogen-specific)
47
-
48
- | Field | Type | Description |
49
- |-------|------|-------------|
50
- | `signature_type` | string | `"exact"` \| `"fuzzy"` — matching strategy |
51
- | `pattern_string` | string | The literal string or regex to match against |
52
- | `confidence_threshold` | number | Float 0.0–1.0, minimum confidence for a match |
53
- | `escalation_level` | string | `"log"` \| `"elevated"` \| `"swarm"` — response tier |
54
-
55
- ## Escalation Thresholds (Hardcoded)
56
-
57
- | Confidence | Escalation Level | Action |
58
- |------------|-----------------|--------|
59
- | >= 0.9 | `"swarm"` | Immediate swarm response |
60
- | 0.7–0.89 | `"elevated"` | Elevated scrutiny |
61
- | < 0.7 | `"log"` | Log only |
62
-
63
- ## Backward Compatibility
64
-
65
- ### Existing queries that still work
66
-
67
- ```bash
68
- # Select by name (works on both error patterns and pathogens)
69
- jq '.pathogens[] | select(.name == "some_name")' pathogens.json
70
-
71
- # Filter by severity
72
- jq '.pathogens[] | select(.severity == "critical")' pathogens.json
73
-
74
- # Filter recurring (2+ occurrences, unresolved)
75
- jq '[.pathogens[] | select(.occurrences >= 2 and .resolved == false)]' pathogens.json
76
-
77
- # Get all names
78
- jq '[.pathogens[].name]' pathogens.json
79
- ```
80
-
81
- ### New queries for pathogen-specific fields
82
-
83
- ```bash
84
- # Filter by confidence threshold
85
- jq '.pathogens[] | select(.confidence_threshold >= 0.7)' pathogens.json
86
-
87
- # Get all exact-match pathogens
88
- jq '[.pathogens[] | select(.signature_type == "exact")]' pathogens.json
89
-
90
- # Get pathogens requiring swarm escalation
91
- jq '[.pathogens[] | select(.escalation_level == "swarm")]' pathogens.json
92
-
93
- # Search for a specific pattern string
94
- jq --arg pat "error_string" '.pathogens[] | select(.pattern_string == $pat)' pathogens.json
95
- ```
96
-
97
- ## Validation
98
-
99
- Validate the file structure:
100
-
101
- ```bash
102
- # Check file is valid JSON
103
- jq empty pathogens.json
104
-
105
- # Verify required fields exist on all entries
106
- jq '.pathogens[] | has("name", "signature_type", "pattern_string", "confidence_threshold", "escalation_level")' pathogens.json
107
-
108
- # Verify confidence is in range
109
- jq '.pathogens[] | select(.confidence_threshold < 0 or .confidence_threshold > 1)' pathogens.json
110
- # (should return empty if all valid)
111
- ```
@@ -1,159 +0,0 @@
1
- # Planning Discipline
2
-
3
- ## Purpose
4
-
5
- Write comprehensive implementation plans with bite-sized tasks, assuming workers have zero context. Each task should be one action (2-5 minutes of work).
6
-
7
- ## Core Principles
8
-
9
- - **DRY** - Don't Repeat Yourself
10
- - **YAGNI** - You Aren't Gonna Need It
11
- - **TDD** - Test-Driven Development (test first, always)
12
- - **Frequent Commits** - One commit per feature/fix
13
-
14
- ## Bite-Sized Task Granularity
15
-
16
- **Each step is ONE action:**
17
-
18
- ```
19
- "Write the failing test" - step
20
- "Run it to make sure it fails" - step
21
- "Implement the minimal code to make the test pass" - step
22
- "Run the tests and make sure they pass" - step
23
- "Commit" - step
24
- ```
25
-
26
- **NOT acceptable:**
27
- - "Implement authentication with tests" (too big)
28
- - "Add validation" (too vague)
29
- - "Set up the project" (needs breakdown)
30
-
31
- ## Task Structure
32
-
33
- Each task should include:
34
-
35
- ### 1. Files Section
36
-
37
- ```markdown
38
- **Files:**
39
- - Create: `exact/path/to/file.py`
40
- - Modify: `exact/path/to/existing.py:123-145`
41
- - Test: `tests/exact/path/to/test.py`
42
- ```
43
-
44
- Always use exact paths. No "somewhere in src/" ambiguity.
45
-
46
- ### 2. Steps with TDD Flow
47
-
48
- ```markdown
49
- **Step 1: Write the failing test**
50
-
51
- \`\`\`python
52
- def test_specific_behavior():
53
- result = function(input)
54
- assert result == expected
55
- \`\`\`
56
-
57
- **Step 2: Run test to verify it fails**
58
-
59
- Run: `pytest tests/path/test.py::test_name -v`
60
- Expected: FAIL with "function not defined"
61
-
62
- **Step 3: Write minimal implementation**
63
-
64
- \`\`\`python
65
- def function(input):
66
- return expected
67
- \`\`\`
68
-
69
- **Step 4: Run test to verify it passes**
70
-
71
- Run: `pytest tests/path/test.py::test_name -v`
72
- Expected: PASS
73
-
74
- **Step 5: Commit**
75
-
76
- \`\`\`bash
77
- git add tests/path/test.py src/path/file.py
78
- git commit -m "feat: add specific feature"
79
- \`\`\`
80
- ```
81
-
82
- ### 3. Expected Output
83
-
84
- For every command, specify expected output:
85
-
86
- ```markdown
87
- Run: `npm test`
88
- Expected: 47 passing, 0 failing
89
- ```
90
-
91
- Not just "run tests" - specify what success looks like.
92
-
93
- ## Phase Structure
94
-
95
- ```markdown
96
- ### Phase N: [Component Name]
97
-
98
- **Goal:** [One sentence describing what this phase achieves]
99
-
100
- **Dependencies:** [What must exist before this phase]
101
-
102
- **Tasks:**
103
-
104
- #### Task N.1: [Specific action]
105
-
106
- **Files:**
107
- - Create: `src/components/Button.tsx`
108
- - Test: `tests/components/Button.test.tsx`
109
-
110
- **Steps:**
111
- (TDD steps as above)
112
-
113
- **Success Criteria:**
114
- - Tests pass for Button component
115
- - Component renders without errors
116
- ```
117
-
118
- ## Quality Checks
119
-
120
- Before a plan is complete, verify:
121
-
122
- 1. **Exact paths** - Every file reference is complete path
123
- 2. **Complete code** - No "add appropriate code" placeholders
124
- 3. **Expected outputs** - Every command has expected result
125
- 4. **TDD flow** - Test before implementation for each feature
126
- 5. **No assumptions** - Worker could execute with zero context
127
- 6. **Commit points** - Clear where to commit
128
-
129
- ## Integration with Colony
130
-
131
- The Route-Setter Ant follows this discipline when generating plans.
132
-
133
- Each task in `plan.phases[N].tasks` should be:
134
- - Executable in 2-5 minutes
135
- - Self-contained with file paths
136
- - Verifiable with specific success criteria
137
-
138
- ## Red Flags
139
-
140
- **Never in a plan:**
141
- - "Add tests" (which tests? for what?)
142
- - "Implement feature" (what specifically?)
143
- - "Update file" (which file? what changes?)
144
- - "Handle edge cases" (which cases?)
145
-
146
- **Always in a plan:**
147
- - Exact file paths
148
- - Complete code snippets
149
- - Exact commands to run
150
- - Expected outputs/results
151
- - One action per step
152
-
153
- ## Why This Matters
154
-
155
- - Workers can execute without asking questions
156
- - Progress is measurable (step by step)
157
- - Debugging is easier (clear steps to trace)
158
- - Commits are atomic and meaningful
159
- - Quality is built in (TDD from start)