feat(orb): registration-gate the fleet + cap ingest body (das-github-mirror model) - #1274
Merged
Conversation
…mirror model) Answers the "how should /v1/orb/ingest be protected?" question by following das-github-mirror's ingress model rather than a shared ingest secret (which would break #1257's hardwired-on, no-shared-key telemetry — every self-hoster would 401): - Open ingest, bounded. Read the body behind a 1 MiB ceiling (streaming, with a content-length fast-path) → 413 on oversize. Mirrors the body limit das-github-mirror puts in front of its open webhook ingress. Dedup already exists via UNIQUE(instance_id, repo_hash, pr_hash). - Registration gate (the trust anchor). New orb_instances table — every instance that ingests is recorded (registered=0 by default, like das-github-mirror's registered flag); signals are still stored for everyone (so registration is retroactive), but computeFleetAnalytics counts ONLY registered instances toward the fleet median. A stranger — or a ring of them — cannot move calibration until an operator opts them in. - Operator endpoints (internal-token gated): GET /v1/internal/orb/instances lists pending + registered instances with their stored-signal counts; POST /v1/internal/orb/instances/register opts one in (or out). Behavioral note: the fleet surfaces shipped in #1268 (operator dashboard + MCP tool) now read empty until the operator registers at least one instance — the intended trust posture. migrations/0061 + portable ON CONFLICT upserts (no pg-dialect change). Supersedes #1248.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
JSONbored
added a commit
that referenced
this pull request
Jun 24, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1274 +/- ##
=======================================
Coverage 95.04% 95.05%
=======================================
Files 177 177
Lines 19944 19981 +37
Branches 7179 7189 +10
=======================================
+ Hits 18956 18993 +37
Misses 395 395
Partials 593 593
🚀 New features to boost your workflow:
|
JSONbored
added a commit
that referenced
this pull request
Jun 24, 2026
JSONbored
added a commit
that referenced
this pull request
Jun 24, 2026
…end-to-end (#1270) Adds an integration seam test for the full Orb fleet pipeline: a self-host instance's review_audit ledger → exportOrbBatch (FLEET_QUERY join + payload) → handleOrbIngest (orb_signals upsert) → computeFleetAnalytics. Forward-compatible with the #1274 registration gate (registers the instance before asserting analytics). Covers clean-merge precision and human-reversal propagation into fleet reversal/FP rates.
This was referenced Jun 24, 2026
JSONbored
added a commit
that referenced
this pull request
Jun 25, 2026
Second piece of the central Gittensory Orb GitHub App (#1255). Maintains orb_github_installations (migration 0064) from the verified /v1/orb/webhook `installation` lifecycle events — one row per install of the shared Orb App, recording account + repository_selection and the suspend/unsuspend/deleted lifecycle. This is the registry onboarding + the token-broker (later PRs) read to know which installations exist and who owns them. - registered=0 by default — the Mirror-style manual-onboarding gate (an install is RECORDED but not trusted/active until a human opts it in), mirroring #1274. - The upsert runs synchronously in the receiver, BEFORE recording the webhook event, so a failed registry write is flipped to "error" + 500 and GitHub redelivers (the dedup guard only suppresses non-error rows). No-op for every non-installation event. Additive; stacked on #1293 (the webhook receiver). installation_repositories repo-delta tracking and PR-outcome processing are follow-ups. Advances #1255.
JSONbored
added a commit
that referenced
this pull request
Jun 25, 2026
Second piece of the central Gittensory Orb GitHub App (#1255). Maintains orb_github_installations (migration 0064) from the verified /v1/orb/webhook `installation` lifecycle events — one row per install of the shared Orb App, recording account + repository_selection and the suspend/unsuspend/deleted lifecycle. This is the registry onboarding + the token-broker (later PRs) read to know which installations exist and who owns them. - registered=0 by default — the Mirror-style manual-onboarding gate (an install is RECORDED but not trusted/active until a human opts it in), mirroring #1274. - The upsert runs synchronously in the receiver, BEFORE recording the webhook event, so a failed registry write is flipped to "error" + 500 and GitHub redelivers (the dedup guard only suppresses non-error rows). No-op for every non-installation event. Additive; stacked on #1293 (the webhook receiver). installation_repositories repo-delta tracking and PR-outcome processing are follow-ups. Advances #1255.
JSONbored
added a commit
that referenced
this pull request
Jun 25, 2026
Second piece of the central Gittensory Orb GitHub App (#1255). Maintains orb_github_installations (migration 0064) from the verified /v1/orb/webhook `installation` lifecycle events — one row per install of the shared Orb App, recording account + repository_selection and the suspend/unsuspend/deleted lifecycle. This is the registry onboarding + the token-broker (later PRs) read to know which installations exist and who owns them. - registered=0 by default — the Mirror-style manual-onboarding gate (an install is RECORDED but not trusted/active until a human opts it in), mirroring #1274. - The upsert runs synchronously in the receiver, BEFORE recording the webhook event, so a failed registry write is flipped to "error" + 500 and GitHub redelivers (the dedup guard only suppresses non-error rows). No-op for every non-installation event. Additive; stacked on #1293 (the webhook receiver). installation_repositories repo-delta tracking and PR-outcome processing are follow-ups. Advances #1255.
JSONbored
added a commit
that referenced
this pull request
Jun 25, 2026
Second piece of the central Gittensory Orb GitHub App (#1255). Maintains orb_github_installations (migration 0064) from the verified /v1/orb/webhook `installation` lifecycle events — one row per install of the shared Orb App, recording account + repository_selection and the suspend/unsuspend/deleted lifecycle. This is the registry onboarding + the token-broker (later PRs) read to know which installations exist and who owns them. - registered=0 by default — the Mirror-style manual-onboarding gate (an install is RECORDED but not trusted/active until a human opts it in), mirroring #1274. - The upsert runs synchronously in the receiver, BEFORE recording the webhook event, so a failed registry write is flipped to "error" + 500 and GitHub redelivers (the dedup guard only suppresses non-error rows). No-op for every non-installation event. Additive; stacked on #1293 (the webhook receiver). installation_repositories repo-delta tracking and PR-outcome processing are follow-ups. Advances #1255.
JSONbored
added a commit
that referenced
this pull request
Jun 25, 2026
Second piece of the central Gittensory Orb GitHub App (#1255). Maintains orb_github_installations (migration 0064) from the verified /v1/orb/webhook `installation` lifecycle events — one row per install of the shared Orb App, recording account + repository_selection and the suspend/unsuspend/deleted lifecycle. This is the registry onboarding + the token-broker (later PRs) read to know which installations exist and who owns them. - registered=0 by default — the Mirror-style manual-onboarding gate (an install is RECORDED but not trusted/active until a human opts it in), mirroring #1274. - The upsert runs synchronously in the receiver, BEFORE recording the webhook event, so a failed registry write is flipped to "error" + 500 and GitHub redelivers (the dedup guard only suppresses non-error rows). No-op for every non-installation event. Additive; stacked on #1293 (the webhook receiver). installation_repositories repo-delta tracking and PR-outcome processing are follow-ups. Advances #1255.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Answers "how should
/v1/orb/ingestbe protected?" by following das-github-mirror's ingress model instead of #1248's sharedORB_INGEST_SECRET— which would break #1257's hardwired-on, no-shared-key telemetry (every self-hoster would401without the secret). das-github-mirror keeps ingress open + verified-by-context and gates trust on aregistered=false-by-default flag + dedup + a body limit. Orb's many-instances→one-collector topology has no per-instance key the collector could verify, so the faithful translation is:readOrbIngestBodyreads behind a 1 MiB ceiling (streaming, with acontent-lengthfast-path) → 413 on oversize. Mirrors the body limit das-github-mirror puts in front of its open webhook ingress. Dedup already exists viaUNIQUE(instance_id, repo_hash, pr_hash).orb_instancestable — every instance that ingests is recorded (registered=0by default, like das-github-mirror'sregisteredflag). Signals are still stored for everyone (so registration is retroactive), butcomputeFleetAnalyticscounts only registered instances toward the fleet median. A stranger — or a coordinated ring — can't move calibration until an operator opts them in (directly fixes the "median gameable by a bad-actor ring" risk from Fleet-derived gate auto-tune: design + data-readiness gate (do not build yet) #1272).GET /v1/internal/orb/instanceslists pending + registered instances with their stored-signal counts;POST /v1/internal/orb/instances/registeropts one in ({instanceId, registered?}, defaults true).Supersedes #1248 (keeps its DoS hardening, drops the shared-secret requirement).
Behavioral note
The fleet surfaces shipped in #1268 (operator dashboard
fleetMetrics+ thegittensory_get_fleet_analyticsMCP tool) now read empty until the operator registers at least one instance — the intended trust posture. Register the home instance once and it flows. (The #1270 end-to-end test will get a one-lineregisteronce both land — noted there.)Scope
0061_orb_instances.sqlis the next contiguous numberON CONFLICT … DO UPDATEupserts (nopg-dialectchange needed); internal routes (not in OpenAPI)Validation
npm run test:ci— green (incl.db:migrations:check, typecheck, coverage, workers, ui)src/**line (ingest.ts,analytics.ts,routes.ts) — verified against the v8 JSON report, incl. both?? []guards, thejson().catch, the body-cap content-length vs streaming paths, and registered/unregistered foldorb-analyticsto register instances; added an explicit "unregistered stranger excluded" testSafety
Advances #1255.