fix(review): require a real installation before acting-autonomy scans include a repo - #5052
Merged
Merged
Conversation
… include a repo (#5023) isAgentConfigured resolves the operator's global-default autonomy for ANY repoFullName, regardless of whether the GitHub App is installed there. A repo with only a local `repositories` row (a stray subnet-registry entry, say) inherited that global default and looked "agent-configured" purely by existing, even with no installation token to act on it. Require a real installationId before the autonomy-based path counts, across every site that mirrors the regate sweep's selection: the regate sweep itself, PR reconciliation, the sweep watchdog, ops-alerts, selftune, and the maintainer recap. The explicit GITTENSORY_REVIEW_REPOS allowlist path is untouched -- it's a deliberate, operator-typed signal independent of installation state.
Contributor
|
Superagent did not find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5052 +/- ##
==========================================
- Coverage 94.13% 94.13% -0.01%
==========================================
Files 465 465
Lines 39536 39542 +6
Branches 14428 14431 +3
==========================================
+ Hits 37217 37222 +5
Misses 1664 1664
- Partials 655 656 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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
isAgentConfiguredresolves the operator's global-default autonomy for ANYrepoFullName, regardless of whether the GitHub App is installed there. A repo with only a localrepositoriesrow (e.g. a stray gittensor-subnet-registry entry with no real installation) inherited that global default and looked "agent-configured" purely by existing, even with no installation token to ever act on it.hasInstallation(typeof repo.installationId === "number") guard before the autonomy-based eligibility check, mirroring the same pattern across every site that copies the regate sweep's own repo-selection logic:fanOutAgentRegateSweepJobs(src/queue/processors.ts),watchedReposin bothpr-reconciliation.tsandsweep-watchdog.ts, and the scan helpers inops-wire.ts,selftune-wire.ts, andmaintainer-recap-wire.ts.GITTENSORY_REVIEW_REPOSallowlist path (isConvergenceRepoAllowed) is deliberately left untouched — it's an operator-typed signal independent of installation state (e.g. reviewing ahead of a pending install).fanOutAgentRegateSweepJobs) already correctly scoped by installation and that ops-alerts/selftune/maintainer-recap just needed to "mirror the regate sweep exactly" — investigation found the regate sweep had the identical leak, so this PR also fixesprocessors.tsitself plus two more call sites with the same pattern (pr-reconciliation.ts,sweep-watchdog.ts) that weren't in Align ops-alerts / selftune / maintainer-recap scoping with the regate sweep's isInstalled pattern #5023's stated scope.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlint(vianpm run test:ci)npm run typechecknpm run test:coveragelocally — 100% branch/line coverage on every changed line across all 6 files (verified via targeted--coverage.includeruns per file; the only residual gaps flagged by v8 are pre-existing branches on lines my diff did not touch).npm run test:workers(vianpm run test:ci)npm run build:mcp(vianpm run test:ci)npm run test:mcp-pack(vianpm run test:ci)npm run ui:openapi:check(vianpm run test:ci) — no API/schema changes in this PR.npm run ui:lint(vianpm run test:ci)npm run ui:typecheck(vianpm run test:ci)npm run ui:build(vianpm run test:ci)npm audit --audit-level=moderate— 0 vulnerabilities.queue.test.ts,selftune-wiring.test.ts, andops-wire.test.ts;pr-reconciliation.test.ts,sweep-watchdog.test.ts, andmaintainer-recap-wire.test.tsalready had fixtures that exercise the new guard's both branches.Safety
UI Evidencesection. (N/A — no UI changes.)Notes
UI Evidencesection is included.