Skip to content

fix(review): wire handleInternalStatus into /v1/internal/status -- it was never routed #8904

Description

@JSONbored

⚠️ 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

  • /v1/internal/status is registered in src/api/routes.ts, calling handleInternalStatus with the same Bearer-gating middleware its siblings use
  • An integration test hitting the new route end-to-end (not just the existing unit test of handleInternalStatus itself), asserting a 200 response with the expected health/verdict payload

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions