← Back to portfolio

The Problem

A B2B lead-generation business runs on one thing: getting the right leads to the right partners, reliably, and billing for them correctly. The internal tool that controls all of that — which partners receive which leads, in which postcodes, under which filters — had grown organically into a vibe-coded production app. Most of it had been written fast, by AI coding agents, without the safety scaffolding a system of this consequence demands.

The stakes aren't abstract. The pipeline this portal governs carries roughly 35,000 leads a month across 1,000+ partner accounts. A single mis-saved filter doesn't throw an error — it quietly stops a paying partner's leads, and nobody notices until the revenue is already gone. There were no tests on the money path, no guardrail against one UI action silently overwriting unrelated settings, and a growing backlog of feedback reports with no owner.

My Role

I own this system end to end: I scope the work, decide what gets built and in what order, review every change, gate every irreversible action, deploy, and verify against production data.

What makes the role unusual is how the code gets written. Most implementation is done by a fleet of AI coding agents working in parallel. My value isn't hand-typing every line; it's the judgment layer around the agents — deciding what to automate versus what to gate behind a human, catching the production traps an agent won't see, and designing the verification that proves a change is safe before it ships.

That layer needed real discipline. Early on, parallel agents would pick up each other's in-flight commits — one branch meant for a validation panel quietly absorbed unrelated work — making merges unsafe. So I wrote the operating protocol the fleet now runs under: one agent per worktree, a branch-drift stop rule, an adversarial-review loop before anything merges, and a written session-handoff format so concurrent work stays mergeable and auditable.

This is the honest framing: production system ownership of an AI-written codebase, through orchestration and verification — not solo authorship of every line.

Architecture

Lead Delivery Path
Lead source
campaign intake
Criteria match
filters · postcode geography
Delivery
LeadByte
Partner
1,000+ accounts
Invoice
SevDesk
Change Path — where the risk lives
Request
partner or staff
Regression shield
touched-section gating
Fresh payload
generated at send time
Pre-send check
blocking · ownership
Readback
verify or fail closed
Release Path
Isolated worktree
one agent, one lane
Adversarial review
cross-provider
Migration gate
enforced on main
Preview smoke
authenticated, autonomous
Production verify
bounded canary

What Shipped

The work moved through three phases: first make it safe to change, then make the money path correct, then make the release process itself unable to cause harm.

Verified Outcomes

7,872
invoices recovered, zero errors
132
criteria mismatches repaired across 126 partners
600k → 8.3k
rows scanned after export scoping fix
348
migration ledger rows preserved through repair
42 → 33
dependency findings · critical 1 → 0
0
open bugs at last throughput count

Every figure above is tied to a dated entry in an evidence-bound impact register that records the baseline, the intervention, the verification method, and the confidence — including the caveats. Claims without evidence are recorded as unknown rather than estimated.

Key Engineering Decisions

Tech Stack

React 18 TypeScript Vite shadcn/ui · Radix Tailwind TanStack Query zod Supabase Postgres Row-Level Security Edge Functions pg_cron LeadByte API SevDesk API Slack API n8n Vercel Playwright Vitest GitHub Actions

What This Transfers To

The domain is lead routing, but almost none of the hard parts are domain-specific.