Key of the recorded-request ledger: a message ID, optionally scoped.
A bare message-ID string keys requests recorded without an attempt scope
(the legacy behavior). When a caller passes attempt_scope to
record_message_usage/record_model_usage_event, the key is
(attempt_scope, message_id) instead, so a retry that reuses the provider's
message ID is a separate request while chunks of one attempt still merge.
Callers that retain this ledger across retries should use this widened key type.
The two shapes coexist in one ledger, so de-duplication cannot rely on the
key alone: an attempt scope lives for one model call, while a HITL resume pass
replays messages with no scope open. finalize_recorded_requests closes that
gap by projecting every scoped key down to its bare message ID at each round
boundary -- see its docstring.