Repository navigation
Refactor NVX cleanup registry into focused modules - #11748
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Success-path tests are missing for the five capture operations, leaving interface/namespace routing, custom ipPath forwarding, and persisted paths and stage flags unverified.
1 open issue
What changed in this PR
Refactors NVX cleanup internals so the durable registry coordinates state while focused modules handle process identity, network checks, and account validation.
Changes:
- Extract helper functions into three dedicated modules.
- Replace nested handle operations with private methods and a shared record-update method.
- Add direct helper tests and durable-update regression coverage.
| File | Description |
|---|---|
src/nvx/cleanup-registry.ts |
Delegates helper checks and simplifies handle operations. |
src/nvx/cleanup-registry.test.ts |
Adds persistence and process-stage assertions. |
src/nvx/cleanup-process-identity.ts |
Extracts process identity capture and comparison. |
src/nvx/cleanup-process-identity.test.ts |
Tests identity parsing, capture, and matching. |
src/nvx/cleanup-network-state.ts |
Extracts interface checks and forwarding-rule construction. |
src/nvx/cleanup-network-state.test.ts |
Tests network checks and rule arguments. |
src/nvx/cleanup-account-validation.ts |
Extracts pending-account validation and path-existence checks. |
src/nvx/cleanup-account-validation.test.ts |
Tests account validation and filesystem error handling. |
Review effort: Max (adaptive)
| captureNetworkPlan: (plan) => this.captureNetworkPlan(record, layout, plan), | ||
| captureNetworkResource: (resource) => this.captureNetworkResource(record, resource, ipPath), | ||
| captureRunDirectory: () => this.captureRunDirectory(record, layout), | ||
| captureCgroup: () => this.captureCgroup(record, layout), |
There was a problem hiding this comment.
Added the requested durable capture coverage in 9c076f8. Test execution remains blocked by package-feed DNS resolution.
|
@copilot address review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Added the durable success-path coverage in commit |
|
@copilot merge main and resolve conflicts then make sure all review feedback has been addressed |
…t-cleanup-registry Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged |
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (3 files)
✨ New Files (3 files)
Coverage comparison generated by |
Co-authored-by: Copilot App <[email protected]>

The cleanup registry mixed durable state management with security-sensitive process, network, and account checks. This refactor separates those concerns while preserving cleanup behavior and public APIs.