⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
src/review/ops.ts:375-411's handleInternalStatus is fully implemented, documented ("GET //internal/status"), and unit-tested (test/unit/ops.test.ts), computing per-agent health/verdict breakdown, manual-rate, stuck targets, config-invariant violations, and recent decisions. Repo-wide grep confirms it is imported nowhere except its own test file -- its route was simply never added to src/api/routes.ts, unlike its two siblings from the same port batch, handleInternalDecision and handleInternalCalibration, which ARE registered at /v1/internal/decision and /v1/internal/calibration (lines 4645-4652).
Requirements
Add app.get("/v1/internal/status", (c) => handleInternalStatus(c.req.raw, c.env, internalOpsAgentConfig(c.env))) to src/api/routes.ts, alongside the existing /v1/internal/decision and /v1/internal/calibration registrations, importing handleInternalStatus from ../review/ops the same way its siblings are imported.
Deliverables
All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
src/** -- 99%+ patch coverage, branch-counted, on the new route registration and its integration test.
Expected Outcome
/v1/internal/status is a real, reachable diagnostics endpoint, matching its two already-wired siblings.
Links & Resources
src/review/ops.ts:375-411
src/api/routes.ts:4645-4652
test/unit/ops.test.ts
Context
src/review/ops.ts:375-411'shandleInternalStatusis fully implemented, documented ("GET //internal/status"), and unit-tested (test/unit/ops.test.ts), computing per-agent health/verdict breakdown, manual-rate, stuck targets, config-invariant violations, and recent decisions. Repo-wide grep confirms it is imported nowhere except its own test file -- its route was simply never added tosrc/api/routes.ts, unlike its two siblings from the same port batch,handleInternalDecisionandhandleInternalCalibration, which ARE registered at/v1/internal/decisionand/v1/internal/calibration(lines 4645-4652).Requirements
Add
app.get("/v1/internal/status", (c) => handleInternalStatus(c.req.raw, c.env, internalOpsAgentConfig(c.env)))tosrc/api/routes.ts, alongside the existing/v1/internal/decisionand/v1/internal/calibrationregistrations, importinghandleInternalStatusfrom../review/opsthe same way its siblings are imported.Deliverables
/v1/internal/statusis registered insrc/api/routes.ts, callinghandleInternalStatuswith the same Bearer-gating middleware its siblings usehandleInternalStatusitself), asserting a 200 response with the expected health/verdict payloadAll of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
src/**-- 99%+ patch coverage, branch-counted, on the new route registration and its integration test.Expected Outcome
/v1/internal/statusis a real, reachable diagnostics endpoint, matching its two already-wired siblings.Links & Resources
src/review/ops.ts:375-411src/api/routes.ts:4645-4652test/unit/ops.test.ts