← How It’s Made
The Brief
Technical Reference
14 desks · 149 sourcesv1 · 2026
Editorial Pipeline · Technical Reference

Fourteen desks, five stages, one issue every morning.

The technical reference for the editorial pipeline that produces the Daily Travel Brief: 12 mainstream desks plus 2 modal niche pillars (Israel, Kosher), the JSON shapes between every stage, the citation invariant, validation, and resilience. For engineers and journalists. Looking for the plain-English version? How It’s Made →

The pipeline

From RSS feeds to a published edition.

01
Sources
brief-feeds/loader.ts
~9 feeds
per desk (avg)
DB-backed RSS feeds, fetched daily. A health signal labels each desk ok, quiet, or broken.
02
Research
brief/extract.ts
claude -p
rank items
An LLM call ranks fresh items by newsworthiness, weighing the desk’s editorial angle and segment-specific signals.
03
Compose
brief/compose.ts
claude -p
synthesize
A second LLM call turns ranked items into a magazine edition: a thematic hero, ~150-word sections with citations, and a signed closing note.
04
Persist
briefs/persister.ts
upsert
(segment, date)
Idempotent upsert into the briefs table. Protect-hidden guard. publishedAt is immutable after first publish.
05
Render
src/app/[date]/
Next.js 16
App Router · ISR
The full-bleed reader renders the issue cover (tile grid spanning all published desks) and each department view. Static-rendered with ISR; a webhook revalidates on publish.
The desks

Twelve mainstream beats plus two modal niche pillars.

Each desk has its own editorial angle, signals, cadence, visibility, and source set — written verbatim into the stage 02 and 03 prompts. Expand any card below to see the publications that desk reads.

Mainstream tier — visible to all readers

01
Luxury Leisure

Independent ultra-luxury — Aman, Belmond, Rosewood, Soneva, Singita, Oetker, private villas, top-tier cruises, ultra-premium experiences (chain-affiliated luxury sub-brands like Ritz-Carlton/St. Regis live in hotels)

SignalsIndependent ultra-lux openings (Aman, Belmond, Rosewood, Soneva, Singita, Oetker, Capella, Bulgari Hotels), private villa collections (Luxury Retreats, The Thinking Traveller), suite availability and butler-service program changes, private-aviation partnerships, ultra-premium DMC and experiential program launches, branded residences news
CadencedailySlugluxury-leisure
Sources · 7 configured
  • Hospitality Net
  • Recommend
  • Robb Report
  • Skift
  • Boutique Hotel News
  • Condé Nast Traveler
  • Hospitality Design
02
Cruise — Ocean

Mass and premium ocean cruise — new ships, itinerary changes, supplier promos, port news

SignalsNew-ship deliveries (Royal Caribbean Icon/Star/Hero class, Carnival, NCL, MSC, Princess, Holland America, Celebrity), itinerary cancellations or substitutions, dry-dock schedules, port closures, NCF and commission policy changes
CadencedailySlugcruise-ocean
Sources · 9 configured
  • Cruise Fever
  • Cruise Hive
  • Cruise Industry News
  • NOAA NHC Atlantic
  • Seatrade Cruise News
  • Cruise Radio
  • Porthole Cruise
  • Royal Caribbean Blog
  • Skift — Cruise tag
03
Cruise — River

European and US river cruising — itinerary disruptions, Christmas Markets season, new vessel launches, Mekong/Nile/Douro expansion

SignalsRhine/Danube/Elbe water-level disruptions and re-routings, Christmas Markets season schedules (Nov–Dec), new vessel launches (Viking, AmaWaterways, Uniworld, Tauck, Avalon, Scenic, Emerald, Riviera Travel, Amadeus), US river growth (American Cruise Lines, Viking Mississippi), Mekong/Nile/Douro itinerary changes, A&K Sanctuary Retreats programs, river-specialist commission and co-op/FAM programs
CadencedailySlugcruise-river
Sources · 8 configured
  • Google News — River disruption signal
  • Google News — Viking/Ama/Uniworld/Tauck
  • River Cruise Advisor
  • Tauck Blog
  • Google News — American Cruise Lines / Mississippi
  • Google News — Avalon/Scenic/Emerald/Riviera
  • Google News — Christmas Markets cruise
  • Google News — Mekong / Douro / Nile
