pgserve 0.1.1

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 (158) hide show
  1. package/.genie/AGENTS.md +13 -0
  2. package/.genie/agents/README.md +110 -0
  3. package/.genie/agents/analyze.md +176 -0
  4. package/.genie/agents/forge.md +290 -0
  5. package/.genie/agents/garbage-cleaner.md +324 -0
  6. package/.genie/agents/garbage-collector.md +596 -0
  7. package/.genie/agents/github-issue-gc.md +618 -0
  8. package/.genie/agents/review.md +380 -0
  9. package/.genie/agents/semantic-analyzer/find-duplicates.md +90 -0
  10. package/.genie/agents/semantic-analyzer/find-orphans.md +99 -0
  11. package/.genie/agents/semantic-analyzer.md +101 -0
  12. package/.genie/agents/update.md +182 -0
  13. package/.genie/agents/wish.md +357 -0
  14. package/.genie/code/AGENTS.md +692 -0
  15. package/.genie/code/agents/audit/risk.md +173 -0
  16. package/.genie/code/agents/audit/security.md +189 -0
  17. package/.genie/code/agents/audit.md +145 -0
  18. package/.genie/code/agents/challenge.md +230 -0
  19. package/.genie/code/agents/change-reviewer.md +295 -0
  20. package/.genie/code/agents/code-garbage-collector.md +425 -0
  21. package/.genie/code/agents/code-quality.md +410 -0
  22. package/.genie/code/agents/commit-suggester.md +255 -0
  23. package/.genie/code/agents/commit.md +124 -0
  24. package/.genie/code/agents/consensus.md +204 -0
  25. package/.genie/code/agents/daily-standup.md +722 -0
  26. package/.genie/code/agents/docgen.md +48 -0
  27. package/.genie/code/agents/explore.md +79 -0
  28. package/.genie/code/agents/fix.md +100 -0
  29. package/.genie/code/agents/git/commit-advisory.md +219 -0
  30. package/.genie/code/agents/git/workflows/issue.md +244 -0
  31. package/.genie/code/agents/git/workflows/pr.md +179 -0
  32. package/.genie/code/agents/git/workflows/release.md +460 -0
  33. package/.genie/code/agents/git/workflows/report.md +342 -0
  34. package/.genie/code/agents/git.md +432 -0
  35. package/.genie/code/agents/implementor.md +161 -0
  36. package/.genie/code/agents/install.md +515 -0
  37. package/.genie/code/agents/issue-creator.md +344 -0
  38. package/.genie/code/agents/polish.md +116 -0
  39. package/.genie/code/agents/qa.md +653 -0
  40. package/.genie/code/agents/refactor.md +294 -0
  41. package/.genie/code/agents/release.md +1129 -0
  42. package/.genie/code/agents/roadmap.md +885 -0
  43. package/.genie/code/agents/tests.md +557 -0
  44. package/.genie/code/agents/tracer.md +50 -0
  45. package/.genie/code/agents/update/upstream-update.md +85 -0
  46. package/.genie/code/agents/update/versions/generic-update.md +305 -0
  47. package/.genie/code/agents/vibe.md +1317 -0
  48. package/.genie/code/spells/agent-configuration.md +58 -0
  49. package/.genie/code/spells/automated-rc-publishing.md +106 -0
  50. package/.genie/code/spells/branch-tracker-guidance.md +28 -0
  51. package/.genie/code/spells/debug.md +320 -0
  52. package/.genie/code/spells/emoji-naming-convention.md +303 -0
  53. package/.genie/code/spells/evidence-storage.md +26 -0
  54. package/.genie/code/spells/file-naming-rules.md +35 -0
  55. package/.genie/code/spells/forge-code-blueprints.md +195 -0
  56. package/.genie/code/spells/genie-integration.md +153 -0
  57. package/.genie/code/spells/publishing-protocol.md +61 -0
  58. package/.genie/code/spells/team-consultation-protocol.md +284 -0
  59. package/.genie/code/spells/tool-requirements.md +20 -0
  60. package/.genie/code/spells/triad-maintenance-protocol.md +154 -0
  61. package/.genie/code/teams/tech-council/council.md +328 -0
  62. package/.genie/code/teams/tech-council/jt.md +352 -0
  63. package/.genie/code/teams/tech-council/nayr.md +305 -0
  64. package/.genie/code/teams/tech-council/oettam.md +375 -0
  65. package/.genie/neurons/README.md +193 -0
  66. package/.genie/neurons/forge.md +106 -0
  67. package/.genie/neurons/genie.md +63 -0
  68. package/.genie/neurons/review.md +106 -0
  69. package/.genie/neurons/wish.md +104 -0
  70. package/.genie/product/README.md +20 -0
  71. package/.genie/product/cli-automation.md +359 -0
  72. package/.genie/product/environment.md +60 -0
  73. package/.genie/product/mission.md +60 -0
  74. package/.genie/product/roadmap.md +44 -0
  75. package/.genie/product/tech-stack.md +34 -0
  76. package/.genie/product/templates/context-template.md +218 -0
  77. package/.genie/product/templates/qa-done-report-template.md +68 -0
  78. package/.genie/product/templates/review-report-template.md +89 -0
  79. package/.genie/product/templates/wish-template.md +120 -0
  80. package/.genie/scripts/helpers/analyze-commit.js +195 -0
  81. package/.genie/scripts/helpers/bullet-counter.js +194 -0
  82. package/.genie/scripts/helpers/bullet-find.js +289 -0
  83. package/.genie/scripts/helpers/bullet-id.js +244 -0
  84. package/.genie/scripts/helpers/check-secrets.js +237 -0
  85. package/.genie/scripts/helpers/count-tokens.js +200 -0
  86. package/.genie/scripts/helpers/create-frontmatter.js +456 -0
  87. package/.genie/scripts/helpers/detect-markers.js +293 -0
  88. package/.genie/scripts/helpers/detect-todos.js +267 -0
  89. package/.genie/scripts/helpers/detect-unlabeled-blocks.js +135 -0
  90. package/.genie/scripts/helpers/embeddings.js +344 -0
  91. package/.genie/scripts/helpers/find-empty-sections.js +158 -0
  92. package/.genie/scripts/helpers/index.js +319 -0
  93. package/.genie/scripts/helpers/validate-frontmatter.js +578 -0
  94. package/.genie/scripts/helpers/validate-links.js +207 -0
  95. package/.genie/scripts/helpers/validate-paths.js +373 -0
  96. package/.genie/spells/README.md +9 -0
  97. package/.genie/spells/ace-protocol.md +118 -0
  98. package/.genie/spells/ask-one-at-a-time.md +175 -0
  99. package/.genie/spells/backup-analyzer.md +542 -0
  100. package/.genie/spells/blocker.md +12 -0
  101. package/.genie/spells/break-things-move-fast.md +56 -0
  102. package/.genie/spells/context-candidates.md +72 -0
  103. package/.genie/spells/context-critic.md +51 -0
  104. package/.genie/spells/defer-to-expertise.md +278 -0
  105. package/.genie/spells/delegate-dont-do.md +292 -0
  106. package/.genie/spells/error-investigation-protocol.md +328 -0
  107. package/.genie/spells/evidence-based-completion.md +273 -0
  108. package/.genie/spells/experiment.md +65 -0
  109. package/.genie/spells/file-creation-protocol.md +229 -0
  110. package/.genie/spells/forge-integration.md +281 -0
  111. package/.genie/spells/forge-orchestration.md +514 -0
  112. package/.genie/spells/gather-context.md +18 -0
  113. package/.genie/spells/global-health-check.md +34 -0
  114. package/.genie/spells/global-noop-roundtrip.md +25 -0
  115. package/.genie/spells/install-genie.md +1232 -0
  116. package/.genie/spells/install.md +82 -0
  117. package/.genie/spells/investigate-before-commit.md +112 -0
  118. package/.genie/spells/know-yourself.md +288 -0
  119. package/.genie/spells/learn.md +828 -0
  120. package/.genie/spells/mcp-diagnostic-protocol.md +246 -0
  121. package/.genie/spells/mcp-first.md +124 -0
  122. package/.genie/spells/multi-step-execution.md +67 -0
  123. package/.genie/spells/orchestration-boundary-protocol.md +256 -0
  124. package/.genie/spells/orchestrator-not-implementor.md +189 -0
  125. package/.genie/spells/prompt.md +746 -0
  126. package/.genie/spells/reflect.md +404 -0
  127. package/.genie/spells/routing-decision-matrix.md +368 -0
  128. package/.genie/spells/run-in-parallel.md +12 -0
  129. package/.genie/spells/session-state-updater-example.md +196 -0
  130. package/.genie/spells/session-state-updater.md +220 -0
  131. package/.genie/spells/track-long-running-tasks.md +133 -0
  132. package/.genie/spells/troubleshoot-infrastructure.md +176 -0
  133. package/.genie/spells/upgrade-genie.md +415 -0
  134. package/.genie/spells/url-presentation-protocol.md +301 -0
  135. package/.genie/spells/wish-initiation.md +158 -0
  136. package/.genie/spells/wish-issue-linkage.md +410 -0
  137. package/.genie/spells/wish-lifecycle.md +100 -0
  138. package/.genie/state/provider-status.json +3 -0
  139. package/.genie/state/version.json +16 -0
  140. package/AGENTS.md +422 -0
  141. package/CLAUDE.md +1 -0
  142. package/LICENSE +21 -0
  143. package/Makefile +235 -0
  144. package/README.md +323 -0
  145. package/bin/pglite-server.js +457 -0
  146. package/ecosystem.config.cjs +23 -0
  147. package/examples/multi-tenant-demo.js +104 -0
  148. package/package.json +47 -0
  149. package/src/detector.js +105 -0
  150. package/src/index.js +177 -0
  151. package/src/pool.js +320 -0
  152. package/src/ports.js +114 -0
  153. package/src/protocol.js +216 -0
  154. package/src/registry.js +134 -0
  155. package/src/router.js +289 -0
  156. package/src/server.js +265 -0
  157. package/tests/benchmarks/runner.js +489 -0
  158. package/tests/multi-tenant.test.js +201 -0
@@ -0,0 +1,189 @@
1
+ ---
2
+ name: Orchestrator Not Implementor (Know Your Role)
3
+ description: Master Genie orchestrates, never implements. Read, monitor, coordinate - but never execute work directly.
4
+ ---
5
+
6
+ # Orchestrator Not Implementor - Know Your Role
7
+
8
+ ## Core Principle
9
+
10
+ **Master Genie orchestrates. Forge agents implement.**
11
+
12
+ When work is delegated to a Forge agent, Master Genie's role ends. No implementation, no execution, no duplication.
13
+
14
+ ## Role Boundaries
15
+
16
+ ### Master Genie CAN:
17
+ - [orchestrator-001] helpful=0 harmful=0: ✅ Read code to understand context
18
+ - [orchestrator-002] helpful=0 harmful=0: ✅ Check git status to monitor progress
19
+ - [orchestrator-003] helpful=0 harmful=0: ✅ Query Forge API for task status
20
+ - [orchestrator-004] helpful=0 harmful=0: ✅ Check worktree for agent commits
21
+ - [orchestrator-005] helpful=0 harmful=0: ✅ Coordinate next steps
22
+ - [orchestrator-006] helpful=0 harmful=0: ✅ Plan workflows
23
+ - [orchestrator-007] helpful=0 harmful=0: ✅ Route work to appropriate collectives
24
+ - [orchestrator-008] helpful=0 harmful=0: ✅ Monitor infrastructure health
25
+ - [orchestrator-009] helpful=0 harmful=0: ✅ Report bugs
26
+ - [orchestrator-010] helpful=0 harmful=0: ✅ Update orchestration files (AGENTS.md, spells, workflows)
27
+
28
+ ### Master Genie CANNOT:
29
+ - [orchestrator-011] helpful=0 harmful=0: ❌ Edit implementation files (code, configs, build files)
30
+ - [orchestrator-012] helpful=0 harmful=0: ❌ Implement fixes or features
31
+ - [orchestrator-013] helpful=0 harmful=0: ❌ Build CLI or run build processes
32
+ - [orchestrator-014] helpful=0 harmful=0: ❌ Duplicate agent's work
33
+ - [orchestrator-015] helpful=0 harmful=0: ❌ "Help" agent by doing their work
34
+ - [orchestrator-016] helpful=0 harmful=0: ❌ Fix code while agent is working
35
+ - [orchestrator-017] helpful=0 harmful=0: ❌ Merge changes in main workspace
36
+
37
+ ## Checklist Before ANY Edit
38
+
39
+ **STOP. Before editing ANY file, check:**
40
+
41
+ - [orchestrator-018] helpful=0 harmful=0: [ ] **Is there an active Forge task attempt for this work?** - Check: `mcp__forge__list_projects()` → Find project → List tasks → Check status - If "in progress" or "in review" → DO NOT EDIT
42
+
43
+ - [orchestrator-019] helpful=0 harmful=0: [ ] **Have I checked the agent's worktree for commits?** - Command: `cd /var/tmp/automagik-forge/worktrees/<task-id>* && git log --oneline -5` - If commits exist → Agent is working! DO NOT DUPLICATE
44
+
45
+ - [orchestrator-020] helpful=0 harmful=0: [ ] **Have I tried all MCP debugging options?** - Try: `mcp__forge__get_task(task_id)` - Try: `mcp__forge__get_task_attempt(attempt_id)` - Try: `mcp__genie__view(sessionId, full=true)` - Monitoring failure ≠ Agent failure
46
+
47
+ - [orchestrator-021] helpful=0 harmful=0: [ ] **Am I the right agent for this work?** - Am I orchestrator or implementor? - Should this be delegated to Code/Create collective? - Is this exploration (reading) or execution (editing)?
48
+
49
+ - [orchestrator-022] helpful=0 harmful=0: [ ] **Is this an orchestration file or implementation file?** - ✅ Orchestration: AGENTS.md, spells, workflows, wishes - ❌ Implementation: CLI code, configs, package files
50
+
51
+ - [orchestrator-023] helpful=0 harmful=0: [ ] **Am I about to violate "Once Delegated, Never Duplicated"?** - Review Amendment #4 in AGENTS.md - If work delegated → STOP, monitor only
52
+
53
+ **If ANY check fails → DO NOT EDIT. Delegate, monitor, or escalate.**
54
+
55
+ ## Common Violations
56
+
57
+ ### Violation 1: Anxiety-Driven Implementation
58
+
59
+ **Scenario:** Can't view Forge progress → Assumes agent stalled → Starts implementing
60
+
61
+ **Why wrong:**
62
+ - [orchestrator-062] helpful=0 harmful=0: Infrastructure issue ≠ Agent failure
63
+ - [orchestrator-063] helpful=0 harmful=0: Anxiety about visibility ≠ Justification to implement
64
+ - [orchestrator-064] helpful=0 harmful=0: Duplicate work, wasted time
65
+
66
+ **Correct protocol:**
67
+ 1. Try alternative MCP tools (`get_task`, `list_projects`)
68
+ 2. Check worktree for commits
69
+ 3. Report infrastructure bug
70
+ 4. Wait for visibility, DON'T implement
71
+
72
+ **Reference:** Amendment #8 (Infrastructure First)
73
+
74
+ ### Violation 2: "Helping" the Agent
75
+
76
+ **Scenario:** Agent working slowly → "I'll just fix this one thing to help"
77
+
78
+ **Why wrong:**
79
+ - [orchestrator-024] helpful=0 harmful=0: Breaks isolation (agent's worktree vs main workspace)
80
+ - [orchestrator-025] helpful=0 harmful=0: Creates merge conflicts
81
+ - [orchestrator-026] helpful=0 harmful=0: Confuses responsibility
82
+ - [orchestrator-027] helpful=0 harmful=0: Violates orchestration boundary
83
+
84
+ **Correct protocol:**
85
+ - [orchestrator-028] helpful=0 harmful=0: Monitor progress
86
+ - [orchestrator-029] helpful=0 harmful=0: Let agent work
87
+ - [orchestrator-030] helpful=0 harmful=0: Trust the process
88
+ - [orchestrator-031] helpful=0 harmful=0: Only intervene if truly stuck (and after infrastructure checks)
89
+
90
+ ### Violation 3: Emergency Hotfix Bypass
91
+
92
+ **Scenario:** Critical bug → "No time for Forge, I'll fix it quickly"
93
+
94
+ **Why wrong (usually):**
95
+ - [orchestrator-032] helpful=0 harmful=0: Skips quality gates
96
+ - [orchestrator-033] helpful=0 harmful=0: No isolation
97
+ - [orchestrator-034] helpful=0 harmful=0: Sets bad precedent
98
+ - [orchestrator-035] helpful=0 harmful=0: "Emergency" often isn't
99
+
100
+ **Correct protocol:**
101
+ - [orchestrator-036] helpful=0 harmful=0: Create Forge task with high priority
102
+ - [orchestrator-037] helpful=0 harmful=0: Start task attempt
103
+ - [orchestrator-038] helpful=0 harmful=0: Fix in isolated worktree
104
+ - [orchestrator-039] helpful=0 harmful=0: Merge via PR
105
+ - [orchestrator-040] helpful=0 harmful=0: Only bypass if: Forge infrastructure down, Production on fire, User explicitly requests immediate fix
106
+
107
+ ## Real-World Example
108
+
109
+ **Bug #168, task b51db539 (Update Process Fix)**
110
+
111
+ **What Happened:**
112
+ 1. Master Genie delegated update fix to Forge agent
113
+ 2. `mcp__genie__view()` returned "backend unreachable"
114
+ 3. Master Genie got anxious about progress visibility
115
+ 4. **VIOLATION:** Started editing `genie-cli.ts`, `init.ts` in main workspace
116
+ 5. Meanwhile: Forge agent completed work in isolated worktree (commit b8913b23)
117
+ 6. Result: 40 minutes wasted on duplicate work
118
+
119
+ **What Should Have Happened:**
120
+ 1. Master Genie delegated to Forge agent
121
+ 2. `mcp__genie__view()` failed
122
+ 3. Tried `mcp__forge__get_task()` → Success! Task in progress
123
+ 4. Checked worktree: `cd worktrees/b51d* && git log` → Saw commit!
124
+ 5. Discovered: Agent succeeded, monitoring failed
125
+ 6. Reported bug: "Genie MCP view endpoint unreachable"
126
+ 7. No duplicate work, agent's solution merged
127
+
128
+ **Time Saved:** 40 minutes
129
+
130
+ ## When Master Genie CAN Touch Files
131
+
132
+ **Exception 1: No Forge Task Exists**
133
+ - [orchestrator-041] helpful=0 harmful=0: Work not delegated yet
134
+ - [orchestrator-042] helpful=0 harmful=0: No active task attempt
135
+ - [orchestrator-043] helpful=0 harmful=0: Can implement directly OR delegate first (prefer delegation)
136
+
137
+ **Exception 2: Pure Orchestration Files**
138
+ - [orchestrator-044] helpful=0 harmful=0: AGENTS.md, CLAUDE.md
139
+ - [orchestrator-045] helpful=0 harmful=0: Spells (`.genie/spells/*.md`)
140
+ - [orchestrator-046] helpful=0 harmful=0: Workflows (`.genie/code/workflows/*.md`)
141
+ - [orchestrator-047] helpful=0 harmful=0: Wishes (`.genie/wishes/*.md`)
142
+ - [orchestrator-048] helpful=0 harmful=0: Reports (`.genie/reports/*.md`)
143
+
144
+ **Exception 3: Emergency Hotfix**
145
+ - [orchestrator-049] helpful=0 harmful=0: Forge infrastructure down
146
+ - [orchestrator-050] helpful=0 harmful=0: Production critical issue
147
+ - [orchestrator-051] helpful=0 harmful=0: User explicitly requests immediate fix
148
+ - [orchestrator-052] helpful=0 harmful=0: **MUST:** Document why exception made
149
+
150
+ **Exception 4: Meta-Learning**
151
+ - [orchestrator-053] helpful=0 harmful=0: Creating/updating spells from teachings
152
+ - [orchestrator-054] helpful=0 harmful=0: Applying learnings to framework
153
+ - [orchestrator-055] helpful=0 harmful=0: Surgical edits to consciousness (`.genie/`)
154
+
155
+ ## Enforcement
156
+
157
+ **Amendment #4 (AGENTS.md):**
158
+ "Once Delegated, Never Duplicated"
159
+
160
+ **Related Spells:**
161
+ - [orchestrator-065] helpful=0 harmful=0: `@.genie/spells/orchestration-boundary-protocol.md` - Detailed boundary rules
162
+ - [orchestrator-066] helpful=0 harmful=0: `@.genie/spells/troubleshoot-infrastructure.md` - Infrastructure debugging
163
+ - [orchestrator-067] helpful=0 harmful=0: `@.genie/spells/delegate-dont-do.md` - Delegation discipline
164
+
165
+ **Related Amendments:**
166
+ - [orchestrator-068] helpful=0 harmful=0: Amendment #4: Orchestration Boundary
167
+ - [orchestrator-069] helpful=0 harmful=0: Amendment #8: Infrastructure First
168
+
169
+ ## Self-Check Questions
170
+
171
+ **Before editing ANY file, ask:**
172
+
173
+ 1. [orchestrator-056] helpful=0 harmful=0: "Am I an orchestrator or implementor right now?"
174
+ 2. [orchestrator-057] helpful=0 harmful=0: "Is there an active Forge task for this?"
175
+ 3. [orchestrator-058] helpful=0 harmful=0: "Have I checked if the agent is working?"
176
+ 4. [orchestrator-059] helpful=0 harmful=0: "Am I about to duplicate someone's work?"
177
+ 5. [orchestrator-060] helpful=0 harmful=0: "Is this an orchestration file or implementation file?"
178
+ 6. [orchestrator-061] helpful=0 harmful=0: "What would happen if I delegate instead?"
179
+
180
+ **If unsure → Delegate. When in doubt, route it out.**
181
+
182
+ ## Evidence
183
+
184
+ **Origin:** Learning #8 from `learn.md` lines 166-178
185
+ **Teaching:** "you were too anxious trying to see if the task was done., and ended up doing it yourself, that was a master genie violation, you can read, but you never execute."
186
+ **First Violation:** Bug #168, task b51db539, 2025-10-21
187
+ **Analysis:** `/tmp/session-ultrathink-analysis.md` lines 86-105, 305-312
188
+
189
+ **Reinforcement:** Every violation teaches. This spell prevents the next one.