chore(cli): reconcile monitors -> alerts API parity drift - #106
Conversation
The public API renamed its published OpenAPI spec from monitors-v1 to alerts-v1 in coval-ai/backend#6368, but deliberately retained /v1/monitors as a serving legacy alias rather than removing it. Verified against production on 2026-08-04 that all seven /v1/monitors routes still reach their Lambda and return Coval-shaped responses, while an unrouted path returns API Gateway's own not-found body. The shipped coval monitors commands are therefore not broken, so this is coverage-manifest drift only and no command surface changes. Record the seven published /alerts operations as reviewed gaps, record the seven legacy /v1/monitors client operations as allowed extras, and refresh the coverage snapshot from 124 to 117 supported operations. Follow-up, deliberately not in this PR: point the client at the canonical /v1/alerts paths and rename the command to coval alerts with monitors kept as an alias, which would return the seven reviewed gaps to first-class coverage.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe API coverage metadata now uses the 2026-08-04 review date and records 117 first-class CLI operations. It allows seven retained Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryReconciles API coverage metadata after the published API renamed the monitors specification to alerts while retaining monitors as a legacy route alias.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The manifest operation names normalize to the existing client paths, all seven canonical alert gaps are accounted for, and the regenerated report and snapshot totals are mutually consistent. Reviews (1): Last reviewed commit: "chore(cli): reconcile monitors -> alerts..." | Re-trigger Greptile |
Reconciles pre-existing API-parity drift found incidentally on 2026-08-04. Deliberately left out of #102 to keep that PR scoped to
reports merge/reports rows.The drift
python scripts/audit_api_coverage.pyon cleanmainfails:coval-ai/backend#6368 (merged 2026-07-31) renamed the published spec
monitors-v1->alerts-v1. The live catalog now lists analertsspec and nomonitorsspec, while the CLI client still calls/v1/monitors/*.The CLI is not broken — verified, not assumed
The rename was spec-only.
/v1/monitors/*was retained as a serving legacy alias, so no shipped command regressed. Confirmed three independent ways:Live production probe (read-only GETs).
GET /v1/monitorsandGET /v1/alertsboth return200with byte-identical payloads carrying both keys:{"alerts": [], "monitors": [], ...}.Control for route existence. Real routes reach the Lambda and return a Coval-shaped body; unrouted paths return API Gateway's own. This distinguishes "route missing" from "record missing":
GET /v1/monitors/{ulid}{"error":{"code":"NOT_FOUND","message":"Monitor not found"}}GET /v1/monitors/{ulid}/events{"error":{"code":"NOT_FOUND", ...}}GET /v1/bogusresource{"message":"Not Found"}GET /v1/monitors/{ulid}/bogus{"message":"Not Found"}Backend
origin/main.terraform/api-v1/modules/monitors_api_gateway.tfdeclares all 14 routes — 7/alertsplus 7/monitors— against the same integrations, andtests/integration/api/v1/test_monitors_e2e.pystill exercises/monitorsalongside the newtest_alerts_e2e.py. That PR's own title says it retains the alias.So this is coverage-manifest drift, not a broken-command problem. No command surface changes here.
Changes
api-coverage.tomlonly, plus the regenerated report:[[allowed_extra]]entries for the legacy/v1/monitorsclient operations, matching the client's actual path literals (the{id}/{monitor_id}mix is real —src/client/mod.rsuses differentformat!locals per method).[[known_gap]]entries for the canonical published/alertsoperations, each naming thecoval monitorssubcommand that serves it today.cli_supported_operations124 -> 117,reviewed_at-> 2026-08-04.Result — audit passes, exit 0:
python -m unittest scripts/test_audit_api_coverage.py— 21 tests, OK. No Rust files touched; nothing insrc/ortests/reads this manifest.Recommended follow-up (not in this PR)
Point the client at the canonical
/v1/alertspaths and rename the command tocoval alerts, keepingmonitorsas an alias so existing scripts keep working. That returns these 7 reviewed gaps to first-class coverage (117 -> 124) and stops the CLI depending on an undocumented alias that will eventually be withdrawn. Worth a ticket — the reviewed-gap reasons here are written to point at it.The weekly automation is broken independently
.github/workflows/api-parity-audit.ymlshould have caught this in its rollingchore/weekly-api-parityPR. It didn't, and no such PR exists, because the workflow is failing — run 30808061069, 2026-08-03:It fails at
Open or update the parity PR(peter-evans/create-pull-request@v7). The audit steps before it succeeded — that run printedPASS: 124/174, which is why the drift went unrecorded: the spec rename landed in the published catalog after 08-03.secrets.REGEN_PR_TOKENresolves to an empty value. The secret name exists (created 2026-07-31, never updated), but the step's input dump echoescommit-message,title,body, andbranchwhile omittingtoken:entirely — an empty secret renders as absent. An expired-but-present PAT would instead fail with a 401.This needs a repo-admin action I can't take: re-add
REGEN_PR_TOKENwith a valid PAT (Contents + Pull requests write). Until then the weekly parity PR cannot open, and this manual reconciliation is the only thing keeping the manifest current. Issue #101 is open and tracking it; the workflow auto-closes it on the next green run.Note
continue-on-erroron CI's audit step isfalseonly for PRs fromchore/weekly-api-parity, so on this branch the step is advisory — but it passes here regardless.Merge-order note
#102 also edits
api-coverage.toml(it removes theGET /reports/{report_id}/rowsknown_gap). Whichever lands second needs the snapshot'scli_supported_operationsre-derived by rerunning the audit — the two changes move that number in opposite directions.🤖 Generated with Claude Code