# Content Pipeline v2 — Integration Test Guide **Date:** 2026-04-22 **Status:** Ready for testing **Prerequisites:** Backend running, Gaming PC online --- ## Test 1: API Connectivity **Purpose:** Verify all endpoints respond ```bash cd /home/hoffmann_admin/.openclaw/workspace-socrates/hoffdesk-api # Start the API (if not running) python -m uvicorn main:app --host 127.0.0.1 --port 8000 --reload # In another terminal, test connectivity curl -H "X-Admin-Token: hoffdesk-admin-2025" \ http://127.0.0.1:8000/api/v1/content/briefs # Expected: {"briefs": [], "count": 0} or list of existing briefs ``` **✅ Pass:** HTTP 200 with JSON response **❌ Fail:** Connection refused, 401 (check token), 500 (check logs) --- ## Test 2: Style Reference Endpoint **Purpose:** Verify dns-night.json loads correctly ```bash curl -H "X-Admin-Token: hoffdesk-admin-2025" \ http://127.0.0.1:8000/api/v1/content/style-references # Expected: [{"slug": "dns-night", "title": "...", "excerpt": "..."}] ``` **✅ Pass:** Returns style example with correct metadata **❌ Fail:** Empty array (check file path), 404 (check endpoint) --- ## Test 3: Create Brief **Purpose:** Verify brief creation and validation ```bash # Create test brief curl -X POST \ -H "Content-Type: application/json" \ -H "X-Admin-Token: hoffdesk-admin-2025" \ http://127.0.0.1:8000/api/v1/content/briefs \ -d '{ "title": "Test: The Morning I Broke Coffee", "struggle_angle": "I broke the coffee maker at 6 AM when Aundrea needed caffeine", "origin_story": "It was Monday morning. Aundrea was already running late. I was 'just cleaning' the coffee maker...", "attempts": [ {"attempt": "Took it apart to clean", "why_failed": "Couldn't remember how to reassemble"}, {"attempt": "Watched YouTube tutorial", "why_failed": "Our model was different"} ], "the_moment": "I found the broken plastic piece under the sink. It had been broken the whole time.", "the_fix": "Bought a new coffee maker on Amazon Same-Day. Delivered by 9 AM.", "reflection": "Never disassemble critical appliances before morning coffee. Also: always have backup caffeine.", "style_reference": "dns-night", "target_length": 800 }' # Expected: {"brief_id": "...", "status": "draft", "created_at": "..."} # Save the brief_id for next test ``` **✅ Pass:** Returns brief_id, status "draft" **❌ Fail:** 400 validation error (check required fields), 500 (server error) --- ## Test 4: Submit for Approval **Purpose:** Verify Telegram notification triggers ```bash # Replace BRIEF_ID with actual ID from Test 3 curl -X POST \ -H "X-Admin-Token: hoffdesk-admin-2025" \ http://127.0.0.1:8000/api/v1/content/briefs/BRIEF_ID/submit # Expected: {"success": true, "status": "submitted"} ``` **✅ Pass:** Status changes to "submitted", you receive Telegram DM **❌ Fail:** 400 (brief not complete), Telegram error (check token) **Check Telegram:** You should receive DM: > "New brief: Test: The Morning I Broke Coffee — Approve? [Yes] [No] [Edit]" --- ## Test 5: Approve Brief **Purpose:** Verify generation triggers ```bash # Option A: Click [Yes] in Telegram (recommended) # Option B: API call curl -X POST \ -H "X-Admin-Token: hoffdesk-admin-2025" \ http://127.0.0.1:8000/api/v1/content/briefs/BRIEF_ID/approve # Expected: {"success": true, "status": "generating"} ``` **✅ Pass:** Status changes to "generating" **❌ Fail:** 403 (not authorized), Gaming PC unavailable --- ## Test 6: Monitor Generation **Purpose:** Verify generation completes ```bash # Poll every 10 seconds curl -H "X-Admin-Token: hoffdesk-admin-2025" \ http://127.0.0.1:8000/api/v1/content/briefs/BRIEF_ID # Watch status: generating → complete ``` **Expected timeline:** - T+0s: Approved, generation started - T+60-120s: Generation completes - T+120s: Status "complete", output available **✅ Pass:** Status becomes "complete", struggle_score present **❌ Fail:** Stuck on "generating" (check Gaming PC), timeout (check model) --- ## Test 7: View Output **Purpose:** Verify content generated with struggle-first voice ```bash curl -H "X-Admin-Token: hoffdesk-admin-2025" \ http://127.0.0.1:8000/api/v1/content/briefs/BRIEF_ID/output # Expected: { # "content": "# Test: The Morning...", # "html": "