From d0416633204495b760e74498e796b0356c423014 Mon Sep 17 00:00:00 2001 From: Fabro Date: Sun, 15 Mar 2026 14:55:13 -0400 Subject: [PATCH] init run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ⚒️ Generated with [Fabro](https://fabro.sh) --- graph.fabro | 34 ++++++++++++++++++++++++++++++++++ manifest.json | 12 ++++++++++++ sandbox.json | 5 +++++ 3 files changed, 51 insertions(+) create mode 100644 graph.fabro create mode 100644 manifest.json create mode 100644 sandbox.json diff --git a/graph.fabro b/graph.fabro new file mode 100644 index 000000000..4ab945c04 --- /dev/null +++ b/graph.fabro @@ -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 +} diff --git a/manifest.json b/manifest.json new file mode 100644 index 000000000..38527da8c --- /dev/null +++ b/manifest.json @@ -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,\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::>()\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" +} \ No newline at end of file diff --git a/sandbox.json b/sandbox.json new file mode 100644 index 000000000..2903ee851 --- /dev/null +++ b/sandbox.json @@ -0,0 +1,5 @@ +{ + "provider": "daytona", + "working_directory": "/home/daytona/workspace", + "identifier": "fabro-01KKSDEQC3GZ6NB715GFVPPRG6" +} \ No newline at end of file