Repository navigation
test: diagnose post-bind enclave storage propagation - #9532
Conversation
Record bounded source/destination and per-role mount observations around invocation binds. Identify the failed storage verification role without changing private mount enforcement. Cover five propagation hypotheses, shared destination fixtures, redaction and descriptor bounds. Co-authored-by: Copilot App <[email protected]>
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 4d92604 |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Unresolved correctness issues and unverified privileged Linux reproductions require fixes and human validation.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds bounded diagnostics to investigate Cloud Hypervisor enclave storage propagation failures without claiming a startup fix or relaxing existing guards.
Changes:
- Records propagation evidence by mount role and startup phase.
- Preserves sanitized evidence within the existing descriptor limit.
- Adds fault cases, gated Linux reproductions, and investigation documentation.
| File | Description |
|---|---|
| src/enclave/startup-progress.ts | Retains and resets propagation evidence. |
| src/enclave/startup-progress.test.ts | Tests retention, copying, and reset. |
| src/commands/main-action.ts | Bounds diagnostic messages while preserving evidence. |
| src/commands/main-action-startup-diagnostics.test.ts | Tests maximum-size diagnostic publication. |
| src/cloud-hypervisor/trusted-enclave-storage.ts | Captures phase evidence and role-specific checks. |
| src/cloud-hypervisor/trusted-enclave-storage.test.ts | Adds diagnostic failure regressions. |
| src/cloud-hypervisor/storage-propagation-schema.json | Defines bounded evidence codes and slots. |
| src/cloud-hypervisor/mount-topology.ts | Adds propagation observation and validation helpers. |
| src/cloud-hypervisor/mount-topology.test.ts | Tests classification and strict evidence validation. |
| src/cloud-hypervisor/host-preflight-schema.json | Adds storage-verification checks. |
| src/cloud-hypervisor/host-preflight-progress.ts | Publishes copied propagation evidence. |
| src/cloud-hypervisor/enclave-mount-capture.integration.test.ts | Adds shared-destination Linux reproductions. |
| scripts/ci/cloud-hypervisor-enclave-live-smoke.test.ts | Tests evidence sanitization and retention. |
| scripts/ci/cloud-hypervisor-enclave-live-smoke.js | Sanitizes the new diagnostic payload. |
| docs/diagnostics/README.md | Links the post-bind investigation guidance. |
| docs/cloud-hypervisor-foundation.md | Documents hypotheses, evidence, and rollout limits. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (new Set(candidates.map((mount) => mount.mountPoint)).size !== candidates.length) return 'unknown'; | ||
| const longest = candidates.reduce((maximum, mount) => Math.max(maximum, mount.mountPoint.length), 0); | ||
| const matches = candidates.filter((mount) => mount.mountPoint.length === longest); | ||
| return propagation(matches.length === 1 ? matches[0] : undefined); |
There was a problem hiding this comment.
Implemented in d48983a: covering candidates must form a parent-ID ancestry chain; hidden or incompatible mount trees now report unknown. Added the distinct-mountpoint hidden-descendant regression.
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (5 files)
Coverage comparison generated by |
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
|
⏳ Copilot review left inline comments. @lpcox To proceed:
|

Observed failure and research
The v0.28.43 environment probe 37571367739 passed
storage-propagation-set, immediatestorage-propagation, layout, local binds and invocation mount.bounded-runtime/storage-verificationthen failed withstorage-mount-propagation. All bounded cleanup checks passed. Snapshot binding, guest startup and gateway readiness were not attempted. No diagnosis-registry record matches this specific failure; this PR does not claim a confirmed root cause or implement a speculative fix.Leading hypothesis: the separate invocation bind destination.
prepareTrustedInvocationStorage()binds the private allocation'sstateontoplan.invocationHostDirunderrun.invocationsDir, outside the allocation. Making the source allocation private does not privatize that destination's covering mount. The previous Linux fixture changed the allocation parent but left this separate destination under a private namespace.Primary-source research:
attach_recursive_mnt(): the destination shared-state check leads toset_mnt_shared()on the attached tree. This verifies the mechanism, not the runner's unrecorded exact kernel version.remount,bindchanges mount flags; it does not automatically change propagation.The probe fingerprint is v0.28.43, workflow-configured GitHub-hosted Ubuntu 24.04 x86_64, primary Docker/script CH configuration, no model provider/credential, and the workflow GitHub token for release attestation/public seed access. Exact kernel and DOCKER_HOST are unverified; runtime/storage is the failing boundary, not guest networking or authentication.
Five falsifiable hypotheses
Hypotheses 4/5 are lower-confidence: journal verification passed before the failing propagation guard, so they require a subsequent change/different table observation. Read/parse/journal failures are separately reported, not mislabeled as any of these hypotheses.
Diagnostics and tests
storage-verification: journal identity, mountinfo read/observation, and the six fixed mount roles. Every applicable role still requires the original private propagation and mount options. The snapshot check is optional only while no sealed snapshot exists. Catalog: 188 IDs; existing checklist schema version stays 1.storagePropagationevidence before/after invocation bind/remount, after initial private verification/local layout, and for every role from the exact single table used by verification guards, before the first role can fail.unknown, never authority to choose a topmost mount. Normalized-only observations never weaken exact matching.invocation-staterejection, private root/local roles, shared invocation after bind/remount, no snapshot attempt and ordinary identity-checked cleanup. All synthetic shared mounts remain in disposable private namespaces.The new full catalog/evidence combination exceeds the old descriptor budget if a maximum optional fatal message is also retained. Compact four-code tuples and the existing duplicate-active-scope omission keep the complete checklist/evidence; if needed the optional message becomes the existing explicit message-bound placeholder. The 16 KiB limit is unchanged and tested at worst-case enum/reason sizes. No success-shaped fallback is introduced.
Validation and scope
docs/research/is untouched; the intentionally unmerged sharp fix is not included.Rollout
After review/merge, publish a new immutable release containing this commit and authorize the release-pinned script-only environment probe. v0.28.43 cannot acquire these diagnostics through another dispatch. The probe must supply the missing role/phase evidence before selecting a fix; this PR does not claim enclave startup is repaired.