Skip to content

Unify public enclave diagnostics export across Docker and Cloud Hypervisor - #10930

Merged
lpcox merged 4 commits into
mainfrom
copilot/add-shared-public-diagnostics-exporter
Oct 31, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/add-shared-public-diagnostics-exporter

Conversation

Copilot AI commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Diagnostic retention is shared, but the existing exporter only discovers Cloud Hypervisor artifacts. This change extends that entry point to Docker without duplicating the diagnostic schema or publication logic.

  • Backend discovery

    • Covers Docker helper-owned and privileged storage layouts with backend-specific ownership checks.
    • Preserves Cloud Hypervisor supplemental evidence, early-failure proxy projections, and legacy CLI forms.
  • Validation and publication

    • Validates the shared envelope/session projection, exact identities, stop proof, permissions, links, and collection bounds.
    • Preserves approved credential-redacted streams and truthful availability states.
    • Publishes validated output through protected host staging; rejection produces only bounded failed-check identifiers and categories.
  • Consumer interface

    • Adds explicit backend and runner-identity binding.
    • Defines one new AWF run and at most one invocation per prepared scope; rejects ambiguity.
    • Migrates the script smoke caller and documents commit-pinned Docker usage, narrow host privilege, and prepare/collect/upload ordering that preserves nonzero execution outcomes.
sudo node collector.cjs prepare docker "$RUN_KEY" "$(id -u)" "$(id -g)"
# Execute AWF; collect after teardown, including execution failure.
sudo node collector.cjs collect docker "$RUN_KEY" "$(id -u)" "$(id -g)"

Upload only /var/lib/awf-enclave-smoke-export/$RUN_KEY/upload/, never protected source artifacts.

Copilot AI changed the title [WIP] Add shared public diagnostics exporter for Docker and Cloud Hypervisor enclaves Unify public enclave diagnostics export across Docker and Cloud Hypervisor Oct 31, 2026
Copilot AI requested a review from lpcox October 31, 2026 20:10
@lpcox
lpcox marked this pull request as ready for review October 31, 2026 20:10
Copilot AI adaptive review requested due to automatic review settings October 31, 2026 20:10

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.

🟡 Changes recommended

The Cloud Hypervisor fallback can publish supplemental files without trusted, identity-correlated workload-stop evidence when termination fails.

5 open issues
What changed in this PR

Generalizes the existing host-only diagnostics collector so Docker and Cloud Hypervisor enclaves share one supported export interface, addressing #10929 without duplicating the diagnostic schema.

Changes:

  • Adds backend-specific discovery, runner-identity binding, and explicit run/invocation limits.
  • Shares validation, credential redaction, protected staging, and safe failure reporting while preserving Cloud Hypervisor supplemental evidence.
  • Updates the smoke caller and regression coverage, and documents version-pinned Docker collection and upload ordering.
File Description
src/​enclave/​proxy-auth-diagnostics.test.ts Updates assertions for named validation failures.
scripts/​ci/​smoke-enclave-workflow.test.ts Checks explicit backend and runner arguments.
scripts/​ci/​collect-enclave-smoke-debug.test.ts Adds dual-backend fixtures and schema, safety, scope, and limit checks.
scripts/​ci/​collect-enclave-smoke-debug.cjs Implements shared discovery, validation, staging, and failure reporting.
README.md Links to the shared exporter documentation.
docs/​cloud-hypervisor-foundation.md Documents the interface, safeguards, and pinned Docker consumer example.
.github/​workflows/​smoke-enclave-cloud-hypervisor.md Migrates collector calls to explicit backend and runner binding.
.github/​workflows/​smoke-enclave-cloud-hypervisor.lock.yml Synchronizes compiled collector calls and workflow metadata.

Review effort: Max (auto)

Comment on lines +677 to +680
if (error.code === 'ENOENT' && runtime === 'cloud-hypervisor') {
// Pre-shared-envelope CH releases still retain bounded public-only
// supplemental evidence in this same protected namespace.
envelope = undefined;
DEBUG_RUN_KEY: ${{ github.run_id }}-${{ github.run_attempt }}
run: |
sudo node /var/lib/awf-enclave-smoke-export/collector.cjs collect "$DEBUG_RUN_KEY" "$(id -u)" "$(id -g)"
sudo node /var/lib/awf-enclave-smoke-export/collector.cjs collect cloud-hypervisor "$DEBUG_RUN_KEY" "$(id -u)" "$(id -g)"
.replace(/\b(?:github_pat_[A-Za-z0-9_]+|gh[pousr]_[A-Za-z0-9_]+|sk-[A-Za-z0-9_-]+)\b/g, '[REDACTED]');
const redactValue = (value, depth = 0) => {
check(depth <= 64, 'credential-redaction-bound', 'oversized');
if (typeof value === 'string') return redactText(value);
check(false, 'run-budget', 'concurrent-runs');
}
const roots = active[0] ?? candidates[0];
collect(runDirectory, runnerUid, runnerGid, roots, roots.sourceUid, '/', binding);
@lpcox

lpcox commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Addressed in commit ff3b9f0. The targeted build and enclave diagnostic/workflow regressions pass.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-10930 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit d012f97

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.57% 93.57% ➡️ +0.00%
Statements 92.09% 92.09% ➡️ +0.00%
Functions 91.32% 91.32% ➡️ +0.00%
Branches 86.16% 86.16% ➡️ +0.00%

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

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

Copy link
Copy Markdown
Contributor

🪪 Smoke Copilot BYOK AOAI (Entra) is testing Azure OpenAI BYOK (Entra / GitHub OIDC) mode on this pull request...

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #10930

@github-actions

Copy link
Copy Markdown
Contributor

💎 Smoke Gemini is crystallizing results on this pull request...

@github-actions

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot BYOK AOAI (api-key) is testing Azure OpenAI BYOK (api-key) mode on this pull request...

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test

  • Preserve enclave smoke credentials across sudo-rs
  • Add opt-in renewable token-broker authentication for Copilot inference
  • Merged PR review: ✅
  • PR details: ✅
  • Playwright: ❌
  • File write/read: ✅
  • Discussion lookup: ❌
  • Build AWF: ✅
  • Overall: FAIL

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

  • API status: ✅ PASS
  • GitHub check: ✅ PASS
  • File status: ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #10930 · claude · haiku45 · ~35 AIC · ⊞ 6.1K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

OTEL smoke test

  • ✅ S1 Module loading: otel.js loads; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, routerCallTracing, shutdown, isEnabled, etc.
  • ✅ S2 Tests: 3 suites, 75/75 passed
  • ✅ S3 Env forwarding: GITHUB_AW_OTEL_TRACE_ID/PARENT_SPAN_ID in env-passthrough.ts; OTEL_* vars + trace context in api-proxy-env-config.ts
  • ✅ S4 Token tracker: onUsage hook present in token-tracker-http.js
  • ✅ S5 Diagnostics: /tmp/gh-aw/otel.jsonl present (1 line)

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Cloud Hypervisor + Copilot smoke test

  1. Merged PR lookup: PASS
  2. github.com connectivity: PASS (HTTP 200)
  3. File write/read: PASS
  4. example.com blocked: PASS (HTTP 000)

Overall: PASS

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.15 Python 3.12.15 ✅ YES
Node.js v24.22.0 v2.98.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Result: Not all tests passed (Node.js mismatch), so the smoke-chroot label was not added.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Copilot: PRs: "Preserve enclave smoke credentials across sudo-rs", "Add opt-in renewable token-broker authentication for Copilot inference"

  • GitHub MCP ✅
  • GitHub.com connectivity ✅
  • File write/read ✅

Overall: PASS — @Copilot @lpcox

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode ✅

Test Result
GitHub MCP ✅
github.com HTTP 200 ✅
File Write/Read ✅
BYOK Inference ✅

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

Status: PASS

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com → 200)
  • ✅ Blocked domain (example.com blocked)

Overall: PASS — @lpcox

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Oct 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Services smoke test: FAIL

  • ❌ Redis PING: connection refused
  • ❌ pg_isready: no response
  • ❌ Postgres SELECT 1: connection refused

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@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 ✅ all passed ✅ PASS
Go env ✅ all passed ✅ PASS
Go uuid ✅ all passed ✅ PASS
Java gson ❌ 0 run ❌ FAIL
Java caffeine ❌ 0 run ❌ 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

Java failure details: Maven could not resolve plugins (maven-resources-plugin:3.4.0) from Maven Central: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (the Java truststore appears empty or unusable). The default ~/.m2 repository was also not writable, so I used a temporary local repo, and the failure persisted.

.NET: the first attempts failed on first-run setup (/run/user/1001 missing). Re-running with XDG_RUNTIME_DIR and DOTNET_CLI_HOME set to a writable path passed.

The build-test label was not added because Java failed.

Generated by Build Test Suite for #10930 · copilot · auto · ~25 AIC · ⊞ 5.7K · ◷
Add label ready-for-aw to run again

This branch had an error being deployed

1 failed deployment
aoai-model — ff3b9f04 Deployed Oct 31, 2026 by lpcox via conclusion #2218
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.

Provide a shared public diagnostics exporter for Docker and Cloud Hypervisor enclaves

3 participants