Skip to content

Separate Docker host enclave execution concerns - #11788

Merged
lpcox merged 2 commits into
mainfrom
copilot/refactor-split-docker-host-execute
Nov 18, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/refactor-split-docker-host-execute

Conversation

@lpcox

@lpcox lpcox commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

The Docker host execution module mixes security-critical validation, launch configuration, redaction, and settlement. This refactor separates those concerns while preserving the exported API and execution behavior.

  • Validation: Extract plan identity, invocation-path, and seed checks.
  • Launch construction: Isolate configuration, workload/probe arguments, immutable seed mounts, and debug-secret collection.
  • Recovery and settlement: Move recovery-record creation and authority accounting/revocation into the existing recovery module.
  • Orchestration: Retain lifecycle sequencing, cancellation, diagnostic stages, and fail-closed cleanup in the execution module.

@lpcox lpcox changed the title [WIP] Refactor docker-host-execute.ts into focused modules Separate Docker host enclave execution concerns Nov 18, 2026
@lpcox
lpcox marked this pull request as ready for review November 18, 2026 19:00
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 19:00

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

Human review is needed to confirm that the new asynchronous validation and authority-settlement boundaries preserve cancellation cleanup, journal-before-allocation, and revocation-before-result guarantees across modules.

No open issues 🎉

What changed in this PR

Refactors Docker-host enclave execution into focused modules for #11783, preserving the exported API and keeping lifecycle orchestration in the execution module.

Changes:

  • Extracts plan and path validation, launch arguments, storage-probe arguments, and debug-secret collection.
  • Moves recovery-record construction and authority settlement into the recovery module.
  • Adds focused tests for the extracted helpers.
File Description
src/​enclave/​docker-host-recovery.ts Adds recovery-record and authority-settlement helpers.
src/​enclave/​docker-host-recovery.test.ts Tests recovery records, accounting, and revocation failures.
src/​enclave/​docker-host-plan-validation.ts Extracts identity, invocation-path, and seed validation.
src/​enclave/​docker-host-plan-validation.test.ts Tests valid plans, unsafe paths, and seed requirements.
src/​enclave/​docker-host-launch-args.ts Extracts launch configuration, argument construction, and secret collection.
src/​enclave/​docker-host-launch-args.test.ts Tests launch vectors, debug settings, redaction inputs, and storage probes.
src/​enclave/​docker-host-execute.ts Delegates extracted concerns while retaining lifecycle sequencing and cleanup.

Review effort: Max (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 94.32% 94.35% 📈 +0.03%
Statements 92.93% 92.96% 📈 +0.03%
Functions 93.49% 93.55% 📈 +0.06%
Branches 87.20% 87.23% 📈 +0.03%
📁 Per-file Coverage Changes (6 files)
File Lines (Before → After) Statements (Before → After)
src/enclave/docker-host-execute.ts 97.2% → 97.2% (-0.01%) 93.5% → 92.7% (-0.79%)
src/enclave/host-executor-socket.ts 95.9% → 95.9% (+0.00%) 91.5% → 90.2% (-1.22%)
src/enclave/docker-host-recovery.ts 95.5% → 95.8% (+0.28%) 91.0% → 91.5% (+0.50%)
src/routing/bootstrap.ts 90.0% → 91.0% (+1.00%) 85.3% → 86.6% (+1.34%)
src/commands/main-action-cleanup.ts 96.9% → 97.9% (+1.03%) 97.0% → 98.0% (+0.99%)
src/nvx/one-shot-process.ts 81.5% → 84.0% (+2.47%) 74.7% → 76.8% (+2.11%)
✨ New Files (2 files)
  • src/enclave/docker-host-launch-args.ts: 100.0% lines
  • src/enclave/docker-host-plan-validation.ts: 100.0% lines

Coverage comparison generated by scripts/ci/compare-coverage.ts

@lpcox
lpcox merged commit 885ca6d into main Nov 18, 2026
46 of 48 checks passed
@lpcox
lpcox deleted the copilot/refactor-split-docker-host-execute branch November 18, 2026 20:51
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-execute.ts into focused modules

3 participants