OPER-74
Stop pinning github_api_degraded on missing agent-dispatch.yml (Ledger backfill for PR #52)
Suggested
Justin Cooke
Body
feature_id: FEAT-studio-planning-validation
## Context
The `pipeline-health` cron pinned `github_api_degraded=true` for the `operant` team for 273 consecutive ticks (~20h) on [REDACTED-DOB]. Root cause: `targetRepoForTeamSlug("operant")` -> `operant-studio`, but that repo has no `.github/workflows/agent-dispatch.yml`. Every 5-min tick hit `GET /repos/.../actions/workflows/agent-dispatch.yml/runs`, got a 404, and `listWorkflowDispatchRuns` collapsed that into `degraded=true`. That suppressed `queue_liveness` and `in_progress_without_dispatch` evaluation on the affected team, silently burning SLO budget and masking real signal.
The fix distinguishes "workflow file missing" (a config error, 404) from "GitHub degraded" (an outage, 5xx / network). On 404 the runs helper returns `{ workflowMissing: true, degraded: false }` and pipeline-health writes a new `github_workflow_missing` metric row without paging. 5xx and network errors still fail-soft to `degraded=true` (unchanged).
This is a Ledger backfill for the pre-existing PR #52 (`justin/oper-7c-breaker-404-fix`, sha dd9f87f) so the OPER-D2 ticket-trailer check has a numeric identifier to match. The PR predates the reconciler and uses the informal "OPER-7C" label to place it in the 7-series alongside OPER-7A (detection) and OPER-7B (auto-heal), both of which shipped as pure-numeric Ledger tickets.
## Acceptance Criteria
- `listWorkflowDispatchRuns` returns `{ workflowMissing: true, degraded: false }` on a 404 from the workflow-scoped runs endpoint.
- 5xx and network errors still return `{ degraded: true }` (unchanged).
- `pipeline-health` cron writes a `github_workflow_missing` metric row (with team slug in payload, no PHI) when `workflowMissing=true`.
- `queue_liveness` and `in_progress_without_dispatch` are suppressed for that team/tick when `workflowMissing=true`.
- No page fires on `github_workflow_missing` (per spec sec 6).
- Runbook has a `github_workflow_missing (OPER-7C)` section documenting the fix menu.
- New vitest suite covers 7 cases: 200, 404->workflowMissing, 500->degraded, 403->degraded, network->degraded, PHI-safety on warn payload, `since` filter.
## Non-Goals
- Auto-heal for the 206 tasks parked by the associated PAT outage - that is OPER-7B (already shipped).
Attachments
Loading attachments…
Comments
Loading comments…