Skip to content

orb(mcp): the ORB management tool family — ops, fleet, hosted tenants, instance diagnostics (#9522) - #9604

Merged
JSONbored merged 6 commits into
mainfrom
feat/orb-management-tools-9522
Jul 29, 2026
Merged

orb(mcp): the ORB management tool family — ops, fleet, hosted tenants, instance diagnostics (#9522)#9604
JSONbored merged 6 commits into
mainfrom
feat/orb-management-tools-9522

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Closes #9522.

What changed

The ORB management capabilities existed; they were scattered across interfaces an agent could not reach uniformly. This adds 25 tools across four families, every one wrapping the same service function its HTTP route calls — one implementation behind two transports, so they cannot drift into two behaviors with one audit trail between them.

Ops (7) — dead-letter list/replay/delete/purge, kill-switch get/set, operator dashboard. availability: both: on a deployment whose queue backend has no dead-letter admin these answer unavailable: true rather than vanishing from the catalog, because "this backend has no DLQ" is an answer to the question.

Fleet (11) — instances, installations, enrollments, config push, and one loopover_fleet_run_job replacing the ~30 bespoke per-job tools a route-by-route mapping would have produced.

Hosted tenants (4) — create/list/set-installation/destroy, over a new src/orb/control-plane-client.ts.

Self-host diagnostics (4)status, doctor (ORB had none; the miner has had one for years), bounded tail_logs, backup_status, behind a Workers-safe nullable capability registry that only the self-host entry fills.

requireOperator mirrors requireAppRole(["operator"]) and deliberately refuses the shared LOOPOVER_MCP_TOKEN — an end-user-obtainable CLI credential that must not reach the kill switch. requireInternal mirrors the /v1/internal/* bearer gate. Destructive tools take z.literal(true) (a plain boolean lets an omitted field read as false and pass) and elicit confirmation where the client supports it; a decline is a structured non-error, and an elicitation that errors is treated as a decline rather than an implicit yes. Releasing the kill switch needs the ceremony; engaging it is fail-safe and must not be slowed down.

Things this found and fixed

  • loopover_admin_rotate_secret had no contract entry. Live, registered, with its own test file — contract(remote): migrate the remote MCP server's tools to @loopover/contract — typed handlers, real output schemas #9518's migration missed exactly one tool, so validate:mcp never saw it. Migrated, with its secret name a closed enum rather than an open string, since rotation writes to a host path.
  • MCP_TOOL_CATEGORIES was a hand-maintained 112-entry map beside a registry that already carried category on every tool. Diffed first — zero disagreements — then derived. Its exact-sync test loses the stale-entry half, which only had meaning while the map was hand-kept; the half that actually caught drift stays.
  • Two job routes do not send their own name as the queue message type (rag-indexrag-index-repo, regate-pragent-regate-pr) and two more are run-only with no message at all. Deriving the message from the job name — the obvious implementation — silently enqueues messages the dispatcher drops, i.e. a job that reports "queued" and never runs. INTERNAL_JOB_SPEC records each job's real message type and real modes; a compile-time assertion pins every one to JobMessage["type"] | null, and the parity test checks each against the route that actually sends it.
  • loopover_fleet_get_analytics was not added: loopover_get_fleet_analytics already wraps the same function behind the same gate. Two names for one capability is how a catalog rots. The incumbent keeps its name and moves into the fleet category.

Deliberately not here

loopover_tenant_rollout. Its route is an explicit 501 whose own comment is blunt about why — the previous implementation no-opped on all four of its promised effects, and "rollback is the control you least want to discover is fake". The image-side mechanism it needs is scoped on #9143 by this issue's own instruction. A tool on top of a route that changes nothing observable would ship exactly the fake control #9143 removed.

Validation

Full typecheck clean. validate:mcp passes — including its assertion that every remote-locality non-self-host tool is actually served, which is what caught the tenant tools being declared but unregistered before the client existed. 159 MCP/ORB test files pass. Deny-path coverage is generated from the registry (48 assertions), so a new management tool is covered the moment it is added; the pre-existing requireOperatorAccess family is pinned to its real #2455 wildcard-opt-in boundary rather than forced into the categorical shape. Extracted code is at 100% line and branch, including the rows.results ?? [] arms the real in-memory D1 can never reach.

@loopover-orb

loopover-orb Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-29 02:53:49 UTC

27 files · 1 AI reviewer · no blockers · CI failing · unstable

🛑 Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): .github/workflows/self-host-maintenance.yml (matched .github/workflows/**).

Review summary
This PR adds 25 new MCP tools (ops/fleet/tenant/instance-diagnostics families) to the ORB server, each declared in the contract package and wired in src/mcp/server.ts, plus derives the tool-category map from TOOL_CONTRACTS instead of a hand-maintained list. The design is coherent: every handler delegates to the same service function its HTTP route calls, auth gates (requireOperator/requireInternal/requireMcpAdmin) mirror existing route middleware, destructive actions require z.literal(true) plus an elicitation-based confirmation that treats decline and elicitation-errors alike as non-proceeding. The most notable risk is that several referenced files (src/mcp/server.ts full body, src/orb/fleet-admin.ts, src/orb/control-plane-client.ts, tenant.ts, the parity/auth test files) were not included in full, so end-to-end wiring of auth checks and the fleet-job dispatch/parity guarantees can't be fully verified from what's shown, though CI is green on this commit.

Nits — 7 non-blocking
  • packages/loopover-contract/src/tools/fleet.ts:53 FleetRegisterInstanceOutput's instanceSecret is optional but the description implies it's always returned on registration — worth clarifying when it's actually omitted.
  • Several magic numbers (issue numbers embedded as literals like 9522, 9543, 8024) appear in comments/enums per the external brief; harmless since they're issue references, not real magic numbers, but worth a quick check that none are actually meant to be named constants.
  • src/mcp/server.ts's fleetRunJob (not fully shown) builds `message` via an `as unknown as JobMessage` cast — worth confirming the compile-time check (`_INTERNAL_JOB_MESSAGE_TYPES_ARE_REAL`) actually catches a mismatched messageType before this cast masks a runtime bug.
  • packages/loopover-contract/src/tools/ops.ts's kill-switch release path requires `confirm: true` via a manual check in the handler (input.confirm !== true) rather than via z.literal in the schema itself — confirm this dual-path (schema-optional but handler-enforced) is intentional and tested for the false path.
  • Given the file-content budget was exhausted, request the full src/mcp/server.ts diff hunk around requireOperator/requireInternal and the fleet-job-parity test file in a follow-up pass to confirm the auth boundaries are exhaustively tested for every new tool.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.

CI checks failing

  • Workers Builds: loopover-ui — Workers Builds: loopover-ui

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ⚠️ Gate result — Not blocking (Advisory; not blocking this PR.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #9522
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: 14 registered-repo PR(s), 13 merged, 284 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 14 PR(s), 284 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The PR implements all four requested tool families (self-host diagnostics incl. new doctor/status/tail_logs/backup_status, ops queue+kill-switch, fleet, hosted tenants) via the standardized registry with auth/locality/availability metadata, destructive tools with confirm literal + elicitation/decline handling, and handlers calling the same shared service functions as the HTTP routes with audit eve

Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is registered but has no active allocation in the current snapshot.
  • Public profile languages: not available
  • Official Gittensor activity: 14 PR(s), 284 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Then work through the remaining 1 step in the Signals table above.
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 <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> 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.

Decision record
  • action: hold · clause: guardrail_hold
  • config: 690534b60f25d2b06910a5611a6743b19060bdbe86e3693f34744428eaa8a433 · pack: oss-anti-slop · ci: failed
  • record: 14cc68e54b0781489897e0e55bca7b40bdbf9c10f47218aefabc6e9f9066712f (schema v5, head 8b5c4e8)
Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/ before / (scroll)
before / (scroll)
after / (scroll)
after / (scroll)

A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show.

🟩 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

@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
loopover-ui 8b5c4e8 Jul 29 2026, 01:23 AM

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 3.13kB (0.04%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
loopover-ui 7.79MB 3.13kB (0.04%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: loopover-ui

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/add-scalar-classes-C6VUvb6O.js (New) 2.16MB 2.16MB 100.0% 🚀
assets/tanstack-vendor-DvvQWC8e.js (New) 912.86kB 912.86kB 100.0% 🚀
assets/docs.fumadocs-spike-api-reference-lPsQ1LL2.js (New) 443.45kB 443.45kB 100.0% 🚀
assets/AgentScalarChatInterface.vue-D7Hg_rQe.js (New) 201.7kB 201.7kB 100.0% 🚀
assets/modal-DUw_M3F1.js (New) 184.5kB 184.5kB 100.0% 🚀
assets/client-DpqqOuFX.js (New) 151.47kB 151.47kB 100.0% 🚀
assets/self-hosting-operations-DWX8-_N1.js (New) 134.31kB 134.31kB 100.0% 🚀
assets/maintainer-panel-C_uoN151.js (New) 78.99kB 78.99kB 100.0% 🚀
assets/routes-Ba96T4-l.js (New) 35.96kB 35.96kB 100.0% 🚀
assets/owner-panel-BQh_XmUH.js (New) 27.92kB 27.92kB 100.0% 🚀
assets/app-a0fOAcmU.js (New) 25.78kB 25.78kB 100.0% 🚀
assets/ui-vendor-CWYEqp6N.js (New) 24.57kB 24.57kB 100.0% 🚀
assets/miner-panel-DbIi1SDR.js (New) 20.24kB 20.24kB 100.0% 🚀
assets/app.runs-C5uFmfbI.js (New) 20.22kB 20.22kB 100.0% 🚀
assets/api._op-CeRGL1cS.js (New) 17.57kB 17.57kB 100.0% 🚀
assets/self-hosting-docs-audit-CladSRn4.js (New) 16.6kB 16.6kB 100.0% 🚀
assets/docs._slug-beIuPh91.js (New) 15.52kB 15.52kB 100.0% 🚀
assets/playground-panel-DRrQcEpQ.js (New) 14.42kB 14.42kB 100.0% 🚀
assets/fairness-BvmlZGNU.js (New) 10.73kB 10.73kB 100.0% 🚀
assets/app.audit-CZnDfwCO.js (New) 10.08kB 10.08kB 100.0% 🚀
assets/app.config-generator-CnV6VHSl.js (New) 10.06kB 10.06kB 100.0% 🚀
assets/maintainers-BQu1j4d3.js (New) 8.06kB 8.06kB 100.0% 🚀
assets/miners-Cc_RTMN0.js (New) 7.91kB 7.91kB 100.0% 🚀
assets/agents-CFm9nTwJ.js (New) 7.74kB 7.74kB 100.0% 🚀
assets/commands-panel-DNVKg2Oc.js (New) 6.65kB 6.65kB 100.0% 🚀
assets/maintainer-workflow-AFaBBFG3.js (New) 6.52kB 6.52kB 100.0% 🚀
assets/digest-panel-LTklf-O6.js (New) 6.15kB 6.15kB 100.0% 🚀
assets/repos._owner._repo.quality-eafFwDTf.js (New) 6.14kB 6.14kB 100.0% 🚀
assets/docs-nav-DICgsmy5.js (New) 6.01kB 6.01kB 100.0% 🚀
assets/docs.index-k8ouxTYV.js (New) 5.95kB 5.95kB 100.0% 🚀
assets/api.index-JM-zdjlq.js (New) 4.7kB 4.7kB 100.0% 🚀
assets/docs-DnryJy60.js (New) 2.7kB 2.7kB 100.0% 🚀
assets/api-DKqsEZ-K.js (New) 2.69kB 2.69kB 100.0% 🚀
assets/docs-page-DkSTujgi.js (New) 2.1kB 2.1kB 100.0% 🚀
assets/table-B1V1fHa5.js (New) 1.75kB 1.75kB 100.0% 🚀
assets/app.workbench-Da0cl6qr.js (New) 1.58kB 1.58kB 100.0% 🚀
assets/tabs-D7664EKM.js (New) 1.39kB 1.39kB 100.0% 🚀
assets/app.repos-B98QLrzv.js (New) 1.07kB 1.07kB 100.0% 🚀
assets/input-CO5WduYr.js (New) 796 bytes 796 bytes 100.0% 🚀
assets/file-cog-byz_q9OJ.js (New) 758 bytes 758 bytes 100.0% 🚀
assets/app.maintainer-7WtF-prZ.js (New) 502 bytes 502 bytes 100.0% 🚀
assets/app.owner-CN1NaazS.js (New) 474 bytes 474 bytes 100.0% 🚀
assets/app.commands-BrW6Yi9b.js (New) 455 bytes 455 bytes 100.0% 🚀
assets/app.playground-BwpNTrNw.js (New) 442 bytes 442 bytes 100.0% 🚀
assets/index-Blyp1qLl.js (New) 438 bytes 438 bytes 100.0% 🚀
assets/app.digest-DMR-gWe4.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/eye-off-BBdqtdU2.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/app.miner-ADrtnRUJ.js (New) 422 bytes 422 bytes 100.0% 🚀
assets/key-round-Qa_YampS.js (New) 355 bytes 355 bytes 100.0% 🚀
assets/bot-BF1bYAYf.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/trash-2-CcT_8Nvp.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/save-D1D0ARVf.js (New) 327 bytes 327 bytes 100.0% 🚀
assets/git-pull-request-arrow-DwRfH1bQ.js (New) 321 bytes 321 bytes 100.0% 🚀
assets/list-checks-DkJqyivS.js (New) 279 bytes 279 bytes 100.0% 🚀
assets/compass-bqRgfqGW.js (New) 251 bytes 251 bytes 100.0% 🚀
assets/history-BbDf2fUc.js (New) 237 bytes 237 bytes 100.0% 🚀
assets/message-square-ZBr83Nbs.js (New) 233 bytes 233 bytes 100.0% 🚀
assets/lock-CdC_q2mc.js (New) 206 bytes 206 bytes 100.0% 🚀
assets/rotate-cw-Z_FhRYaD.js (New) 201 bytes 201 bytes 100.0% 🚀
assets/play-BDf1wu4a.js (New) 190 bytes 190 bytes 100.0% 🚀
assets/circle-check-CUxgut0j.js (New) 178 bytes 178 bytes 100.0% 🚀
assets/search-ZE8miIvD.js (New) 174 bytes 174 bytes 100.0% 🚀
assets/add-scalar-classes-D8Dj7YyG.js (Deleted) -2.16MB 0 bytes -100.0% 🗑️
assets/tanstack-vendor-DgX5HYmn.js (Deleted) -912.86kB 0 bytes -100.0% 🗑️
assets/docs.fumadocs-spike-api-reference-DHZ63mnT.js (Deleted) -443.45kB 0 bytes -100.0% 🗑️
assets/AgentScalarChatInterface.vue-D0XRxWXc.js (Deleted) -201.7kB 0 bytes -100.0% 🗑️
assets/modal-CKVqXj52.js (Deleted) -184.5kB 0 bytes -100.0% 🗑️
assets/client-BiUgLQNF.js (Deleted) -151.47kB 0 bytes -100.0% 🗑️
assets/self-hosting-operations-x-HwDFv_.js (Deleted) -131.18kB 0 bytes -100.0% 🗑️
assets/maintainer-panel-BE-s2qKp.js (Deleted) -78.99kB 0 bytes -100.0% 🗑️
assets/routes-BIIqSisu.js (Deleted) -35.96kB 0 bytes -100.0% 🗑️
assets/owner-panel-BIwdq47g.js (Deleted) -27.92kB 0 bytes -100.0% 🗑️
assets/app-Bn5KjUMo.js (Deleted) -25.78kB 0 bytes -100.0% 🗑️
assets/ui-vendor-BqoXHLzp.js (Deleted) -24.57kB 0 bytes -100.0% 🗑️
assets/miner-panel-hgWaNYQQ.js (Deleted) -20.24kB 0 bytes -100.0% 🗑️
assets/app.runs-6vZbrege.js (Deleted) -20.22kB 0 bytes -100.0% 🗑️
assets/api._op-DVwCRakh.js (Deleted) -17.57kB 0 bytes -100.0% 🗑️
assets/self-hosting-docs-audit-HktHL1uq.js (Deleted) -16.6kB 0 bytes -100.0% 🗑️
assets/docs._slug-C_m8qXeX.js (Deleted) -15.52kB 0 bytes -100.0% 🗑️
assets/playground-panel-B49R_Yi7.js (Deleted) -14.42kB 0 bytes -100.0% 🗑️
assets/fairness-VY1DclTZ.js (Deleted) -10.73kB 0 bytes -100.0% 🗑️
assets/app.audit-CaFm8Eqs.js (Deleted) -10.08kB 0 bytes -100.0% 🗑️
assets/app.config-generator-i6cjBVeu.js (Deleted) -10.06kB 0 bytes -100.0% 🗑️
assets/maintainers-DsDK-yPw.js (Deleted) -8.06kB 0 bytes -100.0% 🗑️
assets/miners-BMvDsqDe.js (Deleted) -7.91kB 0 bytes -100.0% 🗑️
assets/agents-Q1yFlaDD.js (Deleted) -7.74kB 0 bytes -100.0% 🗑️
assets/commands-panel-D-8wPXGb.js (Deleted) -6.65kB 0 bytes -100.0% 🗑️
assets/maintainer-workflow-CQG8L7mN.js (Deleted) -6.52kB 0 bytes -100.0% 🗑️
assets/digest-panel-DuUBSq1O.js (Deleted) -6.15kB 0 bytes -100.0% 🗑️
assets/repos._owner._repo.quality-F3oREzhU.js (Deleted) -6.14kB 0 bytes -100.0% 🗑️
assets/docs-nav-uW4i6eVC.js (Deleted) -6.01kB 0 bytes -100.0% 🗑️
assets/docs.index-Mag_9Ek5.js (Deleted) -5.95kB 0 bytes -100.0% 🗑️
assets/api.index-B0sE4AFV.js (Deleted) -4.7kB 0 bytes -100.0% 🗑️
assets/docs-DSuqq3FI.js (Deleted) -2.7kB 0 bytes -100.0% 🗑️
assets/api-LvGaCYkk.js (Deleted) -2.69kB 0 bytes -100.0% 🗑️
assets/docs-page-CsRVj76t.js (Deleted) -2.1kB 0 bytes -100.0% 🗑️
assets/table-sKqhVkg8.js (Deleted) -1.75kB 0 bytes -100.0% 🗑️
assets/app.workbench-D8wd2Gd0.js (Deleted) -1.58kB 0 bytes -100.0% 🗑️
assets/tabs-BylaM85l.js (Deleted) -1.39kB 0 bytes -100.0% 🗑️
assets/app.repos-XkgUdRhW.js (Deleted) -1.07kB 0 bytes -100.0% 🗑️
assets/input-BfvmcGjW.js (Deleted) -796 bytes 0 bytes -100.0% 🗑️
assets/file-cog-DxfkU_Qm.js (Deleted) -758 bytes 0 bytes -100.0% 🗑️
assets/app.maintainer-nUgZiMyM.js (Deleted) -502 bytes 0 bytes -100.0% 🗑️
assets/app.owner-H7TNH-hk.js (Deleted) -474 bytes 0 bytes -100.0% 🗑️
assets/app.commands-Co1kG67d.js (Deleted) -455 bytes 0 bytes -100.0% 🗑️
assets/app.playground-BkgwmzcP.js (Deleted) -442 bytes 0 bytes -100.0% 🗑️
assets/index-CnL2s3_D.js (Deleted) -438 bytes 0 bytes -100.0% 🗑️
assets/app.digest-DwIhNDUN.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/eye-off-DX6rI0lD.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/app.miner-_EzNdLDQ.js (Deleted) -422 bytes 0 bytes -100.0% 🗑️
assets/key-round-DaONLAkf.js (Deleted) -355 bytes 0 bytes -100.0% 🗑️
assets/bot-CsaaI2U2.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/trash-2-CzgYtdg9.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/save-DbIfNLkM.js (Deleted) -327 bytes 0 bytes -100.0% 🗑️
assets/git-pull-request-arrow-D2fv1DMg.js (Deleted) -321 bytes 0 bytes -100.0% 🗑️
assets/list-checks-1EbutALM.js (Deleted) -279 bytes 0 bytes -100.0% 🗑️
assets/compass-CQgBrikq.js (Deleted) -251 bytes 0 bytes -100.0% 🗑️
assets/history-vw6Aln5Z.js (Deleted) -237 bytes 0 bytes -100.0% 🗑️
assets/message-square-DMcaexhm.js (Deleted) -233 bytes 0 bytes -100.0% 🗑️
assets/lock-Ba4wK6Uv.js (Deleted) -206 bytes 0 bytes -100.0% 🗑️
assets/rotate-cw-lpWDG7jF.js (Deleted) -201 bytes 0 bytes -100.0% 🗑️
assets/play-CrO53Kph.js (Deleted) -190 bytes 0 bytes -100.0% 🗑️
assets/circle-check-CFE2hDxO.js (Deleted) -178 bytes 0 bytes -100.0% 🗑️
assets/search-DjH7H0qh.js (Deleted) -174 bytes 0 bytes -100.0% 🗑️

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.52719% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.05%. Comparing base (bd139a5) to head (8b5c4e8).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/mcp/server.ts 99.17% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9604      +/-   ##
==========================================
+ Coverage   90.02%   90.05%   +0.03%     
==========================================
  Files         888      896       +8     
  Lines      111983   112372     +389     
  Branches    26570    26634      +64     
==========================================
+ Hits       100810   101197     +387     
- Misses       9843     9844       +1     
- Partials     1330     1331       +1     
Flag Coverage Δ
backend 95.59% <99.52%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
packages/loopover-contract/src/enums.ts 100.00% <100.00%> (ø)
packages/loopover-contract/src/tool-definition.ts 100.00% <100.00%> (ø)
...ckages/loopover-contract/src/tools/admin-config.ts 100.00% <100.00%> (ø)
packages/loopover-contract/src/tools/fleet.ts 100.00% <100.00%> (ø)
packages/loopover-contract/src/tools/index.ts 100.00% <ø> (ø)
...ckages/loopover-contract/src/tools/instance-ops.ts 100.00% <100.00%> (ø)
packages/loopover-contract/src/tools/maintainer.ts 100.00% <ø> (ø)
packages/loopover-contract/src/tools/ops.ts 100.00% <100.00%> (ø)
packages/loopover-contract/src/tools/tenant.ts 100.00% <100.00%> (ø)
src/api/routes.ts 95.58% <100.00%> (-0.05%) ⬇️
... and 5 more

The management capabilities existed; they were just scattered across interfaces an agent
could not reach uniformly. This adds the ops family (dead-letter list/replay/delete/purge,
kill-switch get/set, operator dashboard) and the fleet family (instances, installations,
enrollments), each wrapping the SAME service function its HTTP route calls so the two
transports cannot drift into two behaviors with one audit trail between them.

The instance and installation handlers lived inline in routes.ts, so they move to
src/orb/fleet-admin.ts and both transports now call that. auth is enforced per tool from
the registry's own declaration: requireOperator mirrors requireAppRole(["operator"]) and
deliberately refuses the shared LOOPOVER_MCP_TOKEN, which is an end-user-obtainable CLI
credential; requireInternal mirrors the /v1/internal/* middleware's bearer check.

Destructive tools take a z.literal(true) confirm -- a plain boolean would let an omitted
field read as false and pass -- and, where the client supports elicitation, ask before
acting. A decline is a structured non-error result, and an elicitation that errors is
treated as a decline rather than an implicit yes. Releasing the kill switch is the
direction that needs the ceremony; engaging it is fail-safe and must not be slowed down.

Two findings fixed in passing. MCP_TOOL_CATEGORIES was a hand-maintained 112-entry
name-to-category map beside a registry that already carried category on every tool; it
now derives, which is also what lets this issue's three new categories land in one place.
Its exact-sync test loses the stale-entry half, which only had meaning while the map was
hand-kept -- the map now indexes all three servers' tools, since locality says where a
tool's work happens rather than which server exposes it, and a dozen local-git tools are
registered on the remote server too. The half that actually caught drift, every registered
tool resolving a category, stays.

The map had already fallen a tool behind: loopover_admin_rotate_secret is live and tested
but had no contract entry, so validate:mcp never saw it -- now migrated, with its secret
name as a closed enum rather than an open string, since rotation writes to a host path.

loopover_fleet_get_analytics is deliberately not added: loopover_get_fleet_analytics
already wraps computeFleetAnalytics behind the same gate. Two names for one capability is
how a catalog rots. The incumbent keeps its name and moves into the fleet category.
The first pass excluded three job routes as "not valid queue message types" and left them
HTTP-only. That was a wrong reading of a real finding: nothing is invalid about them, they
are PARAMETERIZED, and two simply do not use their route path as their message type.

rag-index enqueues rag-index-repo, regate-pr enqueues agent-regate-pr, and
backfill-contributor-gate-history and refresh-installation-health have no queue message at
all because they are run-only. Deriving the message from the job name -- which the first
pass would have done for the seventeen it kept -- would have silently enqueued messages the
dispatcher drops for the two renamed ones.

INTERNAL_JOB_SPEC now records, per job, the queue message type it really sends (null when
run-only) and the modes it really offers. The tool forwards a payload, dispatches enqueue
through JOBS.send and run through processJob -- the same dispatcher the queue consumer uses,
so an inline run and a queued run cannot diverge -- and routes the two run-only jobs to the
same functions their own /run routes call. All 20 are reachable; none are excluded.

The parity test now asserts the full route table with nothing filtered out, checks each
job's modes and its real message type against the route that sends it, and fails if a
run-only job has no inline runner wired. The compile-time assertion widened to
JobMessage["type"] | null so a bad messageType still fails the build.

The management deny-path suite separates two auth contracts that are genuinely different
rather than forcing one shape on both: the categorical requireOperator/requireInternal this
issue added, and the pre-existing requireOperatorAccess, which honors the established
wildcard opt-in (#2455) where an operator explicitly unscoping MCP_READ_REPO_ALLOWLIST
declares that token may read everything. The latter is pinned to its real boundary -- a
SCOPED allowlist is still refused -- instead of being exempted or "fixed" into a behavior
change nobody asked for.
…ient

validate:mcp caught the gap this closes: the four tenant tools were in the registry but
registered nowhere, which its own assertion calls "a promised capability with nothing
behind it". They needed a client the Worker did not have.

src/orb/control-plane-client.ts is that client, mirroring the miner's tenant-client posture
rather than sharing its code -- the miner reads process.env in a Node CLI, this takes the
Worker's Env binding, and the two products' control-plane credentials are separately
namespaced on purpose. What is shared is the contract: control-plane/src/http-app.ts owns
the wire shapes and both clients speak exactly its routes.

Every call fails loud. Tenant create and destroy are deliberate admin actions, so
unreachable, non-2xx, and malformed all throw rather than letting a caller read success
into something that did not happen; the non-2xx error carries the status only, never the
operator-adjacent body. One bounded request per call and no retry, because a create is not
idempotent. "Not configured" is answered as a structured result instead, since having no
hosted tenants to administer is the normal state for every deployment but one.

Also documents the maintenance-job surface: the self-host-maintenance workflow gains no
duties and stays the scheduled path, with loopover_fleet_run_job as the interactive one
running the identical dispatcher, and the operations doc now shows all three routes to the
same job.

The extracted fleet-admin functions get direct tests to 100% line and branch, including
the `rows.results ?? []` arms that the real in-memory D1 can never reach.
…tenant-list output

codecov/patch caught that the deny-path suite only ever reached the auth throw, so every
handler's actual behavior was ungraded. These drive each family past the gate: the
structured unavailable/not-configured answers that stand in for a capability a deployment
lacks, the kill switch's asymmetric confirm, the fleet registry round-trip, both
fleet_run_job dispatch paths including the renamed message type, and every instance
diagnostic including its reader-throws degradation.

That found a real contract defect: TenantListOutput required `tenants`, which the
not-configured answer has no list to supply, so a perfectly valid response failed its own
output schema with -32602. Made optional alongside an explicit `configured`.
codecov/patch was 86.29% with 58 lines missing in src/mcp/server.ts. The deny-path and
not-configured suites reached every guard but almost none of the work behind them: the
dead-letter tools all answered "unavailable" because a test JOBS binding has no
dead-letter admin, and the tenant tools all answered "not configured".

These supply the missing halves — a JOBS binding with the self-host queue's admin surface,
a stubbed control plane, seeded installation rows, and a client that actually advertises
elicitation. That last one is what finally reaches confirmDestructive: without the
capability the server falls through on the schema-level confirm alone, so the decline path
and the "an elicitation that errors is a decline, not an implicit yes" rule had no test.

One real gap fell out of it. FleetRegisterInstallationInput never declared `registered`,
so the opt-OUT half of the onboarding gate was unreachable over MCP -- an operator could
register an installation but never un-register it, even though the route supports both.
Declared, with the description spelling out what opting out actually does.

loopover_fleet_backfill_installations' success return stays uncovered: reconciling against
GitHub needs real Orb App credentials, and faking them to reach one return statement would
buy a covered line at the cost of a test that asserts nothing. Its failure path is covered
instead, which is the behavior that matters -- it fails loud rather than reporting a
backfill that never ran.
…ement families

#9521 landed its generator, so the two READMEs and the UI tool-reference module are now
generated from the contract registry. The 25 tools this branch adds flow through it with no
hand-edits, which is what that issue built it for.
@JSONbored
JSONbored force-pushed the feat/orb-management-tools-9522 branch from 59b778b to 8b5c4e8 Compare July 29, 2026 01:18
@JSONbored
JSONbored merged commit 7803f25 into main Jul 29, 2026
10 of 11 checks passed
@JSONbored
JSONbored deleted the feat/orb-management-tools-9522 branch July 29, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

orb(mcp): ORB management tool family — instance doctor/status/logs, queue+kill-switch ops, fleet + hosted-tenant administration

1 participant