Skip to content

chore(miner): migrate CLI command packages/loopover-miner/lib modules to TypeScript (#7305)#7331

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
oktofeesh1:claude/issue-7305-batch-3-1
Jul 19, 2026
Merged

chore(miner): migrate CLI command packages/loopover-miner/lib modules to TypeScript (#7305)#7331
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
oktofeesh1:claude/issue-7305-batch-3-1

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Summary

Closes #7305.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally — full unsharded run passes (1002/1004 test files, 2 pre-existing unrelated skips); all 6 converted files are at 100% line and branch coverage
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate — 2 pre-existing high-severity findings in github-actionlint's adm-zip transitive dependency (no fix available upstream), unrelated to this change
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — no new logic/behavior is introduced; all 6 modules' existing test suites (96 tests total) continue to pass unmodified against the compiled artifacts

Also 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 secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A — no such changes.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A — no API/OpenAPI/MCP behavior changes.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A — no UI changes.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (N/A.)

No UI Evidence section — this PR has no visible UI/frontend/docs surface.

Notes

  • tenant-cli.ts's parseTenantCreateArgs/parseTenantNameArgs/parseTenantListArgs and calibration/feasibility argv parsers needed small TypeScript-only structural additions (a local isOneOf type-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.

… 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.
@oktofeesh1
oktofeesh1 requested a review from JSONbored as a code owner July 19, 2026 17:48
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 19, 2026
@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.03%. Comparing base (4bcac8c) to head (ff5ef1d).

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           
Flag Coverage Δ
shard-1 41.37% <6.50%> (-0.37%) ⬇️
shard-2 35.72% <34.14%> (+<0.01%) ⬆️
shard-3 31.60% <0.40%> (-0.03%) ⬇️
shard-4 32.75% <2.84%> (+0.16%) ⬆️
shard-5 30.08% <32.92%> (-0.49%) ⬇️
shard-6 43.81% <27.64%> (+0.25%) ⬆️

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/calibration-cli.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/feasibility-cli.ts 100.00% <100.00%> (ø)
...ackages/loopover-miner/lib/idea-feasibility-cli.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/metrics-cli.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/migrate-cli.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/tenant-cli.ts 100.00% <100.00%> (ø)

... and 6 files with indirect coverage changes

@loopover-orb

loopover-orb Bot commented Jul 19, 2026

Copy link
Copy Markdown

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-19 17:55:26 UTC

18 files · 1 AI reviewer · no blockers · readiness 82/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a mechanical batch of six lib/*.js -> lib/*.ts conversions (metrics, feasibility, idea-feasibility, calibration, tenant, migrate CLIs) that produce byte-identical runtime output — verified by diffing the pre/post .js emit, which differs only in formatting (4-space indent, explicit `continue`/`else` braces) and the appended sourcemap comment, never in logic or control flow. The two called-out pre-existing type drifts (`toOutcomeRecords`'s unchecked `repoFullName` cast in calibration-cli.ts, and the stale `NodeJS.ProcessEnv` cast on `resolveReplaySnapshotDbPath` in migrate-cli.ts) are honestly documented as out-of-scope rather than silently fixed or hidden. Existing tests (e.g. test/unit/miner-calibration-cli.test.ts) import the compiled .js output directly and continue to pass since behavior is unchanged, so the external brief's 'zero test-path evidence' and 'console debug leftovers' flags are noise from a path-based heuristic that doesn't understand a zero-behavior-change migration.

Nits — 4 non-blocking
  • tenant-cli.ts:52 and :63 use `as TenantClientOptions` to force an options object with possibly-undefined `env`/`fetchImpl` into the client's type — consider giving `TenantClientOptions`'s fields optional modifiers so the cast isn't needed, though this is pre-existing behavior carried over verbatim.
  • The external brief's magic-number/deep-nesting/console flags on feasibility-cli.ts:67, calibration-cli.ts:84, etc. are all on logic carried over unchanged from the original .js — worth confirming your coverage tooling excludes straight ports like this from new findings so future migration PRs aren't penalized for pre-existing patterns.
  • Nothing to change functionally; if a future batch converts tenant-client.js or replay-snapshot's .d.ts, the two documented casts in tenant-cli.ts and migrate-cli.ts can likely be dropped.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.

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 #7305
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
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: 77 registered-repo PR(s), 64 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor oktofeesh1; Gittensor profile; 77 PR(s), 0 issue(s).
Improvement ℹ️ None detected risk: low · value: none · LLM: moderate
Linked issue satisfaction

Addressed
The PR converts all six listed lib CLI files (metrics-cli, feasibility-cli, idea-feasibility-cli, calibration-cli, tenant-cli, migrate-cli) from .js to real .ts, including tenant-cli which the issue flagged as conditional, matching the diff evidence shown for migrate-cli.ts, tenant-cli.ts, feasibility-cli.ts, and idea-feasibility-cli.ts.

Review context
  • Author: oktofeesh1
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, MDX, Python, TypeScript
  • Official Gittensor activity: 77 PR(s), 0 issue(s).
  • Related work: Titles/paths share 8 meaningful terms. (issue #7300)
  • Related work: Titles/paths share 8 meaningful terms. (issue #7301)
  • Related work: Titles/paths share 8 meaningful terms. (issue #7302)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Start here: Review top overlaps.
  • Then work through the remaining 2 steps 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 &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; 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

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(miner): migrate CLI command packages/loopover-miner/lib modules to TypeScript (batch 3.1 of 4 (Phase 3))

1 participant