Trevor PaughSystems engineer
Trevor PaughProject Chronicles

Chronicles / PermitBuzz

First code on main, and the bug the reviewer caught before it shipped

Milestone

The first merge: a permit schema built to hold more than one state, a mapper from county permit types to trades, the contact scrubber, and connectors for Raleigh's building and trade permits. Backfilled locally, about 47,000 Raleigh permits since the start of 2025. The reviewer found that the nightly update window was keyed on the wrong clock and would have silently dropped nearly every record after the first pull.

Hours after the go, the first product code reached main.

What landed

  • A normalised permit schema that does not assume North Carolina. Jurisdictions, permits, and ingest runs, shaped so a second state slots in without a rewrite.
  • A trade mapper that turns each county’s own permit categories into the trades a contractor picks from: roofing, plumbing, pool, and so on.
  • The contact scrubber decided at kickoff, dropping owner and contractor phone numbers, emails, and mailing addresses before anything is stored.
  • Raleigh connectors for building permits and trade permits, the first of the Wake bundle.

Run locally against the live feed, the connector backfilled every Raleigh permit since January 2025, around 47,000 records, in testing.

The bug

The nightly run was meant to fetch only what changed since the last run, with the window keyed on the time of the run. The reviewer checked the feed itself and found that Raleigh publishes records between ten and forty-four hours after the timestamps on them. So a record stamped yesterday afternoon might not appear until tomorrow, by which time the window had moved past it. After the first full pull, almost every update would have been lost, and nothing would have complained.

The fix windows on the data’s own timestamps and looks back three days on every run, so a late record is picked up on whichever night it turns up. The reviewer verified the lag live against the county rather than from the code, which is why it was found at all. Left alone, it would have surfaced weeks later as a contractor asking why there were no alerts.