Skip to content

protocol: add capture requests and restore activation messages - #1331

Merged
Pedro Henrique Penna (ppenna) merged 4 commits into
feature/nvx-refactorfrom
esaurez/slim-3.2.1-sl4.2-canonical-20261107
Nov 7, 2026
Merged

Pedro Henrique Penna (ppenna) merged 4 commits into
feature/nvx-refactorfrom
esaurez/slim-3.2.1-sl4.2-canonical-20261107

Conversation

@esaurez

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

Copy link
Copy Markdown
Contributor

Part of #1113

Add the two crate-private NVXC v1 operations needed by the later capture handler and restore driver:

  • A capture request carries a strictly checked kill-executions flag. ControlSession::capture sends it and requires the matching, empty, successful READY acknowledgement.
  • An activate request carries the existing activation record and the canonical workload identity, with strict length, framing and credential-bound checks.
  • Keep host workload selection and its public identity re-export unchanged, including builds without the host feature. New unused private items identify their future callers through the existing dead-code expectations.

This is SL4.2 only. It adds no guest handler, restore driver, retry/deadline framework, peer-verification framework, NVXC v2 framing or public protocol API.

Dependency: builds on the activation-record change in #1311, merged into feature/nvx-refactor at bc9cecac747b460d89159914154b9f6ce3732968. That parent has the identical source tree as the qualified 02d4219ff07e74622fe3178ad9e7f5b7d1ea3975 input.

Size: 132 core lines in 5 counted files; 7 changed paths and 142 added test lines. Test-layout metadata is counted normally, without an exemption.

Tests

Existing protocol and session tests remain. No existing test function is removed or rewritten. Added regression coverage:

  • capture_requests_round_trip_both_kill_flags
  • capture_requests_refuse_unknown_or_mis_sized_flags
  • activate_requests_round_trip_records_and_workload_identity
  • activate_requests_refuse_truncated_or_malformed_payloads
  • activate_workload_ids_match_guest_credential_bounds
  • capture_sends_both_kill_flags_and_waits_for_acknowledgement
  • capture_refuses_invalid_acknowledgements

The test-change report records 14 added test items and two test-policy changes: the session and protocol application entries now permit their actual one and six test hooks. All inherited hook counts remain, with canonical ordering checked by the repository formatter and layout checker.

Validation

Exact candidate: 3f217d54f9d8e19bbe512a7df64dbc7c3d9d328e, tree 8c7a51d779b777a9993c20dcac8c295def316775.

The four commits were mechanically reparented onto the merged parent. Complete local checks and independent read-only review were produced at e596bb70186e74aee893f663fe41627d7974b458, with the identical full source tree and effective inputs. That evidence is reused, not described as a new execution.

  • Windows: all 11 applicable action blocks passed, including 8 Rust blocks, 2 native comparison blocks and the complete CLI block. CLI units: 1,818 cases with 70 platform skips; adversarial: 84 cases with 11 platform skips; host resolver: 4 cases with no skips.
  • Linux: all 22 source-dependent action blocks passed, including 13 Rust blocks, 2 comparisons, the complete CLI block and 6 quality blocks. Existing unchanged development prerequisites were verified without reinstalling them. CLI units: 1,818 cases with 34 platform skips; adversarial: 84 cases without skips; host resolver: 4 cases without skips; Specula: 25 cases without skips. Ten current-source guest binaries and 33 associated tests passed.
  • Both public-API snapshots passed unchanged. The complete CLI suites use the default parallel harness. Real cancelled-capture shell and native PowerShell coverage passed.
  • Independent read-only review of the qualified identical source tree has no open code findings. Current per-PR measurement, test-change inventory and canonical test-layout checks are recorded.

Earlier metadata-ordering failures and warnings remain history. Nine Windows compiler-descendant cleanup warnings and ordinary tool notices were retained in the current qualification receipts; post-run inspection found those descendants ended.

This unused-private-code slice changes no guest handler, VMM arguments or executed CLI VM route, and is not the group's final PR. No new VM matrix or borrowed parent runtime pass is claimed. Group-final VM coverage and CI-only coverage, including KVM, remain unrun here. This PR remains Draft.

@esaurez Enrique Saurez (esaurez) added tests-modified Changes existing tests, test data, or test wiring feat-nvx-refactor labels Nov 7, 2026
@esaurez
Enrique Saurez (esaurez) requested a balanced review from Copilot November 7, 2026 03:55
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

This pull request changes existing tests

It modifies or removes 2 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 policy

Change What Before After
loosened allowlist entry nvx-rs/src/host/session.rs (the seams allow 1 test hooks) scripts/test-layout-allowlist.json
loosened allowlist entry nvx-rs/src/protocol/app.rs (the seams allow 6 test hooks) scripts/test-layout-allowlist.json

Relocated unchanged: 0; added: 14. Compared the merge base bc9cecac747b with 3f217d54f9d8.

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

No active review issues block the crate-private capture and activation protocol changes.

No open issues 🎉

What changed in this PR

Adds crate-private NVXC v1 capture and activation messages for SL4.2 of #1113, building on the activation-record changes in #1311. This prepares later guest handlers and restore orchestration without adding those execution paths or expanding the public protocol API.

Changes:

  • Adds capture and activation payload codecs with strict flag, credential and record validation.
  • Adds ControlSession::capture, requiring a matching, empty, successful READY acknowledgement.
  • Shares the workload identity type while preserving its public host re-export, and adds regression tests and test-layout metadata.
File Description
scripts/​test-layout-allowlist.json Records session and protocol test-hook allowances.
nvx-rs/​src/​protocol/​tests.rs Tests payload round trips, malformed inputs and credential bounds.
nvx-rs/​src/​protocol/​mod.rs Adds host-gated internal protocol re-exports.
nvx-rs/​src/​protocol/​app.rs Defines shared workload identity and capture/activation codecs.
nvx-rs/​src/​host/​session/​tests.rs Tests capture flags and acknowledgement validation.
nvx-rs/​src/​host/​session.rs Adds capture requests and payload support to the acknowledgement helper.
nvx-rs/​src/​host/​launch.rs Preserves the public workload identity path through a re-export.

Review effort: Balanced

@esaurez
Enrique Saurez (esaurez) force-pushed the esaurez/slim-2.3.1-sl2.5b-20261105 branch 2 times, most recently from fc44f2b to 02d4219 Compare November 7, 2026 19:49
Base automatically changed from esaurez/slim-2.3.1-sl2.5b-20261105 to feature/nvx-refactor November 7, 2026 20:45
Enrique Saurez and others added 4 commits November 7, 2026 13:32
Encode the kill-executions flag in NVXC v1 and require a matching empty READY acknowledgement before the host operation returns.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 629c762a-9133-4b64-8356-19a4ade2d1f0
Reuse the workload identity definition from a private shared owner while keeping host selection and its public re-export unchanged. Encode the persistent identity beside the existing activation record in NVXC v1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 629c762a-9133-4b64-8356-19a4ade2d1f0
Document the shared identity type visibility without the host feature and retain dead-code expectations only for future protocol callers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 629c762a-9133-4b64-8356-19a4ade2d1f0
Sort the carried hook entries with the repository formatter without changing
their counts or the inherited hooks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 629c762a-9133-4b64-8356-19a4ade2d1f0

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

No active review issues block approval of the capture and activation protocol changes.

No open issues 🎉

Review effort: Balanced

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

No active review issues require follow-up for the crate-private capture and activation protocol changes.

No open issues 🎉

Review effort: Balanced

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