pub enum Staleness {
Cached,
Strict {
max_cache_age: String,
},
Unchecked,
}Expand description
Staleness policy declared on a Manifest, forwarded onto each
emitted Command. Internally tagged via mode so YAML reads
naturally:
staleness:
mode: strict
max_cache_age: 5mCached and Unchecked carry no payload, so they collapse to
just staleness: { mode: cached } / staleness: { mode: unchecked }.
Variants§
Cached
Use whatever the agent has cached for script_current /
script_status, no age limit. Silently proceed if the entries
are missing. Historical default — every pre-v0.26 Manifest
reads as this on deserialize, so introducing the field is
fully back-compatible.
Strict
Only run when the agent can verify reasonably-fresh KV state.
“Reasonably fresh” = the last confirmed connection to the
broker happened within max_cache_age (NATS KV watch is
push-based, so while connected the cache is provably up to
date; the timer only starts when the agent disconnects). When
the window expires the agent attempts a live kv.get(); if
that also fails the agent publishes a synthetic skipped
result with exit_code = 127.
Fields
Unchecked
Skip Layer 2 entirely — don’t look at script_current or
script_status. Use only for fully idempotent local scripts
where revoke semantics don’t make sense.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Staleness
impl<'de> Deserialize<'de> for Staleness
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Staleness
impl JsonSchema for Staleness
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more