pub struct CommitAttemptLog {
pub attempt_number: usize,
pub agent: String,
pub strategy: String,
pub timestamp: DateTime<Local>,
pub prompt_size_bytes: usize,
pub diff_size_bytes: usize,
pub diff_was_truncated: bool,
pub raw_output: Option<String>,
pub extraction_attempts: Vec<ExtractionAttempt>,
pub validation_checks: Vec<ValidationCheck>,
pub outcome: Option<AttemptOutcome>,
}Expand description
Per-attempt log for commit message generation.
Captures all details about a single attempt to generate a commit message, providing a complete audit trail for debugging.
Fields§
§attempt_number: usizeAttempt number within this session
agent: StringAgent being used (e.g., “claude”, “glm”)
strategy: StringRetry strategy (e.g., “initial”, “strict_json”)
timestamp: DateTime<Local>Timestamp when attempt started
prompt_size_bytes: usizeSize of the prompt in bytes
diff_size_bytes: usizeSize of the diff in bytes
diff_was_truncated: boolWhether the diff was pre-truncated
raw_output: Option<String>Raw output from the agent (truncated if very large)
extraction_attempts: Vec<ExtractionAttempt>Extraction attempts with their results
validation_checks: Vec<ValidationCheck>Validation checks that were run
outcome: Option<AttemptOutcome>Final outcome of this attempt
Implementations§
Source§impl CommitAttemptLog
impl CommitAttemptLog
Sourcepub fn new(attempt_number: usize, agent: &str, strategy: &str) -> Self
pub fn new(attempt_number: usize, agent: &str, strategy: &str) -> Self
Create a new attempt log.
Sourcepub const fn set_prompt_size(&mut self, size: usize)
pub const fn set_prompt_size(&mut self, size: usize)
Set the prompt size.
Sourcepub const fn set_diff_info(&mut self, size: usize, was_truncated: bool)
pub const fn set_diff_info(&mut self, size: usize, was_truncated: bool)
Set the diff information.
Sourcepub fn set_raw_output(&mut self, output: &str)
pub fn set_raw_output(&mut self, output: &str)
Set the raw output from the agent.
Truncates very large outputs to prevent log file bloat.
Sourcepub fn add_extraction_attempt(&mut self, attempt: ExtractionAttempt)
pub fn add_extraction_attempt(&mut self, attempt: ExtractionAttempt)
Record an extraction attempt.
Sourcepub fn set_outcome(&mut self, outcome: AttemptOutcome)
pub fn set_outcome(&mut self, outcome: AttemptOutcome)
Set the final outcome.
Sourcepub fn write_to_workspace(
&self,
log_dir: &Path,
workspace: &dyn Workspace,
) -> Result<PathBuf>
pub fn write_to_workspace( &self, log_dir: &Path, workspace: &dyn Workspace, ) -> Result<PathBuf>
Write this log to a file using workspace abstraction.
This is the architecture-conformant version that uses the workspace trait instead of direct filesystem access.
§Arguments
log_dir- Directory to write the log file to (relative to workspace)workspace- The workspace to use for filesystem operations
§Returns
Path to the written log file on success.
Trait Implementations§
Source§impl Clone for CommitAttemptLog
impl Clone for CommitAttemptLog
Source§fn clone(&self) -> CommitAttemptLog
fn clone(&self) -> CommitAttemptLog
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CommitAttemptLog
impl RefUnwindSafe for CommitAttemptLog
impl Send for CommitAttemptLog
impl Sync for CommitAttemptLog
impl Unpin for CommitAttemptLog
impl UnwindSafe for CommitAttemptLog
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> 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