feat: integrate Firecracker primary-agent runtime preview - #7136
Conversation
There was a problem hiding this comment.
Pull request overview
Integrates the Firecracker preview as an executable primary-agent runtime backed by Compose infrastructure and vsock transport.
Changes:
- Adds runtime validation, artifact/tool preflight, and infrastructure discovery.
- Implements VM execution, stdio forwarding, probing, cleanup, and preservation.
- Adds supervisor configuration across CLI, schema, and documentation.
Show a summary per file
| File | Description |
|---|---|
src/types/runtime-options.ts |
Adds supervisor artifact options. |
src/firecracker/runtime-validation.ts |
Validates Firecracker compatibility. |
src/firecracker/preflight.ts |
Checks artifacts and host tools. |
src/firecracker/preflight.test.ts |
Tests expanded preflight. |
src/firecracker/manager.ts |
Adds runtime controls and preservation. |
src/firecracker/manager.test.ts |
Tests preserved runtime state. |
src/firecracker/infrastructure.ts |
Discovers and validates Docker topology. |
src/firecracker/infrastructure.test.ts |
Tests topology validation. |
src/firecracker/config.test.ts |
Tests supervisor configuration. |
src/firecracker-runtime-backend.ts |
Implements Firecracker execution lifecycle. |
src/firecracker-runtime-backend.test.ts |
Tests backend execution and isolation. |
src/external-runtime-backend.ts |
Adds optional preservation lifecycle. |
src/external-runtime-backend.test.ts |
Updates preview-resolution tests. |
src/external-runtime-backend-resolver.ts |
Enforces preview opt-in. |
src/config-mapper.ts |
Maps supervisor settings. |
src/config-file.ts |
Extends file configuration typing. |
src/commands/validators/security-mode.ts |
Applies Firecracker topology security. |
src/commands/validators/config-assembly.ts |
Integrates runtime validation. |
src/commands/main-action.ts |
Coordinates preservation and cleanup. |
src/commands/build-config.ts |
Builds supervisor configuration. |
src/cli-options.ts |
Adds supervisor CLI flags. |
src/awf-config-schema.json |
Updates source schema. |
docs/awf-config.schema.json |
Updates published schema. |
docs/awf-config-spec.md |
Documents workload preview requirements. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 24/24 changed files
- Comments generated: 5
- Review effort level: Balanced
| await this.dependencies.startInfrastructure( | ||
| workDir, | ||
| allowedDomains, | ||
| proxyLogsDir, | ||
| skipPull, | ||
| onNetworkReady, | ||
| onInfrastructureReady, | ||
| ); |
| identity: () => ({ | ||
| uid: Number(getSafeHostUid()), | ||
| gid: Number(getSafeHostGid()), | ||
| }), |
| const timeoutMs = agentTimeoutMinutes === undefined | ||
| ? undefined | ||
| : agentTimeoutMinutes * 60_000; |
| const onData = (chunk: Buffer | string): void => { | ||
| const data = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk); | ||
| void manager.writeStdin(data, requestId).catch((error) => { | ||
| this.dependencies.logger.warn( |
| const searchPath = process.env.PATH ?? ''; | ||
| for (const directory of searchPath.split(path.delimiter)) { | ||
| if (!directory) continue; | ||
| try { | ||
| await fs.access(path.join(directory, tool), constants.X_OK); |
7e92edc to
40bab00
Compare
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.06% | 92.23% | 📉 -0.83% |
| Statements | 91.94% | 91.10% | 📉 -0.84% |
| Functions | 91.95% | 90.46% | 📉 -1.49% |
| Branches | 84.70% | 83.76% | 📉 -0.94% |
📁 Per-file Coverage Changes (7 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/validators/config-assembly.ts |
100.0% → 69.7% (-30.31%) | 100.0% → 69.7% (-30.31%) |
src/firecracker-runtime-backend.ts |
82.3% → 73.4% (-8.92%) | 82.3% → 69.8% (-12.50%) |
src/firecracker/manager.ts |
83.8% → 76.7% (-7.06%) | 81.1% → 74.2% (-6.96%) |
src/external-runtime-backend-resolver.ts |
100.0% → 93.8% (-6.25%) | 100.0% → 93.8% (-6.25%) |
src/firecracker/preflight.ts |
72.3% → 66.7% (-5.64%) | 72.7% → 66.3% (-6.47%) |
src/commands/main-action.ts |
94.7% → 91.7% (-3.07%) | 94.8% → 91.1% (-3.68%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/firecracker/infrastructure.ts: 74.6% linessrc/firecracker/runtime-validation.ts: 71.8% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
1 similar comment
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.06% | 92.23% | 📉 -0.83% |
| Statements | 91.94% | 91.10% | 📉 -0.84% |
| Functions | 91.95% | 90.46% | 📉 -1.49% |
| Branches | 84.70% | 83.76% | 📉 -0.94% |
📁 Per-file Coverage Changes (7 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/validators/config-assembly.ts |
100.0% → 69.7% (-30.31%) | 100.0% → 69.7% (-30.31%) |
src/firecracker-runtime-backend.ts |
82.3% → 73.4% (-8.92%) | 82.3% → 69.8% (-12.50%) |
src/firecracker/manager.ts |
83.8% → 76.7% (-7.06%) | 81.1% → 74.2% (-6.96%) |
src/external-runtime-backend-resolver.ts |
100.0% → 93.8% (-6.25%) | 100.0% → 93.8% (-6.25%) |
src/firecracker/preflight.ts |
72.3% → 66.7% (-5.64%) | 72.7% → 66.3% (-6.47%) |
src/commands/main-action.ts |
94.7% → 91.7% (-3.07%) | 94.8% → 91.1% (-3.68%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/firecracker/infrastructure.ts: 74.6% linessrc/firecracker/runtime-validation.ts: 71.8% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
40bab00 to
68bcff3
Compare
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.06% | 92.23% | 📉 -0.83% |
| Statements | 91.94% | 91.10% | 📉 -0.84% |
| Functions | 91.95% | 90.46% | 📉 -1.49% |
| Branches | 84.70% | 83.76% | 📉 -0.94% |
📁 Per-file Coverage Changes (7 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/validators/config-assembly.ts |
100.0% → 69.7% (-30.31%) | 100.0% → 69.7% (-30.31%) |
src/firecracker-runtime-backend.ts |
82.3% → 73.4% (-8.92%) | 82.3% → 69.8% (-12.50%) |
src/firecracker/manager.ts |
83.8% → 76.7% (-7.06%) | 81.1% → 74.2% (-6.96%) |
src/external-runtime-backend-resolver.ts |
100.0% → 93.8% (-6.25%) | 100.0% → 93.8% (-6.25%) |
src/firecracker/preflight.ts |
72.3% → 66.7% (-5.64%) | 72.7% → 66.3% (-6.47%) |
src/commands/main-action.ts |
94.7% → 91.7% (-3.07%) | 94.8% → 91.1% (-3.68%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/firecracker/infrastructure.ts: 74.6% linessrc/firecracker/runtime-validation.ts: 71.8% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
1 similar comment
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.06% | 92.23% | 📉 -0.83% |
| Statements | 91.94% | 91.10% | 📉 -0.84% |
| Functions | 91.95% | 90.46% | 📉 -1.49% |
| Branches | 84.70% | 83.76% | 📉 -0.94% |
📁 Per-file Coverage Changes (7 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/validators/config-assembly.ts |
100.0% → 69.7% (-30.31%) | 100.0% → 69.7% (-30.31%) |
src/firecracker-runtime-backend.ts |
82.3% → 73.4% (-8.92%) | 82.3% → 69.8% (-12.50%) |
src/firecracker/manager.ts |
83.8% → 76.7% (-7.06%) | 81.1% → 74.2% (-6.96%) |
src/external-runtime-backend-resolver.ts |
100.0% → 93.8% (-6.25%) | 100.0% → 93.8% (-6.25%) |
src/firecracker/preflight.ts |
72.3% → 66.7% (-5.64%) | 72.7% → 66.3% (-6.47%) |
src/commands/main-action.ts |
94.7% → 91.7% (-3.07%) | 94.8% → 91.1% (-3.68%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/firecracker/infrastructure.ts: 74.6% linessrc/firecracker/runtime-validation.ts: 71.8% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
68bcff3 to
d72644b
Compare
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.06% | 92.26% | 📉 -0.80% |
| Statements | 91.93% | 91.12% | 📉 -0.81% |
| Functions | 92.08% | 90.67% | 📉 -1.41% |
| Branches | 84.78% | 83.86% | 📉 -0.92% |
📁 Per-file Coverage Changes (7 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/validators/config-assembly.ts |
100.0% → 69.7% (-30.31%) | 100.0% → 69.7% (-30.31%) |
src/firecracker-runtime-backend.ts |
82.3% → 73.4% (-8.92%) | 82.3% → 69.8% (-12.50%) |
src/external-runtime-backend-resolver.ts |
100.0% → 93.8% (-6.25%) | 100.0% → 93.8% (-6.25%) |
src/firecracker/manager.ts |
83.1% → 77.3% (-5.84%) | 80.5% → 74.7% (-5.78%) |
src/firecracker/preflight.ts |
75.3% → 70.2% (-5.09%) | 75.0% → 69.4% (-5.62%) |
src/commands/main-action.ts |
94.8% → 91.8% (-3.03%) | 94.8% → 91.2% (-3.64%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/firecracker/infrastructure.ts: 74.6% linessrc/firecracker/runtime-validation.ts: 71.8% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
d72644b to
27842a4
Compare
27842a4 to
10ac870
Compare
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.08% | 92.26% | 📉 -0.82% |
| Statements | 91.95% | 91.12% | 📉 -0.83% |
| Functions | 92.16% | 90.67% | 📉 -1.49% |
| Branches | 84.80% | 83.86% | 📉 -0.94% |
📁 Per-file Coverage Changes (7 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/validators/config-assembly.ts |
100.0% → 69.7% (-30.31%) | 100.0% → 69.7% (-30.31%) |
src/firecracker-runtime-backend.ts |
82.3% → 73.4% (-8.92%) | 82.3% → 69.8% (-12.50%) |
src/firecracker/manager.ts |
84.4% → 77.3% (-7.14%) | 81.8% → 74.7% (-7.04%) |
src/external-runtime-backend-resolver.ts |
100.0% → 93.8% (-6.25%) | 100.0% → 93.8% (-6.25%) |
src/firecracker/preflight.ts |
75.3% → 70.2% (-5.09%) | 75.0% → 69.4% (-5.62%) |
src/commands/main-action.ts |
94.8% → 91.8% (-3.03%) | 94.8% → 91.2% (-3.64%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/firecracker/infrastructure.ts: 74.6% linessrc/firecracker/runtime-validation.ts: 71.8% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
3 similar comments
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.08% | 92.26% | 📉 -0.82% |
| Statements | 91.95% | 91.12% | 📉 -0.83% |
| Functions | 92.16% | 90.67% | 📉 -1.49% |
| Branches | 84.80% | 83.86% | 📉 -0.94% |
📁 Per-file Coverage Changes (7 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/validators/config-assembly.ts |
100.0% → 69.7% (-30.31%) | 100.0% → 69.7% (-30.31%) |
src/firecracker-runtime-backend.ts |
82.3% → 73.4% (-8.92%) | 82.3% → 69.8% (-12.50%) |
src/firecracker/manager.ts |
84.4% → 77.3% (-7.14%) | 81.8% → 74.7% (-7.04%) |
src/external-runtime-backend-resolver.ts |
100.0% → 93.8% (-6.25%) | 100.0% → 93.8% (-6.25%) |
src/firecracker/preflight.ts |
75.3% → 70.2% (-5.09%) | 75.0% → 69.4% (-5.62%) |
src/commands/main-action.ts |
94.8% → 91.8% (-3.03%) | 94.8% → 91.2% (-3.64%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/firecracker/infrastructure.ts: 74.6% linessrc/firecracker/runtime-validation.ts: 71.8% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.08% | 92.26% | 📉 -0.82% |
| Statements | 91.95% | 91.12% | 📉 -0.83% |
| Functions | 92.16% | 90.67% | 📉 -1.49% |
| Branches | 84.80% | 83.86% | 📉 -0.94% |
📁 Per-file Coverage Changes (7 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/validators/config-assembly.ts |
100.0% → 69.7% (-30.31%) | 100.0% → 69.7% (-30.31%) |
src/firecracker-runtime-backend.ts |
82.3% → 73.4% (-8.92%) | 82.3% → 69.8% (-12.50%) |
src/firecracker/manager.ts |
84.4% → 77.3% (-7.14%) | 81.8% → 74.7% (-7.04%) |
src/external-runtime-backend-resolver.ts |
100.0% → 93.8% (-6.25%) | 100.0% → 93.8% (-6.25%) |
src/firecracker/preflight.ts |
75.3% → 70.2% (-5.09%) | 75.0% → 69.4% (-5.62%) |
src/commands/main-action.ts |
94.8% → 91.8% (-3.03%) | 94.8% → 91.2% (-3.64%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/firecracker/infrastructure.ts: 74.6% linessrc/firecracker/runtime-validation.ts: 71.8% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.08% | 92.26% | 📉 -0.82% |
| Statements | 91.95% | 91.12% | 📉 -0.83% |
| Functions | 92.16% | 90.67% | 📉 -1.49% |
| Branches | 84.80% | 83.86% | 📉 -0.94% |
📁 Per-file Coverage Changes (7 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/validators/config-assembly.ts |
100.0% → 69.7% (-30.31%) | 100.0% → 69.7% (-30.31%) |
src/firecracker-runtime-backend.ts |
82.3% → 73.4% (-8.92%) | 82.3% → 69.8% (-12.50%) |
src/firecracker/manager.ts |
84.4% → 77.3% (-7.14%) | 81.8% → 74.7% (-7.04%) |
src/external-runtime-backend-resolver.ts |
100.0% → 93.8% (-6.25%) | 100.0% → 93.8% (-6.25%) |
src/firecracker/preflight.ts |
75.3% → 70.2% (-5.09%) | 75.0% → 69.4% (-5.62%) |
src/commands/main-action.ts |
94.8% → 91.8% (-3.03%) | 94.8% → 91.2% (-3.64%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/firecracker/infrastructure.ts: 74.6% linessrc/firecracker/runtime-validation.ts: 71.8% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
10ac870 to
064a910
Compare
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.12% | 92.30% | 📉 -0.82% |
| Statements | 92.00% | 91.16% | 📉 -0.84% |
| Functions | 92.24% | 90.74% | 📉 -1.50% |
| Branches | 84.84% | 83.90% | 📉 -0.94% |
📁 Per-file Coverage Changes (7 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/validators/config-assembly.ts |
100.0% → 69.7% (-30.31%) | 100.0% → 69.7% (-30.31%) |
src/firecracker-runtime-backend.ts |
82.3% → 73.4% (-8.92%) | 82.3% → 69.8% (-12.50%) |
src/firecracker/manager.ts |
85.1% → 77.8% (-7.22%) | 83.0% → 75.8% (-7.19%) |
src/external-runtime-backend-resolver.ts |
100.0% → 93.8% (-6.25%) | 100.0% → 93.8% (-6.25%) |
src/firecracker/preflight.ts |
75.3% → 70.2% (-5.09%) | 75.0% → 69.4% (-5.62%) |
src/commands/main-action.ts |
94.8% → 91.8% (-3.03%) | 94.8% → 91.2% (-3.64%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (2 files)
src/firecracker/infrastructure.ts: 74.6% linessrc/firecracker/runtime-validation.ts: 71.8% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
064a910 to
57e9624
Compare
|
✅ Smoke Claude passed
|
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...
|
|
🛡️ 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 OTel Tracing completed. All tracing scenarios validated. ✅
|
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...
|
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
❌ Smoke Gemini reports failed. Facets need polishing...
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤
|
|
❌ Contribution Check failed. Please review the logs for details.
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Warning Firewall blocked 5 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "msfeed12.pkgs.visualstudio.com"
- "msfeed17.pkgs.visualstudio.com"
- "msfeed2.pkgs.visualstudio.com"
- "msfeed25.pkgs.visualstudio.com"
- "registry.npmjs.org"See Network Configuration for more information.
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
🚀 Security Guard has started processing this pull request |
|
@lpcox Network isolation egress smoke test results: EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (api.github.com) reachable — HTTP 200 Overall status: 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: Claude Engine Validation
Overall result: PASS
|
|
Smoke Test: Copilot BYOK (Direct) Mode Recent merged PRs:
Note: Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com Overall: PASS cc @lpcox
|
|
Smoke Test: Copilot Engine
Overall: PASS PRs checked: #7156 [docs] auth: Mark gh-aw#50053 MCP OIDC boundary work as resolved, #7153 Drive Google provider adapters (Gemini, Vertex) from declarative specs cc @lpcox
|
Smoke Test Results: GitHub Actions Services Connectivity
Overall: FAIL —
|
Chroot Version Comparison
Overall: FAILED - Node.js version differs between host and chroot environments.
|
Smoke Test: API Proxy OTEL Tracing — Results
Overall: All 5 scenarios passed. No issues found.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Note: Java tests required
|
Smoke Test: Docker Sbx — PASS ✅
PR #7156: Mark gh-aw#50053 MCP OIDC boundary work as resolved Overall status: PASS cc @lpcox
|
|
Smoke test on PR #7136 Warning Firewall blocked 5 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "msfeed12.pkgs.visualstudio.com"
- "msfeed17.pkgs.visualstudio.com"
- "msfeed2.pkgs.visualstudio.com"
- "msfeed25.pkgs.visualstudio.com"
- "registry.npmjs.org"See Network Configuration for more information.
|
Stack
Layer 5/6, based exactly on
lpcox-firecracker-guest-transportat0347f8faa384818d9597d7e8dbebc16ad0b5d6f1.Depends on #7135 and the lower Firecracker stack (#7129, #7133, #7134, #7135).
Summary
--container-runtime firecracker --firecracker-previewthrough the external runtime backend while Compose runs infrastructure only--keep-containersa safe Firecracker equivalent: quiesce/copy back first, then preserve jail, images, netns, and Compose infrastructurePreview prerequisites
Linux x86_64/aarch64 with readable/writable KVM, a host-visible local Unix-socket Docker daemon, Firecracker/jailer v1.16.1,
ip,nft,mke2fs,debugfs,e2fsck, andrsync. Kernel, rootfs, built AWF guest supervisor, Firecracker, and jailer must all be supplied with SHA-256 digests.Validation
npm run buildgo test ./...Remaining layer 6 work
Broader KVM-backed CI, long-form operational/security documentation, release artifact workflow, rollout policy, and production enablement remain intentionally deferred to layer 6.