Skip to main content

CandidateWorkspace

Struct CandidateWorkspace 

Source
pub struct CandidateWorkspace { /* private fields */ }
Expand description

A node-local candidate filesystem. Model mutations never target the source workspace directly; only promote copies touched paths.

Implementations§

Source§

impl CandidateWorkspace

Source

pub fn create( source_root: &Path, node_id: impl Into<String>, generation: u32, graph_revision: impl Into<String>, ) -> Result<Self>

Source

pub fn create_with_policy( source_root: &Path, node_id: impl Into<String>, generation: u32, graph_revision: impl Into<String>, allow_unisolated_verifiers: bool, ) -> Result<Self>

Source

pub fn set_tool_handlers(&mut self, handlers: Arc<CandidateHandlerRegistry>)

Replace the execution plane. The composition root uses this to add registered tool families beyond the builtins.

Source

pub fn overlay_root(&self) -> &Path

Source

pub fn set_verifier_timeouts(&mut self, timeouts: VerifierTimeouts)

Configure per-stage governed verifier timeouts ([verification] stage_timeout_secs + overrides).

Source

pub fn has_mutated(&self) -> bool

Source

pub fn node_generation(&self) -> u32

The node generation this candidate was created for.

Source

pub fn touched_paths(&self) -> Vec<String>

Paths mutated by admitted effects — the only promotable set.

Source

pub fn realized_diff(&self) -> Result<String>

Diff the realized candidate against the source workspace. This is an observation for advisory/conjunctive validators; gating still measures the candidate filesystem directly.

Source

pub fn promote(&self) -> Result<Vec<String>>

Promote only paths mutated by admitted governed proposals. Checks and writes share one directory descriptor per target (crate::promote), so a path swapped underneath the workspace between validation and rename is refused rather than followed.

Source

pub fn restore_exported(&self, files: &[SeedFile]) -> Result<()>

Rebuild an accepted candidate state from a durable checkpoint’s exported files (mid-loop resume): each file is journaled and written into the overlay, and re-enters the mutated (promotable) set.

Source

pub fn restore_seeded(&self, files: &[SeedFile]) -> Result<()>

Seed inherited content (a staged predecessor’s contribution) without marking it promotable: files are journaled and tracked with their pre-images (promotion overwrite-protection intact), but they enter mutated_paths only when this node’s own admitted effects touch them — so a downstream export is exactly its own work, never a re-export of everything it inherited (PSP-10 system 22).

Trait Implementations§

Source§

impl Debug for CandidateWorkspace

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl EffectExecutor for CandidateWorkspace

Source§

fn checkpoint<'life0, 'life1, 'async_trait>( &'life0 self, scope: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<CandidateCheckpoint>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Snapshot the reversible candidate overlay.
Source§

fn apply<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, call: &'life1 ProviderToolCall, entry: &'life2 ToolEntry, ) -> Pin<Box<dyn Future<Output = Result<EffectOutcome>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn restore<'life0, 'life1, 'async_trait>( &'life0 self, checkpoint: &'life1 CandidateCheckpoint, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Restore an earlier candidate snapshot exactly.
Source§

fn state_witness<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<CandidateStateWitness>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Re-read the materialized candidate after an effect.
Source§

fn export_accepted<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<SeedFile>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The accepted candidate’s mutated paths with their current contents (None = deleted), for durable mid-loop checkpoints. The default is empty: fixtures without a filesystem have nothing durable to export.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
§

impl<T> ToAst for T

§

fn ast(self, begin: usize, end: usize) -> Spanned<Self>

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> AsTypeStaticRegistered for T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> HasTyVTable for T
where T: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> StarlarkAnyBound for T
where T: Debug + Send + Sync + 'static,