pub enum OverflowPolicy {
SurfaceNat,
Strict,
HardenedNat,
}Expand description
How a temporal overflow should be surfaced.
br-frankenpandas-fyr1z-policy-carrier-f29nz adds this carrier WITHOUT
changing any default behavior: every existing call site is on
OverflowPolicy::SurfaceNat, which is exactly what the codebase did
before. Strict exists so fyr1z.3 can wire per-op raise arms in a separate,
reviewable step, and NOTHING routes to it yet.
Note DISC-018: a blanket “STRICT raises everywhere” is NOT pandas parity —
pandas silently wraps on Series * int and .cumsum(), and returns NaT for
.mean(). The strict arm therefore needs a per-op table, which is why the
policy is carried per operation rather than set globally.
Variants§
SurfaceNat
Today’s behavior, and the only arm currently wired up: overflow becomes the family’s NaT sentinel.
Strict
Reserved for fyr1z.3. Surfaces the TemporalFailure to the caller.
HardenedNat
HARDENED mode (br-frankenpandas-fyr1z-hardened-audit-vllv6): returns the
SAME NaT as Self::SurfaceNat, bit-for-bit, and additionally records a
TemporalRecovery into overflow_audit when that log is enabled.
This adds observability, never semantics. AGENTS.md defines hardened mode as “bounded defensive recovery” and requires a deterministic audit log for exactly that.
Implementations§
Source§impl OverflowPolicy
impl OverflowPolicy
Sourcepub fn resolve<T>(
self,
outcome: Result<T, TemporalFailure>,
nat: T,
) -> Result<T, TemporalFailure>
pub fn resolve<T>( self, outcome: Result<T, TemporalFailure>, nat: T, ) -> Result<T, TemporalFailure>
Resolve a fallible temporal result under this policy.
SurfaceNat discards the overflow and yields nat, reproducing the
pre-f29nz behavior bit-for-bit. Strict propagates the overflow.
§Errors
Returns the TemporalFailure unchanged under Self::Strict.
Sourcepub fn resolve_recording<T>(
self,
outcome: Result<T, TemporalFailure>,
nat: T,
recovered_as: i64,
) -> Result<T, TemporalFailure>
pub fn resolve_recording<T>( self, outcome: Result<T, TemporalFailure>, nat: T, recovered_as: i64, ) -> Result<T, TemporalFailure>
Self::resolve plus the sentinel value to record in the audit trail.
Split out because the recovered value is generic (T) but the audit
entry needs its i64 backing; recovered_as supplies that without
constraining T.
§Errors
Returns the TemporalFailure unchanged under Self::Strict.
Trait Implementations§
Source§impl Clone for OverflowPolicy
impl Clone for OverflowPolicy
Source§fn clone(&self) -> OverflowPolicy
fn clone(&self) -> OverflowPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more