SAFE TS/JS Cleanup Plan (No Deletions Yet)
Date: 2026-03-06
Input: TS_JS_DUPLICATION_TABLE_2026-03-06.tsv and runtime-entrypoint scan
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
Input: TS_JS_DUPLICATION_TABLE_2026-03-06.tsv and runtime-entrypoint scan
packages/identity-infra is started directly from TS source:
package.json -> "start": "tsx src/index.ts"package.json -> dev:identity calls packages/identity-infra dev script.apps/web consumes source packages directly:
apps/web/next.config.js -> transpilePackages: ["@kvary/core", "@kvary/ai-layer", "@kvary/memory-layer"]../../packages/core, ../../packages/ai-layer, ../../packages/memory-layer.services/api imports many @kvary/core/* subpaths.scripts/*.js import packages/financial-layer/.../*.js directly.These already use dist-based package outputs and can adopt strict "TS source -> dist build" without runtime migration:
packages/carbon-domainpackages/identity-domainpackages/kyc-domainpackages/policy-domainpackages/rbac-domainpackages/risk-domainpackages/stakeholder-domainpackages/tender-domainThese are currently source-consumed or have direct JS runtime coupling:
packages/ai-layer
main/exports point to src/index.ts, tsconfig has noEmit: true.packages/memory-layer
main/exports point to src/index.ts, tsconfig has noEmit: true.packages/identity-infra
main/exports point to src/index.ts, runtime starts via tsx src/index.ts.packages/core
main: "index.ts", no package-level build pipeline file currently.packages/financial-layer
package.json; direct require("../packages/financial-layer/.../*.js") from scripts.SAFE_DELETE_AFTER_BUILD_STRICT_2026-03-06.txt (120 files)docs/90_stabilization/SAFE_DELETE_AFTER_BUILD_STRICT_2026-03-06.txtBreakdown:
services/api: 43services/svc-auth: 19services/svc-tenders: 7services/svc-kyc: 7services/svc-carbon: 6services/svc-risk: 5packages/identity-domain: 7packages/rbac-domain: 6packages/carbon-domain: 5packages/tender-domain: 4packages/stakeholder-domain: 4packages/kyc-domain: 3packages/risk-domain: 2packages/policy-domain: 2MANUAL_VERIFICATION_REQUIRED_STRICT_2026-03-06.txt (175 files)docs/90_stabilization/MANUAL_VERIFICATION_REQUIRED_STRICT_2026-03-06.txtBreakdown:
packages/core: 97packages/financial-layer: 27packages/identity-infra: 21packages/ai-layer: 21packages/memory-layer: 6scripts/verify-governance-consistency.js: 1scripts/golden.js: 1tests/governance: 1Commit 1: chore(stabilization): lock in deletion candidates and manual verification sets
docs/90_stabilization/SAFE_DELETE_AFTER_BUILD_STRICT_2026-03-06.txtdocs/90_stabilization/MANUAL_VERIFICATION_REQUIRED_STRICT_2026-03-06.txtCommit 2: build(packages): add dist pipeline for ai-layer and memory-layer
tsconfig -> rootDir: "src", outDir: "dist", declaration: true, noEmit: false."build": "tsc --project tsconfig.json".main/types/exports from src/* to dist/*.Commit 3: build(core): introduce package build pipeline and dist exports
packages/core/tsconfig.json.build script.main to dist/index.js, types to dist/index.d.ts, define exports map.Commit 4: runtime(identity-infra): dual-run mode before final switch
dist output for identity-infra.dev on tsx for local velocity.start on node dist/index.js.tsx src/index.ts path until smoke test passes.Commit 5: runtime(financial-layer): create package boundary and stop direct .js requires
packages/financial-layer/package.json + tsconfig.../packages/financial-layer/.../*.js.Commit 6: refactor: redirect imports to canonical ts/dist modules
.js imports where found.Commit 7: chore(cleanup): mark runtime-stable js duplicates for removal
SAFE_DELETE_AFTER_BUILD_STRICT_2026-03-06.txt after successful build + smoke.Commit 8: chore(cleanup): manual-reviewed removals for migrated packages
MANUAL_VERIFICATION_REQUIRED_STRICT_2026-03-06.txt package-by-package only after each migration passes.