Skip to content

fix(review): register the /v1/internal/status route so handleInternalStatus is reachable - #8974

Merged
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
kai392:fix/critical-issue-internal-status-route
Jul 26, 2026
Merged

fix(review): register the /v1/internal/status route so handleInternalStatus is reachable#8974
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
kai392:fix/critical-issue-internal-status-route

Conversation

@kai392

@kai392 kai392 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

handleInternalStatus (src/review/ops.ts) is fully implemented, documented, and unit-tested, but a
repo-wide grep confirms it is imported nowhere except its own test — its route was simply never added
to src/api/routes.ts, unlike its two siblings from the same port batch (handleInternalDecision,
handleInternalCalibration), which ARE registered at /v1/internal/decision and
/v1/internal/calibration.

Registers /v1/internal/status the same way — same /v1/internal/* INTERNAL_JOB_TOKEN gate, same
internalOpsAgentConfig(c.env) — so the operator agent-health endpoint is actually reachable.

Test plan

  • New integration test: /v1/internal/status 401s without the internal token, and 200s (fail-safe empty) with it, returning the expected project/counts/health payload, slug-scoped, with no actor/trust internals leaked
  • Non-vacuity verified: removing the route registration makes the 200 test fail
  • npx vitest run test/unit/routes-internal-decision-calibration.test.ts — 9/9 pass; tsc --noEmit clean

Closes #8904

@kai392
kai392 requested a review from JSONbored as a code owner July 26, 2026 14:41
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

RealDiligent and others added 2 commits July 26, 2026 22:45
…Status is reachable

handleInternalStatus (src/review/ops.ts) is fully implemented, documented, and unit-tested, but its
route was never added to routes.ts — unlike its two siblings handleInternalDecision and
handleInternalCalibration, which are registered at /v1/internal/decision and /v1/internal/calibration.
Register /v1/internal/status the same way (same INTERNAL_JOB_TOKEN gate, same internalOpsAgentConfig),
so the operator agent-health endpoint is actually reachable.

Closes JSONbored#8904

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.02%. Comparing base (266b07d) to head (81875fc).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8974      +/-   ##
==========================================
+ Coverage   90.56%   91.02%   +0.46%     
==========================================
  Files          96       97       +1     
  Lines       22490    24954    +2464     
  Branches     3884     4677     +793     
==========================================
+ Hits        20367    22714    +2347     
- Misses       1945     1975      +30     
- Partials      178      265      +87     
Flag Coverage Δ
backend 95.25% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/api/routes.ts 95.25% <100.00%> (ø)

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 26, 2026
@loopover-orb

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-26 14:59:28 UTC

2 files · 1 AI reviewer · no blockers · readiness 93/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR registers the previously-unwired `/v1/internal/status` route by importing `handleInternalStatus` and adding a one-line `app.get` registration in `src/api/routes.ts`, following the exact same pattern as its two already-registered siblings (`/v1/internal/decision`, `/v1/internal/calibration`). The new integration test confirms both the 401 unauthenticated path and the 200 fail-safe-empty path with the expected `project`/`counts`/`health` shape, and asserts no actor/trust fields leak. The change is minimal, narrowly scoped, closes issue #8904, and matches an established convention in the same file, so it's straightforward to verify correct.

Nits — 2 non-blocking
  • The route is placed between `/v1/internal/calibration` and `/v1/internal/calibration trend` rather than immediately after its stated siblings' block — consider grouping all three `/v1/internal/*` routes contiguously for readability (src/api/routes.ts:4693).
  • Since routes.ts is already very large (~4700 lines), consider whether internal ops routes could eventually be extracted to a dedicated router module, though that's out of scope for this fix.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8904
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 130 registered-repo PR(s), 67 merged, 6 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kai392; Gittensor profile; 130 PR(s), 6 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff adds the exact route registration requested (import of handleInternalStatus and app.get for /v1/internal/status using internalOpsAgentConfig), matching the sibling routes, and includes an integration test asserting 401 without token and 200 with the expected payload shape.

Review context
  • Author: kai392
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 130 PR(s), 6 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 4611040 into JSONbored:main Jul 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants