# AGY-031: Space-in-Mind Products Stuck in Discovery "Generating Cards"

**Status:** open
**Priority:** P1
**Type:** bug
**Reporter:** WaG
**Assignee:** unassigned
**Product:** agency
**Created:** 2026-02-17
**Updated:** 2026-02-17

## Description

Products created via the "Space in Mind" flow get stuck showing "Generating cards" in the Discovery phase, even when all discovery artifacts have been successfully generated. This affects 25 products (35% of space-in-mind creations).

**Root Cause:** The `space-in-mind` flow initializes `discovery/workflow.json` with `status: "in-progress", progress: 0`. The discovery pipeline generates artifacts and creates 3 PRD options for human review, but never updates workflow.json to complete because:

1. The flow expects human to select a PRD option before marking complete
2. The UI shows "Generating cards" instead of "Awaiting Review"
3. No reminder/notification is sent for pending review
4. The human gate is invisible — users don't know action is needed

## Impact

| Metric | Value |
|--------|-------|
| Total space-in-mind products | 71 |
| Stuck products | 25 (35%) |
| Working products | 43 (61%) |

**Affected products include:** alignly, compliance, dance-workshop-studio, direct-to-reader-sales-platform-for-books, edtech, households, internal-tool, local-events, motorcycle-industry, software-quality-assurance, tech, virtual-assistants (14 duplicates)

## Comparison with Working Flows

| Flow | Origin | Human Gate | Completion |
|------|--------|------------|------------|
| **Space in Mind** | `space-in-mind` | ✅ Waits for PRD selection | ❌ Often stuck |
| **Client Ready** | `client-ready` | ❌ No gate | ✅ Auto-completes |
| **Symphony Suite** | `symphony-suite` | ❌ No gate | ✅ Auto-completes |

## Steps to Reproduce

1. Go to Symphony → Create Product
2. Choose "I have a space in mind"
3. Enter industry/problem description
4. Submit
5. Wait for discovery to generate artifacts
6. Observe: UI shows "Generating cards" indefinitely
7. Check `discovery/workflow.json` → still shows `in-progress, progress: 0`

## Technical Details

**Files involved:**
- `/home/aria/projects/symph-agency/src/app/api/products/create/route.ts` — triggerDiscoveryPipeline()
- `/home/aria/projects/symph-agency/src/lib/workspace.ts` — getPhaseInfo() reads workflow.json
- `agency/products/{slug}/discovery/workflow.json` — status file

## Suggested Fix

**Quick fix (data):**
- Batch update all 25 stuck workflow.json files to `status: complete, progress: 100`

**Proper fix (code):**
1. In `workspace.ts` getPhaseInfo(), detect "has artifacts but workflow stuck" state
2. Either auto-complete, or return `status: "review"` instead of `"in-progress"`
3. Update UI to show "Review Required" badge for `status: review`
4. Add "Select PRD" CTA button in discovery phase view

## Acceptance Criteria

- [ ] Space-in-mind products don't get stuck in "Generating cards"
- [ ] Either auto-complete when artifacts exist, OR show "Awaiting Review" state
- [ ] Clear user action if human review is needed

## Updates

### 2026-02-17 — ARIA
Issue created from investigation at WaG's request. Root cause identified as missing workflow.json completion step in space-in-mind flow. No changes made to stuck products — ticket created for proper tracking.
