mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-06 08:18:58 +00:00
parent
8b0d9afd12
commit
57366c3741
4 changed files with 38 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"timestamp": "2026-03-20T01:42:13.377207Z",
|
||||
"current_node": "verify",
|
||||
"timestamp": "2026-03-20T01:42:17.300111Z",
|
||||
"current_node": "fmt",
|
||||
"completed_nodes": [
|
||||
"start",
|
||||
"toolchain",
|
||||
|
|
@ -9,7 +9,8 @@
|
|||
"implement",
|
||||
"simplify_opus",
|
||||
"simplify_gpt",
|
||||
"verify"
|
||||
"verify",
|
||||
"fmt"
|
||||
],
|
||||
"node_retries": {
|
||||
"implement": 1,
|
||||
|
|
@ -17,6 +18,7 @@
|
|||
"start": 1,
|
||||
"toolchain": 1,
|
||||
"simplify_gpt": 1,
|
||||
"fmt": 1,
|
||||
"preflight_lint": 1,
|
||||
"preflight_compile": 1,
|
||||
"verify": 1
|
||||
|
|
@ -25,6 +27,7 @@
|
|||
"internal.node_visit_count": 1,
|
||||
"thread.preflight_compile.current_node": "preflight_lint",
|
||||
"internal.retry_count.implement": 1,
|
||||
"internal.retry_count.fmt": 1,
|
||||
"internal.retry_count.preflight_compile": 1,
|
||||
"thread.implement.current_node": "simplify_opus",
|
||||
"internal.retry_count.start": 1,
|
||||
|
|
@ -32,8 +35,9 @@
|
|||
"last_stage": "simplify_opus",
|
||||
"internal.retry_count.simplify_opus": 1,
|
||||
"response.simplify_opus": "All 390 tests pass, 0 failures.\n\n## Summary\n\n**Review findings:**\n- **Code Reuse**: Clean — the one-line `json!({\"effort\": effort})` duplication between Anthropic and OpenAI providers is coincidental API symmetry, not shared domain logic. Not worth extracting.\n- **Efficiency**: Clean — the `.as_ref().map()` short-circuits to `None` in the common case, negligible next to HTTP I/O.\n- **Code Quality**: One actionable finding — copy-paste `Request` construction in tests.\n\n**Fix applied:** Introduced a `make_base_request()` test helper and refactored 3 tests + `make_request_with_format` to use it via struct update syntax (`..make_base_request()`), eliminating ~40 lines of duplicated test boilerplate. The tests now clearly express only what differs from the default (e.g., `reasoning_effort: Some(\"medium\".to_string())` or custom `messages`).",
|
||||
"current.preamble": "Goal: # Plan: Map `reasoning_effort` to Anthropic `output_config.effort`\n\n## Context\n\nThe Anthropic Messages API now supports `output_config: { effort: \"low\" | \"medium\" | \"high\" | \"max\" }` as the recommended way to control thinking depth for Claude Opus 4.6 and Sonnet 4.6 (replacing deprecated `budget_tokens`). Fabro's unified `Request` already carries `reasoning_effort: Option<String>` and workflow nodes default it to `\"high\"`, but the Anthropic provider silently drops this field — it never appears in the API request. The OpenAI provider correctly maps it to `reasoning: { effort }`, but the Anthropic provider has no equivalent.\n\n## Single file to modify\n\n`lib/crates/fabro-llm/src/providers/anthropic.rs`\n\n## Step 1: Add failing tests\n\nAdd tests at the end of the `#[cfg(test)] mod tests` block (before line 2043's `}`). These tests reference a new `output_config` field on `ApiRequest` that doesn't exist yet, so they won't compile until Step 2.\n\n**Test A** — `build_api_request_maps_reasoning_effort_to_output_config`: Build a `Request` with `reasoning_effort: Some(\"medium\")`, call `build_api_request`, assert `api_request.output_config == Some(json!({\"effort\": \"medium\"}))`. Pattern: follows existing `build_api_request_omits_whitespace_only_system_prompt` test (line 1592).\n\n**Test B** — `build_api_request_omits_output_config_when_no_reasoning_effort`: Same but with `reasoning_effort: None`, assert `api_request.output_config.is_none()`.\n\n## Step 2: Add `output_config` field to `ApiRequest` struct\n\nAt line 108 (after `thinking`), add:\n\n```rust\n#[serde(skip_serializing_if = \"Option::is_none\")]\noutput_config: Option<serde_json::Value>,\n```\n\nUpdate every existing `ApiRequest` construction to include `output_config: None`:\n- line 1566 (serialization test)\n- line 1962 (merge_provider_options test)\n- line 1993 (merge_provider_options test)\n\nAt this point: code compiles, Test B passes, **Test A fails** (proving the bug exists).\n\n## Step 3: Map `reasoning_effort` → `output_config` in `build_api_request`\n\nAt line 1073 (next to the `thinking` extraction), add:\n\n```rust\nlet output_config = request\n .reasoning_effort\n .as_ref()\n .map(|effort| serde_json::json!({\"effort\": effort}));\n```\n\nAdd `output_config,` to the `ApiRequest` construction at line 1075.\n\nThis mirrors the OpenAI provider pattern at `openai.rs:385-388`.\n\nAll tests pass.\n\n## Verification\n\n```sh\ncargo test -p fabro-llm -- anthropic::tests::build_api_request_maps_reasoning_effort\ncargo test -p fabro-llm -- anthropic::tests::build_api_request_omits_output_config\ncargo test -p fabro-llm # all provider tests still pass\ncargo clippy --workspace -- -D warnings\n```\n\n\n## Completed stages\n- **toolchain**: success\n - 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`\n - Stdout:\n ```\n cargo 1.94.0 (85eff7c80 2026-01-15)\n ```\n - Stderr: (empty)\n- **preflight_compile**: success\n - Script: `cargo check -q --workspace 2>&1`\n - Stdout: (empty)\n - Stderr: (empty)\n- **preflight_lint**: success\n - Script: `cargo clippy -q --workspace -- -D warnings 2>&1`\n - Stdout: (empty)\n - Stderr: (empty)\n- **implement**: success\n - Model: claude-opus-4-6, 10.6k tokens in / 4.4k out\n - Files: /home/daytona/workspace/lib/crates/fabro-llm/src/providers/anthropic.rs\n- **simplify_opus**: success\n - Model: claude-opus-4-6, 26.9k tokens in / 7.9k out\n - Files: /home/daytona/workspace/lib/crates/fabro-llm/src/providers/anthropic.rs\n- **simplify_gpt**: fail\n\n## Context\n- failure_class: deterministic\n- failure_signature: simplify_gpt|deterministic|api_deterministic|anthropic|not_found\n",
|
||||
"current.preamble": "Goal: # Plan: Map `reasoning_effort` to Anthropic `output_config.effort`\n\n## Context\n\nThe Anthropic Messages API now supports `output_config: { effort: \"low\" | \"medium\" | \"high\" | \"max\" }` as the recommended way to control thinking depth for Claude Opus 4.6 and Sonnet 4.6 (replacing deprecated `budget_tokens`). Fabro's unified `Request` already carries `reasoning_effort: Option<String>` and workflow nodes default it to `\"high\"`, but the Anthropic provider silently drops this field — it never appears in the API request. The OpenAI provider correctly maps it to `reasoning: { effort }`, but the Anthropic provider has no equivalent.\n\n## Single file to modify\n\n`lib/crates/fabro-llm/src/providers/anthropic.rs`\n\n## Step 1: Add failing tests\n\nAdd tests at the end of the `#[cfg(test)] mod tests` block (before line 2043's `}`). These tests reference a new `output_config` field on `ApiRequest` that doesn't exist yet, so they won't compile until Step 2.\n\n**Test A** — `build_api_request_maps_reasoning_effort_to_output_config`: Build a `Request` with `reasoning_effort: Some(\"medium\")`, call `build_api_request`, assert `api_request.output_config == Some(json!({\"effort\": \"medium\"}))`. Pattern: follows existing `build_api_request_omits_whitespace_only_system_prompt` test (line 1592).\n\n**Test B** — `build_api_request_omits_output_config_when_no_reasoning_effort`: Same but with `reasoning_effort: None`, assert `api_request.output_config.is_none()`.\n\n## Step 2: Add `output_config` field to `ApiRequest` struct\n\nAt line 108 (after `thinking`), add:\n\n```rust\n#[serde(skip_serializing_if = \"Option::is_none\")]\noutput_config: Option<serde_json::Value>,\n```\n\nUpdate every existing `ApiRequest` construction to include `output_config: None`:\n- line 1566 (serialization test)\n- line 1962 (merge_provider_options test)\n- line 1993 (merge_provider_options test)\n\nAt this point: code compiles, Test B passes, **Test A fails** (proving the bug exists).\n\n## Step 3: Map `reasoning_effort` → `output_config` in `build_api_request`\n\nAt line 1073 (next to the `thinking` extraction), add:\n\n```rust\nlet output_config = request\n .reasoning_effort\n .as_ref()\n .map(|effort| serde_json::json!({\"effort\": effort}));\n```\n\nAdd `output_config,` to the `ApiRequest` construction at line 1075.\n\nThis mirrors the OpenAI provider pattern at `openai.rs:385-388`.\n\nAll tests pass.\n\n## Verification\n\n```sh\ncargo test -p fabro-llm -- anthropic::tests::build_api_request_maps_reasoning_effort\ncargo test -p fabro-llm -- anthropic::tests::build_api_request_omits_output_config\ncargo test -p fabro-llm # all provider tests still pass\ncargo clippy --workspace -- -D warnings\n```\n\n\n## Completed stages\n- **toolchain**: success\n - 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`\n - Stdout:\n ```\n cargo 1.94.0 (85eff7c80 2026-01-15)\n ```\n - Stderr: (empty)\n- **preflight_compile**: success\n - Script: `cargo check -q --workspace 2>&1`\n - Stdout: (empty)\n - Stderr: (empty)\n- **preflight_lint**: success\n - Script: `cargo clippy -q --workspace -- -D warnings 2>&1`\n - Stdout: (empty)\n - Stderr: (empty)\n- **implement**: success\n - Model: claude-opus-4-6, 10.6k tokens in / 4.4k out\n - Files: /home/daytona/workspace/lib/crates/fabro-llm/src/providers/anthropic.rs\n- **simplify_opus**: success\n - Model: claude-opus-4-6, 26.9k tokens in / 7.9k out\n - Files: /home/daytona/workspace/lib/crates/fabro-llm/src/providers/anthropic.rs\n- **simplify_gpt**: fail\n- **verify**: success\n - Script: `cargo clippy -q --workspace -- -D warnings 2>&1 && cargo nextest run --cargo-quiet --workspace --status-level fail 2>&1`\n - Stdout:\n ```\n warning: function `init_repo_with_remote` is never used\n --> lib/crates/fabro-workflows/src/git.rs:1153:8\n |\n 1153 | fn init_repo_with_remote(dir: &Path) -> (std::path::PathBuf, std::path::PathBuf) {\n | ^^^^^^^^^^^^^^^^^^^^^\n |\n = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default\n \n ────────────\n Nextest run ID 175af601-b41c-46ec-b80d-7f20b66bc4f5 with nextest profile: default\n Starting 3215 tests across 41 binaries (177 tests skipped)\n ────────────\n Summary [ 13.453s] 3215 tests run: 3215 passed, 177 skipped\n ```\n - Stderr: (empty)\n",
|
||||
"response.implement": "All 390 tests pass and clippy is clean with zero warnings.\n\nHere's a summary of the changes made to `lib/crates/fabro-llm/src/providers/anthropic.rs`:\n\n1. **Added `output_config` field to `ApiRequest` struct** (after `thinking`):\n ```rust\n #[serde(skip_serializing_if = \"Option::is_none\")]\n output_config: Option<serde_json::Value>,\n ```\n\n2. **Mapped `reasoning_effort` → `output_config` in `build_api_request`** — converts `request.reasoning_effort` into `{\"effort\": \"<value>\"}` JSON, mirroring how the OpenAI provider maps this field:\n ```rust\n let output_config = request\n .reasoning_effort\n .as_ref()\n .map(|effort| serde_json::json!({\"effort\": effort}));\n ```\n\n3. **Added two tests**:\n - `build_api_request_maps_reasoning_effort_to_output_config` — verifies `reasoning_effort: Some(\"medium\")` produces `output_config: Some({\"effort\": \"medium\"})`\n - `build_api_request_omits_output_config_when_no_reasoning_effort` — verifies `reasoning_effort: None` produces `output_config: None`\n\n4. **Updated all existing `ApiRequest` construction sites** in tests to include `output_config: None`.",
|
||||
"thread.verify.current_node": "fmt",
|
||||
"internal.retry_count.toolchain": 1,
|
||||
"internal.run_id": "01KM4DXJ0MHZ30K4193ADAH1RT",
|
||||
"internal.fidelity": "compact",
|
||||
|
|
@ -41,7 +45,7 @@
|
|||
"internal.retry_count.simplify_gpt": 1,
|
||||
"failure_class": "",
|
||||
"graph.goal": "# Plan: Map `reasoning_effort` to Anthropic `output_config.effort`\n\n## Context\n\nThe Anthropic Messages API now supports `output_config: { effort: \"low\" | \"medium\" | \"high\" | \"max\" }` as the recommended way to control thinking depth for Claude Opus 4.6 and Sonnet 4.6 (replacing deprecated `budget_tokens`). Fabro's unified `Request` already carries `reasoning_effort: Option<String>` and workflow nodes default it to `\"high\"`, but the Anthropic provider silently drops this field — it never appears in the API request. The OpenAI provider correctly maps it to `reasoning: { effort }`, but the Anthropic provider has no equivalent.\n\n## Single file to modify\n\n`lib/crates/fabro-llm/src/providers/anthropic.rs`\n\n## Step 1: Add failing tests\n\nAdd tests at the end of the `#[cfg(test)] mod tests` block (before line 2043's `}`). These tests reference a new `output_config` field on `ApiRequest` that doesn't exist yet, so they won't compile until Step 2.\n\n**Test A** — `build_api_request_maps_reasoning_effort_to_output_config`: Build a `Request` with `reasoning_effort: Some(\"medium\")`, call `build_api_request`, assert `api_request.output_config == Some(json!({\"effort\": \"medium\"}))`. Pattern: follows existing `build_api_request_omits_whitespace_only_system_prompt` test (line 1592).\n\n**Test B** — `build_api_request_omits_output_config_when_no_reasoning_effort`: Same but with `reasoning_effort: None`, assert `api_request.output_config.is_none()`.\n\n## Step 2: Add `output_config` field to `ApiRequest` struct\n\nAt line 108 (after `thinking`), add:\n\n```rust\n#[serde(skip_serializing_if = \"Option::is_none\")]\noutput_config: Option<serde_json::Value>,\n```\n\nUpdate every existing `ApiRequest` construction to include `output_config: None`:\n- line 1566 (serialization test)\n- line 1962 (merge_provider_options test)\n- line 1993 (merge_provider_options test)\n\nAt this point: code compiles, Test B passes, **Test A fails** (proving the bug exists).\n\n## Step 3: Map `reasoning_effort` → `output_config` in `build_api_request`\n\nAt line 1073 (next to the `thinking` extraction), add:\n\n```rust\nlet output_config = request\n .reasoning_effort\n .as_ref()\n .map(|effort| serde_json::json!({\"effort\": effort}));\n```\n\nAdd `output_config,` to the `ApiRequest` construction at line 1075.\n\nThis mirrors the OpenAI provider pattern at `openai.rs:385-388`.\n\nAll tests pass.\n\n## Verification\n\n```sh\ncargo test -p fabro-llm -- anthropic::tests::build_api_request_maps_reasoning_effort\ncargo test -p fabro-llm -- anthropic::tests::build_api_request_omits_output_config\ncargo test -p fabro-llm # all provider tests still pass\ncargo clippy --workspace -- -D warnings\n```\n",
|
||||
"internal.thread_id": "simplify_gpt",
|
||||
"internal.thread_id": "verify",
|
||||
"thread.simplify_gpt.current_node": "verify",
|
||||
"internal.retry_count.verify": 1,
|
||||
"thread.toolchain.current_node": "preflight_compile",
|
||||
|
|
@ -49,10 +53,10 @@
|
|||
"command.stderr": "",
|
||||
"thread.preflight_lint.current_node": "implement",
|
||||
"last_response": "All 390 tests pass, 0 failures.\n\n## Summary\n\n**Review findings:**\n- **Code Reuse**: Clean — the one-line `json!({\"effort\": effort})` duplication between Anthropic and OpenAI providers is coincidenta",
|
||||
"current_node": "verify",
|
||||
"current_node": "fmt",
|
||||
"failure_signature": "",
|
||||
"outcome": "success",
|
||||
"command.output": "warning: function `init_repo_with_remote` is never used\n --> lib/crates/fabro-workflows/src/git.rs:1153:8\n |\n1153 | fn init_repo_with_remote(dir: &Path) -> (std::path::PathBuf, std::path::PathBuf) {\n | ^^^^^^^^^^^^^^^^^^^^^\n |\n = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default\n\n────────────\n Nextest run ID 175af601-b41c-46ec-b80d-7f20b66bc4f5 with nextest profile: default\n Starting 3215 tests across 41 binaries (177 tests skipped)\n────────────\n Summary [ 13.453s] 3215 tests run: 3215 passed, 177 skipped\n",
|
||||
"command.output": "",
|
||||
"graph.rankdir": "LR",
|
||||
"internal.retry_count.preflight_lint": 1
|
||||
},
|
||||
|
|
@ -116,6 +120,15 @@
|
|||
"notes": "Script completed: cargo check -q --workspace 2>&1",
|
||||
"duration_ms": 68143
|
||||
},
|
||||
"fmt": {
|
||||
"status": "success",
|
||||
"context_updates": {
|
||||
"command.stderr": "",
|
||||
"command.output": ""
|
||||
},
|
||||
"notes": "Script completed: cargo fmt --all 2>&1",
|
||||
"duration_ms": 1103
|
||||
},
|
||||
"verify": {
|
||||
"status": "success",
|
||||
"context_updates": {
|
||||
|
|
@ -152,12 +165,13 @@
|
|||
"duration_ms": 0
|
||||
}
|
||||
},
|
||||
"next_node_id": "fmt",
|
||||
"next_node_id": "exit",
|
||||
"loop_failure_signatures": {
|
||||
"simplify_gpt|deterministic|api_deterministic|anthropic|not_found": 1
|
||||
},
|
||||
"node_visits": {
|
||||
"verify": 1,
|
||||
"fmt": 1,
|
||||
"start": 1,
|
||||
"simplify_opus": 1,
|
||||
"toolchain": 1,
|
||||
|
|
|
|||
5
nodes/fmt/script_invocation.json
Normal file
5
nodes/fmt/script_invocation.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"command": "cargo fmt --all 2>&1",
|
||||
"language": "shell",
|
||||
"timeout_ms": null
|
||||
}
|
||||
5
nodes/fmt/script_timing.json
Normal file
5
nodes/fmt/script_timing.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"duration_ms": 1102,
|
||||
"exit_code": 0,
|
||||
"timed_out": false
|
||||
}
|
||||
6
nodes/fmt/status.json
Normal file
6
nodes/fmt/status.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"status": "success",
|
||||
"notes": "Script completed: cargo fmt --all 2>&1",
|
||||
"failure_reason": null,
|
||||
"timestamp": "2026-03-20T01:42:17.299668+00:00"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue