pgserve 2.1.3 → 2.2.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 (235) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.md +105 -1
  3. package/bin/autopg-wrapper.cjs +16 -0
  4. package/bin/pgserve-wrapper.cjs +32 -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 +14 -2
  27. package/scripts/postinstall.cjs +60 -0
  28. package/src/cli-config.cjs +310 -0
  29. package/src/cli-install.cjs +112 -11
  30. package/src/cli-restart.cjs +228 -0
  31. package/src/cli-ui.cjs +580 -0
  32. package/src/cluster.js +43 -38
  33. package/src/postgres.js +141 -19
  34. package/src/settings-loader.cjs +235 -0
  35. package/src/settings-migrate.cjs +212 -0
  36. package/src/settings-pg-args.cjs +146 -0
  37. package/src/settings-schema.cjs +422 -0
  38. package/src/settings-validator.cjs +416 -0
  39. package/src/settings-writer.cjs +288 -0
  40. package/src/upgrade/index.js +65 -0
  41. package/src/upgrade/runner.js +23 -0
  42. package/src/upgrade/steps/binary-cache-flush.js +67 -0
  43. package/src/upgrade/steps/consumer-signal.js +40 -0
  44. package/src/upgrade/steps/env-refresh.js +89 -0
  45. package/src/upgrade/steps/health-validate.js +53 -0
  46. package/src/upgrade/steps/plpgsql-resolve.js +66 -0
  47. package/src/upgrade/steps/port-reconcile.js +52 -0
  48. package/.claude/context/windows-debug.md +0 -119
  49. package/.genie/AGENTS.md +0 -15
  50. package/.genie/agents/README.md +0 -110
  51. package/.genie/agents/analyze.md +0 -176
  52. package/.genie/agents/forge.md +0 -290
  53. package/.genie/agents/garbage-cleaner.md +0 -324
  54. package/.genie/agents/garbage-collector.md +0 -596
  55. package/.genie/agents/github-issue-gc.md +0 -618
  56. package/.genie/agents/review.md +0 -380
  57. package/.genie/agents/semantic-analyzer/find-duplicates.md +0 -90
  58. package/.genie/agents/semantic-analyzer/find-orphans.md +0 -99
  59. package/.genie/agents/semantic-analyzer.md +0 -101
  60. package/.genie/agents/update.md +0 -182
  61. package/.genie/agents/wish.md +0 -357
  62. package/.genie/brainstorms/pgserve-v2/DESIGN.md +0 -174
  63. package/.genie/code/AGENTS.md +0 -694
  64. package/.genie/code/agents/audit/risk.md +0 -173
  65. package/.genie/code/agents/audit/security.md +0 -189
  66. package/.genie/code/agents/audit.md +0 -145
  67. package/.genie/code/agents/challenge.md +0 -230
  68. package/.genie/code/agents/change-reviewer.md +0 -295
  69. package/.genie/code/agents/code-garbage-collector.md +0 -425
  70. package/.genie/code/agents/code-quality.md +0 -410
  71. package/.genie/code/agents/commit-suggester.md +0 -255
  72. package/.genie/code/agents/commit.md +0 -124
  73. package/.genie/code/agents/consensus.md +0 -204
  74. package/.genie/code/agents/daily-standup.md +0 -722
  75. package/.genie/code/agents/docgen.md +0 -48
  76. package/.genie/code/agents/explore.md +0 -79
  77. package/.genie/code/agents/fix.md +0 -100
  78. package/.genie/code/agents/git/commit-advisory.md +0 -219
  79. package/.genie/code/agents/git/workflows/issue.md +0 -244
  80. package/.genie/code/agents/git/workflows/pr.md +0 -179
  81. package/.genie/code/agents/git/workflows/release.md +0 -460
  82. package/.genie/code/agents/git/workflows/report.md +0 -342
  83. package/.genie/code/agents/git.md +0 -432
  84. package/.genie/code/agents/implementor.md +0 -161
  85. package/.genie/code/agents/install.md +0 -515
  86. package/.genie/code/agents/issue-creator.md +0 -344
  87. package/.genie/code/agents/polish.md +0 -116
  88. package/.genie/code/agents/qa.md +0 -653
  89. package/.genie/code/agents/refactor.md +0 -294
  90. package/.genie/code/agents/release.md +0 -1129
  91. package/.genie/code/agents/roadmap.md +0 -885
  92. package/.genie/code/agents/tests.md +0 -557
  93. package/.genie/code/agents/tracer.md +0 -50
  94. package/.genie/code/agents/update/upstream-update.md +0 -85
  95. package/.genie/code/agents/update/versions/generic-update.md +0 -305
  96. package/.genie/code/agents/vibe.md +0 -1317
  97. package/.genie/code/spells/agent-configuration.md +0 -58
  98. package/.genie/code/spells/automated-rc-publishing.md +0 -106
  99. package/.genie/code/spells/branch-tracker-guidance.md +0 -28
  100. package/.genie/code/spells/debug.md +0 -320
  101. package/.genie/code/spells/emoji-naming-convention.md +0 -303
  102. package/.genie/code/spells/evidence-storage.md +0 -26
  103. package/.genie/code/spells/file-naming-rules.md +0 -35
  104. package/.genie/code/spells/forge-code-blueprints.md +0 -195
  105. package/.genie/code/spells/genie-integration.md +0 -153
  106. package/.genie/code/spells/publishing-protocol.md +0 -61
  107. package/.genie/code/spells/team-consultation-protocol.md +0 -284
  108. package/.genie/code/spells/tool-requirements.md +0 -20
  109. package/.genie/code/spells/triad-maintenance-protocol.md +0 -154
  110. package/.genie/code/teams/tech-council/council.md +0 -328
  111. package/.genie/code/teams/tech-council/jt.md +0 -352
  112. package/.genie/code/teams/tech-council/nayr.md +0 -305
  113. package/.genie/code/teams/tech-council/oettam.md +0 -375
  114. package/.genie/neurons/README.md +0 -193
  115. package/.genie/neurons/forge.md +0 -106
  116. package/.genie/neurons/genie.md +0 -63
  117. package/.genie/neurons/review.md +0 -106
  118. package/.genie/neurons/wish.md +0 -104
  119. package/.genie/product/README.md +0 -20
  120. package/.genie/product/cli-automation.md +0 -359
  121. package/.genie/product/environment.md +0 -60
  122. package/.genie/product/mission.md +0 -60
  123. package/.genie/product/roadmap.md +0 -44
  124. package/.genie/product/tech-stack.md +0 -34
  125. package/.genie/product/templates/context-template.md +0 -218
  126. package/.genie/product/templates/qa-done-report-template.md +0 -68
  127. package/.genie/product/templates/review-report-template.md +0 -89
  128. package/.genie/product/templates/wish-template.md +0 -120
  129. package/.genie/scripts/helpers/analyze-commit.js +0 -195
  130. package/.genie/scripts/helpers/bullet-counter.js +0 -194
  131. package/.genie/scripts/helpers/bullet-find.js +0 -289
  132. package/.genie/scripts/helpers/bullet-id.js +0 -244
  133. package/.genie/scripts/helpers/check-secrets.js +0 -237
  134. package/.genie/scripts/helpers/count-tokens.js +0 -200
  135. package/.genie/scripts/helpers/create-frontmatter.js +0 -456
  136. package/.genie/scripts/helpers/detect-markers.js +0 -293
  137. package/.genie/scripts/helpers/detect-todos.js +0 -267
  138. package/.genie/scripts/helpers/detect-unlabeled-blocks.js +0 -135
  139. package/.genie/scripts/helpers/embeddings.js +0 -344
  140. package/.genie/scripts/helpers/find-empty-sections.js +0 -158
  141. package/.genie/scripts/helpers/index.js +0 -319
  142. package/.genie/scripts/helpers/validate-frontmatter.js +0 -578
  143. package/.genie/scripts/helpers/validate-links.js +0 -207
  144. package/.genie/scripts/helpers/validate-paths.js +0 -373
  145. package/.genie/spells/README.md +0 -9
  146. package/.genie/spells/ace-protocol.md +0 -118
  147. package/.genie/spells/ask-one-at-a-time.md +0 -175
  148. package/.genie/spells/backup-analyzer.md +0 -542
  149. package/.genie/spells/blocker.md +0 -12
  150. package/.genie/spells/break-things-move-fast.md +0 -56
  151. package/.genie/spells/context-candidates.md +0 -72
  152. package/.genie/spells/context-critic.md +0 -51
  153. package/.genie/spells/defer-to-expertise.md +0 -278
  154. package/.genie/spells/delegate-dont-do.md +0 -292
  155. package/.genie/spells/error-investigation-protocol.md +0 -328
  156. package/.genie/spells/evidence-based-completion.md +0 -273
  157. package/.genie/spells/experiment.md +0 -65
  158. package/.genie/spells/file-creation-protocol.md +0 -229
  159. package/.genie/spells/forge-integration.md +0 -281
  160. package/.genie/spells/forge-orchestration.md +0 -514
  161. package/.genie/spells/gather-context.md +0 -18
  162. package/.genie/spells/global-health-check.md +0 -34
  163. package/.genie/spells/global-noop-roundtrip.md +0 -25
  164. package/.genie/spells/install-genie.md +0 -1232
  165. package/.genie/spells/install.md +0 -82
  166. package/.genie/spells/investigate-before-commit.md +0 -112
  167. package/.genie/spells/know-yourself.md +0 -288
  168. package/.genie/spells/learn.md +0 -828
  169. package/.genie/spells/mcp-diagnostic-protocol.md +0 -246
  170. package/.genie/spells/mcp-first.md +0 -124
  171. package/.genie/spells/multi-step-execution.md +0 -67
  172. package/.genie/spells/orchestration-boundary-protocol.md +0 -256
  173. package/.genie/spells/orchestrator-not-implementor.md +0 -189
  174. package/.genie/spells/prompt.md +0 -746
  175. package/.genie/spells/reflect.md +0 -404
  176. package/.genie/spells/routing-decision-matrix.md +0 -368
  177. package/.genie/spells/run-in-parallel.md +0 -12
  178. package/.genie/spells/session-state-updater-example.md +0 -196
  179. package/.genie/spells/session-state-updater.md +0 -220
  180. package/.genie/spells/track-long-running-tasks.md +0 -133
  181. package/.genie/spells/troubleshoot-infrastructure.md +0 -176
  182. package/.genie/spells/upgrade-genie.md +0 -415
  183. package/.genie/spells/url-presentation-protocol.md +0 -301
  184. package/.genie/spells/wish-initiation.md +0 -158
  185. package/.genie/spells/wish-issue-linkage.md +0 -410
  186. package/.genie/spells/wish-lifecycle.md +0 -100
  187. package/.genie/state/provider-status.json +0 -3
  188. package/.genie/state/version.json +0 -16
  189. package/.genie/wishes/canonical-pgserve-pm2-supervision/WISH.md +0 -290
  190. package/.genie/wishes/pgserve-v2/BRIEF-from-genie-pgserve.md +0 -99
  191. package/.genie/wishes/pgserve-v2/WISH.md +0 -442
  192. package/.genie/wishes/release-system-genie-pattern/WISH.md +0 -268
  193. package/.genie/wishes/release-system-genie-pattern/validation.md +0 -205
  194. package/.gitguardian.yaml +0 -29
  195. package/.gitguardianignore +0 -16
  196. package/.github/workflows/ci.yml +0 -122
  197. package/.github/workflows/release.yml +0 -289
  198. package/.github/workflows/version.yml +0 -228
  199. package/.husky/pre-commit +0 -2
  200. package/AGENTS.md +0 -433
  201. package/CLAUDE.md +0 -1
  202. package/Makefile +0 -285
  203. package/assets/icon.ico +0 -0
  204. package/bun.lock +0 -435
  205. package/bunfig.toml +0 -28
  206. package/ecosystem.config.cjs +0 -23
  207. package/eslint.config.js +0 -63
  208. package/examples/multi-tenant-demo.js +0 -104
  209. package/install.sh +0 -123
  210. package/knip.json +0 -9
  211. package/tests/audit.test.js +0 -189
  212. package/tests/backpressure.test.js +0 -167
  213. package/tests/benchmarks/runner.js +0 -1197
  214. package/tests/benchmarks/vector-generator.js +0 -368
  215. package/tests/cli-install.test.js +0 -322
  216. package/tests/control-db.test.js +0 -285
  217. package/tests/daemon-args.test.js +0 -86
  218. package/tests/daemon-control.test.js +0 -171
  219. package/tests/daemon-fingerprint-integration.test.js +0 -111
  220. package/tests/daemon-pr24-regression.test.js +0 -198
  221. package/tests/fingerprint.test.js +0 -263
  222. package/tests/fixtures/240-orphan-seed.sql +0 -30
  223. package/tests/multi-tenant.test.js +0 -374
  224. package/tests/orphan-cleanup.test.js +0 -390
  225. package/tests/pg-version-regex.test.js +0 -129
  226. package/tests/quick-bench.js +0 -135
  227. package/tests/router-handshake-retry.test.js +0 -119
  228. package/tests/router-handshake-watchdog.test.js +0 -110
  229. package/tests/sdk.test.js +0 -71
  230. package/tests/stale-postmaster-pid.test.js +0 -85
  231. package/tests/stress-test.js +0 -439
  232. package/tests/sync-perf-test.js +0 -150
  233. package/tests/tcp-listen.test.js +0 -368
  234. package/tests/tenancy.test.js +0 -403
  235. package/tests/wrapper-supervision.test.js +0 -107
@@ -1,359 +0,0 @@
1
- # Genie CLI Automation Guide
2
-
3
- Complete reference for using Genie CLI in automated workflows (cron, CI/CD, scripts).
4
-
5
- ## Quick Reference Table
6
-
7
- | Command | Mode | Output | Use Case |
8
- |---------|------|--------|----------|
9
- | `genie task` | Headless | JSON | Fire-and-forget tasks |
10
- | `genie run` | Foreground | JSON/Text | Wait for completion |
11
- | `genie run --background` | Headless | URL | Same as task |
12
- | `genie task monitor <id>` | Foreground | Live logs | Monitor background task |
13
- | `genie list tasks` | Query | Table | Task status check |
14
- | `genie view <id>` | Query | Transcript | Get task output |
15
- | `genie resume <id>` | Interactive | JSON | Continue conversation |
16
- | `genie stop <id>` | Control | - | Kill running task |
17
- | `genie status` | Health | Status | System health check |
18
-
19
- ---
20
-
21
- ## 1. Fire-and-Forget Tasks (Cron/Background)
22
-
23
- **Command:** `genie task`
24
- - Starts task immediately
25
- - Returns task ID
26
- - No browser, no waiting
27
- - Perfect for cron
28
-
29
- ### Basic Usage
30
- ```bash
31
- # Default: JSON output with task info
32
- genie task code/explore "Check system health"
33
-
34
- # Output:
35
- {
36
- "task_id": "abc-123...",
37
- "task_url": "http://localhost:8887/...",
38
- "agent": "code/explore",
39
- "executor": "CLAUDE_CODE:DEFAULT",
40
- "status": "started"
41
- }
42
- ```
43
-
44
- ### Quiet Mode (No Warnings)
45
- ```bash
46
- # Suppress version warnings (clean cron logs)
47
- genie task --quiet code/explore "Silent task"
48
- ```
49
-
50
- ### Cron Examples
51
- ```bash
52
- # Every 5 minutes - health check
53
- */5 * * * * genie task --quiet code/explore "Health check" >> /var/log/genie.log 2>&1
54
-
55
- # Daily at 3 AM - cleanup
56
- 0 3 * * * genie task --quiet code/code-garbage-collector "Daily cleanup" >> /var/log/cleanup.log 2>&1
57
-
58
- # Hourly - save task ID for later monitoring
59
- 0 * * * * genie task --quiet code/explore "Hourly scan" | jq -r '.task_id' > /var/log/last-task-id.txt 2>&1
60
- ```
61
-
62
- ---
63
-
64
- ## 2. Wait for Completion (Synchronous)
65
-
66
- **Command:** `genie run`
67
- - Waits for task to finish
68
- - Returns output when done
69
- - Opens browser (unless --background)
70
-
71
- ### Basic Usage
72
- ```bash
73
- # Wait for completion, see output
74
- genie run code/explore "Analyze codebase"
75
-
76
- # Output: Full results JSON with status
77
- ```
78
-
79
- ### Background Mode
80
- ```bash
81
- # Same as 'genie task' (no waiting)
82
- genie run --background code/explore "Background task"
83
- ```
84
-
85
- ### Automation Examples
86
- ```bash
87
- # CI/CD: Run tests and capture results
88
- genie run --quiet code/tests "Run all tests" > test-results.json
89
-
90
- # Script: Wait for analysis, then act on results
91
- genie run --quiet code/analyze "Check dependencies" > deps.json
92
- if grep -q "vulnerable" deps.json; then
93
- echo "Security issues found!"
94
- exit 1
95
- fi
96
- ```
97
-
98
- ---
99
-
100
- ## 3. Monitor Background Tasks
101
-
102
- **Command:** `genie task monitor <task-id>`
103
- - Attach to running task
104
- - Stream live logs
105
- - Wait for completion
106
-
107
- ### Usage
108
- ```bash
109
- # Start task in background
110
- TASK_ID=$(genie task --quiet code/explore "Long analysis" | jq -r '.task_id')
111
-
112
- # Monitor it later
113
- genie task monitor $TASK_ID
114
- ```
115
-
116
- ### Automation Example
117
- ```bash
118
- # Cron: Start task, then monitor in separate job
119
- # Job 1 (every hour): Start task
120
- 0 * * * * genie task --quiet code/explore "Hourly check" | jq -r '.task_id' > /tmp/task-id.txt
121
-
122
- # Job 2 (5 mins later): Monitor completion
123
- 5 * * * * genie task monitor $(cat /tmp/task-id.txt) >> /var/log/monitored.log 2>&1
124
- ```
125
-
126
- ---
127
-
128
- ## 4. Query Task Status
129
-
130
- ### List All Tasks
131
- ```bash
132
- # Show all tasks (table format)
133
- genie list tasks
134
-
135
- # Sample output:
136
- | Task ID | Agent | Status | Executor |
137
- |--------------|--------------|---------|------------------|
138
- | abc-123... | code/explore | running | CLAUDE_CODE/DEFAULT |
139
- ```
140
-
141
- ### View Task Output
142
- ```bash
143
- # Get full transcript
144
- genie view <task-id>
145
-
146
- # Live view (auto-refresh)
147
- genie view --live <task-id>
148
-
149
- # Full history
150
- genie view --full <task-id>
151
- ```
152
-
153
- ### Automation Examples
154
- ```bash
155
- # Check if any tasks are still running
156
- if genie list tasks | grep -q "running"; then
157
- echo "Tasks still in progress"
158
- fi
159
-
160
- # Get specific task result
161
- genie view abc-123 > task-output.txt
162
- ```
163
-
164
- ---
165
-
166
- ## 5. Task Control
167
-
168
- ### Stop Running Task
169
- ```bash
170
- genie stop <task-id>
171
- ```
172
-
173
- ### Resume Conversation
174
- ```bash
175
- # Continue from previous task
176
- genie resume <task-id> "Follow-up question"
177
- ```
178
-
179
- ---
180
-
181
- ## 6. System Health Checks
182
-
183
- ### Check Genie Status
184
- ```bash
185
- genie status
186
-
187
- # Output:
188
- 🧞 GENIE STATUS
189
- 📦 Forge Backend: 🟢 Running
190
- 📡 MCP Server: ...
191
- ```
192
-
193
- ### Automation Example
194
- ```bash
195
- # Pre-flight check before running tasks
196
- if ! genie status | grep -q "🟢 Running"; then
197
- echo "Forge not running, starting..."
198
- genie & # Start Genie server
199
- sleep 5
200
- fi
201
-
202
- # Now safe to run tasks
203
- genie task code/explore "Check system"
204
- ```
205
-
206
- ---
207
-
208
- ## 7. Executor Control
209
-
210
- ### Override Default Executor
211
- ```bash
212
- # Use specific executor
213
- genie task -x OPENCODE code/explore "Use OpenCode"
214
- genie task --executor GEMINI code/explore "Use Gemini"
215
-
216
- # Use specific model
217
- genie task -m "gpt-4" code/explore "Use GPT-4"
218
- ```
219
-
220
- ### Automation Example
221
- ```bash
222
- # Distribute load across executors
223
- for executor in CLAUDE_CODE OPENCODE GEMINI; do
224
- genie task -x $executor code/explore "Check $executor" &
225
- done
226
- wait # Wait for all background tasks
227
- ```
228
-
229
- ---
230
-
231
- ## 8. Advanced Patterns
232
-
233
- ### Parallel Execution
234
- ```bash
235
- # Run multiple tasks simultaneously
236
- genie task code/explore "Task 1" &
237
- genie task code/analyze "Task 2" &
238
- genie task code/tests "Task 3" &
239
- wait # Wait for all to finish
240
- ```
241
-
242
- ### Error Handling
243
- ```bash
244
- # Capture exit code
245
- genie run --quiet code/tests "Run tests"
246
- EXIT_CODE=$?
247
-
248
- if [ $EXIT_CODE -ne 0 ]; then
249
- echo "Task failed with code $EXIT_CODE"
250
- # Notify, retry, etc.
251
- fi
252
- ```
253
-
254
- ### Task Chaining
255
- ```bash
256
- # Sequential tasks with error checking
257
- TASK1=$(genie task --quiet code/explore "Step 1" | jq -r '.task_id')
258
- genie task monitor $TASK1 || exit 1
259
-
260
- TASK2=$(genie task --quiet code/analyze "Step 2" | jq -r '.task_id')
261
- genie task monitor $TASK2 || exit 1
262
-
263
- echo "Pipeline complete!"
264
- ```
265
-
266
- ### Retry Logic
267
- ```bash
268
- # Retry failed tasks
269
- MAX_RETRIES=3
270
- RETRY=0
271
-
272
- while [ $RETRY -lt $MAX_RETRIES ]; do
273
- genie run --quiet code/tests "Run tests" && break
274
- RETRY=$((RETRY + 1))
275
- echo "Retry $RETRY/$MAX_RETRIES"
276
- sleep 10
277
- done
278
- ```
279
-
280
- ---
281
-
282
- ## 9. CI/CD Integration
283
-
284
- ### GitHub Actions Example
285
- ```yaml
286
- - name: Run Genie Analysis
287
- run: |
288
- genie task --quiet code/analyze "Analyze PR changes" > task.json
289
- TASK_ID=$(jq -r '.task_id' task.json)
290
- genie task monitor $TASK_ID
291
- ```
292
-
293
- ### Jenkins Example
294
- ```groovy
295
- stage('Genie Quality Check') {
296
- steps {
297
- sh 'genie run --quiet code/code-quality "Check code quality" > report.json'
298
- archiveArtifacts 'report.json'
299
- }
300
- }
301
- ```
302
-
303
- ---
304
-
305
- ## 10. Logging & Output
306
-
307
- ### Structured Logging
308
- ```bash
309
- # JSON output for parsing
310
- genie task code/explore "Check" | jq '.task_id'
311
-
312
- # Human-readable output
313
- genie run code/explore "Generate report" | tee report.json
314
- ```
315
-
316
- ### Log Rotation
317
- ```bash
318
- # Cron with log rotation
319
- */15 * * * * genie task --quiet code/explore "Check" >> /var/log/genie/$(date +\%Y\%m\%d).log 2>&1
320
-
321
- # Keep last 7 days
322
- find /var/log/genie/ -name "*.log" -mtime +7 -delete
323
- ```
324
-
325
- ---
326
-
327
- ## Best Practices
328
-
329
- 1. **Use `--quiet`** in cron to suppress version warnings
330
- 2. **Use `jq`** to extract specific fields from JSON output
331
- 3. **Check `genie status`** before heavy automation
332
- 4. **Save task IDs** for later monitoring/debugging
333
- 5. **Use JSON output** for programmatic parsing
334
- 6. **Set explicit executor** if you need consistency
335
- 7. **Monitor long tasks** via `genie task monitor`
336
- 8. **Handle errors** - check exit codes in scripts
337
-
338
- ---
339
-
340
- ## Common Issues
341
-
342
- **Workspace Version Warning:**
343
- ```bash
344
- ⚠️ Workspace behind: workspace 2.5.19 ← global 2.5.20
345
- ```
346
- Solution: Use `--quiet` flag or run `genie` once to sync.
347
-
348
- **Forge Not Running:**
349
- ```bash
350
- ❌ Forge backend unreachable
351
- ```
352
- Solution: Start Forge with `genie` (no args) or check `genie status`.
353
-
354
- **Task Stuck:**
355
- ```bash
356
- genie stop <task-id> # Kill stuck task
357
- genie list tasks # Check status
358
- ```
359
-
@@ -1,60 +0,0 @@
1
- # Genie Dev Environment Configuration
2
- Genie Dev relies on a small set of environment variables to steer the CLI, model selection, and self-improvement experiments. Configure these in a local `.env` and load them before running the CLI.
3
-
4
- ## Conventions
5
- - Names: UPPER_SNAKE_CASE
6
- - Types: string | int (ms) | bool (`0/1` or `true/false`)
7
- - Scope legend: [required], [optional], [experimental]
8
-
9
- ## Core CLI
10
- - APP_NAME [optional]: defaults to `Genie Dev`
11
- - APP_ENV [optional]: `dev|staging|prod` (default `dev`)
12
- - GENIE_BRANCH [optional]: branch name used for wish/forge guidance (default `genie-dev`)
13
- - LOG_LEVEL [optional]: `trace|debug|info|warn|error` (default `info`)
14
-
15
- ## Genie Runtime
16
- - GENIE_MODEL [required]: model identifier used by agents (e.g., `gpt-5`)
17
- - GENIE_APPROVAL_POLICY [optional]: `on-request|on-failure|never|untrusted` (default approval behavior)
18
- - GENIE_SANDBOX_MODE [optional]: `workspace-write|read-only|danger-full-access` (default sandbox mode)
19
- - GENIE_CLI_STYLE [optional]: `plain|compact|art` (default `compact`)
20
-
21
- Note: Agent-specific sandbox and approval settings in frontmatter override these defaults.
22
-
23
- ## Provider Credentials
24
- - OPENAI_API_KEY or ALTERNATE_PROVIDER_KEY [required]: API key for the LLM provider
25
- - PROVIDER_ENDPOINT [optional]: override base URL when pointing at non-default gateways
26
- - PROVIDER_REGION [optional]: specify regional routing if required by service policy
27
-
28
- ## Experiment Toggles
29
- - ENABLE_LEARN_SYNC [optional]: `0|1` (default `1`) — when disabled, learn updates are reported but not auto-applied
30
- - ENABLE_TWIN_DEFAULT [optional]: `0|1` (default `0`) — automatically schedule twin audits for high-risk wishes
31
- - DONE_REPORT_DIR [optional]: overrides `.genie/wishes/<slug>/reports/` when storing experiment evidence elsewhere
32
-
33
- ## Safety Limits
34
- - MAX_CONCURRENT_AGENTS [optional]: limit parallel CLI sessions (default `5`)
35
- - SESSION_TIMEOUT_SECONDS [optional]: auto-stop background sessions after N seconds (default `3600`)
36
- - RATE_LIMIT_RPS [optional]: throttles outbound provider calls (default `60`)
37
-
38
- ## Example .env (development)
39
- ```env
40
- APP_NAME="Genie Dev"
41
- APP_ENV=dev
42
- GENIE_BRANCH=genie-dev
43
- LOG_LEVEL=debug
44
-
45
- GENIE_MODEL=gpt-5
46
- GENIE_APPROVAL_POLICY=on-request
47
- GENIE_SANDBOX_MODE=workspace-write
48
- GENIE_CLI_STYLE=compact
49
-
50
- OPENAI_API_KEY=replace_me
51
- ENABLE_SELF_LEARN_SYNC=1
52
- ENABLE_TWIN_DEFAULT=0
53
- MAX_CONCURRENT_AGENTS=5
54
- SESSION_TIMEOUT_SECONDS=3600
55
- ```
56
-
57
- ## Notes
58
- - Never commit real API keys or secrets; rely on `.env` files and secret managers
59
- - Keep experimental toggles disabled by default when preparing release candidates for downstream repos
60
- - Align CLI harness configuration with the approval policy documented in active wishes to avoid mismatched expectations
@@ -1,60 +0,0 @@
1
- # Genie Dev Mission
2
- ## Pitch
3
-
4
- Genie Dev is the self-development branch of the Genie framework. It turns the template into a living meta-agent that can audit, upgrade, and validate its own workflow stack while remaining installable in any host repository.
5
-
6
- ## Users
7
-
8
- ### Primary Customers
9
-
10
- - **Framework Maintainers:** Steer the Genie prompt stack and CLI toward higher autonomy without losing human oversight.
11
- - **Power Users / Partner Teams:** Pilot emerging self-improvement patterns and feed structured evidence back into the core templates.
12
-
13
- ### User Personas
14
-
15
- **Meta-Orchestrator**
16
- - **Role:** Maintains Genie agents and safeguards guardrails
17
- - **Context:** Needs rapid iteration on prompts, policies, and diagnostics without destabilizing downstream repos
18
- - **Pain Points:** Slow feedback loops, fragmented experiments, weak traceability when agents evolve themselves
19
- - **Goals:** Tighten validation loops, capture every change rationale, and publish upgrade paths that downstream repos can adopt deliberately
20
-
21
- **Pilot Squad Lead**
22
- - **Role:** Early adopter embedding Genie into complex delivery environments
23
- - **Context:** Validates new meta-agent behaviours before they ship broadly
24
- - **Pain Points:** Unclear upgrade guidance, lack of proof that automation changes are safe, difficulty reporting outcomes
25
- - **Goals:** Receive pre-baked playbooks, evidence kits, and rollback guidance for every self-improvement release
26
-
27
- ## The Problem
28
-
29
- ### Self-Evolving Agents Need Structure
30
- Genie’s templates must improve themselves without eroding trust or breaking installs across diverse projects.
31
-
32
- **Our Approach:** Codify meta-agent upgrades as wishes with verifiable evidence, ensuring every prompt or workflow change is paired with metrics and rollback hooks.
33
-
34
- ### Feedback Loops Are Opaque
35
- Learnings often stay buried in session transcripts, delaying improvements to prompts and guardrails.
36
-
37
- **Our Approach:** Promote learnings into persistent documentation, align them with experiments, and surface them in done reports so humans can audit evolution.
38
-
39
- ### Downstream Risk Management
40
- Branch experimentation can create surprises for adopters if success criteria are not explicit.
41
-
42
- **Our Approach:** Treat this branch as the proving ground for phased releases, publish adoption kits, and require validation evidence before merging into the canonical template.
43
-
44
- ## Differentiators
45
-
46
- ### Meta-Agent Feedback Harness
47
- Purpose-built to let Genie run experiments on itself, capture the outcomes, and decide what ships.
48
-
49
- ### Evidence-First Governance
50
- Every change must tie back to a wish, a forge plan, validation commands, and a done report stored under `.genie/wishes/<slug>/reports/`.
51
-
52
- ### Human-in-the-Loop Control
53
- Automation never bypasses human approval gates; new capabilities arrive with clear opt-in guidance and rollback instructions.
54
-
55
- ## Key Focus Areas
56
-
57
- - **Self-Audit Loops:** Plan → Wish → Forge cycles targeted at the prompt stack, CLAUDE/AGENTS guardrails, and CLI behaviours.
58
- - **Learning Propagation:** Promote validated learnings into `.genie/instructions/` and agent briefs so changes stick.
59
- - **Tooling Diagnostics:** Expand test harnesses and smoke commands that ensure the CLI behaves before releases.
60
- - **Adoption Playbooks:** Provide branch-to-main migration guides, change logs, and decision records for every improvement wave.
@@ -1,44 +0,0 @@
1
- # Genie Dev Roadmap
2
- The genie-dev branch is the laboratory for Genie’s self-improvement program. Phases are sequenced to keep downstream adopters safe while we iterate quickly.
3
-
4
- ## Phase 0 — Baseline Capture (✅ complete)
5
- - Neutralize template placeholders and document the current mission, tech stack, and guardrails
6
- - Inventory existing behavioural learnings and confirm they are enforced across agents
7
- - Establish `pnpm run build:genie` + smoke tests as the minimum verification gate
8
-
9
- ## Phase 1 — Instrumentation & Telemetry (in progress)
10
- - Treat the wish **Evidence Checklist** as the gating deliverable before other instrumentation tasks proceed (see ).
11
- - Add branch-specific checklists to every wish to log evidence paths and validation commands
12
- - Expand done-report coverage so each experiment stores scope, risks, and follow-ups
13
- - Wire CLI diagnostics to surface missing sessions or misconfigured presets
14
-
15
- ## Phase 2 — Guided Self-Improvement
16
- - Author wishes that target prompt quality, guardrail clarity, and CLI usability
17
- - Pair each wish with twin audits and validation scripts before merging back to `main`
18
- - Promote validated learnings into `.genie/instructions/` and agent briefs
19
-
20
- ## Phase 3 — Adoption Kits for Downstream Repos
21
- - Package upgrade notes, migration diffs, and rollback guidance for every major change
22
- - Publish branch-to-main release checklist (Plan → Wish → Forge coverage, tests, done report link)
23
- - Partner with pilot teams to trial upgrades and capture their feedback in structured templates
24
-
25
- ## Phase 4 — Automation & CI Integration
26
- - Land GitHub Actions pipeline that runs build + smoke tests and attaches artefacts to PRs
27
- - Add regression checks for behavioural rules (learn, guardrail compliance)
28
- - Introduce metrics capture (latency, wish completion velocity) with reporting hooks
29
-
30
- ## Success Metrics
31
- - 100% of genie-dev wishes include validation commands and evidence links
32
- - Smoke suite (`pnpm run test:genie`) passing before merge on every PR
33
- - Documented learnings promoted within 48 hours of validation
34
- - Downstream adopters report <5% rollback rate on genie-dev releases
35
-
36
- ## Dependencies & Enablers
37
- - Maintainers available for twin reviews and manual approvals
38
- - Access to GPT-5 class models (configurable via `GENIE_MODEL`)
39
- - Stable sandboxed environment mirroring production guardrails
40
-
41
- ## Risk Log (actively monitored)
42
- - **Automation drift:** self-improvement scripts may bypass approval gates → mitigate with review checklist baked into wishes
43
- - **Telemetry gaps:** missing evidence makes regression root-cause harder → mitigate by enforcing done report template updates
44
- - **Adopter fatigue:** too many upgrades without guides → mitigate by bundling changes into release kits with opt-in toggles
@@ -1,34 +0,0 @@
1
- # Genie Dev Technical Stack
2
- Genie Dev extends the core Genie template with diagnostics and automation focused on self-evolution. The stack stays lightweight so downstream repos can still install it cleanly.
3
-
4
- ## Core CLI
5
- - **Runtime:** Node.js 20.x managed with `pnpm`
6
- - **Language:** TypeScript 5.9 (compiled via `src/cli/tsconfig.json`)
7
- - **UI:** `ink` + `react` for interactive CLI flows
8
- - **Formatting & Parsing:** `yaml` for agent metadata, native fs/stream tooling for logs
9
-
10
- ## Agent Assets
11
- - **Prompts:** Markdown agents under `.genie/agents/` with shared personas in `.genie/agents/core/`
12
- - **Project Overrides:** Add a short "Project Notes" section inside relevant agent or spell docs (no separate `custom/` directory)
13
- - **State:** Session and ledger files stored in `.genie/state/` (never edit manually; inspect via MCP genie tools: `mcp__genie__list_sessions`, `mcp__genie__view`)
14
-
15
- ## Testing & Validation
16
- - **Smoke Suite:** `tests/genie-cli.test.js` exercises CLI commands and prompt loading
17
- - **Identity Check:** `tests/identity-smoke.sh` ensures guardrails match expectations
18
- - **Recommended Checks:** `pnpm run build:genie` followed by `pnpm run test:genie` before publishing upgrades
19
-
20
- ## Meta-Agent Instrumentation
21
- - **Done Reports:** `.genie/wishes/<slug>/reports/` captures experiment evidence and upgrade readiness
22
- - **Learning Ledger:** `.genie/instructions/*` houses behavioural overrides promoted from experiments
23
- - **Genie Orchestrator:** `.genie/agents/orchestrator.md` powers second-opinion audits before adopting risky changes
24
-
25
- ## Toolchain Integrations
26
- - **Version Control:** Git-driven; branch `genie-dev` serves as the experimental lane
27
- - **CI Hooks (planned):** GitHub Actions pipeline to run build + smoke tests and publish artefacts for review
28
- - **Optional Runtimes:** Node/TS remains primary; Rust components can be referenced via `vendors/` for cross-language experiments
29
-
30
- ## Observability
31
- - **Logs:** CLI captures command transcripts under `.genie/state/logs/`
32
- - **Metrics (manual):** Encourage recording latency/quality metrics inside wish evidence tables until automated collectors land
33
-
34
- This stack keeps Genie fast to iterate while providing the hooks required for self-auditing and safe downstream adoption.