pub struct LaneGateBoard {
pub lane_id: String,
pub gates: BTreeMap<String, GateState>,
pub retries: BTreeMap<String, u32>,
pub artifacts: Vec<HandoffArtifact>,
}Expand description
In-memory (and serializable) gate + handoff store for one lane.
Fields§
§lane_id: String§gates: BTreeMap<String, GateState>Gate id → current state.
retries: BTreeMap<String, u32>Retry counters per gate id.
artifacts: Vec<HandoffArtifact>Handoff artifacts for this lane.
Implementations§
Source§impl LaneGateBoard
impl LaneGateBoard
pub fn new(lane_id: impl Into<String>) -> Self
Sourcepub fn install_gates(&mut self, specs: &[GateSpec])
pub fn install_gates(&mut self, specs: &[GateSpec])
Register gate specs in pending state.
Sourcepub fn evaluate(
&mut self,
spec: &GateSpec,
outcome: GateOutcome,
) -> Result<GateState, GateError>
pub fn evaluate( &mut self, spec: &GateSpec, outcome: GateOutcome, ) -> Result<GateState, GateError>
Evaluate a gate against an outcome; updates board state.
Sourcepub fn role_is_blocked(
&self,
specs: &[GateSpec],
role: &str,
) -> Option<&GateState>
pub fn role_is_blocked( &self, specs: &[GateSpec], role: &str, ) -> Option<&GateState>
Whether role is currently blocked by any gate that targets it.
Sourcepub fn record_handoff(
&mut self,
artifact: HandoffArtifact,
) -> Result<(), GateError>
pub fn record_handoff( &mut self, artifact: HandoffArtifact, ) -> Result<(), GateError>
Record a scout→implementer (etc.) handoff artifact.
Sourcepub fn latest_handoff(
&self,
from_role: &str,
to_role: &str,
kind: &str,
) -> Option<&HandoffArtifact>
pub fn latest_handoff( &self, from_role: &str, to_role: &str, kind: &str, ) -> Option<&HandoffArtifact>
Latest handoff of kind from from_role to to_role, if any.
Sourcepub fn consume_handoffs_for(
&mut self,
to_role: &str,
limit: usize,
) -> Vec<HandoffArtifact>
pub fn consume_handoffs_for( &mut self, to_role: &str, limit: usize, ) -> Vec<HandoffArtifact>
Remove and return the latest handoffs addressed to to_role (newest
first), up to limit.
Handoffs are single-use: the consumer that receives one is also issued
a HandoffConsumed receipt, so leaving the artifact on the board would
re-deliver it to every later same-role task — stale evidence, repeated
token cost, and a receipt that lies about being spent.
Sourcepub fn save_to_dir(&self, dir: &Path) -> Result<PathBuf, GateError>
pub fn save_to_dir(&self, dir: &Path) -> Result<PathBuf, GateError>
Persist board under a lane directory (JSON).
pub fn load_from_dir(dir: &Path) -> Result<Self, GateError>
Sourcepub fn status_summary(&self) -> Vec<GateStatusLine>
pub fn status_summary(&self) -> Vec<GateStatusLine>
Compact status for lane status / panel surfaces.
Trait Implementations§
Source§impl Clone for LaneGateBoard
impl Clone for LaneGateBoard
Source§fn clone(&self) -> LaneGateBoard
fn clone(&self) -> LaneGateBoard
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more