Matthew Jeter M. Ziemba

Roof age from aerial imagery

Estimates when a commercial low-slope roof was last replaced from 34 years of county aerial imagery and permit records, with the Claude API judging image pairs that statistics cannot settle.

For
A roofing contractor consortium
When
September 2026 to now
Status
In production since October 2026
Role
Sole engineer and author, from the research to the live app
Systems
Claude

Data paths and guards

Invited userWeb appRun storeCounty aerial imageryClaude APIInvited userWeb appRun storeCounty aerial imageryClaude APIOpus 5.5 visionAnalysis serviceAddresses or a CSVScans and batch runsQueue, runs, cacheRoof crops by yearDated answersPairs of cropsVerdicts with reasonsInvite-only sign-inRate limit, fails closedClaimed queue rowsRights checked firstRequest-hash cache Invited userWeb appRun storeImageryClaudeInvited userWeb appRun storeImageryClaudeAnalysisabcdefg
  1. Invited user: Signs in by invitation, scans one address or uploads a CSV, and reads each dated answer with its evidence.
  2. Web app: Sign-in, scans, CSV batches and run history; hands each address to the analysis service.
  3. Run store: The queue, runs, answers, model cache and refusals; image crops in private storage for 90 days.
  4. Analysis service: Per address: geocoding, the footprint, roof crops by year, change statistics, a local permit index and the fusion rules.
  5. County aerial imagery: The county’s own aerial flights, free to use with its permission.
  6. Claude API: Judges pairs of roof crops that the statistics could not settle, and says why.
  7. From Invited user to Web app: Addresses or a CSV. One address, or a CSV batch of up to 500. An invited user starts a scan or a run.
  8. From Web app to Analysis service: Scans and batch runs. Each address to analyze, through a private service binding. A scan, or each queued address the browser loop or the cron drains.
  9. From Analysis service to Run store: Queue, runs, cache. Queued addresses, run state, answers, model verdicts and refusals. Every address processed.
  10. From County aerial imagery to Analysis service: Roof crops by year. A crop of the roof from each of the 11 flights. Each address analyzed.
  11. From Run store to Web app: Dated answers. A bracket of years, a lower bound or an abstention, with each model call and its reasoning. The app reads a run’s results.
  12. From Analysis service to Claude API: Pairs of crops. Two crops of the same roof from two flights, at matched resolution, outlined with its footprint. A pair the statistics cannot settle, chosen by bisection.
  13. From Claude API to Analysis service: Verdicts with reasons. Whether the roof changed between the two flights, and the model’s reasoning. Each pair sent.
  14. On Addresses or a CSV: Invite-only sign-in. Accounts exist only by invitation: sign-up is off, so no emailed link can create an uninvited account.
  15. On Scans and batch runs: Rate limit, fails closed. Each user’s scans are counted in Postgres by the minute and the hour; if the count cannot be read, the scan is refused.
  16. On Queue, runs, cache: Claimed queue rows. Addresses are written before work starts and claimed with SKIP LOCKED by the browser loop and the cron; a stuck claim is put back.
  17. On Pairs of crops: Rights checked first. Before any image is encoded, its source is checked against a 38-term vendor blocklist and a per-county clearance; every refusal is logged.
  18. On Run store: Request-hash cache. The store keeps each verdict against a hash of the whole request, so a re-scan returns the same answer without a new call.
  • Built by me
  • Platforms I connect to
  • Guards
  • In production

Data paths
Addresses or a CSV One address, or a CSV batch of up to 500
Scans and batch runs Each address to analyze, through a private service binding
Queue, runs, cache Queued addresses, run state, answers, model verdicts and refusals
Roof crops by year A crop of the roof from each of the 11 flights
Dated answers A bracket of years, a lower bound or an abstention, with each model call and its reasoning
Pairs of crops
Pairs of crops Two crops of the same roof from two flights, at matched resolution, outlined with its footprint
Verdicts with reasons Whether the roof changed between the two flights, and the model’s reasoning
  1. Systems

    Invited users work in a Next.js app on Vercel. A private Python FastAPI service, run as a second Vercel Service, does the analysis, with its queue, answers and model cache in Supabase Postgres. It reads county aerial flights, building footprints and permits, and calls the Claude API for hard cases.

  2. Data paths

    An address or a CSV comes in through the app, which hands each one to the analysis service. The service queues it, crops the roof from every flight, reads its footprint and permits, measures change between years and stores a dated answer for the app.

    • a Addresses or a CSV
    • b Scans and batch runs
    • c Queue, runs, cache
    • d Roof crops by year
    • e Dated answers
  3. Pairs of crops

    Where the statistics cannot settle a pair of flights, the service sends Claude two crops of the same roof and asks whether it changed. It searches by bisection, oldest flight against newest and then toward the change, instead of judging every pair.

    • f Pairs of crops
    • g Verdicts with reasons
  4. Guards

    A rights gate checks every image before it is encoded, and a request-hash cache makes a re-scan repeat its answer. Queue rows are claimed, so two drivers never scan one address. Sign-in is by invitation only, and a rate limit that fails closed protects the service.

    • Invite-only sign-in on a
    • Rate limit, fails closed on b
    • Claimed queue rows on c
    • Rights checked first on f
    • Request-hash cache on c
  5. Result

    Live since October 2026. In a 50-address demo batch every address was answered, none contradicted the imagery, and 25 of 25 checks agreed with the county’s independent historical building footprints.

What I built

What the guards protect against

The risk The guard
Someone without an invitation creates an account. Invite-only sign-in Accounts exist only by invitation: sign-up is off, so no emailed link can create an uninvited account.
One user floods the analysis service, or a broken counter lets every scan through. Rate limit, fails closed Each user’s scans are counted in Postgres by the minute and the hour; if the count cannot be read, the scan is refused.
Two drivers scan the same address, or a closed tab stops a run. Claimed queue rows Addresses are written before work starts and claimed with SKIP LOCKED by the browser loop and the cron; a stuck claim is put back.
Imagery licensed against AI use is sent to a model. Rights checked first Before any image is encoded, its source is checked against a 38-term vendor blocklist and a per-county clearance; every refusal is logged.
A re-scan of the same address gives a different answer. Request-hash cache The store keeps each verdict against a hash of the whole request, so a re-scan returns the same answer without a new call.

Results

  • Demo batch: 50 of 50 addresses answered, with 0 answers contradicting the imagery.
  • 25 of 25 checks agreed with the county’s independent historical building footprints.
  • 3.71 model calls per address on average, by bisecting the ladder of flights instead of judging every pair.
  • A blind benchmark of 261 addresses built from county permit records: 87 dated reroofs and 174 negatives.

A gate that refuses everything looks just like a gate that works, so every gate test here asserts the permitted case as well as the refused one.

Facts

  • Every model call and its reasoning is stored and shown on the result page
  • Invitations and password resets go out as branded emails through Resend
  • Research behind it: 14 files on imagery and data providers’ terms and licenses, backed by dated snapshots
  • 185 test functions across 14 test files
  1. Deal creation app

    Date: Dec 2025

    Fact: One contractor created 1,395 deals with it, January to August 2026

    Client: For four roofing contractors

    Systems: CompanyCam, Smarty, Shovels and NOAA weather radar

    Status: In production

  2. QuickBooks job costing

    Date: Aug 2026

    Fact: On day one of a 3-day hackathon, an invoice posted through the approval gate

    Client: For contractors on HubSpot (a hackathon build)

    Systems: QuickBooks Online, Stripe and Claude

    Status: Active

  3. Business-card lead intake

    Date: Feb 2026

    Fact: Prototype app in 1 day, then a prompt with 20+ lead-source rules

    Client: For a construction company

    Systems: Claude

    Status: In production