Skip to content

orb(chat): read-only grounding tool registry over maintainer surfaces — authz and redaction enforced by tests #9189

Description

@JSONbored

Context

Part of the ORB maintainer chat platform epic; implements the grounding side per the spec sub-issue's recorded decisions (do not start before that spec closes — the tool list below is the candidate set, and the spec may trim or extend it). Mirrors the contributor pattern of #6517: read-only, deterministic, JSON tool results that the chat model consumes — grounding, not generation.

Requirements

  1. A tool-registry module in src/ exposing the spec-confirmed read-only tools over existing services (queue snapshot, per-PR status + gate verdict + blocker reasons, decision-record fetch, ledger-verify proxy, calibration summary, effective-config resolution, audit-event tail, repo-settings snapshot). Each tool wraps an existing service/module — no new data paths, no new SQL surfaces invented for chat.
  2. Authz on every call: per-repo maintainer verification through the existing helpers (the authz doc-comment over src/api/routes.ts's helpers is the source of truth). Cross-repo access denies. Affiliation-tier behavior exactly as the spec decided.
  3. Redaction is structural: every tool response passes the existing public-safety redaction path before leaving the API; wallet/hotkey/reward/private-ranking/raw-trust fields are unreachable by construction (allowlisted response shapes, not blocklist filtering).
  4. Read-only is enforced, not promised: no tool may hold an installation Octokit in write mode; add a unit test asserting the registry performs zero GitHub writes (mirroring the no-direct-octokit invariant style).
  5. Per-tool response token budgets and deterministic ordering (stable sort keys) so identical state produces identical grounding.
  6. Accuracy/calibration responses always carry coverage and confidence interval alongside any accuracy figure.

Deliverables

  • The tool registry + route wiring on the protected API, feature-flagged off by default (LOOPOVER_REVIEW_*-style flag, ships OFF).
  • Unit tests: per-tool authz-deny (cross-repo actor), redaction shape tests, the zero-writes invariant test, determinism test (two identical calls, identical bytes).
  • Docs: a short tool-catalog reference section (the spec's catalog, as-built).

Expected outcome

The chat backend can answer "what's blocking the queue?" and "why did the gate close #123?" from real ORB state, with authz and redaction guaranteed by tests rather than convention.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.orbGittensory Orb related - maintainer self-hosting analytics.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions