Skip to content

Extract shared private cleanup-file writer - #10064

Merged
lpcox merged 2 commits into
mainfrom
copilot/duplicate-code-shared-cleanup-file-helper
Oct 16, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/duplicate-code-shared-cleanup-file-helper

Conversation

Copilot AI commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The NVX and Cloud Hypervisor cleanup stores duplicated private-file creation, writing, syncing, and closing logic. This duplication risked behavioral drift between cleanup persistence paths.

  • Shared utility
    • Added src/private-file.ts with the common exclusive mode-0600 write-through implementation.
  • Cleanup stores
    • Updated NVX and Cloud Hypervisor stores to pass their open dependency to the shared helper.
    • Removed duplicated local helpers while preserving existing atomicity and cleanup behavior.
await writePrivateFile(
  dependencies.open,
  temporaryPath,
  contents,
);

Copilot AI changed the title [WIP] Refactor shared cleanup-file writer helper to reduce duplication Extract shared private cleanup-file writer Oct 16, 2026
Copilot AI requested a review from lpcox October 16, 2026 03:33
@lpcox
lpcox marked this pull request as ready for review October 16, 2026 03:34
Copilot AI max review requested due to automatic review settings October 16, 2026 03:34

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.

🟢 Approval recommended

The focused extraction preserves existing behavior and introduces no blocking issues.

0 open findings

What changed in this PR

Extracts duplicated private-file writing into a shared utility for the NVX and Cloud Hypervisor cleanup stores.

Changes:

  • Centralizes exclusive mode-0600 creation, writing, syncing, and closing.
  • Updates both stores to use the helper while preserving existing persistence behavior.
File Description
src/​private-file.ts Adds the shared private-file writer.
src/​nvx/​cleanup-store.ts Replaces the local writer with the shared helper.
src/​cloud-hypervisor/​cleanup-record-store.ts Uses the shared helper for records and claims.

🧠 Review effort: Max


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

@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

⚠️ Coverage Regression Detected

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

Overall Coverage

Metric Base PR Delta
Lines 93.19% 93.19% ➡️ +0.00%
Statements 91.77% 91.77% ➡️ +0.00%
Functions 90.68% 90.67% 📉 -0.01%
Branches 85.63% 85.64% 📈 +0.01%
📁 Per-file Coverage Changes (3 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/cleanup-store.ts 70.6% → 69.1% (-1.45%) 65.6% → 64.0% (-1.55%)
src/cloud-hypervisor/cleanup-record-store.ts 97.9% → 97.8% (-0.07%) 94.6% → 94.4% (-0.17%)
src/log-directory-setup.ts 96.8% → 100.0% (+3.18%) 96.9% → 100.0% (+3.13%)
✨ New Files (1 files)
  • src/private-file.ts: 100.0% lines

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

@lpcox
lpcox enabled auto-merge (squash) October 16, 2026 04:36
@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

github-actions Bot commented Oct 16, 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 Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Generated by Smoke Claude for #10064

@github-actions

github-actions Bot commented Oct 16, 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

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 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #10064

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Oct 16, 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 16, 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 Oct 16, 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 Oct 16, 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

github-actions Bot commented Oct 16, 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 16, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@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

Smoke Test: Claude Engine Validation

Check Status
API ✅ PASS
GH CLI ✅ PASS
File ✅ PASS

Overall result: PASS

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode ✅ PASS

  • ✅ MCP connectivity: Verified
  • ✅ GitHub.com HTTP: 200 OK
  • ✅ File I/O: Readable
  • ✅ BYOK inference: Direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com working

All smoke tests passed. Running in direct BYOK mode as expected.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Copilot — PR: "Extract shared private cleanup-file writer"

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

@github-actions github-actions Bot added smoke-copilot smoke-copilot-network-isolation Copilot network-isolation egress smoke test labels Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass
✅ Allowed (api.github.com): HTTP 403 received (reachable)
✅ Blocked (example.com): blocked
Overall: PASS — cc @lpcox

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

@github-actions

Copy link
Copy Markdown
Contributor

OTEL smoke test

  • ✅ S1: otel.js loads; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled
  • ✅ S2: OTEL tests pass, 3 suites, 68 tests
  • ✅ S3: env forwarding present (env-passthrough.ts trace/parent IDs; api-proxy-env-config.ts OTEL vars)
  • ✅ S4: onUsage hook exists in token-tracker-http.js
  • ✅ S5: otel.jsonl present with 1 record (no api-proxy spans expected in this run)

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke services: ✅ Redis PONG · ✅ pg_isready accepting connections · ✅ SELECT 1 = 1. PASS

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

@github-actions

Copy link
Copy Markdown
Contributor

feat: correlate enclave handoff and VMM launch diagnostics — ❌
Extract shared private cleanup-file writer — ✅
PR detail lookup — ✅
Playwright title check — ❌
Temp file write/read — ✅
Build (npm ci && npm run build) — ✅
Discussion comment — ✅
Overall: FAIL

🔮 The oracle has spoken through Smoke Codex
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 ❌ not run ❌ FAIL
Bun hono ❌ not run ❌ FAIL
C++ fmt ✅ N/A ✅ PASS
C++ json ✅ N/A ✅ PASS
Deno oak ❌ not run ❌ FAIL
Deno std ❌ not run ❌ FAIL
.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 ✅ all passed ✅ PASS
Node.js execa ✅ all passed ✅ PASS
Node.js p-limit ✅ all passed ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 6/8 ecosystems passed — FAIL

Failures

  • Bun and Deno: the curl | bash / curl | sh installer commands were denied by the sandbox permission policy, so neither tool was installed and no tests ran. The sandbox did not bypass this.
  • Workarounds used for the passing ecosystems: .NET needed XDG_RUNTIME_DIR and DOTNET_CLI_HOME set to writable paths, and Maven needed a writable -Dmaven.repo.local. Both failed on their first runs because of the runner's home and runtime directories.

The build-test label was not added because not all ecosystems passed.

Generated by Build Test Suite for #10064 · copilot · auto · 18 AIC · ⊞ 12K · ◷
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.21.0 v2.98.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

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

@lpcox
lpcox merged commit ae65ae2 into main Oct 16, 2026
147 of 158 checks passed
@lpcox
lpcox deleted the copilot/duplicate-code-shared-cleanup-file-helper branch October 16, 2026 04:56

This branch had an error being deployed

1 failed deployment
aoai-model — 5041f08e Deployed Oct 16, 2026 by lpcox via conclusion #1975
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.

[Duplicate Code] Shared cleanup-file writer helper

3 participants