mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-10 22:43:37 +00:00
parent
e9d4bf6eec
commit
7e47edef4c
5 changed files with 177 additions and 10 deletions
167
run.json
167
run.json
|
|
@ -505,7 +505,7 @@
|
|||
"kind": "running"
|
||||
},
|
||||
"status_updated_at": "2026-05-28T00:17:17.965930Z",
|
||||
"last_event_at": "2026-05-28T00:17:25.623645Z",
|
||||
"last_event_at": "2026-05-28T00:19:37.858096Z",
|
||||
"pending_control": null,
|
||||
"checkpoints": [
|
||||
{
|
||||
|
|
@ -609,9 +609,9 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"seq": 0,
|
||||
"seq": 38,
|
||||
"checkpoint": {
|
||||
"timestamp": "2026-05-28T00:19:34.146370Z",
|
||||
"timestamp": "2026-05-28T00:19:37.854447Z",
|
||||
"current_node": "preflight_compile",
|
||||
"completed_nodes": [
|
||||
"start",
|
||||
|
|
@ -620,15 +620,98 @@
|
|||
],
|
||||
"node_retries": {},
|
||||
"context_values": {
|
||||
"outcome": "succeeded",
|
||||
"current_node": "preflight_compile",
|
||||
"internal.retry_count.toolchain": 0,
|
||||
"internal.node_visit_count": 1,
|
||||
"internal.retry_count.preflight_compile": 0,
|
||||
"thread.start.current_node": "toolchain",
|
||||
"internal.fidelity": "compact",
|
||||
"internal.retry_count.start": 0,
|
||||
"graph.goal": "# Issue #399: Add automation run endpoints\n\n- URL: https://github.com/fabro-sh/fabro/issues/399\n- State: OPEN\n- Author: Bryan Helmkamp (@brynary)\n- Created: 2026-05-25T15:06:27Z\n- Updated: 2026-05-25T15:06:27Z\n- Labels: None\n- Assignees: None\n- Milestone: None\n- Comments: 0\n\n---\n\n## Goal\n\nExpose API endpoints for listing runs associated with an automation and starting a run through an enabled API trigger.\n\n## Scope\n\nImplement these endpoints:\n\n```http\nGET /automations/{id}/runs\nPOST /automations/{id}/runs\n```\n\n`GET /automations/{id}/runs` behavior:\n\n- Require the automation definition to exist; return 404 when it does not.\n- List cached runs from the existing run store.\n- Filter by `run.automation.as_ref().is_some_and(|a| a.id == id)`.\n- Sort newest first.\n- Support `page[limit]` and `page[offset]` using existing pagination behavior.\n- Return the existing paginated run list envelope:\n\n```json\n{\n \"data\": [],\n \"meta\": { \"has_more\": false, \"total\": 0 }\n}\n```\n\n`POST /automations/{id}/runs` behavior:\n\n- Use `RequiredRunToolActor`.\n- Require the automation to exist and be enabled.\n- Find an enabled trigger where `type = \"api\"`.\n- Return 409 with API error code `automation_api_trigger_disabled` when the automation is disabled or no enabled API trigger is available.\n- Materialize the run manifest using the configured `AutomationRunMaterializer`.\n- Call the shared create-run helper with:\n\n```rust\nAutomationRef {\n id: automation.id.to_string(),\n name: Some(automation.name.clone()),\n trigger_id: Some(api_trigger.id.to_string()),\n}\n```\n\n- Return 201 and the normal `Run` response shape with automation metadata populated.\n\nFinal integration expectations:\n\n- Automation-created runs are visible through normal run APIs.\n- Automation-created runs are visible through `GET /automations/{id}/runs`.\n- Run history is derived from persisted/cached runs; no runtime automation state store is introduced.\n- Schedule trigger expressions are stored and validated by earlier phases but are not scheduled by this endpoint work.\n\n## Files\n\nModify:\n\n- `lib/crates/fabro-server/src/server/handler/automations.rs`\n- `lib/crates/fabro-server/src/server/handler/runs.rs`, only if additional helper exposure is needed from the previous phase\n- `lib/crates/fabro-server/tests/it/api/automations.rs`\n- `lib/crates/fabro-server/tests/it/api/mod.rs`\n\n## Acceptance Criteria\n\n- Disabled automations cannot start runs through the automation run endpoint.\n- Automations without an enabled API trigger cannot start runs through the automation run endpoint.\n- A successful API-triggered automation run returns a normal `Run` response with `automation.id`, `automation.name`, and `automation.trigger_id`.\n- The automation run listing endpoint returns only runs linked to that automation.\n- Automation run listings are newest-first and paginate correctly.\n- No scheduler, web UI route/component, or CLI command is added.\n\n## Verification\n\nAdd integration tests using the fake materializer for:\n\n- Disabled automation returns 409.\n- Disabled API trigger returns 409.\n- Missing API trigger returns 409.\n- Successful run creation returns 201.\n- Created run persists `Run.automation`.\n- Associated run listing includes the run.\n- Run listing excludes runs from other automations.\n- Run listing pagination and newest-first sorting.\n\nRun:\n\n```bash\ncargo nextest run -p fabro-automation\ncargo nextest run -p fabro-api\ncargo nextest run -p fabro-server automations\ncargo nextest run -p fabro-server openapi_conformance\ncargo +nightly-2026-04-14 fmt --check --all\ncargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D warnings\ngit diff -- apps/fabro-web lib/crates/fabro-cli\n```\n\nExpected: focused tests and checks pass; web UI and CLI command modules remain unchanged.\n",
|
||||
"internal.work_dir": "/home/daytona/workspace/fabro",
|
||||
"command.output": "blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126",
|
||||
"failure_class": "",
|
||||
"failure_signature": "",
|
||||
"internal.run_id": "01KSNZ26XXV9Y70FDJQHBQ0CC4",
|
||||
"internal.thread_id": "toolchain",
|
||||
"graph.model_stylesheet": "\n * { model: claude-opus-4-7; }\n ",
|
||||
"thread.toolchain.current_node": "preflight_compile",
|
||||
"graph.rankdir": "LR"
|
||||
},
|
||||
"node_outcomes": {
|
||||
"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": 128511,
|
||||
"active_time_ms": 128511
|
||||
}
|
||||
},
|
||||
"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": 1398,
|
||||
"active_time_ms": 1398
|
||||
}
|
||||
}
|
||||
},
|
||||
"next_node_id": "preflight_lint",
|
||||
"git_commit_sha": "b19f618644ebcd18f2249f127df35ce6cdfbf471",
|
||||
"node_visits": {
|
||||
"start": 1,
|
||||
"toolchain": 1,
|
||||
"preflight_compile": 1
|
||||
}
|
||||
},
|
||||
"diff": {
|
||||
"summary": {
|
||||
"files_changed": 0,
|
||||
"additions": 0,
|
||||
"deletions": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"seq": 0,
|
||||
"checkpoint": {
|
||||
"timestamp": "2026-05-28T00:22:01.215539Z",
|
||||
"current_node": "preflight_lint",
|
||||
"completed_nodes": [
|
||||
"start",
|
||||
"toolchain",
|
||||
"preflight_compile",
|
||||
"preflight_lint"
|
||||
],
|
||||
"node_retries": {},
|
||||
"context_values": {
|
||||
"current_node": "preflight_lint",
|
||||
"thread.toolchain.current_node": "preflight_compile",
|
||||
"internal.fidelity": "compact",
|
||||
"internal.run_id": "01KSNZ26XXV9Y70FDJQHBQ0CC4",
|
||||
"internal.retry_count.preflight_compile": 0,
|
||||
"outcome": "succeeded",
|
||||
"thread.preflight_compile.current_node": "preflight_lint",
|
||||
"internal.node_visit_count": 1,
|
||||
"internal.work_dir": "/home/daytona/workspace/fabro",
|
||||
"internal.thread_id": "toolchain",
|
||||
"internal.thread_id": "preflight_compile",
|
||||
"failure_class": "",
|
||||
"thread.start.current_node": "toolchain",
|
||||
"command.output": "blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126",
|
||||
|
|
@ -636,6 +719,7 @@
|
|||
"graph.rankdir": "LR",
|
||||
"graph.goal": "# Issue #399: Add automation run endpoints\n\n- URL: https://github.com/fabro-sh/fabro/issues/399\n- State: OPEN\n- Author: Bryan Helmkamp (@brynary)\n- Created: 2026-05-25T15:06:27Z\n- Updated: 2026-05-25T15:06:27Z\n- Labels: None\n- Assignees: None\n- Milestone: None\n- Comments: 0\n\n---\n\n## Goal\n\nExpose API endpoints for listing runs associated with an automation and starting a run through an enabled API trigger.\n\n## Scope\n\nImplement these endpoints:\n\n```http\nGET /automations/{id}/runs\nPOST /automations/{id}/runs\n```\n\n`GET /automations/{id}/runs` behavior:\n\n- Require the automation definition to exist; return 404 when it does not.\n- List cached runs from the existing run store.\n- Filter by `run.automation.as_ref().is_some_and(|a| a.id == id)`.\n- Sort newest first.\n- Support `page[limit]` and `page[offset]` using existing pagination behavior.\n- Return the existing paginated run list envelope:\n\n```json\n{\n \"data\": [],\n \"meta\": { \"has_more\": false, \"total\": 0 }\n}\n```\n\n`POST /automations/{id}/runs` behavior:\n\n- Use `RequiredRunToolActor`.\n- Require the automation to exist and be enabled.\n- Find an enabled trigger where `type = \"api\"`.\n- Return 409 with API error code `automation_api_trigger_disabled` when the automation is disabled or no enabled API trigger is available.\n- Materialize the run manifest using the configured `AutomationRunMaterializer`.\n- Call the shared create-run helper with:\n\n```rust\nAutomationRef {\n id: automation.id.to_string(),\n name: Some(automation.name.clone()),\n trigger_id: Some(api_trigger.id.to_string()),\n}\n```\n\n- Return 201 and the normal `Run` response shape with automation metadata populated.\n\nFinal integration expectations:\n\n- Automation-created runs are visible through normal run APIs.\n- Automation-created runs are visible through `GET /automations/{id}/runs`.\n- Run history is derived from persisted/cached runs; no runtime automation state store is introduced.\n- Schedule trigger expressions are stored and validated by earlier phases but are not scheduled by this endpoint work.\n\n## Files\n\nModify:\n\n- `lib/crates/fabro-server/src/server/handler/automations.rs`\n- `lib/crates/fabro-server/src/server/handler/runs.rs`, only if additional helper exposure is needed from the previous phase\n- `lib/crates/fabro-server/tests/it/api/automations.rs`\n- `lib/crates/fabro-server/tests/it/api/mod.rs`\n\n## Acceptance Criteria\n\n- Disabled automations cannot start runs through the automation run endpoint.\n- Automations without an enabled API trigger cannot start runs through the automation run endpoint.\n- A successful API-triggered automation run returns a normal `Run` response with `automation.id`, `automation.name`, and `automation.trigger_id`.\n- The automation run listing endpoint returns only runs linked to that automation.\n- Automation run listings are newest-first and paginate correctly.\n- No scheduler, web UI route/component, or CLI command is added.\n\n## Verification\n\nAdd integration tests using the fake materializer for:\n\n- Disabled automation returns 409.\n- Disabled API trigger returns 409.\n- Missing API trigger returns 409.\n- Successful run creation returns 201.\n- Created run persists `Run.automation`.\n- Associated run listing includes the run.\n- Run listing excludes runs from other automations.\n- Run listing pagination and newest-first sorting.\n\nRun:\n\n```bash\ncargo nextest run -p fabro-automation\ncargo nextest run -p fabro-api\ncargo nextest run -p fabro-server automations\ncargo nextest run -p fabro-server openapi_conformance\ncargo +nightly-2026-04-14 fmt --check --all\ncargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D warnings\ngit diff -- apps/fabro-web lib/crates/fabro-cli\n```\n\nExpected: focused tests and checks pass; web UI and CLI command modules remain unchanged.\n",
|
||||
"internal.retry_count.toolchain": 0,
|
||||
"internal.retry_count.preflight_lint": 0,
|
||||
"failure_signature": "",
|
||||
"internal.retry_count.start": 0
|
||||
},
|
||||
|
|
@ -658,6 +742,20 @@
|
|||
"status": "succeeded",
|
||||
"usage": null
|
||||
},
|
||||
"preflight_lint": {
|
||||
"status": "succeeded",
|
||||
"context_updates": {
|
||||
"command.output": "blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126"
|
||||
},
|
||||
"notes": "Script completed: cargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1",
|
||||
"usage": null,
|
||||
"timing": {
|
||||
"wall_time_ms": 0,
|
||||
"inference_time_ms": 0,
|
||||
"tool_time_ms": 143345,
|
||||
"active_time_ms": 143345
|
||||
}
|
||||
},
|
||||
"preflight_compile": {
|
||||
"status": "succeeded",
|
||||
"context_updates": {
|
||||
|
|
@ -673,11 +771,12 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"next_node_id": "preflight_lint",
|
||||
"next_node_id": "implement",
|
||||
"node_visits": {
|
||||
"start": 1,
|
||||
"toolchain": 1,
|
||||
"preflight_compile": 1
|
||||
"preflight_compile": 1,
|
||||
"start": 1,
|
||||
"preflight_lint": 1
|
||||
}
|
||||
},
|
||||
"diff": {}
|
||||
|
|
@ -713,7 +812,12 @@
|
|||
"first_event_seq": 31,
|
||||
"prompt": null,
|
||||
"response": null,
|
||||
"completion": null,
|
||||
"completion": {
|
||||
"outcome": "succeeded",
|
||||
"notes": "Script completed: cargo check -q --workspace 2>&1",
|
||||
"failure_reason": null,
|
||||
"timestamp": "2026-05-28T00:19:34.145318Z"
|
||||
},
|
||||
"provider_used": null,
|
||||
"diff": null,
|
||||
"script_invocation": {
|
||||
|
|
@ -721,11 +825,27 @@
|
|||
"command": "exec 2>&1\ncargo check -q --workspace 2>&1",
|
||||
"language": "shell"
|
||||
},
|
||||
"script_timing": null,
|
||||
"script_timing": {
|
||||
"output": "blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126",
|
||||
"exit_code": 0,
|
||||
"duration_ms": 128511,
|
||||
"termination": "exited",
|
||||
"output_bytes": 0,
|
||||
"live_streaming": false
|
||||
},
|
||||
"parallel_results": null,
|
||||
"output": null,
|
||||
"output_bytes": 0,
|
||||
"live_streaming": false,
|
||||
"termination": "exited",
|
||||
"started_at": "2026-05-28T00:17:25.623407Z",
|
||||
"handler": "command",
|
||||
"timing": {
|
||||
"wall_time_ms": 128521,
|
||||
"inference_time_ms": 0,
|
||||
"tool_time_ms": 128511,
|
||||
"active_time_ms": 128511
|
||||
},
|
||||
"usage": {
|
||||
"input_tokens": 0,
|
||||
"output_tokens": 0,
|
||||
|
|
@ -734,7 +854,7 @@
|
|||
"cache_read_tokens": 0,
|
||||
"cache_write_tokens": 0
|
||||
},
|
||||
"state": "running"
|
||||
"state": "succeeded"
|
||||
},
|
||||
"toolchain@1": {
|
||||
"first_event_seq": 21,
|
||||
|
|
@ -784,6 +904,33 @@
|
|||
},
|
||||
"state": "succeeded"
|
||||
},
|
||||
"preflight_lint@1": {
|
||||
"first_event_seq": 41,
|
||||
"prompt": null,
|
||||
"response": null,
|
||||
"completion": null,
|
||||
"provider_used": null,
|
||||
"diff": null,
|
||||
"script_invocation": {
|
||||
"script": "cargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1",
|
||||
"command": "exec 2>&1\ncargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1",
|
||||
"language": "shell"
|
||||
},
|
||||
"script_timing": null,
|
||||
"parallel_results": null,
|
||||
"output": null,
|
||||
"started_at": "2026-05-28T00:19:37.857664Z",
|
||||
"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,
|
||||
|
|
|
|||
1
stages/003-preflight_compile@1/output.log
Normal file
1
stages/003-preflight_compile@1/output.log
Normal file
|
|
@ -0,0 +1 @@
|
|||
blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126
|
||||
8
stages/003-preflight_compile@1/script_timing.json
Normal file
8
stages/003-preflight_compile@1/script_timing.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"output": "blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126",
|
||||
"exit_code": 0,
|
||||
"duration_ms": 128511,
|
||||
"termination": "exited",
|
||||
"output_bytes": 0,
|
||||
"live_streaming": false
|
||||
}
|
||||
6
stages/003-preflight_compile@1/status.json
Normal file
6
stages/003-preflight_compile@1/status.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"outcome": "succeeded",
|
||||
"notes": "Script completed: cargo check -q --workspace 2>&1",
|
||||
"failure_reason": null,
|
||||
"timestamp": "2026-05-28T00:19:34.145318Z"
|
||||
}
|
||||
5
stages/004-preflight_lint@1/script_invocation.json
Normal file
5
stages/004-preflight_lint@1/script_invocation.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"script": "cargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1",
|
||||
"command": "exec 2>&1\ncargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1",
|
||||
"language": "shell"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue