|
| 1 | +// SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | +// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> |
| 3 | + |
| 4 | +//! Groove capability discovery endpoint for gitbot-fleet. |
| 5 | +//! |
| 6 | +//! Serves GET `/.well-known/groove` with a JSON capability manifest and |
| 7 | +//! GET `/health` so that groove-aware systems (Gossamer, PanLL, BoJ) can |
| 8 | +//! discover and probe the fleet dashboard automatically. |
| 9 | +//! |
| 10 | +//! The canonical ABI definition lives in `Groove.idr` (`gitbotFleetManifest`). |
| 11 | +
|
| 12 | +use axum::response::Json; |
| 13 | + |
| 14 | +/// Groove capability manifest for gitbot-fleet. |
| 15 | +/// |
| 16 | +/// Advertises the fleet's bot-orchestration capability in the standard Groove |
| 17 | +/// format. Any groove-aware client can probe `GET /.well-known/groove` on |
| 18 | +/// port 7500 to discover this service. |
| 19 | +/// |
| 20 | +/// ## Capabilities offered |
| 21 | +/// |
| 22 | +/// - **bot-orchestration** — Fleet of 6 bots (rhodibot, echidnabot, |
| 23 | +/// sustainabot, glambot, seambot, finishbot) for automated repository |
| 24 | +/// maintenance across 500+ hyperpolymath repos. |
| 25 | +/// |
| 26 | +/// ## Capabilities consumed |
| 27 | +/// |
| 28 | +/// - **octad-storage** (VeriSimDB) — Persist dispatch outcomes and fleet |
| 29 | +/// metrics. |
| 30 | +/// - **static-analysis** (Hypatia / CodeQL) — Receive findings that drive |
| 31 | +/// bot dispatch decisions. |
| 32 | +pub async fn groove_manifest() -> Json<serde_json::Value> { |
| 33 | + Json(serde_json::json!({ |
| 34 | + "groove_version": "1", |
| 35 | + "service_id": "gitbot-fleet", |
| 36 | + "service_version": "0.1.0", |
| 37 | + "capabilities": { |
| 38 | + "bot_orchestration": { |
| 39 | + "type": "bot-orchestration", |
| 40 | + "description": "Fleet of 6 bots (rhodibot, echidnabot, sustainabot, glambot, seambot, finishbot) for automated repository maintenance", |
| 41 | + "protocol": "http", |
| 42 | + "endpoint": "/api/v1/dispatch", |
| 43 | + "requires_auth": false, |
| 44 | + "panel_compatible": true |
| 45 | + } |
| 46 | + }, |
| 47 | + "consumes": ["octad-storage", "static-analysis"], |
| 48 | + "endpoints": { |
| 49 | + "api": "http://localhost:7500/api", |
| 50 | + "health": "http://localhost:7500/health" |
| 51 | + }, |
| 52 | + "health": "/health", |
| 53 | + "applicability": ["individual", "team"] |
| 54 | + })) |
| 55 | +} |
| 56 | + |
| 57 | +/// Lightweight health probe for groove discovery. |
| 58 | +/// |
| 59 | +/// Returns a minimal JSON object indicating the service is alive. This is |
| 60 | +/// the endpoint referenced by the `"health"` key in the groove manifest and |
| 61 | +/// is intentionally separate from the richer `/api/health` handler which |
| 62 | +/// returns full `FleetHealth` diagnostics. |
| 63 | +pub async fn health() -> Json<serde_json::Value> { |
| 64 | + Json(serde_json::json!({ |
| 65 | + "service_id": "gitbot-fleet", |
| 66 | + "status": "ok" |
| 67 | + })) |
| 68 | +} |
0 commit comments