Complete admitted checkpoint continuity path
This commit is contained in:
parent
54e0dc07b6
commit
0763fcbe94
4 changed files with 18 additions and 10 deletions
|
|
@ -1856,7 +1856,6 @@ fn launch_reorient(
|
|||
epiphany_state_model::reorient_checkpoint_from_admitted_repo_model(
|
||||
projection.snapshot(),
|
||||
&projection.obligation().obligation_id,
|
||||
&projection.obligation().source_commit_id,
|
||||
)
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -318,7 +318,6 @@ fn run_native_status(args: &Args, include_auxiliary_status: bool) -> Result<Valu
|
|||
Some(epiphany_state_model::reorient_checkpoint_from_admitted_repo_model(
|
||||
projection.snapshot(),
|
||||
&projection.obligation().obligation_id,
|
||||
&projection.obligation().source_commit_id,
|
||||
))
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
use crate::coordinator_results::latest_runtime_link;
|
||||
use crate::coordinator_state::changed_fields;
|
||||
use crate::*;
|
||||
use anyhow::Context;
|
||||
use epiphany_state_model::EpiphanyThreadState;
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::path::Path;
|
||||
|
|
@ -73,11 +74,21 @@ pub fn accept_coordinator_reorient_finding(
|
|||
update_scratch: bool,
|
||||
update_investigation_checkpoint: bool,
|
||||
) -> anyhow::Result<EpiphanyNativeReorientAcceptance> {
|
||||
if update_investigation_checkpoint && state.investigation_checkpoint.is_none() {
|
||||
return Err(anyhow::anyhow!(
|
||||
"cannot update investigation checkpoint because state has no durable checkpoint"
|
||||
));
|
||||
}
|
||||
let investigation_checkpoint = if update_investigation_checkpoint {
|
||||
match state.investigation_checkpoint.clone() {
|
||||
Some(checkpoint) => Some(checkpoint),
|
||||
None => {
|
||||
let projection = crate::runtime_modeling_semantic_projection_input(store)
|
||||
.context("cannot accept reorientation without a valid admitted RepoModel checkpoint")?;
|
||||
Some(epiphany_state_model::reorient_checkpoint_from_admitted_repo_model(
|
||||
projection.snapshot(),
|
||||
&projection.obligation().obligation_id,
|
||||
))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let snapshot = read_reorient_result_snapshot(Some(state), Some(store), binding_id);
|
||||
if snapshot.status != EpiphanyCrrcResultStatus::Completed {
|
||||
return Err(anyhow::anyhow!(
|
||||
|
|
@ -97,7 +108,7 @@ pub fn accept_coordinator_reorient_finding(
|
|||
accepted_at.clone(),
|
||||
update_scratch,
|
||||
update_investigation_checkpoint,
|
||||
state.investigation_checkpoint.clone(),
|
||||
investigation_checkpoint,
|
||||
)
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
let contract = acceptance_launch_contract_for_binding(store, state, binding_id, "reorient")
|
||||
|
|
|
|||
|
|
@ -876,7 +876,6 @@ pub enum RepoModelPatchPurpose {
|
|||
pub fn reorient_checkpoint_from_admitted_repo_model(
|
||||
snapshot: &EpiphanyMemoryGraphSnapshot,
|
||||
obligation_id: &str,
|
||||
source_commit_id: &str,
|
||||
) -> EpiphanyInvestigationCheckpoint {
|
||||
EpiphanyInvestigationCheckpoint {
|
||||
checkpoint_id: obligation_id.to_string(),
|
||||
|
|
@ -904,7 +903,7 @@ pub fn reorient_checkpoint_from_admitted_repo_model(
|
|||
note: Some("Current admitted RepoModel frontier scope".to_string()),
|
||||
})
|
||||
.collect(),
|
||||
evidence_ids: vec![source_commit_id.to_string()],
|
||||
evidence_ids: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue