(
root: &Path,
files: &FileManifest,
options: &TurnRecordOptions<'_>,
)
| 133 | } |
| 134 | |
| 135 | pub(super) fn validate( |
| 136 | root: &Path, |
| 137 | files: &FileManifest, |
| 138 | options: &TurnRecordOptions<'_>, |
| 139 | ) -> AgentResult<()> { |
| 140 | for (path, expected) in files { |
| 141 | let actual = fingerprint(root, path).map_err(|reason| AgentError::RecordFailed { |
| 142 | session_id: options.session.session_id.clone(), |
| 143 | turn_number: options.turn_number, |
| 144 | reason, |
| 145 | })?; |
| 146 | if &actual != expected { |
| 147 | return Err(AgentError::RecordFailed { session_id: options.session.session_id.clone(), turn_number: options.turn_number, reason: format!("scoped file changed after this session's tool finished: {path}; refusing ambiguous ownership") }); |
| 148 | } |
| 149 | } |
| 150 | Ok(()) |
| 151 | } |
| 152 | |
| 153 | /// A duplicate Stop can be acknowledged only if its scoped files have no |
| 154 | /// unrecorded changes. Never use unrelated working-tree edits as evidence of |
no test coverage detected