Skip to content

feat(commands): wire @gittensory pause dispatch to record the autoreview-paused marker (#2164) - #4067

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
davion-knight:feat/gittensory-pause-command
Jul 7, 2026
Merged

feat(commands): wire @gittensory pause dispatch to record the autoreview-paused marker (#2164)#4067
JSONbored merged 1 commit into
JSONbored:mainfrom
davion-knight:feat/gittensory-pause-command

Conversation

@davion-knight

Copy link
Copy Markdown
Contributor

Wires the dispatch handler for the @gittensory pause PR-comment verb — the parse target and authorization policy already landed with #1960, so this is the follow-up dispatch bounty (mirroring maybeProcessGateOverrideCommand / maybeProcessResolveCommand).

What it does

  • Adds maybeProcessPauseCommand + recordAutoreviewPausedSkip in src/queue/processors.ts and wires it into the issue_comment dispatch chain after explain.
  • On an authorized @gittensory pause, records a per-PR github_app.autoreview_paused audit marker (keyed to repo#pr) that the sweep/webhook re-review path can honor, and posts a public-safe confirmation via sanitizePublicComment.
  • Reuses the shared classifyPrCommandRequest preamble + authorizePrActionActor and the gate-override skip/denied/completed recording convention.

Auto-review scope only (#1960 hard constraint)

Pause touches neither the Gate check-run, the AgentActionMode, nor any advisory — the one-shot gate disposition and its enforcement are left intact; the gate-enforcement side and any repository_settings kill-switch stay maintainer-owned. Unlike gate-override it deliberately does not consult resolveAgentActionMode: the pause is the stop-auto-reviewing instruction, so gating the marker behind the execution mode would make an already-paused/dry-run agent impossible to pause — the marker + confirmation are therefore recorded unconditionally on an authorized pause.

Tests

test/unit/queue.test.ts: authorized pause (records marker + posts confirmation), authorized-with-no-reason, non-maintainer denied, cached-PR-missing skip, bot-authored classifier skip, and non-pause non-interception — plus an explicit invariant asserting no Gate check-run write and no gate-disposition audit (proving no gate/AgentActionMode mutation). The #2160 scaffold test's example verb is moved from the now-wired pause to the still-unwired resume.

Closes #2164

…iew-paused marker (JSONbored#2164)

Adds maybeProcessPauseCommand, the dispatch handler for the @gittensory
pause PR-comment verb (already a registered parse target + authorization
policy from JSONbored#1960). It pauses AUTO-REVIEW for a single PR by recording a
per-PR github_app.autoreview_paused audit marker the sweep/webhook
re-review path can honor, and posts a public-safe confirmation.

Auto-review scope only: it records nothing on the Gate check-run, flips no
AgentActionMode, and builds no advisory, so the one-shot gate disposition
and its enforcement are left intact. Mirrors maybeProcessResolveCommand's
classify -> authorize -> record shape (classifyPrCommandRequest +
authorizePrActionActor + the gate-override skip/denied/completed recording
convention). Unlike gate-override it does not consult resolveAgentActionMode:
the pause is itself the stop-auto-reviewing instruction, so the marker +
confirmation are recorded unconditionally on an authorized pause.

Closes JSONbored#2164
@davion-knight
davion-knight requested a review from JSONbored as a code owner July 7, 2026 21:48
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.59%. Comparing base (1deb96c) to head (e9b21c7).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4067   +/-   ##
=======================================
  Coverage   93.59%   93.59%           
=======================================
  Files         380      380           
  Lines       35596    35622   +26     
  Branches    13050    13056    +6     
=======================================
+ Hits        33316    33342   +26     
  Misses       1618     1618           
  Partials      662      662           
Files with missing lines Coverage Δ
src/queue/processors.ts 95.00% <100.00%> (+0.04%) ⬆️
🚀 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:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 7, 2026
@loopover-orb

loopover-orb Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-07 23:04:22 UTC

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

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): src/queue/processors.ts (matched src/queue/**).

Review summary
Wires the `@​gittensory pause` dispatch handler using the same classify→authorize→record pattern as maybeProcessResolveCommand, recording an unconditional `github_app.autoreview_paused` audit marker without touching the Gate check-run or AgentActionMode, consistent with the #1960 scope constraint. Tests cover the authorized/no-reason/denied/cached-pr-missing/bot-skip/non-interception paths plus an explicit invariant that no Gate check-run or gate-disposition audit is written, and the #2160 scaffold test was correctly updated to use the now-unwired `resume` verb instead of `pause`. The implementation is a faithful mirror of the existing resolve/explain dispatch convention with no logic issues visible in the diff.

Nits — 6 non-blocking
  • src/queue/processors.ts: `payload.issue!` non-null assertion in the authorizePrActionActor call relies on classifyPrCommandRequest having validated `issue` presence — worth a comment or a narrower type on `req` confirming this invariant so a future refactor of the classifier can't silently reintroduce a runtime null.
  • src/queue/processors.ts: the `Promise.all([getPullRequest, resolveRepositorySettings])` + authorize + audit-record sequence duplicates the shape already in maybeProcessResolveCommand; consider extracting a shared helper if a third command handler follows.
  • The feat(commands): @gittensory pause command — parse + classify + record auto-review-paused state (dispatch scaffold) #2164/PR command surface — @gittensory review / pause / resume / resolve / help / configuration / explain #1960 issue numbers embedded in the doc comment are fine as references but the flagged 'magic numbers' are just historical issue citations, not literals needing a named constant — no action needed.
  • Consider asserting in a follow-up PR (or here) that a second `@​gittensory pause` on an already-paused PR still succeeds/records another marker rather than silently no-oping, since the marker table semantics (append-only audit vs. latest-wins) aren't obvious from this diff alone.
  • If `resolveAgentActionMode` is ever consulted elsewhere to short-circuit other commands when an agent is disabled entirely, double check `maybeProcessPauseCommand`'s intentional bypass of it is documented at that call site too, not just in this function's docstring.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2164
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: 78 registered-repo PR(s), 41 merged, 1 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 78 PR(s), 1 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: davion-knight
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Rust
  • Official Gittensor activity: 78 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.

🟩 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

@JSONbored
JSONbored merged commit 62905f2 into JSONbored:main Jul 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

feat(commands): @gittensory pause command — parse + classify + record auto-review-paused state (dispatch scaffold)

2 participants