Repository navigation
Refactor Docker host enclave execution into focused stages - #11904
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
Verifying fail-closed behavior across the extracted asynchronous stages requires cross-module reasoning about cancellation, authority settlement, recovery journaling, and removal-gated output release beyond the limited approval scope.
No open issues 🎉
What changed in this PR
This PR addresses #11899 by splitting Docker host enclave execution into focused stages, reducing nesting while preserving the executor’s public API and diagnostic stage names.
Changes:
- Extract storage preparation, workload execution, and cleanup into dedicated modules.
- Centralize diagnostic checks and share invocation state between stages.
- Add boundary and isolated-stage tests for cancellation, recovery journals, diagnostics, and fail-closed cleanup.
| File | Description |
|---|---|
src/enclave/docker-host-storage-stage.ts |
Extracts storage mounting, seccomp staging, and daemon visibility probing. |
src/enclave/docker-host-stages.test.ts |
Tests storage, run, and cleanup stages independently. |
src/enclave/docker-host-run-stage.ts |
Extracts authority resolution, input staging, network checks, and workload execution. |
src/enclave/docker-host-plan-validation.ts |
Adds cleanup classification to the shared diagnostic-check type. |
src/enclave/docker-host-execute.ts |
Replaces nested execution logic with stage orchestration. |
src/enclave/docker-host-execute.test.ts |
Tests execution boundaries and fail-closed cleanup behavior. |
src/enclave/docker-host-context.ts |
Exposes prepared-entry and shared invocation-stage types. |
src/enclave/docker-host-cleanup-stage.ts |
Extracts removal-before-reclaim ordering and diagnostic finalization. |
Review effort: Max (adaptive)
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
|
@copilot merge main, resolve conflicts, and address review feedback |
…t-execute-method Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged |
The inner
execute()mixed validation, storage preparation, workload launch, and cleanup across deeply nested error paths. This refactor separates those concerns while preserving the public API and diagnostic stage names.debugCheckwrapper; retain initialization and authority-settlement boundaries.