(options: &TurnRecordOptions<'_>)
| 110 | } |
| 111 | |
| 112 | pub(super) fn manifest(options: &TurnRecordOptions<'_>) -> AgentResult<Option<FileManifest>> { |
| 113 | let raw = options |
| 114 | .event |
| 115 | .raw_json |
| 116 | .as_ref() |
| 117 | .and_then(|v| v.get("record_files")); |
| 118 | let fail = |reason| AgentError::RecordFailed { |
| 119 | session_id: options.session.session_id.clone(), |
| 120 | turn_number: options.turn_number, |
| 121 | reason, |
| 122 | }; |
| 123 | match raw { |
| 124 | Some(value) => serde_json::from_value(value.clone()) |
| 125 | .map(Some) |
| 126 | .map_err(|e| fail(format!("invalid record_files manifest: {e}"))), |
| 127 | None if options.session.explicit_record_files => Err(fail( |
| 128 | "explicit record_files manifest required; refusing to record shared working tree" |
| 129 | .into(), |
| 130 | )), |
| 131 | None => Ok(None), |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | pub(super) fn validate( |
| 136 | root: &Path, |
no test coverage detected