diff --git a/hive-c0re/src/dashboard/approvals.rs b/hive-c0re/src/dashboard/approvals.rs index 5deef931..be405cf2 100644 --- a/hive-c0re/src/dashboard/approvals.rs +++ b/hive-c0re/src/dashboard/approvals.rs @@ -16,7 +16,7 @@ use super::{AppState, error_response}; use crate::actions; use crate::coordinator::Coordinator; -/// Approve a pending approval row. +/// `POST /api/approve/{id}` — approve a pending approval row. #[utoipa::path( post, path = "/api/approve/{id}", @@ -47,7 +47,7 @@ pub(super) struct DenyForm { note: Option, } -/// Deny a pending approval row, with an optional +/// `POST /api/deny/{id}` — deny a pending approval row, with an optional /// note (form field `note`). #[utoipa::path( post, diff --git a/hive-c0re/src/dashboard/build_logs.rs b/hive-c0re/src/dashboard/build_logs.rs index f4835878..27489263 100644 --- a/hive-c0re/src/dashboard/build_logs.rs +++ b/hive-c0re/src/dashboard/build_logs.rs @@ -29,10 +29,8 @@ pub(super) struct BuildLogsAllQuery { limit: Option, } -/// Most-recent build log headers across -/// all agents, newest first. -/// -/// Same JSON shape as the per-agent endpoint. +/// `GET /api/build-logs?limit=N` — most-recent build log headers across +/// all agents, newest first. Same JSON shape as the per-agent endpoint. #[utoipa::path( get, path = "/api/build-logs", @@ -62,11 +60,11 @@ pub(super) struct BuildLogsQuery { limit: Option, } -/// Most-recent build log -/// headers for one agent, newest first. -/// -/// Returns `Vec` (JSON). Backs the per-agent log chip -/// in the agent card and the side-panel header list. +/// `GET /api/build-logs/{agent}?limit=N` — most-recent build log +/// headers for one agent, newest first. Returns +/// `Vec` (JSON). Limit defaults to 10, server-side +/// cap at 50. Backs the per-agent log chip in the agent card and +/// the side-panel header list. #[utoipa::path( get, path = "/api/build-logs/{agent}", @@ -103,12 +101,10 @@ pub(super) async fn get_build_logs_agent( } } -/// Full build log row (stdout + -/// stderr concatenated) by id. -/// -/// Returns `BuildLogFull` (JSON), or HTTP 404 when the id doesn't -/// exist (vacuum-reaped, or the operator passed a stale id from a -/// refresh race). +/// `GET /api/build-logs/id/{id}` — full build log row (stdout + +/// stderr concatenated) by id. Returns `BuildLogFull` (JSON), or +/// HTTP 404 when the id doesn't exist (vacuum-reaped, or the +/// operator passed a stale id from a refresh race). #[utoipa::path( get, path = "/api/build-logs/id/{id}", @@ -131,16 +127,14 @@ pub(super) async fn get_build_log_full( } } -/// The build log for a **queue node**, -/// resolved node id → log-row id → full log. -/// -/// Same `BuildLogFull` JSON (`stdout` / `stderr` + header) as -/// `get_build_log_full`; HTTP 404 when the node has no linked log (the -/// client gates the request on `NodeView.build_log_id`, but a vacuum -/// race can still 404). This is the on-demand live-log-panel fetch, -/// distinct from the `build_log_id` on the wire — that id is for -/// deep-linking to the BUILD L0GS tab's full history view, not for -/// fetching the log content itself. +/// `GET /api/build-log/{node_id}` — the build log for a **queue node**, +/// resolved node id → log-row id → full log. Same `BuildLogFull` JSON +/// (`stdout` / `stderr` + header) as `get_build_log_full`; HTTP 404 when the +/// node has no linked log (the client gates the request on +/// `NodeView.build_log_id`, but a vacuum race can still 404). This is the +/// on-demand live-log-panel fetch, distinct from the `build_log_id` on the +/// wire — that id is for deep-linking to the BUILD L0GS tab's full history +/// view, not for fetching the log content itself. #[utoipa::path( get, path = "/api/build-log/{node_id}", @@ -166,7 +160,7 @@ pub(super) async fn get_build_log_for_node( } } -/// The node's build log as `text/plain` +/// `GET /api/build-log/{node_id}/raw` — the node's build log as `text/plain` /// for download (delegates to `get_build_log_raw` after resolving the node id). #[utoipa::path( get, @@ -206,16 +200,15 @@ struct BuildLogFrame { done: bool, } -/// SSE stream that delivers -/// incremental stdout/stderr as a build runs. +/// `GET /api/build-logs/id/{id}/stream` — SSE stream that delivers +/// incremental stdout/stderr as a build runs. The client connects when +/// it opens a running-build panel; the stream closes automatically once +/// the build finishes (or the row disappears due to a vacuum). /// -/// The client connects when it opens a running-build panel; the -/// stream closes automatically once the build finishes (or the row -/// disappears due to a vacuum). Each frame is a JSON-serialised -/// `BuildLogFrame`. The first frame always carries the full -/// accumulated log so far (cursors start at 0); subsequent frames -/// carry only new bytes. `done: true` on the final frame signals the -/// browser to close the `EventSource`. +/// Each frame is a JSON-serialised `BuildLogFrame`. The first frame +/// always carries the full accumulated log so far (cursors start at 0); +/// subsequent frames carry only new bytes. `done: true` on the final +/// frame signals the browser to close the `EventSource`. #[utoipa::path( get, path = "/api/build-logs/id/{id}/stream", @@ -314,10 +307,8 @@ pub(super) async fn get_build_log_stream( Sse::new(ReceiverStream::new(rx)).keep_alive(KeepAlive::default()) } -/// Full log as `text/plain` for -/// download. -/// -/// Stdout and stderr are concatenated with a `--- stderr ---` +/// `GET /api/build-logs/id/{id}/raw` — full log as `text/plain` for +/// download. Stdout and stderr are concatenated with a `--- stderr ---` /// separator (same layout the JS side-panel renders). The /// `Content-Disposition` header triggers a browser download with a /// descriptive filename so the operator can save and share the log. diff --git a/hive-c0re/src/dashboard/extra_forges.rs b/hive-c0re/src/dashboard/extra_forges.rs index 12e759fb..54bfec0a 100644 --- a/hive-c0re/src/dashboard/extra_forges.rs +++ b/hive-c0re/src/dashboard/extra_forges.rs @@ -58,13 +58,11 @@ pub(super) struct ExtraForgesQuery { agent: String, } -/// List the external forge -/// accounts currently provisioned for `agent`. -/// -/// Derived from every `forge-