Skip to content

Remove verified-dead exports and orphaned DB tables #4619

Description

@JSONbored

Context

Part of the review-stack architecture audit (parent epic — dead-code dimension). All items below were
individually grep/git-blame-verified as having zero real call sites outside their own declaration and
test files.

# Location What's dead
1 src/db/repositories.ts:4052 countRecentSubmissionsByAuthor() — orphaned by 7501e16a7, which removed its only caller (submissionFloodHit) but missed this helper.
2 src/db/repositories.ts:3552 + src/db/schema.ts:1012 upsertIssueQualityReport() + the issue_quality_reports table (migration 0004_scoring_intelligence.sql) — no reader exists either; the live "issue quality report" feature persists through signal_snapshots via services/issue-quality.ts instead.
3 src/db/repositories.ts:3592 + src/db/schema.ts:1038 persistRegistryDriftEvents() + the registry_drift_events table (same migration 0004) — the live upstream-drift feature (src/upstream/ruleset.ts) uses its own tables instead.
4 review-enrichment/src/analyzers/dependency-scan.ts:437 scanDependencies() — superseded by the descriptor-based registration pattern in analyzers/dependency/descriptor.ts.
5 review-enrichment/src/analyzers/registry.ts:1635 ANALYZER_REGISTRY const — redundant alias of ANALYZERS (the binding actually consumed).
6 src/review/content-lane/registry-logic.ts:34 ISSUE_SUBMISSION_LABELS const — dead since the original 3c4a30b05 import, never wired.
7 src/review/content-lane/registry-logic.ts:84 AI_REVIEW_VERDICTS const — same origin as #6.
8 src/review/repo-doc-render.ts:16 REPO_DOC_TEMPLATE_VERSION const — the actual refresh module does byte-for-byte content diffing instead.
9 src/selfhost/queue-common.ts:601 githubRateLimitAdmissionRemainingFloor() — sibling functions are used, this one never was.
10 src/services/linked-issue-satisfaction-run.ts:181 __linkedIssueSatisfactionRunInternals — tests use the public entrypoint instead.
11 src/settings/pr-type-label.ts:34 and packages/gittensory-engine/src/settings/pr-type-label.ts:34 ALL_TYPE_LABELS const (both copies) — not re-exported from the engine's public index.ts barrel.
12 src/selfhost/cf-workers-shim.ts:12 WorkerEntrypoint class — the file's own comment states the only real import from cloudflare:workers is DurableObject.
13 src/selfhost/cf-workers-shim.ts:18 and test/stubs/cloudflare-workers.ts:21 RpcTarget class (both copies) — same shim-parity pattern as #12.
14 packages/gittensory-engine/src/signals/test-evidence.ts:173 (detectTestConvention) + :133 (TestConvention type) Unit-tested but zero production callers anywhere — sibling exports in the same file (isTestPath, classifyTestCoverage, etc.) ARE live via src/signals/test-evidence.ts's re-export shim; only these two specific exports are dead.

Fix

Delete each. For #2/#3 (orphaned tables), add a new migration dropping the tables — verify no production
data exists in them first (check via the audit-only read against a DB export/staging, not the live
server directly, or coordinate with the maintainer to check production before the migration ships).

Acceptance criteria

  • All 14 items removed with zero behavior change (confirmed via full test suite).
  • Migration dropping issue_quality_reports and registry_drift_events tables, added as a new
    migrations/NNNN_*.sql per repo convention.
  • npm run cf-typegen / any other generated-artifact regen re-run if schema types are affected.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions