export declare const QA = "# /qa \u2014 Persona Alignment Gate\n\n## What This Does\n\nStress-tests all customer-facing content against the validated buyer persona. Flags misalignment across 7 dimensions, auto-corrects issues, re-validates, and produces a clearance verdict. Nothing enters the deployment pipeline without passing this gate.\n\n## Trigger Context\nThree activation modes:\n\n**AUTO MODE** \u2014 Runs automatically after `/deploy` completes, before `/validate-prep` generates the deployment package. This is the primary gate.\n\n**MANUAL MODE** \u2014 User types `/qa` to run on any existing assets. Useful after manual edits or when iterating on specific pieces.\n\n**CREATIVE MODE** \u2014 Auto-runs on new creative batches from `/creative-test` MODE 1 before they enter the testing flywheel. Prevents spending money testing misaligned creatives.\n\n## Prerequisites\n- Therapeutic Buyer Research Package (from /research): Pain Architecture, Failed Solutions Map, Identity Gap, Language Bank, Sophistication Level, Awareness Level, Transformation Narrative\n- Copy Directives (from /stress-test GO verdict)\n- Building Blocks (from /build-blocks)\n- Campaign assets to audit (from /deploy, /creative-test, or /funnel-optimize)\n\n## Execution Protocol\n\n**DELEGATE TO SUBAGENT: `persona-qa`**\n\n### Step 1: Load All Inputs\n\nGather from pipeline assets:\n```\nFROM buyer research: assets/[market-name]/research/buyer-research-package.md\nFROM building blocks: assets/[market-name]/building-blocks/building-blocks.md\nFROM stress test: assets/[market-name]/building-blocks/stress-test-report.md (Copy Directives section)\nFROM campaigns: assets/[market-name]/campaigns/* (all customer-facing assets)\n```\n\nIf running in CREATIVE MODE, also load:\n```\nFROM creative tests: assets/[market-name]/traffic/creative-tests/batch-[N]/*\n```\n\n### Step 2: Invoke Persona QA Subagent\n\nPass the complete package to the persona-qa subagent. The subagent runs 7 alignment checks on every customer-facing asset:\n\n1. **Language Alignment** \u2014 Does the copy use the buyer's words or the builder's?\n2. **Awareness Level Match** \u2014 Does the approach match how aware this market is?\n3. **Sophistication Level Match** \u2014 Does the copy respect how many solutions they've seen?\n4. **Pain Architecture Alignment** \u2014 Does it address root pain in priority order?\n5. **Failed Solutions Integration** \u2014 Does it acknowledge what they've tried and why it failed?\n6. **Identity Gap Bridge** \u2014 Does the transformation narrative match their specific gap?\n7. **Promise Authorization Audit** \u2014 Does every claim stay within Copy Directives?\n\n**Optional Check 8: Technical/SEO Structure Alignment** \u2014 runs only when `organic_growth.content_engine.status == \"complete\"` in pipeline state OR the selected platform supports organic traffic. This check is **ADVISORY only** (non-blocking). It verifies:\n- H1 contains primary keyword\n- H2s framed as questions (featured snippet optimization)\n- FAQ section present with question-as-header format\n- Meta descriptions present and under 160 chars\n- First 200 words contain stat + value prop + brand name\n\n### Step 3: Receive QA Report + Corrected Assets\n\nThe subagent returns:\n- Full QA report with per-asset scores and per-check breakdowns\n- Auto-corrected versions of all flagged assets\n- Clearance verdict: CLEARED / CLEARED WITH CONDITIONS / BLOCKED\n\n### Step 4: Apply Corrections\n\n**If CLEARED:**\n- Replace original assets with corrected versions in `assets/[market-name]/campaigns/`\n- Archive originals as `[filename]-pre-qa.[ext]` for reference\n- Save QA report to `assets/[market-name]/campaigns/qa-report.md`\n- Update pipeline-state.json with QA status\n- Proceed to `/validate-prep` (or back to `/creative-test` in creative mode)\n\n**If CLEARED WITH CONDITIONS:**\n- Present the accepted risks to user\n- Apply all auto-corrections\n- Document which MODERATE flags were accepted and why\n- Tier 2 \u2014 Notify & Proceed (conditions are documented, not blocking)\n- Proceed to `/validate-prep`\n\n**If BLOCKED:**\n- Present all CRITICAL flags with current vs. corrected versions\n- Tier 3 \u2014 Recommend & Wait\n- User reviews corrected versions and approves\n- If corrections are insufficient (fundamental Building Block problem): route to `/feedback` for Building Block revision, then re-run `/deploy` \u2192 `/qa`\n- Do NOT proceed to deployment until CRITICAL flags are resolved\n\n### Step 5: Capture Alignment Patterns\n\nAfter QA completes, extract learnings for the pattern library:\n\n```\nAuto-capture to /lessons:\n- Which checks scored lowest (recurring weakness to address in future pipelines)\n- Which Language Bank phrases appeared most effective in corrected versions\n- Whether the awareness/sophistication level assessment was accurate\n- Any systematic pattern in the types of corrections needed\n```\n\n### Step 6: Post-QA Verification (AUTO-EXECUTE \u2014 Tier 1)\n\n**Final structural check after persona corrections.** The persona-qa subagent may have edited assets during correction \u2014 this re-run verifies those edits didn't break structural integrity (introduce placeholder text, push subject lines over length, break HTML, etc.).\n\n**Execute immediately using Bash:**\n```bash\npython qa-tests/qa_runner.py [market-slug] --module landing_page --module campaign_assets --json-out assets/[market-name]/campaigns/qa-post-correction.json\n```\n\nNote: research_report and unit_economics modules are NOT re-run here \u2014 they were already validated pre-deploy and persona QA doesn't touch those files.\n\n**If exit code is 0:** proceed to Step 7.\n\n**If exit code is 1:** fix directly (Tier 1 \u2014 auto-fix structural issues introduced by persona corrections). Re-run. Max 3 iterations.\n\n**If iterations exhaust:** present remaining failures to user as Tier 3.\n\n### Step 7: VEE Handoff (CLEARED/CLEARED WITH CONDITIONS only)\n\nThe persona-qa subagent handles this automatically:\n- Archives cleared assets to `assets/[market-name]/campaigns/qa-passed/` with metadata\n- Initializes voice state if first QA pass for this business\n- Increments VEE accumulation counter\n- Flags VEE readiness when threshold is reached\n\nIf VEE READY appears in the QA report, inform the user:\n```\nVoice Extraction Engine ready. Run /voice-extract --business [slug] to generate brand voice doc.\n```\n\n### Step 8: Update Pipeline State\n\n```json\n{\n \"qa_gate\": {\n \"status\": \"complete\",\n \"completed_at\": \"[timestamp]\",\n \"verdict\": \"[cleared/cleared_with_conditions/blocked]\",\n \"overall_score\": \"[X/35]\",\n \"checks\": {\n \"language_alignment\": \"[X/5]\",\n \"awareness_match\": \"[X/5]\",\n \"sophistication_match\": \"[X/5]\",\n \"pain_alignment\": \"[X/5]\",\n \"failed_solutions\": \"[X/5]\",\n \"identity_gap\": \"[X/5]\",\n \"promise_authorization\": \"[X/5]\"\n },\n \"corrections_applied\": {\n \"critical\": \"[N]\",\n \"moderate\": \"[N]\",\n \"minor\": \"[N]\"\n },\n \"seo_structure\": {\n \"ran\": true,\n \"advisory_flags\": \"[N]\",\n \"h1_keyword\": \"[pass/fail]\",\n \"h2_questions\": \"[pass/fail]\",\n \"faq_present\": \"[pass/fail]\",\n \"meta_descriptions\": \"[pass/fail]\",\n \"first_200_words\": \"[pass/fail]\"\n },\n \"assets_cleared\": [\"[list of cleared asset filenames]\"],\n \"output_file\": \"assets/[market-name]/campaigns/qa-report.md\"\n }\n}\n```\n\n## Integration Points\n\n### With /deploy (Primary Gate \u2014 AUTO MODE)\n```\n/deploy completes \u2192 /qa runs automatically \u2192 if CLEARED \u2192 /validate-prep\n \u2192 if BLOCKED \u2192 fix \u2192 re-run /qa\n```\n\n### With /creative-test (Creative Gate \u2014 CREATIVE MODE)\n```\n/creative-test MODE 1 generates batch \u2192 /qa runs on batch \u2192 if CLEARED \u2192 batch enters testing\n \u2192 if BLOCKED \u2192 correct \u2192 re-check\n```\n\n### With /funnel-optimize (Variation Gate \u2014 MANUAL MODE)\n```\n/funnel-optimize generates test variation \u2192 /qa runs on variation \u2192 if CLEARED \u2192 enter A/B test\n \u2192 if BLOCKED \u2192 correct\n```\n\n### With /feedback (Escalation Path)\n```\n/qa BLOCKED + corrections insufficient \u2192 /feedback \u2192 diagnose Building Block issue\n \u2192 /build-blocks revision \u2192 /stress-test \u2192 /deploy \u2192 /qa (full cycle)\n```\n\n### With /voice-extract (Voice Extraction Sidecar)\n```\n/qa CLEARED \u2192 Phase 7 archives to qa-passed/ \u2192 accumulator increments\n \u2192 threshold hit \u2192 VEE READY flagged in report \u2192 user runs /voice-extract\n \u2192 brand voice doc generated \u2192 feeds into future asset creation cycles\n```\n\n## Autonomy\nTier 1 \u2014 Full Auto for running the audit and applying corrections.\nTier 2 \u2014 Notify & Proceed for CLEARED and CLEARED WITH CONDITIONS verdicts.\nTier 3 \u2014 Recommend & Wait for BLOCKED verdicts (user must approve resolution path).\n\n## Output\nQA Report + corrected assets saved to campaigns folder. Pipeline state updated.\n\n## Next Step\nCLEARED \u2192 `/validate-prep` (auto-mode) or back to calling command (creative/manual mode)\nCLEARED \u2192 `campaigns/qa-passed/` is now the canonical deploy source for the Asset Executor agent. The full `assets/[market-name]/` directory can be handed to the executor for deployment.\nBLOCKED \u2192 Fix path presented, then re-run `/qa`"; //# sourceMappingURL=qa.d.ts.map