Create a new "Quality Inspection" furnace-style entity (automatic recipe selection).
Create a new "Rework Report" used to perform research to unlock better levels of quality inspection.
Take all existing items and:
- Create an untested-<item> that has not been through quality control
- Create a failed-<item> that has failed quality control.
- Create a series of quality-inspection-<level>-<item> recipes that have a chance to return either an <item> or a failed-<item>, increasing level of the recipe has an increased chance of success.
Take all existing recipes and create a new rework-<recipe> version that takes a failed-<item> in addition to the original ingredients, and produces an untested-<ingredient> for each original ingredient, to represent disassembling the item and replacing individual components until it works, where the individual components replaced might be faulty.
For some recipes, this might not work. For <ore> to <plate>, for example, it would probably work to have <ore> + failed-<plate> => 2 untested-<plate>.
For all rework-<recipe>s, add as a result a new "Rework Report" that can be fed to a laboratory to research higher levels of quality-inspection, to improve the effective yield of a crafting recipe.
Remove all existing technology, unlock all recipes from the start, and generate a replacement technology tree based on the original tree that uses "Rework Report"s to unlock higher levels of quality-inspection.