pub struct StateDir { /* private fields */ }Implementations§
Source§impl StateDir
impl StateDir
pub fn default_root() -> Result<PathBuf, StateError>
pub fn at(root: impl Into<PathBuf>) -> Self
pub fn discover() -> Result<Self, StateError>
pub fn root(&self) -> &Path
pub fn runs(&self) -> PathBuf
pub fn repos(&self) -> PathBuf
Sourcepub fn project_repos(&self, project_id: &str) -> PathBuf
pub fn project_repos(&self, project_id: &str) -> PathBuf
Project-scoped repos directory at
<root>/projects/<project_id>/repos. Ingestion writes per-repo
workspace subdirs under this path so two repos with the same
name in different projects never collide.
pub fn findings(&self) -> PathBuf
pub fn logs(&self) -> PathBuf
pub fn cache(&self) -> PathBuf
Sourcepub fn bundles(&self) -> PathBuf
pub fn bundles(&self) -> PathBuf
Per-finding repro bundle output directory (<state>/bundles).
One tarball per finding is written here when the operator
requests a repro bundle.
Sourcepub fn traces(&self) -> PathBuf
pub fn traces(&self) -> PathBuf
Per-AI-task trace artefact directory (<state>/traces). The
exploration pass writes one <task_id>.jsonl per run under
Self::traces_for_run and stamps the path on the matching
agent_traces.conversation_jsonl_path row.
Sourcepub fn traces_for_run(&self, run_id: &str) -> PathBuf
pub fn traces_for_run(&self, run_id: &str) -> PathBuf
Per-run trace directory at <state>/traces/<run_id>. Created
on demand by the pass that writes into it; callers should
std::fs::create_dir_all before opening files.
Sourcepub fn secrets(&self) -> PathBuf
pub fn secrets(&self) -> PathBuf
Secrets directory at <state>/secrets, created with mode 0700
by Self::ensure. The env-builder reads
<state>/secrets/test.env (and the optional test.env.allow
sibling) from this path. Surfaced as a single canonical accessor
so the wizard, doctor, and env-builder name the same location.
Sourcepub fn secrets_test_env_path(&self) -> PathBuf
pub fn secrets_test_env_path(&self) -> PathBuf
Path of the env-builder test secrets file
(<state>/secrets/test.env). Absent until the operator drops a
file at this path; the env-builder fails closed when it is
missing.
Sourcepub fn secrets_test_env_allow_path(&self) -> PathBuf
pub fn secrets_test_env_allow_path(&self) -> PathBuf
Path of the optional env-builder secrets allowlist
(<state>/secrets/test.env.allow). Absent on a fresh install;
the env-builder treats a missing file as an empty allowlist.
Sourcepub fn auth_token_path(&self) -> PathBuf
pub fn auth_token_path(&self) -> PathBuf
Bearer-token file consumed by the API auth middleware. Stored
at <state>/auth_token with mode 0600. Absent before the
daemon’s first launch.
Sourcepub fn ensure(&self) -> Result<(), StateError>
pub fn ensure(&self) -> Result<(), StateError>
Create the root and every subdirectory if missing; idempotent. On
Unix every directory created or already present is forced to mode
0700.
Sourcepub fn load_or_mint_auth_token(&self) -> Result<String, StateError>
pub fn load_or_mint_auth_token(&self) -> Result<String, StateError>
Load the bearer token from auth_token, generating + persisting
a fresh one if absent. The minted file is 0o600 so a second
user on the box cannot read it. Callers that have already
invoked Self::ensure do not need to repeat it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StateDir
impl RefUnwindSafe for StateDir
impl Send for StateDir
impl Sync for StateDir
impl Unpin for StateDir
impl UnsafeUnpin for StateDir
impl UnwindSafe for StateDir
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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