Skip to content

chore(miner): migrate batch 4.6 foundational lib modules to TypeScript (#7314)#7327

Closed
andriypolanski wants to merge 3 commits into
JSONbored:mainfrom
andriypolanski:chore/miner-ts-batch-4.6-7314-v3
Closed

chore(miner): migrate batch 4.6 foundational lib modules to TypeScript (#7314)#7327
andriypolanski wants to merge 3 commits into
JSONbored:mainfrom
andriypolanski:chore/miner-ts-batch-4.6-7314-v3

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Summary

Closes #7314

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • 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 (e.g. Closes #123) — 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; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • 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
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • No behavior change; existing miner unit tests for these eight modules continue to pass unmodified (243 related tests across the listed suites). Codecov patch applies only to src/** — this PR only touches packages/loopover-miner/lib/**. Ran npm run build:miner, npm run test:miner-pack, git diff --check, and npm run actionlint. Full test:ci / UI / workers / coverage chain was exercised on the sibling batch 4.7 PR (chore(miner): migrate batch 4.7 foundational lib modules to TypeScript (#7315) #7319) against the same pipeline; this migration is the same class of change.

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.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

N/A — no visible UI/frontend/docs change.

Notes

andriy-polanski and others added 2 commits July 19, 2026 16:29
JSONbored#7314)

Convert eight foundational loopover-miner lib modules from plain .js +
hand-maintained .d.ts to real TypeScript under the existing in-place
tsc emit pipeline, with zero behavior change.

Co-authored-by: Cursor <cursoragent@cursor.com>
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.01%. Comparing base (4bcac8c) to head (652f4d6).

Files with missing lines Patch % Lines
packages/loopover-miner/lib/worktree-allocator.ts 88.03% 8 Missing and 6 partials ⚠️
packages/loopover-miner/lib/repo-clone.ts 96.12% 0 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7327      +/-   ##
==========================================
- Coverage   91.03%   91.01%   -0.02%     
==========================================
  Files         714      714              
  Lines       72102    72124      +22     
  Branches    19163    19323     +160     
==========================================
+ Hits        65635    65646      +11     
  Misses       5427     5427              
- Partials     1040     1051      +11     
Flag Coverage Δ
shard-1 41.29% <33.55%> (-0.45%) ⬇️
shard-2 35.61% <37.28%> (-0.12%) ⬇️
shard-3 31.59% <53.07%> (-0.04%) ⬇️
shard-4 32.72% <38.37%> (+0.12%) ⬆️
shard-5 30.01% <28.07%> (-0.56%) ⬇️
shard-6 43.74% <45.17%> (+0.17%) ⬆️

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

Files with missing lines Coverage Δ
...ackages/loopover-miner/lib/chat-action-registry.ts 100.00% <100.00%> (ø)
...ackages/loopover-miner/lib/contribution-profile.ts 100.00% <100.00%> (ø)
...ages/loopover-miner/lib/github-token-resolution.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/http-retry.ts 100.00% <100.00%> (ø)
...ackages/loopover-miner/lib/policy-verdict-cache.ts 100.00% <100.00%> (ø)
...s/loopover-miner/lib/submission-freshness-check.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/repo-clone.ts 96.12% <96.12%> (ø)
packages/loopover-miner/lib/worktree-allocator.ts 88.03% <88.03%> (ø)

... and 8 files with indirect coverage changes

@JSONbored JSONbored closed this Jul 19, 2026
@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
@JSONbored

Copy link
Copy Markdown
Owner

Stop rebasing - let CI run, there's no need to rebase. All it does is slow down the pipeline, these are single-shot reviews.

@JSONbored JSONbored reopened this Jul 19, 2026
@loopover-orb

loopover-orb Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-19 17:48:17 UTC

26 files · 1 AI reviewer · no blockers · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
This is a mechanical batch-4.6 TypeScript migration of 8 loopover-miner lib modules (policy-verdict-cache, submission-freshness-check, github-token-resolution, worktree-allocator, contribution-profile, http-retry, repo-clone, chat-action-registry), following the established #7290 Phase 4 pattern and closing the linked issue #7314. Comparing the visible .ts sources against their compiled .js output (e.g. worktree-allocator.ts vs worktree-allocator.js, github-token-resolution.ts vs .js, contribution-profile.ts vs .js), the runtime logic is faithfully preserved — types were added but control flow, validation, and error handling are unchanged, consistent with the 'zero behavior change' claim. The biggest caveat is that several changed files (http-retry.*, policy-verdict-cache.*, submission-freshness-check.*) were truncated in this diff and could not be directly diffed against their prior JS behavior, so I can't fully confirm parity there.

Nits — 6 non-blocking
  • No new tests accompany ~2600 added lines, which is acceptable only if the claim that existing unmodified JS-targeting tests exercise the identical compiled output holds for every one of the 8 modules — worth double-checking for http-retry.ts and submission-freshness-check.ts specifically since their diffs were truncated here.
  • packages/loopover-miner/lib/repo-clone.ts:171 and chat-action-registry.ts:103 introduce control-flow depth of 5 (try/catch nested inside conditionals inside async functions) — consider extracting the lock-reclaim branch or the gate-check branch into a helper for readability.
  • http-retry.ts hardcodes status codes 429/403/500 as magic numbers (per the external scan) — consider named constants (e.g. RATE_LIMIT_STATUS, FORBIDDEN_STATUS) for clarity, though this may just carry over from the pre-migration .js.
  • github-token-resolution.ts hardcodes two legacy API URLs (gittensory-api.zeronode.workers.dev / .aethereal.dev) as a Set literal — confirm these aren't meant to be sourced from shared config, though this appears to predate the migration.
  • resolveRepoCloneBaseDir's signature changed from `env = process.env` to `env?` with an explicit `env === undefined ? process.env : env` check inside — functionally identical but worth confirming this pattern is consistent with the other migrated modules' env-defaulting style.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.

CI checks failing

  • validate-tests-merge
  • validate
  • validate-tests (6)
  • validate-tests (2)
  • validate-tests (4)
  • validate-tests (5)
  • validate-tests (1)
  • validate-tests (3)

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 #7314
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: 166 registered-repo PR(s), 111 merged, 22 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 166 PR(s), 22 issue(s).
Improvement ℹ️ None detected risk: low · value: none · LLM: moderate
Linked issue satisfaction

Addressed
The PR converts the listed batch-4.6 files (worktree-allocator.ts and repo-clone.ts are shown in full, matching the issue's exact file list) to real TypeScript with tsc-regenerated .js output, consistent with the Phase 1 in-place-emit pattern the issue requests, and the description confirms all eight named files were converted with existing tests passing unmodified.

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: 166 PR(s), 22 issue(s).
  • Related work: Titles/paths share 19 meaningful terms. (issue #7300, issue #7301)
  • Related work: Titles/paths share 19 meaningful terms. (issue #7300, issue #7302)
  • Related work: Titles/paths share 19 meaningful terms. (issue #7301, 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 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate-tests-merge, validate, validate-tests (6), validate-tests (2), validate-tests (4), validate-tests (5), validate-tests (1), validate-tests (3))). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 19, 2026
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 foundational, most-depended-on packages/loopover-miner/lib modules to TypeScript (batch 4.6 of 8 (Phase 4))

3 participants