chore(imports): unify relative-import specifiers per resolution zone; add a drift guard - #9231
Conversation
… add a drift guard (#9221)
|
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 |
loopover-ui | b46e314 | Commit Preview URL Branch Preview URL |
Jul 27 2026, 08:13 AM |
Logic backtestReplayed 0 historical case(s) for Backtest comparison:
|
Bundle ReportBundle size has no change ✅ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9231 +/- ##
=======================================
Coverage 93.94% 93.94%
=======================================
Files 825 825
Lines 81835 81835
Branches 24849 24849
=======================================
Hits 76882 76882
Misses 3558 3558
Partials 1395 1395
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-27 08:35:41 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk 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.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 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.
|


Summary
The repo had three relative-import specifier styles where only one split was actually forced:
src/**moduleResolution: "Bundler"scripts/**,test/**.js.tssource directly from this zone toopackages/**moduleResolution: "NodeNext", published ESM.jssrc/**andscripts/**/test/**compiled under the identical tsconfig yet disagreed — an arbitrary drift, not a technical requirement. This PR convertsscripts/**andtest/**to extensionless (matchingsrc/**), leavespackages/**on.js(a hard constraint of shipping ESM, not a style choice), and adds a drift guard so the split can't silently return.What changed:
src/**/scripts/**/test/**:./foo.js→./fooon relative specifiers.packages/**: bare relative specifiers →.js(their own internal imports only — reaching FROMsrc/scripts/testINTO a package's source still resolves extensionless, since the importer's own zone rule governs, not the target's).scripts/check-import-specifiers.ts+npm run import-specifiers:check, wired intotest:ci. Pure core with injectablelistSourceFiles/readFile(mirrorscheck-coverage-bolt-on-filenames.ts's shape), 11 unit tests..d.tsdeclaration-only imports (claim-ledger.d.tset al.) and non-JS/TS extensions (.jsonimport assertions, etc.) are explicitly exempted in both the checker and the conversion — verified no such import was mangled.Closes #9221
Two false positives found and fixed while building the checker
.jsto../package.json(an import-assertion, not a JS specifier) insidepackages/loopover-engine/src/version.ts— caught bynpm run typecheckfailing withTS2307, reverted, and the checker's own extension-detection tightened (OTHER_EXTENSION_TAIL) so neither the checker nor the converter can misfire on.json/.css/.svg/etc. again.readFile) — it was flagging its own fixtures as violations of themselves. Fixed with anALLOWED_FILENAMESallowlist, mirroringcheck-coverage-bolt-on-filenames.ts's identical self-referential-false-positive pattern.Validation
npm run import-specifiers:check— clean (0 violations) against the fullsrc/**,scripts/**,test/**,packages/**tree.npm run typecheck— clean.npm run build --workspace @loopover/engine+npm run test --workspace @loopover/engine— 737/737 pass.npm run build:mcp,build:miner,build --workspace @loopover/ui-kit,build --workspace @loopover/discovery-index— all clean.npx vitest runtargeted at the checker's own suite plus every test file touched by recent related work (attester seam, rate-limit fix, gate-check-policy) — 311/311 pass, including the two#4995regression tests inorb-relay.test.tsthat are only green now that fix(orb): degrade rate-limit installation-identity resolution on a DB error instead of escaping uncaught #9227 has merged.Safety
packages/**'s published ESM output is unchanged (still.js-suffixed internally, as required).