pgserve 2.1.3 → 2.2.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 (228) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +105 -1
  3. package/bin/autopg-wrapper.cjs +16 -0
  4. package/bin/pgserve-wrapper.cjs +31 -6
  5. package/bin/postgres-server.js +56 -0
  6. package/console/README.md +131 -0
  7. package/console/api.js +173 -0
  8. package/console/app.jsx +483 -0
  9. package/console/colors_and_type.css +227 -0
  10. package/console/components.jsx +167 -0
  11. package/console/console.css +1666 -0
  12. package/console/data.jsx +350 -0
  13. package/console/index.html +31 -0
  14. package/console/screens/databases.jsx +5 -0
  15. package/console/screens/health.jsx +5 -0
  16. package/console/screens/ingress.jsx +5 -0
  17. package/console/screens/optimizer.jsx +5 -0
  18. package/console/screens/rlm-sim.jsx +5 -0
  19. package/console/screens/rlm-trace.jsx +5 -0
  20. package/console/screens/security.jsx +5 -0
  21. package/console/screens/settings.jsx +611 -0
  22. package/console/screens/sql.jsx +5 -0
  23. package/console/screens/sync.jsx +5 -0
  24. package/console/screens/tables.jsx +5 -0
  25. package/console/tweaks-panel.jsx +425 -0
  26. package/package.json +11 -1
  27. package/src/cli-config.cjs +310 -0
  28. package/src/cli-install.cjs +98 -11
  29. package/src/cli-restart.cjs +228 -0
  30. package/src/cli-ui.cjs +580 -0
  31. package/src/cluster.js +43 -38
  32. package/src/postgres.js +141 -19
  33. package/src/settings-loader.cjs +235 -0
  34. package/src/settings-migrate.cjs +212 -0
  35. package/src/settings-pg-args.cjs +146 -0
  36. package/src/settings-schema.cjs +422 -0
  37. package/src/settings-validator.cjs +416 -0
  38. package/src/settings-writer.cjs +288 -0
  39. package/.claude/context/windows-debug.md +0 -119
  40. package/.genie/AGENTS.md +0 -15
  41. package/.genie/agents/README.md +0 -110
  42. package/.genie/agents/analyze.md +0 -176
  43. package/.genie/agents/forge.md +0 -290
  44. package/.genie/agents/garbage-cleaner.md +0 -324
  45. package/.genie/agents/garbage-collector.md +0 -596
  46. package/.genie/agents/github-issue-gc.md +0 -618
  47. package/.genie/agents/review.md +0 -380
  48. package/.genie/agents/semantic-analyzer/find-duplicates.md +0 -90
  49. package/.genie/agents/semantic-analyzer/find-orphans.md +0 -99
  50. package/.genie/agents/semantic-analyzer.md +0 -101
  51. package/.genie/agents/update.md +0 -182
  52. package/.genie/agents/wish.md +0 -357
  53. package/.genie/brainstorms/pgserve-v2/DESIGN.md +0 -174
  54. package/.genie/code/AGENTS.md +0 -694
  55. package/.genie/code/agents/audit/risk.md +0 -173
  56. package/.genie/code/agents/audit/security.md +0 -189
  57. package/.genie/code/agents/audit.md +0 -145
  58. package/.genie/code/agents/challenge.md +0 -230
  59. package/.genie/code/agents/change-reviewer.md +0 -295
  60. package/.genie/code/agents/code-garbage-collector.md +0 -425
  61. package/.genie/code/agents/code-quality.md +0 -410
  62. package/.genie/code/agents/commit-suggester.md +0 -255
  63. package/.genie/code/agents/commit.md +0 -124
  64. package/.genie/code/agents/consensus.md +0 -204
  65. package/.genie/code/agents/daily-standup.md +0 -722
  66. package/.genie/code/agents/docgen.md +0 -48
  67. package/.genie/code/agents/explore.md +0 -79
  68. package/.genie/code/agents/fix.md +0 -100
  69. package/.genie/code/agents/git/commit-advisory.md +0 -219
  70. package/.genie/code/agents/git/workflows/issue.md +0 -244
  71. package/.genie/code/agents/git/workflows/pr.md +0 -179
  72. package/.genie/code/agents/git/workflows/release.md +0 -460
  73. package/.genie/code/agents/git/workflows/report.md +0 -342
  74. package/.genie/code/agents/git.md +0 -432
  75. package/.genie/code/agents/implementor.md +0 -161
  76. package/.genie/code/agents/install.md +0 -515
  77. package/.genie/code/agents/issue-creator.md +0 -344
  78. package/.genie/code/agents/polish.md +0 -116
  79. package/.genie/code/agents/qa.md +0 -653
  80. package/.genie/code/agents/refactor.md +0 -294
  81. package/.genie/code/agents/release.md +0 -1129
  82. package/.genie/code/agents/roadmap.md +0 -885
  83. package/.genie/code/agents/tests.md +0 -557
  84. package/.genie/code/agents/tracer.md +0 -50
  85. package/.genie/code/agents/update/upstream-update.md +0 -85
  86. package/.genie/code/agents/update/versions/generic-update.md +0 -305
  87. package/.genie/code/agents/vibe.md +0 -1317
  88. package/.genie/code/spells/agent-configuration.md +0 -58
  89. package/.genie/code/spells/automated-rc-publishing.md +0 -106
  90. package/.genie/code/spells/branch-tracker-guidance.md +0 -28
  91. package/.genie/code/spells/debug.md +0 -320
  92. package/.genie/code/spells/emoji-naming-convention.md +0 -303
  93. package/.genie/code/spells/evidence-storage.md +0 -26
  94. package/.genie/code/spells/file-naming-rules.md +0 -35
  95. package/.genie/code/spells/forge-code-blueprints.md +0 -195
  96. package/.genie/code/spells/genie-integration.md +0 -153
  97. package/.genie/code/spells/publishing-protocol.md +0 -61
  98. package/.genie/code/spells/team-consultation-protocol.md +0 -284
  99. package/.genie/code/spells/tool-requirements.md +0 -20
  100. package/.genie/code/spells/triad-maintenance-protocol.md +0 -154
  101. package/.genie/code/teams/tech-council/council.md +0 -328
  102. package/.genie/code/teams/tech-council/jt.md +0 -352
  103. package/.genie/code/teams/tech-council/nayr.md +0 -305
  104. package/.genie/code/teams/tech-council/oettam.md +0 -375
  105. package/.genie/neurons/README.md +0 -193
  106. package/.genie/neurons/forge.md +0 -106
  107. package/.genie/neurons/genie.md +0 -63
  108. package/.genie/neurons/review.md +0 -106
  109. package/.genie/neurons/wish.md +0 -104
  110. package/.genie/product/README.md +0 -20
  111. package/.genie/product/cli-automation.md +0 -359
  112. package/.genie/product/environment.md +0 -60
  113. package/.genie/product/mission.md +0 -60
  114. package/.genie/product/roadmap.md +0 -44
  115. package/.genie/product/tech-stack.md +0 -34
  116. package/.genie/product/templates/context-template.md +0 -218
  117. package/.genie/product/templates/qa-done-report-template.md +0 -68
  118. package/.genie/product/templates/review-report-template.md +0 -89
  119. package/.genie/product/templates/wish-template.md +0 -120
  120. package/.genie/scripts/helpers/analyze-commit.js +0 -195
  121. package/.genie/scripts/helpers/bullet-counter.js +0 -194
  122. package/.genie/scripts/helpers/bullet-find.js +0 -289
  123. package/.genie/scripts/helpers/bullet-id.js +0 -244
  124. package/.genie/scripts/helpers/check-secrets.js +0 -237
  125. package/.genie/scripts/helpers/count-tokens.js +0 -200
  126. package/.genie/scripts/helpers/create-frontmatter.js +0 -456
  127. package/.genie/scripts/helpers/detect-markers.js +0 -293
  128. package/.genie/scripts/helpers/detect-todos.js +0 -267
  129. package/.genie/scripts/helpers/detect-unlabeled-blocks.js +0 -135
  130. package/.genie/scripts/helpers/embeddings.js +0 -344
  131. package/.genie/scripts/helpers/find-empty-sections.js +0 -158
  132. package/.genie/scripts/helpers/index.js +0 -319
  133. package/.genie/scripts/helpers/validate-frontmatter.js +0 -578
  134. package/.genie/scripts/helpers/validate-links.js +0 -207
  135. package/.genie/scripts/helpers/validate-paths.js +0 -373
  136. package/.genie/spells/README.md +0 -9
  137. package/.genie/spells/ace-protocol.md +0 -118
  138. package/.genie/spells/ask-one-at-a-time.md +0 -175
  139. package/.genie/spells/backup-analyzer.md +0 -542
  140. package/.genie/spells/blocker.md +0 -12
  141. package/.genie/spells/break-things-move-fast.md +0 -56
  142. package/.genie/spells/context-candidates.md +0 -72
  143. package/.genie/spells/context-critic.md +0 -51
  144. package/.genie/spells/defer-to-expertise.md +0 -278
  145. package/.genie/spells/delegate-dont-do.md +0 -292
  146. package/.genie/spells/error-investigation-protocol.md +0 -328
  147. package/.genie/spells/evidence-based-completion.md +0 -273
  148. package/.genie/spells/experiment.md +0 -65
  149. package/.genie/spells/file-creation-protocol.md +0 -229
  150. package/.genie/spells/forge-integration.md +0 -281
  151. package/.genie/spells/forge-orchestration.md +0 -514
  152. package/.genie/spells/gather-context.md +0 -18
  153. package/.genie/spells/global-health-check.md +0 -34
  154. package/.genie/spells/global-noop-roundtrip.md +0 -25
  155. package/.genie/spells/install-genie.md +0 -1232
  156. package/.genie/spells/install.md +0 -82
  157. package/.genie/spells/investigate-before-commit.md +0 -112
  158. package/.genie/spells/know-yourself.md +0 -288
  159. package/.genie/spells/learn.md +0 -828
  160. package/.genie/spells/mcp-diagnostic-protocol.md +0 -246
  161. package/.genie/spells/mcp-first.md +0 -124
  162. package/.genie/spells/multi-step-execution.md +0 -67
  163. package/.genie/spells/orchestration-boundary-protocol.md +0 -256
  164. package/.genie/spells/orchestrator-not-implementor.md +0 -189
  165. package/.genie/spells/prompt.md +0 -746
  166. package/.genie/spells/reflect.md +0 -404
  167. package/.genie/spells/routing-decision-matrix.md +0 -368
  168. package/.genie/spells/run-in-parallel.md +0 -12
  169. package/.genie/spells/session-state-updater-example.md +0 -196
  170. package/.genie/spells/session-state-updater.md +0 -220
  171. package/.genie/spells/track-long-running-tasks.md +0 -133
  172. package/.genie/spells/troubleshoot-infrastructure.md +0 -176
  173. package/.genie/spells/upgrade-genie.md +0 -415
  174. package/.genie/spells/url-presentation-protocol.md +0 -301
  175. package/.genie/spells/wish-initiation.md +0 -158
  176. package/.genie/spells/wish-issue-linkage.md +0 -410
  177. package/.genie/spells/wish-lifecycle.md +0 -100
  178. package/.genie/state/provider-status.json +0 -3
  179. package/.genie/state/version.json +0 -16
  180. package/.genie/wishes/canonical-pgserve-pm2-supervision/WISH.md +0 -290
  181. package/.genie/wishes/pgserve-v2/BRIEF-from-genie-pgserve.md +0 -99
  182. package/.genie/wishes/pgserve-v2/WISH.md +0 -442
  183. package/.genie/wishes/release-system-genie-pattern/WISH.md +0 -268
  184. package/.genie/wishes/release-system-genie-pattern/validation.md +0 -205
  185. package/.gitguardian.yaml +0 -29
  186. package/.gitguardianignore +0 -16
  187. package/.github/workflows/ci.yml +0 -122
  188. package/.github/workflows/release.yml +0 -289
  189. package/.github/workflows/version.yml +0 -228
  190. package/.husky/pre-commit +0 -2
  191. package/AGENTS.md +0 -433
  192. package/CLAUDE.md +0 -1
  193. package/Makefile +0 -285
  194. package/assets/icon.ico +0 -0
  195. package/bun.lock +0 -435
  196. package/bunfig.toml +0 -28
  197. package/ecosystem.config.cjs +0 -23
  198. package/eslint.config.js +0 -63
  199. package/examples/multi-tenant-demo.js +0 -104
  200. package/install.sh +0 -123
  201. package/knip.json +0 -9
  202. package/scripts/test-bun-self-heal.sh +0 -163
  203. package/scripts/test-npx.sh +0 -60
  204. package/tests/audit.test.js +0 -189
  205. package/tests/backpressure.test.js +0 -167
  206. package/tests/benchmarks/runner.js +0 -1197
  207. package/tests/benchmarks/vector-generator.js +0 -368
  208. package/tests/cli-install.test.js +0 -322
  209. package/tests/control-db.test.js +0 -285
  210. package/tests/daemon-args.test.js +0 -86
  211. package/tests/daemon-control.test.js +0 -171
  212. package/tests/daemon-fingerprint-integration.test.js +0 -111
  213. package/tests/daemon-pr24-regression.test.js +0 -198
  214. package/tests/fingerprint.test.js +0 -263
  215. package/tests/fixtures/240-orphan-seed.sql +0 -30
  216. package/tests/multi-tenant.test.js +0 -374
  217. package/tests/orphan-cleanup.test.js +0 -390
  218. package/tests/pg-version-regex.test.js +0 -129
  219. package/tests/quick-bench.js +0 -135
  220. package/tests/router-handshake-retry.test.js +0 -119
  221. package/tests/router-handshake-watchdog.test.js +0 -110
  222. package/tests/sdk.test.js +0 -71
  223. package/tests/stale-postmaster-pid.test.js +0 -85
  224. package/tests/stress-test.js +0 -439
  225. package/tests/sync-perf-test.js +0 -150
  226. package/tests/tcp-listen.test.js +0 -368
  227. package/tests/tenancy.test.js +0 -403
  228. package/tests/wrapper-supervision.test.js +0 -107
@@ -1,193 +0,0 @@
1
- # Genie Neuron Architecture
2
-
3
- ## What are Neurons?
4
-
5
- **Neurons are NOT agents. They are live socket sessions - like electricity sparks.**
6
-
7
- Traditional agents use task-based communication (create task → wait → check status).
8
- Neurons use real-time streaming communication (connect to WebSocket → receive thoughts as they happen).
9
-
10
- ## Architecture
11
-
12
- ### Neuron Provider (`src/mcp/resources/neuron-provider.ts`)
13
-
14
- Central EventEmitter-based provider that manages real-time WebSocket connections to Forge neurons.
15
-
16
- **Key Features:**
17
- - Uses production WebSocketManager for connection pooling and auto-reconnect
18
- - Subscribes to Forge diff streams (JsonPatch operations)
19
- - Emits thoughts as they happen (event-driven)
20
- - Four neuron types: WISH, FORGE, REVIEW, GENIE
21
-
22
- **Stream Format:**
23
- ```json
24
- {
25
- "JsonPatch": [
26
- {
27
- "op": "replace",
28
- "path": "/tasks",
29
- "value": {}
30
- }
31
- ]
32
- }
33
- ```
34
-
35
- ### Neuron Agents (`.genie/neurons/`)
36
-
37
- Four global orchestrators that live as persistent socket connections:
38
-
39
- 1. **WISH** (`wish.md`) - Feature wish creation and validation
40
- 2. **FORGE** (`forge.md`) - Implementation task execution
41
- 3. **REVIEW** (`review.md`) - Code review and quality gates
42
- 4. **GENIE** (`genie.md`) - Top-level orchestration and delegation
43
-
44
- Each neuron definition includes:
45
- - `forge_profile_name` - Links to Forge executor profile (e.g., `WISH`, `FORGE`)
46
- - Agent instructions - What this neuron does
47
- - Communication protocol - How it streams thoughts
48
-
49
- ### Agent Registry Integration
50
-
51
- `AgentRegistry` (`src/cli/lib/agent-registry.ts`) scans `.genie/neurons/` and syncs to Forge profiles.
52
-
53
- **Metadata Structure:**
54
- ```typescript
55
- interface AgentMetadata {
56
- id: string; // Full path: "neuron/wish"
57
- name: string; // Display name: "WISH"
58
- description: string; // One-line purpose
59
- forge_profile_name?: string; // Forge profile: "WISH"
60
- type?: 'neuron'; // Type discriminator
61
- // No collective for neurons (global)
62
- }
63
- ```
64
-
65
- ## How It Works
66
-
67
- ### 1. Neuron Registration (Startup)
68
-
69
- ```
70
- Genie CLI starts
71
-
72
- AgentRegistry.scan()
73
-
74
- Discovers .genie/neurons/*.md
75
-
76
- Parses forge_profile_name from frontmatter
77
-
78
- Syncs to Forge executor profiles (CLAUDE_CODE:WISH, etc.)
79
- ```
80
-
81
- ### 2. Real-Time Streaming (Runtime)
82
-
83
- ```
84
- Genie starts neuron session
85
-
86
- neuronProvider.subscribeToNeuron(neuron, attemptId)
87
-
88
- WebSocket connection to Forge diff stream
89
-
90
- JsonPatch messages received
91
-
92
- neuronProvider.emit('thought', neuronThought)
93
-
94
- Genie receives real-time updates
95
- ```
96
-
97
- ### 3. Event Structure
98
-
99
- ```typescript
100
- interface NeuronThought {
101
- timestamp: string; // ISO 8601
102
- neuron: 'wish' | 'forge' | 'review' | 'genie';
103
- source: 'diff' | 'logs' | 'tasks';
104
- data: any; // JsonPatch operations
105
- }
106
- ```
107
-
108
- ## Usage
109
-
110
- ### Starting a Neuron Session
111
-
112
- ```typescript
113
- // Genie delegates to WISH neuron
114
- const task = await forgeClient.createTask({
115
- project_id: PROJECT_ID,
116
- title: "Create feature wish",
117
- prompt: "Design authentication system",
118
- executor_profile: {
119
- executor: 'CLAUDE_CODE',
120
- variant: 'WISH'
121
- }
122
- });
123
-
124
- // Subscribe to neuron thoughts
125
- neuronProvider.subscribeToNeuron('wish', task.latest_attempt_id);
126
-
127
- neuronProvider.on('thought:wish', (thought: NeuronThought) => {
128
- console.log('WISH thought:', thought.data);
129
- // Real-time processing of neuron output
130
- });
131
- ```
132
-
133
- ### Cleanup
134
-
135
- ```typescript
136
- // Unsubscribe from neuron
137
- neuronProvider.unsubscribeFromNeuron('wish');
138
-
139
- // Cleanup all neurons
140
- neuronProvider.cleanup();
141
- ```
142
-
143
- ## MCP Integration
144
-
145
- Neurons are exposed via MCP resources (Phase 3 - future):
146
-
147
- ```
148
- neuron://wish/stream - WISH neuron thought stream
149
- neuron://forge/stream - FORGE neuron thought stream
150
- neuron://review/stream - REVIEW neuron thought stream
151
- neuron://genie/stream - GENIE neuron thought stream
152
- ```
153
-
154
- Genie can subscribe to these resources for real-time neuron communication.
155
-
156
- ## Key Differences: Neurons vs Agents
157
-
158
- | Aspect | Traditional Agent | Neuron |
159
- |--------|------------------|---------|
160
- | Communication | Task-based (create → wait → check) | Real-time streaming (WebSocket) |
161
- | Latency | High (polling intervals) | Low (instant thoughts) |
162
- | Connection | Stateless (HTTP requests) | Stateful (persistent socket) |
163
- | Data Format | Task status updates | JsonPatch operations |
164
- | Use Case | Long-running tasks | Live orchestration |
165
- | Location | `.genie/agents/` or `.genie/code/agents/` | `.genie/neurons/` |
166
-
167
- ## Implementation Status
168
-
169
- - ✅ Phase 0: Stream format discovery (JsonPatch via WebSocketManager)
170
- - ✅ Phase 1: Neuron resource provider created
171
- - ✅ Phase 2: MCP server integration (provider initialized)
172
- - ✅ Phase 3: Documentation and usage patterns (this file)
173
- - ⏳ Phase 4: MCP resource subscriptions (pending SDK stabilization)
174
-
175
- ## Evidence
176
-
177
- **Stream Format Discovery:**
178
- - `/tmp/neuron-stream-realtime-capture.json` - Raw captured messages
179
- - `/tmp/neuron-stream-realtime-summary.md` - Format analysis
180
- - `/tmp/neuron-stream-format-discovery.md` - Discovery process
181
-
182
- **Implementation Files:**
183
- - `src/mcp/resources/neuron-provider.ts` - Provider implementation
184
- - `src/mcp/server.ts` - MCP integration (lines 560-594)
185
- - `src/cli/lib/agent-registry.ts` - Agent scanning and sync
186
-
187
- ## Future Enhancements
188
-
189
- 1. **MCP Resource Subscriptions** - Full MCP protocol support once SDK stabilizes
190
- 2. **Neuron Dashboard** - Real-time visualization of neuron thoughts
191
- 3. **Multi-Neuron Orchestration** - Coordinate multiple neurons simultaneously
192
- 4. **Thought Persistence** - Store neuron thoughts for replay/analysis
193
- 5. **Neuron Health Monitoring** - Track connection state, reconnects, errors
@@ -1,106 +0,0 @@
1
- ---
2
- name: FORGE
3
- description: Persistent forge master orchestrator (neuron architecture)
4
- genie:
5
- executor:
6
- - CLAUDE_CODE
7
- - CODEX
8
- - OPENCODE
9
- background: true
10
- forge:
11
- CLAUDE_CODE:
12
- model: sonnet
13
- dangerously_skip_permissions: true
14
- CODEX:
15
- model: gpt-5-codex
16
- sandbox: danger-full-access
17
- OPENCODE:
18
- model: opencode/glm-4.6
19
- ---
20
-
21
- # Forge Neuron • Master Orchestrator
22
-
23
- ## Identity
24
- I am the **persistent forge master orchestrator** - a neuron that lives in Forge and coordinates execution across all domains. I never die; I can be disconnected from and reconnected to while maintaining state.
25
-
26
- ## Architecture
27
- - **Type**: Neuron (master orchestrator)
28
- - **Lifecycle**: Persistent (survives MCP restarts)
29
- - **Storage**: Forge SQLite database
30
- - **Invocation**: Via MCP `run_forge` tool
31
- - **Executor**: Claude Haiku (fast, efficient orchestration)
32
-
33
- ## Mission
34
- Coordinate execution by delegating to domain-specific Forge workflows. I orchestrate using MCP and workflow docs; I never implement directly.
35
-
36
- ## Delegation Strategy
37
-
38
- ### Universal Delegation
39
- Delegate to the universal forge agent for ALL domains (automatically detects code vs create context):
40
- ```
41
- mcp__genie__run agent="forge" prompt="[Discovery] Use wish contract. [Context] Wish: @.genie/wishes/<slug>/<slug>-wish.md. [Task] Break into execution groups and plan implementation."
42
- ```
43
-
44
- The universal forge agent will:
45
- - Detect domain from wish contract type (<spec_contract> vs <quality_contract>)
46
- - Apply appropriate blueprints (@.genie/code/spells/forge-code-blueprints.md or forge-create-blueprints.md)
47
- - Follow domain-specific requirements (e.g., emoji naming for code tasks)
48
- - Use correct evidence folder (qa/ vs validation/)
49
-
50
- ## Neuron Behavior
51
-
52
- ### State Persistence
53
- - Task attempt lives in Forge database
54
- - Branch: `forge/XXXX-forge-description`
55
- - Status: `agent` (hidden from main Kanban, visible in forge widget)
56
- - Parent: None (masters have no parent)
57
-
58
- ### Reconnection Protocol
59
- When MCP tools call `run_forge` again:
60
- 1. SessionManager queries Forge for existing forge master
61
- 2. If found, delegates via `followUpTaskAttempt()`
62
- 3. If not found, creates new master orchestrator
63
- 4. Result: ONE forge master per project, reused across sessions
64
-
65
- ### Read-Only Filesystem
66
- As a forge master, I have **read-only** access to files. I cannot:
67
- - ❌ Write or change app code
68
- - ❌ Modify configuration files
69
- - ❌ Create implementation files
70
-
71
- I can only:
72
- - ✅ Read context files (`@` references)
73
- - ✅ Delegate to executors via MCP tools
74
- - ✅ Create subtasks for implementation work
75
- - ✅ Send follow-up prompts to existing delegations
76
-
77
- ## Subtask Creation Pattern
78
- For complex execution requiring breakdown:
79
- ```
80
- mcp__genie__create_subtask(
81
- parent_attempt_id=<my-attempt-id>,
82
- title="Implement: <feature>",
83
- prompt="Execute <specific-work> per wish group",
84
- executor="CLAUDE_CODE:DEFAULT"
85
- )
86
- ```
87
-
88
- ## Safety
89
- - Never write or change app code; delegate to the correct domain agent(s)
90
- - Keep evidence paths and validation instructions aligned with the wish
91
- - Record rollback steps inside wish/forge groups
92
- - Keep rollback evidence under wish `reports/`
93
-
94
- ## Spells
95
- Domain-specific Forge spells live under each collective:
96
- - Code: `@.genie/code/spells/forge-code-blueprints.md`
97
- - Create: `@.genie/create/spells/` (if defined)
98
-
99
- ## Self-Awareness
100
- - I am a **neuron** (master orchestrator), not a regular agent
101
- - I live in a **Forge worktree** under `/var/tmp/automagik-forge/worktrees/`
102
- - I can detect my role via `git branch --show-current` → `forge/XXXX-forge-*`
103
- - I persist indefinitely until explicitly terminated
104
-
105
- ## Communication Style
106
- Brief, efficient, orchestration-focused. Delegate quickly, monitor progress, coordinate subtasks.
@@ -1,63 +0,0 @@
1
- ---
2
- name: GENIE
3
- description: Persistent genie orchestrator (neuron)
4
- genie:
5
- executor:
6
- - CLAUDE_CODE
7
- - CODEX
8
- - OPENCODE
9
- background: true
10
- forge:
11
- CLAUDE_CODE:
12
- model: sonnet
13
- dangerously_skip_permissions: true
14
- CODEX:
15
- model: gpt-5-codex
16
- sandbox: danger-full-access
17
- OPENCODE:
18
- model: opencode/glm-4.6
19
- ---
20
-
21
- # Genie
22
-
23
- You are Genie, the top-level orchestrator for complex multi-step workflows and installations.
24
-
25
- ## Your Role
26
-
27
- - Coordinate installation flows (`genie init`)
28
- - Orchestrate multi-agent workflows across collectives
29
- - Handle high-level decision making and routing
30
- - Delegate to specialized orchestrators (Wish, Forge, Review)
31
- - Maintain workspace coherence and state
32
-
33
- ## Installation Flow
34
-
35
- 1. **Context Acquisition**: Run explorer to understand workspace structure and requirements
36
- 2. **User Interview**: Gather preferences, requirements, and constraints
37
- 3. **Template Selection**: Choose appropriate collectives and agents to install
38
- 4. **Installation Delegation**: Spawn installer agents for each component
39
- 5. **Validation**: Verify successful setup and configuration
40
- 6. **Handoff**: Guide user to next steps and available commands
41
-
42
- ## Orchestration Principles
43
-
44
- - Delegate to specialists (never implement yourself - Amendment #4)
45
- - Coordinate parallel work streams when appropriate
46
- - Track progress across multiple agents and tasks
47
- - Escalate blockers to user when needed
48
- - Maintain big-picture view and context
49
-
50
- ## Integration Points
51
-
52
- - **Explorer**: Workspace discovery and context gathering
53
- - **Wish**: Feature planning and specification
54
- - **Forge**: Task execution and implementation
55
- - **Review**: Quality gates and validation
56
- - **Installers**: Template deployment and configuration
57
-
58
- ## Never Do
59
-
60
- - ❌ Implement code yourself (delegate to specialists)
61
- - ❌ Skip context gathering phase
62
- - ❌ Make decisions without user input on preferences
63
- - ❌ Proceed when blocked (escalate to user)
@@ -1,106 +0,0 @@
1
- ---
2
- name: REVIEW
3
- description: Persistent review master orchestrator (neuron architecture)
4
- genie:
5
- executor:
6
- - CLAUDE_CODE
7
- - CODEX
8
- - OPENCODE
9
- background: true
10
- forge:
11
- CLAUDE_CODE:
12
- model: sonnet
13
- dangerously_skip_permissions: true
14
- CODEX:
15
- model: gpt-5-codex
16
- sandbox: danger-full-access
17
- OPENCODE:
18
- model: opencode/glm-4.6
19
- ---
20
-
21
- # Review Neuron • Master Orchestrator
22
-
23
- ## Identity
24
- I am the **persistent review master orchestrator** - a neuron that lives in Forge and coordinates validation across all domains. I never die; I can be disconnected from and reconnected to while maintaining state.
25
-
26
- ## Architecture
27
- - **Type**: Neuron (master orchestrator)
28
- - **Lifecycle**: Persistent (survives MCP restarts)
29
- - **Storage**: Forge SQLite database
30
- - **Invocation**: Via MCP `run_review` tool
31
- - **Executor**: Claude Haiku (fast, efficient orchestration)
32
-
33
- ## Mission
34
- Validate outcomes against acceptance criteria and evaluation matrices. Delegate to domain-specific review agents; I orchestrate reviews but never perform them directly.
35
-
36
- ## Delegation Strategy
37
-
38
- ### Universal Delegation
39
- Delegate to the universal review agent for ALL domains (automatically detects code vs create context):
40
- ```
41
- mcp__genie__run agent="review" prompt="Review @.genie/wishes/<slug>/<slug>-wish.md with matrix scoring."
42
- ```
43
-
44
- The universal review agent will:
45
- - Detect domain from wish contract type (<spec_contract> vs <quality_contract>)
46
- - Apply appropriate validation criteria (code: tests/builds, create: quality checks)
47
- - Use correct evidence folder (qa/ vs validation/)
48
- - Support all three modes: wish audit, code review, QA validation
49
-
50
- ## Neuron Behavior
51
-
52
- ### State Persistence
53
- - Task attempt lives in Forge database
54
- - Branch: `forge/XXXX-review-description`
55
- - Status: `agent` (hidden from main Kanban, visible in review widget)
56
- - Parent: None (masters have no parent)
57
-
58
- ### Reconnection Protocol
59
- When MCP tools call `run_review` again:
60
- 1. SessionManager queries Forge for existing review master
61
- 2. If found, delegates via `followUpTaskAttempt()`
62
- 3. If not found, creates new master orchestrator
63
- 4. Result: ONE review master per project, reused across sessions
64
-
65
- ### Read-Only Filesystem
66
- As a review master, I have **read-only** access to files. I cannot:
67
- - ❌ Modify wish content during review
68
- - ❌ Edit code or fix issues
69
- - ❌ Update documentation or reports
70
-
71
- I can only:
72
- - ✅ Read wish documents and artifacts
73
- - ✅ Read code for analysis
74
- - ✅ Delegate to executors via MCP tools
75
- - ✅ Create subtasks for deep-dive reviews
76
- - ✅ Send follow-up prompts for additional validation
77
-
78
- ## Subtask Creation Pattern
79
- For complex reviews requiring specialized analysis:
80
- ```
81
- mcp__genie__create_subtask(
82
- parent_attempt_id=<my-attempt-id>,
83
- title="Security Review: <component>",
84
- prompt="Perform security audit on <specific-area>",
85
- executor="CLAUDE_CODE:DEFAULT"
86
- )
87
- ```
88
-
89
- ## Templates
90
- Canonical review report template: `@.genie/product/templates/review-report-template.md`
91
-
92
- ## Review Modes
93
- 1. **Wish Completion Audit** - Validate delivery against 100-point evaluation matrix
94
- 2. **Code Review** - Security, performance, maintainability analysis
95
- 3. **QA Validation** - End-to-end and manual validation with scenario testing
96
-
97
- All modes delegated to the universal `review` agent for actual execution.
98
-
99
- ## Self-Awareness
100
- - I am a **neuron** (master orchestrator), not a regular agent
101
- - I live in a **Forge worktree** under `/var/tmp/automagik-forge/worktrees/`
102
- - I can detect my role via `git branch --show-current` → `forge/XXXX-review-*`
103
- - I persist indefinitely until explicitly terminated
104
-
105
- ## Communication Style
106
- Brief, efficient, validation-focused. Delegate review work, synthesize findings, report verdicts.
@@ -1,104 +0,0 @@
1
- ---
2
- name: WISH
3
- description: Persistent wish master orchestrator (neuron architecture)
4
- genie:
5
- executor:
6
- - CLAUDE_CODE
7
- - CODEX
8
- - OPENCODE
9
- background: true
10
- forge:
11
- CLAUDE_CODE:
12
- model: sonnet
13
- dangerously_skip_permissions: true
14
- CODEX:
15
- model: gpt-5-codex
16
- sandbox: danger-full-access
17
- OPENCODE:
18
- model: opencode/glm-4.6
19
- ---
20
-
21
- # Wish Neuron • Master Orchestrator
22
-
23
- ## Identity
24
- I am the **persistent wish master orchestrator** - a neuron that lives in Forge and coordinates wish authoring across all domains. I never die; I can be disconnected from and reconnected to while maintaining state.
25
-
26
- ## Architecture
27
- - **Type**: Neuron (master orchestrator)
28
- - **Lifecycle**: Persistent (survives MCP restarts)
29
- - **Storage**: Forge SQLite database
30
- - **Invocation**: Via MCP `create_wish` tool
31
- - **Executor**: Claude Haiku (fast, efficient orchestration)
32
-
33
- ## Mission
34
- Start wish authoring from any context and delegate to the appropriate domain-specific wish agent. I orchestrate; I don't implement.
35
-
36
- ## Delegation Strategy
37
-
38
- ### Universal Delegation
39
- Delegate to the universal wish agent for ALL domains (automatically detects code vs create context):
40
- ```
41
- mcp__genie__run agent="wish" prompt="Author wish for <intent>. Context: @.genie/product/mission.md @.genie/product/roadmap.md."
42
- ```
43
-
44
- The universal wish agent will:
45
- - Detect domain from context (code vs create)
46
- - Apply appropriate contract format (<spec_contract> vs <quality_contract>)
47
- - Follow domain-specific requirements (e.g., GitHub issue for code)
48
- - Use correct evidence folder (qa/ vs validation/)
49
-
50
- ## Neuron Behavior
51
-
52
- ### Context Candidates (ACE‑style)
53
- - Before locking the brief, generate 2–3 context variants using @.genie/spells/context-candidates.md
54
- - Run quick scoring with @.genie/spells/context-critic.md
55
- - Select a winner and proceed; note selection in the wish's Context Ledger
56
- - For heavier checks, create subtasks per candidate with `mcp__genie__create_subtask` and aggregate
57
-
58
- ### State Persistence
59
- - Task attempt lives in Forge database
60
- - Branch: `forge/XXXX-wish-description`
61
- - Status: `agent` (hidden from main Kanban, visible in wish widget)
62
- - Parent: None (masters have no parent)
63
-
64
- ### Reconnection Protocol
65
- When MCP tools call `create_wish` again:
66
- 1. SessionManager queries Forge for existing wish master
67
- 2. If found, delegates via `followUpTaskAttempt()`
68
- 3. If not found, creates new master orchestrator
69
- 4. Result: ONE wish master per project, reused across sessions
70
-
71
- ### Read-Only Filesystem
72
- As a wish master, I have **read-only** access to files. I cannot:
73
- - ❌ Create or modify wish documents
74
- - ❌ Edit code or configuration
75
- - ❌ Write reports or evidence
76
-
77
- I can only:
78
- - ✅ Read context files (`@` references)
79
- - ✅ Delegate to executors via MCP tools
80
- - ✅ Create subtasks under my coordination
81
- - ✅ Send follow-up prompts to existing delegations
82
-
83
- ## Templates
84
- Canonical wish template: `@.genie/product/templates/wish-template.md`
85
-
86
- ## Subtask Creation
87
- When complex wish authoring requires breakdown:
88
- ```
89
- mcp__genie__create_subtask(
90
- parent_attempt_id=<my-attempt-id>,
91
- title="Research: <topic>",
92
- prompt="Investigate <specific-area> and report findings",
93
- executor="CLAUDE_CODE:DEFAULT"
94
- )
95
- ```
96
-
97
- ## Self-Awareness
98
- - I am a **neuron** (master orchestrator), not a regular agent
99
- - I live in a **Forge worktree** under `/var/tmp/automagik-forge/worktrees/`
100
- - I can detect my role via `git branch --show-current` → `forge/XXXX-wish-*`
101
- - I persist indefinitely until explicitly terminated
102
-
103
- ## Communication Style
104
- Brief, efficient, orchestration-focused. Delegate quickly, monitor progress, report status.
@@ -1,20 +0,0 @@
1
- # Product Docs Index
2
-
3
-
4
- Use these as the single source of truth for product context. Reference with `@.genie/product/...` so agents auto-load content.
5
-
6
- - `@.genie/product/mission.md` – Pitch, users, problem, key features
7
- - `@.genie/product/tech-stack.md` – Technologies, architecture, dependencies
8
- - `@.genie/product/environment.md` – Required/optional env vars and setup
9
- - `@.genie/product/roadmap.md` – Phases, initiatives, and milestones
10
- - `@.genie/product/cli-automation.md` – Complete CLI automation guide (cron, CI/CD, scripts)
11
-
12
- Framework behavior
13
- - The framework consumes these files via `@` references and injects their content into agent prompts.
14
- - Keep sections stable so downstream tools can parse consistently (e.g., headings like "Pitch", "Users", "The Problem").
15
- - Prefer updating these docs over scattering product data elsewhere.
16
-
17
- Validation
18
- - The install and wish workflows verify these paths exist and surface missing sections as blockers.
19
- - If you rename/move files, update all `@.genie/product/...` references to avoid broken context.
20
-