Correct the mapping for incoming records
Different entry paths provided different inputs to the same mapping. I updated the mapping so it preserved the information needed to calculate the entitlement across those paths.
Inspect existing state before writing
I added a read-only inspection step so proposed repairs could be reviewed before a write. Correcting the incoming mapping and repairing earlier records were separate problems.
I made failed lookups distinguishable from records that were successfully checked and needed no change. A failed lookup leaves the record unresolved. A successful check can establish that repair is unnecessary.
Correct new records and inspect old ones before writing