Case study · September 2026 · 4 min read
A YouTube channel tracker that refuses to hand over a single row until a second, separately-written pass of its own pipeline reaches the same answer from a fresh fetch.
yt-mastersheet-kit4
gated phases: discover, verify, format, QA note
2
independently written code paths that must agree before anything ships
33
tests, including one pinned to a midnight timezone boundary
A team tracker sheet is a shared source of truth: once a row is pasted in, other people build schedules and payouts on top of it. A wrong date or a video filed under the wrong category doesn't fail loudly, it just quietly corrupts whatever depends on that row until someone happens to notice.
The brief was a tool that turns a channel's recent uploads into paste-ready rows for that sheet, correctly categorized and dated, without becoming one more thing a person has to double-check by hand every time it runs.
The categorization and dating logic runs once to build the rows, then a second module re-derives the same date, duration, and category for every row from scratch, with its own fresh fetches, deliberately never importing the first module's functions. If it did, agreement would only prove a function got called twice, not that the logic is right.
The formatting step that actually produces the paste-ready rows refuses to run at all unless that second pass reports a clean PASS. That's a few lines of code, not a step someone has to remember to run before trusting the output.
A livestream is dated by the moment it actually went live, never by its publish time, because a live's publish time is often a placeholder posted hours or days earlier, and dating by it can put a Thursday session on Wednesday's row. Shorts and long-form videos, by contrast, are dated by publish time; a premiere is never treated as a livestream, and that distinction comes from the platform's own isLiveContent flag, never a guess based on timing.
A livestream long enough to be a marathon session gets split into one row per person named in its title, minutes divided evenly, and if the title names nobody, the row is kept whole and flagged for a human rather than guessed at. When no name can be identified at all, the cell gets a configured placeholder, never left blank and never invented.
Bulk fetching against a real platform means some pages fail to load. Every failed fetch is retried once, and if it still can't be read, it's recorded as an explicit exclusion rather than disappearing; the pipeline's own coverage check requires that everything it touched is either placed in a row or accounted for as an exclusion, with the two totals required to balance before anything is called done.
The four-phase pipeline runs end to end against a fully fictional demo vertical shipped in the repo, and 33 pure-function tests pin the categorization rules above, including the exact midnight boundary where a one-second difference in absolute time has to flip which calendar day a video is dated on.
The full engine behind this write-up is public and open source at yt-mastersheet-kit, with its own README, architecture diagram, and test suite.
More landing soon
Leave your email. One short note when a new write-up lands here, nothing else.
Just your email, stored on my own private database. Never sold, never rented. Reply to any email to unsubscribe.