chore(miner): migrate leaf-most low-fan-in lib modules to typescript (batch 2.3)#7333
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…(batch 2.3) Convert the 8 leaf-most, lowest-fan-in packages/loopover-miner/lib utility modules to real TypeScript (batch 2.3 of Phase 2, JSONbored#7302): version, slop-assessment, discovery-throttle, claim-ledger-expiry, portfolio-queue-expiry, prompt-injection-defense, execute-local-write, cross-repo-evaluation. Each module gains a hand-authored .ts source; tsc -p tsconfig.json emits the .js + .d.ts in place (inline sourcemap), so the published bin/lib layout is unchanged and v8 coverage remaps to the .ts source. Conversions are type-only: no runtime branch was added (null/undefined narrowing uses casts past the existing finite/nullish guards), keeping behaviour byte-faithful to the prior hand-maintained .js.
1d604ea to
830ad97
Compare
|
I rebased mid-run because I just merged some bigger CI improvements aimed at helping efficiency/performance of our CI pipeline long term. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7333 +/- ##
==========================================
+ Coverage 91.03% 91.99% +0.96%
==========================================
Files 714 631 -83
Lines 72118 51470 -20648
Branches 19232 15673 -3559
==========================================
- Hits 65651 47352 -18299
+ Misses 5427 3243 -2184
+ Partials 1040 875 -165
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Caution 🛑 LoopOver review result - reject/close recommendedReview updated: 2026-07-19 18:16:15 UTC
Review summary Blockers
Nits — 6 non-blocking
Why this is blocked
📋 Copy for AI agents — paste into your coding agentCI checks failing
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. 🟩 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.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, codecov/patch, validate-tests-merge); AI reviewers agree on a likely critical defect: codecov/patch is failing at 94.96% against a 99% target — for a pure type-only migration this typically means a narrowing/cast branch (e.g. the `leasedAt`/`claimedAt` NaN path in claim-ledger-expiry.ts/portfolio-queue-expiry.ts, or a warning branch in cross-repo-evaluation.ts's manifest normalizers) isn't actually exercised by the existing test suite post-conversion; identify and cover the uncovered lines/branches rather than waiving the gate.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Closes #7302
Summary
Batch 2.3 of the Phase 2
packages/loopover-miner/libTypeScript migration (#7302): converts the 8 leaf-most, lowest-fan-in utility modules to real TypeScript, following the same in-place-emit pattern the earlier batches (#7290 → #7331) established.Converted modules:
version— miner release-id resolverslop-assessment— miner slop scoringdiscovery-throttle— pure rate-limit → concurrency back-offclaim-ledger-expiry— pure active-claim expiry sweepportfolio-queue-expiry— pure stuck-lease reclaim sweepprompt-injection-defense— untrusted-content injection detect/defangexecute-local-write— realsh -csubprocess local-write runnercross-repo-evaluation— cross-repo readiness evaluationEach module gains a hand-authored
.tssource;tsc -p tsconfig.jsonemits the.js+.d.tsin place with an inline sourcemap, so the publishedbin/liblayout is unchanged and v8 coverage remaps onto the.tssource. Every callsite continues to import the same specifier.The conversions are type-only: no runtime branch was added. Where strict-null narrowing was needed (e.g.
number | nullpast aNumber.isFiniteguard, aleasedAtthatDate.parsealready coerces toNaN), a cast is used rather than a newif, keeping the emitted.jsbyte-faithful to the prior hand-maintained.jsand the branch surface identical to what existing tests already cover.Scope
packages/), noblockedPathssite//CNAME/lovableeditsValidation
tsc -p packages/loopover-miner/tsconfig.json— 0 errors (emit +--noEmittypecheck)eslinton all 8.tssources — 0 problemsnode --checkon all 8 emitted.js.js/.d.tsexactly (no emit drift)vitest runon the migrated modules' unit suites — greenmain(rebased)Safety
.jsis a faithful compile of the prior.js