Works01 / 05

A ticket goes in at one end. A chain of AI agents reproduces it, fixes it, reviews it, tests the running app and hands over a pull request — with a record and a price tag on every step.

winningby.ai

The pipeline’s admin overview with total cost, tickets and agent time
The control room, August snapshot. Already public on winningby.ai.
Product
Autonomous development pipeline, plus the company’s site
Role
Co-founder, principal AI engineer
Period
July – October 2026
Stack
TypeScript, Temporal, Claude Code headless, Fastify, PostgreSQL, Playwright, Railway
Live
winningby.ai

Most teams bought an AI coding assistant and got developers who type faster. The tickets still spend weeks in review, testing and queues. We wanted to sell a process instead of a tool: a ticket enters, specialised agents carry it to a merge-ready pull request, and people keep the decisions that matter.

Making an agent write code in a demo is easy. The real question is what happens when it runs for days on a real repository, across deploys, against a real quota, and somebody has to answer for the result.

So one rule from the first commit: models produce artifacts, deterministic code decides what happens next. Free text never moves a ticket.

  1. 01

    The pipeline

    One ticket is one durable Temporal workflow. A bug runs ten agent stages and two human gates; a feature gates the plan rather than the code, because a bad bug plan is cheap and a well-built wrong feature is not. Each stage is a cold start with its own budget of turns, tokens and seconds, and its only output is a result a machine can validate.

  2. 02

    A bench that boots the real app

    Node, PostgreSQL with pgvector, Chromium, the whole target application behind nginx. QA tests the running product instead of reading a diff, and evidence is keyed on the git tree, so it means “this code passed”, not “this commit said so”.

  3. 03

    Model routing

    Per-stage ladders with fallbacks, and a circuit breaker that reads the reset time out of the API’s own refusal and routes around a spent model before paying for a dead attempt.

  4. 04

    The meter and the control room

    A server-rendered admin with no framework: tickets, epics, gates, models, analytics. Every stage of every run is costed and traceable, and a run’s whole record exports with one command.

  5. 05

    From reports to work

    Scheduled analysts read the product’s data, write a report and propose work as cards, de-duplicated and scored by impact. One approval turns a card into a ticket that can carry itself to merge.

How it fits together

  1. Understand

    • Quality checkdoes the ticket make sense
    • Test cases
    • Reproducea failing test, or it does not count
  2. Change

    • Fix plan
    • Fixin a fresh, budgeted session
  3. Prove

    • Code reviewa separate agent, with an evidence bar
    • Human gate
    • QAon the running app
  4. Hand over

    • Learn
    • PR stabiliseuntil CI is green
    • Human gate
    • Docs
Analytics view with cost by ticket type, stage and model
Where the money goes: review and planning, not typing.

The part that never makes it into a portfolio. All of it happened, and all of it is in the commit history.

  1. Fault 01

    The guard that said yes to everything

    Symptom
    Nothing visible. Bug reproductions were being confirmed, and that looked fine.
    Cause
    The anti-fabrication check ran the test command at the repo root and read any non-zero exit as proof the test had failed. The repo had no root test script, so npm always failed, and every claimed reproduction passed without a test ever running.
    Fix
    Three outcomes instead of two: a command that could not run counts as unavailable and leaves no evidence. Only a suite that ran and failed proves anything. A check that cannot fail looks exactly like a check that keeps passing.
  2. Fault 02

    Eight runs of the first ticket, and its PR is still open

    Symptom
    The first real ticket escalated again and again, each time for a new reason.
    Cause
    The agents were fine; the plumbing around them was not. A skill file sat one level above where the CLI could read. A schema demanded fields an agent could not know. A skill told agents to call a tool that did not exist. Any stage over two minutes silently lost its workflow activity, because the heartbeat was declared and never passed, while the admin showed “running” forever.
    Fix
    One commit each, the same day, with the runs numbered in the messages. That first pull request has never been merged. The ticket that broke everything taught the system to work; the next one shipped within a day.
  3. Fault 03

    “The agent failed.” It never ran.

    Symptom
    One ticket kept escalating with “agent ended without recording a result”. The hunt went through gates, webhook de-duplication and retry logic.
    Cause
    The transcript’s first line had the answer: three turns, zero tokens, six seconds, a 429. The quota was spent for three more days. The launcher could not tell a refused request from a misbehaving agent, so an outage got filed as the agent’s fault.
    Fix
    Refusals now escalate as an environment problem, quoting the API, and a circuit breaker routes around the model. The sting came the same day: the check read api_error_status !== undefined, healthy runs end with null, and in JavaScript that is true. Every healthy run read as refused for a while.
  4. Fault 04

    A workflow that runs for days is always mid-flight across a deploy

    Symptom
    An epic stayed RUNNING with 35 failed attempts. Its child ticket had finished and the epic never noticed.
    Cause
    Temporal replays history, and the new code asked for a different activity at the same point: a nondeterminism error. The reasoning that no version guard was needed held for tickets and not for epics. It came back in another form: a worker shutting down cancels through the same signal as the Stop button, so every deploy looked like a stop.
    Fix
    Version guards as routine, later changes replay-tested on a real Temporal server in both directions, and a clean split between requested cancellation and shutdown. With durable agents, deploying is a data migration.
  5. Fault 05

    Teaching an agent to wait, in a session that cannot wait

    Symptom
    A build was killed by the watchdog with its change committed and its test suite already passed three minutes earlier.
    Cause
    The verifier buffered its output, so the log the agent watched stayed empty, and the agent’s pgrep matched its own shell, so it polled “running” until it died. The fix caused the next failure: agents were told to background long checks and wait for a notification. A headless session ends when the agent ends its turn. Nothing wakes it.
    Fix
    A --wait mode that blocks in the foreground, 110 seconds a call, with an exit code meaning “call me again”. Instructions are not guarantees: an agent’s environment has its own physics, and a wrong mental model produces confident, reasonable, fatal behaviour.
  6. Fault 06

    The accounting lied in both directions

    Symptom
    A ticket “blew its 400k token budget” without going near it. Another view showed $47 where $627 had been spent. Three finished tickets were thrown away for running over time.
    Cause
    An agent’s self-report (620,000) overrode a measured 381. The fallback estimate ignored cache, which is 83% of real spend. And the clock started before the queue, the clone and the boot: agents worked 9, 2 and 2 minutes and were billed 78, 57 and 35.
    Fix
    Measurement wins and a gap is logged as an anomaly. A model with no known price shows a dash, never a plausible wrong number. Time counts from when the agent starts. For a product that sells “every run, priced to the line”, the meter is the product.

  • pull requests merged into one live consumer product23 Jul – 17 Sep 2026; 14.8% of what merged there in that window
  • lines added by those PRs−3,364 removed; median PR 296 lines
  • metered agent cost per ticketAugust snapshot, 47 tickets, $1,194.36. Excludes human review and hosting
  • agent time per ticketsame snapshot; not a comparison with human hours
  • of spend went to review and planningwriting the code took 21% — same snapshot
  • test cases in 52 filescounted in the source; 35,530 lines of TypeScript

Commit pulse

Every commit in the project’s repositories, on one line. The taller the bar, the hotter the stretch.

Jul 2026Oct 2026
  1. The company’s site, scaffolded in a day
  2. The pipeline meets a real repository; first ticket, eight runs
  3. Epics with stacked PRs; 53 PRs merged that month
  4. Real browser verification; reports turn into work
  5. Analysts and reports: the loop’s last commit so far

If your team already pays for an AI assistant and tickets still queue, the missing piece is rarely a better model. It is the process around it: gates, evidence, a meter and a way to stop. That is what I build with you, in a 4–6-week sprint with one or two of your engineers.

Write a brief

I reply fast on WhatsApp and Telegram

Or ask the digital mind about it
Next caseBlackbrook Barns