--- id: TASK-13 title: Build the audit and outreach review workspace status: In Progress assignee: [] created_date: '2026-06-03 19:14' updated_date: '2026-06-05 12:13' labels: - mvp - review - workflow dependencies: - TASK-11 - TASK-12 references: - PRD.md priority: high ordinal: 13000 --- ## Description Create the internal review workspace where Matthias can inspect and edit the final audit summary, public audit link, email subject, email body, contact strategy, phone script, follow-up draft, sources, and used skills before any publication or sending happens. ## Acceptance Criteria - [ ] #1 Review workspace shows lead details, contact sources, priority reason, contact strategy, audit summary, used skills, and raw/source detail toggles - [ ] #2 Audit content can be edited and manually approved before the public page shows customer-facing content - [ ] #3 Email subject and body are editable and generated as exactly one recommended version by default - [ ] #4 Phone script is available for Erst anrufen and Kontakt fehlt leads when a phone number exists - [ ] #5 Freigabe offen state clearly separates Audit veröffentlichen from E-Mail freigeben und senden ## Implementation Plan 1. Wire PageSpeed completion into audit_generation queue 2. Verify handoff with regression tests 3. Build review workspace UI and edit/approval flows 4. Verify state transitions back into dashboard/funnel ## Implementation Notes Starting TASK-13 with the missing PageSpeed-to-audit-generation handoff so generated audit content exists for the review workspace. Implemented first TASK-13 prerequisite: PageSpeed completion now queues audit_generation for the same lead via internal.auditGeneration.queueLeadAuditGeneration. Queue failures are logged as warnings and do not fail the PageSpeed run. Verified with pnpm test (245/245), pnpm exec tsc --noEmit, pnpm lint (0 errors, existing generated warnings), and pnpm build using .env.local.