diff --git a/run.json b/run.json index 2e3e7a983..5500e9374 100644 --- a/run.json +++ b/run.json @@ -505,7 +505,7 @@ "kind": "running" }, "status_updated_at": "2026-05-27T20:21:07.705651Z", - "last_event_at": "2026-05-27T20:21:11.108001Z", + "last_event_at": "2026-05-27T20:21:25.357192Z", "pending_control": null, "checkpoints": [ { @@ -546,9 +546,9 @@ "diff": {} }, { - "seq": 0, + "seq": 28, "checkpoint": { - "timestamp": "2026-05-27T20:21:12.956149Z", + "timestamp": "2026-05-27T20:21:25.356110Z", "current_node": "toolchain", "completed_nodes": [ "start", @@ -556,22 +556,22 @@ ], "node_retries": {}, "context_values": { - "thread.start.current_node": "toolchain", - "current_node": "toolchain", - "internal.node_visit_count": 1, - "internal.thread_id": "start", - "internal.run_id": "01KSNHHJ558NP7RY00VDW5WSAV", - "internal.work_dir": "/home/daytona/workspace/fabro", - "internal.retry_count.start": 0, - "internal.retry_count.toolchain": 0, - "graph.model_stylesheet": "\n * { model: claude-opus-4-7; }\n ", - "failure_signature": "", - "failure_class": "", - "command.output": "blob://sha256/fc14b2ba2d770e5cd3169df7a29525c962adfc4cfa3097b9098c63ebd61a748c", "outcome": "succeeded", "graph.rankdir": "LR", + "internal.run_id": "01KSNHHJ558NP7RY00VDW5WSAV", + "thread.start.current_node": "toolchain", + "command.output": "blob://sha256/fc14b2ba2d770e5cd3169df7a29525c962adfc4cfa3097b9098c63ebd61a748c", + "current_node": "toolchain", + "failure_signature": "", + "graph.model_stylesheet": "\n * { model: claude-opus-4-7; }\n ", + "internal.fidelity": "compact", + "internal.retry_count.start": 0, + "internal.thread_id": "start", + "internal.work_dir": "/home/daytona/workspace/fabro", "graph.goal": "# Issue #397: Wire automation store and CRUD API\n\nSource: https://github.com/fabro-sh/fabro/issues/397\nState: OPEN\nAuthor: brynary\nCreated: 2026-05-25T15:06:25Z\nUpdated: 2026-05-25T15:06:25Z\nLabels: none\nAssignees: none\nComments: none\n\n## Body\n\n## Goal\n\nLoad the automation store into server state and expose authenticated REST endpoints for managing automation definitions.\n\n## Scope\n\nServer state:\n\n- Add `fabro-automation = { path = \"../fabro-automation\" }` to `fabro-server`.\n- Add `automation_store: Arc` to `AppState`.\n- In `build_app_state`, compute the automation directory as:\n\n```rust\nlet automation_dir = active_config_path\n .parent()\n .unwrap_or_else(|| std::path::Path::new(\".\"))\n .join(\"automations\");\n```\n\n- Load `AutomationStore::load(automation_dir)` before constructing `AppState`.\n- Fail server startup if an existing automation file is malformed.\n- Add a crate-private `automation_store()` accessor.\n- Keep test support isolated so each test using a temp active config path gets its own sibling `automations` directory.\n\nCRUD API:\n\n- Create `lib/crates/fabro-server/src/server/handler/automations.rs`.\n- Wire automation routes into real server routes.\n- Use `RequiredUser` for CRUD routes.\n- Implement shared request helpers for path ID parsing, quoted/unquoted `If-Match` parsing, ETag formatting, and `AutomationStoreError` to API error mapping.\n- Missing `If-Match` on replace/delete should return HTTP 428.\n- Stale revisions should return HTTP 409.\n- Domain validation failures should return HTTP 422.\n\nImplement these endpoints:\n\n```http\nGET /automations\nPOST /automations\nGET /automations/{id}\nPUT /automations/{id}\nDELETE /automations/{id}\n```\n\nEndpoint behavior:\n\n- `GET /automations` returns `{ data, meta: { total } }`, sorted by automation ID ascending.\n- `POST /automations` creates a new automation and returns 201; duplicate IDs return 409.\n- `GET /automations/{id}` returns 200 with `ETag: \"\"`; missing automation returns 404.\n- `PUT /automations/{id}` requires `If-Match`, fully replaces the automation, and returns 200 with a new ETag.\n- `DELETE /automations/{id}` requires `If-Match` and returns 204 on success.\n\n## Files\n\nModify:\n\n- `lib/crates/fabro-server/Cargo.toml`\n- `lib/crates/fabro-server/src/server.rs`\n- `lib/crates/fabro-server/src/server/handler/mod.rs`\n- `lib/crates/fabro-server/src/test_support.rs`\n- `lib/crates/fabro-server/tests/it/api/mod.rs`\n\nCreate:\n\n- `lib/crates/fabro-server/src/server/handler/automations.rs`\n- `lib/crates/fabro-server/tests/it/api/automations.rs`\n\nRead before implementation:\n\n- `docs/internal/logging-strategy.md`\n- `docs/internal/error-handling-strategy.md`\n- `docs/internal/testing-strategy.md`\n\n## Acceptance Criteria\n\n- A server with no `automations/` directory starts and returns an empty automation list.\n- Malformed persisted automation TOML fails server startup.\n- Creating an automation writes `dirname(active_config_path)/automations/.toml`.\n- Reading an automation returns the current ETag revision.\n- Replacing or deleting an automation requires `If-Match`.\n- Stale revisions are rejected.\n- Invalid automation and trigger shapes are rejected with 422.\n- CRUD routes require the existing authenticated user behavior used by real API routes.\n\n## Verification\n\nAdd integration tests for:\n\n- Empty list.\n- Create automation.\n- Duplicate create.\n- Get automation with ETag.\n- Replace automation.\n- Stale replace.\n- Missing `If-Match`.\n- Delete automation.\n- Invalid trigger IDs.\n- Duplicate trigger IDs.\n- Second trigger with `type = \"api\"`.\n- Invalid schedule expression.\n\nRun:\n\n```bash\ncargo nextest run -p fabro-server automations\ncargo nextest run -p fabro-server automation_store\n```\n", - "internal.fidelity": "compact" + "internal.retry_count.toolchain": 0, + "failure_class": "", + "internal.node_visit_count": 1 }, "node_outcomes": { "toolchain": { @@ -594,11 +594,92 @@ } }, "next_node_id": "preflight_compile", + "git_commit_sha": "6eacaa6c8b8467505346551ee09c7676f9984d66", "node_visits": { "toolchain": 1, "start": 1 } }, + "diff": { + "summary": { + "files_changed": 0, + "additions": 0, + "deletions": 0 + } + } + }, + { + "seq": 0, + "checkpoint": { + "timestamp": "2026-05-27T20:23:45.032583Z", + "current_node": "preflight_compile", + "completed_nodes": [ + "start", + "toolchain", + "preflight_compile" + ], + "node_retries": {}, + "context_values": { + "thread.start.current_node": "toolchain", + "current_node": "preflight_compile", + "internal.node_visit_count": 1, + "internal.thread_id": "toolchain", + "internal.retry_count.preflight_compile": 0, + "internal.run_id": "01KSNHHJ558NP7RY00VDW5WSAV", + "internal.work_dir": "/home/daytona/workspace/fabro", + "internal.retry_count.start": 0, + "internal.retry_count.toolchain": 0, + "thread.toolchain.current_node": "preflight_compile", + "graph.model_stylesheet": "\n * { model: claude-opus-4-7; }\n ", + "failure_signature": "", + "failure_class": "", + "command.output": "blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126", + "outcome": "succeeded", + "graph.rankdir": "LR", + "graph.goal": "# Issue #397: Wire automation store and CRUD API\n\nSource: https://github.com/fabro-sh/fabro/issues/397\nState: OPEN\nAuthor: brynary\nCreated: 2026-05-25T15:06:25Z\nUpdated: 2026-05-25T15:06:25Z\nLabels: none\nAssignees: none\nComments: none\n\n## Body\n\n## Goal\n\nLoad the automation store into server state and expose authenticated REST endpoints for managing automation definitions.\n\n## Scope\n\nServer state:\n\n- Add `fabro-automation = { path = \"../fabro-automation\" }` to `fabro-server`.\n- Add `automation_store: Arc` to `AppState`.\n- In `build_app_state`, compute the automation directory as:\n\n```rust\nlet automation_dir = active_config_path\n .parent()\n .unwrap_or_else(|| std::path::Path::new(\".\"))\n .join(\"automations\");\n```\n\n- Load `AutomationStore::load(automation_dir)` before constructing `AppState`.\n- Fail server startup if an existing automation file is malformed.\n- Add a crate-private `automation_store()` accessor.\n- Keep test support isolated so each test using a temp active config path gets its own sibling `automations` directory.\n\nCRUD API:\n\n- Create `lib/crates/fabro-server/src/server/handler/automations.rs`.\n- Wire automation routes into real server routes.\n- Use `RequiredUser` for CRUD routes.\n- Implement shared request helpers for path ID parsing, quoted/unquoted `If-Match` parsing, ETag formatting, and `AutomationStoreError` to API error mapping.\n- Missing `If-Match` on replace/delete should return HTTP 428.\n- Stale revisions should return HTTP 409.\n- Domain validation failures should return HTTP 422.\n\nImplement these endpoints:\n\n```http\nGET /automations\nPOST /automations\nGET /automations/{id}\nPUT /automations/{id}\nDELETE /automations/{id}\n```\n\nEndpoint behavior:\n\n- `GET /automations` returns `{ data, meta: { total } }`, sorted by automation ID ascending.\n- `POST /automations` creates a new automation and returns 201; duplicate IDs return 409.\n- `GET /automations/{id}` returns 200 with `ETag: \"\"`; missing automation returns 404.\n- `PUT /automations/{id}` requires `If-Match`, fully replaces the automation, and returns 200 with a new ETag.\n- `DELETE /automations/{id}` requires `If-Match` and returns 204 on success.\n\n## Files\n\nModify:\n\n- `lib/crates/fabro-server/Cargo.toml`\n- `lib/crates/fabro-server/src/server.rs`\n- `lib/crates/fabro-server/src/server/handler/mod.rs`\n- `lib/crates/fabro-server/src/test_support.rs`\n- `lib/crates/fabro-server/tests/it/api/mod.rs`\n\nCreate:\n\n- `lib/crates/fabro-server/src/server/handler/automations.rs`\n- `lib/crates/fabro-server/tests/it/api/automations.rs`\n\nRead before implementation:\n\n- `docs/internal/logging-strategy.md`\n- `docs/internal/error-handling-strategy.md`\n- `docs/internal/testing-strategy.md`\n\n## Acceptance Criteria\n\n- A server with no `automations/` directory starts and returns an empty automation list.\n- Malformed persisted automation TOML fails server startup.\n- Creating an automation writes `dirname(active_config_path)/automations/.toml`.\n- Reading an automation returns the current ETag revision.\n- Replacing or deleting an automation requires `If-Match`.\n- Stale revisions are rejected.\n- Invalid automation and trigger shapes are rejected with 422.\n- CRUD routes require the existing authenticated user behavior used by real API routes.\n\n## Verification\n\nAdd integration tests for:\n\n- Empty list.\n- Create automation.\n- Duplicate create.\n- Get automation with ETag.\n- Replace automation.\n- Stale replace.\n- Missing `If-Match`.\n- Delete automation.\n- Invalid trigger IDs.\n- Duplicate trigger IDs.\n- Second trigger with `type = \"api\"`.\n- Invalid schedule expression.\n\nRun:\n\n```bash\ncargo nextest run -p fabro-server automations\ncargo nextest run -p fabro-server automation_store\n```\n", + "internal.fidelity": "compact" + }, + "node_outcomes": { + "start": { + "status": "succeeded", + "usage": null + }, + "toolchain": { + "status": "succeeded", + "context_updates": { + "command.output": "blob://sha256/fc14b2ba2d770e5cd3169df7a29525c962adfc4cfa3097b9098c63ebd61a748c" + }, + "notes": "Script completed: 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", + "usage": null, + "timing": { + "wall_time_ms": 0, + "inference_time_ms": 0, + "tool_time_ms": 1835, + "active_time_ms": 1835 + } + }, + "preflight_compile": { + "status": "succeeded", + "context_updates": { + "command.output": "blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126" + }, + "notes": "Script completed: cargo check -q --workspace 2>&1", + "usage": null, + "timing": { + "wall_time_ms": 0, + "inference_time_ms": 0, + "tool_time_ms": 139661, + "active_time_ms": 139661 + } + } + }, + "next_node_id": "preflight_lint", + "node_visits": { + "toolchain": 1, + "start": 1, + "preflight_compile": 1 + } + }, "diff": {} } ], @@ -632,7 +713,12 @@ "first_event_seq": 21, "prompt": null, "response": null, - "completion": null, + "completion": { + "outcome": "succeeded", + "notes": "Script completed: 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", + "failure_reason": null, + "timestamp": "2026-05-27T20:21:12.955389Z" + }, "provider_used": null, "diff": null, "script_invocation": { @@ -640,11 +726,27 @@ "command": "exec 2>&1\ncommand -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", "language": "shell" }, - "script_timing": null, + "script_timing": { + "output": "blob://sha256/fc14b2ba2d770e5cd3169df7a29525c962adfc4cfa3097b9098c63ebd61a748c", + "exit_code": 0, + "duration_ms": 1835, + "termination": "exited", + "output_bytes": 36, + "live_streaming": true + }, "parallel_results": null, "output": null, + "output_bytes": 36, + "live_streaming": true, + "termination": "exited", "started_at": "2026-05-27T20:21:11.107485Z", "handler": "command", + "timing": { + "wall_time_ms": 1847, + "inference_time_ms": 0, + "tool_time_ms": 1835, + "active_time_ms": 1835 + }, "usage": { "input_tokens": 0, "output_tokens": 0, @@ -653,7 +755,7 @@ "cache_read_tokens": 0, "cache_write_tokens": 0 }, - "state": "running" + "state": "succeeded" }, "start@1": { "first_event_seq": 17, @@ -688,6 +790,33 @@ "cache_write_tokens": 0 }, "state": "succeeded" + }, + "preflight_compile@1": { + "first_event_seq": 31, + "prompt": null, + "response": null, + "completion": null, + "provider_used": null, + "diff": null, + "script_invocation": { + "script": "cargo check -q --workspace 2>&1", + "command": "exec 2>&1\ncargo check -q --workspace 2>&1", + "language": "shell" + }, + "script_timing": null, + "parallel_results": null, + "output": null, + "started_at": "2026-05-27T20:21:25.356963Z", + "handler": "command", + "usage": { + "input_tokens": 0, + "output_tokens": 0, + "total_tokens": 0, + "reasoning_tokens": 0, + "cache_read_tokens": 0, + "cache_write_tokens": 0 + }, + "state": "running" } } } \ No newline at end of file diff --git a/stages/002-toolchain@1/output.log b/stages/002-toolchain@1/output.log new file mode 100644 index 000000000..4e86d161d --- /dev/null +++ b/stages/002-toolchain@1/output.log @@ -0,0 +1 @@ +blob://sha256/fc14b2ba2d770e5cd3169df7a29525c962adfc4cfa3097b9098c63ebd61a748c \ No newline at end of file diff --git a/stages/002-toolchain@1/script_timing.json b/stages/002-toolchain@1/script_timing.json new file mode 100644 index 000000000..71210ee95 --- /dev/null +++ b/stages/002-toolchain@1/script_timing.json @@ -0,0 +1,8 @@ +{ + "output": "blob://sha256/fc14b2ba2d770e5cd3169df7a29525c962adfc4cfa3097b9098c63ebd61a748c", + "exit_code": 0, + "duration_ms": 1835, + "termination": "exited", + "output_bytes": 36, + "live_streaming": true +} \ No newline at end of file diff --git a/stages/002-toolchain@1/status.json b/stages/002-toolchain@1/status.json new file mode 100644 index 000000000..265b715a3 --- /dev/null +++ b/stages/002-toolchain@1/status.json @@ -0,0 +1,6 @@ +{ + "outcome": "succeeded", + "notes": "Script completed: 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", + "failure_reason": null, + "timestamp": "2026-05-27T20:21:12.955389Z" +} \ No newline at end of file diff --git a/stages/003-preflight_compile@1/script_invocation.json b/stages/003-preflight_compile@1/script_invocation.json new file mode 100644 index 000000000..d3abb832f --- /dev/null +++ b/stages/003-preflight_compile@1/script_invocation.json @@ -0,0 +1,5 @@ +{ + "script": "cargo check -q --workspace 2>&1", + "command": "exec 2>&1\ncargo check -q --workspace 2>&1", + "language": "shell" +} \ No newline at end of file