chore(miner): migrate CLI command packages/loopover-miner/lib modules to TypeScript (#7305)#7331
Conversation
… to TypeScript (JSONbored#7305) Batch 3.1 of the JSONbored#7290 migration: converts metrics-cli.js, feasibility-cli.js, idea-feasibility-cli.js, calibration-cli.js, tenant-cli.js, and migrate-cli.js (plus their hand-maintained .d.ts siblings) to real .ts, using the in-place-emit build pipeline Phase 1 (JSONbored#7299) already wired up. No behavior change; existing tests continue to pass unmodified against the compiled output, all at 100% line/branch coverage.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7331 +/- ##
=======================================
Coverage 91.03% 91.03%
=======================================
Files 714 714
Lines 72102 72118 +16
Branches 19163 19232 +69
=======================================
+ Hits 65635 65652 +17
+ Misses 5427 5426 -1
Partials 1040 1040
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 17:55:26 UTC
Review summary Nits — 4 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
lib/metrics-cli.js,lib/feasibility-cli.js,lib/idea-feasibility-cli.js,lib/calibration-cli.js,lib/tenant-cli.js, andlib/migrate-cli.js(plus their hand-maintained.d.tssiblings) from plain.jsto real.ts.lib/foo.tscompiles tolib/foo.jsat the same path), so every consumer's import path stays identical.lib/tenant-cli.jsexisted in the tree by the time this was picked up (per the issue's own note that it might land after feat(miner): add loopover-miner tenant create/list/destroy admin CLI over the control-plane provisioning API #7275/Provisioning core: create/destroy a tenant's Container + Postgres DB #7180), so it's included in this batch rather than skipped.calibration-cli.ts'stoOutcomeRecordspasses a possibly-nullrepoFullNamethrough unchanged (cast, not defaulted), andmigrate-cli.ts'sSTORESarray castsresolveReplaySnapshotDbPathpast a staleNodeJS.ProcessEnvparameter type in its own (not-yet-converted).d.tsthat's inconsistent with its 13 sibling resolvers.Closes #7305.
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally — full unsharded run passes (1002/1004 test files, 2 pre-existing unrelated skips); all 6 converted files are at 100% line and branch coveragenpm 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=moderate— 2 pre-existing high-severity findings ingithub-actionlint'sadm-ziptransitive dependency (no fix available upstream), unrelated to this changeAlso ran:
npm run test:engine-parity,npm run test:live-gate-parity,npm run test:driver-parity,npm run build --workspace @loopover/miner,npm run test:miner-pack,npm run docs:drift-check,npm run manifest:drift-check,npm run engine-parity:drift-check,npm run command-reference:check,npm run ui:openapi:settings-parity,npm run ui:version-audit,npm run miner:env-reference:check— all green.Safety
No UI Evidence section — this PR has no visible UI/frontend/docs surface.
Notes
tenant-cli.ts'sparseTenantCreateArgs/parseTenantNameArgs/parseTenantListArgsand calibration/feasibility argv parsers needed small TypeScript-only structural additions (a localisOneOftype-guard helper for literal-union narrowing, tuple casts after length checks, targeted type assertions for the two pre-existing drift spots above) to satisfy strict mode — none change observable behavior, all covered by the existing test suites.