Skip to content

fix(review): fold pause into the ai-review public gate skip reason - #9909

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-9692
Jul 29, 2026
Merged

fix(review): fold pause into the ai-review public gate skip reason#9909
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-9692

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

Summary

  • On a paused repo the publish pass still computes the gate verdict (only GitHub writes are suppressed), but resolvePublicAiReviewGateSkipReason had no way to know the pass was paused, so aiReviewWillRun stayed true while runAiReviewForAdvisory correctly refused to spend on mode: "paused". That mismatch fired the github_app.ai_review_public_summary_missing alarm and capturePostHogReviewFailure on every single paused pass, plus started review-evasion tracking for a review that would never run.
  • Adds "paused" to PublicAiReviewGateSkipReason and threads mode: AgentActionMode (required) through resolvePublicAiReviewGateSkipReasonshouldRequirePublicAiReviewForAdvisoryshouldStartAiReviewForAdvisory, mirroring the mode check runAiReviewForAdvisory already applies as its own first line. paused is evaluated before skip_ai_review_requested, matching that priority order.
  • Every processors.ts call site (the three fail-closed holds plus the aiReviewWillRun composition and the named-reason audit) now passes the pass's already-resolved mode, so a paused pass records exactly one github_app.ai_review_public_gate_skipped row naming paused and nothing else changes for live/dry_run.

Closes #9692

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • This change is entirely within src/queue/** (no UI, MCP, wrangler, or dependency changes), so actionlint/ui:*/build:mcp/test:mcp-pack/npm audit are unaffected by the diff and were not re-run locally given the shared-workspace time budget; typecheck and the targeted vitest runs below (including full coverage on the two changed files) are green.

Validation detail

  • npx tsc --noEmit (root) and tsc -p packages/loopover-contract|loopover-mcp|loopover-miner/tsconfig.json --noEmit are clean.
  • npx vitest run test/unit/ai-review-advisory.test.ts test/unit/auto-review-wiring.test.ts test/unit/gate-integrity-invariants.test.ts test/unit/reputation-wiring.test.ts test/unit/queue-2.test.ts --coverage — 256/256 passing; src/queue/ai-review-orchestration.ts at 96%/93.7% stmt/branch with the only uncovered lines pre-existing and unrelated to this diff (RAG context building, escalation logging, vote recording).
  • Broader regression sweep of the same processors.ts surface: npx vitest run test/unit/queue.test.ts test/unit/queue-2.test.ts test/unit/queue-3.test.ts test/unit/queue-4.test.ts test/unit/queue-5.test.ts test/unit/queue-lifecycle-guards.test.ts — all green (1000+ tests), confirming no regression in the existing agentPaused/aiReviewMode paths.
  • New end-to-end regression test in test/unit/queue-2.test.ts drives a real processJob webhook pass against a repo with agentPaused: true and aiReviewMode: "block", asserting: zero ai_review_public_summary_missing audit rows, exactly one ai_review_public_gate_skipped row with reason: "paused", and zero active_review_tracking rows for the head SHA — matching every Deliverable in the issue.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed. (No API/OpenAPI/MCP surface changed.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (No UI changed.)
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository. (Not applicable — backend-only change.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

Not applicable — this is a backend-only fix in src/queue/ai-review-orchestration.ts and src/queue/processors.ts with no visible surface change.

Notes

  • No behavior change for mode === "live" or "dry_run"; only the paused pass's named skip reason changes.

A paused repo's publish pass still computes the gate verdict (only GitHub
writes are suppressed), so resolvePublicAiReviewGateSkipReason now checks
mode === "paused" first, matching the stop runAiReviewForAdvisory already
applies. Threading AgentActionMode through shouldStartAiReviewForAdvisory
and shouldRequirePublicAiReviewForAdvisory keeps aiReviewWillRun in sync
with reality on a paused pass, so the ai_review_public_summary_missing
alarm and review-evasion tracking no longer fire against a review that
was never expected to run.
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 29, 2026 21:44
@loopover-orb

loopover-orb Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-29 21:54:12 UTC

7 files · 1 AI reviewer · no blockers · readiness 98/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR threads a `mode: AgentActionMode` parameter through `resolvePublicAiReviewGateSkipReason` → `shouldRequirePublicAiReviewForAdvisory` → `shouldStartAiReviewForAdvisory` and all `processors.ts` call sites, adding a `paused` skip reason evaluated first so the gate no longer disagrees with `runAiReviewForAdvisory`'s own `mode === "paused"` stop. The fix targets the actual root cause (the gate-resolver's ignorance of pause state) rather than patching the alarm/tracking symptoms downstream, and the diff shows every touched call site updated in tandem with the type change, which is the correct way to thread a required field through TypeScript. Tests cover both the new precedence (paused wins over skipAiReview/mode-off) and the sibling-hold suppression, and the included regression test exercises the real webhook path end-to-end rather than fabricating an unreachable state.

Nits — 3 non-blocking
  • src/queue/ai-review-orchestration.ts and processors.ts are both flagged as long files by the size-smell scan, though this PR only adds ~19 lines to each — pre-existing size debt, not something this PR need address.
  • The `mode` field is now required on `maybeAddRequiredAutoReviewSkipHold`/`maybeAddPromptInjectionHold`/`maybeAddReputationSkipHold` (processors.ts:8364,8411,8443) purely to enable the `paused` suppression test — worth double-checking no other production call site of these three helpers exists outside `maybePublishPrPublicSurface` that the diff didn't need to touch, since a required arg addition would fail to compile there if missed (though passing CI here suggests none is missing).
  • Given `scripts/check-dispatch-gate-reasons.ts` explicitly documents `shouldRequirePublicAiReviewForAdvisory`/`shouldStartAiReviewForAdvisory` as allowed bare-booleans paired with `resolvePublicAiReviewGateSkipReason`, it's worth confirming that doc comment's rationale still holds now that `paused` is folded in — it does, since the resolver is updated in lockstep, but flagging for the next contributor touching this trio.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #9692
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 (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 101 registered-repo PR(s), 69 merged, 1 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 101 PR(s), 1 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff adds "paused" as a first-checked reason in resolvePublicAiReviewGateSkipReason, threads mode through shouldRequirePublicAiReviewForAdvisory/shouldStartAiReviewForAdvisory and all named processors.ts call sites (including the aiReviewWillRun composition and the audit call site), and includes unit tests for precedence/shouldStartAiReviewForAdvisory plus a named end-to-end regression test as

Review context
  • Author: bitfathers94
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript
  • Official Gittensor activity: 101 PR(s), 1 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@superagent-security

Copy link
Copy Markdown
Contributor

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

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

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.42%. Comparing base (cb167ba) to head (62daaf4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9909      +/-   ##
==========================================
+ Coverage   79.52%   80.42%   +0.90%     
==========================================
  Files         281      283       +2     
  Lines       58577    62208    +3631     
  Branches     6833     8193    +1360     
==========================================
+ Hits        46581    50030    +3449     
- Misses      11706    11766      +60     
- Partials      290      412     +122     
Flag Coverage Δ
backend 94.98% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/queue/ai-review-orchestration.ts 98.35% <100.00%> (ø)
src/queue/processors.ts 94.81% <ø> (ø)

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 8369904 into JSONbored:main Jul 29, 2026
8 checks passed
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.

orb(review): a paused repo fires the ai_review_public_summary_missing alarm on every pass

1 participant