From 3a49ad73531500a384083652e82ef38c8b9fb430 Mon Sep 17 00:00:00 2001 From: Fabro Date: Sat, 21 Mar 2026 10:15:44 -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 | 37 +++++++++++++++++++++++++++++++++++++ manifest.json | 13 +++++++++++++ sandbox.json | 5 +++++ 3 files changed, 55 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..28e4256e0 --- /dev/null +++ b/graph.fabro @@ -0,0 +1,37 @@ +digraph ImplementPlan { + graph [ + goal="Implement and simplify", + model_stylesheet=" + * { 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_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", 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_gpt -> verify + verify -> fmt [condition="outcome=success"] + verify -> fixup + fixup -> verify + fmt -> exit +} diff --git a/manifest.json b/manifest.json new file mode 100644 index 000000000..d929114cc --- /dev/null +++ b/manifest.json @@ -0,0 +1,13 @@ +{ + "run_id": "01KM8C0SVZW77C5W018CYEVE4Y", + "workflow_name": "ImplementPlan", + "goal": "# Plan: Extract `fabro resume` subcommand\n\n## Context\n\nResume functionality is currently embedded in `fabro run` via `--resume` (checkpoint file) and `--run-branch` (git branch). This makes the `run` command's arg surface complex with `conflicts_with` annotations, and the UX is unintuitive — users must construct `fabro/run/RUN_ID` branch names manually. The new `fabro resume` subcommand provides a cleaner interface: `fabro resume RUN_ID_OR_PREFIX`.\n\n## New `ResumeArgs` struct\n\n```rust\npub struct ResumeArgs {\n /// Run ID, prefix, or branch (fabro/run/...)\n #[arg(required_unless_present = \"checkpoint\")]\n pub run: Option,\n\n /// Resume from a checkpoint file (requires --workflow)\n #[arg(long)]\n pub checkpoint: Option,\n\n /// Override workflow graph (required with --checkpoint)\n #[arg(long)]\n pub workflow: Option,\n\n // Shared run options: run_dir, dry_run, auto_approve, goal, goal_file,\n // model, provider, verbose, sandbox, no_retro, ssh, preserve_sandbox\n}\n```\n\n**Run ID resolution** (at top of `resume_command()`):\n- If `run` starts with `fabro/run/` → strip prefix to get run_id\n- Otherwise → call `find_run_id_by_prefix(&repo, &run)` (same as `rewind`/`fork`)\n- Then construct branch name as `fabro/run/{run_id}`\n\n## Files to modify\n\n### 1. New: `lib/crates/fabro-cli/src/commands/resume.rs`\n- Define `ResumeArgs` struct\n- Move `run_from_branch()` body (~315 lines, `run.rs:1811-2125`) into `pub async fn resume_command()`\n- Add run ID resolution logic at top (prefix → full ID via `find_run_id_by_prefix`)\n- Add `--checkpoint` path: validate `--workflow` is present, load graph via `prepare_from_file()`, load checkpoint via `Checkpoint::load()`, then run engine\n\n### 2. `lib/crates/fabro-cli/src/commands/run.rs`\n- **Remove from `RunArgs`**: `resume` field (line 97-99), `run_branch` field (line 101-103)\n- **Simplify `workflow`**: remove `required_unless_present = \"run_branch\"` — it's now always required\n- **Update `conflicts_with_all`**: remove `\"resume\"`/`\"run_branch\"` from `preflight` (line 90) and `detach` (line 146)\n- **Remove** `run_from_branch()` function (lines 1811-2125)\n- **Remove** the `run_branch` early-return at top of `run_command()` (lines 602-604)\n- **Simplify** engine call: remove `if let Some(ref checkpoint_path) = args.resume` branch (lines 1467-1476), always pass `None` for checkpoint\n- **Widen visibility** of helpers used by `resume.rs`:\n - `local_sandbox_with_callback` (line 439) → `pub(crate)`\n - `resolve_ssh_config` (line 341) → `pub(crate)`\n - `resolve_ssh_clone_params` (line 355) → `pub(crate)`\n - `resolve_exe_config` (line 313) → `pub(crate)`\n - `resolve_exe_clone_params` (line 328) → `pub(crate)`\n - `resolve_preserve_sandbox` (line 261) → `pub(crate)`\n - `generate_retro` (line 2560) → `pub(crate)`\n - `write_finalize_commit` (line 2523) → `pub(crate)`\n - `print_final_output` (line 2128) → `pub(crate)`\n - `print_assets` (line 2149) → `pub(crate)`\n\n### 3. `lib/crates/fabro-cli/src/commands/mod.rs`\n- Add `pub mod resume;`\n\n### 4. `lib/crates/fabro-cli/src/main.rs`\n- Add `Resume(commands::resume::ResumeArgs)` to `Command` enum (near line 170, alongside `Rewind`/`Fork`)\n- Add `Command::Resume(_) => \"resume\"` to command_name match\n- Add dispatch handler (pattern follows `Rewind`/`Fork`/`Wait` — create styles, load cli_config, build github_app/git_author, call `resume_command()`)\n\n### 5. `lib/crates/fabro-workflows/src/run_spec.rs`\n- Remove `resume` and `run_branch` fields from `RunSpec`\n- Add `#[serde(default)]` to `RunSpec` for backward compat with existing `spec.json` files\n- Update `sample_spec()` in tests\n\n### 6. `lib/crates/fabro-cli/src/commands/create.rs`\n- Remove lines 86-87 that set `resume` and `run_branch` in the spec\n\n### 7. `lib/crates/fabro-cli/src/main.rs` (`_run_engine` handler)\n- Remove lines setting `resume` and `run_branch` when reconstructing `RunArgs` from `RunSpec`\n\n### 8. `lib/crates/fabro-cli/src/commands/rewind.rs` (line 48-52)\n- Change hint: `\"To resume: fabro resume {run_id}\"` (use short prefix)\n\n### 9. `lib/crates/fabro-cli/src/commands/fork.rs` (line 56-60)\n- Change hint: `\"To resume: fabro resume {new_run_id}\"` (use short prefix)\n\n### 10. `lib/crates/fabro-cli/tests/cli.rs`\n- Update/remove tests referencing `--resume` or `--run-branch` on `fabro run`\n- Add basic parse test for `fabro resume`\n\n### 11. Documentation (`docs/`)\n- Update `docs/reference/cli.mdx`: add `fabro resume` section, remove `--resume`/`--run-branch` from `fabro run`\n- Update `docs/execution/checkpoints.mdx`: change resume examples\n- Update any other docs referencing `fabro run --run-branch` or `fabro run --resume`\n\n## Verification\n\n1. `cargo build --workspace` — compiles cleanly\n2. `cargo test --workspace` — all tests pass\n3. `cargo clippy --workspace -- -D warnings` — no warnings\n4. Manual: `fabro resume --help` shows expected args\n5. Manual: `fabro run --help` no longer shows `--resume` or `--run-branch`\n", + "start_time": "2026-03-21T14:15:44.557444Z", + "node_count": 12, + "edge_count": 15, + "run_branch": "fabro/run/01KM8C0SVZW77C5W018CYEVE4Y", + "base_sha": "1a323ceb644c109b6b7014379565d253c9a6d14c", + "base_branch": "main", + "workflow_slug": "20260321-01KM8C0SVZW77C5W018CYEVE4Y", + "host_repo_path": "/Users/bhelmkamp/p/fabro-sh/fabro" +} \ No newline at end of file diff --git a/sandbox.json b/sandbox.json new file mode 100644 index 000000000..63d949c6c --- /dev/null +++ b/sandbox.json @@ -0,0 +1,5 @@ +{ + "provider": "daytona", + "working_directory": "/home/daytona/workspace", + "identifier": "fabro-01KM8C0SVZW77C5W018CYEVE4Y" +} \ No newline at end of file