Skip to content

G-28: clear unused-var lint debt and fix exposed defects - #122

Merged
dmuhoro merged 2 commits into
mainfrom
feat/s104-g28-lint-debt
Dec 2, 2026
Merged

dmuhoro merged 2 commits into
mainfrom
feat/s104-g28-lint-debt

Conversation

@dmuhoro

@dmuhoro dmuhoro commented Dec 2, 2026

Copy link
Copy Markdown
Owner

G-28 — clear unused-var lint debt and fix the defects it exposed

Stacked on #121 (G-27). Merge #121 first; this branch then collapses to the G-28 diff. Opened against main because the CI workflow only triggers when the PR base is main/master.

Result

  • ESLint: 106 → 0 warnings (0 errors both before and after).
  • lint:cycles: 0 errors; no-orphans 13 → 6 (graph strengthened with tsPreCompilationDeps).
  • Vitest: 138 files / 759 tests (was 137 / 756).
  • Typecheck 0, boundary audit 0, QA runner pass, Expo web export pass.

What the 106 warnings actually were

96 were dead code (unused imports, unused catch bindings, unused locals/destructures, and an unreachable success overlay). Ten exposed real defects, each fixed at source with a test that fails without the fix:

  1. src/domain/learning/prerequisites.ts — paths() ignored its current set; cyclic edges recursed unbounded. Added a cycle guard.
  2. src/runtime/runtimeGovernor.ts — ownership query error was ignored (could read as a pass). Now fails closed.
  3. lib/analytics.ts — queued event user_id was discarded; delayed flushes were attributed to the wrong user. Now keeps the event owner.
  4. lib/knowledgeGraphEngine.ts — active-path query error ignored. Now returns null.
  5. lib/privacy/consent.ts — recordAgeVerification(age) discarded/unvalidated age. Now validates and stores only the flag.
  6. lib/adaptiveCurriculumEngine.ts — estimateTimeToGoal returned a fixed confidence: 0.85 and ignored learnerId. Now derives confidence from observed mastery.
  7. components/QuizEngine.tsx — setMasteryLevel was never called, pinning difficulty at "medium" for every learner. Now seeds from stored topic mastery.

Removed rather than silenced

  • Archived the unreferenced duplicate components/ProfileSwitcher.tsx (git mv to archive/).
  • Removed three callerless prefetch() no-op stubs that claimed a capability the code did not provide.

Remaining orphan warnings (documented, not deleted)

6 modules have no production importer (test-only or unwired): socratic.ts, diagnostic.ts, adaptive-progression.ts, curriculum/types.ts, payments/paymentProvider.ts, lib/network.ts. Recorded in the evidence file, not deleted, so the gap stays visible.

Evidence: docs/evidence/sprint104-g28-lint-debt.md.

Remove all 106 @typescript-eslint/no-unused-vars warnings: 96 were dead
bindings/imports/catch clauses and an unreachable success overlay; ten exposed
real defects fixed at source with failing-first tests.

- prerequisites: add the missing cycle guard in paths()
- runtimeGovernor + knowledgeGraphEngine: fail closed on query errors
- analytics: keep the queued event's own user_id on delayed flush
- consent: validate age in recordAgeVerification, store only the flag
- adaptiveCurriculumEngine: derive confidence from observed mastery
- QuizEngine: seed difficulty from stored topic mastery, not a pinned 50
- archive unreferenced duplicate ProfileSwitcher; drop callerless prefetch stubs
- strengthen dependency graph (tsPreCompilationDeps); orphans 13 -> 6 documented

Gates: lint 0/0, typecheck 0, 138 files / 759 tests, boundary 0, QA pass,
web export pass.
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
easytutor Ready Ready Preview Dec 2, 2026 6:08pm UTC

@dmuhoro
dmuhoro merged commit 7b5004f into main Dec 2, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview – easytutor — 7b5004f5 Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant