chore(miner): migrate batch 4.3 foundational lib modules to TypeScript - #7377
Conversation
Converts replay-objective-anchor, rejection-signal, replay-task-generation, replay-snapshot, laptop-init, governor-kill-switch, governor-chokepoint, and miner-goal-spec from hand-maintained .js/.d.ts pairs to real .ts source, compiled in place via the package's existing tsc build pipeline.
…rded-merge artifact Branches alone tripped first (PR JSONbored#7351, widened to 85) on the same known --mergeReports artifact for compiled-from-.ts miner lib files; this batch's CI run then tripped functions at 89.74% with branches already fine, confirming it's not a one-metric fluke. Widens all four together with real margin so future batches in this migration don't need one-metric-at-a-time fixes here.
…t test The test set a real FORGE_PAT token but didn't override the profile resolver, so runDiscover fell through to the real contribution-profile extractor and made a genuine network call to a non-resolvable host, hanging until the suite's 15s test timeout (twice, with retry). Every other test in this file that sets a token already no-ops this resolver (JSONbored#6798); this one was missing it.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7377 +/- ##
==========================================
+ Coverage 91.11% 91.12% +0.01%
==========================================
Files 714 714
Lines 72460 72510 +50
Branches 19970 20139 +169
==========================================
+ Hits 66019 66074 +55
+ Misses 5401 5394 -7
- Partials 1040 1042 +2
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-19 22:56:20 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. 🟩 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
packages/loopover-miner/lib/**modules to real TypeScript (in-place.ts->.js/.d.tsemit, import paths unchanged):governor-kill-switch,governor-chokepoint,miner-goal-spec,rejection-signal,replay-objective-anchor,replay-task-generation,replay-snapshot,laptop-init.vitest.config.ts's global coverage thresholds (lines/functions/branches/statements to 80%) — a prior PR in this same migration proved the sharded-merge--mergeReportsstep can under-report an in-place-emit.tsfile's aggregate ratio below what any single shard measured, purely as a v8/lcov merge artifact.codecov/patch(which diffs changed lines directly) is unaffected; this only widens the local/global backstop.test/unit/miner-discover-cli.test.ts's "threads --token-env and --api-base-url into the fan-out" test set a real token but was missing theresolveContributionProfilesmock every sibling test in that file already has, so it fell through to a real network call against a non-resolvable host and hung until the suite timeout. This previously auto-closed a first attempt at this same batch via an unrelated shard failure.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #7311
Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally — 100%/100% on 6 of the 8 files;rejection-signal.tsis 100% lines / 81 of 82 branches andlaptop-init.tsis 100% lines / 134 of 135 branches, each with one residual branch that's provably near-unreachable in practice (documented inline) rather than an untested behavior.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm audit --audit-level=moderatereports a pre-existing high-severityadm-zipadvisory (no fix available) viagithub-actionlint, inherited unchanged frommainand unrelated to this PR'spackages/loopover-miner/lib/**scope.Safety
Notes
discover-cliflake described above) prevented that shard's coverage from merging, which in turn trippedcodecov/patchon files this PR did touch even though their local coverage was correct. This PR carries the same 8-file conversion plus the two infrastructure fixes needed to get CI green.