feat(commands): wire @gittensory review and resume PR-comment commands - #4175
Conversation
Adds maybeProcessReviewCommand (#2163) and maybeProcessResumeCommand (#2165), the last two handlers in the @gittensory PR-comment command surface (#1960). Both mirror the existing classify -> authorize -> dispatch shape used by pause/resolve/explain. review dispatches to the existing reReviewStoredPullRequest path with force:true so a maintainer gets a fresh verdict instead of a cached one; it never touches the Gate check-run or one-shot disposition. resume fixes hasAutoreviewPausedMarker, which previously only checked whether a pause row had EVER been recorded, so a resume command could authorize and confirm but never actually un-pause anything. It now reads the most recent of {paused, resumed} for the target, with a rowid tiebreaker for same-millisecond writes.
|
Superagent didn't 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 #4175 +/- ##
=======================================
Coverage 93.72% 93.73%
=======================================
Files 387 387
Lines 36320 36371 +51
Branches 13306 13316 +10
=======================================
+ Hits 34042 34092 +50
Misses 1621 1621
- Partials 657 658 +1
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-08 09:53:33 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 7 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 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.
|
…typecheck (#4259) Two independently-merged PRs (#4050 and #4175) both implemented the @gittensory review command, leaving two colliding declarations of maybeProcessReviewCommand/recordReviewCommandSkip and two dispatch call sites -- a hard tsc "Duplicate function implementation" error that blocks every PR's typecheck/validate check on main. Keeps the earlier, more complete implementation (which also wires the paired resume command and a real hasAutoreviewPausedMarker fix), and folds in two things only the later, now-removed duplicate got right: - needsMinerDetection: true on the authorization call. "review" is deliberately widened to confirmed_miner (self-rerun precedent, same as review-now), so without this flag a confirmed miner re-triggering review on their own PR had no other role to match and was always denied. - A resolveAgentActionMode pause/dry-run gate before dispatching, matching every other action command (pause/resolve/explain/ gate-override/generate-tests). The kept implementation had no such gate at all, so review always dispatched live regardless of a maintainer's global pause or dry-run setting. Removes the redundant duplicate test suite for the same command and adds regression coverage for both fixes above.
Summary
@gittensoryPR-comment command surface:maybeProcessReviewCommandandmaybeProcessResumeCommand, both mirroring the existing classify → authorize → dispatch shape used bypause/resolve/explain.review(aliasre-review) dispatches to the existingreReviewStoredPullRequestpath withforce: true, so a maintainer explicitly asking for a fresh pass bypasses the AI-review cache/dedup instead of getting a stale verdict. It never touches the Gate check-run,AgentActionMode, or the one-shot disposition — whatever the re-review's own gate evaluation produces is exactly what a scheduled sweep pass would produce.resumefixes a real bug inhasAutoreviewPausedMarker: it previously only checked whether anautoreview_pausedrow had ever been recorded, so a resume command could authorize and post a confirmation comment but silently fail to actually resume anything — the next re-review pass would still see the stale pause as active forever. It now reads the most recent of{autoreview_paused, autoreview_resumed}for the target (order by created_at desc, rowid desc), with therowidtiebreaker covering same-millisecond writes from back-to-back commands in a test/rapid-succession scenario.Scope
Closes #2163, Closes #2165, Closes #1960 (the 10th and final sub-issue completed under the parent — command registration, authorization policy, pause/resolve/explain/configuration/help handlers, and the did-you-mean fallback all shipped in prior PRs).
Validation
npx vitest run test/unit/queue.test.ts— 714/714 passing, including ~10 new tests covering authorized dispatch, re-review alias resolution, unauthorized denial, missing-PR skip, and bot-author skip forreview; and authorized resume superseding an earlier pause, full pause→resume→pause-again ordering, unauthorized denial, missing-PR skip, and bot-author skip forresume.#2160) whose entire premise — "a catalog-registered verb with no dispatch handler exists" — is no longer true now that all 7 registered verbs have handlers; not a coverage dodge, the scenario it guarded against can no longer occur.npx tsc --noEmitclean.npm run docs:drift-checkclean (no gate-mode/command-catalog field added;review/resumewere already registered verbs pre-dating this PR).git diff --checkclean.origin/main, no conflicts.Safety
hasAutoreviewPausedMarkerstill fails open (catchreturnsfalse) so a corrupt/unreachable audit ledger can't wedge review processing.Notes
No generated-artifact regeneration needed (no API/schema, wrangler binding/var,
src/selfhost/**env read, or DB schema changes in this PR).