Skip to main content

FileSystemState

Struct FileSystemState 

Source
pub struct FileSystemState {
    pub files: HashMap<String, FileSnapshot>,
    pub git_head_oid: Option<String>,
    pub git_branch: Option<String>,
    pub git_status: Option<String>,
    pub git_modified_files: Option<Vec<String>>,
}
Expand description

File system state snapshot for key files.

Captures the state of important files that affect pipeline execution. This enables validation on resume to detect unexpected changes.

Fields§

§files: HashMap<String, FileSnapshot>

Snapshots of tracked files

§git_head_oid: Option<String>

Git HEAD commit OID (if available)

§git_branch: Option<String>

Git branch name (if available)

§git_status: Option<String>

Git status output (porcelain format) for tracking staged/unstaged changes

§git_modified_files: Option<Vec<String>>

List of modified files from git diff

Implementations§

Source§

impl FileSystemState

Source

pub fn new() -> Self

Create a new file system state.

Source

pub fn capture_with_optional_executor( executor: Option<&dyn ProcessExecutor>, ) -> Self

👎Deprecated since 0.5.0: Uses CWD-relative paths. Use capture_with_workspace instead.

Capture the current state with an optional executor.

If executor is None, uses RealProcessExecutor (production default).

§Note

This function requires an explicit executor parameter to enable proper dependency injection for testing. For production code, pass Some(&RealProcessExecutor::new()).

§Deprecated

This function uses CWD-relative paths. Prefer capture_with_workspace for new code.

Source

pub fn capture_with_workspace( workspace: &dyn Workspace, executor: &dyn ProcessExecutor, ) -> Self

Capture the current state of key files using a workspace.

This includes files that are critical for pipeline execution:

  • PROMPT.md: The primary task description
  • .agent/PLAN.md: The implementation plan (if exists)
  • .agent/ISSUES.md: Review findings (if exists)
  • .agent/config.toml: Agent configuration (if exists)
  • .agent/start_commit: Baseline commit reference (if exists)
  • .agent/NOTES.md: Development notes (if exists)
  • .agent/status: Pipeline status file (if exists)
Source

pub fn capture_current_with_executor(executor: &dyn ProcessExecutor) -> Self

👎Deprecated since 0.5.0: Uses CWD-relative paths. Use capture_with_workspace instead.

Capture the current state of key files with a provided process executor.

This includes files that are critical for pipeline execution:

  • PROMPT.md: The primary task description
  • .agent/PLAN.md: The implementation plan (if exists)
  • .agent/ISSUES.md: Review findings (if exists)
  • .agent/config.toml: Agent configuration (if exists)
  • .agent/start_commit: Baseline commit reference (if exists)
  • .agent/NOTES.md: Development notes (if exists)
  • .agent/status: Pipeline status file (if exists)
§Deprecated

This function uses CWD-relative paths. Prefer capture_with_workspace for new code.

Source

pub fn capture_file_with_workspace( &mut self, workspace: &dyn Workspace, path: &str, )

Capture a single file’s state using a workspace.

Source

pub fn capture_file(&mut self, path: &str)

👎Deprecated since 0.5.0: Uses CWD-relative paths. Use capture_file_with_workspace instead.

Capture a single file’s state.

§Deprecated

This function uses CWD-relative paths. Prefer capture_file_with_workspace for new code.

Source

pub fn validate(&self) -> Vec<ValidationError>

👎Deprecated since 0.5.0: Uses CWD-relative paths. Use validate_with_workspace instead.

Validate the current file system state against this snapshot.

Returns a list of validation errors. Empty list means all checks passed.

§Deprecated

This function uses CWD-relative paths. Prefer validate_with_workspace for new code.

Source

pub fn validate_with_workspace( &self, workspace: &dyn Workspace, executor: Option<&dyn ProcessExecutor>, ) -> Vec<ValidationError>

Validate the current file system state against this snapshot using a workspace.

Returns a list of validation errors. Empty list means all checks passed.

Source

pub fn validate_with_executor( &self, executor: Option<&dyn ProcessExecutor>, ) -> Vec<ValidationError>

👎Deprecated since 0.5.0: Uses CWD-relative paths. Use validate_with_workspace instead.

Trait Implementations§

Source§

impl Clone for FileSystemState

Source§

fn clone(&self) -> FileSystemState

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for FileSystemState

Source§

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

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

impl Default for FileSystemState

Source§

fn default() -> FileSystemState

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for FileSystemState

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for FileSystemState

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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, 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
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 = 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,