Fix the line, not the output
When a line produced something wrong, stop the line, fix the station, and send the workpiece through again. Never patch the output. What a line delivers is always what the line, run as written, produces.
Toyota, not Detroit
This is the Toyota Production System's jidoka. Anyone who sees a defect pulls the andon cord and the line stops. The cause is found and the process fixed before the line runs again. A defect is evidence that the process is wrong, so the process is what gets fixed.
The Detroit plants of the same era kept the line moving at any cost and fixed defects by hand in large rework areas at the end. Every car looked finished, but the line kept making the same defects, and the quality depended on the rework crew rather than the process. Toyota's way won.
| Toyota | A line |
|---|---|
| Pull the andon cord | A wrong record is found: stop the station before it makes more |
| Fix the process, not the car | Fix the station's code, config or prompt, with a test for the case |
| The car goes back through the station | The workpiece goes back from the station's done/ to its input/ and is done again |
| No rework area at the end | No hand edit or one-off script on the records the line wrote |
Why a patch is worse than it looks
A patch is a hand edit in the system the line writes to, or a script that rewrites records in place. It makes the output right once, and leaves three things wrong:
- The line still has the bug. If the station wasn't fixed, the next document comes out wrong the same way. If it was, the patch tested nothing: nobody knows whether the fixed station produces the right record.
- The records no longer come from the line. Part of the state exists only because of a script or a click. A rerun, a backfill or a move to another system won't reproduce it.
- The procedure stops being the truth. The point of running work as a line is that running it gives the right result. Every patch weakens that claim.
A redo sends the work through every line downstream too. If one of them can't redo its part, that line has a gap. Finding it is the point: fix that line as well, and don't fill the gap by hand.
The procedure
- Stop the stations involved, so nothing more comes out wrong and nothing moves while you work.
- Record the current state of everything the redo will touch: the wrong records and everything that hangs off them, such as payments applied to a bill and the matches made against those payments. Save each exactly as the system returns it. This is the baseline.
- Fix the station, with a test for the case that went wrong. Run it dry first and compare what it would write with the baseline, before anything changes.
- Unwind in reverse order of dependency. Remove what depends on the record first (unmatch the payment), then the record itself (delete the bill). A system usually refuses to delete a record that something still depends on, and that refusal shows the order.
- Put each workpiece back from the fixed station's
done/into itsinput/.done/holds exactly what the station was given, so the redo starts from the same place. Its old copy inoutput/is replaced when the station runs again. - Let the lines do the work again: the fixed station, then every station and line downstream on its normal trigger. Tasks the procedure gives to a person, such as approving a bill, are done again as well.
- Compare with the baseline. Every record must match it, except for the intended change and new ids and timestamps. Any other difference is a finding: fix the line that caused it and redo that part.
A redo relies on stations that look before they write. A posting station that finds the bill it created on a crashed run, and finishes it instead of creating a second, can run again over a half-done batch.
Keep each station's done/ for as long as its work might need redoing. It is where a redo starts.
The test
Before you touch a wrong record, ask: if the whole line ran again from its inputs, would it produce this correction?
- Yes, because the station is fixed: unwind and redo.
- No: the line isn't fixed yet. Fix the line first.
When a redo isn't possible
Some records can't be unwound: a filing already made to an authority, money already sent, a closed period, an email already delivered. Correct those with a new record in a later period, and have that record produced by a line or by a written step of the procedure. Write the exception down. It is never a quiet edit.
Example
IN2 posts each invoice line as 1 × the line total instead of 2 × 750. Fifteen bills are wrong, and payments have been matched against five of them.
- The patch: a script updates the fifteen bills' lines in place. The bills look right, no run of the line ever produced them, and a bug in the fix would go unseen.
- The redo:
- Stop
IN2and the payment-matching line. - Record the fifteen bills, the five payments and the bank lines behind them.
- Fix
IN2, and run it dry against the records. - Unmatch the five payments, then delete the fifteen bills.
- Move the fifteen workpieces from
IN2/done/toIN2/input/. - Run
IN2, approve the new bills as the procedure says, and let the matching line match the payments again. - Compare every bill and payment with the baseline: only quantity and rate differ.
- Stop
If the matching line fails to match a payment again, that is a bug in the matching line, found now rather than at month end.
Related
- Bins: why
done/holds an untouched copy of what each station was given - Check apart from fix: fixing records that a check found wrong, when the line was right
- Redo work through the line: the commands, in Assembly Line