mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-07 03:00:29 +00:00
refactor(workflows): move checkpoint, run_record, start_record, sandbox_record into records/
Consolidate all record types under the records module. Files are renamed to drop the _record suffix (run_record→run, start_record→start, sandbox_record→sandbox) since the module path provides that context. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
521db8c15d
commit
a60719c036
40 changed files with 75 additions and 71 deletions
|
|
@ -21,7 +21,7 @@ use fabro_agent::LocalSandbox;
|
|||
use crate::error::ApiError;
|
||||
use crate::jwt_auth::{AuthMode, AuthenticatedService, AuthenticatedUser};
|
||||
use fabro_interview::{Answer, Interviewer, QuestionType, WebInterviewer};
|
||||
use fabro_workflows::checkpoint::Checkpoint;
|
||||
use fabro_workflows::records::Checkpoint;
|
||||
use fabro_workflows::context::Context;
|
||||
use fabro_workflows::event::{EventEmitter, WorkflowRunEvent};
|
||||
use fabro_workflows::handler::HandlerRegistry;
|
||||
|
|
@ -503,7 +503,7 @@ async fn start_run(
|
|||
.into_response();
|
||||
}
|
||||
|
||||
let run_record = fabro_workflows::run_record::RunRecord {
|
||||
let run_record = fabro_workflows::records::RunRecord {
|
||||
run_id: run_id.clone(),
|
||||
created_at,
|
||||
config: fabro_config::config::FabroConfig {
|
||||
|
|
@ -640,7 +640,7 @@ async fn execute_run(state: Arc<AppState>, run_id: String) {
|
|||
}
|
||||
}
|
||||
|
||||
let run_record = match fabro_workflows::run_record::RunRecord::load(&run_dir) {
|
||||
let run_record = match fabro_workflows::records::RunRecord::load(&run_dir) {
|
||||
Ok(r) => r,
|
||||
Err(e) => {
|
||||
tracing::error!(run_id = %run_id, error = %e, "Failed to load RunRecord");
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ pub async fn attach_run(
|
|||
let mut engine_guard = engine_child.map(EngineChildGuard::new);
|
||||
|
||||
let is_tty = std::io::stderr().is_terminal();
|
||||
let verbose = fabro_workflows::run_record::RunRecord::load(run_dir)
|
||||
let verbose = fabro_workflows::records::RunRecord::load(run_dir)
|
||||
.map(|record| record.config.verbose_enabled())
|
||||
.unwrap_or(false);
|
||||
let mut progress_ui = run_progress::ProgressUI::new(is_tty, verbose);
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ async fn load_sandbox(
|
|||
let run_dir = fabro_workflows::run_lookup::resolve_run(base, run_prefix)?.path;
|
||||
let sandbox_json = run_dir.join("sandbox.json");
|
||||
debug!(path = %sandbox_json.display(), "Loading sandbox record");
|
||||
let record = fabro_workflows::sandbox_record::SandboxRecord::load(&sandbox_json).context(
|
||||
let record = fabro_workflows::records::SandboxRecord::load(&sandbox_json).context(
|
||||
"Failed to load sandbox.json — was this run started with a recent version of arc?",
|
||||
)?;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::path::PathBuf;
|
|||
|
||||
use chrono::Utc;
|
||||
use fabro_config::config::FabroConfig;
|
||||
use fabro_workflows::run_record::RunRecord;
|
||||
use fabro_workflows::records::RunRecord;
|
||||
use fabro_workflows::sandbox_provider::SandboxProvider;
|
||||
|
||||
use super::run::{
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ impl Drop for DetachedRunCompletionGuard {
|
|||
}
|
||||
|
||||
pub(crate) fn load_run_id(run_dir: &Path) -> Option<String> {
|
||||
fabro_workflows::run_record::RunRecord::load(run_dir)
|
||||
fabro_workflows::records::RunRecord::load(run_dir)
|
||||
.ok()
|
||||
.map(|record| record.run_id)
|
||||
.filter(|run_id| !run_id.trim().is_empty())
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ async fn resolve_diff(run_dir: &Path, args: &DiffArgs) -> Result<String> {
|
|||
});
|
||||
}
|
||||
|
||||
let start = fabro_workflows::start_record::StartRecord::load(run_dir)
|
||||
let start = fabro_workflows::records::StartRecord::load(run_dir)
|
||||
.context("Failed to load start.json")?;
|
||||
|
||||
let base_sha = start
|
||||
|
|
@ -71,7 +71,7 @@ async fn resolve_diff(run_dir: &Path, args: &DiffArgs) -> Result<String> {
|
|||
|
||||
debug!("No final.patch found; attempting live diff from sandbox");
|
||||
let sandbox_json = run_dir.join("sandbox.json");
|
||||
let record = fabro_workflows::sandbox_record::SandboxRecord::load(&sandbox_json).context(
|
||||
let record = fabro_workflows::records::SandboxRecord::load(&sandbox_json).context(
|
||||
"Failed to load sandbox.json — was this run started with a recent version of arc?",
|
||||
)?;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,21 +36,21 @@ fn inspect_run_dir(
|
|||
run_dir: &Path,
|
||||
status: fabro_workflows::run_status::RunStatus,
|
||||
) -> Result<InspectOutput> {
|
||||
let run_record = fabro_workflows::run_record::RunRecord::load(run_dir)
|
||||
let run_record = fabro_workflows::records::RunRecord::load(run_dir)
|
||||
.ok()
|
||||
.and_then(|v| serde_json::to_value(v).ok());
|
||||
let start_record = fabro_workflows::start_record::StartRecord::load(run_dir)
|
||||
let start_record = fabro_workflows::records::StartRecord::load(run_dir)
|
||||
.ok()
|
||||
.and_then(|v| serde_json::to_value(v).ok());
|
||||
let conclusion = fabro_workflows::records::Conclusion::load(&run_dir.join("conclusion.json"))
|
||||
.ok()
|
||||
.and_then(|v| serde_json::to_value(v).ok());
|
||||
let checkpoint =
|
||||
fabro_workflows::checkpoint::Checkpoint::load(&run_dir.join("checkpoint.json"))
|
||||
fabro_workflows::records::Checkpoint::load(&run_dir.join("checkpoint.json"))
|
||||
.ok()
|
||||
.and_then(|v| serde_json::to_value(v).ok());
|
||||
let sandbox =
|
||||
fabro_workflows::sandbox_record::SandboxRecord::load(&run_dir.join("sandbox.json"))
|
||||
fabro_workflows::records::SandboxRecord::load(&run_dir.join("sandbox.json"))
|
||||
.ok()
|
||||
.and_then(|v| serde_json::to_value(v).ok());
|
||||
|
||||
|
|
|
|||
|
|
@ -325,10 +325,10 @@ async fn create_from(
|
|||
) -> Result<()> {
|
||||
let run_dir = fabro_workflows::run_lookup::resolve_run(base, &args.run_id)?.path;
|
||||
|
||||
let record = fabro_workflows::run_record::RunRecord::load(&run_dir)
|
||||
let record = fabro_workflows::records::RunRecord::load(&run_dir)
|
||||
.context("Failed to load run.json")?;
|
||||
|
||||
let start = fabro_workflows::start_record::StartRecord::load(&run_dir)
|
||||
let start = fabro_workflows::records::StartRecord::load(&run_dir)
|
||||
.context("Failed to load start.json")?;
|
||||
|
||||
let conclusion = fabro_workflows::records::Conclusion::load(&run_dir.join("conclusion.json"))
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ pub async fn run(args: PreviewArgs) -> Result<()> {
|
|||
let base = fabro_workflows::run_lookup::default_runs_base();
|
||||
let run_dir = fabro_workflows::run_lookup::resolve_run(&base, &args.run)?.path;
|
||||
let sandbox_json = run_dir.join("sandbox.json");
|
||||
let record = fabro_workflows::sandbox_record::SandboxRecord::load(&sandbox_json).context(
|
||||
let record = fabro_workflows::records::SandboxRecord::load(&sandbox_json).context(
|
||||
"Failed to load sandbox.json — was this run started with a recent version of arc?",
|
||||
)?;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use fabro_config::config::FabroConfig;
|
|||
use fabro_interview::{AutoApproveInterviewer, ConsoleInterviewer, Interviewer};
|
||||
use fabro_model::{Catalog, Provider};
|
||||
use fabro_util::terminal::Styles;
|
||||
use fabro_workflows::checkpoint::Checkpoint;
|
||||
use fabro_workflows::records::Checkpoint;
|
||||
use fabro_workflows::event::{EventEmitter, RunNoticeLevel};
|
||||
use fabro_workflows::handler::llm::{AgentApiBackend, AgentCliBackend, BackendRouter};
|
||||
use fabro_workflows::operations::{
|
||||
|
|
@ -20,7 +20,7 @@ use fabro_workflows::outcome::StageStatus;
|
|||
use fabro_workflows::pipeline::{
|
||||
build_conclusion, classify_engine_result, persist_terminal_outcome,
|
||||
};
|
||||
use fabro_workflows::run_record::RunRecord;
|
||||
use fabro_workflows::records::RunRecord;
|
||||
use fabro_workflows::run_settings::{GitCheckpointSettings, LifecycleConfig, RunSettings};
|
||||
use fabro_workflows::sandbox_provider::SandboxProvider;
|
||||
|
||||
|
|
@ -254,7 +254,7 @@ async fn prepare_from_checkpoint(
|
|||
&graph,
|
||||
cli_flags,
|
||||
);
|
||||
let record = fabro_workflows::run_record::RunRecord {
|
||||
let record = fabro_workflows::records::RunRecord {
|
||||
run_id: run_id.clone(),
|
||||
created_at: chrono::Utc::now(),
|
||||
config: normalized.clone(),
|
||||
|
|
@ -649,7 +649,7 @@ async fn prepare_from_branch(
|
|||
&graph,
|
||||
cli_flags,
|
||||
);
|
||||
let record = fabro_workflows::run_record::RunRecord {
|
||||
let record = fabro_workflows::records::RunRecord {
|
||||
run_id: run_id.clone(),
|
||||
created_at: chrono::Utc::now(),
|
||||
config: normalized.clone(),
|
||||
|
|
@ -1032,7 +1032,7 @@ async fn run_resumed(
|
|||
};
|
||||
|
||||
let is_docker = provider == SandboxProvider::Docker;
|
||||
let record = fabro_workflows::sandbox_record::SandboxRecord {
|
||||
let record = fabro_workflows::records::SandboxRecord {
|
||||
provider: provider.to_string(),
|
||||
working_directory: working_directory.clone(),
|
||||
identifier: sandbox_info_opt,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use fabro_config::{project as project_config, run as run_config, sandbox as sand
|
|||
use fabro_interview::{AutoApproveInterviewer, ConsoleInterviewer, FileInterviewer, Interviewer};
|
||||
use fabro_model::{Catalog, FallbackTarget, Provider};
|
||||
use fabro_util::terminal::Styles;
|
||||
use fabro_workflows::checkpoint::Checkpoint;
|
||||
use fabro_workflows::records::Checkpoint;
|
||||
use fabro_workflows::cost::{compute_stage_cost, format_cost};
|
||||
use fabro_workflows::devcontainer_bridge;
|
||||
use fabro_workflows::event::{EventEmitter, RunNoticeLevel, WorkflowRunEvent};
|
||||
|
|
@ -761,7 +761,7 @@ struct RecordBasedRun {
|
|||
///
|
||||
/// Used by `run_engine_entrypoint` for detached runs that already have a RunRecord on disk.
|
||||
pub async fn run_from_record(
|
||||
record: fabro_workflows::run_record::RunRecord,
|
||||
record: fabro_workflows::records::RunRecord,
|
||||
run_dir: PathBuf,
|
||||
run_defaults: FabroConfig,
|
||||
styles: &'static Styles,
|
||||
|
|
@ -962,7 +962,7 @@ async fn run_command_impl(
|
|||
is_cached_run_restart(workflow_path, &run_dir)
|
||||
};
|
||||
let existing_record = if cached_run_restart {
|
||||
fabro_workflows::run_record::RunRecord::load(&run_dir).ok()
|
||||
fabro_workflows::records::RunRecord::load(&run_dir).ok()
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
|
@ -1004,7 +1004,7 @@ async fn run_command_impl(
|
|||
&graph,
|
||||
cli_flags,
|
||||
);
|
||||
let record = fabro_workflows::run_record::RunRecord {
|
||||
let record = fabro_workflows::records::RunRecord {
|
||||
run_id: run_id.clone(),
|
||||
created_at: chrono::Utc::now(),
|
||||
config: normalized_config.clone(),
|
||||
|
|
@ -1404,7 +1404,7 @@ async fn run_command_impl(
|
|||
});
|
||||
|
||||
let is_docker = provider == SandboxProvider::Docker;
|
||||
let record = fabro_workflows::sandbox_record::SandboxRecord {
|
||||
let record = fabro_workflows::records::SandboxRecord {
|
||||
provider: provider.to_string(),
|
||||
working_directory: working_directory.clone(),
|
||||
identifier: sandbox_info_opt,
|
||||
|
|
|
|||
|
|
@ -539,7 +539,7 @@ async fn remove_from(args: &RunsRemoveArgs, base: &Path) -> Result<()> {
|
|||
);
|
||||
|
||||
let sandbox_path = run.path.join("sandbox.json");
|
||||
if let Ok(record) = fabro_workflows::sandbox_record::SandboxRecord::load(&sandbox_path) {
|
||||
if let Ok(record) = fabro_workflows::records::SandboxRecord::load(&sandbox_path) {
|
||||
if record.provider != "local" {
|
||||
match fabro_workflows::sandbox_reconnect::reconnect(&record).await {
|
||||
Ok(sandbox) => {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ pub fn split_run_path(s: &str) -> Option<(&str, &str)> {
|
|||
}
|
||||
|
||||
pub fn validate_daytona_provider(
|
||||
record: &fabro_workflows::sandbox_record::SandboxRecord,
|
||||
record: &fabro_workflows::records::SandboxRecord,
|
||||
feature: &str,
|
||||
) -> Result<()> {
|
||||
if record.provider != "daytona" {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ pub async fn run(args: SshArgs) -> Result<()> {
|
|||
let base = fabro_workflows::run_lookup::default_runs_base();
|
||||
let run_dir = fabro_workflows::run_lookup::resolve_run(&base, &args.run)?.path;
|
||||
let sandbox_json = run_dir.join("sandbox.json");
|
||||
let record = fabro_workflows::sandbox_record::SandboxRecord::load(&sandbox_json).context(
|
||||
let record = fabro_workflows::records::SandboxRecord::load(&sandbox_json).context(
|
||||
"Failed to load sandbox.json — was this run started with a recent version of arc?",
|
||||
)?;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ pub fn start_run(run_dir: &Path) -> Result<std::process::Child> {
|
|||
}
|
||||
|
||||
// Validate run.json is loadable
|
||||
fabro_workflows::run_record::RunRecord::load(run_dir)
|
||||
fabro_workflows::records::RunRecord::load(run_dir)
|
||||
.map_err(|e| anyhow::anyhow!("Cannot start run: failed to load run.json: {e}"))?;
|
||||
|
||||
// Write Starting status before spawning to prevent duplicate engines
|
||||
|
|
@ -105,7 +105,7 @@ mod tests {
|
|||
use chrono::Utc;
|
||||
use fabro_config::config::FabroConfig;
|
||||
use fabro_graphviz::graph::Graph;
|
||||
use fabro_workflows::run_record::RunRecord;
|
||||
use fabro_workflows::records::RunRecord;
|
||||
use fabro_workflows::run_status::{write_run_status, RunStatus, RunStatusRecord, StatusReason};
|
||||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ async fn run_engine_entrypoint(
|
|||
cli_config.git_author().and_then(|a| a.email.clone()),
|
||||
);
|
||||
|
||||
let record = match fabro_workflows::run_record::RunRecord::load(&run_dir) {
|
||||
let record = match fabro_workflows::records::RunRecord::load(&run_dir) {
|
||||
Ok(record) => record,
|
||||
Err(err) => {
|
||||
let anyhow_err: anyhow::Error = anyhow::anyhow!("Failed to load run record: {err}");
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use fabro_git_storage::branchstore::BranchStore;
|
|||
use fabro_git_storage::gitobj::Store;
|
||||
use git2::{Repository, Signature};
|
||||
|
||||
use crate::checkpoint::Checkpoint;
|
||||
use crate::records::Checkpoint;
|
||||
use crate::error::{FabroError, Result};
|
||||
|
||||
/// Branch prefix for workflow run branches (e.g. `fabro/run/{run_id}`).
|
||||
|
|
@ -485,10 +485,10 @@ impl MetadataStore {
|
|||
pub fn read_run_record(
|
||||
repo_path: &Path,
|
||||
run_id: &str,
|
||||
) -> Result<Option<crate::run_record::RunRecord>> {
|
||||
) -> Result<Option<crate::records::RunRecord>> {
|
||||
match Self::read_file(repo_path, run_id, "run.json")? {
|
||||
Some(bytes) => {
|
||||
let record: crate::run_record::RunRecord = serde_json::from_slice(&bytes)
|
||||
let record: crate::records::RunRecord = serde_json::from_slice(&bytes)
|
||||
.map_err(|e| git_error(format!("run record deserialize failed: {e}")))?;
|
||||
Ok(Some(record))
|
||||
}
|
||||
|
|
@ -500,10 +500,10 @@ impl MetadataStore {
|
|||
pub fn read_start_record(
|
||||
repo_path: &Path,
|
||||
run_id: &str,
|
||||
) -> Result<Option<crate::start_record::StartRecord>> {
|
||||
) -> Result<Option<crate::records::StartRecord>> {
|
||||
match Self::read_file(repo_path, run_id, "start.json")? {
|
||||
Some(bytes) => {
|
||||
let record: crate::start_record::StartRecord = serde_json::from_slice(&bytes)
|
||||
let record: crate::records::StartRecord = serde_json::from_slice(&bytes)
|
||||
.map_err(|e| git_error(format!("start record deserialize failed: {e}")))?;
|
||||
Ok(Some(record))
|
||||
}
|
||||
|
|
@ -634,7 +634,7 @@ mod tests {
|
|||
|
||||
let ctx = crate::context::Context::new();
|
||||
ctx.set("goal", serde_json::json!("test"));
|
||||
let cp = crate::checkpoint::Checkpoint::from_context(
|
||||
let cp = crate::records::Checkpoint::from_context(
|
||||
&ctx,
|
||||
"node_a",
|
||||
vec!["start".to_string()],
|
||||
|
|
@ -669,7 +669,7 @@ mod tests {
|
|||
store.init_run("RUN3", &[]).unwrap();
|
||||
|
||||
let ctx = crate::context::Context::new();
|
||||
let cp1 = crate::checkpoint::Checkpoint::from_context(
|
||||
let cp1 = crate::records::Checkpoint::from_context(
|
||||
&ctx,
|
||||
"node_a",
|
||||
vec!["start".to_string()],
|
||||
|
|
@ -683,7 +683,7 @@ mod tests {
|
|||
let cp1_json = serde_json::to_vec_pretty(&cp1).unwrap();
|
||||
store.write_checkpoint("RUN3", &cp1_json, &[]).unwrap();
|
||||
|
||||
let cp2 = crate::checkpoint::Checkpoint::from_context(
|
||||
let cp2 = crate::records::Checkpoint::from_context(
|
||||
&ctx,
|
||||
"node_b",
|
||||
vec!["start".to_string(), "node_a".to_string()],
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ pub(crate) fn load_json<T: serde::de::DeserializeOwned>(
|
|||
/// Build `Vec<CompletedStage>` from a `Checkpoint`, mapping workflow-engine
|
||||
/// types into the flat struct expected by `fabro_retro::retro::derive_retro`.
|
||||
pub fn build_completed_stages(
|
||||
cp: &checkpoint::Checkpoint,
|
||||
cp: &records::Checkpoint,
|
||||
run_failed: bool,
|
||||
) -> Vec<fabro_retro::retro::CompletedStage> {
|
||||
use outcome::{OutcomeExt, StageStatus};
|
||||
|
|
@ -91,7 +91,6 @@ pub fn build_completed_stages(
|
|||
pub mod artifact;
|
||||
pub mod asset_snapshot;
|
||||
pub mod assets;
|
||||
pub mod checkpoint;
|
||||
pub mod condition;
|
||||
pub mod context;
|
||||
pub mod cost;
|
||||
|
|
@ -111,14 +110,11 @@ pub mod pull_request;
|
|||
pub mod records;
|
||||
pub mod run_dir;
|
||||
pub mod run_lookup;
|
||||
pub mod run_record;
|
||||
pub mod run_settings;
|
||||
pub mod run_status;
|
||||
pub mod sandbox_git;
|
||||
pub mod sandbox_provider;
|
||||
pub mod sandbox_reconnect;
|
||||
pub mod sandbox_record;
|
||||
pub mod start_record;
|
||||
#[doc(hidden)]
|
||||
pub mod test_support;
|
||||
pub mod transforms;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use fabro_core::outcome::NodeResult;
|
|||
use fabro_core::state::RunState;
|
||||
|
||||
use super::circuit_breaker::CircuitBreakerLifecycle;
|
||||
use crate::checkpoint::Checkpoint;
|
||||
use crate::records::Checkpoint;
|
||||
use crate::event::{EventEmitter, RunNoticeLevel, WorkflowRunEvent};
|
||||
use crate::graph::WorkflowGraph;
|
||||
use crate::graph::WorkflowNode;
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ impl RunLifecycle<WorkflowGraph> for GitLifecycle {
|
|||
|
||||
// Re-save checkpoint.json with SHA
|
||||
let checkpoint_path = self.run_dir.join("checkpoint.json");
|
||||
if let Ok(mut cp) = crate::checkpoint::Checkpoint::load(&checkpoint_path) {
|
||||
if let Ok(mut cp) = crate::records::Checkpoint::load(&checkpoint_path) {
|
||||
cp.git_commit_sha = Some(sha.clone());
|
||||
if let Err(e) = cp.save(&checkpoint_path) {
|
||||
self.emitter.emit(&WorkflowRunEvent::RunNotice {
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ use fabro_git_storage::gitobj::Store;
|
|||
use git2::{Oid, Signature};
|
||||
|
||||
use crate::git::MetadataStore;
|
||||
use crate::run_record::RunRecord;
|
||||
use crate::start_record::StartRecord;
|
||||
use crate::records::RunRecord;
|
||||
use crate::records::StartRecord;
|
||||
|
||||
use super::rewind::TimelineEntry;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use fabro_git_storage::branchstore::{BranchStore, CommitInfo};
|
|||
use fabro_git_storage::gitobj::Store;
|
||||
use git2::{Oid, Repository, Signature};
|
||||
|
||||
use crate::checkpoint::Checkpoint;
|
||||
use crate::records::Checkpoint;
|
||||
use crate::git::MetadataStore;
|
||||
use fabro_graphviz::graph::Graph;
|
||||
|
||||
|
|
@ -322,7 +322,7 @@ pub fn load_parallel_map(store: &Store, run_id: &str) -> HashMap<String, String>
|
|||
let bs = BranchStore::new(store, &branch, &sig);
|
||||
|
||||
if let Ok(Some(run_bytes)) = bs.read_entry("run.json") {
|
||||
if let Ok(record) = serde_json::from_slice::<crate::run_record::RunRecord>(&run_bytes) {
|
||||
if let Ok(record) = serde_json::from_slice::<crate::records::RunRecord>(&run_bytes) {
|
||||
return detect_parallel_interior(&record.graph);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use crate::sandbox_git::GitState;
|
|||
|
||||
use super::types::{Executed, Initialized};
|
||||
|
||||
fn seed_context_from_checkpoint(checkpoint: Option<&crate::checkpoint::Checkpoint>) -> Context {
|
||||
fn seed_context_from_checkpoint(checkpoint: Option<&crate::records::Checkpoint>) -> Context {
|
||||
let context = Context::new();
|
||||
if let Some(cp) = checkpoint {
|
||||
for (k, v) in &cp.context_values {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use fabro_hooks::HookConfig;
|
|||
use fabro_interview::AutoApproveInterviewer;
|
||||
|
||||
use super::*;
|
||||
use crate::checkpoint::Checkpoint;
|
||||
use crate::records::Checkpoint;
|
||||
use crate::context::{self, Context};
|
||||
use crate::error::FabroError;
|
||||
use crate::event::{EventEmitter, WorkflowRunEvent};
|
||||
|
|
@ -497,7 +497,7 @@ async fn execute_writes_start_json_and_node_status() {
|
|||
.await
|
||||
.unwrap();
|
||||
|
||||
let start = crate::start_record::StartRecord::load(dir.path()).unwrap();
|
||||
let start = crate::records::StartRecord::load(dir.path()).unwrap();
|
||||
assert_eq!(start.run_id, "test-run");
|
||||
assert_eq!(start.run_branch.as_deref(), Some("fabro/run/test-run"));
|
||||
assert_eq!(start.base_sha.as_deref(), Some("abc123"));
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::checkpoint::Checkpoint;
|
||||
use crate::records::Checkpoint;
|
||||
use crate::error::FabroError;
|
||||
use crate::event::{EventEmitter, RunNoticeLevel, WorkflowRunEvent};
|
||||
use crate::outcome::{Outcome, OutcomeExt, StageStatus};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use std::sync::Arc;
|
|||
use fabro_agent::SessionEvent;
|
||||
use fabro_retro::retro::Retro;
|
||||
|
||||
use crate::checkpoint::Checkpoint;
|
||||
use crate::records::Checkpoint;
|
||||
use crate::event::WorkflowRunEvent;
|
||||
|
||||
use super::types::{Executed, RetroOptions, Retroed};
|
||||
|
|
@ -151,7 +151,7 @@ mod tests {
|
|||
use fabro_graphviz::graph::Graph;
|
||||
|
||||
use super::*;
|
||||
use crate::checkpoint::Checkpoint;
|
||||
use crate::records::Checkpoint;
|
||||
use crate::context::Context;
|
||||
use crate::event::{EventEmitter, WorkflowRunEvent};
|
||||
use crate::pipeline::types::Executed;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use fabro_graphviz::graph::Graph;
|
|||
use fabro_hooks::HookRunner;
|
||||
use fabro_validate::Diagnostic;
|
||||
|
||||
use crate::checkpoint::Checkpoint;
|
||||
use crate::records::Checkpoint;
|
||||
use crate::context::Context;
|
||||
use crate::error::FabroError;
|
||||
use crate::event::EventEmitter;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use tracing::{debug, info};
|
|||
use fabro_github::{self as github_app, ssh_url_to_https, GitHubAppCredentials};
|
||||
|
||||
use crate::records::Conclusion;
|
||||
use crate::run_record::RunRecord;
|
||||
use crate::records::RunRecord;
|
||||
use fabro_retro::retro::Retro;
|
||||
|
||||
/// Record of a pull request created for a workflow run.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,11 @@
|
|||
mod checkpoint;
|
||||
mod conclusion;
|
||||
mod run;
|
||||
mod sandbox;
|
||||
mod start;
|
||||
|
||||
pub use checkpoint::Checkpoint;
|
||||
pub use conclusion::{Conclusion, StageSummary};
|
||||
pub use run::RunRecord;
|
||||
pub use sandbox::SandboxRecord;
|
||||
pub use start::StartRecord;
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ use crate::run_settings::RunSettings;
|
|||
pub(crate) fn write_start_record(
|
||||
run_dir: &Path,
|
||||
settings: &RunSettings,
|
||||
) -> crate::start_record::StartRecord {
|
||||
) -> crate::records::StartRecord {
|
||||
let git_state = settings.git.as_ref();
|
||||
let record = crate::start_record::StartRecord {
|
||||
let record = crate::records::StartRecord {
|
||||
run_id: settings.run_id.clone(),
|
||||
start_time: Utc::now(),
|
||||
run_branch: git_state.and_then(|g| g.run_branch.clone()),
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ use anyhow::{bail, Context, Result};
|
|||
use chrono::{DateTime, Utc};
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::run_record::RunRecord;
|
||||
use crate::records::RunRecord;
|
||||
use crate::run_status::{RunStatus, RunStatusRecord, StatusReason};
|
||||
use crate::start_record::StartRecord;
|
||||
use crate::records::StartRecord;
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct RunInfo {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::path::PathBuf;
|
|||
|
||||
use anyhow::{bail, Context, Result};
|
||||
|
||||
use crate::sandbox_record::SandboxRecord;
|
||||
use crate::records::SandboxRecord;
|
||||
|
||||
/// Reconnect to a sandbox from a saved record.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use std::sync::Arc;
|
|||
|
||||
use fabro_agent::Sandbox;
|
||||
|
||||
use crate::checkpoint::Checkpoint;
|
||||
use crate::records::Checkpoint;
|
||||
use crate::error::Result;
|
||||
use crate::event::EventEmitter;
|
||||
use crate::handler::HandlerRegistry;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
//! Run Docker tests with: `cargo test --package arc-workflows --test cp_integration -- --ignored`
|
||||
|
||||
use fabro_workflows::sandbox_reconnect::reconnect;
|
||||
use fabro_workflows::sandbox_record::SandboxRecord;
|
||||
use fabro_workflows::records::SandboxRecord;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Local sandbox
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ use fabro_graphviz::graph::{AttrValue, Edge, Graph, Node};
|
|||
use fabro_llm::provider::Provider;
|
||||
use fabro_sandbox::daytona::{DaytonaConfig, DaytonaSandbox, DaytonaSnapshotConfig};
|
||||
use fabro_workflows::artifact::sync_artifacts_to_env;
|
||||
use fabro_workflows::checkpoint::Checkpoint;
|
||||
use fabro_workflows::records::Checkpoint;
|
||||
use fabro_workflows::context::Context;
|
||||
use fabro_workflows::error::FabroError;
|
||||
use fabro_workflows::event::EventEmitter;
|
||||
|
|
@ -1741,7 +1741,7 @@ async fn daytona_toolbox_idle_diagnostic() {
|
|||
#[ignore]
|
||||
async fn daytona_cp_upload_download_round_trip() {
|
||||
use fabro_workflows::sandbox_reconnect::reconnect;
|
||||
use fabro_workflows::sandbox_record::SandboxRecord;
|
||||
use fabro_workflows::records::SandboxRecord;
|
||||
|
||||
// 1. Create and initialize a real Daytona sandbox
|
||||
let env = create_env().await;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use fabro_interview::{
|
|||
};
|
||||
use fabro_llm::provider::Provider;
|
||||
use fabro_validate::{validate, validate_or_raise, Severity};
|
||||
use fabro_workflows::checkpoint::Checkpoint;
|
||||
use fabro_workflows::records::Checkpoint;
|
||||
use fabro_workflows::context::Context;
|
||||
use fabro_workflows::error::FabroError;
|
||||
use fabro_workflows::event::{EventEmitter, WorkflowRunEvent};
|
||||
|
|
@ -5967,7 +5967,7 @@ mod real_llm {
|
|||
use super::local_env;
|
||||
use fabro_graphviz::graph::{AttrValue, Edge, Graph};
|
||||
use fabro_interview::AutoApproveInterviewer;
|
||||
use fabro_workflows::checkpoint::Checkpoint;
|
||||
use fabro_workflows::records::Checkpoint;
|
||||
use fabro_workflows::event::EventEmitter;
|
||||
use fabro_workflows::handler::exit::ExitHandler;
|
||||
use fabro_workflows::handler::human::HumanHandler;
|
||||
|
|
@ -8716,7 +8716,7 @@ async fn large_context_values_are_offloaded_to_artifact_store() {
|
|||
|
||||
// The checkpoint context should contain an artifact pointer, not the full value
|
||||
let checkpoint =
|
||||
fabro_workflows::checkpoint::Checkpoint::load(&dir.path().join("checkpoint.json"))
|
||||
fabro_workflows::records::Checkpoint::load(&dir.path().join("checkpoint.json"))
|
||||
.expect("checkpoint should load");
|
||||
let pointer_value = checkpoint
|
||||
.context_values
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue