I shipped the UI for calendar feed naming last week. Users can now set a custom title when they import a feed, rename it inline, and see validation errors if they try something the system can't accept. The PR was 1,030 lines. It was also PR #328.
PRs #321 through #327 came first.
This feels slow when I write it out like that. Seven pull requests for "let users name their calendar feeds." But each one was necessary, and looking back at the sequence, I'm not sure what I would have skipped.
The Design Gate (PR #321)
We started with a 737-line technical design document. Not a product spec—a technical design. It documented 10 gap resolutions, a 15-task implementation plan, and 5 production fixtures with approved outputs.
The fixtures were the forcing function. When you run real data through your proposed system, you find things. We found D-1: "The Kids" collision. Two different calendar feeds, both legitimately named "The Kids"—one for school events, one for sports. Our first naming design would have forced a merge. The fixtures caught it before we wrote the code.
Shipping the design first changes the risk profile. You're not iterating on production data. You're not discovering edge cases during code review. You're resolving ambiguity when it's still cheap to change your mind.
The Domain Layer (PR #322)
Next: the composition engine. 527 lines of naming logic with a five-tier precedence system, a sanitizer that rejects 13 attack vectors, and 4,524 lines of tests across 17 fixtures.
This is where the product logic lives. How do we infer a name from messy calendar data? What happens when a user gives us "<script>alert('xss')</script>" as a feed title? What's the precedence when we have a chat hint, an import-time title, and a calendar API summary all competing?
The domain layer doesn't know about databases or HTTP requests. It takes inputs, applies rules, returns outputs. This makes it testable. You can run 17 fixtures through it and verify every edge case without touching Supabase or making API calls.
The Schema Migration (PR #323)
We already had calendar feeds in production. The schema migration added 9 columns and 6 constraints to support the new identity system, then backfilled existing feeds with a 407-line classification job.
The backfill had to decide: is this existing display_name something a user typed in chat, or did we generate it as a fallback? We couldn't just guess. So we fetched the full calendar list from the Google Calendar API and compared. If the feed name matched a calendar summary exactly, we classified it as a fallback (we inferred it from the API). Otherwise, we assumed it came from chat.
Was this perfect? No. But it was principled. And because we wrote the migration to be idempotent with hash verification, we could test it on a copy of production data before running it for real.
The Service Adapters (PR #324)
Now we had domain logic and a database schema. We needed the glue: an 845-line SupabaseIdentityStore adapter and a 441-line ensure_identity service.
The ensure_identity service is fire-and-forget with a 24-hour recompute floor. If you rename a feed, we'll recompute its identity... but not more than once a day. This prevents churn and keeps the system responsive even when users are experimenting.
The TDD audit caught 11 HIGH/MEDIUM findings during development, including an unreachable composer gate that would have failed silently in production. We fixed all of them before merge.
The Read Paths (PR #327)
Before we could build the UI, we needed clean read paths. PR #327 introduced feed_label (for list disambiguation) and feed_title (for display and editing) with the 24-hour recompute floor. It also added the identity_sync_hook for background updates.
This PR also fixed two precision bugs we'd been tracking: SCE-3963 (float precision causing 5 out of 6 records to churn on every sync) and SCE-3967 (fallback round-trip losing precision). Both were caught by the audit.
The UI (PR #328)
Finally, the interface. Title and hint fields in the feed import modal. Inline rename in the subscription sheet. Proper resolution of title vs. source_label for display. Validation error states. An edge case fix for the Escape key.
1,030 lines sounds like a lot for UI code. But by the time we got here, the hard problems were solved. The domain logic was tested. The database schema was proven. The service layer had clean contracts. The UI just had to wire it together.
And it worked on the first try.
What Seven Pull Requests Actually Bought Us
Here's what I learned from this sequence:
Design-first development catches collision cases before you commit to an implementation. Five production fixtures revealed an edge case that would have been expensive to fix in code.
Domain logic belongs in a separate layer. The composition engine has 4,524 lines of tests because it's pure logic—no database, no network, no mocking. Just inputs and outputs. When the UI called it, we already knew it worked.
Schema migrations on production data are their own project. The backfill classification logic was 407 lines and required careful reasoning about existing user state. Bundling that with "ship the UI" would have created split focus and higher risk.
Service adapters prevent the domain layer from knowing about infrastructure. SupabaseIdentityStore talks to Postgres. The composition engine talks to the adapter. When we need to add Redis caching or switch databases, the domain logic doesn't change.
Building read paths separately from write paths reduces risk. We shipped feed_label and feed_title in their own PR with the recompute floor and sync hook. The UI could call stable endpoints on day one.
The Velocity Paradox
Seven pull requests over three weeks feels slow if you measure by "time to first code." It feels fast if you measure by "time to working feature with no follow-up bug fixes."
We didn't ship the UI and then discover the collision case. We didn't ship the migration and then realize the backfill logic was wrong. We didn't ship the service layer and then find 11 audit failures in production.
Each PR was small enough to review thoroughly. Each layer had its own test suite. Each piece worked before we built the next one.
The alternative—one massive 5,000-line PR that does everything at once—ships faster on paper. But then you're debugging in production. You're hot-fixing edge cases users found. You're untangling domain logic from database calls because you need to add a test but the code isn't structured for it.
What's Next
The feed naming UI is live internally, and we're already seeing the benefit. Users can distinguish between "Work Calendar" and "Personal Calendar" without relying on our inference. The chat hint system gives the AI better context about what feeds mean. The disambiguation logic prevents "The Kids" from collapsing into one feed.
But we're not done. The hint field is wired up but not actively used yet—that's coming in the next iteration. The backfill improved our confidence in existing data, but there's still work to do on grouping related feeds. And the recompute floor is conservative; we might tighten it as we learn more about actual usage patterns.
Seven pull requests to ship one feature. Each one necessary. Each one testable. Each one building on the last.
That's what it takes to get it right.