@automagik/genie 4.260409.12 → 4.260409.14

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 (109) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.genie/brainstorm.md +2 -0
  3. package/.genie/wishes/genie-wishes-backup/genie-metaverse/WISH.md +339 -0
  4. package/.genie/wishes/genie-wishes-backup/genie-simulations/WISH.md +488 -0
  5. package/.genie/wishes/genie-wishes-backup/unify-bridge-revamp-skills/WISH.md +271 -0
  6. package/.genie/wishes/unify-bridge-revamp-skills/WISH.md +270 -0
  7. package/dist/genie.js +639 -643
  8. package/knip.json +1 -0
  9. package/package.json +3 -1
  10. package/plugins/genie/.claude-plugin/plugin.json +1 -1
  11. package/plugins/genie/package.json +1 -1
  12. package/scripts/skills-audit.ts +116 -0
  13. package/scripts/skills-lint.ts +140 -0
  14. package/src/genie-commands/doctor.ts +40 -25
  15. package/src/lib/bridge-status.test.ts +114 -0
  16. package/src/lib/bridge-status.ts +162 -0
  17. package/src/lib/provider-adapters.ts +15 -8
  18. package/src/services/__tests__/omni-bridge-pidfile.test.ts +136 -0
  19. package/src/services/executors/claude-code.ts +2 -1
  20. package/src/services/omni-bridge.ts +193 -86
  21. package/src/term-commands/omni.ts +6 -133
  22. package/src/term-commands/serve.ts +12 -8
  23. /package/.genie/wishes/{agent-flexibility-guide → genie-wishes-backup/agent-flexibility-guide}/WISH.md +0 -0
  24. /package/.genie/wishes/{agent-stability-hardening → genie-wishes-backup/agent-stability-hardening}/WISH.md +0 -0
  25. /package/.genie/wishes/{auto-orchestrate → genie-wishes-backup/auto-orchestrate}/WISH.md +0 -0
  26. /package/.genie/wishes/{daily-metrics-agent → genie-wishes-backup/daily-metrics-agent}/WISH.md +0 -0
  27. /package/.genie/wishes/{docs-overhaul → genie-wishes-backup/docs-overhaul}/WISH.md +0 -0
  28. /package/.genie/wishes/{docs-readme-review → genie-wishes-backup/docs-readme-review}/AUDIT-REPORT.md +0 -0
  29. /package/.genie/wishes/{docs-readme-review → genie-wishes-backup/docs-readme-review}/WISH.md +0 -0
  30. /package/.genie/wishes/{dx-800-closeout → genie-wishes-backup/dx-800-closeout}/WISH.md +0 -0
  31. /package/.genie/wishes/{feature-matrix-page → genie-wishes-backup/feature-matrix-page}/WISH.md +0 -0
  32. /package/.genie/wishes/{fire-and-forget → genie-wishes-backup/fire-and-forget}/WISH.md +0 -0
  33. /package/.genie/wishes/{fix-agent-join-delay → genie-wishes-backup/fix-agent-join-delay}/WISH.md +0 -0
  34. /package/.genie/wishes/{fix-cli-polish → genie-wishes-backup/fix-cli-polish}/WISH.md +0 -0
  35. /package/.genie/wishes/{fix-depends-parser → genie-wishes-backup/fix-depends-parser}/WISH.md +0 -0
  36. /package/.genie/wishes/{fix-dispatch-initial-prompt → genie-wishes-backup/fix-dispatch-initial-prompt}/WISH.md +0 -0
  37. /package/.genie/wishes/{fix-first-run → genie-wishes-backup/fix-first-run}/WISH.md +0 -0
  38. /package/.genie/wishes/{fix-genie-v4-stability → genie-wishes-backup/fix-genie-v4-stability}/WISH.md +0 -0
  39. /package/.genie/wishes/{fix-metrics-agent → genie-wishes-backup/fix-metrics-agent}/WISH.md +0 -0
  40. /package/.genie/wishes/{fix-native-inbox → genie-wishes-backup/fix-native-inbox}/WISH.md +0 -0
  41. /package/.genie/wishes/{fix-omni-bridge-hardening → genie-wishes-backup/fix-omni-bridge-hardening}/WISH.md +0 -0
  42. /package/.genie/wishes/{fix-release-blockers → genie-wishes-backup/fix-release-blockers}/WISH.md +0 -0
  43. /package/.genie/wishes/{fix-session-continue-fallback → genie-wishes-backup/fix-session-continue-fallback}/WISH.md +0 -0
  44. /package/.genie/wishes/{fix-session-hook-channel → genie-wishes-backup/fix-session-hook-channel}/WISH.md +0 -0
  45. /package/.genie/wishes/{fix-session-uuid-resume → genie-wishes-backup/fix-session-uuid-resume}/WISH.md +0 -0
  46. /package/.genie/wishes/{fix-short-name-resolver → genie-wishes-backup/fix-short-name-resolver}/WISH.md +0 -0
  47. /package/.genie/wishes/{fix-task-project → genie-wishes-backup/fix-task-project}/WISH.md +0 -0
  48. /package/.genie/wishes/{fix-team-lead-exit → genie-wishes-backup/fix-team-lead-exit}/WISH.md +0 -0
  49. /package/.genie/wishes/{fix-team-lead-polling → genie-wishes-backup/fix-team-lead-polling}/WISH.md +0 -0
  50. /package/.genie/wishes/{fix-test-safety → genie-wishes-backup/fix-test-safety}/WISH.md +0 -0
  51. /package/.genie/wishes/{fix-tmux-dual-statusbar → genie-wishes-backup/fix-tmux-dual-statusbar}/WISH.md +0 -0
  52. /package/.genie/wishes/{fix-tmux-session-explosion → genie-wishes-backup/fix-tmux-session-explosion}/WISH.md +0 -0
  53. /package/.genie/wishes/{fix-trust-prompt → genie-wishes-backup/fix-trust-prompt}/WISH.md +0 -0
  54. /package/.genie/wishes/{genie-app-v2-ui → genie-wishes-backup/genie-app-v2-ui}/WISH.md +0 -0
  55. /package/.genie/wishes/{genie-base-skill → genie-wishes-backup/genie-base-skill}/WISH.md +0 -0
  56. /package/.genie/wishes/{genie-boards-workflows → genie-wishes-backup/genie-boards-workflows}/WISH.md +0 -0
  57. /package/.genie/wishes/{genie-dx-polish → genie-wishes-backup/genie-dx-polish}/WISH.md +0 -0
  58. /package/.genie/wishes/{genie-export-import → genie-wishes-backup/genie-export-import}/WISH.md +0 -0
  59. /package/.genie/wishes/{genie-final-polish → genie-wishes-backup/genie-final-polish}/WISH.md +0 -0
  60. /package/.genie/wishes/{genie-hacks-community-docs → genie-wishes-backup/genie-hacks-community-docs}/WISH.md +0 -0
  61. /package/.genie/wishes/{genie-hardening → genie-wishes-backup/genie-hardening}/WISH.md +0 -0
  62. /package/.genie/wishes/{genie-item-registry → genie-wishes-backup/genie-item-registry}/WISH.md +0 -0
  63. /package/.genie/wishes/{genie-observability → genie-wishes-backup/genie-observability}/WISH.md +0 -0
  64. /package/.genie/wishes/{genie-omni-marriage → genie-wishes-backup/genie-omni-marriage}/WISH.md +0 -0
  65. /package/.genie/wishes/{genie-orchestration-fix → genie-wishes-backup/genie-orchestration-fix}/WISH.md +0 -0
  66. /package/.genie/wishes/{genie-resume → genie-wishes-backup/genie-resume}/WISH.md +0 -0
  67. /package/.genie/wishes/{genie-scheduler → genie-wishes-backup/genie-scheduler}/WISH.md +0 -0
  68. /package/.genie/wishes/{genie-stats-command → genie-wishes-backup/genie-stats-command}/WISH.md +0 -0
  69. /package/.genie/wishes/{genie-task-tables → genie-wishes-backup/genie-task-tables}/WISH.md +0 -0
  70. /package/.genie/wishes/{genie-workflow-engine → genie-wishes-backup/genie-workflow-engine}/WISH.md +0 -0
  71. /package/.genie/wishes/{hook-only-first-install → genie-wishes-backup/hook-only-first-install}/WISH.md +0 -0
  72. /package/.genie/wishes/{inbox-driven-sessions → genie-wishes-backup/inbox-driven-sessions}/WISH.md +0 -0
  73. /package/.genie/wishes/{messaging-refresh → genie-wishes-backup/messaging-refresh}/WISH.md +0 -0
  74. /package/.genie/wishes/{multi-agent-session-isolation → genie-wishes-backup/multi-agent-session-isolation}/WISH.md +0 -0
  75. /package/.genie/wishes/{omni-session-isolation → genie-wishes-backup/omni-session-isolation}/WISH.md +0 -0
  76. /package/.genie/wishes/{parallel-execution → genie-wishes-backup/parallel-execution}/WISH.md +0 -0
  77. /package/.genie/wishes/{pg-state-migration → genie-wishes-backup/pg-state-migration}/WISH.md +0 -0
  78. /package/.genie/wishes/{pg-total-migration → genie-wishes-backup/pg-total-migration}/WISH.md +0 -0
  79. /package/.genie/wishes/{pgserve-embed → genie-wishes-backup/pgserve-embed}/WISH.md +0 -0
  80. /package/.genie/wishes/{qa-dev-to-main → genie-wishes-backup/qa-dev-to-main}/WISH.md +0 -0
  81. /package/.genie/wishes/{readme-v4-agent-first → genie-wishes-backup/readme-v4-agent-first}/WISH.md +0 -0
  82. /package/.genie/wishes/{resilient-messaging → genie-wishes-backup/resilient-messaging}/WISH.md +0 -0
  83. /package/.genie/wishes/{resilient-resume → genie-wishes-backup/resilient-resume}/WISH.md +0 -0
  84. /package/.genie/wishes/{session-auto-create → genie-wishes-backup/session-auto-create}/WISH.md +0 -0
  85. /package/.genie/wishes/{session-continue-by-name → genie-wishes-backup/session-continue-by-name}/WISH.md +0 -0
  86. /package/.genie/wishes/{skills-v4-upgrade → genie-wishes-backup/skills-v4-upgrade}/WISH.md +0 -0
  87. /package/.genie/wishes/{stable-release-fixes → genie-wishes-backup/stable-release-fixes}/WISH.md +0 -0
  88. /package/.genie/wishes/{task-auto-close-on-merge → genie-wishes-backup/task-auto-close-on-merge}/WISH.md +0 -0
  89. /package/.genie/wishes/{task-external-linking → genie-wishes-backup/task-external-linking}/WISH.md +0 -0
  90. /package/.genie/wishes/{task-lifecycle-foundation → genie-wishes-backup/task-lifecycle-foundation}/WISH.md +0 -0
  91. /package/.genie/wishes/{task-projects → genie-wishes-backup/task-projects}/WISH.md +0 -0
  92. /package/.genie/wishes/{team-lead-minimal → genie-wishes-backup/team-lead-minimal}/WISH.md +0 -0
  93. /package/.genie/wishes/{test-pg-ram-isolation → genie-wishes-backup/test-pg-ram-isolation}/TRACE.md +0 -0
  94. /package/.genie/wishes/{test-pg-ram-isolation → genie-wishes-backup/test-pg-ram-isolation}/WISH.md +0 -0
  95. /package/.genie/wishes/{test-schema-isolation → genie-wishes-backup/test-schema-isolation}/WISH.md +0 -0
  96. /package/.genie/wishes/{tmux-split-tabbar → genie-wishes-backup/tmux-split-tabbar}/WISH.md +0 -0
  97. /package/.genie/wishes/{tmux-tui → genie-wishes-backup/tmux-tui}/WISH.md +0 -0
  98. /package/.genie/wishes/{transcript-docs → genie-wishes-backup/transcript-docs}/WISH.md +0 -0
  99. /package/.genie/wishes/{unified-executor-layer → genie-wishes-backup/unified-executor-layer}/AUDIT.md +0 -0
  100. /package/.genie/wishes/{unified-executor-layer → genie-wishes-backup/unified-executor-layer}/WISH.md +0 -0
  101. /package/.genie/wishes/{unified-omni-bridge → genie-wishes-backup/unified-omni-bridge}/INTEGRATION-FROM-OMNI.md +0 -0
  102. /package/.genie/wishes/{unified-omni-bridge → genie-wishes-backup/unified-omni-bridge}/WISH.md +0 -0
  103. /package/.genie/wishes/{unique-leader-names → genie-wishes-backup/unique-leader-names}/WISH.md +0 -0
  104. /package/.genie/wishes/{v3-fixes-release → genie-wishes-backup/v3-fixes-release}/WISH.md +0 -0
  105. /package/.genie/wishes/{v4-critical-fixes → genie-wishes-backup/v4-critical-fixes}/WISH.md +0 -0
  106. /package/.genie/wishes/{voice-personality-pass → genie-wishes-backup/voice-personality-pass}/WISH.md +0 -0
  107. /package/.genie/wishes/{work-fire-forget → genie-wishes-backup/work-fire-forget}/WISH.md +0 -0
  108. /package/.genie/wishes/{workflow-engine-runtime → genie-wishes-backup/workflow-engine-runtime}/WISH.md +0 -0
  109. /package/.genie/wishes/{worktree-out-of-repo → genie-wishes-backup/worktree-out-of-repo}/WISH.md +0 -0
