Skip to content

Split Docker host enclave executor into focused modules - #11600

Merged
lpcox merged 3 commits into
mainfrom
copilot/refactor-split-docker-host-executor
Nov 14, 2026
Merged

lpcox merged 3 commits into
mainfrom
copilot/refactor-split-docker-host-executor

Conversation

@lpcox

@lpcox lpcox commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

The Docker host executor combined container lifecycle, invocation execution, recovery, and settlement in one large closure. This refactor separates those responsibilities over an explicit shared context while preserving the public API.

  • Factory and context: Reduce the factory to 52 lines; make backend state and shared ownership tracking explicit.
  • Container lifecycle: Isolate creation, execution, reconciliation, cleanup, and diagnostic retention.
  • Invocation execution: Extract invocation handling, authority settlement, and active-invocation tracking.
  • Recovery: Move initialization alongside existing journal primitives, avoiding runtime import cycles.
  • Focused coverage: Add component-level cases for journal ordering, cleanup gates, ownership checks, and readiness caching.

@lpcox lpcox changed the title [WIP] Refactor docker host executor into focused modules Split Docker host enclave executor into focused modules Nov 14, 2026
@lpcox
lpcox marked this pull request as ready for review November 14, 2026 19:52
Copilot AI adaptive review requested due to automatic review settings November 14, 2026 19:52

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 Linux test fails because it expects two diagnostic events, but the recorder emits workload-start’s started and succeeded events before a third workload-exit event.

1 open issue
What changed in this PR

Refactors the Docker host enclave executor into focused modules with explicit shared state, addressing #11595 while preserving the public executor API.

Changes:

  • Introduces a shared context and reduces the factory to module wiring.
  • Separates container lifecycle, invocation execution, authority settlement, and recovery initialization.
  • Adds focused tests for journal ordering, cleanup gates, ownership checks, and readiness caching.
File Description
src/​enclave/​docker-host-recovery.ts Adds recovery-state creation and initialization alongside journal primitives.
src/​enclave/​docker-host-recovery.test.ts Covers recovery safeguards and readiness caching.
src/​enclave/​docker-host-executor.ts Wires the extracted modules and preserves the public API.
src/​enclave/​docker-host-execute.ts Extracts invocation execution, settlement, and active-invocation tracking.
src/​enclave/​docker-host-context.ts Defines shared types, validates configuration, and initializes backend state.
src/​enclave/​docker-host-container.ts Extracts container creation, execution, reconciliation, cleanup, and diagnostic retention.
src/​enclave/​docker-host-container.test.ts Covers container operations, journal ordering, cancellation, and cleanup gates.

Review effort: Max (dynamic)

@lpcox

lpcox commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback

@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.

Copilot AI commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Updated the assertion to verify all three diagnostic events and their statuses in order. Commit: 4959f45.

@lpcox
lpcox merged commit 6ed5a44 into main Nov 14, 2026
44 of 46 checks passed
@lpcox
lpcox deleted the copilot/refactor-split-docker-host-executor branch November 14, 2026 21:32
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 src/enclave/docker-host-executor.ts into focused modules

3 participants