Skip to content

Fix capability-file race in enclave executor test - #10122

Merged
lpcox merged 2 commits into
mainfrom
copilot/fix-codeql-file-system-race
Oct 16, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/fix-codeql-file-system-race

Conversation

Copilot AI commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The capability-file test checked permissions and content through separate pathname lookups, triggering CodeQL’s file-system race finding. Use one opened descriptor for both checks while preserving the permission and content assertions.

  • Descriptor-based validation: Open with O_NOFOLLOW, check mode with fstatSync, and read content from that descriptor.
  • Cleanup: Close the descriptor in finally.
const fd = fs.openSync(file, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW);
try {
  expect(fs.fstatSync(fd).mode & 0o777).toBe(0o600);
  expect(fs.readFileSync(fd, 'utf8')).toMatch(/^[0-9a-f]{64}$/);
} finally {
  fs.closeSync(fd);
}

Copilot AI changed the title [WIP] Fix codeql file-system race in enclave host executor test Fix capability-file race in enclave executor test Oct 16, 2026
Copilot AI requested a review from lpcox October 16, 2026 18:00
@lpcox
lpcox marked this pull request as ready for review October 16, 2026 18:02
Copilot AI max review requested due to automatic review settings October 16, 2026 18:02

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 test-only change preserves coverage and reliably closes the descriptor; native CodeQL confirmation remains pending.

0 open findings

What changed in this PR

Addresses the capability-file pathname race reported in #10120 with a focused enclave executor test change.

Changes:

  • Opens the capability file with O_NOFOLLOW and checks permissions and content through the same descriptor.
  • Closes the descriptor in finally, preserving existing permission, content, and server-cleanup assertions.
File Description
src/​enclave/​host-executor-protocol.test.ts Uses descriptor-based capability-file validation with reliable cleanup.

🧠 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 Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.45% 93.46% ➡️ +0.01%
Statements 92.08% 92.09% 📈 +0.01%
Functions 90.91% 90.91% ➡️ +0.00%
Branches 86.04% 86.05% ➡️ +0.01%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.8% → 100.0% (+3.18%) 96.9% → 100.0% (+3.13%)

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

@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

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

@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

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 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

✅ 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

✨ 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 Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor

@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

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

📡 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

✅ Smoke Claude passed

Generated by Smoke Claude for #10122

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing 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 #10122

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

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

Overall result: PASS

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

@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 Copilot — PASS

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

@github-actions

Copy link
Copy Markdown
Contributor

Services smoke test: PASS

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

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

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

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com): HTTP 403 status returned (curl exit 0)
  • ✅ Blocked domain (example.com): blocked (TLS cert error from proxy)
  • Overall: PASS — @lpcox

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

@lpcox
lpcox deployed to aoai-model October 16, 2026 19:04 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

OTEL smoke results

  • ✅ S1 Module loading: otel.js loads and exports its functions.
  • ✅ S2 Tests: 3 OTEL suites, 68/68 tests passed.
  • ✅ S3 Env forwarding: env-passthrough.ts forwards the trace context, and api-proxy-env-config.ts references the OTEL vars.
  • ✅ S4 Token tracker: onUsage callback present in token-tracker-http.js.
  • ⚠️ S5 Diagnostics: only a local otel.jsonl with 1 record is available, so I could not confirm anything about exported spans.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct)

✅ GitHub MCP — connectivity verified
✅ GitHub.com — HTTP 200 OK
✅ File Write/Read — test file confirmed
✅ BYOK Inference — direct BYOK mode via api-proxy → api.githubcopilot.com

Status: PASS | Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY)

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test

  • chore: pin enclave smoke to AWF v0.28.61 ✅
  • Document shipped npm fixes and dispositions for historical alerts ✅
  • PR detail read ✅
  • Playwright title check ❌
  • File write/read ✅
  • AWF build ✅
  • Overall: FAIL

🔮 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

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

Result: Not all tests passed (Node.js version mismatch), so the smoke-chroot label was not added.

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 ✅ 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: Bun/Deno were installed via npm (the curl install scripts were blocked); .NET needed XDG_RUNTIME_DIR set and Maven needed -Dmaven.repo.local because ~/.m2/repository wasn't writable.

Generated by Build Test Suite for #10122 · copilot · auto · 28.1 AIC · ⊞ 12K · ◷
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 564a373 into main Oct 16, 2026
140 of 150 checks passed
@lpcox
lpcox deleted the copilot/fix-codeql-file-system-race branch October 16, 2026 19:18

This branch had an error being deployed

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

fix: resolve CodeQL file-system race in enclave host executor test

3 participants