# Video Pipeline Mission Control - Dashboard Requirements

## Executive Summary

A real-time dashboard for managing the video content pipeline from topic discovery through production-ready scripts. The system manages **537 opportunities** across **14 channels**, tracking them through 5 pipeline stages.

---

## Data Architecture

### Core Data Sources

```
output/
├── analysis_opportunities_{channel}.json    # Per-channel opportunity data
│   └── opportunities[]                      # Array of 30-70 items
│       ├── Layer 3: scores, hooks, structure, verdict
│       ├── Layer 3.5: research_report_content (70-90KB)
│       └── Layer 4: script, evaluation, production_ready
│
└── {channel}/                               # Production output folders
    └── {date}_{slug}.json                   # Complete production packages (160-200KB)
        ├── input: Layer 3 + research
        ├── output: script + evaluation
        ├── pipeline: iteration history
        ├── meta: summary
        └── narration_script: formatted VO text
```

### Opportunity States

| State | Has | Missing | Count |
|-------|-----|---------|-------|
| DISCOVERED | cluster_id, sources | weighted_score | 3 |
| ANALYZED | weighted_score, scores, verdict | research_completed | 499 |
| RESEARCHED | research_report_content | script | 29 |
| SCRIPTED | script, evaluation | production_ready=True | 0 |
| PRODUCTION_READY | production_ready=True | - | 6 |

---

## Views & Screens

### 1. COMMAND CENTER (Home Dashboard)

**Purpose:** At-a-glance system health and quick actions

#### Metrics Panel
```
┌─────────────────────────────────────────────────────────────┐
│  PIPELINE HEALTH                                            │
├──────────────┬──────────────┬──────────────┬───────────────┤
│  537         │  534         │  35          │  6            │
│  Total       │  Analyzed    │  Researched  │  Ready        │
│  Topics      │  (99%)       │  (7%)        │  (1%)         │
└──────────────┴──────────────┴──────────────┴───────────────┘
```

#### Pipeline Funnel Visualization
- Visual funnel showing conversion rates between stages
- Click to filter to that stage

#### Channel Health Grid
```
┌────────────────────────┬───────┬───────┬───────┬───────┐
│ Channel                │ Total │ 4.5+  │ Rsch  │ Ready │
├────────────────────────┼───────┼───────┼───────┼───────┤
│ money_traps            │ 42    │ 33    │ 1     │ 0     │
│ one_minute_history     │ 45    │ 24    │ 6     │ 6     │
│ sixty_second_rabbit... │ 42    │ 26    │ 1     │ 0     │
└────────────────────────┴───────┴───────┴───────┴───────┘
```
- Click channel row to drill into channel view

#### Quick Actions
- "Research Top 5" button per channel
- "Generate Scripts" for researched items
- Active jobs indicator (research service status)

---

### 2. CHANNEL VIEW

**Purpose:** Deep dive into a single channel's opportunities

#### Header
- Channel name, description
- Stats: total topics, avg score, researched count, production ready

#### Opportunity Table
| Score | Title | Stage | Research | Script | Actions |
|-------|-------|-------|----------|--------|---------|
| 4.90 | Tobacco Company... | Ready | 9,846w | 4.54 | View |
| 4.75 | Nuclear Launch... | Ready | 8,753w | 4.65 | View |
| 4.75 | Pilot 6 Tanks... | Analyzed | - | - | Research |

**Columns:**
- `Score`: weighted_score with color coding (green 4.5+, yellow 4.0+, etc.)
- `Title`: suggested_title (truncated)
- `Stage`: State badge (Analyzed/Researched/Ready)
- `Research`: word count if researched, "-" if not
- `Script`: composite_score if scripted, "-" if not
- `Actions`: Context-appropriate buttons

**Filters:**
- Stage: All / Analyzed / Researched / Scripted / Ready
- Score: Min/Max slider
- Search: Title text search

**Bulk Actions:**
- Select multiple → "Research Selected" / "Generate Scripts"

---

### 3. OPPORTUNITY DETAIL VIEW

**Purpose:** Full detail on a single opportunity

#### Tabs

**Overview Tab**
```
┌─────────────────────────────────────────────────────────────┐
│  THE TOBACCO COMPANY THAT BOUGHT THE WOMEN'S MOVEMENT       │
│  Channel: one_minute_history    Score: 4.90                 │
├─────────────────────────────────────────────────────────────┤
│  PREMISE                                                    │
│  "A tobacco company funded the women's rights parade..."    │
├─────────────────────────────────────────────────────────────┤
│  SCORES                                                     │
│  Scroll-Stop: 5/5  │  Completion: 5/5  │  Share: 5/5       │
│  Demand: 4/5       │  Visual: 5/5      │  Evergreen: 5/5   │
├─────────────────────────────────────────────────────────────┤
│  HOOKS (3 candidates)                                       │
│  1. "A tobacco company paid women to march..."              │
│  2. "Freud's nephew invented modern propaganda..."          │
│  3. "In 1929, women couldn't smoke in public..."            │
└─────────────────────────────────────────────────────────────┘
```

**Research Tab** (if researched)
- Research word count, source count, duration
- Expandable research report content
- Key facts table (if parseable)
- Sources list

**Script Tab** (if scripted)
- Narration script (formatted, readable)
- Beat-by-beat breakdown with:
  - Voiceover text
  - Visual direction
  - Text overlays
  - Sound design
  - Timing markers
- Evaluation scores by domain
- Gut check results

**Production Tab** (if production_ready)
- Download production package (JSON)
- Export narration script (TXT)
- Export visual brief (summary of all visual directions)
- Copy to clipboard options

---

### 4. SCRIPT VIEWER

**Purpose:** Production-focused view of a script

#### Script Display
```
┌─────────────────────────────────────────────────────────────┐
│  BEAT 1: THE IMPOSSIBILITY (0-14s)                         │
│  Emotional State: "That can't be real"                      │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────────┐  VO: "The code to launch America's    │
│  │                 │  nuclear missiles was eight zeros."    │
│  │   [VISUAL]      │                                        │
│  │   Missile panel │  TEXT: [00000000]                      │
│  │                 │  AUDIO: Low tension drone              │
│  └─────────────────┘  ★ SYNC: Text appears on "eight zeros" │
├─────────────────────────────────────────────────────────────┤
│  SEGMENT 2 (4.5-8s)                                         │
│  ...                                                        │
└─────────────────────────────────────────────────────────────┘
```

#### Evaluation Sidebar
- Composite score (large display)
- Domain scores radar chart
- Critical failures (if any)
- Strengths summary

#### Actions
- "Regenerate Script" (trigger new Layer 4 run)
- "Export Production Package"
- "Copy Narration"

---

### 5. JOBS & ACTIVITY VIEW

**Purpose:** Monitor pipeline activity

#### Active Jobs
```
┌─────────────────────────────────────────────────────────────┐
│  ACTIVE JOBS                                                │
├────────────────────────────────────┬────────────┬───────────┤
│  Research: Nuclear Launch Codes    │  4m 23s    │  Running  │
│  Research: Beach Boys Manson       │  2m 10s    │  Running  │
│  Script: Tiffany Name              │  45s       │  Running  │
└────────────────────────────────────┴────────────┴───────────┘
```

#### Recent Completions
- Last 20 completed jobs
- Success/failure status
- Click to view result

#### Service Health
- Research service status (green/red)
- Last health check timestamp
- Active jobs count
- Queue depth (if applicable)

---

## Key Data Fields Reference

### Layer 3 Opportunity Fields (for display)
```javascript
{
  suggested_title: "Title for display",
  premise: "One-line premise",
  weighted_score: 4.90,
  channel: "one_minute_history",
  verdict: "MAKE_NOW",

  scores: {
    scroll_stop_power: { score: 5, reasoning: "..." },
    completion_probability: { score: 5, reasoning: "..." },
    share_save_potential: { score: 5, reasoning: "..." },
    demand_signal: { score: 4, reasoning: "..." },
    visual_potential: { score: 5, reasoning: "..." },
    evergreen_potential: { score: 5, reasoning: "..." }
  },

  opening_hook: "First hook candidate",
  hook_candidates: ["hook1", "hook2", "hook3"],
  core_reveal: "The main revelation",
  first_frame: "Visual description for first frame",
  structure: "Beat outline",
  target_audience: "Who this is for",

  // State indicators
  research_completed: true,
  research_word_count: 9846,
  research_source_count: 351,
  production_ready: false
}
```

### Layer 4 Script Fields (for display)
```javascript
{
  metadata: {
    word_count: 267,
    actual_duration: 88,
    beat_count: 5
  },

  beats: [{
    beat_number: 1,
    beat_name: "THE IMPOSSIBILITY",
    time_start: 0,
    time_end: 14,
    emotional_state: "That can't be real",
    function: "Fire orienting response...",
    segments: [{
      time_start: 0,
      time_end: 4.5,
      voiceover: "The code to launch...",
      visual: "Close-up of missile panel...",
      text_overlay: "00000000",
      text_overlay_style: "center, red digital font",
      sound_design: "Low tension drone",
      sync_point: true,
      sync_description: "Text appears as..."
    }]
  }],

  production_notes: {
    voiceover_direction: "Storyteller energy...",
    music_arc: "Tension drone...",
    visual_style: "Archival-forward...",
    sound_off_check: "Text overlays carry...",
    frame_composition: "Center-weighted..."
  }
}
```

### Layer 4 Evaluation Fields (for display)
```javascript
{
  composite_score: 4.65,
  verdict: "PRODUCTION_READY",

  domain_scores: {
    structural_compliance: { domain_average: 4.5, /* subscores */ },
    attention_architecture: { domain_average: 4.5 },
    channel_architecture: { domain_average: 5.0 },
    multi_track_composition: { domain_average: 4.5 },
    emotional_engineering: { domain_average: 5.0 },
    craft_quality: { domain_average: 5.0 }
  },

  gut_check: {
    would_stop_scrolling: true,
    would_watch_to_end: true,
    would_send_to_someone: true,
    gut_assessment: "This would absolutely stop me..."
  },

  critical_failures: [], // Array of issues if any
  strengths: "What the script does well...",
  revision_instructions: null // or string if revision needed
}
```

---

## User Actions & Workflows

### Workflow 1: Daily Review
1. Open Command Center
2. Check pipeline health metrics
3. Review any completed jobs
4. Identify channels with backlog

### Workflow 2: Batch Research
1. Navigate to Channel View
2. Filter to "Analyzed" state, sort by score desc
3. Select top N opportunities
4. Click "Research Selected"
5. Monitor in Jobs view

### Workflow 3: Script Generation
1. Navigate to Channel View
2. Filter to "Researched" state
3. Select opportunity → "Generate Script"
4. Review script in Script Viewer
5. Export if production_ready

### Workflow 4: Production Export
1. Filter to "Production Ready"
2. Open Opportunity Detail → Production Tab
3. Download production package
4. Or copy narration script for VO recording

---

## Technical Requirements

### API Endpoints Needed

```
GET  /api/channels                    # List all channels with stats
GET  /api/channels/:id/opportunities  # List opportunities for channel
GET  /api/opportunities/:id           # Get single opportunity detail
GET  /api/opportunities/:id/script    # Get script if exists
GET  /api/opportunities/:id/research  # Get research if exists

POST /api/opportunities/:id/research  # Trigger research
POST /api/opportunities/:id/script    # Trigger script generation

GET  /api/jobs                        # List active/recent jobs
GET  /api/jobs/:id                    # Get job status

GET  /api/health                      # Service health check
GET  /api/stats                       # Pipeline-wide statistics
```

### Real-time Updates
- WebSocket or polling for:
  - Job progress updates
  - New completions
  - Service status changes

### Performance Considerations
- Pagination for opportunity lists (50 per page)
- Lazy-load research content (it's 70-90KB each)
- Cache channel stats (refresh every 30s)
- Index by channel + state for fast filtering

---

## UI/UX Guidelines

### Color Coding
- **Score Colors:**
  - 4.5+ = Green (#22c55e)
  - 4.0-4.49 = Yellow (#eab308)
  - 3.5-3.99 = Orange (#f97316)
  - <3.5 = Red (#ef4444)

- **State Colors:**
  - Discovered = Gray
  - Analyzed = Blue (#3b82f6)
  - Researched = Purple (#8b5cf6)
  - Scripted = Orange (#f97316)
  - Production Ready = Green (#22c55e)

### Typography
- Monospace for: scores, timestamps, code
- Sans-serif for: titles, descriptions
- Readable serif for: narration scripts (long-form reading)

### Layout
- Fixed sidebar for navigation
- Main content area scrollable
- Collapsible panels for dense data
- Modal dialogs for confirmations

---

## Future Enhancements (Phase 2+)

1. **Comparison View** - Side-by-side script comparison
2. **Edit Capability** - Manual script editing with re-evaluation
3. **Batch Operations** - Queue multiple research/script jobs
4. **Analytics** - Score trends, channel performance over time
5. **Notifications** - Slack/email when production ready
6. **Scheduling** - Automated batch processing
7. **Export Formats** - Direct export to video editing tools
8. **Collaboration** - Comments, assignments, review workflow

---

## Appendix: Sample Data Sizes

| Data Type | Typical Size | Notes |
|-----------|--------------|-------|
| Opportunity (analyzed) | 2-5 KB | Before research |
| Research content | 70-90 KB | ~8,000 words |
| Script | 8-12 KB | 5 beats, 15 segments |
| Evaluation | 15-20 KB | Full domain breakdown |
| Production package | 160-200 KB | Complete bundle |
| Channel opportunities file | 200-600 KB | 40-70 opportunities |
