mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-05 08:10:39 +00:00
parent
282b91182e
commit
6053fd67c6
4 changed files with 38 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"timestamp": "2026-03-20T01:34:53.908320Z",
|
||||
"current_node": "verify",
|
||||
"timestamp": "2026-03-20T01:34:57.513871Z",
|
||||
"current_node": "fmt",
|
||||
"completed_nodes": [
|
||||
"start",
|
||||
"toolchain",
|
||||
|
|
@ -9,7 +9,8 @@
|
|||
"implement",
|
||||
"simplify_opus",
|
||||
"simplify_gpt",
|
||||
"verify"
|
||||
"verify",
|
||||
"fmt"
|
||||
],
|
||||
"node_retries": {
|
||||
"start": 1,
|
||||
|
|
@ -19,18 +20,19 @@
|
|||
"implement": 1,
|
||||
"preflight_lint": 1,
|
||||
"simplify_opus": 1,
|
||||
"fmt": 1,
|
||||
"toolchain": 1
|
||||
},
|
||||
"context_values": {
|
||||
"command.stderr": "",
|
||||
"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 513b6b6c-8286-459f-88a7-c9393d885b51 with nextest profile: default\n Starting 3215 tests across 41 binaries (177 tests skipped)\n────────────\n Summary [ 13.545s] 3215 tests run: 3215 passed, 177 skipped\n",
|
||||
"command.output": "",
|
||||
"last_response": "All tests pass and clippy is clean. \n\n**Summary: The code is already clean — no changes needed.**\n\nThe three review agents found:\n- **No code reuse issues** — the one-liner JSON mapping is appropr",
|
||||
"response.implement": "All 390 tests pass and clippy is clean with zero warnings.\n\n## Summary\n\nImplemented the mapping of `reasoning_effort` to Anthropic's `output_config.effort` in three TDD steps:\n\n1. **Added two failing tests** — `build_api_request_maps_reasoning_effort_to_output_config` (asserts `output_config == Some({\"effort\": \"medium\"})`) and `build_api_request_omits_output_config_when_no_reasoning_effort` (asserts `output_config.is_none()`).\n\n2. **Added `output_config: Option<serde_json::Value>` field** to the `ApiRequest` struct (with `skip_serializing_if`), and set it to `None` in all existing construction sites. At this point Test B passed and Test A failed, proving the bug.\n\n3. **Mapped `reasoning_effort` → `output_config`** in `build_api_request` by computing `output_config` from `request.reasoning_effort` (mirroring the OpenAI provider pattern) and wiring it into the `ApiRequest` construction. Both tests now pass.",
|
||||
"internal.retry_count.preflight_compile": 1,
|
||||
"internal.thread_id": "simplify_gpt",
|
||||
"internal.thread_id": "verify",
|
||||
"internal.retry_count.preflight_lint": 1,
|
||||
"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",
|
||||
"current_node": "verify",
|
||||
"current_node": "fmt",
|
||||
"thread.simplify_opus.current_node": "simplify_gpt",
|
||||
"thread.start.current_node": "toolchain",
|
||||
"thread.preflight_compile.current_node": "preflight_lint",
|
||||
|
|
@ -45,15 +47,17 @@
|
|||
"internal.retry_count.simplify_gpt": 1,
|
||||
"thread.toolchain.current_node": "preflight_compile",
|
||||
"internal.retry_count.implement": 1,
|
||||
"internal.retry_count.fmt": 1,
|
||||
"internal.node_visit_count": 1,
|
||||
"response.simplify_opus": "All tests pass and clippy is clean. \n\n**Summary: The code is already clean — no changes needed.**\n\nThe three review agents found:\n- **No code reuse issues** — the one-liner JSON mapping is appropriately inline in each provider\n- **No efficiency issues** — trivial cost on a network-bound code path \n- **One pre-existing quality observation** (stringly-typed `reasoning_effort`) that is out of scope for this change — it's a codebase-wide pattern that would require a multi-crate refactor to address properly",
|
||||
"internal.retry_count.start": 1,
|
||||
"internal.fidelity": "compact",
|
||||
"thread.preflight_lint.current_node": "implement",
|
||||
"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.2k tokens in / 3.8k out\n - Files: /home/daytona/workspace/lib/crates/fabro-llm/src/providers/anthropic.rs\n- **simplify_opus**: success\n - Model: claude-opus-4-6, 13.2k tokens in / 4.1k out\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.2k tokens in / 3.8k out\n - Files: /home/daytona/workspace/lib/crates/fabro-llm/src/providers/anthropic.rs\n- **simplify_opus**: success\n - Model: claude-opus-4-6, 13.2k tokens in / 4.1k out\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 513b6b6c-8286-459f-88a7-c9393d885b51 with nextest profile: default\n Starting 3215 tests across 41 binaries (177 tests skipped)\n ────────────\n Summary [ 13.545s] 3215 tests run: 3215 passed, 177 skipped\n ```\n - Stderr: (empty)\n",
|
||||
"outcome": "success",
|
||||
"internal.retry_count.verify": 1,
|
||||
"failure_signature": "",
|
||||
"thread.verify.current_node": "fmt",
|
||||
"graph.rankdir": "LR"
|
||||
},
|
||||
"logs": [],
|
||||
|
|
@ -139,6 +143,15 @@
|
|||
"status": "success",
|
||||
"duration_ms": 0
|
||||
},
|
||||
"fmt": {
|
||||
"status": "success",
|
||||
"context_updates": {
|
||||
"command.stderr": "",
|
||||
"command.output": ""
|
||||
},
|
||||
"notes": "Script completed: cargo fmt --all 2>&1",
|
||||
"duration_ms": 1098
|
||||
},
|
||||
"simplify_gpt": {
|
||||
"status": "fail",
|
||||
"failure": {
|
||||
|
|
@ -149,7 +162,7 @@
|
|||
"duration_ms": 419
|
||||
}
|
||||
},
|
||||
"next_node_id": "fmt",
|
||||
"next_node_id": "exit",
|
||||
"loop_failure_signatures": {
|
||||
"simplify_gpt|deterministic|api_deterministic|anthropic|not_found": 1
|
||||
},
|
||||
|
|
@ -158,6 +171,7 @@
|
|||
"preflight_lint": 1,
|
||||
"simplify_gpt": 1,
|
||||
"simplify_opus": 1,
|
||||
"fmt": 1,
|
||||
"toolchain": 1,
|
||||
"verify": 1,
|
||||
"preflight_compile": 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": 1096,
|
||||
"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:34:57.513302+00:00"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue