pub struct EffectRecheckContext<'a> {
pub run_id: &'a str,
pub command_id: &'a str,
pub definition_revision: &'a str,
pub expected_revision: &'a str,
pub expected_generation: u64,
pub current_generation: u64,
pub authorization: Option<&'a StrategyAuthorization>,
pub claimant: &'a str,
pub session_id: Option<&'a str>,
pub single_writer_registry: Option<&'a SingleWriterSessionRegistry>,
pub required_tokens: Option<u64>,
pub token_budget_remaining: Option<u64>,
}Expand description
Context evaluated immediately prior to executing any effect.
Fields§
§run_id: &'a str§command_id: &'a str§definition_revision: &'a str§expected_revision: &'a str§expected_generation: u64§current_generation: u64§claimant: &'a str§session_id: Option<&'a str>Native session this effect will write through, when the executor holds a
single-writer registration. None means the executor has no session lock
to recheck, not that the lock check passed.
single_writer_registry: Option<&'a SingleWriterSessionRegistry>§required_tokens: Option<u64>Tokens this effect is about to spend against a configured pool, and what
is left of it. None means no pool fact is available to compare.
token_budget_remaining: Option<u64>Implementations§
Source§impl<'a> EffectRecheckContext<'a>
impl<'a> EffectRecheckContext<'a>
Sourcepub fn for_run_command(
run_id: &'a str,
snapshot: &'a RunSnapshot,
definition: &'a StrategyDefinition,
command: &'a RunCommand,
claimant: &'a str,
) -> Self
pub fn for_run_command( run_id: &'a str, snapshot: &'a RunSnapshot, definition: &'a StrategyDefinition, command: &'a RunCommand, claimant: &'a str, ) -> Self
Build the pre-effect recheck context for one command the executor claimed.
The generation check compares two independently sourced facts: the visit
the command was minted for (RunCommand::state_visit) against the visit
the run is at now (RunSnapshot::state_visits). A command whose state was
re-entered, or that was claimed for a state the run has since advanced
past, must not reach the executor with stale semantics.
The revision check asserts the run is still bound to the definition it
was loaded from. That binding is structural here (the definition is read
by snapshot.definition_digest), so the check is an invariant assertion
rather than a second read of mutable state.
Session-lock and token-budget facts stay None until the T07.4 node
facade and the T04 pool ports are reachable from the executor; see
GroupBIntegrationGaps. Callers holding those facts set the fields
directly.