TS/JS Duplication Stabilization Report
Date: 2026-03-06
Scope: TypeScript/JavaScript duplication cleanup only (safe mode)
Safety posture: no deletions, no entrypoint/port/URL changes
Resolving locale, route permissions, and workspace projection.
Current scope: Guest
Category: 90_stabilization | Version: v1.0.0
Owner: DOCUMENT_CUSTODIAN | Review cycle: 90 days
Approval authority: Unspecified
Documentation portal is read-only. Editing and mutation endpoints are disabled.
Kvary platform is originally created in Georgian. Where a Georgian version exists, Georgian is authoritative for platform UI, documentation, and legal interpretation.
Translations into other languages are provided for convenience. Some records may originate in other languages and carry their own source or legal locale for a specific flow, but where a Georgian version is available, the Georgian version prevails for platform-level wording and interpretation.
Metadata incomplete: Document ID, Version, Status, Owner Role, Last Review Date, Next Review Date, Change Log
Date: 2026-03-06
Scope: TypeScript/JavaScript duplication cleanup only (safe mode)
Safety posture: no deletions, no entrypoint/port/URL changes
Total TS/JS duplicate pairs detected: 295
Full duplication map:
Sample high-value clusters:
| Cluster ID | TS file | JS file | Import locations | Used by runtime? | Risk |
| --- | --- | --- | --- | --- | --- |
| C001 | services/svc-auth/src/security/jwt.ts | services/svc-auth/src/security/jwt.js | services/svc-auth/src/server.ts imports ./security/jwt | Yes (service runtime path) | High |
| C002 | services/svc-auth/src/security/password.ts | services/svc-auth/src/security/password.js | services/svc-auth/src/server.ts imports ./security/password | Yes | High |
| C003 | services/api/src/routes/tenders.ts | services/api/src/routes/tenders.js | services/api/src/server.ts mounts tendersRouter | Yes | High |
| C004 | services/api/src/routes/auctions.ts | services/api/src/routes/auctions.js | services/api/src/server.ts mounts auctionsRouter | Yes | High |
| C005 | services/svc-tenders/src/server.ts | services/svc-tenders/src/server.js | services/svc-tenders/package.json (dev ts, start dist) | Yes | Medium |
| C006 | packages/ai-layer/src/index.ts | packages/ai-layer/src/index.js | apps/web/src/app/api/ai/ask/route.ts imports @kvary/ai-layer | Yes | High |
| C007 | packages/memory-layer/src/index.ts | packages/memory-layer/src/index.js | apps/web/src/app/api/ai/ask/route.ts imports @kvary/memory-layer | Yes | High |
| C008 | packages/core/index.ts | packages/core/index.js | used via @kvary/core and core compat paths | Yes | High |
Heuristic used:
.ts exists, treat TS as canonical source.dist and starts from dist, src/*.js is candidate artifact.src/*.ts, duplicate src/*.js is treated as UNKNOWN.Classification totals:
SAFE_TO_REMOVE_JS: 147UNKNOWN: 148RUNTIME_JS: 0 detected explicitlyNotes:
services/* pairs were classified as SAFE_TO_REMOVE_JS (builds to dist, starts from dist, dev runs TS entrypoint).packages/ai-layer, packages/memory-layer, packages/identity-infra, and packages/core were kept UNKNOWN due active src-based runtime/export patterns.Checks performed:
*.js in TS sourcesnode src/*.jsnode dist/server.js) and dev scripts (ts-node(-dev)/tsx TS entrypoints)Result:
RUNTIME_JS_DEPENDENCY detected via source/package-script scan.dist/*.jsts-node-dev, ts-node, tsx)Reference:
Added "rootDir": "src" (while keeping existing "outDir": "dist") to:
services/api/tsconfig.jsonservices/svc-auth/tsconfig.jsonservices/svc-tenders/tsconfig.jsonservices/svc-risk/tsconfig.jsonservices/svc-kyc/tsconfig.jsonservices/svc-carbon/tsconfig.jsonNo boot logic changed.
No safe redirects applied in this pass because:
src/*.js import targets were found in TS code paths.For services/*/src/*.js files that have sibling .ts canonical files, header added:
// @deprecated duplicate JS build artifact
// canonical source: file.ts
Marked files in services: 87
No deletions were performed.
Candidate list generated only (not removed):
Candidates count: 147
Produced outputs:
TSV)chore(stabilization): add TS/JS duplication analysis artifactschore(build): add rootDir=src to service tsconfigs with outDir=distrefactor(stabilization): mark service src JS duplicates as deprecated artifactschore(stabilization): add runtime-js dependency report + safe-removal dry-run listchore(stabilization): manual removal (optional, only after build/runtime parity check)UNKNOWN clusters were intentionally not touched beyond reporting.