Skip to content

Retain actionable public enclave result failures and audit evidence - #11277

Merged
lpcox merged 4 commits into
mainfrom
copilot/retain-public-enclave-failure-evidence
Nov 7, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/retain-public-enclave-failure-evidence

Conversation

Copilot AI commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Post-readiness enclave failures collapsed to result/unknown, skipped audit inspection, and obscured Docker setup failures and guest session-log errors. This PR extends the existing public diagnostic contract without changing backend execution.

  • Result classification: Distinguish parser/protocol errors, tool rejection, schema failure, and expected-result mismatch. Add executor outcomes only from identity-checked terminal journals; otherwise retain unknown.
  • Failure-path audits: Inspect presence, schema, and invocation metadata after AWF exit. Separate observations from success assertions; audit and cleanup failures remain secondary.
  • Executor evidence: Retain Docker setup diagnostics before releasing storage, or explicitly report retention unavailable. Promote eligible stderr operation errors such as preflight-session-log when the transcript is missing.
  • Safety and coverage: Preserve eligibility, ownership/path checks, redaction, byte limits, and recoverable sources. Add contract fixtures across Copilot, Codex, and Claude on both backends; keep approved-result, audit, stop, and cleanup success gates intact.

Example bounded result classification:

{
  "resultFailure": {
    "category": "parser-protocol",
    "code": "invalid-json",
    "executorOutcome": "unknown"
  }
}

Copilot AI changed the title [WIP] Retain actionable public enclave result failures and audit evidence Retain actionable public enclave result failures and audit evidence Nov 7, 2026
Copilot AI requested a review from lpcox November 7, 2026 18:42
@lpcox
lpcox marked this pull request as ready for review November 7, 2026 18:43
Copilot AI adaptive review requested due to automatic review settings November 7, 2026 18:43

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

Helper-backed setup failures can block storage cleanup because missing-file error codes are lost, and pre-invocation regression failures incorrectly trigger audit checks that produce spurious secondary failures.

2 open issues
What changed in this PR

Extends AWF’s existing public enclave diagnostic contract to retain actionable result failures and audit evidence across Docker and Cloud Hypervisor.

Changes:

  • Adds bounded result classifications and identity-checked terminal executor outcomes.
  • Inspects failed-result audits and retains Docker setup and guest entrypoint evidence.
  • Adds coverage across Copilot, Codex, Claude, and both backends, and documents the contract.
File Description
src/​enclave/​public-debug-events.ts Projects bounded entrypoint failures and preserves their priority.
src/​enclave/​public-debug-events.test.ts Tests fallback evidence, redaction, limits, and file safety.
src/​enclave/​public-debug-conformance.test-utils.ts Validates entrypoint operation metadata.
src/​enclave/​public-debug-artifacts.ts Avoids implying capture when session data is unavailable.
src/​enclave/​docker-host-executor.ts Retains setup diagnostics and protects recoverable sources.
src/​enclave/​docker-host-executor.test.ts Covers setup, retention, custody, and cleanup failures.
src/​cloud-hypervisor/​host-enclave-executor.ts Integrates session metadata and stderr fallback evidence.
src/​cloud-hypervisor/​host-enclave-executor.test.ts Tests fallback failures with missing session transcripts.
src/​cloud-hypervisor/​enclave-session-diagnostics.ts Exposes the shared session-operation allowlist.
scripts/​ci/​run-enclave-agent-regression.js Classifies result failures and observes failure-path audits.
scripts/​ci/​enclave-agent-regression.test.ts Exercises result and audit classifications across engines and backends.
scripts/​ci/​collect-enclave-smoke-debug.test.ts Tests bounded metadata export and unsafe-evidence rejection.
scripts/​ci/​collect-enclave-smoke-debug.cjs Validates and exports result, audit, and retention-unavailable evidence.
scripts/​ci/​cloud-hypervisor-enclave-live-smoke.js Exposes bounded protocol failure reasons.
docs/​cloud-hypervisor-foundation.md Documents classifications, fallback evidence, and success requirements.
containers/​enclave/​agent-executor/​session-diagnostics.js Exports operation names for shared diagnostic validation.

Review effort: Max (auto)

Comment on lines +253 to +254
if ((error as NodeJS.ErrnoException).code === 'ENOENT') continue;
throw error;
@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 both review findings and pushed commit d7ec2f2.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR 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-11277 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit dcf5faf

@lpcox

lpcox commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and resolve conflicts

…-enclave-failure-evidence

# Conflicts:
#	scripts/ci/collect-enclave-smoke-debug.test.ts
#	scripts/ci/enclave-agent-regression.test.ts
#	src/enclave/docker-host-executor.test.ts

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and resolve conflicts

Merged main and resolved the test conflicts in two-parent merge commit df877df. Targeted build and tests pass (632 tests).

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.76% 93.80% 📈 +0.04%
Statements 92.30% 92.35% 📈 +0.05%
Functions 93.00% 93.02% 📈 +0.02%
Branches 86.56% 86.67% 📈 +0.11%
📁 Per-file Coverage Changes (5 files)
File Lines (Before → After) Statements (Before → After)
src/cloud-hypervisor/enclave-session-diagnostics.ts 100.0% → 100.0% (+0.00%) 97.5% → 97.6% (+0.06%)
src/cloud-hypervisor/host-enclave-executor.ts 93.0% → 93.0% (+0.01%) 90.7% → 90.7% (+0.04%)
src/enclave/docker-host-executor.ts 94.8% → 95.9% (+1.02%) 89.4% → 90.8% (+1.40%)
src/enclave/public-debug-artifacts.ts 94.7% → 96.0% (+1.32%) 93.3% → 94.4% (+1.13%)
src/enclave/docker-host-storage.ts 69.4% → 71.5% (+2.12%) 66.0% → 68.5% (+2.47%)

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

@lpcox
lpcox merged commit 413fb63 into main Nov 7, 2026
47 of 48 checks passed
@lpcox
lpcox deleted the copilot/retain-public-enclave-failure-evidence branch November 7, 2026 20:11
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.

Retain actionable public enclave result failures and audit evidence instead of generic result/unknown diagnostics

3 participants