Flowdiff

Code review, one layer up.

AI writes code faster than anyone can review it line by line. But programming was always problem solving; code was just the medium. The part a reviewer can't let go of is how the system works: which processes talk to each other, over what, in what order, and where the data goes.

Flowdiff shows a change as one sequence diagram. Flows that stay the same are white, new ones green, removed ones red. Click a part for a short note on what it does and why it changed.

Have a .flowdiff file? [ paste it into the viewer ]

[ demo ]

A made-up change in two pull requests: checkout stops calling the email provider and queues the confirmation instead.

[ how ]

  1. Give an AI agent the codebase and what the change is made of: pull requests, tickets, both, or neither. It writes one .flowdiff file.
  2. Open the file in VS Code or Cursor and press Open Preview.
  3. Follow the flow, and ask the agent to dig into anything that doesn't add up.

[ the file ]

Like Mermaid or ZenUML, but written as a diff: + lines were added, - lines removed, and > lines explain the part above them. Here is the demo's source.

title SHOP-142: Send order confirmations from a queue, not during checkout
ticket SHOP-142 https://example.com/browse/SHOP-142
pr shop-api#311 https://example.com/shop/shop-api/pull/311
pr email-worker#12 https://example.com/shop/email-worker/pull/12
repo shop-api https://example.com/shop/shop-api
repo email-worker https://example.com/shop/email-worker
> Checkout used to call the email provider itself, so a slow or failing
> provider slowed or failed the checkout. Now the API saves the order and its
> email job together, and a new worker sends the email from a queue.
>
> Merge email-worker#12 first. Until the worker runs, jobs wait in the queue
> and no confirmations go out.
>
> The ticket also asks for an SMS receipt. Neither pull request adds one.

  participant web "Browser" "shop web app"
  participant api "Orders API" "Node service"
  participant db "Postgres" "orders DB"
+ participant queue "Queue" "jobs"
    > New in shop-api#311: a jobs queue between checkout and email, so
    > checkout no longer waits on the provider.
+ participant worker "Email worker" "new service"
    > New in email-worker#12: a process that takes jobs off the queue and
    > talks to the email provider.
  participant mail "Email provider" "HTTPS API"

  web -> api: HTTP POST /orders
    > Unchanged: the browser submits the cart.
- api -> db: SQL INSERT order
    > Before: only the order was written.
+ api -> db: SQL BEGIN · INSERT order, outbox · COMMIT
    > shop-api#311 writes the order and an outbox row for its email in one
    > transaction, so neither can exist without the other.
- api -> mail: HTTP POST /v3/send
    > Before: checkout called the provider and waited for it. A provider
    > outage made checkout fail.
- mail --> api: 202 Accepted
+ api -> queue: publish order.confirmed\n{ orderId }
    > shop-api#311: after the commit, the API publishes the job and returns at
    > once.
    >
    > If the API crashes between the commit and the publish, the job is
    > never sent: nothing reads the outbox again yet. Worth a follow-up.
  api --> web: 201 Created
    > Same response as before, but it no longer waits on the email provider.

+ loop each job
    > email-worker#12. The worker handles one job at a time.
+   queue -> worker: deliver order.confirmed
+   worker -> db: SQL SELECT order, customer
    > Reads the order and customer straight from the orders database, so the
    > worker needs read access to it.
+   worker -> mail: HTTP POST /v3/send
+   alt 2xx
+     worker -> queue: ack
+   else error or timeout
+     worker -> queue: nack · retry with backoff
        > Retries five times, then drops the job. There is no dead-letter
        > queue, so a lost confirmation leaves no trace.
+   end
+ end