Skip to content

fix(queue): audit draft-dodge stand-down when paused or frozen#6693

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
RealDiligent:feat/critical-issue-draft-dodge-paused-audit-6604-v2
Jul 17, 2026
Merged

fix(queue): audit draft-dodge stand-down when paused or frozen#6693
JSONbored merged 2 commits into
JSONbored:mainfrom
RealDiligent:feat/critical-issue-draft-dodge-paused-audit-6604-v2

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • closeDraftDodgeAttemptIfBlocked passes a real paused object to evaluateCloseEnforcementGate, matching its 4 sibling guards.
  • Removes the outer !settings.agentPaused skip in processors.ts so draft-dodge reaches the shared gate (where pause/freeze are audited), instead of silently no-oping before any audit.
  • Updates docs that previously described the intentional no-audit gap; extends lifecycle-guard tests for paused and frozen stand-downs.
  • Supersedes closed fix(queue): audit draft-dodge stand-down when paused or frozen #6682 (CI did not re-run after the processors follow-up).

Closes #6604

Test plan

  • Draft-dodge under agentPaused / global freeze does not close the PR
  • Both paths record github_app.draft_dodge_closed with outcome: denied and the paused detail
  • codecov/patch green

Made with Cursor

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 16, 2026 19:09
RealDiligent and others added 2 commits July 17, 2026 03:13
…s are audited

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.65%. Comparing base (58ab17e) to head (487ec95).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6693      +/-   ##
==========================================
- Coverage   93.65%   93.65%   -0.01%     
==========================================
  Files         682      682              
  Lines       68112    68113       +1     
  Branches    18708    18708              
==========================================
  Hits        63788    63788              
  Misses       3347     3347              
- Partials      977      978       +1     
Flag Coverage Δ
shard-1 43.90% <ø> (+<0.01%) ⬆️
shard-2 36.98% <ø> (+<0.01%) ⬆️
shard-3 32.45% <ø> (-0.01%) ⬇️
shard-4 34.23% <ø> (-0.01%) ⬇️
shard-5 31.38% <ø> (-0.01%) ⬇️
shard-6 45.75% <ø> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
src/queue/processors.ts 95.51% <ø> (ø)
src/queue/review-evasion.ts 93.93% <ø> (-0.44%) ⬇️

... and 1 file with indirect coverage changes

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

loopover-orb Bot commented Jul 16, 2026

Copy link
Copy Markdown

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-16 20:35:43 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR closes an audit gap where draft-dodge closures under a paused/frozen agent were silently skipped before ever reaching the shared close-enforcement gate, unlike the other 4 guards that route pause/freeze through evaluateCloseEnforcementGate and record a denied audit event. The fix removes the early `!settings.agentPaused` short-circuit in processors.ts and passes a real `paused` object (matching the sibling guards' shape) instead of `null` in review-evasion.ts, and the test updates directly assert that both the paused and frozen paths now produce a `denied` audit_events row with the expected detail text while still not closing the PR. The change is narrow, consistent with the existing sibling-guard convention described in the doc comments, and is backed by targeted regression tests for exactly the two behaviors it claims to fix.

Nits — 4 non-blocking
  • src/queue/review-evasion.ts:83 hard-codes the issue number `review-evasion: draft-dodge guard is the only close-enforcement guard that records no audit event when paused/frozen #6604` in the doc comment; fine as a reference but consider a named constant if this pattern recurs across guards (per external brief).
  • The updated doc comment in processors.ts (removed lines) says pause/freeze are 'enforced inside evaluateCloseEnforcementGate' — worth double-checking that function's paused-branch is itself covered by a direct unit test rather than only indirectly through the two draft-dodge integration tests shown here.
  • Consider adding a one-line assertion in the frozen/paused tests that the PR was NOT actually closed via PATCH, in addition to the audit-event check, to guard against a future regression where the gate audits but still mutates.
  • If `evaluateCloseEnforcementGate`'s paused branch isn't already unit-tested in isolation, add a focused test there since it's now the single choke point for all 5 guards.

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 #6682, #6604
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High review scope from cached public metadata (2 linked issues).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 381 registered-repo PR(s), 187 merged, 33 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 381 PR(s), 33 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 381 PR(s), 33 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 1 step in the Signals table above.
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 added the manual-review Gittensor contributor context label Jul 16, 2026
@JSONbored
JSONbored merged commit d4c2ab5 into JSONbored:main Jul 17, 2026
15 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. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review-evasion: draft-dodge guard is the only close-enforcement guard that records no audit event when paused/frozen

2 participants