Keep CRRC checkpoint view inside routed state model

This commit is contained in:
Meta Vens 2026-08-08 11:21:57 +01:00
commit 5dfdfad420
5 changed files with 23 additions and 25 deletions

View file

@ -338,10 +338,10 @@ fn run_native_status(args: &Args, include_auxiliary_status: bool) -> Result<Valu
})
.unwrap_or_default();
let reorient_checkpoint = investigation_checkpoint
.map(epiphany_core::EpiphanyReorientCheckpoint::from)
.map(epiphany_state_model::EpiphanyReorientCheckpoint::from)
.or_else(|| {
admitted_model_projection.as_ref().map(|projection| {
epiphany_core::EpiphanyReorientCheckpoint {
epiphany_state_model::EpiphanyReorientCheckpoint {
checkpoint_id: &projection.obligation().obligation_id,
disposition:
epiphany_state_model::EpiphanyInvestigationDisposition::ResumeReady,

View file

@ -1183,7 +1183,6 @@ pub use surfaces::EpiphanyPressureStatus;
pub use surfaces::EpiphanyReorientAcceptanceBundle;
pub use surfaces::EpiphanyReorientAcceptanceFinding;
pub use surfaces::EpiphanyReorientAction;
pub use surfaces::EpiphanyReorientCheckpoint;
pub use surfaces::EpiphanyReorientCheckpointStatus;
pub use surfaces::EpiphanyReorientDecision;
pub use surfaces::EpiphanyReorientFindingInterpretation;

View file

@ -82,7 +82,6 @@ pub use pressure::EpiphanyPressureStatus;
pub use pressure::EpiphanyTokenUsageSnapshot;
pub use pressure::derive_pressure_view;
pub use reorient::EpiphanyReorientAction;
pub use reorient::EpiphanyReorientCheckpoint;
pub use reorient::EpiphanyReorientCheckpointStatus;
pub use reorient::EpiphanyReorientDecision;
pub use reorient::EpiphanyReorientFreshnessStatus;

View file

@ -1,5 +1,5 @@
use epiphany_state_model::EpiphanyInvestigationCheckpoint;
use epiphany_state_model::EpiphanyInvestigationDisposition;
use epiphany_state_model::EpiphanyReorientCheckpoint;
use serde::Deserialize;
use serde::Serialize;
use std::collections::HashSet;
@ -80,25 +80,6 @@ pub struct EpiphanyReorientInput<'a> {
pub watched_root: Option<PathBuf>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct EpiphanyReorientCheckpoint<'a> {
pub checkpoint_id: &'a str,
pub disposition: EpiphanyInvestigationDisposition,
pub next_action: Option<&'a str>,
pub code_refs: &'a [epiphany_state_model::EpiphanyCodeRef],
}
impl<'a> From<&'a EpiphanyInvestigationCheckpoint> for EpiphanyReorientCheckpoint<'a> {
fn from(checkpoint: &'a EpiphanyInvestigationCheckpoint) -> Self {
Self {
checkpoint_id: &checkpoint.checkpoint_id,
disposition: checkpoint.disposition,
next_action: checkpoint.next_action.as_deref(),
code_refs: &checkpoint.code_refs,
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EpiphanyReorientDecision {
@ -410,7 +391,7 @@ fn epiphany_path_key(path: &Path) -> String {
#[cfg(test)]
mod tests {
use super::*;
use epiphany_state_model::EpiphanyCodeRef;
use epiphany_state_model::{EpiphanyCodeRef, EpiphanyInvestigationCheckpoint};
fn checkpoint() -> EpiphanyInvestigationCheckpoint {
EpiphanyInvestigationCheckpoint {

View file

@ -873,6 +873,25 @@ pub enum RepoModelPatchPurpose {
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct EpiphanyReorientCheckpoint<'a> {
pub checkpoint_id: &'a str,
pub disposition: EpiphanyInvestigationDisposition,
pub next_action: Option<&'a str>,
pub code_refs: &'a [EpiphanyCodeRef],
}
impl<'a> From<&'a EpiphanyInvestigationCheckpoint> for EpiphanyReorientCheckpoint<'a> {
fn from(checkpoint: &'a EpiphanyInvestigationCheckpoint) -> Self {
Self {
checkpoint_id: &checkpoint.checkpoint_id,
disposition: checkpoint.disposition,
next_action: checkpoint.next_action.as_deref(),
code_refs: &checkpoint.code_refs,
}
}
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, TS)]
#[serde(tag = "operation", rename_all = "snake_case")]
#[ts(tag = "operation", rename_all = "snake_case")]