Skip to content

tests: gate Linux restore-view exclusion (SL2.15) - #1457

Merged
Pedro Henrique Penna (ppenna) merged 7 commits into
feature/nvx-refactorfrom
esaurez/issue1103-sl215-20261110-c3e21e47
Nov 11, 2026
Merged

Pedro Henrique Penna (ppenna) merged 7 commits into
feature/nvx-refactorfrom
esaurez/issue1103-sl215-20261110-c3e21e47

Conversation

@esaurez

@esaurez Enrique Saurez (esaurez) commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1103 (SL2.15), in #1076. Does not close the SL2.16/SL2.18 work in that issue.

Adds the Linux real-VM restore-exclusion gate and its platform-aware consolidated-suite registration. This sync replays only the seven owned commits from historical fork 2a0451d4ed1e27445bcd4615e7c0878c291edca5 through original remote head 970046d4d03517658808275c673eb9abadeeabab onto already-published PR #1455 source 1148a7487995e02f3a39c6cf384f5d6d825f40ce. The resulting head is 27994d47a389f64ee51ae37d9b05cc4de30d471a, tree ee150f1db1803556772e8d0ee21452a0a8368ab8.

The selected producer's actual source lower is 8d6cbce4e649ae2dc6a9275f61541135171bd854. PR #1455's mutable base subsequently advanced to e976e5c307f396807854ebfe6cff0efb289ba754; that newer lower is not imported or qualified here. The PR's existing base branch, Draft state, labels and actual native-stack membership are preserved.

Rebase onto feature/nvx-refactor

#1455 and #1453 merged, so the branch now holds only its seven own commits, rebased onto cfdb452f29c898cd39c4691b9a12fabc14ca1bca as 48847d006a..d6b70447d5d0fd8843332a51a32e9b5884255e73 (tree 42a22938a69b48491420690142c8ff383df9138e). git range-diff 1148a74879..27994d47a3 cfdb452f29..d6b70447d5 reports all seven patches identical, and the rebase resolved no conflicts. The inherited #1454 and #1455 commits are dropped because they landed in the base. Since the base holds #1455's third commit, which moves VmDir into the private host::vm_directory below both host::snapshot and host::vm, the known host-module cycle below no longer applies. check_test_changes.py --base origin/feature/nvx-refactor reports the same 4 changed existing test items and 36 added items as the accounting below.

Rechecked on Windows at d6b70447: the 16 RuntimeAdapterSuiteTests, Ruff lint and format of both changed Python files, Pyright of runtime_adapter_tests.py for Windows and Linux, and the runtime adapter's rustfmt and Clippy with -D warnings for the host feature on Windows and on x86_64-unknown-linux-musl. CI runs the remaining gates, including the Linux real-VM gate.

Exact owned-change preservation

The seven original commits (89e324b8, 32c63815, 673f9252, 32834506, 7be6836f, 794cafb7, 970046d4) replay cleanly. Every individual source patch and the aggregate own-range patch are byte-identical; only commit ancestry and the current-session trailers change. All six final gate/runner/inventory/documentation blobs exactly match original 970046.

In particular, tests/runtime-adapter/tests/vm_clone.rs remains Git blob c7e6ab682f5575003e79bcdb3451f2e110a721e1: all four gate oracles, both retained regressions, FIFO synchronization, helper rendezvous and assertions are unchanged. The entire nvx-rs subtree exactly matches selected producer 1148; no production permission implementation, restore API, native source/pin, guest/kernel input, lock storage or fallback is added by this sync. Native remains 14dc4116ec7e57567633c4b7b07892aca3a58522.

Inherited privacy finding: fixed by adopting existing producer logic

Finding 4531202369 is valid on the old 970046/2a0451 source: both APIs directly used the legacy capture validator, whose Linux private_file_problem deliberately returns no per-file refusal.

Published producer 1148 already fixes this at the snapshot boundary. Its existing check_openvmm first preserves legacy validation and then calls strict check_file on each manifest.bin, memory.bin and state.bin. On Linux, that refuses a different effective UID or any mode bits in 0077; both Snapshot::open and finish_capture call this same boundary. Windows keeps its owner-only ACL/reparse checks. The legacy template validator and generic Linux private-file policy are unchanged.

Existing regressions cover shared permissions for all artifacts through opening and finishing, including the finalizer's per-artifact 0640 refusal followed by restored 0600, links, FIFOs and sockets; Windows covers shared ACLs and reparse entries through both APIs. The root-only foreign-owner mutation regression remains explicitly ignored: source inspection establishes the common UID guard, not a falsely claimed privileged execution.

Platform-aware inventory, already corrected before this sync

Finding 4530276205 was already addressed by original 794cafb7 plus 970046d4, not a second new unfixed bug. scenarios.txt accepts TARGET TEST [linux|windows]; unqualified entries run on both. The restore-exclusion gate is explicitly linux, matching its Rust cfg, and is excluded on Windows.

Malformed lines, unknown qualifiers and global duplicate target/test pairs fail before filtering. The same selected list drives strict Cargo/libtest inventory, exact --include-ignored execution and counts. Missing/unlisted tests and ignored tests in the library or unnamed targets remain errors. No discovery-based omission, suppressed failure or weakened Rust assertion is introduced.

Existing-test accounting

Existing asset Disposition retained unchanged by the sync
RuntimeAdapterSuiteTests.test_scenarios_refuse_other_lines Keeps malformed/duplicate/empty-inventory checks; distinguishes unknown qualifiers and checks both platforms, including off-platform duplicates
RuntimeAdapterSuiteTests.test_the_adapter_s_readme_lists_its_scenarios Keeps exact documentation/inventory correspondence for both platforms, including module-qualified names and documented qualifiers
tests/runtime-adapter/scenarios.txt Documents the optional qualifier and adds only the exact Linux-only restore gate
read_scenarios in scripts/nvx_tools/runtime_adapter_tests.py Adds explicit selection while retaining visible parse/duplicate failures and strict downstream inventory/execution checks

Three focused Python tests retain platform/order selection, identical check-only/execution/count selection and unexpected/ignored-test failures. No existing Rust test is rewritten or retired. Exact-parent accounting reports 4 existing-test asset changes and 36 added test items: the original 33 Rust items plus 3 Python tests.

Measured own delta remains 11 core lines and 1 counted non-test Python file, with the exact original 510 added Rust test lines. The complete own range touches 6 files; this sync adds no source changes beyond replaying it.

Current prepared-source checks

Both fresh private checkouts have real Git metadata and exact native source/Cargo files at 14dc4116ec7e57567633c4b7b07892aca3a58522. verify preceded every Cargo command. Rust formatting for both crates and the adapter's cargo build --locked --features host passed on both hosts.

Actual platform Exact-head focused snapshot tests Actual platform-selected compile/list inventory
Linux/MSHV cargo test --locked --lib --manifest-path nvx-rs/Cargo.toml -- host::snapshot::: 99 passed, 1 root-only ownership test ignored python3 scripts/nvx.py test-runtime-adapter --backend mshv --check-only: 157 scenarios / 11 targets, Linux gate included
Windows/WHP cargo test --locked --lib --manifest-path nvx-rs\Cargo.toml -- host::snapshot::: 97 passed, 0 ignored python scripts\nvx.py test-runtime-adapter --backend whp --check-only: 156 scenarios / 11 targets, Linux gate excluded

These are actual prepared-source compilations, privacy-regression executions and Cargo/libtest-list inventory checks, not inherited parent receipts or mocked discovery. Check-only runs execute no VM scenario. Windows MSVC setup and all Cargo descendants ran in the same cmd.exe environment; private targets/caches and fresh physical/commit-memory/disk admission were used on both hosts.

At this exact head, the preserved Python RuntimeAdapterSuiteTests pass (16 tests), along with affected-file Ruff 0.15.22 lint/format, Pyright 1.1.411 for Linux and Windows (0 type errors/warnings), targeted compileall, test layout, Markdown links and exact-parent test accounting.

