Skip to content

[Export Audit] Dead barrel re-exports in src/logs/index.ts bypass direct sub-module imports #2923

@github-actions

Description

@github-actions

API Surface Issue

Category

Unused export (dead barrel re-exports)

Summary

  • File: src/logs/index.ts
  • Symbols: parseLogLine, extractDomain, extractPort, discoverLogSources, selectMostRecent, isContainerRunning, validateSource, aggregateLogs, loadAllLogs, loadAndAggregate, AggregatedStats, DomainStats, formatStats
  • Issue: The barrel re-exports 13 symbols that are never imported via this barrel in production code. All consumer commands import directly from the sub-modules, making these barrel entries dead code.

Evidence

The only production file that imports from the ../logs barrel is src/commands/logs.ts, which uses only listLogSources, LogFormatter, and streamLogs:

src/commands/logs.ts:11:} from '../logs';

All other log-consuming code bypasses the barrel:

src/commands/logs-command-helpers.ts:13: from '../logs/log-discovery';
src/commands/logs-command-helpers.ts:14: import { loadAndAggregate, loadAllLogs } from '../logs/log-aggregator';
src/commands/logs-command-helpers.ts:17: import { formatStats } from '../logs/stats-formatter';
src/commands/logs-audit.ts:11: import { loadAllLogs } from '../logs/log-aggregator';
src/commands/logs-audit.ts:12: import { enrichWithPolicyRules, computeRuleStats } from '../logs/audit-enricher';

ts-prune confirms none of these 13 symbols are imported from src/logs/index.ts:

src/logs/index.ts:5 - parseLogLine
src/logs/index.ts:5 - extractDomain
src/logs/index.ts:5 - extractPort
src/logs/index.ts:8 - discoverLogSources
src/logs/index.ts:9 - selectMostRecent
src/logs/index.ts:10 - isContainerRunning
src/logs/index.ts:11 - validateSource
src/logs/index.ts:16 - aggregateLogs
src/logs/index.ts:17 - loadAllLogs
src/logs/index.ts:18 - loadAndAggregate
src/logs/index.ts:19 - AggregatedStats
src/logs/index.ts:20 - DomainStats
src/logs/index.ts:23 - formatStats

Recommended Fix

Option A – Remove dead re-exports from the barrel: Delete all 13 re-export lines from src/logs/index.ts. Keep only what logs.ts actually uses (listLogSources, LogFormatter, streamLogs, and the type/interface it needs).

Option B – Consolidate via the barrel: Update logs-command-helpers.ts and other command files to import through the ../logs barrel instead of sub-modules, making the barrel the single import surface.

Option A is safer since it shrinks the public surface without touching callers.

Impact

  • Dead code risk: Medium — any future refactor of sub-module internals might unknowingly break these re-exports with no test signal
  • Maintenance burden: Medium — developers assume barrel re-exports are used and may hesitate to remove them; over time this accumulates more dead surface

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

Generated by API Surface & Export Audit · ● 831.8K ·

  • expires on Jun 10, 2026, 3:52 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