refactor: remove dead code, hollow stubs, and orphaned modules #2
Reference in New Issue
Block a user
Delete Branch "feat/dead-code-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
ai_system,bsi,dashboard,isms_governance,report,service_module) — never imported by any route or service (confirmed via grep)sdk/agents/sessions,sdk/agents/statistics) that only render a "future implementation" placeholder with no wired API/api/sdk/v1/demo/seed,/api/sdk/v1/demo/clear) — never called; real seeding usesapiClient.saveState()alert()stub from the retention page (sdk/einwilligungen/retention)Test plan
ruff check backend-compliance/passespytest compliance/tests/ -xpassesnpx tsc --noEmitpasses inadmin-compliance/npm run buildpasses inadmin-compliance/Notes
models.pyLOC violation (1643 lines, cap 500) is not fixed here —EvidenceConfidenceEnumandEvidenceTruthStatusEnumare defined inline and referenced across routes, repos, and tests. Migrating them is a separate, higher-risk PR.Backend — delete 6 orphaned schema sub-modules never imported by any route: compliance/schemas/{ai_system,bsi,dashboard,isms_governance,report,service_module}.py All symbols were only accessible through the monolithic schemas.py barrel; the split files were never wired up and created misleading import paths. Frontend — delete 2 hollow "future implementation" stub pages: app/sdk/agents/sessions/page.tsx app/sdk/agents/statistics/page.tsx Both showed a static placeholder with no API calls or real functionality. Frontend — delete dead demo seed/clear API routes: app/api/sdk/v1/demo/{seed,clear}/route.ts Used a global in-memory store never connected to PostgreSQL. The actual demo seeding (lib/sdk/demo-data/) goes through the real state API (apiClient.saveState/deleteState), not these routes. Frontend — remove unimplemented PDF export alert from retention page: app/sdk/einwilligungen/retention/page.tsx Removed the PDF button and alert('PDF-Export wird noch implementiert.') stub. CSV and JSON export remain fully functional. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>