fix(miner): close_pr runs unconditionally before its best-effort comment - #5494
Merged
Conversation
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).
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| 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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) chainedgh pr comment && gh pr close-- ifgh pr commentfailed (e.g. a transient network blip), the&&meantgh pr closenever 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) whyassembleCompetingClaimsdeliberately excludes same-author PRs -- a miner never competes against its own retry attempts, per the same reviewer nit.Test plan
tsc --noEmit --incremental falsecleannpx vitest run test/unit test/contract-- 774/775 passing (1 pre-existing unrelated skip)local-write-tools.tsandclaim-conflict-resolver.jsnpm run docs:drift-check/manifest:drift-check/engine-parity:drift-checkall cleannpm audit --audit-level=moderate-- 0 vulnerabilitiesgit diff --checkclean