Skip to content

refactor: remove dead exports from preflight, network-setup, domain-acl, and logs barrel#3051

Merged
lpcox merged 1 commit into
mainfrom
fix/export-audit-batch-2
May 12, 2026
Merged

refactor: remove dead exports from preflight, network-setup, domain-acl, and logs barrel#3051
lpcox merged 1 commit into
mainfrom
fix/export-audit-batch-2

Conversation

@lpcox
Copy link
Copy Markdown
Collaborator

@lpcox lpcox commented May 12, 2026

Summary

Remove dead exports identified by export audit issues. No behavioral changes — all modifications are export keyword removals or barrel trimming.

Changes

src/commands/preflight.ts — Unexport AllowedDomainsResult interface (never imported outside the file; the function resolveAllowedDomains remains exported since it is used by main-action.ts and tests).

src/commands/network-setup.ts — Unexport NetworkSetupResult interface (never imported outside the file; resolveNetworkConfig remains exported).

src/squid/domain-acl.ts — Unexport 4 symbols only used internally:

  • DomainsByProtocol interface
  • PatternsByProtocol interface
  • groupDomainsByProtocol() function
  • groupPatternsByProtocol() function

assertSafeForSquidConfig, formatDomainForSquid, and parseDomainConfig remain exported (used by other modules).

src/logs/index.ts — Trim barrel from 12 re-exports to the 3 actually consumed via the barrel (listLogSources, LogFormatter, streamLogs). All other consumers already import directly from source modules.

Verification

  • npx tsc --noEmit — passes
  • 221 tests across 7 relevant suites — all pass

Closes #3044, #3041, #3047, #3048, #3050, #3025

…cl, and logs barrel

- Unexport AllowedDomainsResult interface in preflight.ts (never imported)
- Unexport NetworkSetupResult interface in network-setup.ts (never imported)
- Unexport DomainsByProtocol, PatternsByProtocol interfaces in domain-acl.ts
  (only used internally)
- Unexport groupDomainsByProtocol, groupPatternsByProtocol functions in
  domain-acl.ts (only called within the same file)
- Trim logs/index.ts barrel to the 3 symbols actually consumed via the
  barrel (listLogSources, LogFormatter, streamLogs); remove 9 dead
  re-exports (parseLogLine, extractDomain, discoverLogSources,
  selectMostRecent, isContainerRunning, validateSource, aggregateLogs,
  loadAllLogs, loadAndAggregate, AggregatedStats, DomainStats, formatStats)

Closes #3044
Closes #3041
Closes #3047
Closes #3048
Closes #3050
Closes #3025

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 12, 2026 21:54
@lpcox lpcox requested a review from Mossaka as a code owner May 12, 2026 21:54
@github-actions
Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 89.71% 89.75% 📈 +0.04%
Statements 89.62% 89.66% 📈 +0.04%
Functions 92.04% 94.18% 📈 +2.14%
Branches 81.52% 81.56% 📈 +0.04%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/config-writer.ts 78.4% → 81.0% (+2.59%) 78.4% → 81.0% (+2.59%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results

✅ Playwright Test: GitHub page title verified
✅ File Writing Test: Created test file successfully
✅ Bash Tool Test: File verified with cat
❌ GitHub MCP Test: gh CLI authentication failed (HTTP 401)

Overall: PARTIAL PASS (3/4 tests passed)

💥 [THE END] — Illustrated by Smoke Claude

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces the project’s public TypeScript surface area by removing unused/dead exports and trimming an internal barrel module, based on export-audit findings. The intent is to keep only externally-consumed exports while leaving runtime behavior unchanged.

Changes:

  • Unexported unused result interfaces in the commands layer (AllowedDomainsResult, NetworkSetupResult).
  • Unexported internal-only helper types/functions in src/squid/domain-acl.ts (protocol grouping helpers).
  • Trimmed src/logs/index.ts barrel exports down to the symbols actually imported via the barrel.
Show a summary per file
File Description
src/commands/preflight.ts Removes export from an internal-only return-type interface.
src/commands/network-setup.ts Removes export from an internal-only return-type interface.
src/squid/domain-acl.ts Makes protocol-grouping types/helpers module-private while keeping the intended public functions exported.
src/logs/index.ts Trims the logs barrel to only the symbols consumed via ../logs.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 0

@github-actions
Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

Test Status
GitHub MCP connectivity ❌ MCP returned 401 (credentials not available to agent)
GitHub.com HTTP connectivity ⚠️ Pre-step data not passed (template vars unexpanded)
File write/read ⚠️ Pre-step data not passed (template vars unexpanded)

Overall: ❌ FAIL — workflow template variables (${{ steps.smoke-data.outputs.* }}) were not resolved before being passed to this agent step. Pre-computed results unavailable.

Author: @lpcox

📰 BREAKING: Report filed by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Copilot BYOK (Offline) Mode

Test Result
GitHub MCP connectivity ✅ (MCP tools available)
GitHub.com HTTP connectivity
File write/read (smoke-test-copilot-byok-25764473794.txt)
BYOK inference (agent → api-proxy → api.githubcopilot.com)

Running in BYOK offline mode (COPILOT_OFFLINE=true) via api-proxy → api.githubcopilot.com.

Overall: PASS 🟢

/cc @lpcox

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: FAIL

PRs: feat: gate token steering behind opt-in flag, adjust thresholds to 80/90/95/99%; Refactor squid config generation into focused modules
✅ GitHub PR review
❌ Safe Inputs GH CLI: safeinputs-gh unavailable
✅ Playwright title contains GitHub
❌ Tavily search: no search tool published
✅ File write/bash read/build
✅ Discussion lookup/comment
Overall status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions
Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color passed ✅ PASS
Go env passed ✅ PASS
Go uuid passed ✅ PASS
Java gson N/A ❌ FAIL
Java caffeine N/A ❌ FAIL
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 7/8 ecosystems passed — ❌ FAIL


❌ Failure Details

Java (gson, caffeine) — Network unreachable (Maven central https://repo.maven.apache.org/maven2):

[ERROR] Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:3.4.0
        from/to central (https://repo.maven.apache.org/maven2): Network is unreachable

Maven requires network access to download plugins/dependencies. This environment does not have outbound HTTPS connectivity to Maven Central, causing both Java projects to fail at compile time.

Generated by Build Test Suite for issue #3051 · ● 372.5K ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results — FAIL

Check Result
Redis PING ❌ Connection refused / timeout
PostgreSQL pg_isready ❌ No response
PostgreSQL SELECT 1 ❌ No response

Overall: FAIL

host.docker.internal resolves to 172.17.0.1 but TCP connections to ports 6379 and 5432 both fail. Service containers appear unreachable from this environment.

🔌 Service connectivity validated by Smoke Services

@github-actions
Copy link
Copy Markdown
Contributor

🧪 Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3
Node.js v24.14.1 v20.20.2
Go go1.22.12 go1.22.12

Result: FAILED — Python and Node.js versions differ between host and chroot environments.

Tested by Smoke Chroot

@lpcox lpcox merged commit 3cac341 into main May 12, 2026
68 of 72 checks passed
@lpcox lpcox deleted the fix/export-audit-batch-2 branch May 12, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Export Audit] Unused exported types: AllowedDomainsResult and NetworkSetupResult

2 participants