Skip to content

chore(miner): finish TypeScript migration and add zero-orphan guard - #7412

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
andriypolanski:chore/miner-ts-final-cleanup-7317
Jul 20, 2026
Merged

chore(miner): finish TypeScript migration and add zero-orphan guard#7412
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
andriypolanski:chore/miner-ts-final-cleanup-7317

Conversation

@andriypolanski

@andriypolanski andriypolanski commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Closes #7317

Summary

Change

Converted sources (new .ts, regenerated .js + .d.ts):

  • attempt-cli, attempt-log, ci-poller, coding-task-spec
  • contribution-profile-extract, contribution-profile-filter
  • discover-cli, live-issue-snapshot, logger, loop-cli
  • loop-reentry, oauth-device-flow, policy-doc-cache
  • portfolio-queue-cli, self-review-context, stack-detection

Guard / docs:

  • test/unit/miner-typescript-migration-complete.test.ts — every bin//lib/ basename must have a sibling .ts source (and matching emitted .js/.d.ts)
  • packages/loopover-miner/tsconfig.json / vitest.config.ts — drop mid-migration wording now that conversion is complete
  • Coverage-closing tests for the converted modules (patch aims 100% lines+branches on changed miner sources)

Tests

  • test/unit/miner-typescript-migration-complete.test.ts
  • Related suites for all 16 modules (527 tests green), including attempt/discover/loop/portfolio-queue CLI, ci-poller, self-review-context, attempt-log, stack-detection, coding-task-spec path guard, contribution-profile extract/filter, live-issue-snapshot, logger, loop-reentry, oauth-device-flow
  • Scoped coverage: 100% lines + branches on all 16 converted .ts files
  • npx tsc --noEmit
  • npm --workspace @loopover/miner run build

Scope / Safety

@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.27%. Comparing base (0d896ce) to head (47bc837).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7412      +/-   ##
==========================================
+ Coverage   91.22%   91.27%   +0.04%     
==========================================
  Files         716      716              
  Lines       72801    72972     +171     
  Branches    20885    21526     +641     
==========================================
+ Hits        66414    66605     +191     
+ Misses       5347     5327      -20     
  Partials     1040     1040              
Flag Coverage Δ
shard-1 32.64% <4.54%> (+0.58%) ⬆️
shard-2 36.09% <21.23%> (-5.61%) ⬇️
shard-3 34.54% <21.72%> (-3.04%) ⬇️
shard-4 42.90% <42.41%> (-0.02%) ⬇️
shard-5 36.98% <38.42%> (+2.22%) ⬆️
shard-6 33.56% <9.79%> (+8.51%) ⬆️

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/attempt-cli.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/attempt-log.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/ci-poller.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/coding-task-spec.ts 100.00% <100.00%> (ø)
...loopover-miner/lib/contribution-profile-extract.ts 100.00% <100.00%> (ø)
.../loopover-miner/lib/contribution-profile-filter.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/discover-cli.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/live-issue-snapshot.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/logger.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/loop-cli.ts 100.00% <100.00%> (ø)
... and 6 more

... and 16 files with indirect coverage changes

@andriypolanski
andriypolanski force-pushed the chore/miner-ts-final-cleanup-7317 branch from f0c63c6 to 47bc837 Compare July 20, 2026 07:53
@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
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-20 08:06:46 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is the closing deliverable for the miner TypeScript migration (issue #7317), converting the last 16 hand-maintained lib modules to real .ts sources with tsc-emitted .js/.d.ts kept in place, plus a fail-closed guard test to prevent hand-maintained JS/d.ts orphans from reappearing. The two files I can fully inspect (attempt-cli.ts, loop-cli.ts) show coherent, careful logic — worktree cleanup in `finally`, claim release paired with soft-claim discovery-plane release, kill-switch transition tracking, and dry-run short-circuits before any store is opened — consistent with the stated 'same pattern as prior batches' approach. The bulk of the diff (58 of 61 files) is omitted/truncated here, so I can't verify the other 15 converted modules line-by-line; nothing in what I can see indicates a functional regression versus the prior JS implementation.

Nits — 6 non-blocking
  • The external scan flags a possible `generic_secret_assignment` at test/unit/miner-loop-cli.test.ts:1330 (medium confidence) — worth a quick manual check that this is a fixture/test token and not a real credential before merge.
  • attempt-cli.ts and loop-cli.ts are both 600–900 lines with several depth-5 branches (e.g. attempt-cli.ts:191); consider whether the outcome-handling blocks in `runAttempt`/`runLoop` could be split into smaller named helpers now that they're real TS and get type-checked, though this mirrors the prior .js structure so it's not a regression.
  • The 'console.log'/'console.error' hits flagged by the scanner in attempt-cli.js/ts are intentional CLI stdout/stderr output for the `attempt` subcommand, not debug leftovers — no action needed, but worth confirming none of these leak sensitive fields (e.g. tokens) via `JSON.stringify(finalResult, ...)`.
  • Given the description states this converts existing hand-maintained .js/.d.ts to .ts 1:1, it'd help reviewers to see a smaller sample diff or a note confirming behavior is unchanged for the 13 modules not shown in this truncated diff (attempt-log, ci-poller, contribution-profile-extract/filter, discover-cli, live-issue-snapshot, logger, loop-reentry, oauth-device-flow, policy-doc-cache, self-review-context, stack-detection).
  • Since this PR converts 16 modules from .js to .ts in one shot, a follow-up sanity pass diffing each new .ts against its predecessor .js (not just against the regenerated .js/.d.ts) would give higher confidence that no logic drifted during the manual TS conversion, beyond what `tsc --noEmit` and the 100%-coverage suite can catch.
  • Possible secret-shaped assignment in the diff (generic_secret_assignment) — Verify the value is not a real credential.

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 #7317
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low 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: 162 registered-repo PR(s), 108 merged, 22 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 162 PR(s), 22 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: significant
Linked issue satisfaction

Addressed
The PR converts the remaining 16 hand-maintained .js/.d.ts modules in packages/loopover-miner/lib to real .ts sources under the existing tsc pipeline and adds a fail-closed guard test (miner-typescript-migration-complete.test.ts) that verifies every bin/lib basename has a sibling .ts source, directly matching both deliverables (zero hand-maintained .d.ts remaining, 100% compiler-verified TypeScrip

Review context
  • Author: andriypolanski
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, JavaScript, Rust, Cuda, Kotlin, MDX, Scala
  • Official Gittensor activity: 162 PR(s), 22 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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
Contributor

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 603ea35 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): final cleanup once all packages/loopover-miner TypeScript migration batches land

2 participants