diff --git a/run.json b/run.json index 56f167457..2e3e7a983 100644 --- a/run.json +++ b/run.json @@ -496,14 +496,112 @@ } }, "web_url": "http://127.0.0.1:32276/runs/01KSNHHJ558NP7RY00VDW5WSAV", - "start": null, - "status": { - "kind": "starting" + "start": { + "start_time": "2026-05-27T20:21:07.705604Z", + "run_branch": "fabro/run/01KSNHHJ558NP7RY00VDW5WSAV", + "base_sha": "c767db897f14b4e1bf4c7572f83b164c5650ce58" }, - "status_updated_at": "2026-05-27T20:20:46.941465Z", - "last_event_at": "2026-05-27T20:21:07.295516Z", + "status": { + "kind": "running" + }, + "status_updated_at": "2026-05-27T20:21:07.705651Z", + "last_event_at": "2026-05-27T20:21:11.108001Z", "pending_control": null, - "checkpoints": [], + "checkpoints": [ + { + "seq": 20, + "checkpoint": { + "timestamp": "2026-05-27T20:21:11.106907Z", + "current_node": "start", + "completed_nodes": [ + "start" + ], + "node_retries": {}, + "context_values": { + "current_node": "start", + "internal.fidelity": "compact", + "internal.retry_count.start": 0, + "internal.run_id": "01KSNHHJ558NP7RY00VDW5WSAV", + "failure_class": "", + "graph.model_stylesheet": "\n * { model: claude-opus-4-7; }\n ", + "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.thread_id": null, + "outcome": "succeeded", + "internal.node_visit_count": 1, + "internal.work_dir": "/home/daytona/workspace/fabro", + "graph.rankdir": "LR", + "failure_signature": "" + }, + "node_outcomes": { + "start": { + "status": "succeeded", + "usage": null + } + }, + "next_node_id": "toolchain", + "node_visits": { + "start": 1 + } + }, + "diff": {} + }, + { + "seq": 0, + "checkpoint": { + "timestamp": "2026-05-27T20:21:12.956149Z", + "current_node": "toolchain", + "completed_nodes": [ + "start", + "toolchain" + ], + "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", + "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": { + "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 + } + }, + "start": { + "status": "succeeded", + "usage": null + } + }, + "next_node_id": "preflight_compile", + "node_visits": { + "toolchain": 1, + "start": 1 + } + }, + "diff": {} + } + ], "conclusion": null, "sandbox": { "kind": "ready", @@ -529,5 +627,67 @@ "pull_request": null, "superseded_by": null, "pending_interviews": {}, - "stages": {} + "stages": { + "toolchain@1": { + "first_event_seq": 21, + "prompt": null, + "response": null, + "completion": null, + "provider_used": null, + "diff": null, + "script_invocation": { + "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", + "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, + "parallel_results": null, + "output": null, + "started_at": "2026-05-27T20:21:11.107485Z", + "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" + }, + "start@1": { + "first_event_seq": 17, + "prompt": null, + "response": null, + "completion": { + "outcome": "succeeded", + "notes": null, + "failure_reason": null, + "timestamp": "2026-05-27T20:21:11.106611Z" + }, + "provider_used": null, + "diff": null, + "script_invocation": null, + "script_timing": null, + "parallel_results": null, + "output": null, + "started_at": "2026-05-27T20:21:11.106359Z", + "handler": "start", + "timing": { + "wall_time_ms": 0, + "inference_time_ms": 0, + "tool_time_ms": 0, + "active_time_ms": 0 + }, + "usage": { + "input_tokens": 0, + "output_tokens": 0, + "total_tokens": 0, + "reasoning_tokens": 0, + "cache_read_tokens": 0, + "cache_write_tokens": 0 + }, + "state": "succeeded" + } + } } \ No newline at end of file diff --git a/stages/001-start@1/status.json b/stages/001-start@1/status.json new file mode 100644 index 000000000..60bf3274f --- /dev/null +++ b/stages/001-start@1/status.json @@ -0,0 +1,6 @@ +{ + "outcome": "succeeded", + "notes": null, + "failure_reason": null, + "timestamp": "2026-05-27T20:21:11.106611Z" +} \ No newline at end of file diff --git a/stages/002-toolchain@1/script_invocation.json b/stages/002-toolchain@1/script_invocation.json new file mode 100644 index 000000000..92c244949 --- /dev/null +++ b/stages/002-toolchain@1/script_invocation.json @@ -0,0 +1,5 @@ +{ + "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", + "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" +} \ No newline at end of file