Problem
In src/config/index.ts lines 90-94, the config export uses a Proxy that returns (ensureConfig() as any)[prop]. Any property access on config returns any, bypassing TypeScript's type checking.
If someone writes config.NONEXISTENT_KEY, it compiles fine but returns undefined at runtime.
Fix
Consider eagerly loading config at startup (with the test-mode fallback) instead of using a Proxy, to preserve type safety.
Scope
src/config/index.ts -- refactor config loading
Acceptance Criteria
- Config properties are type-checked at compile time
- Typo in config property name causes compile error
- Existing tests pass
Technical Context
src/config/index.ts:90-94 -- Proxy-based config
Problem
In
src/config/index.tslines 90-94, theconfigexport uses aProxythat returns(ensureConfig() as any)[prop]. Any property access onconfigreturnsany, bypassing TypeScript's type checking.If someone writes
config.NONEXISTENT_KEY, it compiles fine but returnsundefinedat runtime.Fix
Consider eagerly loading config at startup (with the test-mode fallback) instead of using a Proxy, to preserve type safety.
Scope
src/config/index.ts-- refactor config loadingAcceptance Criteria
Technical Context
src/config/index.ts:90-94-- Proxy-based config