pub struct MissionPaths {
pub repo_root: PathBuf,
pub mission_id: String,
}Fields§
§repo_root: PathBuf§mission_id: StringImplementations§
Source§impl MissionPaths
impl MissionPaths
pub fn new(repo_root: impl Into<PathBuf>, mission_id: impl Into<String>) -> Self
Sourcepub fn is_safe_id(id: &str) -> bool
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.
pub fn kranz_dir(&self) -> PathBuf
pub fn missions_dir(&self) -> PathBuf
pub fn mission_dir(&self) -> PathBuf
pub fn plan_file(&self) -> PathBuf
Sourcepub fn plan_md_file(&self) -> PathBuf
pub fn plan_md_file(&self) -> PathBuf
Rendered plan markdown (distinct from plan_file’s plan.json).
Sourcepub fn report_file(&self) -> PathBuf
pub fn report_file(&self) -> PathBuf
Mission report markdown, written on completion.
Sourcepub fn estimate_file(&self) -> PathBuf
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.
Sourcepub fn research_file(&self) -> PathBuf
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.
pub fn events_file(&self) -> PathBuf
pub fn lock_file(&self) -> PathBuf
pub fn state_file(&self) -> PathBuf
pub fn control_dir(&self) -> PathBuf
pub fn runs_dir(&self) -> PathBuf
Sourcepub fn lessons_dir(&self) -> PathBuf
pub fn lessons_dir(&self) -> PathBuf
Repo-level (not per-mission) directory of captured cross-mission
lessons; deliberately survives kranz clean and mission deletion.
Sourcepub fn lessons_index(&self) -> PathBuf
pub fn lessons_index(&self) -> PathBuf
Append-only manifest of captured lessons in capture order.
pub fn transcript_file(&self, run_id: &str) -> PathBuf
Sourcepub fn egress_denials_file(&self) -> PathBuf
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.
Sourcepub fn transcript_rel(run_id: &str) -> String
pub fn transcript_rel(run_id: &str) -> String
Relative transcript path recorded in events/state (stable across hosts).
Sourcepub fn list_missions(repo_root: &Path) -> Vec<String>
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.
Sourcepub fn try_list_missions(repo_root: &Path) -> Result<Vec<String>>
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.
Sourcepub fn require_no_follow(&self) -> Result<()>
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
impl Clone for MissionPaths
Source§fn clone(&self) -> MissionPaths
fn clone(&self) -> MissionPaths
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more