runbookify
← All plans
Manufacturing & Production / Lot & Batch Traceability

Lot Genealogy Builder: Trace Any Lot Back to Its Inputs in Seconds

Record which raw-material lots went into which WIP and finished-goods lots, let a quality lead approve the links, then trace any lot backward to its inputs or forward to everything it touched — and export a full genealogy report on demand.

IntermediateA weekendBuilds onNext.jsSupabaseResend
What you'll build

An internal web tool where you record lot consumption per batch, a quality lead approves the links, and you can trace any finished lot back to every raw input across all levels (and forward from any raw lot to everything it touched) in seconds — then export a complete genealogy report.

Gated download

Enter your email — the plan downloads instantly and a copy lands in your inbox.

By submitting your email you'll also receive the weekly runbookify newsletter. You can unsubscribe at any time.

Before you start

  • A Supabase account (free)
  • A Vercel account (free)
  • A consumption export or list: which batch / work order consumed which raw lot to make which finished lot
  • Your lot-number and batch / work-order naming conventions
  • Claude Code or any AI coding agent

The problem this kills

A customer complaint comes in, or a supplier tells you a raw-material lot was bad. Now you have one question that has to be answered fast: where did that lot go? Which work orders consumed it, which WIP batches it became, which finished-goods lots shipped, and to which customers. Run it the other way and the question is just as urgent: this finished lot is suspect — what went into it? Trace it back through every level to the exact raw lots and suppliers.

In most plants the answer lives in a graveyard of batch records, travelers, spreadsheets, and someone's memory. Pulling a single genealogy can take a quality engineer a day of cross-referencing — and during a recall scope or an audit, a day is the difference between containing the problem and over-recalling half your inventory because you couldn't prove what was clean.

The links exist. They're just trapped on paper and in heads. You don't need a six-figure MES to make them queryable. You can build the genealogy graph yourself, this weekend.

What you'll build

An internal web tool your production and quality team logs into. As batches run, you record consumption: this work order consumed raw lot X (and Y, and Z) to produce finished lot P. The tool stores each link as an edge in a genealogy graph — handling the real shapes of manufacturing, where one raw lot feeds many finished lots (one-to-many) and one finished lot is built from many inputs (many-to-one), across as many levels as your process has.

Before any link becomes part of the official traceability record, a quality lead reviews and approves it — especially the manual entries keyed on the floor. Approved links are queryable instantly. Type any lot number and the tool walks the graph: backward to show every raw input and supplier that fed it, or forward to show every WIP and finished lot it ended up in. One click exports a complete genealogy report — the document you hand to an auditor or attach to a recall scope. It guards against the things that wreck a genealogy: duplicate links, and accidental cycles (a lot listed as its own ancestor).

What's inside the Implementation Plan

The downloadable plan is a single markdown file you paste into an AI coding agent. It opens by interviewing you about your own production process — your lot and batch numbering, the levels your product moves through (raw → WIP → finished, or more), how consumption is captured today, your one-to-many and many-to-one realities, and your messiest exceptions like rework, reblends, and split lots — then it reads a short spec back for your thumbs-up before it builds anything. That's the difference between a tool shaped to your shop floor and a generic template you have to bend.

From there it walks the agent through the data model (lots, consumption links as graph edges, approvals, audit), the consumption importer and on-floor entry form, the duplicate guard, the cycle guard, the approval gate, the backward and forward trace walkers, and the genealogy report export. Every step ends with a ready-to-copy prompt. There's a full "No API yet?" path: import a consumption CSV, export a genealogy CSV — no MES or ERP integration required to ship.

The governance it includes (this is the point)

Traceability is a controls problem, so the plan builds the controls in: a login so only your team can use it; row-level security so each site or organization only ever sees its own lots; a complete audit trail of who recorded, edited, approved, and exported each link, and when; a hard human-approval gate so a manually entered link doesn't enter the official genealogy until a quality lead signs off; a duplicate guard keyed on batch + consumed lot + produced lot so the same link can't be recorded twice; and a cycle guard so a lot can never become its own ancestor. When an auditor asks "how do you know this record is trustworthy?", the answer is built into the tool.

Who it's for

Quality engineers, traceability and compliance leads, and production supervisors who own recall readiness and batch records — anyone who has ever been asked "where did this lot go?" and dreaded the answer. If you can explain how a batch consumes raw materials to make a finished lot, you can build this — no developer required.

You've got this — open the plan, paste the first prompt, answer a few questions about how your plant actually runs, and you'll trace your first lot end-to-end before the weekend's out.

Gated download

Enter your email — the plan downloads instantly and a copy lands in your inbox.

By submitting your email you'll also receive the weekly runbookify newsletter. You can unsubscribe at any time.