Skip to content

tech-debt batch 1: dead-code removal + build/config hygiene (#146/#147/#148)#162

Merged
delabrcd merged 1 commit into
mainfrom
tech-debt/batch-1-cleanup
Jun 22, 2026
Merged

tech-debt batch 1: dead-code removal + build/config hygiene (#146/#147/#148)#162
delabrcd merged 1 commit into
mainfrom
tech-debt/batch-1-cleanup

Conversation

@delabrcd

Copy link
Copy Markdown
Owner

Tech-debt batch 1 of the June 2026 cleanup sweep (epic #161). Low-risk, no runtime behavior change — confirmed-dead-code removal + build/config hygiene.

Closes #146, closes #147, closes #148.

What changed

#146 — dead code (verified zero callers):

  • Deleted lib/ngrid/discoverInterval.ts (185 LOC of completed-RE scaffolding).
  • Removed layoutEngine.ts computeFitRowHeight + placementRows (superseded by computePageFit; kept MIN_ROW_HEIGHT). The one computePageFit assertion that lived in a removed test block was relocated, not dropped.
  • Removed intervalParams.ts IntervalGrain/parseGrain/FIFTEEN_MIN_SECONDS + the unread grain return field (route already documented ?grain= as IGNORED).
  • Removed prediction.ts SeasonOpts.horizonK (self-labeled unused) and the redundant intervalProfile.ts ReconcileRow alias.
  • Removed package.json prisma:migrate/prisma:dev (no migration files; schema applied via db push).

#147 — tsconfig: enabled noUnusedLocals / noUnusedParameters / noImplicitReturns; fixed the 3 resulting unused-import errors at the root (no suppressions).

#148 — build hygiene: Dockerfile npm installnpm ci; removed the app/package-lock.json line from .gitignore (the lockfile is tracked and must stay in sync for npm ci); documented DATA_DIR in .env.example.

Verification (local, CI path)

  • docker build --target test63 files / 921 tests passed (921 vs prior 930 = 9 dead test cases for the removed code; no assertions deleted to pass).
  • tsc --noEmit (prisma generate + tsc) → clean with the 3 new strict flags.
  • production builder stage (next build) → builds clean.
  • No numeric/scraper logic touched → /api/verify unaffected. No secret/personal data staged.

…#148)

No runtime behavior change — dead-code removal plus build/config hygiene.

#146 Remove confirmed-dead code (verified zero production callers; dead
test blocks and stale comments removed alongside):
- lib/ngrid/discoverInterval.ts: delete the whole file (zero importers).
- lib/layoutEngine.ts: drop computeFitRowHeight + placementRows; keep
  MIN_ROW_HEIGHT (used by computePageFit). Fix the module header + the
  rows->pixels comment that named computeFitRowHeight.
- lib/intervalParams.ts: drop IntervalGrain, parseGrain, FIFTEEN_MIN_SECONDS
  and the grain field of parseIntervalQuery (routes destructure only
  fuelType/window/bucket); note in the route doc that ?grain is no longer
  parsed.
- lib/prediction.ts: drop the unused SeasonOpts.horizonK field.
- lib/intervalProfile.ts: drop the redundant ReconcileRow alias and use
  IntervalProfileRow directly in reconcileToHourly.
- package.json: drop prisma:migrate / prisma:dev (no migration files;
  schema applied via prisma db push).
- Prune the matching describe()/it() blocks in the two test files
  (preserving the computePageFit assertion that shared a block).

#147 tsconfig strictness: enable noUnusedLocals, noUnusedParameters,
noImplicitReturns. Fix the three resulting unused-import/const errors at
the root (removed dead imports STRIP_KEY in WidgetLayout, Legend in
VizCharts, and the unused SKY constant in VizCharts).

#148 Build hygiene:
- Dockerfile deps stage: npm install -> npm ci (lockfile is tracked).
- .gitignore: stop ignoring app/package-lock.json (it is tracked and must
  stay in sync for reproducible npm ci).
- .env.example: document DATA_DIR (container data root for session +
  secret.key, bill PDFs, and backups; default /data).

Verified via the Docker test stage: 63 files / 921 tests pass; tsc
--noEmit clean (the CI lint path: prisma generate then tsc).
@delabrcd delabrcd merged commit 3cc2e13 into main Jun 22, 2026
6 checks passed
@delabrcd delabrcd deleted the tech-debt/batch-1-cleanup branch June 22, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant