Skip to content

Sprint A+B: Downloads, Claude models, feedback UI, Shorts pipeline, SEMRush#66

Merged
mriechers merged 17 commits intomainfrom
dev
Apr 8, 2026
Merged

Sprint A+B: Downloads, Claude models, feedback UI, Shorts pipeline, SEMRush#66
mriechers merged 17 commits intomainfrom
dev

Conversation

@mriechers
Copy link
Copy Markdown
Owner

Summary

Comprehensive feature sprint addressing 7 high/normal priority issues plus a merged PR (#65) with formatter editor feedback.

Sprint A (High Priority)

Sprint B (Normal Priority)

Also included

Test plan

Container rebuild

  • docker compose build --no-cache && docker compose up -d — all services start
  • curl http://localhost:8000/api/system/health returns healthy
  • Dashboard loads at http://localhost:3001

Downloads (#62)

  • On job detail page, download buttons appear next to each output tab
  • Clicking download triggers browser file save (not inline render)
  • /api/jobs/1/outputs/analyst_output.md?download=true returns Content-Disposition: attachment header

AirTable images (#63)

  • Screengrab images are clickable (open full-size in new tab)
  • "View in Airtable" link opens correct SST record (not raw base URL)

Model tiers (#61)

  • Submit a new job — verify it uses Claude Sonnet (check phase model in job detail)
  • Retry a phase with tier override — verify Claude Haiku (0) / Opus (2) / pinned (3) work
  • Cost tracking shows correct pricing for Claude models

Editorial feedback (#64)

  • Click retry on any phase output — modal appears with tier dropdown + feedback textarea
  • Submit retry with feedback text — verify phase re-runs and output reflects feedback
  • Check phase history shows feedback in previous runs

Shorts pipeline (#59)

  • Process a short transcript (<90s duration) — verify "Short" badge appears
  • Verify timestamp phase is skipped for Shorts
  • Verify cheapskate tier used for all Short phases

SEMRush upload (#20)

  • Upload a CSV file via the keyword report section on job detail page
  • Verify file saved as keyword_report_v1.md
  • Retry SEO phase — verify keyword data appears in prompt context

Agent definitions (#46)

  • Spot-check .claude/agents/*.md files have consistent section headers

Formatter improvements (PR #65)

  • Retry formatter phase on an existing job
  • Verify output preserves verbatim dialogue (no paraphrasing)
  • Verify "partisan" spelling, no italicized program names

DB migration

  • alembic upgrade head runs cleanly (adds content_type column)

🤖 Generated with Claude Code

mriechers and others added 17 commits March 27, 2026 15:08
…ling, and editorial rules

Job 44 (6POL0102) exposed systemic issues: the formatter fabricated a host name
from garbled live captions because Airtable SST context was unavailable. This
overhaul addresses speaker attribution accuracy, content preservation, and PBS
Wisconsin house style across the entire agent pipeline.

SST context expansion:
- Add get_project_record() to AirtableClient for linked Project lookups
- Extract Social Media Description and follow Project→Notes for series cast info
- Auto-parse speaker names from SST text fields into Host/Presenter when not set
- Add Social Media Description and Project Notes to all phase prompts

Agent prompt improvements:
- Analyst: detect live caption sources, never fabricate names from garbled text
- Formatter: PBS house style (Capitol, OK, liberals lowercase, Legislature caps,
  no oxford commas, abbreviated honorifics, em dash discipline, Marquette Poll),
  two-trailing-space line breaks, content preservation rules
- Manager: CRITICAL speaker name verification against SST data

Code fixes:
- Strip Model/Creator/Agent attribution lines in chunked merge (mid-doc bug)
- Lower timestamp auto-trigger threshold from 30min to 10min
- Strengthen verbatim instructions to reconstruct garbled captions, never omit
- Load Wisconsin proper-noun reference for analyst and formatter phases

New files:
- knowledge/wisconsin_reference.md: place names, political figures, legal cases

[Agent: Claude Code]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rolls in guidelines from the /timestamps skill (the-lodge) into
Cardigan's timestamp agent prompt. Key improvements:

- Duration-based chapter count caps (3-10 depending on length)
- Mandatory "Episode intro" as first chapter name
- Sentence case naming convention for PBS descriptions
- "Capture the topic, not the format" naming rule
- Neutral/professional tone guardrail for public media
- Updated quality checklist

[Agent: Claude Code]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Addresses code review finding on PR #54: the knowledge/ directory
(containing wisconsin_reference.md) was not being copied into Docker
containers, so the Wisconsin proper-noun reference would silently
never load in production. Also fixes stale "30+" comment to match
the new 10-minute timestamp threshold.

[Agent: Claude Code]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two additional chaptering rules from the /timestamps skill:
- Align chapter timestamps to speaker transitions (>> markers) rather
  than mid-speech topic keywords
- Use parallel framing for political content to avoid editorial bias
  in candidate/party chapter names

[Agent: Claude Code]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dockerfile.api was missing COPY alembic/ — migrations couldn't run
in the container. Also updated alembic/env.py to read DATABASE_PATH
env var so it connects to the correct SQLite path in Docker
(/data/db/dashboard.db) instead of the hardcoded local ./dashboard.db.

[Agent: Main Assistant]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add feedback parameter to phase retry endpoint, allowing editors to
guide re-runs with natural language instructions. Prototype tested
successfully on job #1 timestamp phase.

Also fixes:
- nginx crash when MCP service not running (lazy DNS resolution)
- Web dashboard port moved to 3001 to avoid conflicts
- CORS origin updated to match new port

Closes #15 (superseded by #64)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address editor review of IWP episode output:
- Strengthen verbatim/no-paraphrasing instructions throughout prompt
- Add "partisan" (not "partizan") to house style rules
- Add rule: program names are NOT italicized
- Add attribution accuracy guidance for openings and rapid exchanges
- Require blank line between speaker blocks, no breaks within turns
- Add openrouter-claude backend for pinned Claude model routing
- Remove hardcoded tier cap (le=2) from phase retry endpoint
- Update quality checklist with new verification items

[Agent: Claude Code]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
, #63, #64)

Issue #62: Add download parameter to job output endpoint. When
?download=true, sets Content-Disposition: attachment header. Download
button added to each output tab in the dashboard.

Issue #63: Fix AirTable image rendering — images now clickable (open
full-size in new tab), SST record links use correct deep-link URL
format with base64-encoded detail param, added CORS fallback for
cross-origin images.

Issue #61: Swap OpenRouter model tiers to Claude family — Haiku
(cheapskate), Sonnet (default), Opus (big-brain). Claude models are
now primary in each preset with existing models as fallback. Added
MODEL_PRICING entries for all three.

Issue #64: Productionize editorial feedback — changed from query param
to JSON body (PhaseRetryRequest model), extended feedback injection to
all 6 phases, feedback stored in phase retry history, added retry modal
with tier selector and feedback textarea to dashboard.

44 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ad (#20, #46, #59)

Issue #59: Shorts pipeline handling — content type detection (full/short/clip)
based on duration (<90s) and SST fields. Shorts skip timestamp phase, use
cheapskate tier for all phases, and get tailored prompts for analyst/SEO/manager.
Content type badge shown in dashboard UI. Includes DB migration (010).

Issue #46: Standardize agent definitions — consistent section structure across
all 7 agent files (Role, Input, Output, Guidelines, Quality Checklist). Demoted
subsections under Guidelines to ### level. Added pipeline-exclusion note to
ap_style_bot.md.

Issue #20: SEMRush keyword report upload — POST endpoint for CSV upload with
auto-versioning (keyword_report_v{N}.md), GET endpoint to list reports, keyword
data injected into SEO phase prompt on retries, upload UI in dashboard.

44 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolved conflicts:
- jobs.py: Keep PhaseRetryRequest JSON body (supersedes query params),
  remove le=2 tier cap to support 4th tier from PR #65
- llm-config.json: Keep Claude tier labels, add 4th tier label
  "Claude (pinned)" for openrouter-claude backend

Updated tier_labels dicts throughout jobs.py to include all 4 tiers.
Updated test to accept high tier values (no upper cap).

44 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When pipeline output isn't in the local OUTPUT directory (e.g., running
in Docker), the editor agent now knows to check the REST API at
localhost:8000 before giving up. Falls back gracefully to Airtable SST
data alone if needed.

Agent: Main Assistant
Machine: marks-macbook-pro

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Kept dev's editor feedback improvements (verbatim instructions,
formatter checklist, Shorts content_type detection). Combined
main's Streamable HTTP transport with dev's lazy DNS resolution
for optional MCP service.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mriechers mriechers merged commit 27fbca8 into main Apr 8, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant