Repository navigation
Refactor enclave smoke debug collection into focused modules - #11951
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Duplicated fixture setup in projections.test.ts and publication.test.ts risks inconsistent updates when the journal or diagnostics schema changes.
1 open issue
What changed in this PR
Refactors AWF’s security-sensitive enclave smoke diagnostics collector into focused modules, addressing #11944 while preserving the existing entrypoint and public interfaces.
Changes:
- Separate evidence projections, filesystem validation, credential redaction, publication, and CLI handling.
- Split regression tests by responsibility and add focused compatibility and boundary checks.
- Update workflows and deployment documentation to install sibling modules with protected ownership and permissions.
| File | Description |
|---|---|
scripts/ci/test-cloud-hypervisor-enclave-workflow.test.ts |
Verify module triggers and test selection. |
scripts/ci/smoke-enclave-workflow.test.ts |
Assert protected module installation. |
scripts/ci/smoke-enclave-copilot-workflow.test.ts |
Assert protected Copilot smoke installation. |
scripts/ci/enclave-agent-regression.test.ts |
Check collector deployment permissions. |
scripts/ci/collect-enclave-smoke-debug/safe-fs.test.ts |
Cover filesystem safety and UTF-8 rejection. |
scripts/ci/collect-enclave-smoke-debug/safe-fs.cjs |
Isolate safe filesystem access and decoding. |
scripts/ci/collect-enclave-smoke-debug/redaction.test.ts |
Cover credential redaction and recursion limits. |
scripts/ci/collect-enclave-smoke-debug/redaction.cjs |
Isolate credential sanitization and auth-field validation. |
scripts/ci/collect-enclave-smoke-debug/publication.test.ts |
Preserve collection and publication regression coverage. |
scripts/ci/collect-enclave-smoke-debug/publication.cjs |
Isolate collection, retention, and failure publication. |
scripts/ci/collect-enclave-smoke-debug/projections.test.ts |
Preserve session and runtime projection coverage. |
scripts/ci/collect-enclave-smoke-debug/projections.cjs |
Isolate closed evidence projections and schemas. |
scripts/ci/collect-enclave-smoke-debug/common.cjs |
Share bounds, constants, and validation helpers. |
scripts/ci/collect-enclave-smoke-debug/collector.test-utils.ts |
Share fixtures and isolated deployment setup. |
scripts/ci/collect-enclave-smoke-debug/cli.test.ts |
Preserve dispatcher and identity-binding coverage. |
docs/cloud-hypervisor-foundation.md |
Document pinned entrypoint and sibling-module installation. |
.github/workflows/test-cloud-hypervisor-enclaves.yml |
Include module changes and split test suites. |
.github/workflows/smoke-enclave-cloud-hypervisor.md |
Install protected sibling modules. |
.github/workflows/smoke-enclave-cloud-hypervisor.lock.yml |
Synchronize compiled installation steps and metadata. |
.github/workflows/smoke-enclave-cloud-hypervisor-copilot.md |
Install modules for the Copilot smoke workflow. |
.github/workflows/smoke-enclave-cloud-hypervisor-copilot.lock.yml |
Synchronize compiled Copilot installation steps and metadata. |
.github/workflows/daily-agent-runtime-regression.yml |
Deploy modules alongside the protected collector. |
Review effort: Max (adaptive)
| journal.record({ invocationId, entryId: 'script', state: 'cleanup-pending' }); | ||
| if (terminal) journal.record({ invocationId, entryId: 'script', state: 'terminal', outcome: 'executor-failure' }); |
|
@copilot address review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Moved the shared fixture setup, journal helper, and common diagnostics envelope into |
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 09d3bf1 |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Fixed the unused uid/gid binding and the CI-only stream-size test scope reuse in commit 6520151. The targeted suite could not run locally because the sandbox dependency install failed with incomplete packages, but the fix reproduces the exact EEXIST root cause and is whitespace/secret checked. |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (5 files)
✨ New Files (5 files)
Coverage comparison generated by |

The 1,398-line collector mixed evidence projection, filesystem safety, credential redaction, publication, and CLI handling on a security-sensitive CI path. This refactor separates those responsibilities without changing collection policy or public interfaces.
Module boundaries
Compatibility and deployment
0700directory permissions, and0600file permissions.Regression coverage