tech-debt batch 1: dead-code removal + build/config hygiene (#146/#147/#148)#162
Merged
Conversation
…#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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
lib/ngrid/discoverInterval.ts(185 LOC of completed-RE scaffolding).layoutEngine.tscomputeFitRowHeight+placementRows(superseded bycomputePageFit; keptMIN_ROW_HEIGHT). The onecomputePageFitassertion that lived in a removed test block was relocated, not dropped.intervalParams.tsIntervalGrain/parseGrain/FIFTEEN_MIN_SECONDS+ the unreadgrainreturn field (route already documented?grain=as IGNORED).prediction.tsSeasonOpts.horizonK(self-labeled unused) and the redundantintervalProfile.tsReconcileRowalias.package.jsonprisma:migrate/prisma:dev(no migration files; schema applied viadb push).#147 — tsconfig: enabled
noUnusedLocals/noUnusedParameters/noImplicitReturns; fixed the 3 resulting unused-import errors at the root (no suppressions).#148 — build hygiene: Dockerfile
npm install→npm ci; removed theapp/package-lock.jsonline from.gitignore(the lockfile is tracked and must stay in sync fornpm ci); documentedDATA_DIRin.env.example.Verification (local, CI path)
docker build --target test→ 63 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.next build) → builds clean./api/verifyunaffected. No secret/personal data staged.