Skip to content

fix(checks): require real imports in checkers-wired home scan (#10048) - #10119

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kai392:feat/10048-checkers-wired-import-scan
Jul 31, 2026
Merged

fix(checks): require real imports in checkers-wired home scan (#10048)#10119
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kai392:feat/10048-checkers-wired-import-scan

Conversation

@kai392

@kai392 kai392 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • resolveCheckerHome imported detection now requires a real import / export ... from / dynamic import() after stripping // and /* */ comments.
  • Prose mentions (including the live check-fixture-clock-races sentence) no longer fake an imported home.

Closes #10048

Test plan

  • npx vitest run test/unit/check-checkers-wired.test.ts (20 tests)
  • npm run checkers-wired:check
  • CI green

@kai392
kai392 requested a review from JSONbored as a code owner July 31, 2026 07:48
@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 08:21:29 UTC

2 files · 1 AI reviewer · no blockers · readiness 86/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR replaces a substring-scan for 'is this checker imported by a sibling script' with a real parser that strips comments and requires an actual import/export/dynamic-import statement pointing at the specifier, closing the exact false positive from #10048 (the check-fixture-clock-races prose sentence). The regex is carefully bounded to not cross a `;`, so multi-import lines and adjacent unrelated statements are handled correctly, and the new test suite directly exercises .js/.ts suffixes, re-exports, dynamic import, both comment styles, a near-miss specifier, and the exact live sentence that caused the bug. I traced the regex against several edge cases (mid-statement `.from()` calls, cross-statement leakage) and found no false positives introduced by the change.

Nits — 5 non-blocking
  • scripts/check-checkers-wired.ts: the `sourceImportsChecker` regex only matches quoted specifiers (`['"]`), so a backtick/template-literal dynamic import like `` import(`./check-foo`) `` would not be detected as an import and could produce a false 'none' — worth a follow-up test if that pattern exists anywhere in scripts/.
  • scripts/check-checkers-wired.ts:119 (per external brief): the bare `scripts(checks): check-checkers-wired counts a prose comment mention as an "imported by a sibling script" home #10048` issue reference in comments could be a named constant for clarity, though this is purely stylistic.
  • test/unit/check-checkers-wired.test.ts: the helper factories (`fromSpecifier`, etc.) are a nice DRY improvement over the old ad-hoc literal, but consider also adding a case for `require(...)`-style CommonJS imports if any scripts still use that form.
  • Add a test for a template-literal dynamic import (backticks) to confirm the intended behavior when/if that syntax appears in scripts/.
  • Consider extracting the `scripts(checks): check-checkers-wired counts a prose comment mention as an "imported by a sibling script" home #10048` issue number into a named constant/comment convention if this repo has a pattern for that elsewhere (nit only).

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 #10048
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 (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 93 registered-repo PR(s), 50 merged, 10 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kai392; Gittensor profile; 93 PR(s), 10 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR rewrites resolveCheckerHome's imported branch to strip // and /* */ comments then require the specifier to appear in an actual import/export/dynamic-import statement, matching exactly the required pattern forms while preserving branch precedence and other functions untouched, and adds tests covering the //, /* */, near-miss, and the real check-fixture-clock-races prose sentence.

Review context
  • Author: kai392
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, Cuda, JavaScript, Kotlin, MDX, Perl, Ruby, Rust
  • Official Gittensor activity: 93 PR(s), 10 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 <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> 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.

Prose/comment mentions of a sibling check-*.ts no longer count as imported homes, so dropping a checker from test:ci fails instead of being masked by a sentence (JSONbored#10048).

Co-authored-by: Cursor <cursoragent@cursor.com>
@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 91.95%. Comparing base (c877ed6) to head (6c84758).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10119   +/-   ##
=======================================
  Coverage   91.95%   91.95%           
=======================================
  Files         931      931           
  Lines      113924   113924           
  Branches    27506    27506           
=======================================
  Hits       104760   104760           
  Misses       7863     7863           
  Partials     1301     1301           
Flag Coverage Δ
backend 95.67% <ø> (ø)

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

@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 2e1842b into JSONbored:main Jul 31, 2026
8 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scripts(checks): check-checkers-wired counts a prose comment mention as an "imported by a sibling script" home

2 participants