Update run creation event fixtures and docs

This commit is contained in:
Scott Werner 2026-08-03 15:09:32 -04:00
parent cff0a2461a
commit 4194ff4a26
29 changed files with 14 additions and 119 deletions

View file

@ -44,7 +44,6 @@ Emitted when the run record is created.
"event": "run.created",
"properties": {
"workflow_slug": "my-workflow",
"run_dir": "/home/user/.fabro/storage/scratch/20260428-01JQXYZ",
"source_directory": "/home/user/src/my-project",
"repo_origin_url": "https://github.com/acme/my-project.git",
"base_branch": "main",
@ -79,20 +78,21 @@ Emitted when the run record is created.
| `settings` | object | Workflow settings snapshot |
| `graph` | object | Parsed workflow graph |
| `workflow_source` | string? | Workflow source text |
| `workflow_config` | string? | Workflow config text |
| `labels` | object | Run labels |
| `run_dir` | string | Local scratch directory for the run |
| `source_directory` | string? | Submitter-side source directory |
| `repo_origin_url` | string? | Normalized repository origin URL used by clone-based sandboxes |
| `base_branch` | string? | Submitter-side base branch |
| `workflow_slug` | string? | Workflow slug |
| `db_prefix` | string? | Store prefix used for the run |
| `provenance` | object | Actor and request provenance |
| `manifest_blob` | string? | Blob id for the submitted manifest |
| `pre_run_git` | object? | Submitter-side pre-run git context and push outcome |
| `fork_source_ref` | object? | Source run/checkpoint reference when this run was forked |
| `in_place` | boolean | Whether the run was created with `--in-place` (no git checkpoints) |
Readers remain tolerant of the legacy `workflow_config`, `run_dir`, and
`db_prefix` properties when replaying historical events, but newly emitted
`run.created` events omit them.
### `run.started`
Emitted when the workflow run begins.

View file

@ -916,7 +916,6 @@ fn attach_json_errors_without_prompting_for_human_input() {
"login": "dev"
}
},
"run_dir": "[RUN_DIR]",
"settings": {
"project": {
"description": null,

View file

@ -115,11 +115,6 @@ fn events_completed_run_reads_store_without_progress_jsonl() {
r#""id":"[0-9a-f-]+""#.to_string(),
r#""id":"[EVENT_ID]""#.to_string(),
));
filters.push((
r#""run_dir":"(?:\[DRY_RUN_DIR\]|\[STORAGE_DIR\]/scratch/REDACTED)""#.to_string(),
r#""run_dir":"[RUN_DIR]""#.to_string(),
));
let mut cmd = context.command();
cmd.args(["events", "--tail", "2", &run.run_id]);
@ -146,10 +141,6 @@ fn events_tail_limits_output() {
r#""id":"[0-9a-f-]+""#.to_string(),
r#""id":"[EVENT_ID]""#.to_string(),
));
filters.push((
r#""run_dir":"(?:\[DRY_RUN_DIR\]|\[STORAGE_DIR\]/scratch/REDACTED)""#.to_string(),
r#""run_dir":"[RUN_DIR]""#.to_string(),
));
let mut cmd = context.command();
cmd.args(["events", "--tail", "2", &run.run_id]);

View file

@ -2069,7 +2069,6 @@ async fn mcp_events_decodes_run_created_with_model_keyed_fallbacks() {
"settings": settings,
"graph": Graph::new("Remote Workflow"),
"labels": {},
"run_dir": "/tmp/run",
"source_directory": "/srv/repo",
"provenance": test_support::test_run_provenance()
},

View file

@ -621,13 +621,10 @@ mod stage_events_tests {
settings: serde_json::to_value(WorkflowSettings::default()).unwrap(),
graph: serde_json::to_value(Graph::new("test")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::new(),
run_dir: "/tmp/test".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -1021,13 +1021,10 @@ mod tests {
settings: serde_json::to_value(WorkflowSettings::default()).unwrap(),
graph: serde_json::to_value(Graph::new("test")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::new(),
run_dir: "/tmp/test".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -1365,7 +1365,6 @@ mod retrieve_sandbox_tests {
"properties": {
"settings": WorkflowSettings::default(),
"graph": Graph::new("test"),
"run_dir": "/tmp/test",
"provenance": test_support::test_run_provenance(),
},
}),

View file

@ -4569,13 +4569,10 @@ async fn append_default_run_created(run_store: &fabro_store::RunDatabase, run_id
settings: serde_json::to_value(WorkflowSettings::default()).unwrap(),
graph: serde_json::to_value(Graph::new("test")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: "/tmp".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,
@ -4623,13 +4620,10 @@ async fn create_slack_notification_run(
settings: serde_json::to_value(settings).unwrap(),
graph: serde_json::to_value(Graph::new(graph_name)).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: "/tmp".to_string(),
source_directory: None,
workflow_slug: workflow_slug.map(str::to_string),
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,
@ -5699,13 +5693,10 @@ async fn list_run_stages_distinguishes_visits() {
settings: serde_json::to_value(fabro_types::WorkflowSettings::default()).unwrap(),
graph: serde_json::to_value(&graph).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: String::new(),
source_directory: None,
workflow_slug: Some("test".to_string()),
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,
@ -5838,13 +5829,10 @@ async fn list_run_stages_exposes_execution_identity_for_resumed_stage() {
settings: serde_json::to_value(fabro_types::WorkflowSettings::default()).unwrap(),
graph: serde_json::to_value(&graph).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: String::new(),
source_directory: None,
workflow_slug: Some("test".to_string()),
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,
@ -7045,13 +7033,10 @@ async fn create_completed_run_ready_for_pull_request(
settings: serde_json::to_value(&run_spec.settings).unwrap(),
graph: serde_json::to_value(&run_spec.graph).unwrap(),
workflow_source: None,
workflow_config: None,
labels: run_spec.labels.clone().into_iter().collect(),
run_dir: run_spec.source_directory.clone().unwrap_or_default(),
source_directory: run_spec.source_directory.clone(),
workflow_slug: run_spec.workflow_slug.clone(),
automation: None,
db_prefix: None,
provenance: run_spec.provenance.clone(),
manifest_blob: None,
git,
@ -10599,9 +10584,12 @@ async fn create_run_persists_manifest_and_definition_blobs_without_bundle_file()
assert_eq!(accepted_definition["workflow_path"], "workflow.fabro");
assert!(accepted_definition["workflows"]["workflow.fabro"].is_object());
created["properties"]["run_dir"]
.as_str()
.expect("run.created should include run_dir");
for removed in ["workflow_config", "run_dir", "db_prefix"] {
assert!(
created["properties"].get(removed).is_none(),
"new run.created events must omit {removed}"
);
}
}
#[tokio::test]
@ -13869,13 +13857,10 @@ async fn create_preserved_local_sandbox_run(state: &Arc<AppState>, run_id: RunId
settings: serde_json::to_value(settings).unwrap(),
graph: serde_json::to_value(graph).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: "/tmp/fabro-run".to_string(),
source_directory: Some("/tmp/fabro-run".to_string()),
workflow_slug: Some("test".to_string()),
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,
@ -14621,13 +14606,10 @@ async fn delete_run_retry_after_missing_provider_resource_removes_metadata() {
settings: serde_json::to_value(fabro_types::WorkflowSettings::default()).unwrap(),
graph: serde_json::to_value(graph).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: "/tmp/fabro-run".to_string(),
source_directory: Some("/tmp/fabro-run".to_string()),
workflow_slug: Some("test".to_string()),
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -62,13 +62,10 @@ async fn append_completed_run_with_final_patch(
.expect("workflow settings should serialize"),
graph: serde_json::to_value(Graph::new("test")).expect("graph should serialize"),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: "/tmp".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -648,7 +648,6 @@ mod tests {
"graph": run_spec.graph,
"workflow_slug": run_spec.workflow_slug,
"source_directory": run_spec.source_directory,
"run_dir": format!("/tmp/{label}"),
"git": run_spec.git,
"labels": run_spec.labels,
"provenance": run_spec.provenance,
@ -674,7 +673,6 @@ mod tests {
"graph": run_spec.graph,
"workflow_slug": run_spec.workflow_slug,
"source_directory": run_spec.source_directory,
"run_dir": format!("/tmp/{label}"),
"git": run_spec.git,
"labels": run_spec.labels,
"parent_id": parent_id,
@ -1041,7 +1039,6 @@ mod tests {
"properties": {
"settings": WorkflowSettings::default(),
"graph": Graph::new("test"),
"run_dir": "/tmp/test",
"provenance": test_support::test_run_provenance(),
},
}),
@ -1590,7 +1587,6 @@ mod tests {
"graph": run_spec["graph"],
"workflow_slug": run_spec["workflow_slug"],
"source_directory": run_spec["source_directory"],
"run_dir": "/tmp/run-2",
"git": run_spec["git"],
"labels": run_spec["labels"],
},

View file

@ -987,7 +987,6 @@ mod tests {
"properties": {
"settings": WorkflowSettings::default(),
"graph": Graph::new("test"),
"run_dir": "/tmp/test",
"provenance": test_support::test_run_provenance(),
},
}),

View file

@ -284,13 +284,10 @@ mod tests {
settings: serde_json::to_value(WorkflowSettings::default()).unwrap(),
graph: serde_json::to_value(Graph::new("test")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::new(),
run_dir: "/tmp/test".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -358,13 +358,10 @@ mod tests {
.unwrap(),
graph: serde_json::to_value(fabro_types::Graph::new("test")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: "/tmp".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -495,13 +495,10 @@ mod tests {
.unwrap(),
graph: serde_json::to_value(fabro_types::Graph::new("test")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: "/tmp".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -465,13 +465,10 @@ mod tests {
settings: serde_json::to_value(WorkflowSettings::default()).unwrap(),
graph: serde_json::to_value(Graph::new("test")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: "/tmp".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -950,13 +950,10 @@ mod tests {
.unwrap(),
graph: serde_json::to_value(fabro_types::Graph::new("test")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: BTreeMap::default(),
run_dir: "/tmp".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -273,13 +273,10 @@ mod tests {
.unwrap(),
graph: serde_json::to_value(fabro_types::Graph::new("test")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: "/tmp".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -744,13 +744,10 @@ mod tests {
settings: serde_json::to_value(WorkflowSettings::default()).unwrap(),
graph: serde_json::to_value(fabro_types::Graph::new("metadata")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: BTreeMap::new(),
run_dir: "/tmp/run".to_string(),
source_directory: Some("/tmp/project".to_string()),
workflow_slug: Some("metadata".to_string()),
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -221,13 +221,10 @@ mod tests {
.unwrap(),
graph: serde_json::to_value(fabro_types::Graph::new("test")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::default(),
run_dir: "/tmp".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -213,13 +213,10 @@ async fn seed_created_and_starting(
settings: serde_json::to_value(&run_options.settings).unwrap(),
graph: serde_json::to_value(graph).unwrap(),
workflow_source: None,
workflow_config: None,
labels: run_options.labels.clone().into_iter().collect(),
run_dir: run_options.run_dir.display().to_string(),
source_directory: Some(std::env::current_dir().unwrap().display().to_string()),
workflow_slug: run_options.workflow_slug.clone(),
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: run_options.pre_run_git.clone(),

View file

@ -782,13 +782,10 @@ mod tests {
settings: serde_json::to_value(WorkflowSettings::default()).unwrap(),
graph: serde_json::to_value(fabro_types::Graph::new("metadata")).unwrap(),
workflow_source: None,
workflow_config: None,
labels: std::collections::BTreeMap::new(),
run_dir: "/tmp/run".to_string(),
source_directory: Some("/tmp/project".to_string()),
workflow_slug: Some("metadata".to_string()),
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -1048,13 +1048,10 @@ mod tests {
settings: serde_json::to_value(&run_options.settings).unwrap(),
graph: serde_json::to_value(&graph).unwrap(),
workflow_source: None,
workflow_config: None,
labels: BTreeMap::new(),
run_dir: run_dir.display().to_string(),
source_directory: Some(workspace.display().to_string()),
workflow_slug: Some("test".to_string()),
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -155,7 +155,7 @@ mod tests {
}
}
async fn seeded_store(run_dir: &Path, record: &RunSpec, source: Option<&str>) -> RunDatabase {
async fn seeded_store(record: &RunSpec, source: Option<&str>) -> RunDatabase {
let store = memory_store();
let run_store = store.create_run(&record.run_id).await.unwrap();
append_event(&run_store, &record.run_id, &Event::RunCreated {
@ -164,13 +164,10 @@ mod tests {
settings: serde_json::to_value(&record.settings).unwrap(),
graph: serde_json::to_value(&record.graph).unwrap(),
workflow_source: source.map(ToOwned::to_owned),
workflow_config: None,
labels: record.labels.clone().into_iter().collect(),
run_dir: run_dir.to_string_lossy().to_string(),
source_directory: record.source_directory.clone(),
workflow_slug: record.workflow_slug.clone(),
automation: record.automation.clone(),
db_prefix: None,
provenance: record.provenance.clone(),
manifest_blob: None,
git: record.git.clone(),
@ -250,7 +247,7 @@ mod tests {
)
.unwrap();
let run_store = seeded_store(&run_dir, &expected, Some(&source)).await;
let run_store = seeded_store(&expected, Some(&source)).await;
let loaded = load_from_store(&run_store.clone().into(), &run_dir)
.await
.unwrap();
@ -301,7 +298,7 @@ mod tests {
let mut record = sample_record(different_graph());
record.graph = graph;
let run_store = seeded_store(&run_dir, &record, None).await;
let run_store = seeded_store(&record, None).await;
let loaded = load_from_store(&run_store.clone().into(), &run_dir)
.await
.unwrap();
@ -319,7 +316,7 @@ mod tests {
let mut record = sample_record(different_graph());
record.graph = graph.clone();
let run_store = seeded_store(&run_dir, &record, Some(&source)).await;
let run_store = seeded_store(&record, Some(&source)).await;
let loaded = load_from_store(&run_store.clone().into(), &run_dir)
.await
.unwrap();

View file

@ -1048,13 +1048,10 @@ mod tests {
settings: serde_json::to_value(&run_spec.settings).unwrap(),
graph: serde_json::to_value(&run_spec.graph).unwrap(),
workflow_source: Some("digraph test { plan -> code }".to_string()),
workflow_config: None,
labels: run_spec.labels.clone().into_iter().collect(),
run_dir: "/tmp/project".to_string(),
source_directory: run_spec.source_directory.clone(),
workflow_slug: run_spec.workflow_slug.clone(),
automation: None,
db_prefix: None,
provenance: run_spec.provenance.clone(),
manifest_blob: None,
git: run_spec.git.clone(),
@ -1119,13 +1116,10 @@ mod tests {
settings: serde_json::to_value(&run_spec.settings).unwrap(),
graph: serde_json::to_value(&run_spec.graph).unwrap(),
workflow_source: Some("digraph test { plan -> code }".to_string()),
workflow_config: None,
labels: run_spec.labels.clone().into_iter().collect(),
run_dir: "/tmp/project".to_string(),
source_directory: run_spec.source_directory.clone(),
workflow_slug: run_spec.workflow_slug.clone(),
automation: None,
db_prefix: None,
provenance: run_spec.provenance.clone(),
manifest_blob: None,
git: run_spec.git.clone(),
@ -1539,13 +1533,10 @@ mod tests {
settings: serde_json::to_value(&run_spec.settings).unwrap(),
graph: serde_json::to_value(&run_spec.graph).unwrap(),
workflow_source: Some("digraph test { plan -> code }".to_string()),
workflow_config: None,
labels: run_spec.labels.clone().into_iter().collect(),
run_dir: "/tmp/project".to_string(),
source_directory: run_spec.source_directory.clone(),
workflow_slug: run_spec.workflow_slug.clone(),
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,
@ -1733,13 +1724,10 @@ mod tests {
settings: serde_json::to_value(&run_spec.settings).unwrap(),
graph: serde_json::to_value(&run_spec.graph).unwrap(),
workflow_source: None,
workflow_config: None,
labels: run_spec.labels.clone().into_iter().collect(),
run_dir: "/tmp/x".to_string(),
source_directory: None,
workflow_slug: None,
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -507,13 +507,10 @@ mod tests {
settings: serde_json::to_value(&run_spec.settings).unwrap(),
graph: serde_json::to_value(&run_spec.graph).unwrap(),
workflow_source: None,
workflow_config: None,
labels: run_spec.labels.clone().into_iter().collect(),
run_dir: run_dir.display().to_string(),
source_directory: run_spec.source_directory.clone(),
workflow_slug: run_spec.workflow_slug.clone(),
automation: None,
db_prefix: None,
provenance: run_spec.provenance.clone(),
manifest_blob: None,
git: run_spec.git.clone(),

View file

@ -163,13 +163,10 @@ mod tests {
settings: serde_json::to_value(&record.settings).unwrap(),
graph: serde_json::to_value(&record.graph).unwrap(),
workflow_source: Some("digraph test {}".to_string()),
workflow_config: None,
labels: std::collections::BTreeMap::new(),
run_dir: "/tmp/test".to_string(),
source_directory: Some("/tmp/test".to_string()),
workflow_slug: Some("test".to_string()),
automation: None,
db_prefix: None,
provenance: test_support::test_run_provenance(),
manifest_blob: None,
git: None,

View file

@ -188,17 +188,14 @@ async fn initialized(
.expect("failed to serialize settings"),
graph: serde_json::to_value(graph).expect("failed to serialize graph"),
workflow_source: None,
workflow_config: None,
labels: run_options
.labels
.clone()
.into_iter()
.collect::<BTreeMap<_, _>>(),
run_dir: run_options.run_dir.display().to_string(),
source_directory: Some(sandbox.working_directory().to_string()),
workflow_slug: run_options.workflow_slug.clone(),
automation: None,
db_prefix: None,
provenance: fabro_types::RunProvenance {
server: None,
client: None,

View file

@ -19,7 +19,6 @@ fn run_event_round_trips_run_created() {
"properties": {
"settings": WorkflowSettings::default(),
"graph": Graph::new("test"),
"run_dir": "/tmp/fabro/run-1",
"source_directory": "/tmp/fabro/run-1",
"provenance": test_support::test_run_provenance()
}
@ -38,7 +37,6 @@ fn run_event_round_trips_run_created_with_web_url() {
"properties": {
"settings": WorkflowSettings::default(),
"graph": Graph::new("test"),
"run_dir": "/tmp/fabro/run-1",
"source_directory": "/tmp/fabro/run-1",
"web_url": format!("http://localhost:3000/runs/{}", fixtures::RUN_1),
"provenance": test_support::test_run_provenance()

View file

@ -1007,7 +1007,6 @@ mod tests {
"settings": settings,
"graph": graph,
"labels": {},
"run_dir": "/tmp/run",
"source_directory": "/tmp/run",
"provenance": test_support::test_run_provenance()
}
@ -1055,7 +1054,6 @@ mod tests {
"settings": WorkflowSettings::default(),
"graph": Graph::new("test"),
"labels": {},
"run_dir": "/tmp/run",
"source_directory": "/tmp/run",
"provenance": test_support::test_run_provenance(),
"manifest_blob": RunBlobId::new(br#"{"version":1}"#).to_string()