Skip to content

fix(orb): make fleet telemetry work + non-optional in broker mode - #1434

Merged
JSONbored merged 1 commit into
mainfrom
claude/orb-broker-telemetry
Jun 26, 2026
Merged

fix(orb): make fleet telemetry work + non-optional in broker mode#1434
JSONbored merged 1 commit into
mainfrom
claude/orb-broker-telemetry

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Makes the Orb fleet-telemetry exporter actually work and be non-optional in broker mode — the
canonical self-host path where the instance relies on the central Orb for GitHub tokens + webhook relay.

Three issues, all in orb-collector.ts:

  1. Telemetry never ran in broker mode. The exporter gated on a local GITHUB_APP_PRIVATE_KEY, which a
    brokered instance never holds (the Orb mints tokens), so an enrolled self-host exported nothing
    defeating the "rely on our Orb for insights" model. Now gated on the enrollment OR a local App key.
  2. ORB_AIR_GAP could opt a brokered instance out. Telemetry is the fleet-telemetry contract for
    brokered self-hosts; air-gap now suppresses export only for a self-managed (non-brokered) instance.
  3. Instance-id collision. Brokered instances hold no Orb/App id, so they all collapsed to the
    "unknown" instanceId fallback (colliding cursors + collector dedup). Now derived from the enrollment
    secret
    when no Orb/App id is present — hashed, so the high-entropy secret never leaks, and unique +
    stable per install.

Scope

  • src/selfhost/** + its test only; no behavior change for the hosted worker or self-managed instances.
  • No secrets logged/sent; the enrollment secret is only ever hashed.

Validation

  • npm run typecheck
  • npm run test:coverage — full suite green; 100% of changed lines and branches covered (new test: brokered mode exports despite air-gap + no App key, and uses the enrollment-derived instance id).

Advances the self-host Orb-broker model (follow-up to #1433).

A brokered self-host (ORB_ENROLLMENT_SECRET set) relies on the central Orb for
GitHub tokens + webhook relay, so fleet telemetry is part of the self-hosting
contract. But the exporter gated on a local GITHUB_APP_PRIVATE_KEY — which a
brokered instance never holds — so broker-mode telemetry never ran at all, and
ORB_AIR_GAP could suppress it. Also, brokered instances share no Orb/App id, so
they collided on the 'unknown' instanceId fallback.

- Gate export on the enrollment OR a local App key (brokered = configured).
- Air-gap suppresses export only for a self-managed (non-brokered) instance;
  a brokered instance always exports.
- Derive instanceId from the enrollment secret when no Orb/App id is present
  (hashed — the high-entropy secret never leaks; unique + stable per install).
@dosubot dosubot Bot added the size:S label Jun 26, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored JSONbored self-assigned this Jun 26, 2026
@JSONbored JSONbored added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 26, 2026
@JSONbored
JSONbored merged commit 823749a into main Jun 26, 2026
17 checks passed
@JSONbored
JSONbored deleted the claude/orb-broker-telemetry branch June 26, 2026 08:26
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.40%. Comparing base (92959ba) to head (634408b).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1434   +/-   ##
=======================================
  Coverage   95.40%   95.40%           
=======================================
  Files         193      193           
  Lines       20971    20973    +2     
  Branches     7580     7581    +1     
=======================================
+ Hits        20008    20010    +2     
  Misses        383      383           
  Partials      580      580           
Files with missing lines Coverage Δ
src/selfhost/orb-collector.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.

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.

1 participant