API Surface Issue
Category
Unused export (production-side dead code)
Summary
- File:
src/api-proxy-config.ts
- Symbols:
validateApiTargetInAllowedDomains (line 85)
extractGhecDomainsFromServerUrl (line 216)
extractGhesDomainsFromEngineApiTarget (line 267)
- Issue: All three functions are exported but never imported by any production module outside
api-proxy-config.ts. Each is called internally by other functions in the same file (e.g., resolveApiTargetsToAllowedDomains calls the extract helpers) and is also imported directly from co-located test files. This unnecessarily widens the module's public API and couples tests to internal implementation details rather than the public entrypoints that actually compose them.
Evidence
grep -rEw "validateApiTargetInAllowedDomains|extractGhecDomainsFromServerUrl|extractGhesDomainsFromEngineApiTarget" src/ --include="*.ts" outside api-proxy-config.ts returns only test files:
src/api-proxy-config-validation.test.ts: validateApiTargetInAllowedDomains,
src/api-proxy-config-validation.test.ts:describe('validateApiTargetInAllowedDomains', () => {
src/api-proxy-config-validation.test.ts: const result = validateApiTargetInAllowedDomains(...) [7 call sites]
src/api-proxy-config-domains.test.ts: extractGhesDomainsFromEngineApiTarget,
src/api-proxy-config-domains.test.ts: extractGhecDomainsFromServerUrl,
src/api-proxy-config-domains.test.ts:describe('extractGhesDomainsFromEngineApiTarget', () => { ... } [6 call sites]
src/api-proxy-config-domains.test.ts:describe('extractGhecDomainsFromServerUrl', () => { ... } [12 call sites]
ts-prune flagged all three as "used in module" (i.e., only called from within their defining file by other code in the same module), confirming no production caller outside the file.
This is the same pattern as closed-completed #4007 (translateBindMountHostPath), where an internal helper exported solely for direct testing was demoted to module-private and tests were rerouted through the public composition function.
Recommended Fix
- Drop the
export keyword from all three functions in src/api-proxy-config.ts, making them module-private helpers.
- Update
src/api-proxy-config-validation.test.ts and src/api-proxy-config-domains.test.ts to exercise these behaviors through the public entrypoints that compose them (e.g., resolveApiTargetsToAllowedDomains, validateApiProxyConfig), so the tests verify the contract that production code actually observes.
Impact
- Dead code risk: Low (logic is still exercised via internal callers)
- Maintenance burden: Medium (three symbols on the public API surface, three test suites coupled to private helpers — refactors to the composition functions can silently break tests that bypass them)
Detected by Export Audit workflow. Triggered by push to main on 2026-06-02
Generated by API Surface & Export Audit · opus47 5.1M · ◷
API Surface Issue
Category
Unused export (production-side dead code)
Summary
src/api-proxy-config.tsvalidateApiTargetInAllowedDomains(line 85)extractGhecDomainsFromServerUrl(line 216)extractGhesDomainsFromEngineApiTarget(line 267)api-proxy-config.ts. Each is called internally by other functions in the same file (e.g.,resolveApiTargetsToAllowedDomainscalls the extract helpers) and is also imported directly from co-located test files. This unnecessarily widens the module's public API and couples tests to internal implementation details rather than the public entrypoints that actually compose them.Evidence
grep -rEw "validateApiTargetInAllowedDomains|extractGhecDomainsFromServerUrl|extractGhesDomainsFromEngineApiTarget" src/ --include="*.ts"outsideapi-proxy-config.tsreturns only test files:ts-pruneflagged all three as "used in module" (i.e., only called from within their defining file by other code in the same module), confirming no production caller outside the file.This is the same pattern as closed-completed #4007 (
translateBindMountHostPath), where an internal helper exported solely for direct testing was demoted to module-private and tests were rerouted through the public composition function.Recommended Fix
exportkeyword from all three functions insrc/api-proxy-config.ts, making them module-private helpers.src/api-proxy-config-validation.test.tsandsrc/api-proxy-config-domains.test.tsto exercise these behaviors through the public entrypoints that compose them (e.g.,resolveApiTargetsToAllowedDomains,validateApiProxyConfig), so the tests verify the contract that production code actually observes.Impact
Detected by Export Audit workflow. Triggered by push to main on 2026-06-02