Skip to content

feat(orb): surface fleet calibration analytics via dashboard + MCP - #1268

Merged
JSONbored merged 1 commit into
mainfrom
feat/orb-fleet-surfaces
Jun 24, 2026
Merged

feat(orb): surface fleet calibration analytics via dashboard + MCP#1268
JSONbored merged 1 commit into
mainfrom
feat/orb-fleet-surfaces

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Exposes the fleet calibration analytics (computeFleetAnalytics, shipped in #1256) through the two operator-facing read surfaces that were deferred from #1255:

  • gittensory_get_fleet_analytics MCP tool — operator-gated (a session must carry operator authority; trusted token/static identities pass, mirroring the other measurement tools), measurement only. Lets the owner audit fleet drift directly from an agent harness. Returns the same shape as the existing /v1/internal/fleet/analytics endpoint.
  • Operator dashboard fleetMetricsbuildOperatorDashboardPayload now folds in the 90-day fleet report. Two summary cards (Fleet instances, Fleet merge precision) join the metrics grid, and a Fleet health panel on the operator route renders median merge/close precision, false-positive + reversal rates, p50 cycle time, and the per-instance outlier count.

Both surfaces are read-only aggregates over the anonymized orb_signals (HMAC'd instance/repo/pr hashes + counts); no per-repo identity or sensitive terms cross the boundary. The MCP result still runs through redactSensitiveForMcp, and the operator-dashboard test asserts the serialized payload contains none of the forbidden export terms.

Advances #1255 (the collector + analytics fn + internal endpoint landed in #1256; the per-instance App retirement + always-on hardwire is #1257). Auto-tune wiring and the live end-to-end fleet loop remain as separate follow-ups.

Scope

  • Narrow, in wantedPaths (src/, apps/gittensory-ui/, test/)
  • No blockedPaths, no secrets / wallets / hotkeys / trust scores / reward values
  • No changelog edit; no generated-artifact drift (ui:openapi:check clean — the operator route is not an OpenAPI surface)

Validation

  • npm run test:ci — green (actionlint, db:migrations:check, typecheck, test:coverage, test:workers, build:mcp, test:mcp-pack, ui:openapi:check, ui:version-audit, ui:lint, ui:typecheck, ui:test, ui:build)
  • npm audit --audit-level=moderate — clean
  • Patch coverage: every changed line and branch in src/mcp/server.ts and src/services/operator-dashboard.ts covered (verified against the v8 JSON report) — both sides of the metric-card ternaries and all three requireOperatorAccess arms (non-session / operator session / non-operator session)
  • New test/unit/mcp-fleet-analytics.test.ts (4 cases incl. the operator-gate matrix) + extended test/unit/operator-dashboard.test.ts (empty-fleet and populated-fleet-with-outlier cases)

Safety

  • Operator-only: the MCP gate throws for non-operator sessions (negative-path test included); the data is fleet-aggregate, never per-repo
  • No public/private boundary leak — anonymized hashes + numeric aggregates only; forbidden-terms assertion in the operator-dashboard test
  • No auth/CORS/session changes

UI Evidence

The operator route gains a Fleet health section (median precision / FP rate / reversal rate / cycle p50 / outliers) plus two cards in the existing metrics grid. It renders only when instanceCount > 0, so deployments with no fleet data see no empty panel. (Operator-only route; no public-facing visual change.)

Expose the fleet calibration analytics (computeFleetAnalytics, shipped in
#1256) through two operator-facing read surfaces:

- gittensory_get_fleet_analytics MCP tool — operator-gated (sessions need
  operator authority; trusted token/static identities pass), measurement
  only. Lets the owner audit fleet drift from their agent harness.
- Operator dashboard fleetMetrics — median merge/close precision, FP +
  reversal rates, and cycle-time percentiles, plus two summary cards
  (Fleet instances, Fleet merge precision) and a Fleet health panel in
  the operator route.

Both are read-only aggregates over the anonymized orb_signals; no per-repo
or sensitive terms cross the boundary.

Advances #1255.
@dosubot dosubot Bot added the size:L label Jun 24, 2026
@JSONbored JSONbored self-assigned this Jun 24, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.03%. Comparing base (654e7ca) to head (ebdda69).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1268   +/-   ##
=======================================
  Coverage   95.03%   95.03%           
=======================================
  Files         177      177           
  Lines       19894    19908   +14     
  Branches     7170     7176    +6     
=======================================
+ Hits        18906    18920   +14     
  Misses        395      395           
  Partials      593      593           
Files with missing lines Coverage Δ
src/mcp/server.ts 95.56% <100.00%> (+0.08%) ⬆️
src/services/operator-dashboard.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cloudflare-workers-and-pages

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 Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui ebdda69 Commit Preview URL

Branch Preview URL
Jun 24 2026, 09:48 PM

@JSONbored
JSONbored merged commit 43a2449 into main Jun 24, 2026
20 checks passed
@JSONbored
JSONbored deleted the feat/orb-fleet-surfaces branch June 24, 2026 21:57
@github-actions github-actions Bot mentioned this pull request Jun 25, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant