Skip to content

fix: align Docker enclave verification and retain failure evidence - #11276

Merged
lpcox merged 3 commits into
mainfrom
copilot/resolve-docker-enclave-failures
Nov 7, 2026
Merged

lpcox merged 3 commits into
mainfrom
copilot/resolve-docker-enclave-failures

Conversation

Copilot AI commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

All three Docker enclave engines reached startup readiness but failed result validation, followed by nonzero AWF exits and retained work directories. Missing invocation evidence leaves the original run’s cause unconfirmed.

  • Docker verification

    • Match the audited supervisor’s exact capability set, including Docker’s CAP_ normalization.
    • Support narrowly identified legacy recovery journals without relaxing identity or isolation checks.
  • Failure evidence

    • Retain bounded host metadata when cleanup cannot prove removal.
    • Preserve the first invocation failure separately from cleanup failures.
    • Keep streams unavailable, recovery custody pending, and source storage intact on uncertain paths.
    {
      "workloadStopped": false,
      "stopProof": "unavailable",
      "streams": {
        "stdout": "unavailable",
        "stderr": "unavailable",
        "session": "unavailable"
      }
    }
  • Lifecycle regressions

    • Cover all engines across pre-launch failure, nonzero exit, cancellation, retention failure, and legacy recovery.
    • Assert verified cleanup on settled paths, retained residue on uncertain paths, and failure for invalid results or incomplete finalization.

Copilot AI changed the title [WIP] Resolve Docker enclave failures with nonzero AWF exits fix: align Docker enclave verification and retain failure evidence Nov 7, 2026
Copilot AI requested a review from lpcox November 7, 2026 18:27
@lpcox
lpcox marked this pull request as ready for review November 7, 2026 18:28
Copilot AI adaptive review requested due to automatic review settings November 7, 2026 18:28

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 metadataOnly path bypasses the launch/exit invariant, allowing an exit code to be accepted and published even when no workload was launched.

1 open issue
What changed in this PR

This PR addresses Docker enclave verification and diagnostic gaps from #11273, preserving recovery state when cleanup cannot be verified.

Changes:

  • Align capability checks with the audited supervisor and support narrowly identified legacy journals.
  • Retain metadata-only diagnostics when stop proof is unavailable, keeping invocation and cleanup failures separate.
  • Expand lifecycle and finalization regressions across Copilot, Codex, and Claude.
File Description
src/​enclave/​public-debug-artifacts.ts Allows restricted metadata retention without verified stop proof.
src/​enclave/​public-debug-artifacts.test.ts Tests metadata-only retention and stream restrictions.
src/​enclave/​docker-host-recovery.ts Normalizes capabilities and handles legacy supervisor records.
src/​enclave/​docker-host-executor.ts Exports host-only diagnostics after uncertain cleanup.
src/​enclave/​docker-host-executor.test.ts Covers capability verification, recovery, cancellation, and failure paths.
scripts/​ci/​enclave-agent-regression.test.ts Checks invalid results independently of finalization failures.
scripts/​ci/​collect-enclave-smoke-debug.test.ts Tests collection of uncertain-cleanup metadata.
scripts/​ci/​collect-enclave-smoke-debug.cjs Adds metadata-only envelope validation and export.
docs/​diagnostics/​README.md Explains uncertain stop proof and protected recovery evidence.

Review effort: Max (auto)

Comment on lines +321 to +325
check(typeof value.workloadLaunched === 'boolean' && (metadataOnly || (value.workloadStopped === true
&& value.stopProof === (value.workloadLaunched ? 'verified' : 'not-launched')
&& (value.workloadLaunched || (value.exitCode === null
&& ((['setup-failed', 'cancelled', 'timeout'].includes(value.failure) && value.stage === 'setup')
|| (value.failure === 'retention-failed' && value.stage === 'retention')))),
|| (value.failure === 'retention-failed' && value.stage === 'retention')))))),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 024cdb4. Metadata-only diagnostics now retain the null-exit and setup/retention checks for unlaunched workloads; regression tests cover nonzero exit and inconsistent pre-launch outcomes.

@lpcox

lpcox commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Addressed in 024cdb4. The metadata-only path now relaxes only stop-proof validation; no-launch exit and setup/retention invariants remain enforced.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

⏳ Copilot review left inline comments.

@copilot To proceed:

  1. Ask @copilot to address the review feedback (reply to this comment or the review thread)
  2. Once the fix is pushed, add the ready-for-aw label to trigger agentic CI smoke tests

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-11276 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit f800232

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 93.78% 93.77% 📉 -0.01%
Statements 92.31% 92.31% ➡️ +0.00%
Functions 93.02% 93.00% 📉 -0.02%
Branches 86.58% 86.56% 📉 -0.02%
📁 Per-file Coverage Changes (5 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-process.ts 84.0% → 81.5% (-2.47%) 76.8% → 74.7% (-2.11%)
src/enclave/docker-host-executor.ts 95.0% → 94.8% (-0.18%) 89.5% → 89.4% (-0.10%)
src/enclave/host-executor-server.ts 91.2% → 91.2% (+0.00%) 89.8% → 90.1% (+0.29%)
src/enclave/public-debug-artifacts.ts 94.7% → 94.7% (+0.07%) 93.2% → 93.3% (+0.07%)
src/enclave/docker-host-recovery.ts 94.4% → 94.5% (+0.08%) 88.8% → 89.0% (+0.19%)

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

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.

Resolve Docker enclave failures that leave nonzero AWF exits and retained work directories for all engines

3 participants