fabro/lib/crates/fabro-workflow/src
Bryan Helmkamp e13de9faaf
feat(automation): persist automation refs on runs (#428)
## Summary

Adds durable automation metadata to workflow runs so
automation-triggered runs can carry their automation and trigger
references through creation, stored events, projections, summaries,
fork, retry, and API surfaces.

This also introduces the new `fabro-automation` crate with typed
automation IDs, TOML parsing/validation, revision hashing, and a
file-backed automation store. The store avoids overwriting malformed
existing TOML files on create and keeps read access from being blocked
by mutation disk I/O.

## Changes

- Add `AutomationRef` propagation through `RunSpec`, `run.created`,
store projections, summaries, fork, retry, and related tests.
- Add `fabro-automation` domain/store crate for automation TOML
definitions, trigger validation, revisions, create/replace/delete, and
load behavior.
- Update OpenAPI and regenerated TypeScript client types for
`RunSpec.automation` and `AutomationRef.trigger_id`.
- Add API/type regression coverage for the new automation fields.
- Harden automation store create semantics so skipped malformed files
still reserve their path.

## Verification

- `cargo nextest run -p fabro-automation`
- `cargo +nightly-2026-04-14 clippy -p fabro-automation --all-targets --
-D warnings`
- `cargo nextest run -p fabro-api`
- `cargo nextest run -p fabro-types
run_spec_round_trips_templated_settings
run_created_props_round_trip_templated_settings`
- `cd lib/packages/fabro-api-client && bun run typecheck`
- `cargo +nightly-2026-04-14 fmt --check --all`
- `git diff --check`
2026-05-27 11:52:57 -04:00
..
event feat(automation): persist automation refs on runs (#428) 2026-05-27 11:52:57 -04:00
graph refactor(workflow): update stage outcome semantics 2026-04-30 06:06:51 -04:00
handler feat(automation): persist automation refs on runs (#428) 2026-05-27 11:52:57 -04:00
lifecycle feat(automation): persist automation refs on runs (#428) 2026-05-27 11:52:57 -04:00
operations feat(automation): persist automation refs on runs (#428) 2026-05-27 11:52:57 -04:00
pipeline feat(automation): persist automation refs on runs (#428) 2026-05-27 11:52:57 -04:00
records refactor: unify run vocabulary and metadata snapshot layout 2026-04-20 22:17:23 -04:00
transforms Replace vague expect/panic messages with invariant-explaining messages (#422) 2026-05-27 10:38:20 -04:00
artifact.rs fix(agent): use raw sandbox reads for edits 2026-05-22 21:26:36 -04:00
artifact_snapshot.rs fix(agent): use raw sandbox reads for edits 2026-05-22 21:26:36 -04:00
artifact_upload.rs feat(run): separate stage state and artifact retries 2026-05-01 20:10:47 -04:00
billing_rollup.rs feat(automation): persist automation refs on runs (#428) 2026-05-27 11:52:57 -04:00
command_log.rs refactor(run): add rich failure contract (#256) 2026-05-13 12:32:28 -04:00
condition.rs Replace bare unwrap() with documented expect() across production runtim… (#415) 2026-05-26 17:46:39 -04:00
context.rs feat(runs): merge command output streams 2026-05-07 22:07:13 -07:00
devcontainer_bridge.rs feat(sandbox): secure daytona snapshot names (#429) 2026-05-27 11:52:35 -04:00
error.rs Fix cancelled projection for failed commands 2026-05-24 12:15:56 -04:00
event.rs Surface silent fallback warnings in runs and logs (#205) 2026-05-05 09:18:05 -04:00
file_resolver.rs fix(workflow): allow workflow-root template partials (#322) 2026-05-20 09:22:28 -04:00
git.rs feat(automation): persist automation refs on runs (#428) 2026-05-27 11:52:57 -04:00
github_token_source.rs refactor: simplify token plumbing and parallelize read_many_files 2026-05-06 07:15:18 -04:00
graph.rs refactor(unwrap): clear non-test workspace warnings 2026-04-19 20:56:38 -04:00
hook_context.rs Rename fabro-workflows crate to fabro-workflow 2026-03-30 12:27:40 -04:00
interview_runtime.rs Migrate sandbox config to named environments; add InterviewOption metad… (#372) 2026-05-23 15:47:33 -04:00
lib.rs Migrate sandbox config to named environments; add InterviewOption metad… (#372) 2026-05-23 15:47:33 -04:00
node_handler.rs fix(workflow): honor human gate timeout defaults (#323) 2026-05-20 09:26:20 -04:00
outcome.rs refactor(model): move provider facts into catalog (#298) 2026-05-17 20:59:08 -04:00
pull_request.rs refactor: remove compatibility shims (#281) 2026-05-16 15:29:25 -04:00
retry.rs ci: switch clippy to pinned nightly, clean up workspace lints 2026-04-16 18:59:11 -04:00
run_control.rs fmt: apply nightly rustfmt after merge 2026-04-11 13:43:30 -04:00
run_dir.rs fmt 2026-04-11 11:27:46 -04:00
run_lookup.rs feat(automation): persist automation refs on runs (#428) 2026-05-27 11:52:57 -04:00
run_materialization.rs feat(model): support open provider catalog data (#245) 2026-05-12 15:42:49 -04:00
run_metadata.rs feat(automation): persist automation refs on runs (#428) 2026-05-27 11:52:57 -04:00
run_options.rs feat: add run.checkpoint.skip_git_hooks to bypass Git commit hooks (#355) 2026-05-22 17:26:06 -04:00
run_status.rs refactor(run-status): unify tagged lifecycle states 2026-04-22 17:15:13 -04:00
runtime_store.rs feat(automation): persist automation refs on runs (#428) 2026-05-27 11:52:57 -04:00
sandbox_git.rs fix(agent): use raw sandbox reads for edits 2026-05-22 21:26:36 -04:00
sandbox_git_runtime.rs fix(workflow): retain exec output tails on failures 2026-05-03 21:30:34 -04:00
services.rs Replace bare unwrap() with documented expect() across production runtim… (#415) 2026-05-26 17:46:39 -04:00
stage_scope.rs refactor(workflow): split event module by responsibility 2026-05-02 14:52:10 -04:00
static_reference.rs Add output_schema validation with same-context repair for agent and pro… (#374) 2026-05-23 19:45:16 -04:00
steering_hub.rs Stage-based pairing API and fabro_run_pair MCP tool (#344) 2026-05-21 21:57:55 -04:00
test_support.rs feat(automation): persist automation refs on runs (#428) 2026-05-27 11:52:57 -04:00
workflow_bundle.rs fix: MiniJinja can't find partials (#301) 2026-05-17 22:15:45 -04:00