Skip to content

test: add provider-free Cloud Hypervisor harness observation acceptance - #11096

Open
lpcox wants to merge 8 commits into
mainfrom
lpcox-cloud-hypervisor-observation-tests
Open

lpcox wants to merge 8 commits into
mainfrom
lpcox-cloud-hypervisor-observation-tests

Conversation

@lpcox

@lpcox lpcox commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Scope

Relates to #11091 and #10294. Does not close either issue. This is only the Cloud Hypervisor validation slice; NVX is separate and Docker/ARC-DinD live acceptance remains deferred.

Adds provider-free Copilot/Claude/Codex fixture executables and a runner for the real compiled CLI → host infrastructure → Cloud Hypervisor primary guest → observation publication → command lifecycle. The test-only preload observes/delegates the real manager channel and supplies applicable test-owned floors only around the ready-runtime validator. Production source, bundled harness constraints, feed rejection, policy/network/features/effort/known-limit controls, pricing non-admission and recovery/opt-outs are unchanged.

The 13 live cases cover direct absolute/relative guest selection, actual UID/GID/cwd/env/PATH and matching login-shell request semantics, compatible admission, incompatible/unverified blocking before command entry, explicitly unconstrained legacy admission, missing/malformed/failed/oversized/timed-out probes, exact 4096/4097-byte boundaries, cancellation during a guest-marked probe and residue-free cleanup. A separate process in the actual API sidecar consumes its real report mount through the real eligibility store, request pin and routing controller with deterministic test-owned catalogue/planner/classifier responses—not provider inference. Existing smoke partial-start rollback coverage remains separately identified.

Wires separate portable and live artifacts into the existing reviewed label/dispatch-gated test-cloud-hypervisor.yml KVM job. Artifact provenance, host eligibility and execution gates remain intact. Live evidence records checkout SHA, runner/kernel/Node/Docker, infrastructure image IDs, guest artifact source/versions/digests, sanitized reports, consumer pins and cleanup results. Raw probe output/errors and the credential sentinel are not uploaded.

Corrected candidate and lifecycle regression

Current reviewed correction: d8139cd87819f40904ad2c2279c8e21d4d5eb44f.

The review-fix descendant of the original isolation audit moved an unconditional throw ahead of expected blocked-case evidence. This correction defers only the expected incompatible/unverified admission error until real proxy-consumer checks and blocked evidence complete, then rethrows the original error. Unexpected failures still propagate unchanged. Cancellation continuation, bounded/no-follow diagnostic reads, explicit report-file mode and CodeQL corrections are preserved.

Four new portable lifecycle cases exercise the actual compiled observeHarness, applicable test-owned floor validation and report publication through the preload. Expected incompatible and unverified rejections must retain real proxy-consumer evidence and the original error; unexpected errors on both blocked and nonblocked cases must remain errors. Only the guest probe, Docker transport and root-owned file metadata are simulated. The incompatible/unverified cases failed before the correction and pass afterward; these are not live guest evidence.

Label isolation audit

The workflow/gate files are unchanged from the audited 765c63d906844418f7e697ea0558b892b0c41c7e through this correction.

cloud-hypervisor-kvm appears only in the primary integration workflow's live-kvm job. This is a provider-free lane, but not a harness-fixtures-only lane: it also runs the existing shell/network/security smoke with a fake OpenAI credential sentinel. It does not import provider secrets or invoke inference. The existing build still uses GitHub Actions OIDC/provenance, artifact and checkout credentials; provider-free does not mean no CI credentials or network.

All label-triggered agentic inference jobs remain behind distinct exact event-label activation gates (ready-for-aw or test-cloud-hypervisor-* for the CH inference workflows). Credential-bearing enclave live acceptance is dispatch-only. No current workflow_run completion watcher includes the primary integration or enclave conformance workflow. Regression coverage checks full activation/dependency gate shapes and rejects broad completion wildcards, rather than only checking whether a label string is absent. No separate fixture lane is needed because the inherited CH gate does not bundle inference.

Before any authorized run, recheck the exact head, workflow gates and PR labels. Unrelated existing opt-ins can activate their own jobs on a label/synchronize event and must remain absent. No labels have been applied and no workflow has been dispatched by this work. Previous approval named an older SHA; the corrected candidate requires confirmation before activation.

Portable validation

Local environment: macOS/Darwin arm64; /dev/kvm absent.

  • Seven targeted Jest suites at d8139cd87819f40904ad2c2279c8e21d4d5eb44f: 273 tests passed (cloud-hypervisor-harness-observation, test-cloud-hypervisor-workflow, both root Cloud Hypervisor runtime suites, harness-observation, model-information-contract, model-information-eligibility).
  • Normal pre-commit lint/build and commit-message hooks passed (repository lint has existing warnings, no errors). Type-check, targeted ESLint, markdownlint and whitespace checks passed.
  • npm run build:bundle, bundled CLI --version (0.23.1) and npm run models:check previously passed at 7c7db279afbaaa54a0337245b25882f004431b50; no production code or catalogue changed in these fixture corrections.

Portable consumer tests explicitly redirect report paths and simulate file ownership in isolated child processes; they are not mounted-sidecar or KVM guest evidence. The live consumer uses neither redirect nor ownership stubbing.

Remaining acceptance gate

No live KVM guest acceptance has been established by this PR. An authorized run needs same-commit artifacts with the existing provenance/digest checks, a GitHub-hosted Ubuntu x86_64 runner with accessible KVM and cgroup v2, Docker and successful production host preflight. PR runs retain the existing explicit development-artifact opt-in; release-tag runs separately verify signer workflow and source/signer digests/ref. The new step and exact cloud-hypervisor-harness-live artifacts must pass review before #11091 can close. Earlier unrelated CH smoke, an artifact build, skipped jobs or the portable test pass are not substitutes. Actual runner/artifact failures remain blockers, not passes.

No merges, provider inference, enclave attribution, NVX producer work, Docker/ARC-DinD acceptance, sbx support, compiler overlay changes, private launch ABI or new execution-security architecture.

Add provider-free compiled CLI/guest lifecycle fixtures and real sidecar eligibility/request/routing consumer checks behind the existing KVM gate. Keep portable evidence separate and live acceptance open pending an eligible run.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI auto review requested due to automatic review settings November 4, 2026 14:59
@github-actions

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

Built from commit 20b2761

Verify label-triggered inference activation gates, dispatch-only enclave acceptance, and completion watchers stay isolated from cloud-hypervisor-kvm. Document provider-free versus CI provenance credentials and exact eligible-run prerequisites.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 4, 2026

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.69% 93.68% ➡️ -0.01%
Statements 92.22% 92.22% ➡️ +0.00%
Functions 91.46% 91.46% ➡️ +0.00%
Branches 86.45% 86.44% 📉 -0.01%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-process.ts 84.0% → 81.5% (-2.47%) 76.8% → 74.7% (-2.11%)
src/cloud-hypervisor/diagnostics.ts 88.8% → 89.2% (+0.37%) 87.5% → 87.8% (+0.35%)

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

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.

🟡 Changes recommended

Cancellation can resume the workflow after shutdown begins, triggering a fatal exit with code 1 instead of 143 and failing the final live case despite completed cleanup.

3 open issues
What changed in this PR

Adds provider-free acceptance coverage for selected-harness observations in Cloud Hypervisor primary guests, extending the existing model-eligibility validation path without changing production constraints. Live KVM acceptance remains pending; this PR does not close #11091 or #10294.

Changes:

  • Adds Copilot, Claude and Codex fixtures plus 13 live cases covering guest context, admission, probe limits, cancellation and cleanup.
  • Exercises published observations through real sidecar eligibility consumers and immutable request/routing pins.
  • Integrates separate portable and live artifacts into the existing gated KVM workflow and documents the remaining acceptance gate.
File Description
tests/​fixtures/​harness-observation/​cloud-hypervisor/​proxy-check.cjs Checks mounted reports, eligibility decisions and immutable consumer pins.
tests/​fixtures/​harness-observation/​cloud-hypervisor/​preload.cjs Instruments the compiled lifecycle and supplies test-only requirements.
tests/​fixtures/​harness-observation/​cloud-hypervisor/​executable.sh Provides deterministic harness versions and probe failure modes.
src/​cloud-hypervisor-runtime-backend.test.ts Adds probe-cancellation and cleanup regression coverage.
scripts/​ci/​cloud-hypervisor-harness-observation.test.ts Validates portable fixtures, consumers and workflow wiring.
scripts/​ci/​cloud-hypervisor-harness-observation.cjs Runs live guest cases and records sanitized provenance and cleanup evidence.
docs/​cloud-hypervisor-foundation.md Explains coverage, artifact separation and outstanding live acceptance.
.github/​workflows/​test-cloud-hypervisor.yml Adds portable/live checks and separate artifacts to the gated KVM job.

Review effort: Max (auto)

Comment on lines +234 to +235
const expectedExit = test.cancel ? 143 : test.blocked ? 1 : 23;
assert.equal(command.exitCode, expectedExit, 'unexpected CLI exit');
Comment on lines +267 to +268
assert(evidence.probeRequest, 'cancellation did not reach actual producer');
result.cancelledDuringGuestProbe = true;
@lpcox

lpcox commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback

@github-actions

github-actions Bot commented Nov 4, 2026 •

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.75% 93.74% 📉 -0.01%
Statements 92.30% 92.29% ➡️ -0.01%
Functions 91.66% 91.66% ➡️ +0.00%
Branches 86.51% 86.50% 📉 -0.01%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-process.ts 84.0% → 81.5% (-2.47%) 76.8% → 74.7% (-2.11%)
src/enclave/host-executor-server.ts 91.2% → 91.2% (+0.00%) 90.1% → 89.8% (-0.29%)

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

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Addressed the review feedback in commit 8de45ab: cancellation now waits for signal-driven cleanup, the live assertion requires an unavailable non-timeout report and exit 143, the report fixture uses mode 0644, and diagnostic reads are bounded and descriptor-based.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@lpcox

lpcox commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot merge main and resolve conflicts

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@copilot merge main and resolve conflicts

Merged latest main in two-parent commit fb3f3f8; no conflicts. Preserved the review fixes. All 284 targeted tests, lint/build hooks, type-check, syntax checks, and secret scan passed. CodeQL was invoked but skipped analysis due to database size. Live KVM acceptance remains unrun.

@lpcox

lpcox commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot merge main and resolve conflicts

Copilot AI and others added 3 commits November 4, 2026 18:29
Exercise compiled observation, applicable harness validation, report publication and proxy
consumers through the preload lifecycle. Record expected blocked evidence before rethrowing
the original error, while preserving unexpected failures and cancellation cleanup.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@copilot merge main and resolve conflicts

Merged main in 69c61c8, resolving workflow/documentation conflicts while preserving both harness suites with separate live artifacts. Preserved the concurrent review fix in final merge 5aab89b and published both. All 370 targeted tests passed, along with lint/build, type-check, model consistency, documentation/syntax checks and secret scans. CodeQL Actions passed; JavaScript analysis was skipped due to database size. No live KVM acceptance was run.

@lpcox lpcox added the cloud-hypervisor-kvm Trigger the Cloud Hypervisor live-KVM smoke/security suite label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@lpcox lpcox removed the cloud-hypervisor-kvm Trigger the Cloud Hypervisor live-KVM smoke/security suite label Nov 4, 2026

This branch has not been deployed

No deployments
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.

4 participants