04
Cruise — Luxury & Expedition

Ultra-luxury and expedition cruising — Regent, Silversea, Seabourn, Explora, Crystal, Ponant, Lindblad, polar and remote-destination programs

SignalsNew ultra-luxury and expedition vessel launches (Regent Seven Seas Prestige, Silversea, Ponant, Lindblad/National Geographic, Seabourn Venture/Pursuit, Crystal, Explora Journeys, HX/Hurtigruten, Scenic Eclipse, Atlas Ocean Voyages, Aqua Expeditions, Aurora Expeditions, Quark), Antarctic/Arctic season schedules and capacity, Galapagos and Amazon itineraries, ultra-luxury all-inclusive inclusions changes (air credits, pre/post hotel, shore-ex bundling), expedition team and naturalist additions, charter availability, A&K Sanctuary/Crystal collaboration news
CadencedailySlugcruise-luxury-expedition
Sources · 9 configured
  • Google News — Explora/Ponant/Scenic Eclipse/Atlas
  • Google News — Lindblad/NatGeo/Aurora/Quark
  • Google News — Regent/Silversea/Seabourn/Crystal
  • Seatrade Cruise News
  • Google News — HX / Hurtigruten / Aqua / A&K
  • Google News — Polar expedition cruises
  • Polar Journal
  • Quark Expeditions Blog
  • Tauck Blog
05
Adventure & Experiential

Small-group and activity-driven adventure — Intrepid, G Adventures, Backroads, eco-lodges, expedition cruises, soft adventure, sustainability

SignalsSmall-group operator news (Intrepid, G Adventures, Backroads, REI Adventures, Wilderness Travel, Mountain Travel Sobek), camp/lodge closures and openings, permit availability (Inca Trail, Kilimanjaro, gorilla trekking), expedition departures, sustainability certifications (Green Key, EarthCheck, B-Corp), weather/season shifts
CadenceweeklySlugadventure
Sources · 16 configured
  • Adventure Travel News
  • Explorersweb
  • Matador Network
  • UK FCDO — Ecuador
  • UK FCDO — Morocco
  • UK FCDO — Nepal
  • UK FCDO — Peru
  • Adventure.com
  • Google News — Intrepid / G Adventures / Backroads
  • Outside Business Journal
  • The Outdoor Journal
  • Google News — Everest / Annapurna trekking
  • Google News — Gorilla trekking permits
  • Google News — Inca Trail / Machu Picchu permits
  • Google News — Kilimanjaro permits
  • Google News — Patagonia / Torres del Paine
06
Safari & Africa

African camps & lodges, conservation news, seasonality, charter logistics

SignalsCamp closures and rebuilds, conservation funding changes, charter capacity/pricing, malaria-zone updates, wildlife migration shifts
CadenceweeklySlugsafari
Sources · 21 configured
  • Africa.com
  • Daily Maverick
  • Mail & Guardian Africa
  • Tourism Update
  • UK FCDO — Botswana
  • UK FCDO — Kenya
  • UK FCDO — South Africa
  • UK FCDO — Tanzania
  • Getaway
  • Google News — Africa tourism (broader)
  • Google News — African safari luxury/lodge
  • Google News — African tourism policy
  • Google News — Kruger/Okavango/Serengeti tourism
  • Great Plains Conservation
  • SA People Travel
  • Tourvest
  • Travel4Wildlife
  • Google News — African charter aviation
  • Google News — African conservation funding
  • Google News — Great Migration timing
  • Google News — Safari camp brands
07
Family & Multi-gen

Family and multi-generational travel — Disney parks and cruises, Royal Caribbean family ships, all-inclusive family resorts, Adventures by Disney, soft-adventure family operators

SignalsDisney parks pricing/promotions, Disney Cruise Line and Royal Caribbean Icon/Star-class family itinerary and ship-order news, Universal Orlando/Hollywood programs, all-inclusive family resort openings (Beaches, Club Med, Atlantis, Baha Mar, Margaritaville), connecting-room and swim-out suite inventory at family AIs, group-block (10+ rooms) policy changes, NCL Haven and MSC Yacht Club family-cabin availability, Adventures by Disney / Tauck Bridges / Backroads / Abercrombie & Kent Family Journeys itineraries, kids-club program changes
CadencedailySlugfamily
Sources · 15 configured
  • Attractions Magazine
  • Disney Cruise Line Blog
  • Disney Parks Blog
  • Skift — Family Travel tag
  • Travel Agent Central
  • Universal Discover Blog
  • Google News — All-inclusive family resorts
  • Google News — Disney Cruise Line / RCI family ships
  • Google News — Multi-gen group travel
  • Google News — Theme park openings
  • Google News — Theme park pricing & promos
  • Inside the Magic
  • Theme Park Insider
  • Trekaroo Family Travel Blog
  • Google News — ABD / Tauck Bridges / family operators
08
Romance

Destination weddings and honeymoons — Sandals, Excellence, Hyatt Inclusive Collection, Hard Rock, Karisma, Palace, Caribbean and Mexico AI resorts, safari and Maldives honeymoons, wedding-planning logistics

SignalsDestination wedding policy changes (Mexico, Jamaica, DR, Caribbean), Sandals/Beaches, Excellence Group, Hyatt Inclusive Collection (Secrets/Dreams/Zoetry/Breathless/Zilara/Ziva), Hard Rock All-Inclusive, Karisma (El Dorado/Azul/Generations), Palace Resorts (Le Blanc/Moon Palace), Riu, Bahia Principe, Iberostar honeymoon promotions, overwater bungalow availability (Maldives, French Polynesia, Bali), safari honeymoon trends, wedding room-block policies and minimum-night requirements, group-booking concessions (comp rooms per N booked), private-event venue fees, symbolic vs. legal ceremony rules by destination, wedding-planner commission programs
CadencedailySlugromance
Sources · 11 configured
  • Breaking Travel News — Hotels
  • Club Med Corporate
  • Hotel Management
  • Skift — All-Inclusive Resorts tag
  • Travel Agent Central
  • Google News — Excellence/Palace/Hard Rock AI
  • Google News — honeymoon / destination wedding
  • HoneyTrek
  • PR Newswire — Travel
  • RIU Blog
  • Sandals Blog
09
Corporate & Business Travel

Airline alliance changes, business hotel news, T&E policy, route impacts

SignalsAlliance reshuffles, status-match windows, route launches/cuts, corporate-rate changes, T&E compliance shifts
CadencedailySlugcorporate
Sources · 6 configured
  • Simple Flying
  • Skift
  • The Company Dime
  • The Points Guy
  • One Mile at a Time
  • View from the Wing
10
Hotels & Resorts

Global hotel chain news — brand openings/closures/conversions, loyalty programs (Bonvoy, Hilton Honors, World of Hyatt, IHG One Rewards, ALL-Accor), soft-brand growth, M&A, NCF and commission policy

SignalsBonvoy / Hilton Honors / World of Hyatt / IHG One Rewards / ALL-Accor / Wyndham Rewards / Choice Privileges program changes and devaluations, status-match windows, brand acquisitions and conversions, soft-brand expansion (Autograph, Curio, Tapestry, Tribute, Unbound, Ascend, Trademark, JdV), midscale soft-brand launches (Spark, Garner, StudioRes), MGM Collection updates, Asia/Europe chains with US-advisor relationships (Mandarin Oriental, Shangri-La, Pan Pacific, Anantara, Jumeirah, Kempinski, Pestana), major chain-affiliated openings/closures/refurbs, NCF and commissionable-rate policy shifts, chain leadership changes
CadencedailySlughotels
Sources · 11 configured
  • Hotel Management
  • HOTELS Magazine
  • LoyaltyLobby
  • Marriott News Releases
  • Skift — Hotels tag
  • Google News — Asia/Europe chains
  • Hyatt Newsroom
  • Skift — Loyalty tag
  • Skift — Luxury Hotels tag
  • Skift — Soft Brands tag
  • Travel Agent Central
