Skip to content

Refactor Docker host enclave execution into focused stages - #11904

Merged
lpcox merged 4 commits into
mainfrom
copilot/refactor-split-execute-method
Nov 21, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/refactor-split-execute-method

Conversation

@lpcox

@lpcox lpcox commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  • Storage stage: Mount bounded storage, stage seccomp, verify daemon-visible mount identity, and remove the probe.
  • Run stage: Resolve authority, build launch configuration, stage workload inputs, verify network isolation, and record launch/exit state.
  • Cleanup stage: Require container-removal proof before reclaiming output; finalize diagnostics and preserve recovery evidence on failure.
  • Orchestration: Sequence stages through one shared debugCheck wrapper; retain initialization and authority-settlement boundaries.
  • Regression coverage: Add boundary and isolated-stage tests for journal state, cancellation, diagnostic classification, and fail-closed cleanup.

@lpcox lpcox changed the title [WIP] Refactor docker-host-execute.ts to split execute() into stages Refactor Docker host enclave execution into focused stages 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.

🔵 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)

@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 commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot merge main, resolve conflicts, and address review feedback

…t-execute-method

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

@copilot merge main, resolve conflicts, and address review feedback

Merged main cleanly with no conflicts. The only review was the overview noting no open issues, with no specific code changes requested. Merge commit: 27275dd. Focused tests remain blocked because the package feed is unreachable (DNS ENOTFOUND).

@lpcox
lpcox merged commit d77ca25 into main Nov 21, 2026
44 of 46 checks passed
@lpcox
lpcox deleted the copilot/refactor-split-execute-method branch November 21, 2026 18:10
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 docker-host-execute.ts execute() into focused stages

3 participants