⚒️ Generated with [Fabro](https://fabro.sh)
This commit is contained in:
Fabro 2026-03-15 14:55:13 -04:00
parent 203094d89f
commit d041663320
3 changed files with 51 additions and 0 deletions

34
graph.fabro Normal file
View file

@ -0,0 +1,34 @@
digraph ImplementAndSimplify {
graph [
goal="Implement and simplify",
model_stylesheet="
* { backend: api; model: claude-opus-4-6;}
"
]
rankdir=LR
start [shape=Mdiamond, label="Start"]
exit [shape=Msquare, label="Exit"]
toolchain [label="Toolchain", shape=parallelogram, script="command -v cargo >/dev/null || { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && sudo ln -sf $HOME/.cargo/bin/* /usr/local/bin/; }; cargo --version 2>&1", max_retries=0]
preflight_compile [label="Preflight Compile", shape=parallelogram, script="cargo check 2>&1", max_retries=0]
preflight_lint [label="Preflight Lint", shape=parallelogram, script="cargo clippy -- -D warnings 2>&1", max_retries=0]
fix_lints [label="Fix Lints", prompt="The preflight lint step failed. Read the build output from context and fix all clippy lint warnings.", max_visits=3]
implement [label="Implement", prompt="Read the plan file referenced in the goal and implement every step. Make all the code changes described in the plan."]
simplify [label="Simplify", prompt="@prompts/simplify.md"]
verify [label="Verify", shape=parallelogram, script="cargo clippy -- -D warnings 2>&1 && cargo test 2>&1", goal_gate=true, retry_target="fixup"]
fixup [label="Fixup", prompt="The verify step failed. Read the build output from context and fix all clippy lint warnings and test failures.", max_visits=3]
start -> toolchain
toolchain -> preflight_compile [condition="outcome=success"]
toolchain -> exit
preflight_compile -> preflight_lint [condition="outcome=success"]
preflight_compile -> exit
preflight_lint -> implement [condition="outcome=success"]
preflight_lint -> fix_lints
fix_lints -> preflight_lint
implement -> simplify -> verify
verify -> exit [condition="outcome=success"]
verify -> fixup
fixup -> verify
}

12
manifest.json Normal file
View file

@ -0,0 +1,12 @@
{
"run_id": "01KKSDEQC3GZ6NB715GFVPPRG6",
"workflow_name": "ImplementAndSimplify",
"goal": "# Add `goal` to WorkflowRunStarted and render in `fabro logs --pretty`\n\n## Context\n\n`fabro logs --pretty` shows `▶ WorkflowName run_id` at the top but doesn't show what the workflow is trying to do. The goal is available via `graph.goal()` at the emit site but isn't included in the event. Adding it gives users immediate context when reading logs.\n\nGoals can be short one-liners or full markdown documents.\n\n## Changes\n\n### 1. Add `goal` field to `WorkflowRunEvent::WorkflowRunStarted` (`event.rs:~11`)\n\n```rust\n#[serde(default, skip_serializing_if = \"Option::is_none\")]\ngoal: Option<String>,\n```\n\n`Option` + `serde(default)` for backward compat with old JSONL (same pattern as `base_sha`, `run_branch`).\n\n### 2. Populate at emit site (`engine.rs:~1209`)\n\nAdd `goal:` field using `graph.goal()`. Emit `None` when empty, `Some(...)` otherwise:\n\n```rust\ngoal: {\n let g = graph.goal();\n if g.is_empty() { None } else { Some(g.to_string()) }\n},\n```\n\n### 3. Update all other construction sites\n\nGrep for `WorkflowRunStarted {` — tests in `event.rs` construct this variant. Add `goal: None` to each.\n\n### 4. Render in `logs.rs` `format_event_pretty` (`logs.rs:~203`)\n\nAfter the existing header line, if `goal` is present, render it below indented. Use `styles.render_markdown_width()` for markdown rendering (same approach as `Agent.AssistantMessage` at line 355).\n\n- Short goal (single line, no markdown): render inline on same line or as a single indented line\n- Multi-line / markdown goal: render with `render_markdown_width` + indent, same as assistant messages\n\n```rust\n\"WorkflowRunStarted\" => {\n let name = str_field(&envelope, \"workflow_name\").unwrap_or(\"?\");\n let run_id = str_field(&envelope, \"run_id\").unwrap_or(\"?\");\n let header = format!(\n \"{} {} {} {}\",\n styles.dim.apply_to(&ts),\n styles.bold_cyan.apply_to(\"\\u{25b6}\"),\n styles.bold.apply_to(name),\n styles.dim.apply_to(run_id),\n );\n match str_field(&envelope, \"goal\") {\n Some(goal) if !goal.is_empty() => {\n let indent = \" \";\n let term_width = fabro_util::terminal::Styles::terminal_width();\n let wrap_width = term_width.saturating_sub(indent.len());\n let rendered = styles.render_markdown_width(goal, wrap_width);\n let body: String = rendered\n .lines()\n .map(|l| format!(\"{indent}{l}\"))\n .collect::<Vec<_>>()\n .join(\"\\n\");\n Some(format!(\"{header}\\n{body}\\n\"))\n }\n _ => Some(header),\n }\n}\n```\n\n### 5. Tests (`event.rs`)\n\n- Update existing `workflow_run_started` serialization tests to include `goal`\n- Add test: round-trip with `goal: Some(\"Fix the bug\")`\n- Existing backward-compat test (`workflow_run_completed_backward_compat_without_new_fields` pattern) — add one for `WorkflowRunStarted` without `goal` field deserializing to `goal: None`\n\n## Files to modify\n\n| File | What |\n|---|---|\n| `lib/crates/fabro-workflows/src/event.rs` | Add `goal` field, update trace, update tests |\n| `lib/crates/fabro-workflows/src/engine.rs` | Populate `goal` at emit site |\n| `lib/crates/fabro-workflows/src/cli/logs.rs` | Render goal in pretty logs |\n\n## Verification\n\n1. `cargo test -p fabro-workflows`\n2. `cargo build --workspace`\n3. `cargo test --workspace`\n4. `cargo clippy --workspace -- -D warnings`\n5. `cargo fmt --check --all`\n",
"start_time": "2026-03-15T18:55:13.367528Z",
"node_count": 10,
"edge_count": 13,
"run_branch": "fabro/run/01KKSDEQC3GZ6NB715GFVPPRG6",
"base_sha": "891a6db29bf35007d664b08e511dc52fc62fa879",
"base_branch": "main",
"workflow_slug": "implement"
}

5
sandbox.json Normal file
View file

@ -0,0 +1,5 @@
{
"provider": "daytona",
"working_directory": "/home/daytona/workspace",
"identifier": "fabro-01KKSDEQC3GZ6NB715GFVPPRG6"
}