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.
- package/CHANGELOG.md +86 -0
- package/README.md +105 -1
- package/bin/autopg-wrapper.cjs +16 -0
- package/bin/pgserve-wrapper.cjs +31 -6
- package/bin/postgres-server.js +56 -0
- package/console/README.md +131 -0
- package/console/api.js +173 -0
- package/console/app.jsx +483 -0
- package/console/colors_and_type.css +227 -0
- package/console/components.jsx +167 -0
- package/console/console.css +1666 -0
- package/console/data.jsx +350 -0
- package/console/index.html +31 -0
- package/console/screens/databases.jsx +5 -0
- package/console/screens/health.jsx +5 -0
- package/console/screens/ingress.jsx +5 -0
- package/console/screens/optimizer.jsx +5 -0
- package/console/screens/rlm-sim.jsx +5 -0
- package/console/screens/rlm-trace.jsx +5 -0
- package/console/screens/security.jsx +5 -0
- package/console/screens/settings.jsx +611 -0
- package/console/screens/sql.jsx +5 -0
- package/console/screens/sync.jsx +5 -0
- package/console/screens/tables.jsx +5 -0
- package/console/tweaks-panel.jsx +425 -0
- package/package.json +11 -1
- package/src/cli-config.cjs +310 -0
- package/src/cli-install.cjs +98 -11
- package/src/cli-restart.cjs +228 -0
- package/src/cli-ui.cjs +580 -0
- package/src/cluster.js +43 -38
- package/src/postgres.js +141 -19
- package/src/settings-loader.cjs +235 -0
- package/src/settings-migrate.cjs +212 -0
- package/src/settings-pg-args.cjs +146 -0
- package/src/settings-schema.cjs +422 -0
- package/src/settings-validator.cjs +416 -0
- package/src/settings-writer.cjs +288 -0
- package/.claude/context/windows-debug.md +0 -119
- package/.genie/AGENTS.md +0 -15
- package/.genie/agents/README.md +0 -110
- package/.genie/agents/analyze.md +0 -176
- package/.genie/agents/forge.md +0 -290
- package/.genie/agents/garbage-cleaner.md +0 -324
- package/.genie/agents/garbage-collector.md +0 -596
- package/.genie/agents/github-issue-gc.md +0 -618
- package/.genie/agents/review.md +0 -380
- package/.genie/agents/semantic-analyzer/find-duplicates.md +0 -90
- package/.genie/agents/semantic-analyzer/find-orphans.md +0 -99
- package/.genie/agents/semantic-analyzer.md +0 -101
- package/.genie/agents/update.md +0 -182
- package/.genie/agents/wish.md +0 -357
- package/.genie/brainstorms/pgserve-v2/DESIGN.md +0 -174
- package/.genie/code/AGENTS.md +0 -694
- package/.genie/code/agents/audit/risk.md +0 -173
- package/.genie/code/agents/audit/security.md +0 -189
- package/.genie/code/agents/audit.md +0 -145
- package/.genie/code/agents/challenge.md +0 -230
- package/.genie/code/agents/change-reviewer.md +0 -295
- package/.genie/code/agents/code-garbage-collector.md +0 -425
- package/.genie/code/agents/code-quality.md +0 -410
- package/.genie/code/agents/commit-suggester.md +0 -255
- package/.genie/code/agents/commit.md +0 -124
- package/.genie/code/agents/consensus.md +0 -204
- package/.genie/code/agents/daily-standup.md +0 -722
- package/.genie/code/agents/docgen.md +0 -48
- package/.genie/code/agents/explore.md +0 -79
- package/.genie/code/agents/fix.md +0 -100
- package/.genie/code/agents/git/commit-advisory.md +0 -219
- package/.genie/code/agents/git/workflows/issue.md +0 -244
- package/.genie/code/agents/git/workflows/pr.md +0 -179
- package/.genie/code/agents/git/workflows/release.md +0 -460
- package/.genie/code/agents/git/workflows/report.md +0 -342
- package/.genie/code/agents/git.md +0 -432
- package/.genie/code/agents/implementor.md +0 -161
- package/.genie/code/agents/install.md +0 -515
- package/.genie/code/agents/issue-creator.md +0 -344
- package/.genie/code/agents/polish.md +0 -116
- package/.genie/code/agents/qa.md +0 -653
- package/.genie/code/agents/refactor.md +0 -294
- package/.genie/code/agents/release.md +0 -1129
- package/.genie/code/agents/roadmap.md +0 -885
- package/.genie/code/agents/tests.md +0 -557
- package/.genie/code/agents/tracer.md +0 -50
- package/.genie/code/agents/update/upstream-update.md +0 -85
- package/.genie/code/agents/update/versions/generic-update.md +0 -305
- package/.genie/code/agents/vibe.md +0 -1317
- package/.genie/code/spells/agent-configuration.md +0 -58
- package/.genie/code/spells/automated-rc-publishing.md +0 -106
- package/.genie/code/spells/branch-tracker-guidance.md +0 -28
- package/.genie/code/spells/debug.md +0 -320
- package/.genie/code/spells/emoji-naming-convention.md +0 -303
- package/.genie/code/spells/evidence-storage.md +0 -26
- package/.genie/code/spells/file-naming-rules.md +0 -35
- package/.genie/code/spells/forge-code-blueprints.md +0 -195
- package/.genie/code/spells/genie-integration.md +0 -153
- package/.genie/code/spells/publishing-protocol.md +0 -61
- package/.genie/code/spells/team-consultation-protocol.md +0 -284
- package/.genie/code/spells/tool-requirements.md +0 -20
- package/.genie/code/spells/triad-maintenance-protocol.md +0 -154
- package/.genie/code/teams/tech-council/council.md +0 -328
- package/.genie/code/teams/tech-council/jt.md +0 -352
- package/.genie/code/teams/tech-council/nayr.md +0 -305
- package/.genie/code/teams/tech-council/oettam.md +0 -375
- package/.genie/neurons/README.md +0 -193
- package/.genie/neurons/forge.md +0 -106
- package/.genie/neurons/genie.md +0 -63
- package/.genie/neurons/review.md +0 -106
- package/.genie/neurons/wish.md +0 -104
- package/.genie/product/README.md +0 -20
- package/.genie/product/cli-automation.md +0 -359
- package/.genie/product/environment.md +0 -60
- package/.genie/product/mission.md +0 -60
- package/.genie/product/roadmap.md +0 -44
- package/.genie/product/tech-stack.md +0 -34
- package/.genie/product/templates/context-template.md +0 -218
- package/.genie/product/templates/qa-done-report-template.md +0 -68
- package/.genie/product/templates/review-report-template.md +0 -89
- package/.genie/product/templates/wish-template.md +0 -120
- package/.genie/scripts/helpers/analyze-commit.js +0 -195
- package/.genie/scripts/helpers/bullet-counter.js +0 -194
- package/.genie/scripts/helpers/bullet-find.js +0 -289
- package/.genie/scripts/helpers/bullet-id.js +0 -244
- package/.genie/scripts/helpers/check-secrets.js +0 -237
- package/.genie/scripts/helpers/count-tokens.js +0 -200
- package/.genie/scripts/helpers/create-frontmatter.js +0 -456
- package/.genie/scripts/helpers/detect-markers.js +0 -293
- package/.genie/scripts/helpers/detect-todos.js +0 -267
- package/.genie/scripts/helpers/detect-unlabeled-blocks.js +0 -135
- package/.genie/scripts/helpers/embeddings.js +0 -344
- package/.genie/scripts/helpers/find-empty-sections.js +0 -158
- package/.genie/scripts/helpers/index.js +0 -319
- package/.genie/scripts/helpers/validate-frontmatter.js +0 -578
- package/.genie/scripts/helpers/validate-links.js +0 -207
- package/.genie/scripts/helpers/validate-paths.js +0 -373
- package/.genie/spells/README.md +0 -9
- package/.genie/spells/ace-protocol.md +0 -118
- package/.genie/spells/ask-one-at-a-time.md +0 -175
- package/.genie/spells/backup-analyzer.md +0 -542
- package/.genie/spells/blocker.md +0 -12
- package/.genie/spells/break-things-move-fast.md +0 -56
- package/.genie/spells/context-candidates.md +0 -72
- package/.genie/spells/context-critic.md +0 -51
- package/.genie/spells/defer-to-expertise.md +0 -278
- package/.genie/spells/delegate-dont-do.md +0 -292
- package/.genie/spells/error-investigation-protocol.md +0 -328
- package/.genie/spells/evidence-based-completion.md +0 -273
- package/.genie/spells/experiment.md +0 -65
- package/.genie/spells/file-creation-protocol.md +0 -229
- package/.genie/spells/forge-integration.md +0 -281
- package/.genie/spells/forge-orchestration.md +0 -514
- package/.genie/spells/gather-context.md +0 -18
- package/.genie/spells/global-health-check.md +0 -34
- package/.genie/spells/global-noop-roundtrip.md +0 -25
- package/.genie/spells/install-genie.md +0 -1232
- package/.genie/spells/install.md +0 -82
- package/.genie/spells/investigate-before-commit.md +0 -112
- package/.genie/spells/know-yourself.md +0 -288
- package/.genie/spells/learn.md +0 -828
- package/.genie/spells/mcp-diagnostic-protocol.md +0 -246
- package/.genie/spells/mcp-first.md +0 -124
- package/.genie/spells/multi-step-execution.md +0 -67
- package/.genie/spells/orchestration-boundary-protocol.md +0 -256
- package/.genie/spells/orchestrator-not-implementor.md +0 -189
- package/.genie/spells/prompt.md +0 -746
- package/.genie/spells/reflect.md +0 -404
- package/.genie/spells/routing-decision-matrix.md +0 -368
- package/.genie/spells/run-in-parallel.md +0 -12
- package/.genie/spells/session-state-updater-example.md +0 -196
- package/.genie/spells/session-state-updater.md +0 -220
- package/.genie/spells/track-long-running-tasks.md +0 -133
- package/.genie/spells/troubleshoot-infrastructure.md +0 -176
- package/.genie/spells/upgrade-genie.md +0 -415
- package/.genie/spells/url-presentation-protocol.md +0 -301
- package/.genie/spells/wish-initiation.md +0 -158
- package/.genie/spells/wish-issue-linkage.md +0 -410
- package/.genie/spells/wish-lifecycle.md +0 -100
- package/.genie/state/provider-status.json +0 -3
- package/.genie/state/version.json +0 -16
- package/.genie/wishes/canonical-pgserve-pm2-supervision/WISH.md +0 -290
- package/.genie/wishes/pgserve-v2/BRIEF-from-genie-pgserve.md +0 -99
- package/.genie/wishes/pgserve-v2/WISH.md +0 -442
- package/.genie/wishes/release-system-genie-pattern/WISH.md +0 -268
- package/.genie/wishes/release-system-genie-pattern/validation.md +0 -205
- package/.gitguardian.yaml +0 -29
- package/.gitguardianignore +0 -16
- package/.github/workflows/ci.yml +0 -122
- package/.github/workflows/release.yml +0 -289
- package/.github/workflows/version.yml +0 -228
- package/.husky/pre-commit +0 -2
- package/AGENTS.md +0 -433
- package/CLAUDE.md +0 -1
- package/Makefile +0 -285
- package/assets/icon.ico +0 -0
- package/bun.lock +0 -435
- package/bunfig.toml +0 -28
- package/ecosystem.config.cjs +0 -23
- package/eslint.config.js +0 -63
- package/examples/multi-tenant-demo.js +0 -104
- package/install.sh +0 -123
- package/knip.json +0 -9
- package/scripts/test-bun-self-heal.sh +0 -163
- package/scripts/test-npx.sh +0 -60
- package/tests/audit.test.js +0 -189
- package/tests/backpressure.test.js +0 -167
- package/tests/benchmarks/runner.js +0 -1197
- package/tests/benchmarks/vector-generator.js +0 -368
- package/tests/cli-install.test.js +0 -322
- package/tests/control-db.test.js +0 -285
- package/tests/daemon-args.test.js +0 -86
- package/tests/daemon-control.test.js +0 -171
- package/tests/daemon-fingerprint-integration.test.js +0 -111
- package/tests/daemon-pr24-regression.test.js +0 -198
- package/tests/fingerprint.test.js +0 -263
- package/tests/fixtures/240-orphan-seed.sql +0 -30
- package/tests/multi-tenant.test.js +0 -374
- package/tests/orphan-cleanup.test.js +0 -390
- package/tests/pg-version-regex.test.js +0 -129
- package/tests/quick-bench.js +0 -135
- package/tests/router-handshake-retry.test.js +0 -119
- package/tests/router-handshake-watchdog.test.js +0 -110
- package/tests/sdk.test.js +0 -71
- package/tests/stale-postmaster-pid.test.js +0 -85
- package/tests/stress-test.js +0 -439
- package/tests/sync-perf-test.js +0 -150
- package/tests/tcp-listen.test.js +0 -368
- package/tests/tenancy.test.js +0 -403
- package/tests/wrapper-supervision.test.js +0 -107
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
# Rule #2: Wish Initiation (Behavioral Spell)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
**CRITICAL RULE:** All significant work must start with a wish document. Work done without a wish = framework violation.
|
|
5
|
-
|
|
6
|
-
## What Qualifies as "Significant"
|
|
7
|
-
|
|
8
|
-
Work is significant if ANY of these apply:
|
|
9
|
-
- ✅ Multi-part tasks (≥2 distinct groups)
|
|
10
|
-
- ✅ Multi-file changes (≥3 files touched)
|
|
11
|
-
- ✅ Architectural decisions (routing, priorities, structure)
|
|
12
|
-
- ✅ Time investment (≥1 hour estimated)
|
|
13
|
-
- ✅ Framework changes (affects multiple agents/workflows)
|
|
14
|
-
- ✅ User request explicitly scoped (clear goals/outputs)
|
|
15
|
-
|
|
16
|
-
## Why This Rule Exists
|
|
17
|
-
|
|
18
|
-
**Problem it solves:**
|
|
19
|
-
1. **Evidence tracking:** Wish documents preserve execution groups, decisions, outcomes
|
|
20
|
-
2. **Context preservation:** Session restart doesn't lose work progress
|
|
21
|
-
3. **Audit trail:** Clear proof of what was done, why, and evidence
|
|
22
|
-
4. **Streamlined workflow:** Plan → Wish → Forge → Review becomes automatic
|
|
23
|
-
5. **Team visibility:** Other agents know what's in progress
|
|
24
|
-
|
|
25
|
-
**What happens without it:**
|
|
26
|
-
- ❌ Work scattered across session (no formal grouping)
|
|
27
|
-
- ❌ Context lost on session restart
|
|
28
|
-
- ❌ No evidence aggregation (efforts forgotten)
|
|
29
|
-
- ❌ Framework workflow broken (skipped Wish phase)
|
|
30
|
-
- ❌ No Done Report (completion not documented)
|
|
31
|
-
|
|
32
|
-
## How to Apply This Rule
|
|
33
|
-
|
|
34
|
-
### BEFORE Starting Work
|
|
35
|
-
|
|
36
|
-
**Checklist:**
|
|
37
|
-
- [ ] Is this significant? (check list above)
|
|
38
|
-
- [ ] If YES → Create wish FIRST
|
|
39
|
-
- [ ] If NO → Continue with simple task
|
|
40
|
-
|
|
41
|
-
**Creating a wish:**
|
|
42
|
-
```bash
|
|
43
|
-
mkdir -p .genie/wishes/<slug>/
|
|
44
|
-
cat > .genie/wishes/<slug>/<slug>-wish.md << 'EOF'
|
|
45
|
-
# Wish: [Title]
|
|
46
|
-
|
|
47
|
-
## Context Ledger
|
|
48
|
-
- Problem: [what needs fixing]
|
|
49
|
-
- Goal: [what we'll deliver]
|
|
50
|
-
- Timeline: [estimate]
|
|
51
|
-
|
|
52
|
-
## Execution Groups
|
|
53
|
-
### Group A: [Phase 1]
|
|
54
|
-
- Task 1
|
|
55
|
-
- Task 2
|
|
56
|
-
|
|
57
|
-
### Group B: [Phase 2]
|
|
58
|
-
- Task 1
|
|
59
|
-
|
|
60
|
-
## Evidence Checklist
|
|
61
|
-
- [ ] Deliverable 1
|
|
62
|
-
- [ ] Deliverable 2
|
|
63
|
-
EOF
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### AFTER Work Completes
|
|
67
|
-
|
|
68
|
-
**Update wish with:**
|
|
69
|
-
- [x] All groups marked completed
|
|
70
|
-
- [x] Evidence checklist filled
|
|
71
|
-
- [x] Done Report path documented
|
|
72
|
-
- [x] Lessons learned section updated
|
|
73
|
-
|
|
74
|
-
## Examples
|
|
75
|
-
|
|
76
|
-
### ✅ CORRECT: Wish Created First
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
User: "I want to analyze and prioritize our 30 spells"
|
|
80
|
-
Me: "Great! Let me create a wish for this..."
|
|
81
|
-
[Create: spells-prioritization-wish.md]
|
|
82
|
-
"I've set up groups: Analysis, Automation, Docs, Testing"
|
|
83
|
-
[Execute groups]
|
|
84
|
-
[Close wish with evidence]
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### ❌ WRONG: Work Done, Then Wish Created
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
User: "I want to analyze and prioritize our 30 spells"
|
|
91
|
-
Me: [Works for 2 hours]
|
|
92
|
-
[Creates wish AFTER work is done]
|
|
93
|
-
← VIOLATION: Broke Plan → Wish → Forge → Review flow
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### ✅ CORRECT: Simple Task (No Wish Needed)
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
User: "What's the token count for AGENTS.md?"
|
|
100
|
-
Me: "Let me check..."
|
|
101
|
-
[runs: genie helper count-tokens AGENTS.md]
|
|
102
|
-
Me: "5,686 tokens (23KB, 618 lines) using tiktoken cl100k_base encoding"
|
|
103
|
-
← No wish needed: simple informational task
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## Validation Before Committing
|
|
107
|
-
|
|
108
|
-
**Never commit work without verifying:**
|
|
109
|
-
- [ ] Wish created (if significant)
|
|
110
|
-
- [ ] All execution groups documented
|
|
111
|
-
- [ ] Evidence checklist completed
|
|
112
|
-
- [ ] Done Report path in wish
|
|
113
|
-
- [ ] Lessons learned section filled
|
|
114
|
-
- [ ] No framework violations
|
|
115
|
-
|
|
116
|
-
**If wish missing on significant work:**
|
|
117
|
-
1. Create wish retroactively (acknowledge violation)
|
|
118
|
-
2. Document why (learning entry)
|
|
119
|
-
3. Invoke learn agent to propagate lesson
|
|
120
|
-
4. Commit with violation note
|
|
121
|
-
|
|
122
|
-
## Example Violation & Fix
|
|
123
|
-
|
|
124
|
-
**Violation (2025-10-18):**
|
|
125
|
-
- Spells prioritization work executed for 2+ hours
|
|
126
|
-
- No wish created at start
|
|
127
|
-
- Evidence scattered across session
|
|
128
|
-
|
|
129
|
-
**Fix:**
|
|
130
|
-
- Created wish: `.genie/wishes/spells-prioritization/spells-prioritization-wish.md`
|
|
131
|
-
- Documented all groups and deliverables
|
|
132
|
-
- Added lessons learned: Rule #2 violation
|
|
133
|
-
- Invoked learn agent → created this spell
|
|
134
|
-
- Committed: "feat: document Rule #2 + fix spells prioritization violation"
|
|
135
|
-
|
|
136
|
-
## Anti-Patterns to Avoid
|
|
137
|
-
|
|
138
|
-
❌ **"It's just a quick thing"** → If it touches >2 files, create wish
|
|
139
|
-
❌ **"I'll create the wish after"** → Defeats the purpose (context already lost)
|
|
140
|
-
❌ **"No one will notice"** → Framework depends on this discipline
|
|
141
|
-
❌ **"This is too simple for a wish"** → If ≥2 hours or ≥3 files, document it
|
|
142
|
-
❌ **"I'll remember what we did"** → Session ends, memory lost
|
|
143
|
-
|
|
144
|
-
## Integration with Framework
|
|
145
|
-
|
|
146
|
-
**This spell is:**
|
|
147
|
-
- **Tier 3 (System Coordination):** Auto-loaded every session
|
|
148
|
-
- **Enforced by:** Meta-learn protocol (corrections documented)
|
|
149
|
-
- **Verified by:** Review + qa agents
|
|
150
|
-
- **Result:** All significant work has formal tracking
|
|
151
|
-
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
**Status:** Active behavioral rule (all future work must follow)
|
|
155
|
-
**Violation handling:** Retroactive wish + learn agent invocation
|
|
156
|
-
**Framework impact:** CRITICAL - enables streamlined Plan → Wish → Forge → Review
|
|
157
|
-
|
|
158
|
-
**Remember:** The Genie framework depends on this. Every user request must streamline through the wish system. No exceptions.
|
|
@@ -1,410 +0,0 @@
|
|
|
1
|
-
# Rule #6: Wish-Issue Linkage (Behavioral Spell)
|
|
2
|
-
|
|
3
|
-
**Created:** 2025-10-20
|
|
4
|
-
**Priority:** CRITICAL
|
|
5
|
-
**Learn Session:** c873572f-fd95-4ea0-a0c9-cdaed1dda898
|
|
6
|
-
|
|
7
|
-
**CRITICAL RULE:** Every wish MUST link to a GitHub issue. No issue → no wish creation.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## The Core Principle
|
|
12
|
-
|
|
13
|
-
**Before ANY wish document is created:**
|
|
14
|
-
1. GitHub issue MUST exist
|
|
15
|
-
2. Issue number MUST be validated
|
|
16
|
-
3. Issue link MUST be in wish front-matter
|
|
17
|
-
|
|
18
|
-
**No exceptions.** This is mandatory for all wish workflows.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Why This Rule Exists
|
|
23
|
-
|
|
24
|
-
### Problem it Solves
|
|
25
|
-
|
|
26
|
-
**Without issue linkage:**
|
|
27
|
-
- ❌ No team visibility (non-Genie users don't know what's planned)
|
|
28
|
-
- ❌ No approval checkpoint (work may be rejected after implementation)
|
|
29
|
-
- ❌ No audit trail (work history scattered across systems)
|
|
30
|
-
- ❌ No search/discovery (GitHub search can't find wishes)
|
|
31
|
-
- ❌ No permalink stability (wishes live in .genie/, may move)
|
|
32
|
-
|
|
33
|
-
**With issue linkage:**
|
|
34
|
-
- ✅ Team visibility (everyone sees what's being worked on)
|
|
35
|
-
- ✅ Approval gates (issue discussion before implementation starts)
|
|
36
|
-
- ✅ Complete audit trail (issue → wish → forge task → PR → merge)
|
|
37
|
-
- ✅ Searchable history (GitHub search finds all work)
|
|
38
|
-
- ✅ Stable permalinks (issue #XXX never changes)
|
|
39
|
-
|
|
40
|
-
### Architectural Hierarchy
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
GitHub Issue (Public, Permanent)
|
|
44
|
-
↓
|
|
45
|
-
Wish Document (Internal Planning)
|
|
46
|
-
↓
|
|
47
|
-
Forge Task (Execution Tracking)
|
|
48
|
-
↓
|
|
49
|
-
Git Branch + Worktree (Implementation)
|
|
50
|
-
↓
|
|
51
|
-
Pull Request (Review + Merge)
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**Each level links to parent:**
|
|
55
|
-
- Wish → Issue #XXX
|
|
56
|
-
- Forge task → Issue #XXX + Wish path
|
|
57
|
-
- Branch → forge/XXXX-kebab-case (derived from task)
|
|
58
|
-
- PR → Closes #XXX
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## How To Apply This Rule
|
|
63
|
-
|
|
64
|
-
### Step 1: Issue Validation (BEFORE Discovery)
|
|
65
|
-
|
|
66
|
-
**When user requests wish creation:**
|
|
67
|
-
|
|
68
|
-
```typescript
|
|
69
|
-
// Genie MUST check:
|
|
70
|
-
const issueProvided = userInput.includes('#') || userInput.includes('issue');
|
|
71
|
-
|
|
72
|
-
if (!issueProvided) {
|
|
73
|
-
// Ask user for issue number
|
|
74
|
-
await ask("Is there a GitHub issue for this? If yes, provide #XXX. If no, I'll create one.");
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Validate issue exists
|
|
78
|
-
const issue = await gh.issue.get(issueNumber);
|
|
79
|
-
if (!issue) {
|
|
80
|
-
// Route to issue creation workflow
|
|
81
|
-
await createIssueFirst();
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**BLOCK wish creation until issue confirmed.**
|
|
86
|
-
|
|
87
|
-
### Step 2: Issue Creation (If Missing)
|
|
88
|
-
|
|
89
|
-
If no issue exists, route to issue creation:
|
|
90
|
-
|
|
91
|
-
```markdown
|
|
92
|
-
**Issue Creation Checklist:**
|
|
93
|
-
1. Ask user: "Should I create GitHub issue first?"
|
|
94
|
-
2. Gather context:
|
|
95
|
-
- Title (clear, actionable)
|
|
96
|
-
- Description (context ledger summary)
|
|
97
|
-
- Labels (wish, enhancement, bug, etc.)
|
|
98
|
-
- Acceptance criteria
|
|
99
|
-
3. Create issue via GitHub API:
|
|
100
|
-
\`gh issue create --title "..." --body "..." --label wish\`
|
|
101
|
-
4. Extract issue number from response
|
|
102
|
-
5. THEN proceed to wish creation
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### Step 3: Wish Document Linkage
|
|
106
|
-
|
|
107
|
-
Every wish document MUST include issue reference:
|
|
108
|
-
|
|
109
|
-
```markdown
|
|
110
|
-
# Wish: <Title>
|
|
111
|
-
|
|
112
|
-
**GitHub Issue:** #152 <-- MANDATORY FIELD
|
|
113
|
-
**Status:** Discovery
|
|
114
|
-
**Created:** !`date -u +"%Y-%m-%d"`
|
|
115
|
-
**Forge Task:** (filled after task creation)
|
|
116
|
-
|
|
117
|
-
## Context Ledger
|
|
118
|
-
|
|
119
|
-
**Origin:** GitHub Issue #152
|
|
120
|
-
**Problem:** [from issue description]
|
|
121
|
-
...
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Step 4: Forge Task Linkage
|
|
125
|
-
|
|
126
|
-
When creating wish with task:
|
|
127
|
-
|
|
128
|
-
```typescript
|
|
129
|
-
await mcp__genie__create_wish({
|
|
130
|
-
feature: "MCP Server Authentication",
|
|
131
|
-
github_issue: 152 // Issue number required!
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
// Or run forge task directly:
|
|
135
|
-
await mcp__genie__run_forge({
|
|
136
|
-
agent: "implementor",
|
|
137
|
-
prompt: `
|
|
138
|
-
**GitHub Issue:** #152
|
|
139
|
-
**Wish Document:** @.genie/wishes/mcp-auth/mcp-auth-wish.md
|
|
140
|
-
|
|
141
|
-
[Full wish context from issue]
|
|
142
|
-
`
|
|
143
|
-
});
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Integration With Existing Workflows
|
|
149
|
-
|
|
150
|
-
### Wish Workflow Enhancement
|
|
151
|
-
|
|
152
|
-
**Add Step 0 (NEW) before Discovery:**
|
|
153
|
-
|
|
154
|
-
```markdown
|
|
155
|
-
### Step 0: Issue Validation
|
|
156
|
-
**Goal:** Ensure GitHub issue exists before starting wish dance
|
|
157
|
-
|
|
158
|
-
**Process:**
|
|
159
|
-
1. Check if user provided issue number
|
|
160
|
-
2. If YES:
|
|
161
|
-
- Validate issue exists: \`gh issue view #XXX\`
|
|
162
|
-
- Extract context from issue
|
|
163
|
-
- Proceed to Step 1 (Discovery)
|
|
164
|
-
3. If NO:
|
|
165
|
-
- Ask: "Should I create a GitHub issue first?"
|
|
166
|
-
- If user says yes → delegate to issue-creation workflow
|
|
167
|
-
- If user says no → BLOCK wish creation, explain rule
|
|
168
|
-
|
|
169
|
-
**Delegation:**
|
|
170
|
-
\`\`\`
|
|
171
|
-
mcp__genie__run with agent="issue-check" prompt="Validate issue #XXX exists"
|
|
172
|
-
\`\`\`
|
|
173
|
-
|
|
174
|
-
**Output:** Issue number + issue context + "Ready for discovery?"
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### Blueprint Workflow Enhancement
|
|
178
|
-
|
|
179
|
-
**Update wish document template:**
|
|
180
|
-
|
|
181
|
-
```markdown
|
|
182
|
-
**Required front-matter fields:**
|
|
183
|
-
- GitHub Issue: #XXX <-- MUST be filled
|
|
184
|
-
- Forge Task: <task_id> <-- Auto-filled after creation
|
|
185
|
-
- Status: Discovery/In-Progress/Review/Done
|
|
186
|
-
- Created: !`date`
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
---
|
|
190
|
-
|
|
191
|
-
## Enforcement Mechanism
|
|
192
|
-
|
|
193
|
-
### Pre-Creation Check
|
|
194
|
-
|
|
195
|
-
**In wish.md orchestrator:**
|
|
196
|
-
```typescript
|
|
197
|
-
// BEFORE starting wish dance
|
|
198
|
-
async function validateIssueExists(userRequest: string): Promise<IssueValidation> {
|
|
199
|
-
const issueMatch = userRequest.match(/#(\d+)/);
|
|
200
|
-
|
|
201
|
-
if (!issueMatch) {
|
|
202
|
-
return {
|
|
203
|
-
valid: false,
|
|
204
|
-
reason: "No issue number provided",
|
|
205
|
-
action: "prompt_user_for_issue"
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const issueNumber = issueMatch[1];
|
|
210
|
-
const issue = await gh.issue.get(issueNumber);
|
|
211
|
-
|
|
212
|
-
if (!issue) {
|
|
213
|
-
return {
|
|
214
|
-
valid: false,
|
|
215
|
-
reason: `Issue #${issueNumber} does not exist`,
|
|
216
|
-
action: "create_issue_first"
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return {
|
|
221
|
-
valid: true,
|
|
222
|
-
issue: issue,
|
|
223
|
-
issueNumber: issueNumber
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### Post-Creation Validation
|
|
229
|
-
|
|
230
|
-
**In review.md agent:**
|
|
231
|
-
```typescript
|
|
232
|
-
// Validate wish document has issue link
|
|
233
|
-
async function validateWishDocument(wishPath: string): Promise<boolean> {
|
|
234
|
-
const content = await fs.readFile(wishPath, 'utf-8');
|
|
235
|
-
const hasIssueLink = /\*\*GitHub Issue:\*\* #\d+/.test(content);
|
|
236
|
-
|
|
237
|
-
if (!hasIssueLink) {
|
|
238
|
-
throw new Error(`Wish ${wishPath} missing GitHub issue link! Rule #6 violation.`);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return true;
|
|
242
|
-
}
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
---
|
|
246
|
-
|
|
247
|
-
## Examples
|
|
248
|
-
|
|
249
|
-
### ✅ CORRECT: Issue First, Then Wish
|
|
250
|
-
|
|
251
|
-
```
|
|
252
|
-
User: "I want to add MCP authentication"
|
|
253
|
-
|
|
254
|
-
Genie: "Great idea! Is there a GitHub issue for this?"
|
|
255
|
-
User: "Yes, #152"
|
|
256
|
-
|
|
257
|
-
Genie: [Validates #152 exists]
|
|
258
|
-
Genie: "Perfect! Issue #152 confirmed. Let's start the wish dance..."
|
|
259
|
-
[Creates wish with GitHub Issue: #152]
|
|
260
|
-
[Links Forge task to #152]
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### ✅ CORRECT: Create Issue First
|
|
264
|
-
|
|
265
|
-
```
|
|
266
|
-
User: "I want to unify the naming taxonomy"
|
|
267
|
-
|
|
268
|
-
Genie: "Excellent! I don't see a GitHub issue for this. Should I create one first?"
|
|
269
|
-
User: "Yes please"
|
|
270
|
-
|
|
271
|
-
Genie: [Creates issue #155 via gh CLI]
|
|
272
|
-
Genie: "Issue #155 created! Now let's create the wish..."
|
|
273
|
-
[Creates wish with GitHub Issue: #155]
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### ❌ WRONG: Wish Without Issue
|
|
277
|
-
|
|
278
|
-
```
|
|
279
|
-
User: "Create a wish for voice agent transformation"
|
|
280
|
-
|
|
281
|
-
Genie: [Creates wish document immediately] <-- VIOLATION!
|
|
282
|
-
Genie: [No issue link in wish] <-- VIOLATION!
|
|
283
|
-
|
|
284
|
-
← This breaks Rule #6. MUST validate/create issue FIRST.
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
---
|
|
288
|
-
|
|
289
|
-
## Spell Metadata
|
|
290
|
-
|
|
291
|
-
**Spell Type:** Behavioral (Tier 6 - Workflow & State Management)
|
|
292
|
-
**Auto-loaded:** YES (every session)
|
|
293
|
-
**Enforced by:** wish.md orchestrator, review.md validator
|
|
294
|
-
**Violation handling:** BLOCK wish creation, route to issue-creation
|
|
295
|
-
**Related spells:**
|
|
296
|
-
- Rule #2: Wish Initiation (`@.genie/spells/wish-initiation.md`)
|
|
297
|
-
- Wish Document Management (`@.genie/spells/wish-lifecycle.md`)
|
|
298
|
-
- Persistent Tracking Protocol (`@.genie/spells/track-long-running-tasks.md`)
|
|
299
|
-
|
|
300
|
-
---
|
|
301
|
-
|
|
302
|
-
## Anti-Patterns To Avoid
|
|
303
|
-
|
|
304
|
-
❌ **"The issue is implied"** → No. Explicit link required.
|
|
305
|
-
❌ **"I'll create issue after wish"** → No. Issue FIRST, always.
|
|
306
|
-
❌ **"This is internal work, no issue needed"** → No. All wishes need issues.
|
|
307
|
-
❌ **"Issue creation slows me down"** → Good. Approval gate is intentional.
|
|
308
|
-
❌ **"I forgot to link the issue"** → Fix immediately (retroactive linking).
|
|
309
|
-
|
|
310
|
-
---
|
|
311
|
-
|
|
312
|
-
## Retroactive Fixes
|
|
313
|
-
|
|
314
|
-
**If wish exists without issue:**
|
|
315
|
-
1. Create GitHub issue immediately
|
|
316
|
-
2. Update wish document with issue #
|
|
317
|
-
3. Update Forge task title/description with issue #
|
|
318
|
-
4. Add violation note to learn session
|
|
319
|
-
5. Document in meta-learn protocol
|
|
320
|
-
|
|
321
|
-
**Example:**
|
|
322
|
-
```bash
|
|
323
|
-
# Create missing issue
|
|
324
|
-
gh issue create --title "Wish: Voice Agent Transformation" \
|
|
325
|
-
--body "$(cat .genie/wishes/voice-agent/voice-agent-wish.md)" \
|
|
326
|
-
--label wish
|
|
327
|
-
|
|
328
|
-
# Extract issue number
|
|
329
|
-
ISSUE_NUM=$(gh issue list --limit 1 --json number --jq '.[0].number')
|
|
330
|
-
|
|
331
|
-
# Update wish document
|
|
332
|
-
sed -i "s/\*\*GitHub Issue:\*\* TBD/**GitHub Issue:** #$ISSUE_NUM/" \
|
|
333
|
-
.genie/wishes/voice-agent/voice-agent-wish.md
|
|
334
|
-
|
|
335
|
-
# Document violation
|
|
336
|
-
echo "Rule #6 violation: Retroactively linked issue #$ISSUE_NUM" >> \
|
|
337
|
-
.genie/reports/learn-wish-issue-amendment-20251020.md
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
---
|
|
341
|
-
|
|
342
|
-
## MCP Integration
|
|
343
|
-
|
|
344
|
-
### Genie Spell Execution Pattern
|
|
345
|
-
|
|
346
|
-
**Goal:** Genie MCP executes spells dynamically (lighter base prompts)
|
|
347
|
-
|
|
348
|
-
**How this works:**
|
|
349
|
-
1. Base Genie prompt = thin orchestrator
|
|
350
|
-
2. Spells loaded as @ references (not full content in base prompt)
|
|
351
|
-
3. When wish requested → Genie dynamically loads wish-issue-linkage-rule.md
|
|
352
|
-
4. Spell execution = read file, apply rules, validate
|
|
353
|
-
|
|
354
|
-
**Benefits:**
|
|
355
|
-
- Lighter base prompts (token efficiency)
|
|
356
|
-
- Spells updated independently (no base prompt changes)
|
|
357
|
-
- Clear separation of concerns (orchestration vs execution)
|
|
358
|
-
|
|
359
|
-
**Implementation:**
|
|
360
|
-
```typescript
|
|
361
|
-
// In wish.md orchestrator
|
|
362
|
-
async function ensureIssueExists(userRequest: string) {
|
|
363
|
-
// Load spell dynamically
|
|
364
|
-
const spell = await loadSkill('@.genie/spells/wish-issue-linkage.md');
|
|
365
|
-
|
|
366
|
-
// Execute spell logic
|
|
367
|
-
const validation = await spell.validateIssue(userRequest);
|
|
368
|
-
|
|
369
|
-
if (!validation.valid) {
|
|
370
|
-
// Route to issue creation
|
|
371
|
-
return await spell.createIssueFirst(userRequest);
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
return validation.issueNumber;
|
|
375
|
-
}
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
---
|
|
379
|
-
|
|
380
|
-
## Summary
|
|
381
|
-
|
|
382
|
-
**Rule #6 in one sentence:**
|
|
383
|
-
> No GitHub issue = no wish creation. Issue first, always.
|
|
384
|
-
|
|
385
|
-
**Why it matters:**
|
|
386
|
-
- Team visibility (public tracking)
|
|
387
|
-
- Approval gates (discussion before work)
|
|
388
|
-
- Audit trail (complete history)
|
|
389
|
-
- Search/discovery (GitHub search works)
|
|
390
|
-
- Permalink stability (issue # never changes)
|
|
391
|
-
|
|
392
|
-
**How to follow:**
|
|
393
|
-
1. Check if issue exists
|
|
394
|
-
2. If not → create issue first
|
|
395
|
-
3. Link issue # in wish front-matter
|
|
396
|
-
4. Link issue # in Forge task
|
|
397
|
-
5. Close issue when PR merges
|
|
398
|
-
|
|
399
|
-
**Enforcement:**
|
|
400
|
-
- wish.md blocks creation without issue
|
|
401
|
-
- review.md validates issue link exists
|
|
402
|
-
- Meta-learn tracks violations
|
|
403
|
-
|
|
404
|
-
---
|
|
405
|
-
|
|
406
|
-
**Status:** Active behavioral rule (all future wishes must follow)
|
|
407
|
-
**Violation handling:** BLOCK + route to issue creation
|
|
408
|
-
**Framework impact:** CRITICAL - enables public visibility + audit trail
|
|
409
|
-
|
|
410
|
-
**Remember:** GitHub is source of truth. Wishes are implementation plans. Forge tasks are execution. All three MUST link together.
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Wish Document Management
|
|
3
|
-
description: Keep wishes as living blueprints with orchestration strategy and evidence
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Wish Document Management
|
|
7
|
-
|
|
8
|
-
**Purpose:** Wish documents are living blueprints; maintain clarity from inception to closure.
|
|
9
|
-
|
|
10
|
-
## Success Criteria
|
|
11
|
-
|
|
12
|
-
✅ Wish contains orchestration strategy, agent assignments, evidence log.
|
|
13
|
-
✅ Done Report references appended with final summary + remaining risks.
|
|
14
|
-
✅ No duplicate wish documents created.
|
|
15
|
-
|
|
16
|
-
## Multi-Stage Investigation Pattern (RECOMMENDED)
|
|
17
|
-
|
|
18
|
-
**Pattern:** Investigation → Pre-Wish → Wish Creation
|
|
19
|
-
|
|
20
|
-
**When to use:** Complex features requiring architectural decisions, risk assessment, or significant implementation effort.
|
|
21
|
-
|
|
22
|
-
**Benefits:**
|
|
23
|
-
- Surface all risks, benefits, and trade-offs BEFORE committing to implementation
|
|
24
|
-
- Pre-wish summary provides TL;DR + decision matrix for stakeholder buy-in
|
|
25
|
-
- Wish document becomes comprehensive single source of truth
|
|
26
|
-
- Learn task tracks knowledge gained throughout investigation
|
|
27
|
-
|
|
28
|
-
### Phase 1: Investigation
|
|
29
|
-
**Objective:** Deep analysis and proof-of-concept validation
|
|
30
|
-
|
|
31
|
-
**Deliverables:**
|
|
32
|
-
- Multiple investigation reports (API validation, comparisons, strategies, test plans)
|
|
33
|
-
- Proof-of-concept implementation (if applicable)
|
|
34
|
-
- Risk assessment and trade-off analysis
|
|
35
|
-
- Technical feasibility validation
|
|
36
|
-
|
|
37
|
-
**Example (Issue #120):**
|
|
38
|
-
- 7 investigation reports (~5,000 lines total)
|
|
39
|
-
- POC: forge-executor.ts (300 lines, working implementation)
|
|
40
|
-
- Risk/benefit analysis across multiple dimensions
|
|
41
|
-
|
|
42
|
-
### Phase 2: Pre-Wish Summary
|
|
43
|
-
**Objective:** Decision-making checkpoint with stakeholder visibility
|
|
44
|
-
|
|
45
|
-
**Deliverables:**
|
|
46
|
-
- TL;DR executive summary (2-3 paragraphs)
|
|
47
|
-
- Decision matrix (pros/cons/risks/benefits)
|
|
48
|
-
- Go/No-Go recommendation with confidence score
|
|
49
|
-
- Resource requirements and timeline estimate
|
|
50
|
-
|
|
51
|
-
**Decision Matrix Elements:**
|
|
52
|
-
- Ease analysis: How difficult is the change?
|
|
53
|
-
- Replacement mapping: What gets deleted, what gets added?
|
|
54
|
-
- Risk assessment: What could go wrong?
|
|
55
|
-
- Benefit quantification: What improves and by how much?
|
|
56
|
-
|
|
57
|
-
### Phase 3: Wish Creation
|
|
58
|
-
**Objective:** Comprehensive implementation blueprint
|
|
59
|
-
|
|
60
|
-
**Deliverables:**
|
|
61
|
-
- Complete wish document with multiple implementation groups
|
|
62
|
-
- Phased rollout strategy (Group A → B → C → D)
|
|
63
|
-
- Timeline with milestones
|
|
64
|
-
- Success criteria and validation checkpoints
|
|
65
|
-
|
|
66
|
-
**Example Structure (Issue #120):**
|
|
67
|
-
- 4 implementation groups (A: Core, B: Streaming, C: Advanced, D: Testing)
|
|
68
|
-
- 4-week timeline with phased rollout
|
|
69
|
-
- Clear success metrics per group
|
|
70
|
-
|
|
71
|
-
## Evidence Tracking
|
|
72
|
-
|
|
73
|
-
**During Investigation:**
|
|
74
|
-
- Document all findings in `.genie/reports/` with descriptive names
|
|
75
|
-
- Track investigation progress in learning task (Forge)
|
|
76
|
-
- Update pre-wish summary as understanding evolves
|
|
77
|
-
|
|
78
|
-
**During Wish Creation:**
|
|
79
|
-
- Reference investigation reports in wish document
|
|
80
|
-
- Include decision rationale with evidence pointers
|
|
81
|
-
- Document assumptions and risks with supporting evidence
|
|
82
|
-
|
|
83
|
-
**After Implementation:**
|
|
84
|
-
- Append Done Report to wish with final outcomes
|
|
85
|
-
- Document deviations from plan with justification
|
|
86
|
-
- Record lessons learned for future similar wishes
|
|
87
|
-
|
|
88
|
-
## Anti-Patterns
|
|
89
|
-
|
|
90
|
-
❌ **Jumping to Wish without investigation:** Creates incomplete requirements, missed risks
|
|
91
|
-
❌ **Investigation without decision checkpoint:** Wastes effort on exploratory work without commitment
|
|
92
|
-
❌ **Wish creation without stakeholder buy-in:** Implementation starts without alignment
|
|
93
|
-
❌ **No evidence tracking:** Decisions lack justification, can't validate assumptions later
|
|
94
|
-
|
|
95
|
-
## Evidence
|
|
96
|
-
|
|
97
|
-
**Pattern discovered:** Issue #120 investigation → wish creation flow (2025-10-18 09:00-13:15 UTC)
|
|
98
|
-
- Learn task session tracked entire investigation process
|
|
99
|
-
- Pre-wish summary enabled quick decision (9.2/10 - STRONG YES)
|
|
100
|
-
- Comprehensive wish enabled focused implementation planning
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "2.5.27-rc.4",
|
|
3
|
-
"installedAt": "2025-11-23T13:42:06.789Z",
|
|
4
|
-
"updatedAt": "2025-11-23T13:42:06.789Z",
|
|
5
|
-
"commit": "98eb883",
|
|
6
|
-
"packageName": "automagik-genie",
|
|
7
|
-
"customizedFiles": [],
|
|
8
|
-
"deletedFiles": [],
|
|
9
|
-
"lastUpgrade": null,
|
|
10
|
-
"previousVersion": null,
|
|
11
|
-
"upgradeHistory": [],
|
|
12
|
-
"migrationInfo": {
|
|
13
|
-
"backupId": "n/a",
|
|
14
|
-
"claudeBackedUp": false
|
|
15
|
-
}
|
|
16
|
-
}
|