MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / load_first_refusal

Function load_first_refusal

atomic-cli/src/commands/agent/lifecycle.rs:901–916  ·  view source on GitHub ↗
(dir: &Path, run_id: &str)

Source from the content-addressed store, hash-verified

899}
900
901fn load_first_refusal(dir: &Path, run_id: &str) -> CliResult<Option<ManagedBoundaryRefusal>> {
902 validate_run_id(run_id)?;
903 let path = lifecycle_refusal_path(dir, run_id);
904 let data = match fs::read(&path) {
905 Ok(data) => data,
906 Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(None),
907 Err(error) => return Err(CliError::Io(error)),
908 };
909 serde_json::from_slice(&data).map(Some).map_err(|error| {
910 CliError::Internal(anyhow!(
911 "failed to parse managed lifecycle refusal '{}': {}",
912 path.display(),
913 error,
914 ))
915 })
916}
917
918fn persist_first_refusal(
919 dir: &Path,

Callers 3

list_lifecyclesFunction · 0.85
load_lifecycleFunction · 0.85
persist_first_refusalFunction · 0.85

Calls 4

validate_run_idFunction · 0.85
lifecycle_refusal_pathFunction · 0.85
readFunction · 0.70
kindMethod · 0.45

Tested by

no test coverage detected