Skip to content

feat: restructure workflow with unified questions and document-level approval#26

Merged
AmElmo merged 16 commits intomainfrom
AmElmo/unified-questions
Feb 23, 2026
Merged

feat: restructure workflow with unified questions and document-level approval#26
AmElmo merged 16 commits intomainfrom
AmElmo/unified-questions

Conversation

@AmElmo
Copy link
Copy Markdown
Owner

@AmElmo AmElmo commented Feb 23, 2026

Summary

Restructured the workflow to collect all questions upfront before document generation, improving the user experience for non-technical stakeholders. Added per-document approval system replacing the tab-based navigation, comprehensive generation indicators, and multiple UX/UI enhancements.

Key Changes

  • Unified question collection: All workflow questions collected in a single phase before document generation begins
  • Per-document approval system: Replace tab-based navigation with sidebar-based document review and approval
  • Global generation indicators: Active generation tracking with real-time streaming updates
  • Enhanced Edit with AI: Floating panel on the right side with fresh-session fallback support
  • Navigation guard: Prevents accidental navigation when forms have unsaved changes
  • Improved status resilience: Fixed reconciliation loops and doc status tracking issues

Files Modified

Major changes in specification workflows (Specification.tsx, DocumentReview.tsx), status management (status-service.ts), and API routes (web-server.ts). New hooks for navigation guards and generation context management.

… documents

Change the CLI workflow from interleaved question-then-document per agent to two
distinct phases: collect all three agents' questions first, then generate all
documents together. This aligns the CLI with the web UI's parallel generation model.
Rework the engineer questioning prompt to target business owners instead of
developers, asking about performance, cost, scale, and reliability in plain
language. Wire agents to use prior agents' Q&A context instead of generated
documents. Update question depth labels to reflect new per-agent counts.
Add a reusable useNavigationGuard hook that blocks browser refresh, back/forward,
and React Router navigation when a form has unsaved changes. Apply it to the
question form and document review editor.
Add an ActiveGenerationsProvider context that polls for running AI generations
and a fixed-position indicator pill that shows when any agent is working. Clicking
the indicator navigates to the relevant project. Persists across route changes.
Cancel support:
- Add process registry to headless-agent-service for tracking running CLI processes
- Add cancel API endpoint that kills processes and clears generation state
- Add cancel button in the UI working state with WebSocket event handling
- Fix stale ai-working state that persisted across server restarts

Per-agent streaming UI:
- Split single streaming log into per-agent logs routed by WebSocket event phase
- Each agent card shows file-level progress (2 files per agent with checkmarks)
- Cards are expandable to show that agent's live streaming output
- Smart trigger: only spawn agents for incomplete documents on re-entry
- Add markDocPhaseGenerating to preserve already-complete agents on partial re-trigger
Add a Documents section to the sidebar during the review phase showing
PRD, Design Brief, and Tech Spec with approval status indicators
(checkmark, review badge, or empty circle). Fix the Edit with AI
feature by adding a full-width inline mode to RefinePanel and
auto-scrolling to it when activated.
Remove sessionId guard so Edit with AI is always available during review.
Server now tries resume first, falls back to a fresh Claude session with
document content when no session exists or resume fails. Also fixes
clipboard headless fallback behavior.
The Edit with AI panel is now fixed-positioned on the right side so
users can scroll through the document while composing their feedback.
Also adds sidebar document navigation and initialTab support.
The Edit/Approve footer was centered across the full viewport, ignoring
the sidebar offset. Now it starts at the sidebar edge and uses matching
padding so buttons align with the document's right edge.
…eview

Each document can now be approved independently via a new
/api/specification/approve-document endpoint. The phase only advances
when both docs in that phase are approved. The tab UI in DocumentReview
is replaced with direct content rendering since the sidebar handles
document switching.
ProjectDetail was using phase-level booleans (phases.pm.complete) to
determine document status, while Specification used approvedDocuments
and currentPhase. Now both views use the same approvedDocuments +
currentPhase data source with identical backward-compat logic.
…hout selections

Past-phase documents that weren't individually approved now show as
reviewable instead of stuck as pending. Also restore the validation
that prevents approving technology choices before all selections are made.
When approvedDocuments is non-empty, all docs have been generated
(parallel generation). Non-approved docs are always reviewable
regardless of what currentPhase says.

Also fix approveDocument backend to scan phase pairs in order instead
of relying on currentPhase, which can become stale after doc
regeneration.
The reconciliation rule for acceptance criteria only checked for the
'acceptance_criteria' JSON key, but the file uses 'job_stories'. This
caused a loop: reconciliation resets prd-generate to not-started, the
API retroactive check sees files exist and re-completes it, triggering
reconciliation again — causing UI flickering.

Also simplify doc review status: when approvedDocuments has entries,
all docs are generated (parallel gen), so non-approved docs are always
reviewable. Backend approveDocument now scans phase pairs in order
instead of relying on potentially stale currentPhase.
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec-wright Ready Ready Preview, Comment Feb 23, 2026 9:05am

@AmElmo AmElmo merged commit 044e524 into main Feb 23, 2026
10 checks passed
github-actions Bot pushed a commit that referenced this pull request Feb 23, 2026
## [3.5.0](v3.4.1...v3.5.0) (2026-02-23)

### Features

* restructure workflow with unified questions and document-level approval ([#26](#26)) ([044e524](044e524))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 3.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant