chore(miner): add a real tsc build pipeline for loopover-miner (#7290) - #7299
Conversation
…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).
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-19 15:14:53 UTC
Review summary Nits — 6 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk 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.
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.
|
… 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.
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
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.
…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.
…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.
#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.
Summary
.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 realtscbuild pipeline topackages/loopover-miner(mirroring how@loopover/enginealready 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").lib/pr-number-parse.js+ its hand-maintained.d.ts, to reallib/pr-number-parse.ts. Every other file inbin//lib/is untouched and stays hand-maintained.js+.d.tsfor now.lib/foo.ts→lib/foo.js, same path), so the package's publishedbin/liblayout and every consumer's import path (in this repo and fornpm install -g @loopover/minerusers) 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..tssource (verified locally: the lcov report attributes 100% line/branch coverage topr-number-parse.ts, not the compiled.js), so Codecov patch coverage measures the real source correctly..tssource (only compiled.js/.d.tsship), matching today's distribution shape exactly — verified vianpm 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
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally — full unsharded run passes;pr-number-parse.tsis at 100% line and branch coverage (all 6 existing unit tests for it pass unmodified against the compiled output)npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderate— 2 pre-existing high-severity findings ingithub-actionlint'sadm-ziptransitive dependency (no fix available upstream), unrelated to this change and already present onmaintest/unit/miner-pr-number-parse.test.tssuite (already at 100% branch coverage of the function) continues to pass unmodified against the compiled artifact. Updatedtest/unit/miner-package-skeleton.test.ts's assertion on thebuildscript's expected prefix to match the newtsc -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 UI Evidence section — this PR has no visible UI/frontend/docs surface.
Notes
tsconfig.jsonintentionally does not includepackages/loopover-miner/lib— mirroring howpackages/loopover-engineis also type-checked entirely through its own package-leveltsconfig.json/buildscript rather than through the root config.