Skip to content

fix(miner): close_pr runs unconditionally before its best-effort comment - #5494

Merged
JSONbored merged 1 commit into
mainfrom
fix/close-pr-unconditional-4848-nit
Jul 12, 2026
Merged

fix(miner): close_pr runs unconditionally before its best-effort comment#5494
JSONbored merged 1 commit into
mainfrom
fix/close-pr-unconditional-4848-nit

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Follow-up to #4848/#5480, addressing a real nit gittensory's own review caught after that PR was already merged.

buildClosePrSpec (packages/gittensory-engine/src/miner/local-write-tools.ts) chained gh pr comment && gh pr close -- if gh pr comment failed (e.g. a transient network blip), the && meant gh pr close never ran, silently leaving a known-losing PR open. That's the exact outcome claim-conflict resolution exists to prevent.

The close now runs first and unconditionally; the explanatory comment is a best-effort follow-up that only runs once the close itself succeeds, and can never block or mask it.

Also documents (in claim-conflict-resolver.js) why assembleCompetingClaims deliberately excludes same-author PRs -- a miner never competes against its own retry attempts, per the same reviewer nit.

Test plan

  • tsc --noEmit --incremental false clean
  • npx vitest run test/unit test/contract -- 774/775 passing (1 pre-existing unrelated skip)
  • Per-file patch coverage verified: 100% on every changed line in local-write-tools.ts and claim-conflict-resolver.js
  • npm run docs:drift-check / manifest:drift-check / engine-parity:drift-check all clean
  • npm audit --audit-level=moderate -- 0 vulnerabilities
  • git diff --check clean

Per gittensory's own review on this PR: buildClosePrSpec chained gh pr comment && gh pr close, so a transient comment failure would silently leave a known-losing PR open -- the exact outcome claim-conflict resolution exists to prevent. The close now runs first and unconditionally; the explanatory comment is a best-effort follow-up that only runs once the close itself succeeds, and never blocks or masks it.

Also documents why assembleCompetingClaims deliberately excludes same-author PRs (a miner never competes against its own retry attempts).
@JSONbored JSONbored self-assigned this Jul 12, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 446c279 Commit Preview URL

Branch Preview URL
Jul 12 2026, 11:10 PM

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.74%. Comparing base (f0426b5) to head (446c279).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5494   +/-   ##
=======================================
  Coverage   94.74%   94.74%           
=======================================
  Files         563      563           
  Lines       44823    44823           
  Branches    14669    14669           
=======================================
  Hits        42467    42467           
  Misses       1621     1621           
  Partials      735      735           
Flag Coverage Δ
shard-1 44.34% <ø> (ø)
shard-2 35.38% <ø> (ø)
shard-3 31.95% <ø> (ø)
shard-4 31.38% <ø> (ø)
shard-5 33.19% <ø> (-0.01%) ⬇️
shard-6 43.56% <ø> (ø)

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

Files with missing lines Coverage Δ
...s/gittensory-engine/src/miner/local-write-tools.ts 100.00% <ø> (ø)
...es/gittensory-miner/lib/claim-conflict-resolver.js 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 68ce986 into main Jul 12, 2026
17 checks passed
@JSONbored
JSONbored deleted the fix/close-pr-unconditional-4848-nit branch July 12, 2026 23:21
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 12, 2026
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

Development

Successfully merging this pull request may close these issues.

1 participant