Skip to content

fix(miner): drop stale ProcessEnv casts on resolveReplaySnapshotDbPath - #8755

Closed
philluiz2323 wants to merge 1 commit into
JSONbored:mainfrom
philluiz2323:fix/8642-replay-snapshot-resolver-casts
Closed

fix(miner): drop stale ProcessEnv casts on resolveReplaySnapshotDbPath#8755
philluiz2323 wants to merge 1 commit into
JSONbored:mainfrom
philluiz2323:fix/8642-replay-snapshot-resolver-casts

Conversation

@philluiz2323

Copy link
Copy Markdown
Contributor

Summary

  • Remove stale not yet migrated comments and NodeJS.ProcessEnv casts around resolveReplaySnapshotDbPath in migrate-cli.ts and status.ts.
  • Call the resolver directly — its real type is already Record<string, string | undefined>, matching sibling store resolvers.

Closes #8642

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
  • npx tsc -p packages/loopover-miner/tsconfig.json --noEmit (exit 0 after cast removal)
  • npm run actionlint — not applicable
  • npm run typecheck — covered by focused miner tsc above
  • npm run test:coverage — not required (type/comment-only; no new runtime branch per issue)
  • npm run test:workers — not applicable
  • npm run build:mcp — not applicable
  • npm run test:mcp-pack — not applicable
  • npm run ui:openapi:check — not applicable
  • npm run ui:lint — not applicable
  • npm run ui:typecheck — not applicable
  • npm run ui:build — not applicable
  • npm audit --audit-level=moderate — not applicable
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Issue Test Coverage Requirements: type-level/comment fix with no behavioral change; verification is tsc passing with casts removed.

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

Not applicable — miner type/comment cleanup only.

Notes

The resolver already types env as Record<string, string | undefined>; remove the outdated not-yet-migrated comments and casts at both migrate-cli and status call sites.

Closes JSONbored#8642
@philluiz2323
philluiz2323 requested a review from JSONbored as a code owner July 26, 2026 03:16
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.63%. Comparing base (c8eed4c) to head (45646aa).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8755      +/-   ##
==========================================
- Coverage   93.80%   90.63%   -3.17%     
==========================================
  Files         797       98     -699     
  Lines       79493    22700   -56793     
  Branches    24085     3962   -20123     
==========================================
- Hits        74567    20575   -53992     
+ Misses       3555     1945    -1610     
+ Partials     1371      180    -1191     
Flag Coverage Δ
backend 99.04% <ø> (+3.96%) ⬆️

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/migrate-cli.ts 100.00% <ø> (ø)
packages/loopover-miner/lib/status.ts 98.83% <ø> (ø)

... and 699 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 26, 2026
@loopover-orb

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-26 03:22:59 UTC

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

🛑 Suggested Action - Fix Blockers

Review summary
This is a narrow, correct type-cleanup: removes the `NodeJS.ProcessEnv` casts and stale comments around `resolveReplaySnapshotDbPath` in both call sites, relying on its real parameter type already matching `Record<string, string | undefined>`. The full-file content confirms both call sites now pass `env`/`env: Record<string, string | undefined>` directly with no remaining cast, and the diff removes no logic — this is a pure type/comment change with no behavioral impact. The PR correctly links Closes #8642 and the description accurately matches the diff.

Nits — 4 non-blocking
  • packages/loopover-miner/lib/status.ts still has an analogous `as NodeJS.ProcessEnv` cast for `hasGitHubTokenSource` a few lines below the removed one (not touched by this diff) — worth a follow-up if that resolver's real type has also since converged, but out of scope here.
  • No test changes accompany this PR, but that's reasonable given it's a type/comment-only diff with `tsc` as the stated verification.
  • Consider a quick grep across the miner package for any other lingering `as NodeJS.ProcessEnv` casts (e.g. `hasGitHubTokenSource` in status.ts) to fully close out the underlying type-migration in one follow-up.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.

CI checks failing

  • validate
  • validate-code

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 #8642
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: 1025 registered-repo PR(s), 601 merged, 126 issue(s).
Contributor context ✅ Confirmed Gittensor contributor philluiz2323; Gittensor profile; 1025 PR(s), 126 issue(s).
Improvement ℹ️ None detected risk: low · value: none · LLM: minor
Linked issue satisfaction

Addressed
The diff removes the stale 'not yet migrated' comments and NodeJS.ProcessEnv casts at both call sites in migrate-cli.ts and status.ts, calling resolveReplaySnapshotDbPath directly as required, and the PR description reports a passing tsc run confirming no new type errors.

Review context
  • Author: philluiz2323
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, MDX, TypeScript, CSS, Cuda, HTML, Kotlin
  • Official Gittensor activity: 1025 PR(s), 126 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
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 26, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-code)). 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(miner): remove stale 'not yet migrated' type-cast comments for resolveReplaySnapshotDbPath in migrate-cli.ts and status.ts

1 participant