Skip to content

fix(db): drop the 2 orphaned scoring-intelligence tables from #4619 - #4676

Merged
JSONbored merged 1 commit into
mainfrom
fix/drop-orphaned-scoring-tables-4619
Jul 10, 2026
Merged

fix(db): drop the 2 orphaned scoring-intelligence tables from #4619#4676
JSONbored merged 1 commit into
mainfrom
fix/drop-orphaned-scoring-tables-4619

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

What

Completes #4619's deferred scope. PR #4666 already removed the other 12 confirmed-dead exports; the
issue_quality_reports/registry_drift_events DB-table drop was deliberately held back pending
confirmation there's no production data, since that can't be verified from the codebase alone.

Confirmed directly against the live production database: both tables have zero rows. Safe to drop.

Both were scaffolded in migration 0004_scoring_intelligence.sql alongside 6 sibling tables
(scoring_model_snapshots, score_previews, contributor_evidence, contributor_scoring_profiles,
burden_forecasts, bounty_lifecycle_events) that all got wired with real read+write paths — these two
alone never did. The "issue quality report" concept now lives entirely in the generic signal_snapshots
cache via src/services/issue-quality.ts instead.

Changes

  • migrations/0141_drop_orphaned_scoring_intelligence_tables.sqlDROP TABLE IF EXISTS for both.
  • src/db/schema.ts — removed the two Drizzle table definitions.
  • src/db/repositories.ts — removed upsertIssueQualityReport/persistRegistryDriftEvents (zero callers
    anywhere) and their now-unused imports.
  • src/types.ts — removed IssueQualityReportRecord/RegistryDriftEventRecord (only ever referenced by
    the two removed functions).
  • test/unit/db-persistence.test.ts — removed the two functions' round-trip coverage from a shared test
    that also exercises other, still-live persistence helpers; kept everything else in that test intact.

Verified zero remaining references to any of these identifiers anywhere in src/, test/, or packages/.

Testing

npm run db:migrations:check and npm run db:schema-drift:check both pass clean (144 contiguous
migrations, schema.ts matches migrations/). test/unit/db-persistence.test.ts (24 tests) passes.
Typecheck clean.

Fixes #4619

issue_quality_reports and registry_drift_events were scaffolded in
0004_scoring_intelligence.sql alongside 6 sibling tables that all got wired
with real read+write paths -- these two alone never did. The "issue
quality report" concept now lives entirely in the generic signal_snapshots
cache via src/services/issue-quality.ts instead.

Confirmed zero rows in both tables on the live production database before
writing this migration. Completes #4619's remaining scope (PR #4666
already shipped the other 12 verified-dead-export removals; this piece was
deliberately deferred pending that confirmation).

Fixes #4619
@JSONbored JSONbored self-assigned this Jul 10, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored
JSONbored merged commit e984eef into main Jul 10, 2026
8 checks passed
@JSONbored
JSONbored deleted the fix/drop-orphaned-scoring-tables-4619 branch July 10, 2026 11:26
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.14%. Comparing base (347ada8) to head (e99ad44).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4676   +/-   ##
=======================================
  Coverage   94.14%   94.14%           
=======================================
  Files         435      435           
  Lines       38576    38566   -10     
  Branches    14060    14060           
=======================================
- Hits        36316    36308    -8     
+ Misses       1601     1599    -2     
  Partials      659      659           
Files with missing lines Coverage Δ
src/db/repositories.ts 96.72% <ø> (-0.01%) ⬇️
src/db/schema.ts 73.07% <ø> (+0.34%) ⬆️
src/types.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Remove verified-dead exports and orphaned DB tables

1 participant