Repository navigation
fix: align Docker enclave verification and retain failure evidence - #11276
Conversation
Co-authored-by: lpcox <[email protected]>
There was a problem hiding this comment.
🟡 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)
| 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')))))), |
There was a problem hiding this comment.
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.
|
@copilot address review feedback |
Co-authored-by: lpcox <[email protected]>
|
⏳ Copilot review left inline comments. @copilot To proceed:
|
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit f800232 |
|
| 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

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
CAP_normalization.Failure evidence
{ "workloadStopped": false, "stopProof": "unavailable", "streams": { "stdout": "unavailable", "stderr": "unavailable", "session": "unavailable" } }Lifecycle regressions