@@ -10,7 +10,7 @@
10
10
  "plugins": [
11
11
  {
12
12
  "name": "genie",
13
- "version": "4.260409.12",
13
+ "version": "4.260409.14",
14
14
  "source": "./plugins/genie",
15
15
  "description": "Human-AI partnership for Claude Code. Share a terminal, orchestrate workers, evolve together. Brainstorm ideas, wish them into plans, make with parallel agents, ship as one team. A coding genie that grows with your project."
16
16
  }
@@ -3,6 +3,8 @@
3
3
  ## Simmering
4
4
  ## Ready
5
5
  ## Poured
6
+ - **genie-simulations** — Agent eval via real multi-turn Omni conversations, 9-dimension scoring, 100 scenarios per agent → [WISH.md](.genie/wishes/genie-simulations/WISH.md)
7
+ - **genie-metaverse** — Per-workspace instances: unique ID, multi-agent detection, git-controlled publish with sim score gate → [WISH.md](.genie/wishes/genie-metaverse/WISH.md)
6
8
  - **task-leader-architecture** — Task leader built-in role, --wish flag, autonomous lifecycle → [WISH.md](.genie/wishes/task-leader-architecture/WISH.md)
7
9
  - **skill-refresh** — Refresh all 13 skills + orchestration rules rewrite → [WISH.md](.genie/wishes/skill-refresh/WISH.md)
8
10
  - **deps-bump-readme-rewrite** — Deps bump + README rewrite (cognitive load positioning) → [WISH.md](.genie/wishes/deps-bump-readme-rewrite/WISH.md)
@@ -0,0 +1,339 @@
1
+ # Wish: Genie Metaverse — Per-Workspace Instances with Git-Controlled Publishing
2
+
3
+ | Field | Value |
4
+ |-------|-------|
5
+ | **Status** | DRAFT |
6
+ | **Slug** | `genie-metaverse` |
7
+ | **Date** | 2026-04-09 |
8
+ | **Design** | [DESIGN.md](../../brainstorms/genie-metaverse/DESIGN.md) |
9
+ | **depends-on** | `genie-simulations` (publish gate requires sim scores) |
10
+
11
+ ## Summary
12
+
13
+ Transform genie-app from a generic workspace viewer into a dedicated, identity-bound deployment platform. Each install is permanently bound to a workspace (containing one or many agents), gets a unique ID, and the app controls git — dev branch for drafting/simulation, main for production, publish gated by simulation scores. Optional central registry creates a discoverable "metaverse" of genie workspaces.
14
+
15
+ ## Scope
16
+
17
+ ### IN
18
+ - Enhanced wizard: 3 setup paths (select folder, create new + optional GitHub repo, import from GitHub URL+branch)
19
+ - Unique workspace ID: UUIDv4 generated at first setup, immutable, stored in workspace.json
20
+ - Immutable workspace binding: folder + repo URL locked permanently
21
+ - Agent auto-detection: scan `.genie/agents/` + root AGENTS.md for all agents/subagents in workspace
22
+ - App-controlled git: branch switching, publish (dev → main + auto-tag vN)
23
+ - Publish gate: blocks unless latest sim scores ≥ configurable threshold (across all agents with scenarios)
24
+ - Deployment mode: `prod` / `dev` field in workspace config, determines app behavior
25
+ - Workspace lifecycle view in app: draft (dev) → simulate → publish → production → destroy
26
+ - Optional central registry: workspace instances register with metadata (name, agent roster, version, scores)
27
+ - GitHub repo creation from app (optional, for "create new" path)
28
+
29
+ ### OUT
30
+ - Agent optimization loop (auto-improve from sim failures — future wish)
31
+ - Central registry browser / metaverse discovery UI (future — this wish only registers)
32
+ - Kubernetes deployment automation (khal-os infra layer, not app concern)
33
+ - Data mirror / PII sync from prod to dev (separate infra wish — tightly coupled but different subsystem)
34
+ - Simulation engine itself (covered by `genie-simulations` wish)
35
+
36
+ ## Decisions
37
+
38
+ | Decision | Rationale |
39
+ |----------|-----------|
40
+ | Workspace = deployment unit (not single agent) | A workspace contains N agents. They ship together, version together, simulate independently. Eugenia = orchestrator + seller in one workspace |
41
+ | Auto-detect agents in workspace | App scans `.genie/agents/` and root AGENTS.md for registered agents + subagents. All are simulatable if configured |
42
+ | Immutable workspace binding | A workspace IS its identity. Rebinding would create identity confusion. Destroy + recreate is cleaner |
43
+ | App owns git for publish | Lovable-style: non-technical user clicks "Publish", app handles merge + tag. No CLI git knowledge needed |
44
+ | dev = draft, main = production | Standard git convention. dev is always the working branch, main is always what's live |
45
+ | Auto-tagging (v1, v2, v3...) | Every publish is an immutable snapshot. Rollback = point Omni at an older tag |
46
+ | Publish gate = sim score ≥ threshold | Quality-controlled releases. Can't ship a broken agent. Threshold configurable per workspace |
47
+ | Dual deployment (prod + dev) | Dev needs real data to simulate realistically, but real users must never talk to dev |
48
+ | Unique ID per workspace | Offline-first identity. UUIDv4 generated at setup, never changes. Used for PG scoping, registry, log correlation |
49
+ | Central registry is opt-in | Privacy-first. Workspace metadata only (name, agents, score, version, repo URL), never conversations or PII |
50
+
51
+ ## Success Criteria
52
+
53
+ - [ ] First-time wizard offers 3 paths: select folder, create new (+ optional GitHub repo creation), import from GitHub URL+branch
54
+ - [ ] Unique workspace ID generated on first setup, stored in workspace.json, immutable
55
+ - [ ] Workspace folder binding is permanent — app refuses to rebind to different repo
56
+ - [ ] App auto-detects all agents and subagents in workspace (scans .genie/agents/ + AGENTS.md hierarchy)
57
+ - [ ] Each detected agent shown in workspace overview with simulation status
58
+ - [ ] App controls git: branch switching, publish (dev → main + auto-tag vN)
59
+ - [ ] Publish gate: blocks unless latest sim scores ≥ configurable threshold across all agents with scenarios
60
+ - [ ] deployment_mode field (prod/dev) in workspace config — determines behavior
61
+ - [ ] GitHub repo creation works from "create new" wizard path
62
+ - [ ] Optional central registry: workspace can register for metaverse directory
63
+ - [ ] Workspace lifecycle visible in app: draft (dev) → simulate → publish → production
64
+ - [ ] Existing wizard functionality (select folder, open existing) still works
65
+
66
+ ## Execution Strategy
67
+
68
+ ### Wave 1 (parallel — foundations)
69
+ | Group | Agent | Description |
70
+ |-------|-------|-------------|
71
+ | 1 | engineer | Workspace identity: unique ID generation, immutable binding, deployment_mode |
72
+ | 2 | engineer | Agent auto-detection: workspace scanner for agents/subagents |
73
+
74
+ ### Wave 2 (parallel — after Wave 1)
75
+ | Group | Agent | Description |
76
+ |-------|-------|-------------|
77
+ | 3 | engineer | Enhanced wizard: 3 setup paths + GitHub repo creation |
78
+ | 4 | engineer | Git lifecycle: branch switching, publish (merge + auto-tag) |
79
+
80
+ ### Wave 3 (parallel — after Wave 2)
81
+ | Group | Agent | Description |
82
+ |-------|-------|-------------|
83
+ | 5 | engineer | Publish gate: sim score threshold check + UI |
84
+ | 6 | engineer | Workspace lifecycle view in app |
85
+
86
+ ### Wave 4 (after Wave 3)
87
+ | Group | Agent | Description |
88
+ |-------|-------|-------------|
89
+ | 7 | engineer | Central registry: opt-in registration + workspace metadata |
90
+ | review | reviewer | Review all groups |
91
+
92
+ ## Execution Groups
93
+
94
+ ### Group 1: Workspace Identity — Unique ID, Immutable Binding, Deployment Mode
95
+ **Goal:** Extend workspace.json with unique identity, immutable repo binding, and deployment mode.
96
+
97
+ **Deliverables:**
98
+ 1. `packages/genie-app/src-backend/workspace.ts` — extend `Workspace` interface with:
99
+ - `id: string` (UUIDv4, generated once on first setup, never changes)
100
+ - `repoUrl: string | null` (set on setup, immutable after)
101
+ - `repoBranch: string` (current active branch, mutable)
102
+ - `deploymentMode: 'prod' | 'dev'` (determines app behavior)
103
+ - `publishThreshold: number` (default 70, configurable)
104
+ - `createdAt: string` (ISO timestamp, set once)
105
+ 2. Validation: reject any attempt to change `id` or `repoUrl` after initial setup
106
+ 3. Migration: existing workspaces get a generated ID on first open (backwards compat)
107
+
108
+ **Acceptance Criteria:**
109
+ - [ ] New workspace gets UUIDv4 id on creation
110
+ - [ ] Existing workspace gets id generated on first open (migration)
111
+ - [ ] Attempting to change repoUrl after setup is rejected with error
112
+ - [ ] deploymentMode defaults to 'dev' for new workspaces
113
+
114
+ **Validation:**
115
+ ```bash
116
+ bunx biome check packages/genie-app/src-backend/workspace.ts && bunx tsc --noEmit
117
+ ```
118
+
119
+ **depends-on:** none
120
+
121
+ ---
122
+
123
+ ### Group 2: Agent Auto-Detection — Workspace Scanner
124
+ **Goal:** Scan a workspace to discover all registered agents and subagents.
125
+
126
+ **Deliverables:**
127
+ 1. `packages/genie-app/src-backend/agent-scanner.ts` — scans workspace for:
128
+ - Root AGENTS.md (top-level agent definition)
129
+ - `.genie/agents/*/AGENTS.md` (subagents)
130
+ - Parses frontmatter from each: name, model, role, color, promptMode
131
+ - Returns typed `WorkspaceAgent[]` with hierarchy (parent/child relationships)
132
+ 2. NATS subject handler: `agents.scan` — triggers scan and returns agent roster
133
+ 3. Agent roster cached in workspace state, refreshed on branch switch or manual trigger
134
+
135
+ **Acceptance Criteria:**
136
+ - [ ] Scanner discovers root agent + all subagents from `.genie/agents/`
137
+ - [ ] Frontmatter parsed correctly (name, model, role, color)
138
+ - [ ] Parent/child hierarchy detected (subagents reference parent)
139
+ - [ ] Works with eugenia-style repos (orchestrator + seller)
140
+
141
+ **Validation:**
142
+ ```bash
143
+ bunx biome check packages/genie-app/src-backend/agent-scanner.ts && bunx tsc --noEmit
144
+ ```
145
+
146
+ **depends-on:** none
147
+
148
+ ---
149
+
150
+ ### Group 3: Enhanced Wizard — 3 Setup Paths + GitHub Repo Creation
151
+ **Goal:** Upgrade the first-time wizard from 2 paths (new/existing) to 3 paths with GitHub integration.
152
+
153
+ **Deliverables:**
154
+ 1. `packages/genie-app/views/wizard/ui/WizardView.tsx` — rewrite wizard with 3 paths:
155
+ - **Select folder** — pick existing local workspace (current "Open Existing" behavior)
156
+ - **Create new** — enter name, select folder, init `.genie/`, optionally create GitHub repo via `gh repo create`
157
+ - **Import from GitHub** — enter repo URL + branch, clone to selected folder, bind workspace
158
+ 2. GitHub integration: use `gh` CLI for repo creation and cloning (graceful fallback if `gh` not installed)
159
+ 3. Post-setup: generate unique ID, set repoUrl, set deploymentMode, show agent roster from auto-detection
160
+ 4. Immutability messaging: clear UI indication that "this workspace is permanently bound to this repo"
161
+
162
+ **Acceptance Criteria:**
163
+ - [ ] All 3 wizard paths produce a working workspace with unique ID
164
+ - [ ] "Import from GitHub" clones repo at specified branch
165
+ - [ ] "Create new" + GitHub creates a public/private repo and pushes initial commit
166
+ - [ ] Fallback works when `gh` CLI is not installed (manual repo creation instructions)
167
+ - [ ] Post-setup shows detected agents from Group 2's scanner
168
+
169
+ **Validation:**
170
+ ```bash
171
+ bunx biome check packages/genie-app/views/wizard/ && bunx tsc --noEmit
172
+ ```
173
+
174
+ **depends-on:** Group 1, Group 2
175
+
176
+ ---
177
+
178
+ ### Group 4: Git Lifecycle — Branch Switching, Publish (Merge + Auto-Tag)
179
+ **Goal:** App takes control of git for branch management and publishing.
180
+
181
+ **Deliverables:**
182
+ 1. `packages/genie-app/src-backend/git-lifecycle.ts` — git operations:
183
+ - `switchBranch(branch: string)` — checkout + pull, refresh agent roster
184
+ - `publish()` — merge dev → main (fast-forward), auto-tag `vN` (next sequential), push main + tags
185
+ - `getVersionHistory()` — list tags with dates and commit messages
186
+ - `getCurrentBranch()` — current branch name
187
+ - `getBranchStatus()` — ahead/behind main, dirty working tree check
188
+ 2. NATS subject handlers: `workspace.branch`, `workspace.publish`, `workspace.versions`
189
+ 3. Publish refuses to run if current branch is already main (can't publish main to main)
190
+ 4. Tag naming: `v1`, `v2`, `v3` etc., auto-incrementing from highest existing tag
191
+
192
+ **Acceptance Criteria:**
193
+ - [ ] Branch switching works and triggers agent roster refresh
194
+ - [ ] Publish merges dev → main with fast-forward, creates auto-tag
195
+ - [ ] Version history shows all tags with dates
196
+ - [ ] Publish from main branch is rejected with clear error
197
+ - [ ] Dirty working tree warning shown before publish
198
+
199
+ **Validation:**
200
+ ```bash
201
+ bunx biome check packages/genie-app/src-backend/git-lifecycle.ts && bunx tsc --noEmit
202
+ ```
203
+
204
+ **depends-on:** Group 1
205
+
206
+ ---
207
+
208
+ ### Group 5: Publish Gate — Sim Score Threshold Check + UI
209
+ **Goal:** Block publishing unless simulation scores meet the configured threshold.
210
+
211
+ **Deliverables:**
212
+ 1. `packages/genie-app/src-backend/publish-gate.ts` — pre-publish validation:
213
+ - Query `genie_sim_runs` for latest run per agent on current branch
214
+ - Check each agent's latest score ≥ `publishThreshold` from workspace config
215
+ - Return gate result: `{ allowed: boolean, agents: [{ name, score, threshold, pass }] }`
216
+ - Agents with no scenarios configured are flagged as "no simulation data" (warning, not blocking)
217
+ 2. Publish button in UI: shows gate status (green/red per agent), score badges, threshold indicator
218
+ 3. "Run Simulations" quick action when gate fails — links to `/simulate` or `genie sim run --all`
219
+ 4. Override: no override — hard gate, score must be ≥ threshold
220
+
221
+ **Acceptance Criteria:**
222
+ - [ ] Publish blocked when any agent's latest sim score < threshold
223
+ - [ ] Gate shows per-agent breakdown: name, score, pass/fail
224
+ - [ ] Agents without scenarios show warning but don't block
225
+ - [ ] "Run Simulations" button visible when gate fails
226
+ - [ ] Threshold configurable in workspace settings (default 70)
227
+
228
+ **Validation:**
229
+ ```bash
230
+ bunx biome check packages/genie-app/src-backend/publish-gate.ts && bunx tsc --noEmit
231
+ ```
232
+
233
+ **depends-on:** Group 4, `genie-simulations` wish (PG tables must exist)
234
+
235
+ ---
236
+
237
+ ### Group 6: Workspace Lifecycle View
238
+ **Goal:** App view showing the workspace's full lifecycle: identity, agents, branch state, version history, publish controls.
239
+
240
+ **Deliverables:**
241
+ 1. Enhance existing dashboard or create workspace panel in app showing:
242
+ - **Identity card** — workspace name, unique ID, repo URL, deployment mode badge (prod/dev)
243
+ - **Agent roster** — auto-detected agents with name, role, model, last sim score, sim status
244
+ - **Branch status** — current branch, commits ahead of main, dirty indicator
245
+ - **Version history** — published tags (v1, v2, v3...) with dates, clickable for diff
246
+ - **Publish button** — with gate status (green checkmarks or red X per agent)
247
+ - **Lifecycle indicator** — visual: draft → simulate → publish → production
248
+ 2. Wire to NATS subjects from Groups 2, 4, 5
249
+ 3. Add to NAV_ITEMS in App.tsx (or integrate into existing dashboard)
250
+
251
+ **Acceptance Criteria:**
252
+ - [ ] Identity card shows workspace ID, repo URL, deployment mode
253
+ - [ ] Agent roster lists all detected agents with last sim scores
254
+ - [ ] Branch status accurate (current branch, ahead/behind main)
255
+ - [ ] Version history shows all published tags
256
+ - [ ] Publish button respects gate (disabled with explanation when blocked)
257
+ - [ ] Lifecycle indicator reflects current state
258
+
259
+ **Validation:**
260
+ ```bash
261
+ bunx biome check packages/genie-app/views/ && bunx tsc --noEmit
262
+ ```
263
+
264
+ **depends-on:** Group 2, Group 4, Group 5
265
+
266
+ ---
267
+
268
+ ### Group 7: Central Registry — Opt-In Registration
269
+ **Goal:** Allow workspace instances to register with a central directory for discovery.
270
+
271
+ **Deliverables:**
272
+ 1. `packages/genie-app/src-backend/registry.ts` — registry client:
273
+ - `register()` — POST workspace metadata to registry API (name, ID, repo URL, agent roster, latest version, aggregate sim score, deployment mode)
274
+ - `heartbeat()` — periodic update (every 5min when app is running)
275
+ - `deregister()` — on workspace destroy
276
+ - Registry URL configurable in workspace settings (default: Namastex-hosted)
277
+ 2. Settings toggle in app: "Register in Genie Metaverse" (default off)
278
+ 3. Registration payload: workspace metadata only — never conversations, PII, or credentials
279
+ 4. Graceful degradation: registry unavailable = silent skip, app works fully offline
280
+
281
+ **Acceptance Criteria:**
282
+ - [ ] Opt-in toggle in settings, default off
283
+ - [ ] Registration sends metadata only (name, ID, agents, version, score)
284
+ - [ ] Heartbeat keeps registration alive while app is running
285
+ - [ ] Deregister on workspace destroy
286
+ - [ ] App works fully offline when registry is unavailable
287
+
288
+ **Validation:**
289
+ ```bash
290
+ bunx biome check packages/genie-app/src-backend/registry.ts && bunx tsc --noEmit
291
+ ```
292
+
293
+ **depends-on:** Group 1, Group 2
294
+
295
+ ---
296
+
297
+ ## QA Criteria
298
+
299
+ - [ ] Fresh install: all 3 wizard paths produce a working workspace with unique ID and agent detection
300
+ - [ ] Existing workspace: opens with auto-generated ID (migration), no data loss
301
+ - [ ] Publish flow: dev → main + tag works end-to-end, gate blocks when score < threshold
302
+ - [ ] Agent detection: multi-agent workspace (like eugenia) correctly shows orchestrator + subagents
303
+ - [ ] Immutability: app rejects attempts to rebind workspace to different repo
304
+ - [ ] Registry: opt-in registration works, app functions fully without it
305
+ - [ ] `bun run check` passes (typecheck + lint + dead-code + test)
306
+
307
+ ## Assumptions / Risks
308
+
309
+ | Risk | Severity | Mitigation |
310
+ |------|----------|------------|
311
+ | Lock-in (can't rebind workspace) | Low | By design. Clear wizard messaging: "This binding is permanent" |
312
+ | Git conflicts (app vs user CLI pushes) | Medium | App owns publish. Dev branch accepts external pushes. Publish always fast-forwards |
313
+ | `gh` CLI not installed | Low | Graceful fallback: show manual repo creation instructions |
314
+ | Central registry availability | Low | Fully optional, offline-first. Silent skip on unavailable |
315
+ | Threshold gaming | Low | Future: scenario coverage requirements per rule category |
316
+ | Breaking existing wizard users | Medium | Migration path: existing workspaces get ID on first open, no behavior change until user opts in |
317
+
318
+ ## Review Results
319
+
320
+ _Populated by `/review` after execution completes._
321
+
322
+ ## Files to Create/Modify
323
+
324
+ ```
325
+ # New files
326
+ packages/genie-app/src-backend/agent-scanner.ts — Workspace agent/subagent discovery
327
+ packages/genie-app/src-backend/git-lifecycle.ts — Branch switching, publish, tagging
328
+ packages/genie-app/src-backend/publish-gate.ts — Sim score threshold validation
329
+ packages/genie-app/src-backend/registry.ts — Central metaverse registry client
330
+
331
+ # Modified files
332
+ packages/genie-app/src-backend/workspace.ts — Extend Workspace with id, repoUrl, deploymentMode
333
+ packages/genie-app/src-backend/pg-bridge.ts — Add NATS handlers for workspace/publish/registry
334
+ packages/genie-app/views/wizard/ui/WizardView.tsx — 3-path wizard + GitHub integration
335
+ packages/genie-app/lib/subjects.ts — Add workspace/publish/registry NATS subjects
336
+ packages/genie-app/src/App.tsx — Add lifecycle view to NAV_ITEMS
337
+ packages/genie-app/manifest.ts — Register workspace lifecycle view (if separate)
338
+ packages/genie-app/components.ts — Lazy import for lifecycle view
339
+ ```