Skip to content

fix(miner): stop pickScript selecting watch/fix validation scripts - #10261

Merged
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
andriypolanski:fix/10006-pickscript-watch-fix
Jul 31, 2026
Merged

fix(miner): stop pickScript selecting watch/fix validation scripts#10261
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
andriypolanski:fix/10006-pickscript-watch-fix

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Summary

The target-repo verification gate stops running non-terminating watch scripts (which today burn a 10-minute
timeout and then block every PR for that repo) and stops running auto-fix scripts that silently rewrite the
worktree after self-review; a repo with only such scripts falls through to the gate's existing, documented
no_commands_detected skip, and stack detection returns the same commands regardless of package.json key order.

Closes #10006

andriypolanski and others added 2 commits July 31, 2026 14:50
…SONbored#10006)

Exclude watch/write script-name segments from the pattern fallback and pick
the lexicographically smallest survivor so verification never runs :watch or :fix.
…SONbored#10006)

Keep the lex-order assertion on toMatchObject only so root tsc stays green.

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

loopover-orb Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-31 15:01:02 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR fixes an issue where pickScript's pattern-fallback could select non-terminating watch scripts or write-mode fix/format scripts, which the target-repo verification gate would then execute (burning the 10-minute timeout or mutating the worktree). The fix excludes whole `:`-delimited segments like watch/dev/serve/fix/write/update/u and sorts remaining candidates lexicographically for deterministic key-order-independent selection. The change is well-targeted, includes thorough regression tests (segment matching, near-miss `fixtures`, exact-name precedence, key-order independence) and an integration test confirming the gate's existing no_commands_detected skip is reached when all scripts are excluded — this correctly fixes the root cause at the stack-detection source layer rather than patching the verification gate.

Nits — 5 non-blocking
  • The lexicographic sort as tie-break (stack-detection.ts:113-116) is a behavior change beyond the stated watch/fix exclusion fix — e.g. a repo with both `test:e2e` and `test:unit` now silently prefers `test:e2e` over `test:unit` for reasons unrelated to miner(stack-detection): pickScript selects watch/fix script variants that the target-repo verification gate then executes #10006; worth calling out explicitly in the description since it changes existing selection behavior for repos with multiple non-excluded candidates.
  • The `u` segment in EXCLUDED_SCRIPT_SEGMENTS (stack-detection.ts:107) is a very short, generic token — confirm this isn't intended to match e.g. `test:unit` (it won't, since segment must equal `u` exactly, but the terseness invites confusion; a brief inline example in the comment would help).
  • Consider extracting the `miner(stack-detection): pickScript selects watch/fix script variants that the target-repo verification gate then executes #10006` magic reference into a named comment/constant per the external brief, though this is purely cosmetic.
  • Split out the lexicographic-sort tie-break change into its own documented behavior note (or a separate PR) since it silently changes which script is picked among multiple valid non-excluded candidates, independent of the watch/fix exclusion fix.
  • Consider whether `dev`/`serve` segments could ever legitimately be desired build/test commands in some non-Node ecosystems mixed into a monorepo's package.json — if so, document that this exclusion is intentionally conservative.

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 #10006
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 ⚠️ 20/25 Preflight is ready, but the PR body does not name the validation run.
Contributor workload ✅ 10/10 Author activity: 162 registered-repo PR(s), 106 merged, 22 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 162 PR(s), 22 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: significant
Linked issue satisfaction

Addressed
The diff adds an exclusion set for watch/dev/serve/fix/write/update/u segments checked whole-segment and case-insensitively, falls back to null (never a guess) when all pattern candidates are excluded so the existing no_commands_detected skip is reached, keeps exact-name selection unchanged, and makes pattern fallback deterministic via lexicographic sort independent of key order — matching every s

Review context
  • Author: andriypolanski
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Rust, Cuda, JavaScript, Kotlin, MDX, Scala
  • Official Gittensor activity: 162 PR(s), 22 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add validation command/output.
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

@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 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.64%. Comparing base (470d417) to head (de71145).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10261      +/-   ##
==========================================
+ Coverage   80.60%   80.64%   +0.03%     
==========================================
  Files         283      284       +1     
  Lines       59101    59208     +107     
  Branches     7000     7054      +54     
==========================================
+ Hits        47641    47748     +107     
  Misses      11167    11167              
  Partials      293      293              
Flag Coverage Δ
backend 100.00% <100.00%> (?)

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/stack-detection.ts 100.00% <100.00%> (ø)

@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 c7e8e80 into JSONbored:main Jul 31, 2026
8 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 31, 2026
7 tasks
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.

miner(stack-detection): pickScript selects watch/fix script variants that the target-repo verification gate then executes

1 participant