Skip to content

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

Description

@JSONbored

⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.

Context

packages/loopover-miner/lib/migrate-cli.ts:64-67 and packages/loopover-miner/lib/status.ts:401-402
both carry a comment and a type cast claiming resolveReplaySnapshotDbPath's .d.ts still types
its env parameter as NodeJS.ProcessEnv ("not yet migrated"), and cast around that supposed
mismatch.

This is no longer true. packages/loopover-miner/lib/replay-snapshot.ts:64 has typed env as
Record<string, string | undefined> — matching every sibling resolver — since commit 321a734b7,
which landed the same day as (and after) the migrate-cli.ts comment was written, and before the
same stale comment was copied into status.ts a day later. The casts are harmless no-ops today,
but the comments actively mislead a future contributor into thinking a real type inconsistency
still exists in this file, potentially causing wasted investigation time or a defensive workaround
for a problem that no longer exists.

Requirements

  • Remove the now-unnecessary type casts and their accompanying "not yet migrated" comments at both
    call sites (migrate-cli.ts:64-67 and status.ts:401-402), calling
    resolveReplaySnapshotDbPath(env) directly with no cast, since env's real type
    (Record<string, string | undefined>) already matches what both call sites pass.
  • Confirm via tsc (part of the existing npm run typecheck) that removing the cast introduces no
    new type error at either call site.

Deliverables

  • packages/loopover-miner/lib/migrate-cli.ts's call to resolveReplaySnapshotDbPath no longer
    has a type cast or a "not yet migrated" comment.
  • packages/loopover-miner/lib/status.ts's call to resolveReplaySnapshotDbPath no longer has a
    type cast or a "not yet migrated" comment.
  • npm run typecheck passes with both casts removed (no new error surfaces).

All Deliverables above are required in the same PR.

Test Coverage Requirements

This is a type-level/comment-accuracy fix with no behavioral change — no new runtime branch is
introduced, so no new test is required. npm run typecheck passing with the casts removed is the
verification for this issue.

Expected Outcome

Neither call site claims a type mismatch that no longer exists; both call
resolveReplaySnapshotDbPath with its real, already-correct type, with no misleading comment for a
future reader.

Links & Resources

  • packages/loopover-miner/lib/migrate-cli.ts:64-67
  • packages/loopover-miner/lib/status.ts:401-402
  • packages/loopover-miner/lib/replay-snapshot.ts:64 (the already-correct type to trust)
  • Fixed by commit 321a734b7, whose fix these two comments never caught up to

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions