Skip to content

fix(db): drop the stale migration-90 grandfather entry (its second file was renumbered to 0092) - #9099

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kai392:fix/critical-issue-migration90-grandfather
Jul 26, 2026
Merged

fix(db): drop the stale migration-90 grandfather entry (its second file was renumbered to 0092)#9099
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kai392:fix/critical-issue-migration90-grandfather

Conversation

@kai392

@kai392 kai392 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

KNOWN_MIGRATION_DUPLICATES's [90, {0090_contributor_cap_label.sql, 0090_pull_request_detail_sync_head_sha.sql}]
entry is stale: 0090_pull_request_detail_sync_head_sha.sql was later renumbered to migrations/0092_*,
so only 0090_contributor_cap_label.sql exists at 0090 today. detectMigrationCollisions only consults
the list when a number has >1 file, so this changes no behavior — but it's factually wrong about what's
grandfathered.

  • Removes the [90, …] entry (check-migrations.ts imports this same constant, so both stay in lockstep).
  • Updates the two tests that pin the grandfather set: migration-collisions.test.ts (keys [15,17,74,156],
    plus a new assertion that 90 is no longer grandfathered and 0090's single file is not a collision) and
    check-migrations-script.test.ts (the success summary now reports 4 grandfathered duplicates: 0015, 0017, 0074, 0156).

The four remaining entries (15, 17, 74, 156) all still reference real duplicate files at those numbers.

Test plan

  • npm run db:migrations:check186 migrations OK — contiguous 0001..0182 (4 grandfathered duplicates: 0015, 0017, 0074, 0156)
  • npx vitest run test/unit/migration-collisions.test.ts — 15/15 pass; tsc --noEmit clean
  • Verified no other test/script references the old count/list (grep repo-wide)

Closes #8897

@kai392
kai392 requested a review from JSONbored as a code owner July 26, 2026 17:30
@superagent-security

Copy link
Copy Markdown
Contributor

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

…le was renumbered to 0092)

KNOWN_MIGRATION_DUPLICATES's [90, {0090_contributor_cap_label.sql, 0090_pull_request_detail_sync_head_sha.sql}]
entry is stale: 0090_pull_request_detail_sync_head_sha.sql was later renumbered to 0092, so only
0090_contributor_cap_label.sql exists at 0090 today. detectMigrationCollisions only consults the list when a
number has >1 file, so this changes no behavior — but it's factually wrong about what's grandfathered. Remove
the entry (check-migrations.ts imports this same constant, so both stay in lockstep) and update the pinning
test; the four remaining entries (15, 17, 74, 156) all still reference real duplicate files.

Closes JSONbored#8897

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@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.56%. Comparing base (3c1173e) to head (d8dba76).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9099   +/-   ##
=======================================
  Coverage   90.56%   90.56%           
=======================================
  Files          96       97    +1     
  Lines       22490    22510   +20     
  Branches     3884     3889    +5     
=======================================
+ Hits        20367    20387   +20     
  Misses       1945     1945           
  Partials      178      178           
Flag Coverage Δ
backend 100.00% <ø> (?)

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

Files with missing lines Coverage Δ
src/db/migration-collisions.ts 100.00% <ø> (ø)

@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

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-26 17:38:19 UTC

3 files · 1 AI reviewer · no blockers · readiness 98/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a straightforward correction: removes a stale grandfather entry for migration 90 (since one of its two files was renumbered to 0092, leaving only a single file at 0090) from the shared KNOWN_MIGRATION_DUPLICATES map, and updates the two tests that pin the exact grandfathered set/count. Since detectMigrationCollisions only consults the map when a number has >1 file, this is a documentation/data-accuracy fix with no behavioral change for real inputs, and the new test explicitly proves both 0090 and 0092 remain non-colliding lone entries. The change is well-scoped and the tests are grounded in the real detectMigrationCollisions guard, not fabricated.

Nits — 3 non-blocking

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 #8897
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: 127 registered-repo PR(s), 68 merged, 6 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kai392; Gittensor profile; 127 PR(s), 6 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The PR removes the stale [90, ...] entry from KNOWN_MIGRATION_DUPLICATES, keeps the remaining 15/17/74/156 entries intact, and adds/updates tests confirming migration 90 (and renumbered 92) are treated as single, non-colliding files while updating the dependent check-migrations-script summary test.

Review context
  • Author: kai392
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, Cuda, JavaScript, Kotlin, Perl, TypeScript, Vue
  • Official Gittensor activity: 127 PR(s), 6 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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 9df67ed into JSONbored:main Jul 26, 2026
8 checks passed
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(db): stale KNOWN_MIGRATION_DUPLICATES entry for migration 90 references a file that no longer exists

2 participants