Skip to content

miner-ui(hosted): per-tenant chat grounding and action-dispatch authz — server-side, audited #9197

Description

@JSONbored

Context

Part of the hosted AMS chat platform epic; blocked on the hosted-mode flag sub-issue (and consuming the tenant-auth sub-issue's session). The local chat is already grounded (the 11 loopover_miner_* read tools, #6517) and action-capable (governor pause/resume #6521/#6839, portfolio actions #6838) — but every tool and dispatch assumes the local single-operator trust model. Hosted, both must be re-based onto server-side per-tenant authorization.

Requirements

  1. Grounding: each of the read tools works against the tenant's own data via the hosted API; tool responses are tenant-scoped by the server (the tenant-auth sub-issue's boundary), deterministic, and budget-capped. The tool contract (names, shapes) stays identical to local so the conversation layer is mode-agnostic.
  2. Action dispatch: governor and portfolio actions keep the propose → explicit-confirm → server-side-execute pattern; hosted execution verifies, server-side per dispatch: session tenant == target tenant, and the target resource (attempt, queue entry, governor) belongs to that tenant.
  3. Every hosted dispatch writes an audit record with actor, tenant, action, and pre/post state.
  4. Rate/budget controls per tenant on both tool calls and dispatches (align with the tenant-quota machinery — relates Wire evaluateTenantQuota into job-dispatch's real admission path (currently only feeds a dashboard number) #7647/Add soft quota-warning notifications before #7647's hard block #7662 — rather than inventing a parallel limiter).
  5. Failure and denial surface in-conversation with the audited reason; no silent no-ops (the miner chat had exactly this bug class locally — fix(miner-ui): governor pause/resume chat actions are registered and rendered but never dispatched from the chat conversation #8670's registered-but-never-dispatched actions; add a wiring test that every registered action is reachable from a conversation).

Deliverables

  • Hosted grounding + dispatch wiring, tenant-checked server-side, feature-flagged off by default.
  • Tests: cross-tenant tool/dispatch denial per action, audit emission, the action-reachability wiring test, quota behavior at the limit.

Expected outcome

The hosted chat is exactly as capable as the local one — and provably no more capable than its tenant.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions