mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-10 03:30:59 +00:00
parent
f97d2f999f
commit
7162f57309
3 changed files with 51 additions and 0 deletions
34
graph.fabro
Normal file
34
graph.fabro
Normal 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
12
manifest.json
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"run_id": "01KKS6PG9929P116A2RRKXC738",
|
||||
"workflow_name": "ImplementAndSimplify",
|
||||
"goal": "# Rename metadata branch from `refs/fabro/{run_id}` to `fabro/meta/{run_id}`\n\n## Context\n\nTwo branch types exist per workflow run: the **run branch** (`fabro/run/{run_id}`) and the **metadata branch** (`refs/fabro/{run_id}`). `BranchStore` always prepends `refs/heads/` to branch names, so the metadata branch becomes `refs/heads/refs/fabro/{run_id}` — a regular branch with a confusing double-`refs/` name. Three push sites then strip `refs/fabro/` and remap to `fabro/meta/{run_id}` for the remote (because GitHub rejects branch names starting with `refs/`).\n\nFix: change `MetadataStore::branch_name()` to return `fabro/meta/{run_id}`, making local and remote names identical and eliminating the refspec translation.\n\n## Steps (red/green TDD)\n\n### Step 1: RED — add test for new branch name format\n\nIn `lib/crates/fabro-workflows/src/git.rs`, add a `#[cfg(test)]` module with:\n```rust\n#[test]\nfn metadata_branch_name_uses_meta_prefix() {\n assert_eq!(MetadataStore::branch_name(\"abc-123\"), \"fabro/meta/abc-123\");\n}\n\n#[test]\nfn meta_branch_prefix_constant() {\n assert!(MetadataStore::branch_name(\"x\").starts_with(META_BRANCH_PREFIX));\n}\n```\n\nRun `cargo test -p fabro-workflows -- metadata_branch_name` → **fails** (returns `refs/fabro/abc-123`)\n\n### Step 2: GREEN — fix `MetadataStore::branch_name()` and add constant\n\nIn `lib/crates/fabro-workflows/src/git.rs`:\n- Add `META_BRANCH_PREFIX` constant after line 12:\n ```rust\n pub const META_BRANCH_PREFIX: &str = \"fabro/meta/\";\n ```\n- Line 362: `format!(\"refs/fabro/{run_id}\")` → `format!(\"fabro/meta/{run_id}\")`\n- Update doc comments on lines 346, 360\n\nRun `cargo test -p fabro-workflows -- metadata_branch_name` → **passes**\n\n### Step 3: RED — existing `find_run_id_by_prefix` tests now fail\n\nRun `cargo test -p fabro-workflows -- find_run_id` → **fails** because `find_run_id_by_prefix` still uses hardcoded `\"refs/heads/refs/fabro/\"` pattern but branches are now created as `fabro/meta/{run_id}`\n\n### Step 4: GREEN — fix `find_run_id_by_prefix` pattern\n\nIn `lib/crates/fabro-workflows/src/cli/rewind.rs`:\n- Line 395: `\"refs/heads/refs/fabro/\"` → `\"refs/heads/fabro/meta/\"`\n\nRun `cargo test -p fabro-workflows -- find_run_id` → **passes**\n\n### Step 5: RED — add test for push refspec simplification\n\nIn `lib/crates/fabro-workflows/src/cli/rewind.rs` tests, add:\n```rust\n#[test]\nfn rewind_push_refspec_uses_same_name_on_both_sides() {\n // The meta branch name should work directly as a refspec\n // without needing strip_prefix translation\n let meta_branch = MetadataStore::branch_name(\"run-1\");\n let refspec = format!(\"+refs/heads/{meta_branch}:refs/heads/{meta_branch}\");\n assert_eq!(refspec, \"+refs/heads/fabro/meta/run-1:refs/heads/fabro/meta/run-1\");\n}\n```\n\nRun → **fails** because rewind.rs line 381 still constructs the refspec using separate local/remote names with `{run_id}` variable\n\n### Step 6: GREEN — simplify all push refspecs\n\n**`lib/crates/fabro-workflows/src/cli/rewind.rs`** line 381:\n- `format!(\"+refs/heads/{meta_branch}:refs/heads/fabro/meta/{run_id}\")` → `format!(\"+refs/heads/{meta_branch}:refs/heads/{meta_branch}\")`\n\n**`lib/crates/fabro-workflows/src/engine.rs`** lines 1931-1951:\n- Remove `strip_prefix` + comment block, simplify to:\n ```rust\n if let (Some(ref meta_branch), Some(ref repo_path)) =\n (&config.meta_branch, &config.host_repo_path)\n {\n let refspec = format!(\"refs/heads/{meta_branch}\");\n git_push_host(repo_path, &refspec, &config.github_app, \"metadata branch\").await;\n }\n ```\n\n**`lib/crates/fabro-workflows/src/cli/run.rs`** lines 2224-2227:\n- Remove `strip_prefix`, simplify to `let refspec = format!(\"refs/heads/{meta_branch}\");`\n\n### Step 7: Update doc comments\n\n- `engine.rs` line 769: `refs/fabro/{run_id}` → `fabro/meta/{run_id}`\n- `run.rs` line 1550: `refs/fabro/{run_id}` → `fabro/meta/{run_id}`\n\n### Step 8: Update docs\n\n- `docs/execution/checkpoints.mdx`:\n - Line 15: table `refs/fabro/{run_id}` → `fabro/meta/{run_id}`\n - Line 44: `refs/fabro/{run_id}` → `fabro/meta/{run_id}`\n - Line 90: remove parenthetical about local/remote name difference (they now match)\n - Line 114: `refs/fabro/01JKXYZ...` → `fabro/meta/01JKXYZ...`\n - Lines 151, 154: collapse local/remote git show examples into one (both use `fabro/meta/...`)\n- `docs/agents/outputs.mdx` line 185: `refs/fabro/{run_id}` → `fabro/meta/{run_id}`\n\n## Verification\n\nAfter all steps: `cargo test -p fabro-workflows && cargo clippy --workspace -- -D warnings && cargo fmt --check --all`\n",
|
||||
"start_time": "2026-03-15T16:54:07.217880Z",
|
||||
"node_count": 10,
|
||||
"edge_count": 13,
|
||||
"run_branch": "fabro/run/01KKS6PG9929P116A2RRKXC738",
|
||||
"base_sha": "891a6db29bf35007d664b08e511dc52fc62fa879",
|
||||
"base_branch": "main",
|
||||
"workflow_slug": "implement"
|
||||
}
|
||||
5
sandbox.json
Normal file
5
sandbox.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"provider": "daytona",
|
||||
"working_directory": "/home/daytona/workspace",
|
||||
"identifier": "fabro-01KKS6PG9929P116A2RRKXC738"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue