⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
src/orb/installations.ts:44-65's backfillOrbInstallations doc comment claims it "Reconciles the registry against GitHub's authoritative installation list -- recovers installs whose installation webhook fired before the receiver's secret was configured (so they were never recorded)." Confirmed via grep across src/: it's only referenced by its own definition and by test/unit/orb-app-auth.test.ts. No route, cron, or script anywhere ever calls it, so the recovery capability the comment promises does not actually run today.
Requirements
Wire backfillOrbInstallations to a real trigger -- an admin route is the natural fit given /v1/internal/orb/instances already exists in src/api/routes.ts -- so the documented recovery capability is actually reachable. If a manually-invoked admin route is the intended shape (rather than an automatic cron), that's an acceptable fix, but the function must have a real, reachable caller after this PR; leaving it unwired and only updating the comment does not resolve this issue.
Deliverables
All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
src/** -- 99%+ patch coverage, branch-counted, on the new route/trigger wiring.
Expected Outcome
backfillOrbInstallations's documented reconciliation capability is reachable via a real admin route, not just present as dead, tested-but-unreferenced code.
Links & Resources
src/orb/installations.ts:44-65
src/api/routes.ts
test/unit/orb-app-auth.test.ts
Context
src/orb/installations.ts:44-65'sbackfillOrbInstallationsdoc comment claims it "Reconciles the registry against GitHub's authoritative installation list -- recovers installs whoseinstallationwebhook fired before the receiver's secret was configured (so they were never recorded)." Confirmed via grep acrosssrc/: it's only referenced by its own definition and bytest/unit/orb-app-auth.test.ts. No route, cron, or script anywhere ever calls it, so the recovery capability the comment promises does not actually run today.Requirements
Wire
backfillOrbInstallationsto a real trigger -- an admin route is the natural fit given/v1/internal/orb/instancesalready exists insrc/api/routes.ts-- so the documented recovery capability is actually reachable. If a manually-invoked admin route is the intended shape (rather than an automatic cron), that's an acceptable fix, but the function must have a real, reachable caller after this PR; leaving it unwired and only updating the comment does not resolve this issue.Deliverables
backfillOrbInstallationsis wired to a real admin route (or cron) insrc/api/routes.ts/src/index.tsbackfillOrbInstallationsand reconciles a missing installationAll of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
src/**-- 99%+ patch coverage, branch-counted, on the new route/trigger wiring.Expected Outcome
backfillOrbInstallations's documented reconciliation capability is reachable via a real admin route, not just present as dead, tested-but-unreferenced code.Links & Resources
src/orb/installations.ts:44-65src/api/routes.tstest/unit/orb-app-auth.test.ts