Skip to content

feat(nvx): bind Phase 3 resources to one run identity - #8802

Merged
lpcox merged 4 commits into
mainfrom
nvx-phase-3-opt-in-backend
Sep 20, 2026
Merged

lpcox merged 4 commits into
mainfrom
nvx-phase-3-opt-in-backend

Conversation

@lpcox

@lpcox lpcox commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a canonical NVX run layout that derives artifact snapshot, writable run directory, cleanup record, cgroup, and network namespace paths from one 32-character run ID
  • make preflight stage artifacts into the exact identity-bound snapshot path and reject any returned snapshot member outside that layout
  • make confinement reject trusted artifacts and writable directories belonging to different runs
  • make cleanup-record validation use the same canonical layout, including the exact network namespace name
  • add checked host-to-jail path translation helpers for the upcoming Phase 2 adapter integration

Why

A cumulative review of NVX PRs #8718, #8724, #8731, #8763, #8779, and #8785 found that Phase 2 and Phase 3a used multiple incompatible run-layout conventions. That prevented the existing filesystem, preflight, confinement, and cleanup foundations from composing safely into a Phase 3b backend. This PR establishes one fail-closed identity contract without registering NVX in the runtime registry or exposing CLI flags.

Validation

  • npm run type-check
  • npm run lint -- --quiet
  • npm run build
  • npm test -- --runInBand src/nvx/run-layout.test.ts src/nvx/preflight.test.ts src/nvx/confinement.test.ts src/nvx/cleanup-record.test.ts (27 tests)
  • npx --no-install markdownlint-cli2 docs/nvx-security-design.md

The full macOS suite passes 6,038 tests and retains four pre-existing Phase 2 failures that require Linux /proc descriptor traversal or process-group inspection. Linux CI remains authoritative for those tests.

lpcox and others added 3 commits September 19, 2026 14:59
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6b7bb21d-a74b-4061-b1d0-ae2a18df7a8c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 20, 2026 16:29
@github-actions

github-actions Bot commented Sep 20, 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-8802 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit cbf2e6e

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

Snapshot cleanup can delete a noncanonical root path, and truncated namespace names can collide across valid run IDs.

Get a fresh assessment by requesting another Copilot review.

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

Open (2)
What changed in this PR

Introduces a canonical, identity-bound NVX run layout for Phase 3 resources and validates its use across preflight, confinement, and cleanup.

Changes:

  • Derives privileged resource paths from a validated 32-character run ID.
  • Enforces canonical artifact snapshots and matching confinement directories.
  • Aligns cleanup validation and documents the unified layout.
File Description
src/​nvx/​run-layout.ts Defines canonical run resources and guest-path translation.
src/​nvx/​run-layout.test.ts Tests layout derivation and translation.
src/​nvx/​preflight.ts Creates and validates identity-bound snapshots.
src/​nvx/​preflight.test.ts Tests canonical snapshot enforcement.
src/​nvx/​paths.ts Adds the cleanup-root constant.
src/​nvx/​index.ts Exports run-layout APIs.
src/​nvx/​confinement.ts Requires artifact and writable directories to share an ID.
src/​nvx/​confinement.test.ts Tests cross-run directory rejection.
src/​nvx/​cleanup-record.ts Validates cleanup resources against the canonical layout.
src/​nvx/​cleanup-record.test.ts Updates canonical namespace expectations.
docs/​nvx-security-design.md Documents the identity-bound layout.

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

Comment thread src/nvx/preflight.ts Outdated
Comment thread src/nvx/run-layout.ts Outdated
runDirectory: path.join(NVX_RUN_DIRECTORY_ROOT, runId),
cleanupRecordPath: path.join(NVX_CLEANUP_ROOT, `${runId}.json`),
cgroupPath: path.join(NVX_CGROUP_ROOT, runId),
networkNamespace: `awfnvx-${runId.slice(0, 20)}`,
@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 93.28% 93.26% 📉 -0.02%
Statements 91.95% 91.94% 📉 -0.01%
Functions 92.16% 91.93% 📉 -0.23%
Branches 85.78% 85.81% 📈 +0.03%
📁 Per-file Coverage Changes (4 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/confinement.ts 87.8% → 88.0% (+0.17%) 82.9% → 83.1% (+0.21%)
src/nvx/cleanup-record.ts 82.9% → 83.3% (+0.41%) 82.1% → 82.5% (+0.41%)
src/nvx/preflight.ts 61.0% → 64.3% (+3.28%) 59.8% → 63.1% (+3.35%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (1 files)
  • src/nvx/run-layout.ts: 100.0% lines

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

@github-actions

github-actions Bot commented Sep 20, 2026 •

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

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

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

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Sep 20, 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

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

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

Warning

Firewall blocked 8 domains

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

  • accounts.google.com
  • android.clients.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"
    - "android.clients.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 20, 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 20, 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 20, 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 20, 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 20, 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 20, 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 20, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Sep 20, 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 #8802

@github-actions

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

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #8802

@github-actions

This comment has been minimized.

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

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #8802

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Sep 20, 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 20, 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 #8802

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

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

Copy link
Copy Markdown
Contributor

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

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Sep 20, 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 20, 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 20, 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

Smoke Test: Copilot Engine

Overall: PASS

cc @lpcox

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

@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 failed (403)

Overall: PASS — network isolation egress enforcement working as expected. @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: 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 #8802 · claude · haiku45 · 56.5 AIC · ⊞ 4.7K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode

✅ MCP Connectivity — GitHub API responding
✅ Network Access — HTTP 200 to github.com
✅ File I/O — Smoke test marker created
✅ BYOK Inference — Agent→api-proxy→api.githubcopilot.com working

Status: PASS
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy sidecar.

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

@lpcox
lpcox deployed to aoai-model September 20, 2026 18:17 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: GitHub Actions Services Connectivity

  • Redis PING: ✅ (PONG)
  • Postgres pg_isready: ✅ (accepting connections)
  • Postgres SELECT 1: ✅ (1)

Overall: PASS

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

@lpcox
lpcox deployed to aoai-model September 20, 2026 18:17 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing

# Scenario Result
1 Module Loading ✅ otel.js loads and exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, plus internal helpers (_parseEndpoints, _parseOtlpHeaders, _buildResourceSpans, _ProxyAwareOtlpExporter, _FileSpanExporter, _FanOutSpanExporter, _createOtlpWorkloadIdentity).
2 Test Suite ✅ otel.test.js, otel-fanout.test.js, otel-workload-identity.test.js — 68/68 tests passed.
3 Env Var Forwarding ✅ src/services/agent-environment/env-passthrough.ts forwards GITHUB_AW_OTEL_TRACE_ID/GITHUB_AW_OTEL_PARENT_SPAN_ID (plus COPILOT_OTEL_FILE_EXPORTER_PATH) into the agent; src/services/api-proxy-env-config.ts forwards OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, OTEL_SERVICE_NAME, and the parent trace context into the api-proxy container.
4 Token Tracker Integration ✅ onUsage callback confirmed in token-tracker-http.js (invoked with normalized usage + model as the OTEL hook point).
5 OTEL Diagnostics ✅ 1 span exported this run (gh-aw.agent.setup, workflow-level tracing) with valid resource attributes (repo, run id, workflow ref, etc.) and no export errors. No OTEL_EXPORTER_OTLP_ENDPOINT was configured for the api-proxy container in this run, so no additional proxy-side spans were expected — consistent with graceful degradation (no errors when OTEL isn't configured).

Overall: ✅ All scenarios passed or behaved as expected. No regressions detected in the OTEL tracing integration for the api-proxy sidecar.

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

@github-actions

Copy link
Copy Markdown
Contributor

feat: add NVX Phase 3a confinement foundations
feat: add NVX phase 2 filesystem and one-shot foundations
Merged PR review: ✅
PR detail fetch: ✅
Playwright title check: ✅
File write/readback: ✅
Discussion comment: ✅
Build (npm ci + npm run build): ✅
Overall: PASS

Warning

Firewall blocked 8 domains

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

  • accounts.google.com
  • android.clients.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"
    - "android.clients.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

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. The smoke-chroot label was not added since not all tests passed.

Tested by Smoke Chroot
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 (ran ok) ✅ PASS
.NET json-parse ✅ N/A (ran ok) ✅ PASS
Go color ✅ ok ✅ PASS
Go env ✅ ok ✅ PASS
Go uuid ✅ ok ✅ 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's default ~/.m2/repository was root-owned and not writable by the runner user; both gson and caffeine were rebuilt using an alternate local repo path (-Dmaven.repo.local) with the same Squid proxy settings, and both compiled and tested successfully.
  • All other ecosystems (Bun, C++, Deno, .NET, Go, Node.js, Rust) built/installed and tested successfully on the first attempt with no proxy or network issues.

Generated by Build Test Suite for #8802 · copilot · auto · 47.9 AIC · ⊞ 11.8K · ◷
Add label ready-for-aw to run again

@lpcox
lpcox enabled auto-merge (squash) September 20, 2026 18:18
@lpcox
lpcox merged commit f33a96f into main Sep 20, 2026
173 of 180 checks passed
@lpcox
lpcox deleted the nvx-phase-3-opt-in-backend branch September 20, 2026 18:24

This branch was successfully deployed

1 active deployment
aoai-model — c8efe789 Deployed Sep 20, 2026 by lpcox via conclusion #1703
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