Skip to content

Stop keyword leakage in api-proxy-env-constants export surface#5681

Merged
lpcox merged 2 commits into
mainfrom
copilot/export-audit-fix-satisfies
Jun 29, 2026
Merged

Stop keyword leakage in api-proxy-env-constants export surface#5681
lpcox merged 2 commits into
mainfrom
copilot/export-audit-fix-satisfies

Conversation

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Export audit flagged satisfies and ReadonlyArray as public symbols from src/api-proxy-env-constants.ts, indicating the module export shape was being misread. This polluted the API surface with TypeScript syntax artifacts instead of real runtime exports.

  • Root cause

    • OIDC_AUTH_ENV_MAPPING was exported inline while using satisfies ReadonlyArray<...>, which caused audit tooling to attribute TS keywords as exported symbols.
  • Change made

    • Converted OIDC_AUTH_ENV_MAPPING to a local const with the same type constraint.
    • Added an explicit named export afterward: export { OIDC_AUTH_ENV_MAPPING };
    • Runtime behavior and consumer import paths remain unchanged; only export declaration form changed.
  • Result

    • The module exports only intended symbols, and TypeScript keywords are no longer surfaced as API exports.
const OIDC_AUTH_ENV_MAPPING = [
  // ...
] as const satisfies ReadonlyArray<{
  configKey: Extract<keyof import('./types').WrapperConfig, string>;
  envVar: `AWF_AUTH_${string}`;
}>;

export { OIDC_AUTH_ENV_MAPPING };

Copilot AI changed the title [WIP] Fix incorrect export of TypeScript keywords in api-proxy-env-constants Stop keyword leakage in api-proxy-env-constants export surface Jun 29, 2026
Copilot finished work on behalf of lpcox June 29, 2026 14:12
Copilot AI requested a review from lpcox June 29, 2026 14:12
@lpcox lpcox marked this pull request as ready for review June 29, 2026 14:31
Copilot AI review requested due to automatic review settings June 29, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request adjusts how OIDC_AUTH_ENV_MAPPING is declared/exported in src/api-proxy-env-constants.ts to prevent TypeScript syntax artifacts (e.g., satisfies, ReadonlyArray) from being misattributed as part of the module’s public export surface by export-audit tooling, without changing runtime behavior or consumer import paths.

Changes:

  • Convert OIDC_AUTH_ENV_MAPPING from an inline export const ... = ... satisfies ... declaration to a local const with the same satisfies ReadonlyArray<...> constraint.
  • Add an explicit named export export { OIDC_AUTH_ENV_MAPPING }; after the declaration to keep the exported API intact.
  • Keep OIDC_AUTH_ENV_VARS derived from the mapping as before.
Show a summary per file
File Description
src/api-proxy-env-constants.ts Restructures the OIDC_AUTH_ENV_MAPPING export to avoid TypeScript keyword/type leakage in export-surface auditing while preserving runtime exports.

Review details

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Low

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

Smoke test completed with partial failures

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

Contribution guidelines check complete for PR #5681: no important guideline issues found in the provided metadata, diff, and CONTRIBUTING.md context.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.16% 98.20% 📈 +0.04%
Statements 98.10% 98.13% 📈 +0.03%
Functions 99.54% 99.54% ➡️ +0.00%
Branches 94.14% 94.14% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/workdir-setup.ts 92.7% → 94.5% (+1.82%) 92.7% → 94.5% (+1.82%)

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

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Copilot PAT — PASS

Test Result
GitHub MCP connectivity
GitHub.com HTTP ✅ 200
File write/read

Overall: PASS · Auth mode: PAT (COPILOT_GITHUB_TOKEN)
cc @lpcox @Copilot

🔑 PAT report filed by Smoke Copilot PAT

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

  • API check: ✅ PASS
  • gh check: ✅ PASS
  • File check: ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #5681 · 36.1 AIC · ⊞ 3.3K ·

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct Mode) ✅ PASS

  • ✅ File Write/Read Test
  • ✅ GitHub.com Connectivity (MCP)
  • ✅ BYOK Inference Path (direct mode via api-proxy)
  • ✅ GitHub MCP API Verification

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) → api-proxy sidecar → api.githubcopilot.com

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Smoke Test Results — PASS

PR: Stop keyword leakage in api-proxy-env-constants export surface
Author: @Copilot | Assignees: @lpcox @Copilot

Test Result
GitHub MCP connectivity
github.com HTTP ✅ 200
File write/read

Overall: PASS

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing — Results

Scenario Status Detail
1. Module Loading ✅ Pass otel.js loads successfully; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, plus test-only internals
2. Test Suite ✅ Pass 59 tests passed, 0 failed across otel.test.js and otel-fanout.test.js
3. Env Var Forwarding ✅ Pass src/services/api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID, and OTEL_SERVICE_NAME to the api-proxy container
4. Token Tracker Integration ✅ Pass onUsage callback exists in token-tracker-http.js (line 324) as the OTEL hook point; otel.js JSDoc confirms it calls setTokenAttributes/setBudgetAttributes from this callback
5. OTEL Diagnostics ✅ Pass (expected) No spans exported — otel.jsonl absent because no OTLP endpoint is configured in CI; graceful degradation working correctly

Overall: ✅ All 5 scenarios pass. The OTEL tracing integration is fully functional.

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Smoke Test Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3 ❌ NO
Node.js v24.17.0 v22.23.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox

  • GitHub MCP: ✅
  • GitHub.com connectivity: ✅
  • File write/read: ✅
  • BYOK inference: ✅

Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
Overall: PASS

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

Copy link
Copy Markdown
Contributor

Remove unused buildProviderTargetEnv export from API proxy env config
Stop keyword leakage in api-proxy-env-constants export surface
GitHub PR review: ✅
Safe Inputs GH CLI query: ✅
Playwright / file / build checks: ✅
Overall: PASS

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

Smoke Test: GitHub Actions Services Connectivity

Check Result
Redis PING ❌ Timeout (port 6379 unreachable)
PostgreSQL pg_isready ❌ Timeout (port 5432 unreachable)
PostgreSQL SELECT 1 ❌ Timeout (port 5432 unreachable)

host.docker.internal resolves to 172.17.0.1 but TCP connections to both ports timed out — the service containers are not reachable from this runner environment.

Overall: ❌ FAIL

🔌 Service connectivity validated by Smoke Services

@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 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx All passed ✅ PASS
Node.js execa All passed ✅ PASS
Node.js p-limit All passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for #5681 · 43.5 AIC · ⊞ 7.8K ·

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results: Gemini Engine

  • GitHub MCP Testing: ❌ (Unable to fetch PRs - network/auth)
  • GitHub.com Connectivity: ❌ (SSL/TLS error: 400/35)
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅

Overall status: FAIL

Warning

Firewall blocked 1 domain

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

  • localhost

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

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini

@github-actions

Copy link
Copy Markdown
Contributor

@Copilot @lpcox

Smoke test results:

  • Stop keyword leakage in api-proxy-env-constants export surface: ✅
  • Remove unused buildProviderTargetEnv export from API proxy env config: ✅
  • GitHub.com connectivity: ✅
  • File write/read: ✅
  • BYOK inference: ✅

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
Overall: PASS

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@lpcox lpcox merged commit 1625fdb into main Jun 29, 2026
88 of 91 checks passed
@lpcox lpcox deleted the copilot/export-audit-fix-satisfies branch June 29, 2026 15:43
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.

3 participants