feat(nvx): add internal Phase 3c lifecycle manager - #8867
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 1d2e8a4 |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The security-critical lifecycle and crash-recovery logic spans privileged processes, identities, networking, ACLs, cgroups, and destructive cleanup operations.
Review effort: Balanced
Findings: None
What changed in this PR
Adds the internal Phase 3c NVX lifecycle boundary, coordinating durable recovery records, isolated resource setup, launch/confinement hooks, and reverse-order cleanup while keeping production launch and CLI registration disabled.
Changes:
- Introduces
NvxManagerfor preflight, identity, network, filesystem, cgroup, execution, verification, and cleanup orchestration. - Adds schema-v2 cleanup records plus an atomic root-owned cleanup store and stale-resource reaper.
- Supports canonical NVX network naming while preserving shared microVM allocation data, with updated tests and security documentation.
| File | Description |
|---|---|
src/nvx/runtime-lifecycle.ts |
Binds network plans to canonical NVX run identities and updates egress endpoint syntax. |
src/nvx/runtime-lifecycle.test.ts |
Updates lifecycle tool fixtures. |
src/nvx/preflight.ts |
Adds required host tools and snapshot lifecycle hooks. |
src/nvx/manager.ts |
Implements the internal NVX lifecycle manager. |
src/nvx/manager.test.ts |
Tests ordering, rollback, fail-closed launch, and confinement handling. |
src/nvx/index.ts |
Exports manager and cleanup APIs. |
src/nvx/cleanup-store.ts |
Implements private atomic record persistence and claims. |
src/nvx/cleanup-registry.ts |
Implements journaling and exact-identity stale cleanup. |
src/nvx/cleanup-registry.test.ts |
Tests stale cleanup, account recovery, and claim exclusion. |
src/nvx/cleanup-record.ts |
Expands and validates cleanup schema v2. |
src/nvx/cleanup-record.test.ts |
Updates cleanup-record fixtures for schema v2. |
src/microvm/network-reservation.ts |
Adds validated post-allocation plan transformation. |
docs/nvx-security-design.md |
Documents the Phase 3c boundary and launch blockers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.12% | 92.13% | 📉 -0.99% |
| Statements | 91.70% | 90.67% | 📉 -1.03% |
| Functions | 91.83% | 90.19% | 📉 -1.64% |
| Branches | 85.26% | 84.08% | 📉 -1.18% |
📁 Per-file Coverage Changes (5 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/nvx/cleanup-record.ts |
85.1% → 84.1% (-0.99%) | 84.4% → 81.2% (-3.18%) |
src/nvx/runtime-lifecycle.ts |
84.5% → 84.1% (-0.37%) | 78.4% → 78.2% (-0.22%) |
src/nvx/preflight.ts |
64.3% → 64.9% (+0.63%) | 63.1% → 63.8% (+0.64%) |
src/microvm/network-reservation.ts |
52.0% → 52.8% (+0.85%) | 50.2% → 51.1% (+0.86%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (3 files)
src/nvx/cleanup-registry.ts: 41.3% linessrc/nvx/cleanup-store.ts: 70.6% linessrc/nvx/manager.ts: 82.1% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "msfeed25.pkgs.visualstudio.com"See Network Configuration for more information.
|
|
🚀 Security Guard has started processing this pull request |
|
Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...
|
|
❌ Smoke Gemini reports failed. Facets need polishing...
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
✅ Smoke Claude passed Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
✅ Build Test Suite completed successfully!
|
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...
|
|
@lpcox Smoke Test Results:
Overall: PASS
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (github.com) reachable: Overall: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
Smoke Test: Cloud Hypervisor + Copilot
Overall: ALL CHECKS PASSED Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
Smoke Test: Claude Engine Validation
Overall result: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
Smoke Test: Copilot BYOK (Direct Mode) ✅ PASS
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) via api-proxy sidecar to api.githubcopilot.com
|
Chroot Version Comparison Results
Overall: FAILED — Node.js version mismatch between host and chroot environment. The
|
|
Smoke Test: Services Connectivity
Overall: PASS
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Notes:
|
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "msfeed25.pkgs.visualstudio.com"See Network Configuration for more information.
|
Smoke Test: API Proxy OpenTelemetry Tracing — Results
Overall: ✅ All 5 scenarios pass or behave as expected. No regressions detected in OTEL module loading, span/attribute correctness, env var propagation, or token-tracker integration.
|
Summary
NvxManagerthat owns stale cleanup, preflight journaling, dedicated VMM identity allocation, collision-safe network reservation, filesystem/cgroup setup, device ACL scope, launch hooks, confinement verification, and reverse-order cleanupnvx.pyartifact layout and pre-workload readiness/TAP-selection ABI are not yet verifiedWhy
The successful Phase 3b live-KVM run proved the individual account, ACL, cgroup, namespace-policy, and cleanup primitives, but no component owned their complete lifecycle or persisted enough exact ownership evidence for crash recovery. This PR adds that internal lifecycle boundary without prematurely exposing NVX as a selectable runtime.
The review also confirmed two upstream blockers that prevent an honest production launch today:
nvx.py's requiredscripts/nvx_tools,openvmm/target/release, andbuild/layout.The manager therefore refuses the default launch rather than falling back to the unconstrained Phase 2 adapter.
Validation
npm test -- --runInBand— 379 suites passed, 6,075 tests passed, 4 skippednpm run type-checknpm run lint -- --quietnpm run buildnpx --no-install markdownlint-cli2 docs/nvx-security-design.mdgit diff --checkEvidence
Builds on the successful NVX Phase 3b live-KVM validation run: https://github.com/github/gh-aw-firewall/actions/runs/35680067333