Repository navigation
fix: classify enclave gateway readiness failures - #9488
Merged
Merged
Conversation
Track bounded host startup stages and actual gateway request failure codes without exposing private transport details. Preserve readiness retries and distinguish AWF handshake proof from harness requests. Co-authored-by: Copilot App <[email protected]>
Contributor
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 1bcc24b |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
JSON-RPC correlation, RPC-error handling, and snapshot validation can currently produce false readiness evidence.
Review effort: Balanced
Findings: 3
Open (3)
What changed in this PR
Adds bounded host-side diagnostics for enclave gateway readiness and integrates them into Cloud Hypervisor acceptance workflows.
Changes:
- Tracks startup stages, readiness attempts, and allowlisted failure classifications.
- Publishes sanitized startup snapshots and consumes them in the live harness.
- Expands deterministic tests, workflow coverage, and architecture documentation.
| File | Description |
|---|---|
src/enclave/workflow-integration.test.ts |
Tests pre-readiness failures. |
src/enclave/startup-progress.ts |
Defines startup progress state. |
src/enclave/manager.ts |
Records enclave preparation stages. |
src/enclave/gateway.ts |
Classifies gateway readiness requests. |
src/enclave/gateway.test.ts |
Tests readiness classifications. |
src/enclave/cloud-hypervisor-lifecycle.ts |
Tracks lifecycle stages. |
src/enclave/cloud-hypervisor-lifecycle.test.ts |
Tests lifecycle diagnostics. |
src/enclave/cloud-hypervisor-host-service.ts |
Reports host-service startup. |
src/enclave/cloud-hypervisor-host-service.test.ts |
Tests host-service reporting. |
src/commands/main-action.ts |
Persists bounded progress snapshots. |
src/commands/main-action.test.ts |
Tests diagnostic publication safety. |
src/commands/main-action-startup-diagnostics.test.ts |
Adds filesystem-level publication tests. |
src/commands/main-action-fs-mock.test-utils.ts |
Extends filesystem mocks. |
src/cloud-hypervisor/host-enclave-executor.ts |
Reports executor preflight stages. |
src/cloud-hypervisor/host-enclave-executor.test.ts |
Tests preflight stage reporting. |
src/cloud-hypervisor/enclave-executor-types.ts |
Adds the stage callback type. |
src/cli-workflow.ts |
Tracks workflow startup stages. |
scripts/ci/test-cloud-hypervisor-enclave-workflow.test.ts |
Updates deterministic suite assertions. |
scripts/ci/cloud-hypervisor-enclave-live-smoke.test.ts |
Tests live diagnostic handling. |
scripts/ci/cloud-hypervisor-enclave-live-smoke.js |
Exports validated readiness evidence. |
docs/INTEGRATION-TESTS.md |
Documents diagnostic schemas and coverage. |
docs/enclaves-architecture.md |
Documents readiness diagnostics. |
docs/cloud-hypervisor-foundation.md |
Documents acceptance limitations. |
.github/workflows/test-cloud-hypervisor-enclaves.yml |
Expands workflow triggers and tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+265
to
+269
| || (value.readiness === 'not-attempted' | ||
| && (value.attempts !== 0 || !['none', 'unknown', 'readiness-deadline'].includes(value.code))) | ||
| || (value.readiness !== 'not-attempted' && value.attempts === 0) | ||
| || (value.readiness === 'ready' | ||
| && (value.code !== 'ready' || !['tools-list', 'delegation', 'primary-agent'].includes(value.stage)))) { |
| ? events[events.length - 1] | ||
| : raw; | ||
| const parsed = !jsonText ? {} : JSON.parse(jsonText) as JsonRpcResponse; | ||
| if (body.id !== undefined && (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))) { |
Comment on lines
528
to
+533
| const tools = (listed.response.result as { tools?: unknown })?.tools; | ||
| if (canonicalToolSet(tools) !== canonicalToolSet(expectedRoutedTools(contract.expectedTools))) { | ||
| throw new Error('Gateway enclave tool contract did not exactly match the enabled executors'); | ||
| throw new GatewayReadinessError( | ||
| 'Gateway enclave tool contract did not exactly match the enabled executors', false, | ||
| listed.response.error ? 'rpc-error' : 'tools-mismatch', | ||
| ); |
Contributor
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (8 files)
✨ New Files (1 files)
Coverage comparison generated by |
Update the compatible transitive source-map-js lock entry from 1.2.1 to 1.2.2 for GHSA-68fv-2mgg-jv7q. Preserve the existing docs audit acceptance and high/critical enforcement. Co-authored-by: Copilot App <[email protected]>
Contributor
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Add bounded, structured diagnostics from AWF's actual host startup and MCP readiness requests, rather than expanding guesses from fatal error text. This follows #9482 and provides missing evidence for the still-unclassified pre-broker exit in run 37406537897, using immutable
v0.28.36.initialize/initialized/tools-listrequests, delegation, and primary-agent stages.not-attempted,attempted, andready, with perspectiveawf-host. Missing/invalid observations remain unknown.backend_unavailableresponses retry. Permanent failures remain failures; no fallback, widened schema, topology, or permission boundary.AWF_HOST_GATEWAY_READINESSbefore separate harness requests. Broker health or harness success is not substituted for AWF proof.Docs audit CI follow-up
Audit job 112093257576 failed on newly reported transitive
source-map-js, not gateway behavior. Commit7c33b82dced67bc79ced783507fd6ec90e662a09changes only the docs lockfile's version, tarball, and integrity entry 1.2.1 → 1.2.2. GHSA-68fv-2mgg-jv7q affects>=1.0.0 <1.2.2; 1.2.2 is the published first patched release and satisfies every existing magicast/css-tree/PostCSS range. No direct dependency, override, suppression, threshold, registry configuration, or service behavior changed. The singleGHSA-ch52-4w7c-c8xpacceptance and2027-01-03expiry remain unchanged.Remote confirmation: dependency audit run 37409692540 passed both Docs and Main audit jobs on
7c33b82d.The exact CI package-lock-only audit flags and unchanged enforcement script pass against npmjs: source-map-js is absent, no new unique advisories appeared, and only the previously accepted http-cache-semantics high finding remains. The local Microsoft mirror returned a 404 for the patched tarball and a stale/differing transitive audit graph; local install/audit validation used public npm explicitly without changing repository configuration or bypassing enforcement.
Validation
Limits and non-goals
The original
v0.28.36startup cause remains unknown. Readiness is host-to-loopback Docker gateway traffic (Docker primary runtime, CH enclave roles), not guest DNS/data-plane evidence. macOS cannot establish eligible live KVM acceptance; an authorized future release and eligible run remain necessary. No merge, release, secret-bearing live dispatch, or change to the independent privileged network-hook/recovery-directory failures is included.