Skip to content

fix(ci): sanitize Cloud Hypervisor enclave host startup diagnostics - #9482

Merged
lpcox merged 1 commit into
mainfrom
lpcox-enclave-startup-diagnostics
Oct 6, 2026
Merged

lpcox merged 1 commit into
mainfrom
lpcox-enclave-startup-diagnostics

Conversation

@lpcox

@lpcox lpcox commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Improve diagnosis of early AWF startup failures in the release-attested Cloud Hypervisor enclave live acceptance harness. This does not fix the unidentified AWF startup cause observed in run 37374441955.

  • Emit one fixed-schema AWF_HOST_STARTUP_DIAGNOSTIC line (at most 256 bytes) before cleanup for pre-broker child exits, signals, spawn failures, and readiness timeouts, distinguishing initial and recovery starts.
  • Prefer the existing host startup JSON record and fall back to the first AWF fatal stderr header. Classify only allowlisted known errors; otherwise explicitly report unknown. Spawn failures never inspect stale logs. Export only fixed categories/reasons and bounded child metadata, never messages, paths, timestamps, stdout/stderr, credentials, guest/repository content, or subprocess errors.
  • Reuse descriptor-based O_NOFOLLOW regular-file scanning with 16 KiB/64 KiB bounds and stability checks. Bound readiness inspection and child cleanup; keep failure exit semantics and preserve the primary error while reporting cleanup failures separately.
  • Reset logs per launch and remove AWF stdout/stderr plus startup error records even when private recovery state must be retained. No raw artifacts are uploaded. Document the diagnostics and deterministic coverage.

No changes to agent result schemas, attestation, network guards, release publication, or workflow dispatch. The immutable v0.28.35 release cannot receive this patch; release-pinned live acceptance requires a future authorized release containing it.

Validation

  • Six focused harness/artifact/release-gate/startup-fault/workflow suites: 87 tests passed.
  • Regressions cover exact shape/byte bound, known and unknown categories, newline/path/secret/repository sentinels, structured-record precedence, oversized/symlink/non-regular/changing files, real child exits/signals/spawn errors, timeouts, emission before cleanup, raw-file removal, cleanup failure/deadline behavior, and no diagnostic after broker readiness.
  • npm run build, npm run type-check, npm run lint -- --quiet, harness node --check, changed-document markdownlint, and git diff --check passed. Commit hooks also passed lint/build (existing lint warnings remain).
  • Validation performed on macOS: no Linux/KVM reproduction or live secret-bearing dispatch was performed, and the live root cause remains unresolved.

Emit bounded pre-broker diagnostics and remove private startup logs during cleanup.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 01:00
@github-actions

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

Built from commit f18d6ee

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

Broker readiness can be accepted before pending child failure events are processed, suppressing the required diagnostic.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds sanitized, bounded diagnostics for Cloud Hypervisor enclave startup failures.

Changes:

  • Classifies and emits fixed-schema startup diagnostics.
  • Bounds log inspection and cleanup.
  • Adds regression tests and documentation.
File Description
scripts/​ci/​cloud-hypervisor-enclave-live-smoke.js Implements diagnostics and cleanup safeguards.
scripts/​ci/​cloud-hypervisor-enclave-live-smoke.test.ts Tests redaction, bounds, and failure handling.
docs/​INTEGRATION-TESTS.md Documents diagnostic behavior and limitations.

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

timeout: Math.max(1, Math.min(10_000, deadline - Date.now())),
killSignal: 'SIGKILL',
});
if (result.status === 0 && ['healthy', 'running'].includes(result.stdout.trim())) return;
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 92.80% 92.81% 📈 +0.01%
Statements 91.23% 91.24% ➡️ +0.01%
Functions 89.67% 89.67% ➡️ +0.00%
Branches 84.86% 84.87% 📈 +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

@lpcox
lpcox merged commit 61108a1 into main Oct 6, 2026
31 checks passed
@lpcox
lpcox deleted the lpcox-enclave-startup-diagnostics branch October 6, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants