Skip to main content

RunPaths

Struct RunPaths 

Source
pub struct RunPaths {
    pub root: PathBuf,
    pub run_id: RunId,
}
Expand description

Per-run paths anchored on <root>/runs/<run-id>/.

Fields§

§root: PathBuf

The run’s root directory; every other path is derived from it.

§run_id: RunId

The validated run id this directory belongs to. Carried explicitly so event envelopes never re-derive it from root.file_name().

Implementations§

Source§

impl RunPaths

Source

pub fn new(root: impl Into<PathBuf>, run_id: impl Into<String>) -> Result<Self>

Construct paths for root (the run directory) carrying a validated run_id. Rejects malformed ids up front so every downstream event envelope and projection is stamped with a well-formed id, and rejects a run root that is a symlink (Error::SymlinkRunDir) so a replaced run directory cannot redirect writes outside the run tree. An absent root is fine — a fresh run is created later; only an existing symlink is refused. See reject_symlink for the best-effort/TOCTOU caveat.

Source

pub fn from_validated(root: impl Into<PathBuf>, run_id: RunId) -> Result<Self>

Construct paths from an already-validated RunId, skipping the re-parse RunPaths::new does (but not the symlink-root check — that one symlink_metadata is negligible and is the production CLI’s only construction-time guard, since this is the constructor it uses). root must be the run directory (typically run_dir’s output for this same id). Rejects a symlinked root with Error::SymlinkRunDir.

Source

pub fn manifest(&self) -> PathBuf

Path to the run manifest (manifest.json).

Source

pub fn events(&self) -> PathBuf

Path to the append-only event log (events.jsonl).

Source

pub fn lock(&self) -> PathBuf

Path to the advisory flock file (.lock) guarding this run.

Source

pub fn nodes_dir(&self) -> PathBuf

Path to the nodes/ directory holding per-node projection files.

Source

pub fn node(&self, node_id: &NodeId) -> PathBuf

Path to a single node’s projection file (nodes/<node-id>.json).

Takes a validated NodeId, so the filename can never contain / or .. and the result can never escape nodes/.

Source

pub fn supervisor_pid(&self) -> PathBuf

Path to the supervisor pid file (supervisor.pid).

Source

pub fn agent_log(&self) -> PathBuf

Path to the durable capture of the agent’s tmux pane (agent.log). The supervisor tees the worker pane here via tmux pipe-pane right after spawn confirmation so a post-mortem survives teardown — the file lives in the run dir, NOT the worktree, so it persists after the tmux window and worktree are removed.

Trait Implementations§

Source§

impl Clone for RunPaths

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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