Skip to content
AITroveRead. Build. Understand.
Make this comfortable

Backfill prompts: map known states and quarantine unknowns

Last updated: 4 Oct 202611 min read
tutorial
AdvancedBy AITrove Editorial

A migration mapping lists source value, target value, preconditions, null handling, owner, and test case. Unknown source states should enter a reason-coded quarantine rather than a plausible default. Ask the model to identify collisions where distinct source meanings map to one target value, then have the data owner approve any intentional loss. Deterministic code applies the versioned mapping and emits a per-row outcome. Keep the original value and row key so a corrected mapping can replay only affected records.

Operational case

Of 47,000 Harbor orders, 46,940 map under the approved rules. Forty-seven have unfamiliar legacy statuses, and 13 lack required tenant IDs; the groups are disjoint, so 60 rows are quarantined. The assistant does not call the unknown status 'pending' just to make every row load. It creates an exception ledger with reason, pseudonymous key, observed value, and owner.

Output
47,000 = mapped 46,940 + quarantined 60
UNKNOWN_STATUS: 47 | TENANT_ID_MISSING: 13
Fallback to pending: prohibited without approval
Preserve source value and row key

Performance and review cost

Applying an indexed mapping to N rows is O(N) expected time and O(K+E) memory for K mapping keys and E exceptions. Quarantine costs review time but avoids semantic loss. A model can cluster unknown values; only an owner can authorize new meaning.

Common Mistakes

  • Do not silently default unknown statuses.
  • Do not double-count overlapping exception IDs.
  • Do not erase the original value after quarantine.

Connected lessons

prompt engineering
database migration
Storage details