Skip to content

feat: add NVX phase 2 filesystem and one-shot foundations - #8779

Merged
lpcox merged 5 commits into
mainfrom
nvx-phase-2-filesystem-execution
Sep 19, 2026
Merged

lpcox merged 5 commits into
mainfrom
nvx-phase-2-filesystem-execution

Conversation

@lpcox

@lpcox lpcox commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a deterministic NVX EROFS layer builder with stable UUIDs, normalized metadata, credential exclusions, immutable manifests, and fresh bounded ext4 scratch images
  • add a one-shot-only nvx.py sandbox run adapter with process-group timeout/cancellation, minimal host environment, streaming workflow-command filtering, and bounded raw diagnostic tails
  • validate exact NVX outcome/teardown schemas, preserve guest exit codes including 125, and verify the reported network policy matches the requested fail-closed policy
  • keep NVX out of the runtime registry until Phase 3 host confinement, artifact attestation, durable cleanup, and host network enforcement are complete

Validation

  • npm run build
  • npm run lint
  • npm run type-check
  • npm test -- --runInBand src/nvx/filesystem-builder.test.ts src/nvx/outcome.test.ts src/nvx/one-shot-adapter.test.ts
  • npx markdownlint-cli2 docs/nvx-security-design.md

The full test suite reports 6002 passing tests and one unrelated existing failure in scripts/ci/self-hosted-runner-doctor-workflow.test.ts; both the test and portable-agent input are byte-identical to origin/main.

Build deterministic EROFS layers and private ext4 scratch images.

Add a fail-closed adapter for one-shot NVX execution.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6b7bb21d-a74b-4061-b1d0-ae2a18df7a8c
Copilot AI balanced review requested due to automatic review settings September 19, 2026 16:19
@github-actions

github-actions Bot commented Sep 19, 2026 •

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-8779 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit 52c8d9a

Comment thread src/nvx/one-shot-adapter.ts Fixed

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.

Copilot review overview

🟡 Changes recommended

Filesystem staging has credential and race vulnerabilities, identity configuration can diverge, and process-group termination can leave descendants running.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 High severity · 2 Medium severity

Open (4)
What changed in this PR

Adds Phase 2 NVX filesystem and one-shot execution foundations without enabling NVX as a runtime.

Changes:

  • Builds deterministic EROFS layers and private ext4 scratch images.
  • Adds one-shot execution, output filtering, timeout handling, and outcome validation.
  • Documents the Phase 2 security boundary.
File Description
src/​nvx/​filesystem-builder.ts Builds filesystem artifacts and manifests.
src/​nvx/​filesystem-builder.test.ts Tests filesystem preparation and exclusions.
src/​nvx/​one-shot-adapter.ts Implements one-shot NVX execution.
src/​nvx/​one-shot-adapter.test.ts Tests execution outcomes and filtering.
src/​nvx/​outcome.ts Parses strict outcome reports.
src/​nvx/​outcome.test.ts Tests outcome validation.
src/​nvx/​index.ts Exports NVX APIs.
docs/​nvx-security-design.md Documents Phase 2 boundaries.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/nvx/filesystem-builder.ts Outdated
Comment on lines +95 to +97
const DEFAULT_EXCLUDED_PATHS = CREDENTIAL_ENTRIES.map(({ path: entryPath }) =>
normalizeRelative(entryPath)
);
Comment thread src/nvx/filesystem-builder.ts Outdated
Comment on lines +393 to +395
} else {
await fs.mkdir(path.dirname(destination), { recursive: true, mode: 0o700 });
await fs.copyFile(current, destination);
Comment on lines +59 to +60
readonly scratchUid?: number;
readonly scratchGid?: number;
Comment thread src/nvx/one-shot-adapter.ts Outdated
Comment on lines +504 to +506
child.once('exit', (exitCode, signal) => {
clearTimeout(timeout);
clearTimeout(forceKillTimer);
@lpcox lpcox changed the title feat(nvx): add phase 2 filesystem and one-shot foundations feat: add NVX phase 2 filesystem and one-shot foundations Sep 19, 2026
Read NVX outcomes through a no-follow file descriptor.

Update the vulnerable adm-zip override and correct the runner-doctor assertion.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6b7bb21d-a74b-4061-b1d0-ae2a18df7a8c
@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

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

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 94.26% 93.54% 📉 -0.72%
Statements 92.96% 92.23% 📉 -0.73%
Functions 93.56% 92.64% 📉 -0.92%
Branches 86.92% 86.19% 📉 -0.73%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (4 files)
  • src/nvx/filesystem-builder.ts: 89.1% lines
  • src/nvx/index.ts: 0.0% lines
  • src/nvx/one-shot-adapter.ts: 67.3% lines
  • src/nvx/outcome.ts: 84.0% lines

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

@lpcox

lpcox commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback

Copilot AI commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Addressed the review feedback in 5a6642a, a9725a0, and 86c8189: hardened descriptor-based staging and credential exclusions, bound scratch ownership to the workload identity, and completed race-safe process-group escalation.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 94.26% 93.75% 📉 -0.51%
Statements 92.96% 92.43% 📉 -0.53%
Functions 93.56% 92.99% 📉 -0.57%
Branches 86.92% 86.22% 📉 -0.70%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (4 files)
  • src/nvx/filesystem-builder.ts: 88.4% lines
  • src/nvx/index.ts: 0.0% lines
  • src/nvx/one-shot-adapter.ts: 79.8% lines
  • src/nvx/outcome.ts: 84.0% lines

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

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ Security Guard completed successfully!

PR #8779 passes security review: adm-zip version bump (0.6.0→0.6.1) is a routine dependency update with no firewall rule changes, capability additions, egress expansion, or other security-weakening modifications.

Generated by Security Guard for #8779

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

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

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

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

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #8779

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Warning

Firewall blocked 1 domain

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

  • example.com

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

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Warning

Firewall blocked 7 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • msfeed25.pkgs.visualstudio.com
  • update.googleapis.com
  • www.google.com
  • www.gstatic.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "msfeed25.pkgs.visualstudio.com"
    - "update.googleapis.com"
    - "www.google.com"
    - "www.gstatic.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

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

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Warning

Firewall blocked 1 domain

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

  • api.anthropic.com

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

network:
  allowed:
    - defaults
    - "api.anthropic.com"

See Network Configuration for more information.

Generated by Smoke Claude for #8779

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

📰 DEVELOPING STORY: Smoke Docker Sbx reports failed. Our correspondents are investigating the incident...

📰 BREAKING: Report filed by Smoke Docker Sbx

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Sep 19, 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 Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

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

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (github.com) reachable: allowed=200
✅ Blocked domain (example.com) denied: CONNECT tunnel 403

Overall: PASS

@lpcox

Warning

Firewall blocked 1 domain

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

  • example.com

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

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct Mode) ✅ PASS

  • ✅ HTTP 200 (github.com connectivity)
  • ✅ File write/read verified
  • ✅ MCP connectivity confirmed (2 merged PRs)
  • ✅ BYOK inference path active (agent → api-proxy → api.githubcopilot.com)

Running in direct BYOK mode via COPILOT_PROVIDER_API_KEY with api-proxy sidecar injection.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Status
API ✅ PASS
gh CLI ✅ PASS
File ✅ PASS

Overall result: PASS

Warning

Firewall blocked 1 domain

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

  • api.anthropic.com

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

network:
  allowed:
    - defaults
    - "api.anthropic.com"

See Network Configuration for more information.

Generated by Smoke Claude for #8779 · claude · haiku45 · 55.2 AIC · ⊞ 4.5K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot Engine — cc @lpcox

Overall: PASS

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

@github-actions

Copy link
Copy Markdown
Contributor

AWF Sandbox Connectivity Smoke Test

  • ✅ Redis PING → PONG
  • ✅ PostgreSQL pg_isready → accepting connections
  • ✅ PostgreSQL SELECT 1 → 1

Overall: PASS

🔌 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 ✅ 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 ✅ 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: 8/8 ecosystems passed — PASS

Notes:

  • Java Maven builds required overriding -Dmaven.repo.local to a writable path (/tmp/gh-aw/agent/m2-repo) since ~/.m2/repository was not writable by the runner user in this sandbox (unrelated environment quirk, not a firewall issue). All builds/tests still passed through the configured Squid proxy.

Generated by Build Test Suite for #8779 · copilot · auto · 31.9 AIC · ⊞ 10.1K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.14 Python 3.12.14 ✅ YES
Node.js v24.21.0 v22.23.2 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: FAILED — Node.js version mismatch between host and chroot environment.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test

  • chore(deps): Bump devalue from 5.8.2 to 5.9.2 in /docs-site ✅
  • [docs] auth: README: correct API proxy sidecar status to always-enabled ✅
  • GitHub title check ✅
  • File write/read ✅
  • Discussion comment ✅
  • Build (npm ci && npm run build) ✅
  • Overall: PASS

Warning

Firewall blocked 7 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • msfeed25.pkgs.visualstudio.com
  • update.googleapis.com
  • www.google.com
  • www.gstatic.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "msfeed25.pkgs.visualstudio.com"
    - "update.googleapis.com"
    - "www.google.com"
    - "www.gstatic.com"

See Network Configuration for more information.

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

@github-actions

Copy link
Copy Markdown
Contributor

📡 OTel Tracing Smoke Test Results

# Scenario Result
1 Module Loading (otel.js) ✅ Loaded successfully, isEnabled() = true, exports 15 functions incl. startRequestSpan, setTokenAttributes, endSpan
2 Test Suite (--testPathPattern='otel') ✅ 68/68 tests passed (3 suites: otel.test.js, otel-fanout.test.js, otel-workload-identity.test.js)
3 Env Var Forwarding ✅ GITHUB_AW_OTEL_TRACE_ID/GITHUB_AW_OTEL_PARENT_SPAN_ID forwarded in env-passthrough.ts; GH_AW_OTLP_ENDPOINTS/OTEL_EXPORTER_OTLP_ENDPOINT/trace context forwarded in api-proxy-env-config.ts
4 Token Tracker Integration ✅ onUsage callback present in token-tracker-http.js (OTEL hook point)
5 OTEL Diagnostics ✅ Workflow-level OTLP span export active (/tmp/gh-aw/otel.jsonl, 1 record for gh-aw.agent.setup); api-proxy-side token-usage.jsonl active (12.5KB) confirming token tracking; no api-proxy-scoped otel.jsonl at the sidecar-specific path — expected since no LLM calls were proxied in this run

Summary: All 5 scenarios pass. No regressions detected in OTel tracing integration.

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

This branch was successfully deployed

1 active deployment
aoai-model — 86c81896 Deployed Sep 19, 2026 by lpcox via conclusion #1696
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.

4 participants