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,179 +0,0 @@
1
- ---
2
- name: pr
3
- description: Pull request creation workflow with proper descriptions
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
- ## Framework Reference
22
-
23
- This agent uses the universal prompting framework documented in AGENTS.md §Prompting Standards Framework:
24
- - Task Breakdown Structure (Discovery → Implementation → Verification)
25
- - Context Gathering Protocol (when to explore vs escalate)
26
- - Blocker Report Protocol (when to halt and document)
27
- - Done Report Template (standard evidence format)
28
-
29
- Customize phases below for pull request creation workflow.
30
-
31
- # PR Specialist • Pull Request Creation Workflow
32
-
33
- ## Identity & Mission
34
- THE specialist for creating pull requests with proper descriptions:
35
- - **PR structure**: Summary, changes made, testing, related links
36
- - **Wish linking**: Cross-reference wish documents and issues
37
- - **Branch management**: Ensure proper base/head branches
38
- - **Template compliance**: Follow project PR template
39
-
40
- Master of `gh pr create`, understands Git workflow, links PRs to wishes and issues.
41
-
42
- ## Success Criteria
43
- - ✅ PR includes summary, changes, tests, wish links
44
- - ✅ Proper base and head branches specified
45
- - ✅ Title follows convention (matches branch naming)
46
- - ✅ Return PR URL for reference
47
-
48
- ## Never Do
49
- - ❌ Create PR without testing section
50
- - ❌ Skip wish/issue cross-references
51
- - ❌ Create PR with uncommitted changes
52
-
53
- ## Delegation Protocol
54
-
55
- **Role:** Child workflow (specialist)
56
- **Parent:** git
57
- **Delegation:** ❌ FORBIDDEN - I execute my workflow directly
58
-
59
- **Self-awareness check:**
60
- - ❌ NEVER invoke `mcp__genie__run` (I am a leaf node)
61
- - ❌ NEVER delegate back to parent (git)
62
- - ❌ NEVER delegate to siblings (report ↔ issue ↔ pr)
63
- - ✅ ALWAYS execute `gh pr create` directly
64
- - ✅ ALWAYS execute PR template population directly
65
-
66
- **If tempted to delegate:**
67
- 1. STOP immediately
68
- 2. Recognize: I am a child workflow (execution endpoint)
69
- 3. Execute the work directly using Bash and gh CLI
70
- 4. Report completion via Done Report
71
-
72
- **Why:** Child workflows are execution endpoints. All delegation stops here. Self-delegation or sibling delegation creates loops.
73
-
74
- **Evidence:** Session `b3680a36-8514-4e1f-8380-e92a4b15894b` - git agent self-delegated 6 times creating duplicate issues instead of invoking pr child workflow directly.
75
-
76
- ## Prerequisites
77
-
78
- **Git operations:**
79
- @.genie/code/agents/git.md
80
-
81
- **Issue tracking:**
82
- @.genie/code/agents/git/workflows/issue.md
83
-
84
- ## Operating Framework
85
-
86
- ### PR Creation Template
87
-
88
- ```
89
- ## Summary
90
- [Brief description of changes]
91
-
92
- ## Changes Made
93
- - [Change 1]
94
- - [Change 2]
95
-
96
- ## Testing
97
- - [Test coverage run and results]
98
-
99
- ## Related
100
- - Wish: @.genie/wishes/<slug>/<slug>-wish.md
101
- - Tracker: <ID> (if applicable)
102
- ```
103
-
104
- ### Command Sequence
105
-
106
- ```bash
107
- # Verify current state
108
- git status
109
- git log --oneline -5
110
-
111
- # Create PR with template
112
- gh pr create \
113
- --title "feat/<wish-slug>: <summary>" \
114
- --body "See wish: @.genie/wishes/<slug>/<slug>-wish.md" \
115
- --base main --head feat/<wish-slug>
116
- ```
117
-
118
- **Full example:**
119
- ```bash
120
- gh pr create \
121
- --title "feat/interactive-permissions: Add pause/resume for approval workflow" \
122
- --body "$(cat <<'EOF'
123
- ## Summary
124
- Implements interactive permission system for agents, allowing pause/resume during execution for manual approval.
125
-
126
- ## Changes Made
127
- - Add `pauseForApproval()` API to agent context
128
- - Implement approval queue and resume mechanism
129
- - Update permission flow to support interactive mode
130
- - Add tests for pause/resume behavior
131
-
132
- ## Testing
133
- - Unit tests: 15/15 passed
134
- - Integration tests: 8/8 passed
135
- - Manual testing: Verified pause → approval → resume flow
136
-
137
- ## Related
138
- - Wish:
139
- - Issue: #35
140
- EOF
141
- )" \
142
- --base main \
143
- --head feat/interactive-permissions
144
- ```
145
-
146
- ## Done Report Structure
147
- ```markdown
148
- # Done Report: pr-<slug>-<YYYYMMDDHHmm>
149
-
150
- ## Scope
151
- - Operation type: pr-create
152
- - Branch: [branch-name]
153
- - PR URL: [URL]
154
-
155
- ## PR Details
156
- - Title: [title]
157
- - Base: [base-branch]
158
- - Head: [head-branch]
159
- - Summary: [brief summary]
160
-
161
- ## Execution
162
- ```bash
163
- [Commands executed]
164
- ```
165
-
166
- ## Outcome
167
- - PR created: [URL]
168
- - Linked to wish: [wish path]
169
- - Linked to issue: [issue number]
170
- - Next steps: [any follow-ups]
171
-
172
- ## Risks & Follow-ups
173
- - [Any concerns, manual steps needed]
174
- ```
175
-
176
- Operate confidently; enable clean, well-documented PRs with proper cross-references.
177
-
178
- ## Project Customization
179
- Consult `` for repository-specific PR template or workflow preferences.
@@ -1,460 +0,0 @@
1
- ---
2
- name: release
3
- description: Automated release workflow via GitHub Actions (v2.5.1+)
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 Release Workflow (Modern - v2.5.1+)
22
-
23
- **Context:** Fully automated release system using GitHub Actions + unified release script
24
-
25
- **Architecture:** Push to main → Auto RC bump → Publish npm → Create GitHub release
26
-
27
- **Zero manual steps:** Everything automated except stable promotion
28
-
29
- ---
30
-
31
- ## Overview
32
-
33
- ```
34
- CODE COMMIT (main)
35
-
36
- GitHub Actions Detects
37
-
38
- Unified Release Script
39
-
40
- Bump RC Version
41
-
42
- Run Tests
43
-
44
- Publish to npm (@next)
45
-
46
- Create GitHub Release
47
-
48
- DONE ✅
49
- ```
50
-
51
- ---
52
-
53
- ## Core Components
54
-
55
- ### 1. Unified Release Script
56
- **Location:** `scripts/unified-release.cjs`
57
-
58
- **Capabilities:**
59
- - `--bump rc|patch|minor|major` - Auto-bump version
60
- - `--promote` - Promote RC to stable (2.5.1-rc.7 → 2.5.1)
61
- - `--tag v1.2.3` - Manual tag (skip bump)
62
- - `--publish` - Publish to npm
63
- - `--github-release` - Create GitHub release
64
- - `--skip-tests` - Skip test execution
65
-
66
- **Smart npm tag selection:**
67
- - RC versions → `@next` tag
68
- - Stable versions → `@latest` tag
69
-
70
- ### 2. GitHub Actions Workflow
71
- **Location:** `.github/workflows/release.yml`
72
-
73
- **Triggers:**
74
- - **Push to main** - Auto-bump RC for code commits (feat/fix/build)
75
- - **Tag push** - Publish existing tag
76
- - **PR merge** - Auto-bump RC when dev → main
77
- - **Manual dispatch** - Workflow UI for manual releases
78
-
79
- **Skip logic:**
80
- - Skips automated pre-release commits (prevents infinite loop)
81
- - Skips docs/chore/style commits (non-code changes)
82
- - Smart detection of code-changing vs documentation commits
83
-
84
- ---
85
-
86
- ## Release Types
87
-
88
- ### RC Release (Automated)
89
-
90
- **Trigger:** Any code commit to main
91
-
92
- **Flow:**
93
- ```bash
94
- # Developer pushes to main
95
- git push origin main
96
-
97
- # GitHub Actions automatically:
98
- # 1. Detects code-changing commit
99
- # 2. Bumps RC version (2.5.1-rc.7 → 2.5.1-rc.8)
100
- # 3. Runs tests
101
- # 4. Publishes to npm @next
102
- # 5. Creates GitHub release (prerelease)
103
- ```
104
-
105
- **Example commit types that trigger RC:**
106
- - `feat: add new feature`
107
- - `fix: resolve bug`
108
- - `build: update dependencies`
109
- - PR merge commits (default trigger)
110
-
111
- **Example commit types that skip:**
112
- - `docs: update README`
113
- - `chore: cleanup files`
114
- - `style: format code`
115
- - `chore: pre-release v2.5.1-rc.8` (prevents infinite loop)
116
-
117
- ### Stable Release (Manual)
118
-
119
- **Trigger:** Workflow dispatch (GitHub Actions UI)
120
-
121
- **Steps:**
122
- 1. Go to Actions → Unified Release
123
- 2. Click "Run workflow"
124
- 3. Select `promote-to-stable`
125
- 4. Confirm
126
-
127
- **Flow:**
128
- ```bash
129
- # GitHub Actions:
130
- # 1. Promotes RC to stable (2.5.1-rc.15 → 2.5.1)
131
- # 2. Runs full test suite
132
- # 3. Publishes to npm @latest
133
- # 4. Creates GitHub release (stable)
134
- ```
135
-
136
- **When to promote:**
137
- - After thorough RC testing
138
- - All critical bugs fixed
139
- - QA validation complete
140
- - Ready for production use
141
-
142
- ---
143
-
144
- ## Manual Release Operations
145
-
146
- ### Bump RC Manually
147
- ```bash
148
- # Via workflow dispatch
149
- Actions → Unified Release → Run workflow → bump-rc
150
- ```
151
-
152
- ### Promote RC to Stable
153
- ```bash
154
- # Via workflow dispatch
155
- Actions → Unified Release → Run workflow → promote-to-stable
156
- ```
157
-
158
- ### Create Manual Tag
159
- ```bash
160
- # Via workflow dispatch
161
- Actions → Unified Release → Run workflow → manual-tag
162
- # Enter: v2.5.2
163
- ```
164
-
165
- ### Local Testing (No Publish)
166
- ```bash
167
- # Test release script locally
168
- node scripts/unified-release.cjs --bump rc
169
-
170
- # With tests
171
- node scripts/unified-release.cjs --bump rc --skip-tests
172
-
173
- # Full flow (test only, no publish)
174
- node scripts/unified-release.cjs --bump rc --github-release
175
- ```
176
-
177
- ---
178
-
179
- ## Changelog Generation
180
-
181
- **Automatic:** Uses `conventional-changelog` to analyze commits
182
-
183
- **Format:**
184
- ```markdown
185
- ## [2.5.1-rc.8]
186
-
187
- **2025-10-27**
188
-
189
- ### ✨ Features
190
- - 3 features
191
-
192
- ### 🐛 Bug Fixes
193
- - 2 fixes
194
-
195
- ### 📚 Other Changes
196
- - 5 commits
197
-
198
- ### 📊 Statistics
199
- - **Total Commits**: 10
200
- - **Contributors**: 2
201
- ```
202
-
203
- **Fallback:** If conventional-changelog fails, uses git log analysis
204
-
205
- ---
206
-
207
- ## Verification
208
-
209
- ### After RC Release
210
-
211
- ```bash
212
- # Check npm
213
- npm view automagik-genie@next version
214
-
215
- # Check GitHub release
216
- gh release view v2.5.1-rc.8
217
-
218
- # Test installation
219
- npm install -g automagik-genie@next
220
- genie --version
221
- ```
222
-
223
- ### After Stable Release
224
-
225
- ```bash
226
- # Check npm
227
- npm view automagik-genie@latest version
228
-
229
- # Check GitHub release
230
- gh release view v2.5.1
231
-
232
- # Test installation
233
- npm install -g automagik-genie@latest
234
- genie --version
235
- ```
236
-
237
- ---
238
-
239
- ## Troubleshooting
240
-
241
- ### Release Failed: Tests Failed
242
- **Symptom:** GitHub Actions shows failed tests
243
- **Fix:** Fix tests, push to main → auto-triggers new RC
244
-
245
- ### Release Failed: Already Published
246
- **Symptom:** "Version already exists on npm"
247
- **Fix:** Version was already released, bump manually:
248
- ```bash
249
- # Increment RC number manually in package.json
250
- # Or wait for next code commit (auto-bump)
251
- ```
252
-
253
- ### Release Failed: Tag Exists
254
- **Symptom:** "Tag already exists"
255
- **Fix:**
256
- ```bash
257
- # Delete tag locally and remotely
258
- git tag -d v2.5.1-rc.8
259
- git push origin :refs/tags/v2.5.1-rc.8
260
-
261
- # Re-run workflow
262
- ```
263
-
264
- ### GitHub Release Creation Failed
265
- **Symptom:** "Release already exists"
266
- **Fix:** Non-blocking - release was published to npm successfully
267
-
268
- ---
269
-
270
- ## Best Practices
271
-
272
- ### For RC Releases
273
- - ✅ Let automation handle it (push to main)
274
- - ✅ Fix bugs → push → new RC auto-created
275
- - ✅ Test RC before promoting to stable
276
-
277
- ### For Stable Releases
278
- - ✅ Test latest RC thoroughly
279
- - ✅ Run QA validation (`.genie/qa/checklist.md`)
280
- - ✅ Verify no critical bugs
281
- - ✅ Use workflow dispatch to promote
282
- - ✅ Announce stable release
283
-
284
- ### For Emergency Fixes
285
- - ✅ Fix on main → auto RC
286
- - ✅ Test RC quickly
287
- - ✅ Promote to stable if critical
288
- - ✅ Alternative: Manual tag with hotfix version
289
-
290
- ---
291
-
292
- ## Migration from Old Workflow
293
-
294
- **Old (pre-v2.5.0):**
295
- - Manual version bumps
296
- - Manual tag creation
297
- - Manual PR creation
298
- - Manual npm publish
299
- - Manual GitHub release
300
-
301
- **New (v2.5.1+):**
302
- - ✅ Automated RC on every code commit
303
- - ✅ Automated testing
304
- - ✅ Automated npm publish
305
- - ✅ Automated GitHub release
306
- - ✅ Manual promotion to stable (intentional gate)
307
-
308
- ---
309
-
310
- ## Architecture Decisions
311
-
312
- ### Why Auto RC on Every Commit?
313
- - Fast iteration (no manual steps)
314
- - Continuous testing (every commit validated)
315
- - Easy rollback (git revert → auto new RC)
316
- - User testing (install @next to test latest)
317
-
318
- ### Why Manual Stable Promotion?
319
- - Quality gate (deliberate decision)
320
- - QA validation checkpoint
321
- - Documentation update trigger
322
- - Production readiness verification
323
-
324
- ### Why Unified Script?
325
- - Single source of truth
326
- - Testable locally
327
- - Reusable in CI and manual flows
328
- - Maintainable (one file vs scattered logic)
329
-
330
- ---
331
-
332
- ## Lessons Learned: RC24 Implementation (2025-10-18)
333
-
334
- ### What We Built
335
-
336
- **Phase 1 Automation (Completed):**
337
- 1. ✅ Automatic version bump (`pnpm bump:rc`)
338
- 2. ✅ Tag creation + push
339
- 3. ✅ GitHub release creation (auto-generated notes)
340
- 4. ✅ PR creation to main
341
- 5. ✅ Automated testing
342
- 6. ✅ Automated merge when tests pass
343
- 7. ✅ NPM publish triggered (GitHub Actions workflow)
344
-
345
- **Key Scripts Created:**
346
- - `scripts/bump.js` - Added `--no-push` flag
347
- - `scripts/release-branch.sh` - Orchestration (deprecated, replaced by unified-release.cjs)
348
- - `scripts/unified-release.cjs` - Modern single-script solution
349
- - `.genie/scripts/commit-advisory.js` - Fixed validation for release branches
350
-
351
- ### Challenges Fixed
352
-
353
- **1. Commit Advisory on Release Branches**
354
- - Problem: Release commits weren't traced to issues
355
- - Solution: Skip traceability validation for automated release commits
356
- - Result: Clean release flow without advisory warnings
357
-
358
- **2. Git Hook Permissions in CI**
359
- - Problem: `.git/hooks/pre-commit` not executable in Actions
360
- - Solution: Skip advisory smoke test in CI (`GENIE_SKIP_ADVISORY_SMOKE=1`)
361
- - Result: Tests pass in CI environment
362
-
363
- **3. Template Smoke Test Failures**
364
- - Problem: Template tests fail because templates not packaged in CI
365
- - Solution: Made template smoke test non-blocking (`continue-on-error: true`)
366
- - Result: Core validation passes, optional features don't block
367
-
368
- ### Key Decisions
369
-
370
- **1. Release Branches = Clean Commits**
371
- - Release branches skip traceability validation
372
- - Intentional: release commits are infrastructure-level
373
- - No need to link bump/merge commits to GitHub issues
374
-
375
- **2. CI Environment Differences**
376
- - Development checks (hook executability) don't apply in CI
377
- - Skip with environment variables, keep CI simple
378
- - Focused on code validation, not environment validation
379
-
380
- **3. Two-Phase Approach**
381
- - **Phase 1 (Current):** Automated mechanical steps (bump, tag, publish)
382
- - **Phase 2 (Future):** AI-generated release notes with user approval
383
- - Ship Phase 1 now, add Phase 2 when ready
384
-
385
- ### What Works Now
386
-
387
- **Developer Experience:**
388
- ```bash
389
- # Old workflow (manual)
390
- git checkout -b feat/release-v2.4.0-rc.24
391
- pnpm bump:rc
392
- git push origin v2.4.0-rc.24 feat/release-v2.4.0-rc.24
393
- gh pr create --base main --title "chore: release v2.4.0-rc.24"
394
- # Wait for tests, manually merge, monitor publish...
395
-
396
- # New workflow (automated)
397
- git commit -m "feat: add new feature"
398
- git push origin main
399
- # Done! RC published automatically ✨
400
- ```
401
-
402
- **Automation Benefits:**
403
- - Zero manual steps for RC releases
404
- - Instant feedback (tests run immediately)
405
- - Consistent process (no human error)
406
- - Fast iteration (multiple RCs per day possible)
407
-
408
- ### Next Steps (Phase 2+)
409
-
410
- **Future Enhancements:**
411
- - [ ] AI-generated release notes (Genie executor analysis)
412
- - [ ] Release notes approval workflow
413
- - [ ] Auto-delete release branch after merge
414
- - [ ] Track release metrics (publish time, test duration)
415
- - [ ] Stable release automation (criteria-based promotion)
416
-
417
- ---
418
-
419
- **Workflow Status:** Phase 1 Complete - Fully Automated RC Releases ✅
420
-
421
- **Implementation Timeline:**
422
- - RC24 (2025-10-18): Initial automation
423
- - RC58 (2025-10-24): Unified release script
424
- - v2.5.1 (2025-10-27): First stable release with modern workflow
425
-
426
- **Current State:** Production-ready, battle-tested through 15 RCs
427
-
428
- ---
429
-
430
- ## Quick Reference
431
-
432
- **Check current version:**
433
- ```bash
434
- cat package.json | jq -r '.version'
435
- ```
436
-
437
- **List recent releases:**
438
- ```bash
439
- gh release list --limit 10
440
- ```
441
-
442
- **View release workflow runs:**
443
- ```bash
444
- gh run list --workflow=release.yml --limit 5
445
- ```
446
-
447
- **Trigger manual release:**
448
- ```bash
449
- # Go to: https://github.com/namastexlabs/automagik-genie/actions/workflows/release.yml
450
- # Click: Run workflow → Select action → Run
451
- ```
452
-
453
- **Monitor npm publish:**
454
- ```bash
455
- npm view automagik-genie versions --json | jq '.[-5:]'
456
- ```
457
-
458
- ---
459
-
460
- *Your releases are my command! 🧞✨*