Skip to main content

Module normalize

Module normalize 

Source
Expand description

Lossless conversation-history validation before provider requests.

Validation never repairs history by deleting records or inventing tool outcomes. A missing, orphaned, duplicate, or misplaced record is returned as an explicit error so the host can recover it from durable state or block the request without changing canonical history.

Structs§

NormalizeReport
Counts observed while validating a complete history.

Enums§

HistoryValidationError
Why canonical history cannot be sent to a provider.
SyntheticReason
A terminal outcome proven by durable host state.

Constants§

SYNTHETIC_CANCELLED_MARKER
Substring present in every explicitly recorded cancelled result body.
SYNTHETIC_ERROR_MARKER
Substring present in every explicitly recorded error result body.

Functions§

normalize_history
Validate canonical tool call/result structure without modifying messages.
normalize_provider_messages
Validate the JSON message vector immediately before an LlmDriver request. The input remains byte-for-byte unchanged on success and failure.
synthetic_tool_result
Build a typed terminal result after the host has verified durable evidence.