pub struct CommitLogSession { /* private fields */ }Expand description
Session tracker for commit generation logging.
Manages a unique run directory for a commit generation session, ensuring log files are organized and don’t overwrite each other.
Implementations§
Source§impl CommitLogSession
impl CommitLogSession
Sourcepub fn new(base_log_dir: &str, workspace: &dyn Workspace) -> Result<Self>
pub fn new(base_log_dir: &str, workspace: &dyn Workspace) -> Result<Self>
Create a new logging session using workspace abstraction.
Creates a unique run directory under the base log path.
§Arguments
base_log_dir- Base directory for commit logs (e.g.,.agent/logs/commit_generation)workspace- The workspace to use for filesystem operations
Sourcepub fn noop() -> Self
pub fn noop() -> Self
Create a no-op logging session that discards all writes.
This is used as a fallback when all log directories fail to be created. The session will still track attempt numbers and provide a dummy run_dir, but writes will silently succeed without actually writing anything.
§Returns
A CommitLogSession that uses /dev/null equivalent as its run directory.
Sourcepub const fn next_attempt_number(&mut self) -> usize
pub const fn next_attempt_number(&mut self) -> usize
Get the next attempt number and increment the counter.
Sourcepub fn new_attempt(&mut self, agent: &str, strategy: &str) -> CommitAttemptLog
pub fn new_attempt(&mut self, agent: &str, strategy: &str) -> CommitAttemptLog
Create a new attempt log for this session.
§Arguments
agent- The agent being usedstrategy- The retry strategy being used
Sourcepub fn write_summary(
&self,
total_attempts: usize,
final_outcome: &str,
workspace: &dyn Workspace,
) -> Result<()>
pub fn write_summary( &self, total_attempts: usize, final_outcome: &str, workspace: &dyn Workspace, ) -> Result<()>
Write summary file at end of session.
For noop sessions, this silently succeeds without writing anything.
§Arguments
total_attempts- Total number of attempts madefinal_outcome- Description of the final outcomeworkspace- The workspace to use for filesystem operations
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommitLogSession
impl RefUnwindSafe for CommitLogSession
impl Send for CommitLogSession
impl Sync for CommitLogSession
impl Unpin for CommitLogSession
impl UnwindSafe for CommitLogSession
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> 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