Files
marketplaces/docs/archive/CLEANUP_REPORT.md
sdarbinyan 5374401257 docs: consolidate documentation and archive temporary reports
Step 1-2 (audit + plan): classified 35 project markdown files into
Core/Architecture/ADR/Temporary-audit/Sprint-report/Generated-review/
Duplicate/Obsolete/Historical. Agent-tooling files (.agents/skills/**,
.superpowers/**, docs/context/**, CLAUDE.md/GEMINI.md/AGENTS.md/
.github/copilot-instructions.md) explicitly out of scope — intentional
per-tool duplication, not documentation debt.

Step 3 (merge, no information lost):
- docs/PROJECT.md -> docs/PROJECT_INDEX.md, rewritten as the single
  entry point: system overview, living-doc index, archive pointer,
  current status, and a critical-finding callout up top.
- docs/backend/BACKEND-INTEGRATION.md -> docs/BACKEND_API.md,
  docs/backend/REMAINING-BACKEND-WORK.md ->
  docs/BACKEND_API_REMAINING_WORK.md (also folded in a legitimate
  uncommitted status update that had been sitting unstaged all
  session: categories marked DONE, order-creation endpoint noted done).
- RELEASE-NOTES.md merged into CHANGELOG.md (was a near-duplicate of
  the same release content in friendlier prose), then deleted.
- KNOWN-ISSUES.md: added item 13 (see below) and item 14 (missing
  canDeactivate on admin/products edit, from the archived PROJECT-STATE
  audit, re-verified still true); added a correction note to Fixed
  item 7.
- All cross-references to renamed/moved files fixed across every
  kept doc (grep+sed pass, then verified with a link-existence check
  across all 58 in-scope markdown files -> 0 broken links).

Step 4 (archive, nothing deleted without merging first): created
docs/archive/, moved 19 files there (3 root sprint reports, 1 platform
report, SPRINT-PLAN.md, and 14 one-off audit/review/report docs).
Added correction headers to the 3 archived docs whose conclusions were
affected by the finding below, rather than silently leaving them
misleading.

Step 5: docs/PROJECT_INDEX.md rewritten per the mission brief -
someone opening the repo should understand the whole system from it.

IMPORTANT FINDING (surfaced during this audit, not the mission's
primary goal but too significant to bury): pages/category/*,
pages/search/*, pages/item-detail/*, pages/info/**, pages/legal/**
(40+ files) are entirely unrouted dead code - app.routes.ts's
cmsContentRoutes is a literal empty array, and category/search/product
routes redirect to CatalogContainerComponent/
ProductDetailsContainerComponent, not these files. Confirmed against
app.routes.ts directly and cross-checked against FRONTEND.md's own
routing description. This means several fixes from earlier this cycle
(RC-Premium-01, RC STORE-01) and the dead-code cleanup sprint's
conclusion that these files were live were all wrong - documented as
KNOWN-ISSUES.md item 13, flagged at the top of PROJECT_INDEX.md, and
noted on the 3 archived docs whose conclusions it affects. No
application code was changed to fix this (out of scope per this
session's 'documentation only' constraint) - it needs a wire-it-up-or-
delete-it decision first.

Verification: tsc --noEmit clean, npm run build green, all markdown
links across 58 in-scope files resolve (checked programmatically).
No application/Angular/backend code modified.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-25 19:10:49 +04:00

6.6 KiB

Cleanup Report

Archived, correction (2026-07-25): this pass concluded pages/category, pages/search, pages/info/**, pages/legal/**, pages/item-detail were live/routed and kept them — that conclusion was wrong. A later documentation-consolidation pass confirmed directly against app.routes.ts that all of these are genuinely unrouted dead code (cmsContentRoutes is a literal empty array). See docs/KNOWN-ISSUES.md item 13. Kept here for historical accuracy of the process description (the false-positive root-cause analysis re: knip's blind spot is still useful) — the conclusion about these files being "correctly kept" is superseded.

App-wide dead-code sweep: dead components/services/routes/CSS, duplicate models/interfaces, unused imports/variables/assets/icons/SCSS/directories/modules. Business logic untouched — deletion only, no refactoring. One commit on branch B2B (not pushed): e0bcf9d.

Important note on process

The first attempt at this task was interrupted mid-run (hit a usage-limit cutoff) and left an uncommitted, unverified mass-deletion staged: 117 files, ~11,373 lines, including pages/category, pages/search, pages/info/**, pages/legal/**, pages/item-detail — all real, live, routed storefront pages (category/search were fixed for accessibility/skeleton bugs earlier in this same work cycle). This was caught before commit and fully reverted (git restore) — verified clean via tsc --noEmit afterward. The retry used a stricter standard: every deletion candidate had to be manually verified against app.routes.ts/DI registries/cross-repo grep before deletion, not just trusted from a dead-code tool's raw output, and every batch was build-verified immediately rather than at the end.

Root cause: knip repeatedly flagged the entire pages/category/pages/search/pages/info/**/pages/legal/**/pages/item-detail tree as unused, both times it was run. This is a confirmed false-positive blind spot in this codebase — likely the locale-nested component pattern (xxx-en.component.ts under an en/ subfolder, loaded via a runtime locale switch rather than a static import knip can trace) combined with lazy loadComponent route bindings. Anyone running knip on this repo in the future should cross-check its pages/** output against app.routes.ts before trusting it — it is not reliable for this specific pattern.

Deleted (26 files, e0bcf9d)

Category What Verification evidence
Auth core/auth/guards/ed25519-auth.guard.ts, permission.guard.ts, core/auth/interceptors/auth.interceptor.ts ed25519AuthGuard appears only inside a doc-comment in admin-login-page.component.ts; authInterceptor absent from app.config.ts's withInterceptors([...]); neither imported anywhere else.
Search features/search/services/search-analytics.service.ts, features/search/components/empty-results/* SearchAnalyticsService has zero importers; app-search-empty-results selector unused — search-bar.component.html implements its own inline @if (noResults) empty state instead.
Content management features/content-management/pages/content-management-page.component.ts Thin wrapper around StaticPagesEditorComponent, zero route in app.routes.ts. Rest of content-management/* (facade, static-pages-editor, page-editor) kept — used by project-editor.
Backoffice scaffolding features/backoffice/{categories,customers,inventory,orders,products,settings}, features/backoffice/shared/backoffice-coming-soon-page.component.* Re-verified docs/UI-COMPOSITION-REVIEW.md's claim independently: app.routes.ts backoffice section only loads features/admin/* and features/backoffice/media. Each of the 6 deleted dirs contained only a placeholder .gitkeep from the original scaffold commit — never real components. The prior audit's "duplicate implementation" framing was itself stale; corrected here.
Shared barrels/models shared/index.ts, shared/models/index.ts, shared/types/index.ts, shared/models/domain/** (incl. user-preferences.model.ts) Unused barrels/model, zero importers.
Orphaned page pages/public/platform-home.component.ts No route, no import anywhere — distinct from the routed pages/category etc. that were correctly left alone.
Mock data assets/mock/backoffice/{customers,orders}/list.json Orphaned — BackofficeDataProvider only exposes loadProducts()/loadCategories().

Flagged, NOT deleted (verified as false positives or out of scope)

  • pages/category, pages/search, pages/info/**, pages/legal/**, pages/item-detail — knip's recurring false-positive (see Root cause above). All confirmed live and routed. Note: docs/STORE_REVIEW.md had previously flagged item-detail specifically as "confirmed dead code (unrouted)" during RC STORE-01 — that assessment needs re-verification against app.routes.ts given this tool's now-confirmed blind spot on this exact directory pattern; not re-checked in this pass, flagged for the next person touching that area.
  • SearchHistoryService — knip flagged it, but it's actively injected in search.facade.ts. Another confirmed false positive.
  • primeng/primeicons/barry-cache — knip flagged as unused dependencies. Not verified further here; primeng/primeicons removal is already tracked in docs/KNOWN-ISSUES.md (item 12) blocked on an unrelated npm uninstall failure. barry-cache is the repo's own memory tooling, out of scope for a dead-code pass regardless.
  • 123 "unused exports/types" flagged by knip — left alone. This is TypeScript interface/type surface cleanup, not dead files; a different, lower-risk category that wasn't prioritized in this pass given the tool's demonstrated unreliability here — recommend manual review, not knip's raw list, if pursued later.
  • 5 branding SVGs (mastercard-logo.min.svg, dexar-logo*.svg, dexar-favicon.svg, novo-logo.svg, novo-favicon.svg) — flagged in docs/PERFORMANCE_REPORT.md as possibly backend/tenant-driven, not statically referenced. Not touched, per that report's own caution.

Verification

tsc --noEmit clean after every deletion batch (not just at the end — batches were verified incrementally so a bad deletion could be isolated and reverted immediately rather than debugged after the fact). npm run build green (only the pre-existing bundle-budget warning). npm run arch:check:boundaries and arch:check:cycles both pass (435 files processed, no circular dependencies). Working tree clean aside from the pre-existing unrelated docs/backend/REMAINING-BACKEND-WORK.md modification, untouched.