Skip to main content

MissionPaths

Struct MissionPaths 

Source
pub struct MissionPaths {
    pub repo_root: PathBuf,
    pub mission_id: String,
}

Fields§

§repo_root: PathBuf§mission_id: String

Implementations§

Source§

impl MissionPaths

Source

pub fn new(repo_root: impl Into<PathBuf>, mission_id: impl Into<String>) -> Self

Source

pub fn is_safe_id(id: &str) -> bool

Mission ids that come from untrusted user input are joined into filesystem paths. Reject separators, .., and drive designators before constructing paths from those ids.

Source

pub fn kranz_dir(&self) -> PathBuf

Source

pub fn missions_dir(&self) -> PathBuf

Source

pub fn mission_dir(&self) -> PathBuf

Source

pub fn plan_file(&self) -> PathBuf

Source

pub fn plan_md_file(&self) -> PathBuf

Rendered plan markdown (distinct from plan_file’s plan.json).

Source

pub fn report_file(&self) -> PathBuf

Mission report markdown, written on completion.

Source

pub fn estimate_file(&self) -> PathBuf

Approval-time cost estimate (gitignored runtime bookkeeping, like state.json): persisted at plan approval / revision so the completion report can compare actual cost against the exact estimate the operator approved, rather than one recomputed against a later corpus or config.

Source

pub fn research_file(&self) -> PathBuf

Per-mission research evidence artifact (repo-knowledge-store slice 1), committed beside plan.md on the mission branch when a plan is approved.

Source

pub fn events_file(&self) -> PathBuf

Source

pub fn lock_file(&self) -> PathBuf

Source

pub fn state_file(&self) -> PathBuf

Source

pub fn control_dir(&self) -> PathBuf

Source

pub fn runs_dir(&self) -> PathBuf

Source

pub fn lessons_dir(&self) -> PathBuf

Repo-level (not per-mission) directory of captured cross-mission lessons; deliberately survives kranz clean and mission deletion.

Source

pub fn lessons_index(&self) -> PathBuf

Append-only manifest of captured lessons in capture order.

Source

pub fn transcript_file(&self, run_id: &str) -> PathBuf

Source

pub fn egress_denials_file(&self) -> PathBuf

Mission-shared egress-denial JSONL the per-run egress proxy appends to (fs+net sessions; see crate::egress_proxy). Runtime path under the gitignored runs/ dir; v1 correlation is mission-level.

Source

pub fn transcript_rel(run_id: &str) -> String

Relative transcript path recorded in events/state (stable across hosts).

Source

pub fn list_missions(repo_root: &Path) -> Vec<String>

List mission ids present under a repo (sorted), lenient: an unreadable missions dir lists as empty, and an erroring directory entry (fd exhaustion, mid-deletion races, permission flaps) is skipped while the REST are kept — one bad entry must not collapse the whole listing to “no missions”. Use Self::try_list_missions when the caller must distinguish “no missions” from “could not list missions” (e.g. before pruning per-mission bookkeeping keyed on this listing).

Symlinks are never followed: a symlinked .kranz or missions dir lists as empty (the fallible variant refuses with an error), and a symlinked mission-dir entry is excluded rather than resolved into another repository’s tree.

Source

pub fn try_list_missions(repo_root: &Path) -> Result<Vec<String>>

List mission ids present under a repo (sorted), distinguishing filesystem errors from a genuinely empty listing.

A missing missions dir is Ok(vec![]) — the repo simply has no missions yet. Any other read_dir failure, or an erroring directory entry (fd exhaustion, mid-deletion races, permission flaps), is Err: a transient error must not masquerade as “every mission was deleted”. A symlinked .kranz/missions dir is Err too — it must refuse, never be followed into another repository’s tree.

Source

pub fn require_no_follow(&self) -> Result<()>

Refuse when any component of <repo>/.kranz/missions/<id> is a symlink (or otherwise not a real directory). An ABSENT component is not a refusal — callers keep their own missing-mission handling (404s, “unknown mission” errors); only a symlinked component — one that would be followed into another tree — must fail here.

Trait Implementations§

Source§

impl Clone for MissionPaths

Source§

fn clone(&self) -> MissionPaths

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

impl Debug for MissionPaths

Source§

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

Formats the value using the given formatter. 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<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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + 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
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + 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
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<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