Skip to content

feat(commands): wire @gittensory review / re-review command (#2163) - #4050

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
jimcody1995:feat/review-command-2163
Jul 8, 2026
Merged

feat(commands): wire @gittensory review / re-review command (#2163)#4050
JSONbored merged 1 commit into
JSONbored:mainfrom
jimcody1995:feat/review-command-2163

Conversation

@jimcody1995

Copy link
Copy Markdown
Contributor

Summary

  • Add maybeProcessReviewCommand for @gittensory review / re-review: shared classifyPrCommandRequest guards, authorizePrActionActor for the review command (including confirmed-miner detection), then dispatch to the existing reReviewStoredPullRequest path with force: true — no gate-disposition mutation (PR command surface — @gittensory review / pause / resume / resolve / help / configuration / explain #1960).
  • Record github_app.review_command_{skipped,denied,completed} audit events and matching product-usage telemetry, mirroring the gate-override skip/denied/completed shape.
  • Register the handler in the issue-comment dispatch chain immediately before gate-override.

Test plan

  • Authorized maintainer @gittensory review dispatches re-review and records review_command_completed without changing gate_check_mode or emitting gate_overridden.
  • @gittensory re-review alias resolves to the same handler.
  • Unauthorized actor records review_command_denied.
  • Bot author, edited comment, and missing PR target record review_command_skipped with classifier reasons.
  • Missing cached PR row records cached_pr_missing skip.
  • agentPaused / agentDryRun skip without dispatching re-review.
  • Completed/skip metadata fallbacks (headSha, commentId, repoFullName) covered for 100% patch branch coverage.
  • npm run typecheck
  • Full npm run test:coverage (local)

Closes #2163

Made with Cursor

…d#2163)

Dispatch authorized maintainer PR comments to the existing reReviewStoredPullRequest path with classifier skips, denial audits, and completion telemetry — without mutating gate disposition.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jimcody1995
jimcody1995 requested a review from JSONbored as a code owner July 7, 2026 14:04
@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 14:08:38 UTC

2 files · 1 AI reviewer · no blockers · readiness 100/100 · CI pending · blocked

⏸️ Suggested Action - Manual Review

Review summary
This PR wires a new `@​gittensory review`/`re-review` slash command by reusing the existing `classifyPrCommandRequest` → `authorizePrActionActor` → `reReviewStoredPullRequest` pipeline already proven by the gate-override command, and it registers the handler ahead of gate-override in the issue-comment dispatch chain. The flow is correct: it forces a re-review via `reReviewStoredPullRequest(..., { force: true })` without touching `gate_check_mode` or emitting `gate_overridden`, which the new test explicitly asserts. Test coverage is thorough (authorized dispatch, alias resolution, denial, bot/edited/missing-PR classifier skips, missing cached row, paused/dry-run skip, and metadata fallbacks), and the PR is correctly scoped to and closes #2163.

Nits — 5 non-blocking
  • src/queue/processors.ts: `recordReviewCommandSkip` records the audit event with `outcome: "completed"` while the paired product-usage event uses `outcome: "skipped"` for the same skip — confirm this mirrors gate-override's existing convention intentionally rather than being a copy-paste slip, since it reads oddly in the audit log.
  • src/queue/processors.ts: `commandName: "review" as GittensoryMentionCommandName` uses a type cast — if `"review"` isn't already a member of that union, prefer widening the type properly instead of casting past it.
  • test/unit/queue.test.ts: several inline string literals like `"installation-token"` trip generic-secret-assignment scanners; consider a shared test constant/fixture name that scanners won't flag, even though these are clearly fake tokens.
  • External brief flags magic numbers `2163`/`1960` in a doc comment at src/queue/processors.ts:10363-10365 — these are just issue-number references in prose, not logic constants, so no action needed there.
  • Add a one-line comment (or reuse an existing helper) clarifying why `getPullRequest` (cached) is fetched before authorization rather than after, to make the ordering intentional for future readers touching this shared pattern.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2163
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: 153 registered-repo PR(s), 98 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jimcody1995; Gittensor profile; 153 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: jimcody1995
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript
  • Official Gittensor activity: 153 PR(s), 0 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

@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.57%. Comparing base (39cc958) to head (f10648c).
⚠️ Report is 103 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4050   +/-   ##
=======================================
  Coverage   93.56%   93.57%           
=======================================
  Files         378      378           
  Lines       35448    35485   +37     
  Branches    13000    13014   +14     
=======================================
+ Hits        33167    33204   +37     
  Misses       1618     1618           
  Partials      663      663           
Files with missing lines Coverage Δ
src/queue/processors.ts 94.92% <100.00%> (+0.06%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jimcody1995 jimcody1995 closed this Jul 7, 2026
@jimcody1995 jimcody1995 reopened this Jul 8, 2026
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 8, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored
JSONbored merged commit b431bbd into JSONbored:main Jul 8, 2026
11 of 12 checks passed
JSONbored added a commit that referenced this pull request Jul 8, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Development

Successfully merging this pull request may close these issues.

feat(commands): @gittensory review / re-review command — parse + classify + dispatch to existing re-review action

2 participants