Skip to content

feat(review): skip AI review, gate evaluation, and publish for known automation-bot PRs - #4659

Merged
JSONbored merged 3 commits into
mainfrom
feat/skip-automation-bot-pull-requests
Jul 11, 2026
Merged

feat(review): skip AI review, gate evaluation, and publish for known automation-bot PRs#4659
JSONbored merged 3 commits into
mainfrom
feat/skip-automation-bot-pull-requests

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Release-please's github-actions[bot], Renovate, and Dependabot PRs currently still pay full AI-review + gate-evaluation cost even though their public surface is already suppressed elsewhere — this closes that gap by skipping the whole webhook pass (and every re-entry path: scheduled sweep, CI-completion re-review, linked-issue-change re-review) as soon as the PR is confirmed automation-bot-authored.
  • Security: the webhook-entry check requires the live event sender (payload.sender, GitHub-attested, non-spoofable) to itself be one of the three protected bot logins with type: "Bot" — not just the PR's stored author — so a contributor who gains push access to an existing bot PR's branch still gets full review of their own commits (synchronize can't ride the bot's original authorship to dodge review). Re-entry paths (no live webhook actor available) use only the immutable stored author, which was already verified against the live actor at the PR's original opened event.
  • Default-on globally (GITTENSORY_SKIP_AUTOMATION_BOT_PRS), with a per-repo inherit/off/enabled override (repository_settings.skip_automation_bot_authors, mirrors moderation_gate_mode's shape) for repos that want it forced on or off regardless of the global default.

Test plan

  • npm run typecheck
  • npm run test:ci (full unsharded gate: coverage, engine/driver parity, workers, mcp/miner pack, openapi/settings-parity, docs/manifest drift, ui lint/typecheck/test/build)
  • npm audit --audit-level=moderate
  • New pure-function security tests (test/unit/automation-bot-skip.test.ts) — pin the exploit-resistance guarantee (human sender on an existing bot PR is never skipped) plus every inherit/off/enabled combination
  • New DB round-trip tests (test/unit/repository-settings-skip-automation-bot-authors.test.ts)
  • New end-to-end webhook + re-entry tests (test/unit/queue.test.ts): genuine bot skip, exploit-attempt non-skip, per-repo off/enabled overrides, sweep re-entry skip
  • 100% line + branch coverage confirmed via lcov on every new/changed line

@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026

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 ecfa05f Commit Preview URL

Branch Preview URL
Jul 11 2026, 12:22 AM

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.22%. Comparing base (3ae7ece) to head (c2f230c).
⚠️ Report is 19 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/queue/processors.ts 75.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4659      +/-   ##
==========================================
- Coverage   94.22%   94.22%   -0.01%     
==========================================
  Files         441      442       +1     
  Lines       38741    38757      +16     
  Branches    14117    14126       +9     
==========================================
+ Hits        36504    36518      +14     
  Misses       1577     1577              
- Partials      660      662       +2     
Files with missing lines Coverage Δ
src/db/repositories.ts 96.72% <100.00%> (+<0.01%) ⬆️
src/db/schema.ts 73.07% <ø> (ø)
src/openapi/schemas.ts 100.00% <ø> (ø)
src/settings/automation-bot-skip.ts 100.00% <100.00%> (ø)
src/types.ts 100.00% <ø> (ø)
src/queue/processors.ts 95.66% <75.00%> (-0.05%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 10, 2026
@loopover-orb

loopover-orb Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - fixes required

Review updated: 2026-07-11 00:26:42 UTC

15 files · 1 AI reviewer · 2 blockers · readiness 93/100 · CI failing · blocked

🛑 Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

Review summary
This PR adds a config-driven skip for AI review/gate/publish on confirmed automation-bot PRs (release-please, Renovate, Dependabot), wiring the check into both the fresh webhook path (gated on the live, non-spoofable `payload.sender` plus stored author) and all re-entry paths (gated on stored author only, which was already verified against sender at PR-open time). The schema/migration/repository/types/openapi layers are all updated in parity, the migration is a simple additive `ALTER TABLE ... ADD COLUMN ... NOT NULL DEFAULT 'inherit'` (idempotency-safe as long as 0140 is never re-numbered), and the security reasoning for using live sender vs. stored author is sound and is directly exercised by an exploit-attempt test (`queue.test.ts`, human pushing to an existing bot PR's branch is not skipped). The PR description does not link or close any tracked issue, which this repo's contribution policy requires before a PR can be treated as merge-ready.

Blockers

  • No linked/closed issue in the PR description — per this repo's contribution policy every external PR must close or clearly reference an eligible open issue, and this one (a new default-on behavior change to the review pipeline) doesn't cite one, so it can't be marked merge-ready without that link being added or justified.
  • codecov/patch is failing at 87.50% against a 99% target, and the likely gap is the untested `console.warn` audit-failure branch in `src/queue/processors.ts` around line 6181 (the `.catch()` on `recordAuditEvent` inside the new skip block) — add a test that forces `recordAuditEvent` to reject and asserts the webhook still returns/records `processed` despite the audit-log failure.
Nits — 5 non-blocking
  • The `console.warn` at `src/queue/processors.ts:6181` is legitimate best-effort error logging (not debug leftover), but per the coverage note above it currently has no test exercising the rejection path — worth pairing with a test rather than leaving it as the only uncovered branch in this diff.
  • `resolveSkipAutomationBotPullRequests`'s per-repo override is intentionally symmetric (both `off` and `enabled` fully override the global default), unlike `moderation_gate_mode`'s global-is-authoritative asymmetry — the doc comment explains why, but worth a second maintainer sign-off since it's a deliberate divergence from the established pattern in this codebase.
  • `skipAutomationBotAuthors` is optional in `RepositorySettings` (`src/types.ts`) purely so existing fixtures don't need touching, per its own comment — fine, but confirm no caller reads it without going through `getRepositorySettings`'s normalization (which always populates it), or a raw partial object could reach `resolveSkipAutomationBotPullRequests` with `undefined` and silently behave as `inherit` in an unexpected place.
  • Add the missing issue link/reference to the PR description so the automated eligibility gate and future readers can trace the motivation.
  • Add a test asserting the `recordAuditEvent(...).catch(...)` branch in `processGitHubWebhook` (processors.ts ~6172-6181) to close the coverage gap and confirm audit-log failures don't block or un-skip the webhook.

Why this is blocked

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

CI checks failing

  • validate
  • validate-code
Signal Result Evidence
Code review ❌ 2 blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 48 registered-repo PR(s), 40 merged, 275 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 48 PR(s), 275 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 48 PR(s), 275 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before / after /
/ mobile before / (mobile) after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 10, 2026
@JSONbored
JSONbored force-pushed the feat/skip-automation-bot-pull-requests branch from 79febef to 3474c63 Compare July 10, 2026 10:22
@JSONbored
JSONbored force-pushed the feat/skip-automation-bot-pull-requests branch from 3474c63 to fa7f33c Compare July 10, 2026 10:38
…automation-bot PRs

Waste elimination for release-please's github-actions[bot], Renovate, and
Dependabot: a PR/event genuinely triggered by one of these never needs AI
spend, gate evaluation, or a public-surface publish. Gated on the live
webhook sender (not just the stored PR author) so a human pushing to an
existing bot PR's branch still gets full review of their own commits.
Default-on globally, with an inherit/off/enabled per-repo override
(repository_settings.skip_automation_bot_authors, mirrors
moderation_gate_mode's shape).
…ness docs check

Same rationale as the existing agentGlobalFreezeOverride exclusion: this
field is deliberately DB-only (global env default + per-repo override),
never wired into .gittensory.yml parsing, so it correctly has no yml
token to check against.
@JSONbored
JSONbored merged commit 5703e7a into main Jul 11, 2026
9 checks passed
@JSONbored
JSONbored deleted the feat/skip-automation-bot-pull-requests branch July 11, 2026 00:31
JSONbored added a commit that referenced this pull request Jul 11, 2026
…es (#4814)

* test(unit): split queue.test.ts and backfill.test.ts into smaller files

queue.test.ts (33,461 lines / 810 tests) and backfill.test.ts (6,874 lines
/ 236 tests) each ran as one atomic unit under a single vitest worker --
queue.test.ts alone accounted for ~282s (roughly half the wall-clock) of
the full coverage run's ~565s duration, since vitest schedules whole test
files to workers and can't parallelize within one file.

Split each into several files along safe, verified boundaries (no shared
mutable state crosses a file boundary; hoisted helper functions used
across sections were promoted into each file's shared header). Test
count and pass/fail results are identical before and after (810 and 236
tests respectively, all passing) -- verified via `vitest run` on the full
old-vs-new file sets.

Also fixes two stale comments in src/queue/processors.ts that named the
old monolithic queue.test.ts file for a test that moved.

* fixup: port #4757's e2e-test-gen changes into split queue-5.test.ts

Rebasing onto main picked up #4757 (feat(review): decouple e2e-test-gen
auto-trigger and widen checkbox auth), which touched the monolithic
queue.test.ts before it was split. That content now lives in
queue-5.test.ts, so port the same test changes there: the new
autoTrigger opt-in on seedAutoTriggerPr, its three new/updated tests,
and the [BETA] badge text update. Verified against main's actual source
change (src/queue/processors.ts already carries the [BETA] label) and a
full run of all 6 split queue files: 813 tests passing (810 + 3 new).

* fixup: port #4732, #4659, #4816 test changes into split queue files

* fixup: port #4732 and #4816 test changes into split queue files

* fixup: port latest main's queue.test.ts changes into split queue-4.test.ts
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. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

1 participant