checkpoint

⚒️ Generated with [Fabro](https://fabro.sh)
This commit is contained in:
Fabro 2026-05-27 20:42:57 -04:00
parent 7e47edef4c
commit fb63fb1d37
7 changed files with 568 additions and 9 deletions

382
run.json
View file

@ -505,7 +505,7 @@
"kind": "running"
},
"status_updated_at": "2026-05-28T00:17:17.965930Z",
"last_event_at": "2026-05-28T00:19:37.858096Z",
"last_event_at": "2026-05-28T00:42:57.556241Z",
"pending_control": null,
"checkpoints": [
{
@ -690,9 +690,9 @@
}
},
{
"seq": 0,
"seq": 48,
"checkpoint": {
"timestamp": "2026-05-28T00:22:01.215539Z",
"timestamp": "2026-05-28T00:22:05.130112Z",
"current_node": "preflight_lint",
"completed_nodes": [
"start",
@ -702,7 +702,107 @@
],
"node_retries": {},
"context_values": {
"command.output": "blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126",
"failure_signature": "",
"current_node": "preflight_lint",
"internal.run_id": "01KSNZ26XXV9Y70FDJQHBQ0CC4",
"thread.toolchain.current_node": "preflight_compile",
"failure_class": "",
"graph.rankdir": "LR",
"internal.retry_count.preflight_compile": 0,
"internal.thread_id": "preflight_compile",
"outcome": "succeeded",
"thread.preflight_compile.current_node": "preflight_lint",
"thread.start.current_node": "toolchain",
"internal.retry_count.start": 0,
"internal.work_dir": "/home/daytona/workspace/fabro",
"internal.retry_count.preflight_lint": 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.retry_count.toolchain": 0,
"internal.fidelity": "compact",
"internal.node_visit_count": 1,
"graph.model_stylesheet": "\n * { model: claude-opus-4-7; }\n "
},
"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": 1398,
"active_time_ms": 1398
}
},
"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
}
},
"start": {
"status": "succeeded",
"usage": null
},
"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
}
}
},
"next_node_id": "implement",
"git_commit_sha": "55a11172d124259900bd4f75cd69ccc16e13b89a",
"node_visits": {
"toolchain": 1,
"preflight_lint": 1,
"preflight_compile": 1,
"start": 1
}
},
"diff": {
"summary": {
"files_changed": 0,
"additions": 0,
"deletions": 0
}
}
},
{
"seq": 0,
"checkpoint": {
"timestamp": "2026-05-28T00:42:57.610149Z",
"current_node": "implement",
"completed_nodes": [
"start",
"toolchain",
"preflight_compile",
"preflight_lint",
"implement"
],
"node_retries": {},
"context_values": {
"current_node": "implement",
"thread.toolchain.current_node": "preflight_compile",
"internal.fidelity": "compact",
"internal.run_id": "01KSNZ26XXV9Y70FDJQHBQ0CC4",
@ -710,8 +810,10 @@
"outcome": "succeeded",
"thread.preflight_compile.current_node": "preflight_lint",
"internal.node_visit_count": 1,
"last_stage": "implement",
"internal.work_dir": "/home/daytona/workspace/fabro",
"internal.thread_id": "preflight_compile",
"internal.thread_id": "preflight_lint",
"internal.retry_count.implement": 0,
"failure_class": "",
"thread.start.current_node": "toolchain",
"command.output": "blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126",
@ -721,7 +823,10 @@
"internal.retry_count.toolchain": 0,
"internal.retry_count.preflight_lint": 0,
"failure_signature": "",
"internal.retry_count.start": 0
"thread.preflight_lint.current_node": "implement",
"internal.retry_count.start": 0,
"response.implement": "Implemented Issue #399 automation run endpoints.\n\nSummary:\n- Added `GET /automations/{id}/runs`\n - Requires automation existence.\n - Lists cached persisted runs only.\n - Filters by `Run.automation.id`.\n - Sorts newest-first.\n - Uses existing `page[limit]` / `page[offset]` pagination envelope.\n\n- Added `POST /automations/{id}/runs`\n - Uses new `RequiredRunToolActor`.\n - Requires automation to exist, be enabled, and have an enabled API trigger.\n - Returns `409` with code `automation_api_trigger_disabled` for disabled automation/API trigger or missing API trigger.\n - Uses configured `AutomationRunMaterializer`.\n - Calls the shared run creation helper with populated `AutomationRef`.\n\n- Added integration coverage using the fake materializer for:\n - Disabled automation.\n - Disabled API trigger.\n - Missing API trigger.\n - Missing automation 404s.\n - Successful API-triggered run creation.\n - Persisted/retrievable `Run.automation`.\n - Automation run listing filtering.\n - Newest-first sorting and pagination.\n\nChanged files:\n- `lib/crates/fabro-server/src/server/handler/automations.rs`\n- `lib/crates/fabro-server/src/principal_middleware.rs`\n- `lib/crates/fabro-server/tests/it/api/automations.rs`\n\nVerification run:\n- `cargo nextest run -p fabro-automation` ✅\n- `cargo nextest run -p fabro-api` ✅\n- `cargo nextest run -p fabro-server --features test-support automations` ✅\n- `cargo nextest run -p fabro-server --features test-support openapi_conformance` ✅\n- `cargo check -p fabro-server` ✅\n- `cargo +nightly-2026-04-14 fmt --check --all` ✅\n- `cargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D warnings` ✅\n- `git diff -- apps/fabro-web lib/crates/fabro-cli` ✅ empty\n\nNote: the `fabro-server` integration test binary is gated behind the crates `test-support` feature, so I used `--features test-support` for the focused `automations` and `openapi_conformance` integration runs.",
"last_response": "Implemented Issue #399 automation run endpoints.\n\nSummary:\n- Added `GET /automations/{id}/runs`\n - Requires automation existence.\n - Lists cached persisted runs only.\n - Filters by `Run.automation."
},
"node_outcomes": {
"toolchain": {
@ -756,6 +861,42 @@
"active_time_ms": 143345
}
},
"implement": {
"status": "succeeded",
"context_updates": {
"response.implement": "Implemented Issue #399 automation run endpoints.\n\nSummary:\n- Added `GET /automations/{id}/runs`\n - Requires automation existence.\n - Lists cached persisted runs only.\n - Filters by `Run.automation.id`.\n - Sorts newest-first.\n - Uses existing `page[limit]` / `page[offset]` pagination envelope.\n\n- Added `POST /automations/{id}/runs`\n - Uses new `RequiredRunToolActor`.\n - Requires automation to exist, be enabled, and have an enabled API trigger.\n - Returns `409` with code `automation_api_trigger_disabled` for disabled automation/API trigger or missing API trigger.\n - Uses configured `AutomationRunMaterializer`.\n - Calls the shared run creation helper with populated `AutomationRef`.\n\n- Added integration coverage using the fake materializer for:\n - Disabled automation.\n - Disabled API trigger.\n - Missing API trigger.\n - Missing automation 404s.\n - Successful API-triggered run creation.\n - Persisted/retrievable `Run.automation`.\n - Automation run listing filtering.\n - Newest-first sorting and pagination.\n\nChanged files:\n- `lib/crates/fabro-server/src/server/handler/automations.rs`\n- `lib/crates/fabro-server/src/principal_middleware.rs`\n- `lib/crates/fabro-server/tests/it/api/automations.rs`\n\nVerification run:\n- `cargo nextest run -p fabro-automation` ✅\n- `cargo nextest run -p fabro-api` ✅\n- `cargo nextest run -p fabro-server --features test-support automations` ✅\n- `cargo nextest run -p fabro-server --features test-support openapi_conformance` ✅\n- `cargo check -p fabro-server` ✅\n- `cargo +nightly-2026-04-14 fmt --check --all` ✅\n- `cargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D warnings` ✅\n- `git diff -- apps/fabro-web lib/crates/fabro-cli` ✅ empty\n\nNote: the `fabro-server` integration test binary is gated behind the crates `test-support` feature, so I used `--features test-support` for the focused `automations` and `openapi_conformance` integration runs.",
"last_response": "Implemented Issue #399 automation run endpoints.\n\nSummary:\n- Added `GET /automations/{id}/runs`\n - Requires automation existence.\n - Lists cached persisted runs only.\n - Filters by `Run.automation.",
"last_stage": "implement"
},
"notes": "Stage completed: implement",
"usage": {
"input": {
"usage": {
"model": {
"provider": "openai",
"model_id": "gpt-5.5"
},
"tokens": {
"input_tokens": 1645117,
"output_tokens": 13240,
"reasoning_tokens": 11182,
"cache_read_tokens": 8178176,
"cache_write_tokens": 0
}
},
"facts": {
"algorithm": "openai"
}
},
"total_usd_micros": 13047333
},
"timing": {
"wall_time_ms": 0,
"inference_time_ms": 818239,
"tool_time_ms": 427741,
"active_time_ms": 1245980
}
},
"preflight_compile": {
"status": "succeeded",
"context_updates": {
@ -771,11 +912,12 @@
}
}
},
"next_node_id": "implement",
"next_node_id": "simplify_opus",
"node_visits": {
"toolchain": 1,
"preflight_compile": 1,
"start": 1,
"implement": 1,
"preflight_lint": 1
}
},
@ -904,11 +1046,217 @@
},
"state": "succeeded"
},
"implement@1": {
"first_event_seq": 51,
"prompt": null,
"response": null,
"completion": null,
"provider_used": {
"mode": "agent",
"provider": "openai",
"model": "gpt-5.5",
"reasoning_effort": "xhigh"
},
"diff": null,
"script_invocation": null,
"script_timing": null,
"parallel_results": null,
"output": null,
"started_at": "2026-05-28T00:22:05.133165Z",
"handler": "agent",
"usage": {
"input_tokens": 1645117,
"output_tokens": 13240,
"total_tokens": 9847715,
"reasoning_tokens": 11182,
"cache_read_tokens": 8178176,
"cache_write_tokens": 0,
"total_usd_micros": 13047333
},
"model": {
"provider": "openai",
"model_id": "gpt-5.5"
},
"permission_level": "full",
"agent_tools": [
{
"name": "apply_patch",
"description": "Use the `apply_patch` tool to edit files. This is a FREEFORM tool, so do not wrap the patch in JSON.",
"source": {
"kind": "native"
},
"category": "write",
"invoked": true
},
{
"name": "close_agent",
"description": "Close a running subagent that is no longer needed.",
"source": {
"kind": "native"
},
"category": "subagent",
"invoked": false
},
{
"name": "glob",
"description": "Find files by file names using a glob pattern. Use path to choose the search root. Prefer this over shell find or ls when locating repository files.",
"source": {
"kind": "native"
},
"category": "read",
"invoked": true
},
{
"name": "grep",
"description": "Search file contents with a regex pattern. Use path to choose the search root, glob_filter to limit matching files, case_insensitive for case folding, and max_results to cap output.",
"source": {
"kind": "native"
},
"category": "read",
"invoked": true
},
{
"name": "read_file",
"description": "Read files before editing them. Returns line-numbered text and supports offset/limit for large files. Use this instead of shell cat, head, tail, or sed when inspecting repository files.",
"source": {
"kind": "native"
},
"category": "read",
"invoked": true
},
{
"name": "request_user_input",
"description": "Ask the human one or more questions and wait for their answers before continuing this stage.",
"source": {
"kind": "native"
},
"category": "other",
"invoked": false
},
{
"name": "send_input",
"description": "Send a follow-up message to a running subagent when new information or corrected instructions are needed.",
"source": {
"kind": "native"
},
"category": "subagent",
"invoked": false
},
{
"name": "shell",
"description": "Execute shell commands for terminal operations, package managers, tests and builds. Use dedicated tools for file reads, file edits, filename searches, and content searches. Provide timeout_ms for long-running commands.",
"source": {
"kind": "native"
},
"category": "shell",
"invoked": true
},
{
"name": "spawn_agent",
"description": "Spawn a subagent for independent work or context isolation. Use it for tasks that can proceed separately, and avoid duplicating the same work in the parent session.",
"source": {
"kind": "native"
},
"category": "subagent",
"invoked": false
},
{
"name": "update_plan",
"description": "Update the multi-step plan for the current task. Submit the entire plan; existing steps are reconciled by exact step text.",
"source": {
"kind": "native"
},
"category": "other",
"invoked": false
},
{
"name": "wait",
"description": "Wait for a subagent to complete, then use the result to synthesize the outcome for the user.",
"source": {
"kind": "native"
},
"category": "subagent",
"invoked": false
},
{
"name": "web_fetch",
"description": "Fetch content from a URL that starts with http:// or https://. Pass a prompt to extract specific information or summarize the page; omit prompt to return the page content.",
"source": {
"kind": "native"
},
"category": "other",
"invoked": false
},
{
"name": "web_search",
"description": "Search the web using Brave Search when current external information is needed. Returns result titles, URLs, and descriptions; use web_fetch for a specific URL.",
"source": {
"kind": "native"
},
"category": "other",
"invoked": false
},
{
"name": "write_file",
"description": "Create new files, or overwrite an existing file only when replacement is explicitly intended. Prefer edit_file for targeted changes to existing files because write_file overwrites the full file content.",
"source": {
"kind": "native"
},
"category": "write",
"invoked": false
}
],
"context_window": {
"provider": "openai",
"model": "gpt-5.5",
"context_window_tokens": 272000,
"input_tokens": 152350,
"usage_percent": 56.0110294117647,
"count_method": "response_usage_scaled_breakdown",
"staleness": "live",
"generated_at": "2026-05-28T00:42:57.555725Z",
"event_seq": 392,
"breakdown": [
{
"category": "system_prompt",
"tokens": 995,
"usage_percent": 0.36580882352941174
},
{
"category": "tools",
"tokens": 1412,
"usage_percent": 0.5191176470588236
},
{
"category": "memory",
"tokens": 3361,
"usage_percent": 1.2356617647058823
},
{
"category": "conversation",
"tokens": 146575,
"usage_percent": 53.887867647058826
},
{
"category": "other",
"tokens": 7,
"usage_percent": 0.002573529411764706
}
],
"warnings": []
},
"state": "running"
},
"preflight_lint@1": {
"first_event_seq": 41,
"prompt": null,
"response": null,
"completion": null,
"completion": {
"outcome": "succeeded",
"notes": "Script completed: cargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1",
"failure_reason": null,
"timestamp": "2026-05-28T00:22:01.214434Z"
},
"provider_used": null,
"diff": null,
"script_invocation": {
@ -916,11 +1264,27 @@
"command": "exec 2>&1\ncargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1",
"language": "shell"
},
"script_timing": null,
"script_timing": {
"output": "blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126",
"exit_code": 0,
"duration_ms": 143345,
"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:19:37.857664Z",
"handler": "command",
"timing": {
"wall_time_ms": 143356,
"inference_time_ms": 0,
"tool_time_ms": 143345,
"active_time_ms": 143345
},
"usage": {
"input_tokens": 0,
"output_tokens": 0,
@ -929,7 +1293,7 @@
"cache_read_tokens": 0,
"cache_write_tokens": 0
},
"state": "running"
"state": "succeeded"
},
"start@1": {
"first_event_seq": 17,

View file

@ -0,0 +1 @@
blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126

View file

@ -0,0 +1,8 @@
{
"output": "blob://sha256/12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126",
"exit_code": 0,
"duration_ms": 143345,
"termination": "exited",
"output_bytes": 0,
"live_streaming": false
}

View file

@ -0,0 +1,6 @@
{
"outcome": "succeeded",
"notes": "Script completed: cargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1",
"failure_reason": null,
"timestamp": "2026-05-28T00:22:01.214434Z"
}

View file

@ -0,0 +1,131 @@
Goal: # Issue #399: Add automation run endpoints
- URL: https://github.com/fabro-sh/fabro/issues/399
- State: OPEN
- Author: Bryan Helmkamp (@brynary)
- Created: 2026-05-25T15:06:27Z
- Updated: 2026-05-25T15:06:27Z
- Labels: None
- Assignees: None
- Milestone: None
- Comments: 0
---
## Goal
Expose API endpoints for listing runs associated with an automation and starting a run through an enabled API trigger.
## Scope
Implement these endpoints:
```http
GET /automations/{id}/runs
POST /automations/{id}/runs
```
`GET /automations/{id}/runs` behavior:
- Require the automation definition to exist; return 404 when it does not.
- List cached runs from the existing run store.
- Filter by `run.automation.as_ref().is_some_and(|a| a.id == id)`.
- Sort newest first.
- Support `page[limit]` and `page[offset]` using existing pagination behavior.
- Return the existing paginated run list envelope:
```json
{
"data": [],
"meta": { "has_more": false, "total": 0 }
}
```
`POST /automations/{id}/runs` behavior:
- Use `RequiredRunToolActor`.
- Require the automation to exist and be enabled.
- Find an enabled trigger where `type = "api"`.
- Return 409 with API error code `automation_api_trigger_disabled` when the automation is disabled or no enabled API trigger is available.
- Materialize the run manifest using the configured `AutomationRunMaterializer`.
- Call the shared create-run helper with:
```rust
AutomationRef {
id: automation.id.to_string(),
name: Some(automation.name.clone()),
trigger_id: Some(api_trigger.id.to_string()),
}
```
- Return 201 and the normal `Run` response shape with automation metadata populated.
Final integration expectations:
- Automation-created runs are visible through normal run APIs.
- Automation-created runs are visible through `GET /automations/{id}/runs`.
- Run history is derived from persisted/cached runs; no runtime automation state store is introduced.
- Schedule trigger expressions are stored and validated by earlier phases but are not scheduled by this endpoint work.
## Files
Modify:
- `lib/crates/fabro-server/src/server/handler/automations.rs`
- `lib/crates/fabro-server/src/server/handler/runs.rs`, only if additional helper exposure is needed from the previous phase
- `lib/crates/fabro-server/tests/it/api/automations.rs`
- `lib/crates/fabro-server/tests/it/api/mod.rs`
## Acceptance Criteria
- Disabled automations cannot start runs through the automation run endpoint.
- Automations without an enabled API trigger cannot start runs through the automation run endpoint.
- A successful API-triggered automation run returns a normal `Run` response with `automation.id`, `automation.name`, and `automation.trigger_id`.
- The automation run listing endpoint returns only runs linked to that automation.
- Automation run listings are newest-first and paginate correctly.
- No scheduler, web UI route/component, or CLI command is added.
## Verification
Add integration tests using the fake materializer for:
- Disabled automation returns 409.
- Disabled API trigger returns 409.
- Missing API trigger returns 409.
- Successful run creation returns 201.
- Created run persists `Run.automation`.
- Associated run listing includes the run.
- Run listing excludes runs from other automations.
- Run listing pagination and newest-first sorting.
Run:
```bash
cargo nextest run -p fabro-automation
cargo nextest run -p fabro-api
cargo nextest run -p fabro-server automations
cargo nextest run -p fabro-server openapi_conformance
cargo +nightly-2026-04-14 fmt --check --all
cargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D warnings
git diff -- apps/fabro-web lib/crates/fabro-cli
```
Expected: focused tests and checks pass; web UI and CLI command modules remain unchanged.
## Completed stages
- **toolchain**: succeeded
- 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`
- Output:
```
cargo 1.95.0 (f2d3ce0bd 2026-03-21)
```
- **preflight_compile**: succeeded
- Script: `cargo check -q --workspace 2>&1`
- Output: (empty)
- **preflight_lint**: succeeded
- Script: `cargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1`
- Output: (empty)
Read the plan file referenced in the goal and implement every step. Make all the code changes described in the plan. Use red/green TDD.

View file

@ -0,0 +1,6 @@
{
"mode": "agent",
"provider": "openai",
"model": "gpt-5.5",
"reasoning_effort": "xhigh"
}

View file

@ -0,0 +1,43 @@
Implemented Issue #399 automation run endpoints.
Summary:
- Added `GET /automations/{id}/runs`
- Requires automation existence.
- Lists cached persisted runs only.
- Filters by `Run.automation.id`.
- Sorts newest-first.
- Uses existing `page[limit]` / `page[offset]` pagination envelope.
- Added `POST /automations/{id}/runs`
- Uses new `RequiredRunToolActor`.
- Requires automation to exist, be enabled, and have an enabled API trigger.
- Returns `409` with code `automation_api_trigger_disabled` for disabled automation/API trigger or missing API trigger.
- Uses configured `AutomationRunMaterializer`.
- Calls the shared run creation helper with populated `AutomationRef`.
- Added integration coverage using the fake materializer for:
- Disabled automation.
- Disabled API trigger.
- Missing API trigger.
- Missing automation 404s.
- Successful API-triggered run creation.
- Persisted/retrievable `Run.automation`.
- Automation run listing filtering.
- Newest-first sorting and pagination.
Changed files:
- `lib/crates/fabro-server/src/server/handler/automations.rs`
- `lib/crates/fabro-server/src/principal_middleware.rs`
- `lib/crates/fabro-server/tests/it/api/automations.rs`
Verification run:
- `cargo nextest run -p fabro-automation`
- `cargo nextest run -p fabro-api`
- `cargo nextest run -p fabro-server --features test-support automations`
- `cargo nextest run -p fabro-server --features test-support openapi_conformance`
- `cargo check -p fabro-server`
- `cargo +nightly-2026-04-14 fmt --check --all`
- `cargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D warnings`
- `git diff -- apps/fabro-web lib/crates/fabro-cli` ✅ empty
Note: the `fabro-server` integration test binary is gated behind the crates `test-support` feature, so I used `--features test-support` for the focused `automations` and `openapi_conformance` integration runs.