How the Friday agent gets built. Seven small services chained into a single pipeline that pulls from a few dozen sources Thursday night, dedupes into a canonical LP/EP list, enriches it with critic data and cover art, hands it to editorial for review at 8:30 AM, and ships at 9:00 AM ET sharp.
Seven services. Top-to-bottom. Each does one thing, hands off a structured payload to the next, and writes its state to Postgres so the pipeline is resumable from any step.
Each agent is a small, testable TypeScript module with a single responsibility. They share types via a common @corners/schema package and communicate by writing to Postgres — never by direct function calls — so any stage can be rerun independently when a Friday goes sideways.
01 / Connectors
Source Connectors
One TypeScript module per external source. Each exports a single fetchReleases(dateRange) function. Authentication, rate-limiting, retry, and pagination are encapsulated per-source. Outputs the source's raw response wrapped with a runId and timestamp; everything later in the pipeline can be replayed from sources_raw.
Inputs
Date range, source-specific config
Output
sources_raw rows
Runs
Thu 23:00, Fri 06:00, Fri 08:30
Code
/agents/connectors/{name}.ts
02 / Normalizer
Normalizer
Converts every source's response into one CanonicalRelease shape: artist, title, releaseDate, format, trackCount, labels[], mbid?, isrc?, artworkUrl?, sourceConfidence. The plumbing layer where most bugs live — built with a debug mode that logs every field mapping so editorial can audit decisions.
Inputs
Rows from sources_raw
Output
releases draft rows
Runs
After every connector sweep
Code
/agents/normalizer.ts
03 / Deduper
Deduper
Matches releases across sources. Priority: MusicBrainz Release ID (MBID) → ISRC for tracks → Jaro-Winkler fuzzy match on normalize(artist) + normalize(title) at 0.92 threshold. Every dedup decision is logged so the CMS can audit and roll back. The highest-stakes single piece of code — diehards notice duplicates.
Inputs
Draft releases rows
Output
Merged canonical rows · dedup log
Runs
After every Normalizer pass
Code
/agents/deduper.ts
04 / Filter
Filter + Route
Enforces the rules. Format check: tracks > 4 → LP/EP main feed; tracks ≤ 4 → routed to singles for Radio, Radio. Date filter: this Friday in the main feed, +14-day window flagged as Late Drops candidates. Reissues kept but flagged. Anything from a label in the registry gets a "label radar" annotation.
Inputs
Deduped releases
Output
Tagged releases + singles
Runs
After Deduper
Code
/agents/filter.ts
05 / Enricher
Enricher
Fills the gaps. Cover art from MusicBrainz Cover Art Archive → iTunes fallback at 600×600. Label tier from LABEL_REGISTRY. Lead single from Spotify album_tracks popularity-ranked. YouTube video ID via Data API. Critic data parallel pipe: match each Pitchfork / Stereogum / Substack post from this week to a release; store score + URL + quote.
Inputs
Filtered releases + critic feeds
Output
Fully populated releases + critics
Runs
Fri 06:00 + Fri 08:30
Code
/agents/enricher.ts
06 / CMS
Editorial CMS
A Next.js admin app behind password auth. You see the staged issue Thursday night through Friday morning, can promote/demote releases between Hero / Complete-List / Radio-Radio, override aggregate scores, add curated quotes from Substacks where there's no formal review, mark off-Friday entries for Late Drops. Nothing publishes without an "Approve" click — or auto-publishes at 9:00 AM if you don't.
Inputs
Staged issues
Output
Approved issue · audit log
Runs
Always-on web app
Code
/apps/cms/*
07 / Publisher
Publisher · Staging → Production → Distribution
Renders the approved issue's HTML from a templating layer that matches the public mock structure. Writes the rendered page + JSON payload to the staging branch — Vercel builds the preview in 30-60 seconds. Editorial gets a Slack/email ping with the staging URL at 08:30. One-click "Publish" merges staging → main. At 09:00 ET sharp, the email blast fires via Resend; RSS regenerates; OG cards render for social. If editorial doesn't click "Publish" by 08:55, an auto-promote runs anyway so the issue ships.
Inputs
Approved issues
Output
HTML + email + RSS + social cards
Runs
Fri 08:30 (stage) + 09:00 (publish)
Code
/agents/publisher.ts · /templates/issue.tsx
03 · ScheduleThursday Night → Friday Morning
Three cron triggers do most of the work. The pipeline is idempotent: any agent can be rerun from any point without breaking downstream state.
Weekly cadence · America/New_Yorkfig. 2
04 · SchemaData Model
Eight tables. issues is the root — every Friday is one. releases and singles are the canonical published artifacts. critics and labels feed enrichment. posts and users power the From-the-Corners community layer (Phase 2). sources_raw is the audit trail.
issuesid · pk
iduuid · pk
datedate · unique
statusenum: staged|approved|published
issueNumberint
publishedAttimestamp?
approvedByUserId→ users
heroNotetext?
releasesid · pk
iduuid · pk
issueId→ issues
artisttext
titletext
formatenum: lp|ep|reissue
trackCountint
labelId→ labels
tierenum: major|indie
aggregateScoreint 0–100?
isHerobool
isReissuebool
artworkUrltext
leadSingleYtIdtext?
mbid · isrctext?
singlesid · pk
iduuid · pk
issueId→ issues
artist · titletext
labelId→ labels
tierenum
genretext[]
contextenum: loosie|leadSingle|betweenAlbums
radioRankint?
leadSingleYtIdtext?
criticsid · pk
iduuid · pk
releaseId→ releases
publicationtext
isSubstackbool
scorenumeric?
gradetext?
quotetext?
urltext
publishedAttimestamp
labelsid · pk
iduuid · pk
nametext · unique
categoryenum: indie-metal|americana|crossover
parenttext?
tierenum: major|indie
autoPromotebool
feedsjsonb (rss, site, bandcamp)
addedByenum: jon|seed
notestext?
postsid · pk
iduuid · pk
releaseId · singleId→ releases|singles
userId→ users
bodytext
upvotesint
replyCountint
parentPostId→ posts (self)
createdAttimestamp
usersid · pk
iduuid · pk
handletext · unique
displayNametext
emailtext · unique
roleenum: reader|editor|admin
joinedAttimestamp
sources_rawaudit trail
iduuid · pk
runIduuid · indexed
sourcetext
fetchedAttimestamp
payloadjsonb
statusenum: ok|partial|error
errortext?
05 · DeployStaging → Production
Vercel preview deployments do most of this for free. The cleaner setup is a dedicated subdomain pointed at a separate branch so the editorial review URL is stable and shareable.
Build & deploy flow · One Friday in seven steps · fig. 3
06 · StackTech Choices
Boring, well-documented, TypeScript-native. Nothing exotic. The workspace already has TypeScript / Expo scaffolding so the language choice is consistent.
Language & Frameworks
LanguageTypeScript · end to end
Web appNext.js 14+ · public site + CMS
AgentsNode.js or Bun · serverless
Shared types@corners/schema · workspace pkg
Data & Storage
DatabasePostgres on Supabase · free tier OK
ORMDrizzle · typed, no codegen
Object storageCloudflare R2 · cached covers
CacheUpstash Redis · optional v2
Hosting & Scheduling
HostingVercel · web + cron + preview
CronVercel Cron · three triggers
OrchestrationInngest · v2 if needed
DNSCloudflare · corners.fm
Distribution & Monitoring
EmailResend · typed templates
AuthAuth.js / Clerk · CMS only v1
ErrorsSentry · agent + web
LogsVercel + Axiom · structured
07 · RoadmapSix Weeks to MVP
A phased build that ships a publishable Friday by end of week 6. Each week ends with a working artifact that you can review.
Week 1 · · · Foundations
Connectors + schema
Stand up the workspace, define @corners/schema, build the first three connectors (MusicBrainz, iTunes, Spotify). Output: a JSON dump of one real Friday's raw releases, no normalization yet.
Week 2 · · · Normalize + dedupe
Canonical pipeline
Build Normalizer and Deduper. Add 4–5 more connectors (Pitchfork RSS, Stereogum RSS, the four Substacks, AllMusic). Output: a single canonical list of LP/EPs for a real Friday, deduped, with the dedup log visible for audit.
Week 3 · · · Enrich
Filter + Enricher
Build Filter (LP/EP routing + singles → Radio Radio) and Enricher (cover art, label tier, lead single, YouTube). Wire the labels table from label-registry.json. Output: a fully enriched issue JSON ready to render.
Week 4 · · · Critic pipe
Reception aggregation
Pitchfork/Stereogum/Hearing Things RSS reader → critic-match → score aggregation. Substack picks stored as quoted blurbs since they don't grade. Output: every release in the issue carries critic chips.
Week 5 · · · CMS
Editorial admin
Next.js admin app with auth. Issue dashboard, promote/demote, override scores, add curated quotes, approve button. Read-only first then editable. Output: you can review and approve a real Friday.
Week 6 · · · Ship
Publisher + email + production
Templating layer that renders the public mock structure. Vercel staging + production setup. Resend email integration. RSS + OG cards. Wire the three crons. Goal: a real, publishable Friday issue ships at 9:00 AM ET on a target date in late August / early September.
08 · Risk NotesWhere This Gets Hard
Three places we know in advance will need more attention than they look.
The label-tier classifier is a moving target. Labels get sold, sublabels reshuffle, "indie-distributed-via-Universal" is a real category. The labels table is versioned; treat misclassification as a real bug not a small one. The Jon-curated registry is what makes this tractable — we already have provenance on every entry.
Scraping the publications respectfully. Cache aggressively (4-hour TTL on review pages), set a real User-Agent that identifies Corners, honor robots.txt, and reach out to anyone whose RSS we depend on for explicit blessing. Most music critics will say yes when they see what we're building — but ask first.
The deduper is the single highest-stakes piece of code. A release showing up twice on Friday morning is the kind of mistake diehards will notice and screenshot. Build with a debug mode that logs every match decision, surface those in the CMS, and maintain a set of "golden weeks" — past Fridays we've manually verified — as regression tests before every change.