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§
- Safeguard
Fallback Notice - 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§
- Safeguard
Fallback Kind - 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) andtake_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_fallbackscope. - visible_
provider_ fallback - Select the generic provider-fallback record that still needs its own
presentation next to
safeguard.