Skip to main content

Module safeguard_notice

Module safeguard_notice 

Expand description

Task-local side-channel for safeguard (refusal-triggered) model switches.

Mirrors the task-local contract of crate::reliable::ProviderFallbackInfo: the accepted-response owner commits at most one notice per turn via commit_safeguard_fallback, and the runtime turn boundary reads it via take_last_safeguard_fallback. Both must run inside a scope_safeguard_fallback scope for the data to be visible; outside a scope, commit/peek/take are silent no-ops.

Structs§

SafeguardFallbackNotice
One safeguard (refusal-triggered) fallback event for the current turn. Read post-loop by the channel orchestrator (PR 5); mirrors ProviderFallbackInfo’s task-local contract.

Enums§

SafeguardFallbackKind
Which layer performed the safeguard-triggered model switch.

Functions§

commit_safeguard_fallback
Commit the safeguard attribution for the latest accepted response.
scope_safeguard_fallback
Run the given future within a safeguard-fallback scope. Both commit_safeguard_fallback (inside the accepted-response owner) and take_last_safeguard_fallback (the runtime turn boundary) must execute within this scope for the data to be visible.
take_last_safeguard_fallback
Take (consume) the last safeguard fallback notice, if any. Must be called within a scope_safeguard_fallback scope.
visible_provider_fallback
Select the generic provider-fallback record that still needs its own presentation next to safeguard.