Skip to content

fix(miner): halt loop reentry for unresolved PRs - #5496

Closed
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-pr-re-entry-on-unresolved-outcomes
Closed

fix(miner): halt loop reentry for unresolved PRs#5496
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-pr-re-entry-on-unresolved-outcomes

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • The autonomous miner loop could re-enter and submit additional PRs when a prior submitted PR was still open or its PR number was unparseable, risking unwanted GitHub write spam.
  • The change prevents the loop from advancing until a submitted PR reaches a closed (terminal) disposition or a parseable PR number is available.

Description

  • Add a guard in packages/gittensory-miner/lib/loop-cli.js that, when an attempt submitted a PR but the disposition is not closed (or the PR number could not be parsed), records a declined re-entry cycle and halts the loop with an explicit reason.
  • Surface explicit decline reasons: submitted_pr_disposition_unresolved when an observed PR remains open and submitted_pr_number_unresolved when no parseable PR number is exposed.
  • Add regression unit tests in test/unit/miner-loop-cli.test.ts that assert the loop halts re-entry for an open PR and for a submitted attempt that exposes no parseable PR number, and that the queue/ledger state is left consistent.

Testing

  • Ran npx vitest run test/unit/miner-loop-cli.test.ts, and the updated unit test file passed (17 tests passed).
  • Ran npm run build:miner, which completed successfully (node --check passed for the miner package files).
  • Began the full gate with git diff --check && npm run test:ci; the run progressed through many checks but stopped at cf-typegen:check due to a pre-existing worker-configuration.d.ts is stale; run npm run cf-typegen issue unrelated to the miner change.
  • npm audit --audit-level=moderate could not complete against the registry in this environment (registry returned 403 Forbidden).

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 12, 2026

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 a1d96cb Commit Preview URL

Branch Preview URL
Jul 12 2026, 11:12 PM

@JSONbored JSONbored self-assigned this Jul 12, 2026
@JSONbored
JSONbored marked this pull request as draft July 12, 2026 23:11
@superagent-security

Copy link
Copy Markdown
Contributor

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

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

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-12 23:39:14 UTC

2 files · 2 blockers · readiness 89/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.

2. Maintainer requires a linked issue — Link the relevant issue (for example `Closes #123`) before opening the PR.
Signal Result Evidence
Code review ❌ 2 blockers No AI review summary
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
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 (draft PR; no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 44 registered-repo PR(s), 36 merged, 424 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 44 PR(s), 424 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
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: 44 PR(s), 424 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Mark ready when done.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
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.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 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 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.40%. Comparing base (17f988e) to head (a1d96cb).
⚠️ Report is 91 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5496   +/-   ##
=======================================
  Coverage   94.40%   94.40%           
=======================================
  Files         550      550           
  Lines       44119    44124    +5     
  Branches    14632    14632           
=======================================
+ Hits        41652    41657    +5     
  Misses       1792     1792           
  Partials      675      675           
Flag Coverage Δ
shard-1 43.75% <0.00%> (-0.26%) ⬇️
shard-2 34.03% <0.00%> (-0.62%) ⬇️
shard-3 32.22% <0.00%> (+0.61%) ⬆️
shard-4 31.28% <0.00%> (+0.01%) ⬆️
shard-5 33.03% <0.00%> (-0.27%) ⬇️
shard-6 43.63% <100.00%> (+0.28%) ⬆️

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

Files with missing lines Coverage Δ
packages/gittensory-miner/lib/loop-cli.js 93.39% <100.00%> (+0.15%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored

Copy link
Copy Markdown
Owner Author

Closing: this inverts a deliberate, same-day design decision rather than fixing a real gap.

loop-cli.js's reentry wiring (together with pr-disposition-poller.js's classifyPrDisposition) was authored by #5303 (commit dc6fa7a, merged same day). Its own doc comments are explicit that a still-open/unresolved submitted PR classifies as 'other' and must NOT be treated as a failure or blocking condition — "not an error", "not fail", "nothing to re-enter on yet" is intentional: the loop is meant to keep making forward progress on other work while a submitted PR is still pending review, not halt entirely.

This PR's guard turns "still open" into an unconditional full-loop halt, directly reversing that same-day intent. Separately, the double-submission concern the PR's motivation describes doesn't hold up: the specific (repo, identifier) pair is already marked done via portfolioQueue.markDone(...) before any PR-disposition handling runs, so it can't be re-attempted regardless of the PR's later outcome — there's no double-submission path to guard against.

@JSONbored JSONbored closed this Jul 12, 2026
@JSONbored
JSONbored deleted the codex/fix-pr-re-entry-on-unresolved-outcomes branch July 19, 2026 18:41
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