11
Tours & Packaged

Escorted, packaged, and trade-only tour operators — TTC (Trafalgar/Insight/Luxury Gold/Costsaver), Globus family, Tauck, Collette, AAA/CAA Member Choice, USTOA news, and B2B leisure-package wholesalers (ALG Vacations, Pleasant Holidays, Delta Vacations, Classic, GOGO)

SignalsNew escorted itinerary launches (Trafalgar, Insight, Luxury Gold, Globus, Cosmos, Tauck, Collette, AAA Member Choice), USTOA member announcements and $1M Travelers Assistance updates, ALG Vacations / Apple Vacations / Funjet / Travel Impressions / United Vacations / Southwest Vacations / Blue Sky bonus-commission and "Get Paid to Upgrade" windows, Pleasant Holidays / Delta Vacations / Classic Vacations / GOGO promo cycles, Unique Vacations (Sandals/Beaches) commission programs, FAM trips, season-opening and cancellation announcements, custom/FIT operator launches, escorted tour leadership changes
CadencedailySlugtours
Sources · 8 configured
  • Google News — escorted/packaged operators
  • Google News — wholesalers & USTOA
  • Skift — Tour Operators tag
  • Skift — Vacation Packages tag
  • Skift — Wholesalers tag
  • Travel Agent Central
  • USTOA Blog
  • Google News — guided/escorted/group travel
12
Wellness

Wellness, longevity, and spa travel — destination spas, medical/longevity programs, retreat operators, wellness-focused resorts and cruises

SignalsNew destination spa and wellness resort openings (Six Senses, Aman/Amanpuri, COMO Shambhala, Sensei, Canyon Ranch, Miraval, Lefay, Chiva-Som, Kamalaya, Ananda in the Himalayas), longevity and medical-wellness programs (SHA Wellness, Lanserhof, Clinique La Prairie, Palace Merano, Mayrlife, Vana), Healing Hotels of the World consortium news, retreat program length and medical-screening requirement changes, corporate and executive wellness-retreat programs, spa-on-board cruise programs (Celebrity, Crystal, Seabourn × Dr. Andrew Weil), Global Wellness Institute trends
CadenceweeklySlugwellness
Sources · 15 configured
  • Athletech News — Wellness
  • Global Wellness Institute
  • Global Wellness Summit
  • Skift — Spa tag
  • Skift — Wellness tag
  • Google News — Destination spa openings
  • Hospitality Net — News
  • Hotel Management
  • Kamalaya
  • Organic Spa Magazine
  • Spafinder
  • Google News — Asia wellness retreats
  • Google News — Cruise spa programs
  • Google News — Healing Hotels / GWI trends
  • Google News — Longevity medical resorts

Modal tier — niche pillars, opt-in

13
Israel

Israel as a destination — Tel Aviv/Jerusalem hotels, El Al & inbound carrier routes, Ben Gurion ops, Israeli hotel chains (Dan, Isrotel, Fattal), tourism ministry, US/UK travel advisories, security context as it affects bookings

SignalsEl Al/Israir/Arkia route adds & cuts, Ben Gurion operational notices, Israeli hotel chain openings/refurbs (Dan, Isrotel, Fattal, David InterContinental), Israel Tourism Ministry campaigns, US State Dept / UK FCDO advisory changes for Israel, security incidents at tourist-relevant scale
CadencedailymodalSlugisrael
Sources · 13 configured
  • Haaretz English
  • The Jerusalem Post
  • The Times of Israel — general
  • UK FCDO — Israel
  • US State Dept Travel Advisories
  • Algemeiner
  • Google News — Ben Gurion / El Al / Israeli tourism
  • Google News — Dan / Isrotel / Fattal hotels
  • Google News — El Al / Israir / Arkia routes
  • Google News — Israel Tourism Ministry
  • Google News — Tel Aviv / Jerusalem hotels
  • Israel National News
  • Ynetnews
14
Kosher Travel

Kosher-observant clients booking anywhere — Pesach programs worldwide, kosher hotels & restaurants outside Israel too, hechsher certifications, kosher cruise charters, kosher airline meals, frum community travel

SignalsPesach programs (worldwide, not just Israel), hechsher news from major certifiers (OU, Star-K, OK, Kof-K), kosher cruise/all-inclusive charter availability, kosher airline meal changes, kosher restaurant/hotel openings in non-Israel destinations, frum community travel events
CadenceweeklymodalSlugkosher
Sources · 9 configured
  • JTA
  • OU Kosher
  • Star-K
  • Yeah That's Kosher
  • Google News — kosher cruise / resort / Pesach program
  • Google News — Pesach / kosher travel
  • Kosherica
  • The Yeshiva World
  • Kosher Travelers
Why these desks. The set mirrors how trade press (Travel Market Report, Travel Weekly) and advisor consortia (Virtuoso, Signature, CLIA) organize their coverage. Cruise splits three ways because the industry does — ocean, river, and luxury/expedition are editorially distinct beats, and river is where the highest-margin advisors concentrate. Israel and Kosher carry a visibility: 'modal' flag — niche pillars surfaced opt-in by the subscription dispatcher, not rendered to every reader. Health is cadence-aware: a thin day for a weekly desk (Adventure, Safari, Wellness, Kosher) is quiet, not broken.
Stage 01Source ingestion

Where the stories come from.

RSS feeds, DB-backed.

Each desk has its own set of vetted RSS feeds stored in the brief_segment_feeds table. The feed list is editorial metadata — adding or removing a feed is a DB change, not a code deploy.

The loader (brief-feeds/loader.ts) fetches each feed, de-duplicates within a 48-hour window, follows the link to the publisher’s article and extracts the body text (so the ranker reads the full story, not just the RSS blurb), and tags every item with a health signal:

  • ok — feeds returned, fresh items found
  • quiet — feeds healthy but few items (weekly-cadence desks)
  • broken — multiple feeds failed; degrade transparently

The health label is passed forward into stages 02 and 03 so the AI can tone the edition honestly when sourcing was thin.

FetchHealthbrief-feeds/loader.ts
{
  "status": "ok",           // ok | quiet | broken
  "feedsTotal": 9,
  "feedsOk": 9,
  "freshItemCount": 62,
  "cadence": "daily",
  "thresholds": {
    "minFreshItems": 3
  }
}
The numbers today: 158 feed assignments across 14 desks (149unique URLs — many are cross-wired to multiple desks). Phase 4 article-body extraction means we feed the ranker the full publisher article, not just the RSS snippet, on every URL that isn’t paywalled. Sources are held to an ongoing quality bar: candidates are vetted against our live editorial output before we rely on them, and ones that stop earning their place drop out. Expand any desk above to see which publications it reads.
Stage 02Research · the ranking call

An editorial LLM ranks what matters.

One claude -p call per desk.

The fetched items + the desk’s editorial angle + the desk’s segment-specific signals are packed into a prompt and sent to claude -p (the Claude Code CLI — subscription-billed, no per-token API fees).

The AI’s job is notto write anything yet. It ranks items by newsworthiness through the lens of the desk’s angle and emits a structured RankedResearchResult— 3 to 20 items per desk, each carrying a title, a suggested kind (news/supplier/destination/data-point/opinion), a one-sentence why-it-matters, and indexes into the sources list. Items the composer doesn’t promote to a full magazine section are persisted to briefs.rankedItems (with composedItemIndexesmarking which were consumed) and surface in the “More from the wires” rail on the reader.

RankedResearchItem (sample)cruise · today
{
  "title": "Viking's Talactac Era Begins",
  "suggested_kind": "supplier",
  "why_it_matters": "$4B cash, 58-ship
    orderbook, no pivot — sets Viking's
    next-decade trajectory.",
  "source_indexes": [3, 14, 27],
  "rationale": "CEO transitions at the largest
    river+ocean cash position in industry are
    the single biggest forward-supply signal."
}
Stage 03Compose · the synthesis call

Ranked items become a magazine edition.

The desk’s editor, in prompt form.

A second claude -p call takes the ranked items + sources and writes them as a finished magazine edition: a thematic hero combining 2–3 top items into one framing (not a crown for any single story), an ordered list of ~150-word sections with citation indexes, and a ~2-sentence closing note signed by the desk. The system prompt frames Claude as “the editor of the {Department} daily brief” and explicitly forbids hype, inventing facts, padding length, or citing a source not provided. Quality over quantity is encouraged — fewer sections on a quiet day, combining related items rather than repeating.

The user message opens with a ## TODAYblock carrying the canonical edition date (YYYY-MM-DD). The system prompt instructs Claude to resolve relative-time wording in source headlines (“today”, “tomorrow”, “expires soon”, “Final Day”, “this weekend”) against TODAY — never against the source article’s pubDate, which is often 1–3 days older.

BriefContent (output shape)brief/compose.ts
{
  "hero": {
    "headline": "Viking Gets a New Captain,
      Spectrum Drops Japan, and Carnival
      Dream Drops Anchor",
    "dek": "Leah Talactac takes the helm at a
      cash-rich Viking; Royal Caribbean cancels
      Spectrum's Japan 2027 sailings; ..."
  },
  "sections": [
    {
      "kind": "supplier",
      "headline": "Viking's Talactac Era Begins",
      "body": "...150 words of markdown...",
      "citations": [3, 14, 27]
    },
    // 6–8 more sections
  ],
  "closingNote": "Today's edition is defined
    by one irony: ... — The Desk"
}
The citation invariant

Every claim points back to a real article.

The most error-prone field in stage 03 is citations — a list of 0-based indexes into the sources array. The pipeline enforces a citation invariant: every section must cite at least one source, every index must be in range, and (after a deduplication pass) every index must point at a real source article.

Sources (numbered)

  1. Travel Weekly — Viking names Talactac CEO
  2. Cruise Industry News — Spectrum Japan cancelled
  3. USA Today — Carnival Dream stranded off Belize
  4. Reuters — Carnival price-glitch reservations voided
  5. Skift — Australia raises passenger movement charge
  6. The Points Guy — NCL Haifa re-entry signal
Viking’s Talactac Era Begins
cites:0
Royal Caribbean Pulls Spectrum from Japan
cites:1
Carnival Price Glitch + Stranded Dream
cites:23
Stage 04Persist · the database write

One row per (desk, date), with editorial guardrails.

Idempotent upsert.

The composed BriefContent is written to the briefs table — one row per (segmentSlug, editionDate). Re-running the pipeline for the same date overwrites the content but preserves identity.

Three guardrails:

  • Protect-hidden — if a row has status: 'hidden' (an editor has retracted it), the upsert skips. An empty RETURNINGclause signals “declined.”
  • publishedAt is immutable — once a brief is first published, that timestamp is locked. Re-runs change content but not the original publish moment.
  • Status enumdraft, published, hidden, failed — drives what the renderer shows. Only published rows reach the public site.
briefs table (Drizzle)db schema
briefs {
  id                   uuid primary
  segmentSlug          text     // 'cruise-ocean' | 'cruise-river' | ...
  editionDate          date     // 'YYYY-MM-DD'
  status               enum     // draft|published|hidden|failed
  title                text
  summary              text
  heroImageUrl         text?
  content              jsonb?   // BriefContent (null on failed)
  sources              jsonb    // ResearchSourceRecord[]
  rankedItems          jsonb?   // full ranker output
  composedItemIndexes  jsonb?   // composer consumed
  modelUsage           jsonb    // elapsed ms per stage
  generatedAt          timestamp
  publishedAt          timestamp?  // preserved across re-runs

  unique(segmentSlug, editionDate)
}
Stage 05Render · the reader-facing route

One issue, two view modes.

Full-bleed, no app chrome.

The brief reader lives at the root of the Next.js 16 App Router tree. There’s no dashboard shell, no sidebar — the magazine supplies its own chrome via the ReaderRoot wrapper (the same one this page uses).

The route tree on the right is the full public surface — cover, department view, archive, machine feeds. At the bottom of every department view a More from the wiresrail surfaces ranker items the composer didn’t write a full section for, rendered as title + kind chip + why-it-matters + linked sources.

No login required. Reader queries filter status='published', so failed and hidden rows never surface. Pages render statically with ISR; a /api/revalidate webhook fires on publish so fresh issues appear within seconds, not minutes.

route treeNext.js 16 · App Router
src/app/
├─ layout.tsx              // fonts + metadata
├─ page.tsx                // /  → latest issue
├─ [date]/
│  ├─ page.tsx             // /YYYY-MM-DD
│  │                       //   = IssueContents
│  │                       //     (tile cover)
│  └─ [segment]/page.tsx   // /YYYY-MM-DD/luxury-leisure//   = DepartmentView
├─ archive/page.tsx        // /archive
├─ about/page.tsx          // /about
├─ pipeline/
│  ├─ page.tsx             // /pipeline           (advisor view)
│  └─ technical/page.tsx   // /pipeline/technical (you are here)
├─ rss.xml/route.ts        // /rss.xml
├─ news-sitemap.xml/...    // /news-sitemap.xml
├─ subscribe/page.tsx      // /subscribe
└─ api/
   └─ revalidate/          // publish webhook
Resilience

Validation, retries, and quiet-day handling.

LayerWhat it handles
Schema validationThe AI’s response is parsed as JSON, then validated against BriefContentSchema (Zod). Hand-rolled JSON schema floors set length minimums(so Claude doesn’t truncate); Zod ceilings catch pathological output. Mismatches trigger a corrective retry with the Zod error pasted back into the prompt.
Transient CLI errorsThe runClaudeCli wrapper retries once on transient errors (429, ECONNRESET, overload). Worst-case spawn ceiling is 4 (each of the 2 validation attempts internally transient-retries once) — vanishingly rare in practice.
Citation repairrepairCitations() filters out-of-range indexes, deduplicates, drops empty-citation sections. If zero sections survive but research items existed, the compose stage throws ComposeError — never publishes broken citations.
Article-body cacheThe article_bodies table caches the Readability-extracted publisher article for 7 days (successes) or 1 hour (failures). Same URL surfaced two days in a row hits the cache, not the publisher. Caching failures keeps us from re-hitting paywalled URLs on every cron run.
Quiet-day short-circuitIf a desk’s research produces zero items (a genuine quiet day), compose skips the LLM call entirely. A hand-built BriefContent with an honest “quiet day on the wires” hero is returned. Zero cost. Deterministic.
Broken-day tone shiftIf sourcing health is broken but items still exist, an extra sentence is appended to the compose prompt: “be honest about a thin or degraded day.” Same edition shape, more transparent voice.
Design principles

Why the pipeline is shaped the way it is.

Two AI calls, no more.

One call to rank, one call to write. Bounded cost (the daily budget is predictable), bounded variance (two LLM judgments per desk per day), and easy to inspect (artifact files between every stage).

Subscription, not pay-per-token.

All AI calls go through claude -p (Claude Code CLI, subscription-billed). No per-token API fees during iteration; the cost of prompt experimentation is zero.

Editorial parallel, not editorial lead.

Fourteen desks, no anointed “main” desk. The issue cover is a tile grid, not a hero spread — every desk gets equal visual weight. The compose stage’s hero is a thematic wrap-up of that desk’sday, not a story crowned as more important than another desk’s.

Trust, but cite.

The AI is allowed to summarize, synthesize, and frame. It is not allowed to invent. The citation invariant + per-section source attribution gives every claim a traceable lineage back to a numbered article.

Import-purity at the seam.

brief/ (the pipeline core) has zero DB imports. briefs/(the DB boundary) is the only place rows are read or written. Pipeline iterations don’t risk persistence; persistence changes don’t risk pipeline behavior.

Quiet days are first-class.

Slow news isn’t a failure mode — it’s a normal state. Cadence-aware health labels, deterministic quiet-day content, and a “be honest” tone instruction mean the brief never lies about a thin day.