There's a common processing step in PCB manufacturing that occurs right after SMT (reflow soldering of components that have been placed on the PCB by a pick-and-place machine). It is known as AOI (automated optical inspection). What happens during AOI is that a camera images every part of the PCB and then uses old school machine vision to identify problems like missing/misplaced/misoriented components, wrong parts, s…
I hate to say it, but if you have connectivity (and directly connecting your production equipment to the internet seems foolish) then a distributed amongst manufacturers blockchain could provide the secure public database needed. It might be wise to batch the UIDs logged each shift to minimize contact and computation. Your test equipment (associated CPUs) could be searching for a new solution and separately upload the batch of UIDs each time it found one.