Skip to content

[Export Audit] docker-manager.ts barrel re-exports 19 symbols consumed only by test files #3166

Description

@github-actions

API Surface Issue

Category

Dead export / Unused public API surface

Summary

  • File: src/docker-manager.ts
  • Symbols: AGENT_CONTAINER_NAME, ACT_PRESET_BASE_IMAGE, MIN_REGULAR_UID, validateIdNotInSystemRange, getSafeHostUid, getSafeHostGid, getRealUserHome, extractGhHostFromServerUrl, readGitHubPathEntries, readGitHubEnvEntries, parseGitHubEnvFile, mergeGitHubPathEntries, readEnvFile, subnetsOverlap, SslConfig, stripScheme, generateDockerCompose, isAgentExternallyKilled, resetAgentExternallyKilled
  • Issue: The docker-manager.ts barrel file re-exports these symbols from underlying source modules (host-env.ts, compose-generator.ts, container-lifecycle.ts), but none are ever imported from docker-manager.ts by production code. Only test files consume them from this barrel.

Evidence

src/docker-manager.ts comment states "Re-export public API for backwards compatibility", yet the backwards-compatibility consumers are all test files:

# Test file consumers:
src/docker-manager-utils.test.ts:1: import { subnetsOverlap, validateIdNotInSystemRange, ..., MIN_REGULAR_UID, ACT_PRESET_BASE_IMAGE, ... } from './docker-manager'
src/docker-manager-lifecycle.test.ts:1: import { ..., isAgentExternallyKilled, resetAgentExternallyKilled, AGENT_CONTAINER_NAME, ... } from './docker-manager'
src/compose-generator.test.ts:1: import { generateDockerCompose, ACT_PRESET_BASE_IMAGE } from './docker-manager'

# Production code imports directly from source modules (e.g., host-env.ts, container-lifecycle.ts)

ts-prune confirmed all 19 symbols as unused outside their source modules (no (used in module) qualifier).

Recommended Fix

  1. Update test files to import directly from real source modules:
    • docker-manager-utils.test.ts./host-env
    • docker-manager-lifecycle.test.ts./container-lifecycle and ./host-env
    • compose-generator.test.ts./compose-generator and ./host-env
  2. Remove the now-unused re-exports from src/docker-manager.ts, keeping only symbols that production code actually imports.

Impact

  • Dead code risk: Medium — barrel silently exposes internal symbols beyond its intended public interface
  • Maintenance burden: Medium — changes to host-env.ts symbol names require barrel updates even though no production code depends on them

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

Generated by API Surface & Export Audit · ● 22.1M ·

  • expires on Jun 13, 2026, 6:40 PM UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions