Skip to content

chore(miner): add a real tsc build pipeline for loopover-miner (#7290) - #7299

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
oktofeesh1:claude/github-issue-7290-026672
Jul 19, 2026
Merged

chore(miner): add a real tsc build pipeline for loopover-miner (#7290)#7299
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
oktofeesh1:claude/github-issue-7290-026672

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Summary

  • Phase 1 of the plain-.js + hand-maintained-.d.ts → real TypeScript migration proposed in chore(miner): migrate packages/loopover-miner from plain .js + hand-maintained .d.ts to real TypeScript #7290: adds a real tsc build pipeline to packages/loopover-miner (mirroring how @loopover/engine already builds), proven end-to-end against one converted file rather than attempting the full 117-file migration in one PR (explicitly out of scope per the issue itself — "Deliberately NOT scoped as one PR").
  • Converts the first file, lib/pr-number-parse.js + its hand-maintained .d.ts, to real lib/pr-number-parse.ts. Every other file in bin//lib/ is untouched and stays hand-maintained .js + .d.ts for now.
  • Each converted file compiles in place (lib/foo.tslib/foo.js, same path), so the package's published bin/lib layout and every consumer's import path (in this repo and for npm install -g @loopover/miner users) stay identical regardless of a given file's migration status — no consumer ever needs to know or care whether a specific file has been converted yet, and no import path needs to change as later phases convert the rest.
  • Coverage remaps through the compiled output's inline sourcemap back to the .ts source (verified locally: the lcov report attributes 100% line/branch coverage to pr-number-parse.ts, not the compiled .js), so Codecov patch coverage measures the real source correctly.
  • The published npm package still excludes .ts source (only compiled .js/.d.ts ship), matching today's distribution shape exactly — verified via npm pack --dry-run.

Closes #7290 (Phase 1 only — the issue's remaining phases are explicitly meant to be tracked as separate follow-up issues per its own recommended phasing).

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; pr-number-parse.ts is at 100% line and branch coverage (all 6 existing unit tests for it pass unmodified against the compiled output)
  • 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 and already present on main
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — no new logic/behavior is introduced by this migration; the existing test/unit/miner-pr-number-parse.test.ts suite (already at 100% branch coverage of the function) continues to pass unmodified against the compiled artifact. Updated test/unit/miner-package-skeleton.test.ts's assertion on the build script's expected prefix to match the new tsc -p tsconfig.json && ... build step.

Also ran (not in the checklist above, but part of the full local gate): npm run db:migrations:check, npm run db:schema-drift:check, npm run selfhost:env-reference:check, npm run miner:env-reference:check, npm run selfhost:validate-observability, npm run cf-typegen:check, npm run build: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 — 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 in this PR.)
  • 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 doc/changelog content is affected by this build-tooling change.)

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

Notes

  • Root tsconfig.json intentionally does not include packages/loopover-miner/lib — mirroring how packages/loopover-engine is also type-checked entirely through its own package-level tsconfig.json/build script rather than through the root config.
  • Follow-up phases (converting the remaining ~116 files in reviewable batches, per the issue's own recommended phasing) are intended to be filed as separate follow-up issues once this lands, not enumerated here.

…ored#7290)

Phase 1 of the plain-.js-to-TypeScript migration proposed in JSONbored#7290: wires
a real tsc build step into packages/loopover-miner (mirroring how
@loopover/engine already builds), proven end-to-end against one converted
file (lib/pr-number-parse.js -> .ts) before any wider conversion.

Each converted file compiles in place (lib/foo.ts -> lib/foo.js), so the
package's published bin/lib layout and every consumer's import path stay
identical regardless of a given file's migration status -- no file needs
to move as later phases convert the remaining files. Coverage remaps
through the compiled output's inline sourcemap back to the .ts source, so
Codecov patch coverage attributes correctly. The published npm package
excludes .ts source (only the compiled .js/.d.ts ship, matching today's
distribution shape).
@oktofeesh1
oktofeesh1 requested a review from JSONbored as a code owner July 19, 2026 15:03
@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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.82%. Comparing base (8cbcb53) to head (b7300a7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7299   +/-   ##
=======================================
  Coverage   93.82%   93.82%           
=======================================
  Files         706      706           
  Lines       69570    69570           
  Branches    18892    18895    +3     
=======================================
  Hits        65275    65275           
  Misses       3302     3302           
  Partials      993      993           
Flag Coverage Δ
shard-1 43.52% <0.00%> (ø)
shard-2 37.49% <71.42%> (-0.01%) ⬇️
shard-3 32.97% <0.00%> (ø)
shard-4 34.24% <100.00%> (ø)
shard-5 32.10% <0.00%> (ø)
shard-6 45.68% <57.14%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/pr-number-parse.ts 100.00% <100.00%> (ø)

@loopover-orb loopover-orb Bot added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 19, 2026
@loopover-orb

loopover-orb Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-19 15:14:53 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR stands up a real tsc build pipeline for loopover-miner and proves it end-to-end by converting exactly one file (lib/pr-number-parse.js + .d.ts → .ts), compiling in place so the published bin/lib layout and all import paths stay unchanged. The tsconfig reasoning (rootDir/outDir overrides, tsBuildInfoFile isolation, exclude: [] to defeat the implicit outDir-exclude) is sound and each choice is justified with a comment explaining the failure mode it avoids. Coverage wiring correctly remaps through the inline sourcemap to attribute coverage to the .ts source while excluding the still-hand-maintained .d.ts siblings that also glob-match *.ts, and the package.json files/negation ordering (bin, lib, then !**/*.ts) is the correct npm pattern for shipping only compiled output. This closes #7290 as an explicitly-scoped Phase 1, matching the issue's own stated phasing.

Nits — 6 non-blocking
  • test/unit/miner-package-skeleton.test.ts only asserts the build script string, not that `npm run build` (tsc emit) actually succeeds and reproduces the committed lib/pr-number-parse.js/.d.ts — a mismatch between committed compiled output and what tsc would emit wouldn't be caught by this test.
  • No test exercises that `npm pack --dry-run` actually excludes the .ts source per the files-array negation, despite that being called out as manually verified in the description; worth automating given future phases depend on this exact pattern staying correct.
  • Committing all three of pr-number-parse.ts/.js/.d.ts means every future phase's diff triples in file count for one logical change; acceptable for a proof-of-concept phase but worth flagging that it doesn't scale as a review-diff shape for the remaining ~116 files.
  • Consider adding a small test (or CI step) that runs `tsc -p packages/loopover-miner/tsconfig.json` and diffs against the committed .js/.d.ts to catch drift between the compiled artifact and the checked-in files.
  • Consider adding a lightweight `npm pack --dry-run` assertion in test/unit/miner-package-skeleton.test.ts to lock in the .ts-exclusion behavior described in the PR summary.
  • 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 #7290
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
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: 74 registered-repo PR(s), 61 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor oktofeesh1; Gittensor profile; 74 PR(s), 0 issue(s).
Improvement ℹ️ None detected risk: low · value: none · LLM: moderate
Linked issue satisfaction

Addressed
This PR explicitly scopes itself to Phase 1 of the issue's own recommended phasing: it adds a real tsc build pipeline (tsconfig.json, updated build script, coverage remapping) and proves it end-to-end with one converted file (pr-number-parse.ts), removing that file's hand-maintained .d.ts drift while leaving the remaining 116 files as an explicitly deferred, issue-sanctioned follow-up.

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: 74 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 1 step 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
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 e3e85ab into JSONbored:main Jul 19, 2026
16 checks passed
This was referenced Jul 19, 2026
loopover-orb Bot pushed a commit that referenced this pull request Jul 19, 2026
… to TypeScript (#7305) (#7331)

Batch 3.1 of the #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 (#7299) already wired up. No behavior change; existing
tests continue to pass unmodified against the compiled output, all at 100%
line/branch coverage.
tryeverything24 added a commit to tryeverything24/loopover that referenced this pull request Jul 19, 2026
Convert 8 leaf-most, lowest-fan-in packages/loopover-miner/lib modules from
plain .js + hand-maintained .d.ts to real, compiler-verified TypeScript,
following the in-place-emit pattern the Phase 1 build pipeline (JSONbored#7299) wired
up: contribution-profile-filter, loop-reentry, live-issue-snapshot,
oauth-device-flow, logger, manage-status, contribution-profile-extract,
status. Each file's hand-maintained .d.ts sibling is now tsc-generated
instead. No behavior change; existing tests pass unmodified. Adds two small
regression tests for manage-status.ts's collectManageStatus guard clauses
(invalid_portfolio_queue / invalid_event_ledger), which were previously
untested and would otherwise newly count against this diff's patch coverage
now that the whole file is real, measured TypeScript.

Closes JSONbored#7304
JSONbored pushed a commit to tryeverything24/loopover that referenced this pull request Jul 20, 2026
Converts claim-adjudication, governor-chokepoint-persisted, sentry,
idea-feasibility, rejection-state-machine, attempt-worktree,
portfolio-discovery, and process-lifecycle from plain .js + hand-maintained
.d.ts to real .ts under the existing in-place tsc emit pipeline from JSONbored#7299.
Extends targeted unit tests to drive every converted file to 100%
statement/branch/function/line coverage.
JSONbored pushed a commit to tryeverything24/loopover that referenced this pull request Jul 20, 2026
…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.
loopover-orb Bot pushed a commit that referenced this pull request Jul 20, 2026
…2 of 4, Phase 3) (#7387)

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 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 pushed a commit that referenced this pull request Jul 20, 2026
#7384)

Converts claim-adjudication, governor-chokepoint-persisted, sentry,
idea-feasibility, rejection-state-machine, attempt-worktree,
portfolio-discovery, and process-lifecycle from plain .js + hand-maintained
.d.ts to real .ts under the existing in-place tsc emit pipeline from #7299.
Extends targeted unit tests to drive every converted file to 100%
statement/branch/function/line coverage.
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. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(miner): migrate packages/loopover-miner from plain .js + hand-maintained .d.ts to real TypeScript

1 participant