Known inherited quality failure: canonical 1148 has a host-module dependency cycle (snapshot/capture imports vm, while vm imports snapshot). The independently classified PR #1455 CI run 42913894943 fails host_modules::the_children_of_host_depend_on_one_another_without_cycles on both hosts (21 passed, 1 failed, exit 101) on the actual 1148/8d6 merge source, not merely because its mutable base moved. This sync preserves that exact producer subtree; it neither patches, suppresses nor allowlists the failure, and claims neither all-quality nor full-CI green. Producer repair is separate work.

Original hardware proof stays bound to original 7be

All four cases passed on Linux/MSHV at original gate head 7be6836f5d9bf465588810a19bb488e8a91f5ee9, tree bea48db54d9f4b32da44e20ec2e3c23a506c4469:

Case Actual historical outcome at 7be
Concurrent live restores under one caller-owned file lock, including view creation/removal Four complete Activate/Start/Ping/Stop lifecycles with overlapping VMMs
Unlocked memory-file link addition during restore startup Native generation-change error, non-success exit and no ready connection
Controller killed before the VMM connects restore-ready Verified SIGKILL, native readiness-connect error and VMM exit
Link change after the authenticated VMM connects restore-ready Exact ready event and complete lifecycle

The native artifact_open record and blocking --log-file FIFO still provide the ordering boundary. The capability pipe is written/closed before spawn; the nonblocking FIFO reader stays owned until VMM reaping, and the link helper waits until its PID/start identity is recorded. No production hook, synthetic VMM or fallback is used.

Both openvmm_reads_none_of_the_host_s_input_until_the_repair_acknowledges_the_restore and a_clone_reads_no_more_of_its_disks_than_its_root_needs passed in that same original invocation. Original hardware, software-matrix and scoped-review receipts remain historical evidence only, retained under D:\copilot\nvx-slim-1076\runs\sl215-20261110 and the original handoffs.

No VM/hardware scenario, KVM/WHP hardware gate, native/kernel/guest rebuild, broad matrix, MSRV or new manual logical review was run solely for this unchanged replay. No future lower/producer graph is qualified. Copilot review and full CI remain separate from these focused checks; a request's admission, pending state or Draft skip is not a verdict.

This pull request is ready for review on feature/nvx-refactor; its review threads are answered and resolved.

@esaurez Enrique Saurez (esaurez) added tests-modified Changes existing tests, test data, or test wiring feat-nvx-refactor labels Nov 10, 2026
@github-actions github-actions Bot removed the tests-modified Changes existing tests, test data, or test wiring label Nov 10, 2026
@esaurez
Enrique Saurez (esaurez) requested a balanced review from Copilot November 10, 2026 20:37

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

The Linux-only test is absent from the scenario inventory, causing the runner to fail before executing any scenarios; registration must be platform-aware to avoid breaking Windows.

1 open issue
What changed in this PR

Adds the Linux restore-exclusion gate for SL2.15, validating caller-owned snapshot locking before production restore work in SL2.16.

Changes:

  • Exercises concurrent hard-linked restores under a caller-owned file lock.
  • Checks restore failure after an unlocked link change or controller death before readiness.
  • Verifies that a link change after the authenticated readiness connection still permits the full adapter lifecycle.
File Description
tests/​runtime-adapter/​tests/​vm_clone.rs Adds a Linux-only real-VM test covering four restore-exclusion cases, with synchronization and process cleanup helpers.

Review effort: Balanced

Comment thread tests/runtime-adapter/tests/vm_clone.rs Resolved
@github-actions github-actions Bot added the tests-modified Changes existing tests, test data, or test wiring label Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

This pull request changes existing tests

It modifies or removes 4 existing test asset(s), listed below. Review each with care: a change to a test can hide a regression that the test caught. See doc/contribute.md#changes-to-existing-tests.

Test code

Change What Before After
modified test def RuntimeAdapterSuiteTests.test_scenarios_refuse_other_lines in scripts/test_nvx_tools.py scripts/test_nvx_tools.py:21038 scripts/test_nvx_tools.py:21038
modified test def RuntimeAdapterSuiteTests.test_the_adapter_s_readme_lists_its_scenarios in scripts/test_nvx_tools.py scripts/test_nvx_tools.py:21051 scripts/test_nvx_tools.py:21090

Test data

Change What Before After
modified file tests/runtime-adapter/scenarios.txt tests/runtime-adapter/scenarios.txt tests/runtime-adapter/scenarios.txt

End-to-end tests

Change What Before After
modified helper def read_scenarios in scripts/nvx_tools/runtime_adapter_tests.py scripts/nvx_tools/runtime_adapter_tests.py:79 scripts/nvx_tools/runtime_adapter_tests.py:80

Relocated unchanged: 0; added: 36. Compared the merge base cfdb452f29c8 with d6b70447d5d0.

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

Linux validation omits ownership and permission checks for manifest, RAM, and saved-state files in both Snapshot::open() and finish_capture(), allowing shared-permission files that violate the private-snapshot contract.

2 open issues

Review effort: Balanced

Comment thread nvx-rs/src/host/snapshot/capture.rs Resolved

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.

🔵 Needs a closer look

Real-VM ordering and controller-death guarantees need maintainer validation on the reviewed head because hardware evidence covers only a historical revision.

2 open issues

Review effort: Balanced

@esaurez
Enrique Saurez (esaurez) marked this pull request as ready for review November 11, 2026 00:08
@esaurez
Enrique Saurez (esaurez) marked this pull request as draft November 11, 2026 00:49
@ppenna
Pedro Henrique Penna (ppenna) force-pushed the esaurez/issue1102-sl214-20261110-b718df7e branch from c6de1d8 to aa319d6 Compare November 11, 2026 01:23
Base automatically changed from esaurez/issue1102-sl214-20261110-b718df7e to feature/nvx-refactor November 11, 2026 01:39
Enrique Saurez added 7 commits November 10, 2026 18:34
Exercise hard-linked restore views, caller-owned exclusion, the ctime refusal, and the dead-controller/restore-ready boundary with the real runtime adapter guest. Preserve existing input-gating and disk-read regression tests.

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

Copilot-Session: c3e21e47-1cf3-4e12-9b9d-31e350db64a7
Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c3e21e47-1cf3-4e12-9b9d-31e350db64a7
Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Record helper PID/start identity before controller termination and retain native diagnostics in the captured test output before fixture cleanup.

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

Copilot-Session: c3e21e47-1cf3-4e12-9b9d-31e350db64a7
Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Match existing clone launch rules: omit --restore-processors for a template whose key records all processors online without restore-time VP activation. Keep all four gate assertions unchanged.

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

Copilot-Session: c3e21e47-1cf3-4e12-9b9d-31e350db64a7
Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Address the Opus review findings: prepare a complete closed capability pipe before spawn, gate the existing pre-prepare --log-file FIFO open, and hold the link helper at an stdin rendezvous until its process identity is recorded. Keep the four real-VM expectations unchanged.

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

Copilot-Session: c3e21e47-1cf3-4e12-9b9d-31e350db64a7
Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Register the Linux-only restore exclusion gate without changing its Rust implementation. Preserve strict inventory validation, reject unknown qualifiers and duplicate scenarios before platform selection, and use the selected targets for both checking and exact execution.

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

Copilot-Session: c02296f6-2b94-4e0f-a97a-bc5f0276b7ac
Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Keep the CLI usage reference consistent with the explicit host qualifier and shared inventory/execution selection. This changes documentation only; the reviewed registration code and all Rust tests are unchanged.

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

Copilot-Session: c02296f6-2b94-4e0f-a97a-bc5f0276b7ac
Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
@ppenna
Pedro Henrique Penna (ppenna) force-pushed the esaurez/issue1103-sl215-20261110-c3e21e47 branch from 27994d4 to d6b7044 Compare November 11, 2026 02:36
@ppenna
Pedro Henrique Penna (ppenna) marked this pull request as ready for review November 11, 2026 02:36
@ppenna
Pedro Henrique Penna (ppenna) merged commit 5b3d539 into feature/nvx-refactor Nov 11, 2026
85 of 88 checks passed
@ppenna
Pedro Henrique Penna (ppenna) deleted the esaurez/issue1103-sl215-20261110-c3e21e47 branch November 11, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat-nvx-refactor tests-modified Changes existing tests, test data, or test wiring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants