Skip to content

[Export Audit] Test helper objects exported from production modules (containerLifecycleTestHelpers, copilotApiResolverTestHelpers, hostEnvTestH [Content truncated due to length] #3969

Description

@github-actions

API Surface Issue

Category

Test importing from wrong location / Dead export in production module

Summary

Multiple production source files export test-helper objects that are exclusively consumed by test files. This is a recurring pattern that has regressed across several modules:

File Exported Symbol Prior Issue
src/container-lifecycle.ts containerLifecycleTestHelpers regression of #3369
src/copilot-api-resolver.ts copilotApiResolverTestHelpers
src/host-env.ts hostEnvTestHelpers
src/logs/log-discovery.ts logDiscoveryTestHelpers regression of #3525

Evidence

src/container-lifecycle.ts:469:export const containerLifecycleTestHelpers = { isAgentExternallyKilled, resetAgentExternallyKilled };

Used only in: src/docker-manager-lifecycle.test.ts

src/copilot-api-resolver.ts:88:export const copilotApiResolverTestHelpers = { ... };

Used only in: src/copilot-api-resolver.test.ts, src/cli.test.ts

src/host-env.ts:52:export const hostEnvTestHelpers = { subnetsOverlap };

Used only in: src/docker-manager-utils.test.ts

src/logs/log-discovery.ts:168:export const logDiscoveryTestHelpers = { isContainerRunning };

Used only in: src/logs/log-discovery.test.ts

Recommended Fix

For each symbol:

  1. Remove the export const *TestHelpers = ... object from the production file
  2. Either move the helper into a co-located *.test-utils.ts file, or expose the underlying function directly from a test-utils module
  3. Update test imports accordingly

Impact

  • Dead code risk: Medium — test-only state-mutation helpers on production module surfaces
  • Maintenance burden: Medium — four separate modules affected; pattern likely to keep regressing without a lint rule

Detected by Export Audit workflow. Triggered by push to main on 2026-05-28

Generated by API Surface & Export Audit · sonnet46 1.3M ·

  • expires on Jun 27, 2026, 4:47 PM UTC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions