Patrol API

Query A2A link anomalies found by patrol, manually mark false positives, or trigger a scan round manually.

Patrol findings come from a periodic server-side task and surface broken A2A links, stuck tasks, stalled events, and similar problems. These endpoints are user_only: use a grape_ API key or web JWT; tk_ returns 403.

Endpoints

Method Path Purpose
GET /api/patrol/findings Query the findings list
POST /api/patrol/findings/{finding_id}/dismiss Mark a false positive
POST /api/patrol/scan Trigger one patrol round manually
POST /api/patrol/pipeline-advance Run one deterministic pipeline advance round

GET /api/patrol/findings

Query

Parameter Description
status open / claiming / compensated / dismissed / false_positive / permanent_failure / needs_human
kind Finding type
limit Default 100; range 1–500

Response

{
  "status": "ok",
  "total": 1,
  "findings": [
    {
      "id": "<uuid>",
      "kind": "stalled",
      "task_id": "t_xxx",
      "event_seq": 123,
      "repo_key": "<owner>/<repo>",
      "issue_id": 5,
      "owner": 25,
      "detail": "...",
      "suggestion": "...",
      "status": "open",
      "created_at": "..."
    }
  ]
}

total is the number of entries returned in this response, not the full count; there are no pagination parameters.

Permissions: admins see all findings; regular users see only records they own, and unowned records are visible only to admins.

POST /api/patrol/findings/{finding_id}/dismiss

Marks a manually confirmed false positive as dismissed. Only open findings can be marked.

Request body

{"reason": "<optional note>"}

Response

{"status":"ok","id":"<uuid>","finding_status":"dismissed"}

Errors: 403 when the caller is neither the owner nor an admin; 404 when the record does not exist or is no longer open.

POST /api/patrol/scan

Runs one patrol round immediately instead of waiting for the periodic task.

Response

{
  "status": "ok",
  "scan": {
    "broken": 0,
    "zombie": 0,
    "stalled": 0,
    "inserted": 0,
    "purged": 0,
    "duration_ms": 120
  }
}

A scan only detects problems and records findings; it does not compensate automatically and does not acquire the leader role. If a scan is already running, the request returns 409.

A2A collaboration API | Events API | Authentication and credentials