Skip to content

Split Cloud Hypervisor cleanup capture by resource type - #11906

Merged
lpcox merged 4 commits into
mainfrom
copilot/refactor-cleanup-handle
Nov 21, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/refactor-cleanup-handle

Conversation

@lpcox

@lpcox lpcox commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

createCleanupHandle mixed network, VMM account/ACL, and process/filesystem capture rules in one large object literal. Duplicated path assertions also risked drift in security-sensitive durable cleanup state.

  • Resource boundaries: Extract network, VMM, and process/filesystem methods into three focused modules, including artifact snapshots and virtiofsd resources.
  • Shared persistence: Keep composition, timestamp updates, persistence, and completion in the factory. Preserve its signature, validation order, and record-commit semantics.
  • Path validation: Route both network commit methods through one run-scoped assertion helper.
  • Regression coverage: Extend existing cleanup-handle tests for duplicate commits, unsafe paths, VMM identity/ACL ordering, persistence failures, and completion errors.

@lpcox lpcox changed the title [WIP] Refactor cleanup handle by resource type and dedupe path assertions Split Cloud Hypervisor cleanup capture by resource type Nov 21, 2026
@lpcox
lpcox marked this pull request as ready for review November 21, 2026 16:38
Copilot AI adaptive review requested due to automatic review settings November 21, 2026 16:38

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 cleanup-handle test does not verify commit-before-persist ordering because the failing capture reuses the stored identity and the persistence mock never checks the identities it observes.

1 open issue
What changed in this PR

Refactors Cloud Hypervisor’s durable cleanup handle into resource-specific modules, addressing #11901 while keeping shared persistence and completion in the factory.

Changes:

  • Separates network, VMM account and ACL, and process/filesystem capture methods.
  • Consolidates run-scoped network path validation while preserving the factory signature and validation order.
  • Extends regression coverage for duplicate commits, unsafe paths, identity ordering, and persistence/completion failures.
File Description
src/​cloud-hypervisor/​cleanup-handle.ts Composes resource handlers and retains timestamp, persistence, and completion logic.
src/​cloud-hypervisor/​cleanup-handle.test.ts Adds focused record-commit and error-handling tests.
src/​cloud-hypervisor/​cleanup-handle-vmm.ts Extracts VMM account, identity, and device ACL capture rules.
src/​cloud-hypervisor/​cleanup-handle-process.ts Extracts process, directory, artifact snapshot, and virtiofsd capture logic.
src/​cloud-hypervisor/​cleanup-handle-network.ts Extracts network capture methods and shares path validation.

Review effort: Max (adaptive)

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@github-actions

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.

@lpcox
lpcox merged commit e3a3838 into main Nov 21, 2026
46 of 48 checks passed
@lpcox
lpcox deleted the copilot/refactor-cleanup-handle branch November 21, 2026 17:18
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.

[Refactoring] Split createCleanupHandle in cleanup-handle.ts by resource type and dedupe path assertions

3 participants