Web core alias stabilization report
Date: 2026-03-06
Scope
Stabilization of apps/web resolution for @kvary/core and @kvary/core/*.
Files analyzed:
apps/web/tsconfig.jsonapps/web/next.config.js- root
tsconfig.json
Current behavior before change
TypeScript
apps/web/tsconfig.json had raw workspace source mappings:
@kvary/core/governance -> ../../packages/core/governance/index.ts@kvary/core/* -> ../../packages/core/*
This meant web type resolution depended on the source layout of packages/core, not on the package boundary or package exports.
Next.js / bundler
apps/web/next.config.js had explicit source aliases:
- webpack alias:
@kvary/core -> ../../packages/core - turbopack alias:
@kvary/core -> ../../packages/core
This meant runtime/bundler resolution also bypassed package exports and depended on raw workspace layout.
Root tsconfig
Root tsconfig.json still contains:
@kvary/core/governance -> packages/core/governance/index.ts@kvary/core/* -> packages/core/*
That file is not consumed by apps/web/tsconfig.json via extends, so it does not control the web app directly in this step.
Resolution map
| Consumer | Import path | Previous resolution | Current resolution | Classification |
| --- | --- | --- | --- | --- |
| apps/web/src/app/[locale]/(portal)/kes/HashVerificationPanel.tsx | @kvary/core/governance | TS path + Next alias to source | package export to packages/core/dist/governance/index.d.ts | PACKAGE_EXPORT_RESOLUTION |
| apps/web/src/app/[locale]/(portal)/kes/SigningSlotPanel.tsx | @kvary/core/governance | TS path + Next alias to source | package export to packages/core/dist/governance/index.d.ts | PACKAGE_EXPORT_RESOLUTION |
| apps/web/src/app/[locale]/(portal)/kes/page.tsx | @kvary/core/governance | TS path + Next alias to source | package export to packages/core/dist/governance/index.d.ts | PACKAGE_EXPORT_RESOLUTION |
| apps/web/src/app/[locale]/[country]/(portal)/kes/HashVerificationPanel.tsx | @kvary/core/governance | TS path + Next alias to source | package export to packages/core/dist/governance/index.d.ts | PACKAGE_EXPORT_RESOLUTION |
| apps/web/src/app/[locale]/[country]/(portal)/kes/SigningSlotPanel.tsx | @kvary/core/governance | TS path + Next alias to source | package export to packages/core/dist/governance/index.d.ts | PACKAGE_EXPORT_RESOLUTION |
| apps/web/src/app/[locale]/[country]/(portal)/kes/page.tsx | @kvary/core/governance | TS path + Next alias to source | package export to packages/core/dist/governance/index.d.ts | PACKAGE_EXPORT_RESOLUTION |
Change applied
Minimal safe change only:
- Removed
@kvary/corepath mappings from apps/web/tsconfig.json - Removed
@kvary/corewebpack/turbopack aliases from apps/web/next.config.js
What remained intentionally unchanged:
transpilePackages: ["@kvary/core", "@kvary/ai-layer", "@kvary/memory-layer"]@kvary/ai-layersource aliasing@kvary/memory-layersource aliasing- local
@alias
Rationale:
@kvary/corenow has explicit subpath exports and a dist buildtranspilePackagesis enough to keep Next aware of the workspace package- removing only the
@kvary/corealias/path mapping reduces coupling without broadening risk to other packages
Validation
Package resolution from web context
Executed from apps/web:
npm exec -- node -e "import('@kvary/core/governance')..."
npm exec -- node -e "import('@kvary/core/governance/types')..."
Results:
@kvary/core/governanceresolved successfully@kvary/core/governance/typesresolved successfully
TypeScript trace resolution
Executed:
npm exec -- tsc -p apps/web/tsconfig.json --noEmit --traceResolution
Relevant result:
@kvary/core/governanceresolves throughnode_modules/@kvary/core/package.json- TypeScript selects
packages/core/dist/governance/index.d.ts - no fallback to
../../packages/core/governance/index.ts
This is the key stabilization result for web.
Known unrelated TypeScript errors
The full apps/web TypeScript check still fails, but on unrelated tenders-page style typing issues:
apps/web/src/app/[locale]/(portal)/tenders/page.tsxapps/web/src/app/[locale]/[country]/(portal)/tenders/page.tsx
No @kvary/core module-resolution errors were observed in the trace for the web KES consumers.
What remains risky
-
Root tsconfig.json still contains raw
@kvary/core/*source mappings- not a blocker for
apps/webnow - still worth cleaning later cluster-by-cluster
- not a blocker for
-
@kvary/ai-layerand@kvary/memory-layerinapps/web- still use direct source mapping and aliases
- intentionally not changed in this step
-
Full Next runtime/dev server was not restarted in this step
- static resolution and config validation passed
- runtime smoke can be done separately if needed
Next cleanup candidates
- root
tsconfig.jsonraw@kvary/core/*mapping review apps/webresolution review for@kvary/ai-layerand@kvary/memory-layer- later
packages/core/*.jsstrict-delete pass after remaining non-web/manual clusters are stabilized