Skip to content

chore(miner): migrate CLI command lib modules to TypeScript (batch 3.2 of 4)#7387

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
tryeverything24:migrate-miner-lib-batch-3-2-typescript
Jul 20, 2026
Merged

chore(miner): migrate CLI command lib modules to TypeScript (batch 3.2 of 4)#7387
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
tryeverything24:migrate-miner-lib-batch-3-2-typescript

Conversation

@tryeverything24

Copy link
Copy Markdown
Contributor

Closes #7306

Summary

Batch 3.2 of the #7290 migration (Phase 3, CLI command modules): converts
plan-store-cli, run-state-cli, governor-ledger-cli, purge-cli,
event-ledger-cli, and claim-ledger-cli (plus their hand-maintained
.d.ts siblings) from .js to real .ts, using the in-place-emit build
pipeline Phase 1 (#7299) already wired up. No tsconfig.json changes
needed. No behavior change; existing tests continue to pass unmodified
against the compiled output, and each converted module is driven to
100% statement/branch/function/line coverage.

Notes

  • One prior attempt on this issue (#7358)
    had correct content and 100% codecov/patch coverage, but was closed by the
    now-fixed repo-wide validate/validate-tests-merge CI infrastructure
    outage, not a code issue — confirmed by inspecting its check runs before
    starting this attempt.
  • Regenerated and committed the compiled .js/.d.ts build output alongside
    the .ts sources (npm run build --workspace @loopover/miner).
  • git diff --check against upstream/main is clean (no compiled-output
    trailing-whitespace artifacts).
  • Full CI parity run locally: typecheck (root + package), actionlint,
    db:schema-drift:check, selfhost:env-reference:check,
    miner:env-reference:check, docs:drift-check, branding-drift:check,
    manifest:drift-check, engine-parity:drift-check,
    release-manifest:sync:check, command-reference:check, test:workers,
    build:mcp, test:mcp-pack, build:miner, test:miner-pack,
    test:miner-deployment-docs-audit, ui:openapi:check, ui:typecheck,
    ui:lint, npm audit — all clean.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.20%. Comparing base (32e0998) to head (3d6668e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7387      +/-   ##
==========================================
+ Coverage   91.19%   91.20%   +0.01%     
==========================================
  Files         716      716              
  Lines       72733    72758      +25     
  Branches    20578    20775     +197     
==========================================
+ Hits        66326    66360      +34     
+ Misses       5365     5356       -9     
  Partials     1042     1042              
Flag Coverage Δ
shard-1 35.87% <0.63%> (-0.03%) ⬇️
shard-2 41.26% <40.76%> (-0.19%) ⬇️
shard-3 38.99% <26.43%> (+0.06%) ⬆️
shard-4 39.94% <33.43%> (+0.06%) ⬆️
shard-5 27.18% <30.89%> (-0.02%) ⬇️
shard-6 31.27% <4.45%> (-0.04%) ⬇️

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/claim-ledger-cli.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/event-ledger-cli.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/governor-ledger-cli.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/plan-store-cli.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/purge-cli.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/run-state-cli.ts 100.00% <100.00%> (ø)

... and 6 files with indirect coverage changes

…2 of 4, Phase 3)

Converts plan-store-cli, run-state-cli, governor-ledger-cli, purge-cli,
event-ledger-cli, and claim-ledger-cli (plus their hand-maintained .d.ts
siblings) from .js 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, and each
converted module is covered to 100% of its statements/branches/functions/lines.
@JSONbored
JSONbored force-pushed the migrate-miner-lib-batch-3-2-typescript branch from 5856289 to 3d6668e Compare July 20, 2026 04:50
@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 20, 2026
@loopover-orb

loopover-orb Bot commented Jul 20, 2026

Copy link
Copy Markdown

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-20 05:02:30 UTC

23 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 .js-to-.ts conversion of six miner CLI command modules (claim-ledger-cli, event-ledger-cli, governor-ledger-cli, purge-cli, plan-store-cli, run-state-cli), adding typed .ts sources plus regenerated compiled .js/.d.ts output, with no logic changes visible in the diff — the .ts and .js bodies are structurally identical modulo type annotations. The new purge-cli.ts is the most substantive addition (a real, if not previously reviewed, right-to-be-forgotten implementation across 9 stores), but per the PR description this was already merged content from a prior attempt and is being reintroduced verbatim. The PR correctly links to issue #7306 and follows the established Phase 1 in-place-emit build pipeline, so the batch mechanics look sound.

Nits — 5 non-blocking
  • The external brief's 'deep nesting' and 'magic numbers' flags (e.g. claim-ledger-cli.ts:240 padEnd(24)) are inherent to the pre-existing table-rendering/arg-parsing logic being ported, not new complexity introduced by this PR — low value to chase.
  • purge-cli.ts's countExistingRows opens a fresh DatabaseSync per store for the dry-run path (packages/loopover-miner/lib/purge-cli.ts) — fine at current store counts but worth a comment if the target list grows much further.
  • The compiled .js diffs are large due to formatting/whitespace changes from the new tsc emit step, which is expected for a first `.ts` conversion but makes the diff noisy to review — worth calling out in the PR description that .js hunks are compiler output, not hand-edited.
  • Confirm test files (miner-claim-ledger-cli.test.ts, miner-event-ledger-cli.test.ts, etc.) import from the new .ts sources (or their compiled .js) rather than duplicating fixtures, since only the file list was shown here.
  • Given purge-cli.ts touches 9 different stores' purgeByRepo methods, double check each store's purgeByRepo test coverage lands in this batch or a prior one — a missing purgeByRepo test on any target store would be a real gap given this is a data-deletion path.

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 #7306
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: 54 registered-repo PR(s), 19 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor tryeverything24; Gittensor profile; 54 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff converts claim-ledger-cli, event-ledger-cli, and purge-cli to real .ts sources (with the compiled .js output regenerated alongside), matching three of the six files in scope; the truncated diff strongly implies the remaining plan-store-cli, run-state-cli, and governor-ledger-cli files follow the same pattern per the PR description, and the description explicitly states old hand-maintained

Review context
  • Author: tryeverything24
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, TypeScript, Python, HTML, C++, Java, PHP, C#
  • Official Gittensor activity: 54 PR(s), 0 issue(s).
  • Related work: Titles/paths share 7 meaningful terms. (issue #7300)
  • Related work: Titles/paths share 7 meaningful terms. (PR #7384)
  • Related work: Titles/paths share 9 meaningful terms. (issue #7300, PR #7384)
  • 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.

@loopover-orb
loopover-orb Bot merged commit 467306e into JSONbored:main Jul 20, 2026
15 checks passed
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.2 of 4 (Phase 3))

1 participant