mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-11 22:53:00 +00:00
parent
8e47309d18
commit
5d476a4447
3 changed files with 56 additions and 0 deletions
38
graph.fabro
Normal file
38
graph.fabro
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
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 -q --workspace 2>&1", max_retries=0]
|
||||
preflight_lint [label="Preflight Lint", shape=parallelogram, script="cargo clippy -q --workspace -- -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. Use red/green TDD."]
|
||||
simplify_opus [label="Simplify (Opus)", prompt="@prompts/simplify.md"]
|
||||
simplify_gemini [label="Simplify (Gemini)", prompt="@prompts/simplify.md", model="gemini-3.1-pro-preview-customtools"]
|
||||
simplify_gpt [label="Simplify (GPT-54)", prompt="@prompts/simplify.md", model="gpt-54"]
|
||||
verify [label="Verify", shape=parallelogram, script="cargo clippy -q --workspace -- -D warnings 2>&1 && cargo nextest run --cargo-quiet --workspace --status-level fail 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]
|
||||
fmt [label="Format", shape=parallelogram, script="cargo fmt --all 2>&1", goal_gate=true, max_retries=0]
|
||||
|
||||
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_opus -> simplify_gemini -> simplify_gpt -> verify
|
||||
verify -> fmt [condition="outcome=success"]
|
||||
verify -> fixup
|
||||
fixup -> verify
|
||||
fmt -> exit
|
||||
}
|
||||
13
manifest.json
Normal file
13
manifest.json
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"run_id": "01KKT5VWYY8VQFETNRC7RTYKDW",
|
||||
"workflow_name": "ImplementAndSimplify",
|
||||
"goal": "# Style SVG output from `fabro graph` and API\n\n## Context\n\nSVGs from `fabro graph` use raw Graphviz defaults (black strokes, white bg, Times-serif). The docs SVGs look much better: teal nodes, gray edges, Helvetica font, transparent bg, dark mode CSS. The goal is to make `fabro graph` and the API `get_graph` endpoint produce the same styled output without building a layout engine.\n\n## Approach: DOT defaults + SVG post-processing\n\n### Step 1: `inject_dot_style_defaults(source: &str) -> String` in `graph.rs`\n\nFind first `{`, insert after it:\n```dot\n bgcolor=\"transparent\"\n node [color=\"#357f9e\", fontname=\"Helvetica\", fontsize=12, fontcolor=\"#1a1a1a\"]\n edge [color=\"#666666\", fontname=\"Helvetica\", fontsize=10, fontcolor=\"#666666\"]\n```\nThese are DOT defaults — per-node/edge attrs override them. Applies to both SVG and PNG.\n\n### Step 2: `postprocess_svg(raw: Vec<u8>) -> Vec<u8>` in `graph.rs`\n\nSVG-only. Two string operations:\n1. Remove line containing `<polygon fill=\"white\" stroke=\"none\"` (the white background)\n2. Insert dark mode `<style>` block after the `<svg ...>` closing `>`\n\n### Step 3: Wire into `render_dot()` in `graph.rs`\n\n- Call `inject_dot_style_defaults` on source before piping to `dot`\n- Call `postprocess_svg` on output when format is SVG\n\n### Step 4: Wire into `get_graph()` in `server.rs` (line ~1440, ~1467, ~1472)\n\n- Wrap `dot_source` with `inject_dot_style_defaults`\n- Wrap `output.stdout` with `postprocess_svg`\n\n### Step 5: Wire into `get_run_graph()` in `demo/mod.rs` (line ~227, ~248, ~252)\n\nSame two wraps.\n\n### Step 6: Tests in `graph.rs`\n\n- `inject_dot_style_defaults` inserts expected attrs\n- `inject_dot_style_defaults` returns unchanged if no `{`\n- `postprocess_svg` removes white background\n- `postprocess_svg` injects dark mode style block\n- Update `graph_valid_workflow_svg` to assert styled output\n\n## Files to modify\n\n1. `lib/crates/fabro-workflows/src/cli/graph.rs` — add 2 pub fns, modify `render_dot`, add tests\n2. `lib/crates/fabro-api/src/server.rs` — 2-line change in `get_graph`\n3. `lib/crates/fabro-api/src/demo/mod.rs` — 2-line change in `get_run_graph`\n\n## Verification\n\n1. `cargo test -p fabro-workflows -- graph` — unit tests pass\n2. `cargo test -p fabro-api` — API tests pass\n3. `cargo clippy --workspace -- -D warnings` — no warnings\n4. `fabro graph fabro/workflows/implement/workflow.fabro -o /tmp/test.svg` — visually inspect:\n - Teal node strokes, gray edges, Helvetica font\n - No white background\n - Dark mode `<style>` block present\n - Compare with `docs/images/tutorial-plan-implement.svg`\n",
|
||||
"start_time": "2026-03-16T01:58:50.483601Z",
|
||||
"node_count": 13,
|
||||
"edge_count": 16,
|
||||
"run_branch": "fabro/run/01KKT5VWYY8VQFETNRC7RTYKDW",
|
||||
"base_sha": "b101ad78a26a30df5f2bca7f141791d730b67c23",
|
||||
"base_branch": "main",
|
||||
"workflow_slug": "implement",
|
||||
"host_repo_path": "/Users/bhelmkamp/p/fabro-sh/fabro"
|
||||
}
|
||||
5
sandbox.json
Normal file
5
sandbox.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"provider": "daytona",
|
||||
"working_directory": "/home/daytona/workspace",
|
||||
"identifier": "fabro-01KKT5VWYY8VQFETNRC7RTYKDW"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue