Extraction Invocation Row Mapper
Translates one attempt at one planned model call to and from its own node's properties.
The key is (contextId, runId, invocationIndex, attempt), allocated when the run's call plan is laid out rather than when a call returns, so a retry writes its own row and a replayed write of the same attempt upserts in place. Nothing here writes the key: it is in the MERGE pattern, where the uniqueness constraint can see it.
Usage and provider-response facts are optional records with several optional fields each, so both are JSON strings. Two scalar properties per field would lose the difference between "the provider reported nothing" and "there is no report", and that difference is the whole point of separating what was asked for from what was observed.
Functions
A digest of one attempt's whole payload, computed from the same map bindMap builds.
Rebuilds one attempt, throwing on anything the writer must have stored and did not.