MCPcopy Create free account
hub / github.com/AI45Lab/Code / sample_workflow_checkpoint

Function sample_workflow_checkpoint

core/src/store/tests.rs:815–842  ·  view source on GitHub ↗
(wf_id: &str)

Source from the content-addressed store, hash-verified

813}
814
815fn sample_workflow_checkpoint(wf_id: &str) -> crate::orchestration::WorkflowCheckpoint {
816 use crate::orchestration::{
817 StepOutcome, WorkflowCheckpoint, WorkflowStepRecord, WORKFLOW_CHECKPOINT_SCHEMA_VERSION,
818 };
819 let outcome = |id: &str, structured| StepOutcome {
820 task_id: id.to_string(),
821 session_id: format!("task-run-{id}"),
822 agent: "explore".to_string(),
823 output: format!("out-{id}"),
824 success: true,
825 structured,
826 };
827 WorkflowCheckpoint {
828 schema_version: WORKFLOW_CHECKPOINT_SCHEMA_VERSION,
829 workflow_id: wf_id.to_string(),
830 steps: vec![
831 WorkflowStepRecord {
832 task_id: "a".into(),
833 outcome: outcome("a", None),
834 },
835 WorkflowStepRecord {
836 task_id: "b".into(),
837 outcome: outcome("b", Some(serde_json::json!({ "k": 1 }))),
838 },
839 ],
840 checkpoint_ms: 1_700_000_000_000,
841 }
842}
843
844#[tokio::test]
845async fn test_file_store_workflow_checkpoint_roundtrip() {

Calls

no outgoing calls

Tested by

no test coverage detected