Skip to content

fix(review-evasion): draft-dodge close audits its REAL outcome instead of an unconditional 'completed' - #8809

Merged
loopover-orb[bot] merged 1 commit into
mainfrom
fix/draft-dodge-close-outcome
Jul 26, 2026
Merged

fix(review-evasion): draft-dodge close audits its REAL outcome instead of an unconditional 'completed'#8809
loopover-orb[bot] merged 1 commit into
mainfrom
fix/draft-dodge-close-outcome

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Round-2 audit fix (#8801): closeDraftDodgeAttemptIfBlocked swallowed the closePullRequest failure and unconditionally audited outcome: "completed" — the exact anti-pattern #2260 fixed in this file's six sibling guards. A transient 403/5xx left the PR open while the audit trail said the one-shot close was enforced.

Changes

Test plan

  • npm run typecheck — clean
  • New regression test: close PATCH returns 502 → audit outcome: "error" with the FAILED detail (attempted-close asserted; unknown-author fallback arm covered)
  • queue-lifecycle-guards suite 227/227
  • Changed hunks: 0 uncovered statements/branches

Closes #8801

…d of an unconditional 'completed' (#8801)

The draft-dodge guard was the one sibling in this file still swallowing the
closePullRequest error and recording outcome:"completed" regardless — a
transient 403/5xx left the PR open on GitHub while the audit trail claimed a
draft-dodge close was enforced (the exact #2260 anti-pattern the
reopen-reclose guard in this same file already fixed, with the same comment
explaining why an operator trusting the trail must never be lied to).

Apply the identical pattern: capture the close error, audit
completed/error accordingly, and name the failure ("the PR may still be
open") with the error in metadata. Regression test: a 502 on the close PATCH
now audits outcome "error" with the FAILED detail (and covers the
unknown-author fallback arm).
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored JSONbored self-assigned this Jul 26, 2026
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.26%. Comparing base (1667bd5) to head (11b50e6).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8809      +/-   ##
==========================================
- Coverage   93.81%   92.26%   -1.55%     
==========================================
  Files         797      797              
  Lines       79608    79613       +5     
  Branches    24127    24131       +4     
==========================================
- Hits        74686    73458    -1228     
- Misses       3556     5090    +1534     
+ Partials     1366     1065     -301     
Flag Coverage Δ
backend 92.94% <100.00%> (-2.16%) ⬇️

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

Files with missing lines Coverage Δ
src/queue/review-evasion.ts 95.45% <100.00%> (+0.08%) ⬆️

... and 3 files with indirect coverage changes

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

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-26 07:12:47 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This closes the last gap in the six close-enforcement guards: `closeDraftDodgeAttemptIfBlocked` now captures the `closePullRequest` result via the same `.then(() => null).catch(error)` pattern its five siblings already use, and records `outcome: 'error'` with a FAILED detail plus the error in metadata when the close call fails, instead of unconditionally claiming 'completed'. The diff byte-matches the established sibling pattern (e.g. the reopen-reclose and repeated-draft-cycling guards shown in the full file), the new test asserts the close was attempted, the audit outcome is 'error', and the unknown-author fallback arm is exercised on the failure path. This is a narrow, well-targeted parity fix with real coverage of both outcome branches.

Nits — 3 non-blocking
  • The success-path detail on the new line still reads `pr.authorLogin ?? "unknown"` while `draftDodgeAuthor` (same fallback, computed earlier) is already in scope — using `draftDodgeAuthor` in both branches would avoid the redundant re-evaluation (src/queue/review-evasion.ts, inside closeDraftDodgeAttemptIfBlocked).
  • Consider replacing the two `pr.authorLogin ?? "unknown"` occurrences in the new detail strings with the already-computed `draftDodgeAuthor` for consistency with the rest of the function.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.

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 #8801
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: 13 registered-repo PR(s), 13 merged, 275 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 13 PR(s), 275 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The diff replaces the unconditional `.catch(() => undefined)` swallow of `closePullRequest` with the same `.then(() => null).catch(error)` capture used by the sibling guard, and now conditionally records outcome 'completed' or 'error' with a FAILED detail and error metadata, matching the issue's requested fix pattern exactly. A regression test asserting a 502 close yields audit outcome 'error' wit

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: 13 PR(s), 275 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Treat this as maintainer-lane context rather than normal contributor-lane activity.
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 &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; 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

@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 de70226 into main Jul 26, 2026
7 checks passed
@loopover-orb
loopover-orb Bot deleted the fix/draft-dodge-close-outcome branch July 26, 2026 07:12
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

1 participant