(options: &TurnRecordOptions<'_>)
| 138 | } |
| 139 | |
| 140 | pub(super) fn manifest(options: &TurnRecordOptions<'_>) -> AgentResult<Option<FileManifest>> { |
| 141 | let raw = options |
| 142 | .event |
| 143 | .raw_json |
| 144 | .as_ref() |
| 145 | .and_then(|v| v.get("record_files")); |
| 146 | let fail = |reason| AgentError::RecordFailed { |
| 147 | session_id: options.session.session_id.clone(), |
| 148 | turn_number: options.turn_number, |
| 149 | reason, |
| 150 | }; |
| 151 | match raw { |
| 152 | Some(value) => serde_json::from_value(value.clone()) |
| 153 | .map(Some) |
| 154 | .map_err(|e| fail(format!("invalid record_files manifest: {e}"))), |
| 155 | None if options.session.explicit_record_files => Err(fail( |
| 156 | "explicit record_files manifest required; refusing to record shared working tree" |
| 157 | .into(), |
| 158 | )), |
| 159 | None => Ok(None), |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | pub(super) fn validate( |
| 164 | root: &Path, |
no test coverage detected