Skip to content

Allow narrowly gated Cloud Hypervisor agent acceptance fixture - #69777

Merged
lpcox merged 6 commits into
mainfrom
lpcox-cloud-hypervisor-agent-acceptance
Oct 17, 2026
Merged

lpcox merged 6 commits into
mainfrom
lpcox-cloud-hypervisor-agent-acceptance

Conversation

@lpcox

@lpcox lpcox commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Companion compiler prerequisite for github/gh-aw-firewall#10171. Admit a Cloud Hypervisor primary plus a Cloud Hypervisor Copilot agent enclave only through checked-in boolean features.cloud-hypervisor-agent-acceptance: true and the exact manual official-repository branch acceptance fixture. This is not general or production support.

The gate fixes workflow identity smoke-enclave-cloud-hypervisor-copilot, the official-repository/branch condition, one static public github/gh-aw-firewall repository, explicit Copilot / claude-sonnet-5, AWF v0.28.62, and the exact single-invocation/time/task/output/model settings. Ambient GH_AW_FEATURES cannot opt in. Existing no-mixed-runtime, no-image-override, no-dynamic, no-GitHub-tools, API-proxy/provider-route, and attested-artifact checks remain active. Model request/token settings remain advisory in the pinned guest.

Adds positive compilation and negative/boundary regression tests plus directly related experimental documentation. No release/version bumps, runtime/setup-script changes, workflow dispatch, inference, or guest/artifact/credential bypass.

Validation

  • make build and make fmt passed.
  • go test ./pkg/workflow -run 'Test.*CloudHypervisor' -count=1 passed.
  • Focused acceptance/runtime tests passed on both main and a clean targeted v0.92.3 source backport.
  • make agent-report-progress passed, including change-scoped lint/tests and 344 workflows recompiled with no lock-file drift. The initial cold-cache Go-lint attempt timed out at five minutes; the repository-compatible linter subsequently passed with a bounded 15-minute allowance (0 issues), and the complete final gate passed on rerun.
  • A scratch copy of the actual AWF acceptance workflow compiled successfully with the final backport binary and preserved setup SHA, Copilot 1.0.96, mcpg v0.4.33, and both Cloud Hypervisor runtimes. No live inference was run.

Reproducible acceptance compiler

Main differs from v0.92.3 in 995 unrelated files. For generating only this acceptance workflow, use a source-built targeted backport, not main's compiler or an unchanged official release binary.

Base: v0.92.3 commit aa629a8f04fc27f6024cc49d9935d3b882c37880. Companion patch commit: 2b19ccffd0694750e8e2bdcb20bf882e9bb440f2. Only pkg/workflow/enclaves_runtime.go and pkg/workflow/enclaves_agent_acceptance_test.go are required in the backport; documentation may also be applied unchanged. The backport needs no other compiler changes.

In an isolated source directory, with this companion commit available locally, set SOURCE_DIR, PATCH_PATH (absolute), and OUTPUT_BINARY (absolute):

git archive v0.92.3 | tar -x -C "$SOURCE_DIR"
{
  git diff 2b19ccffd0694750e8e2bdcb20bf882e9bb440f2^ 2b19ccffd0694750e8e2bdcb20bf882e9bb440f2 -- pkg/workflow/enclaves_runtime.go
  git diff 2b19ccffd0694750e8e2bdcb20bf882e9bb440f2^ 2b19ccffd0694750e8e2bdcb20bf882e9bb440f2 -- pkg/workflow/enclaves_agent_acceptance_test.go
} > "$PATCH_PATH"
cd "$SOURCE_DIR"
git apply --check "$PATCH_PATH"
git apply "$PATCH_PATH"
go test ./pkg/workflow -run 'Test(ValidateCloudHypervisor|CloudHypervisorAgentAcceptance|CompileCloudHypervisor.*Enclave|CompileCloudHypervisorAgentAcceptance|EnclavesCloudHypervisorExperimentalWarning)' -count=1
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath \
  -ldflags '-s -w -X main.version=dev-v0.92.3-enclave-agent-acceptance.c483bd2e10ac' \
  -o "$OUTPUT_BINARY" ./cmd/gh-aw

Built using go1.26.9 darwin/arm64. Ordered compiler/test patch SHA256: c483bd2e10ac94aa1c9b37fd82e2c55e09f6b11ebc8e44f8c5b1950f644e57b9 (verified against the public commit diff). Delivered darwin/arm64 binary SHA256: 478142026cf767c53d5678a76bf511f4237468c2f662dd07117a3a4045e75239.

From the AWF checkout, generate only the new workflow:

"$OUTPUT_BINARY" compile .github/workflows/smoke-enclave-cloud-hypervisor-copilot.md \
  --action-mode action \
  --action-tag 26e5d7e7d2345ae4c8dfa3d9017ca2ff9bbf2c82 \
  --no-check-update

The binary and lock metadata identify the experimental source build. Non-release runtime version emission stays dev; it is not represented as official v0.92.3. The explicit setup reference remains the official github/gh-aw-actions v0.92.3 SHA. AWF owns its host-source-build postprocessing; attested primary/enclave guests remain pinned to checked-in compatibility v0.28.62. No companion setup action/runtime script change is required.

Preserve general primary-plus-agent rejection while admitting the manual official-repository static public Copilot acceptance workflow. Keep existing artifact, provider, runtime, and GitHub restrictions intact.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 37f16600-2538-40c8-90d4-5a3ac59ed162
@lpcox
lpcox marked this pull request as ready for review October 17, 2026 20:22
Copilot AI max review requested due to automatic review settings October 17, 2026 20:22
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · sonnet50 · 14 AIC · ⌖ 15 AIC · ◇ 6.61 AIC · ⊞ 12.6K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · gpt56 · 7.26 AIC · ⌖ 6.15 AIC · ⊞ 14.6K · ◷

Generated by Ponytail Reviewer for #69777

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Commit pushed: fd4f846

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR adds 263 new lines in pkg/ (more than the 100-line threshold), which counts as a significant change to core business logic. It does not link an Architecture Decision Record (ADR).

The PR adds a new compile-time exception: validateCloudHypervisorAgentAcceptance in pkg/workflow/enclaves_runtime.go. It admits Cloud Hypervisor agent enclaves under a Cloud Hypervisor primary, but only for one fixture pinned by feature flag, workflow, repository and parameters. This partly revisits ADR-67772, which rejected agent enclaves in that configuration and also rejected a separate opt-in flag.

📄 Draft ADR committed: docs/adr/69777-gate-cloud-hypervisor-agent-enclave-acceptance-fixture.md. Review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch. It was generated from the PR diff.
  2. Complete the missing sections. Add context the AI could not infer (for example, other deciders), refine the decision rationale, and confirm the alternatives you actually considered.
  3. Commit the finalized ADR to docs/adr/ on your branch.
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-69777: Gate Cloud Hypervisor Agent Enclaves Behind a Narrow Acceptance Fixture

Once an ADR is linked in the PR body, this gate will re-run and check that the implementation matches the decision.

❓ Why ADRs Matter

ADRs create a searchable, permanent record of why the codebase looks the way it does. This matters most for decisions like this one, where fixture-specific values are hard-coded into the compiler.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context: What is the problem? What forces are at play?
  • Decision: What did you decide? Why?
  • Alternatives Considered: What else could have been done?
  • Consequences: What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · opus55 · 31 AIC · ⌖ 40.6 AIC · ⊞ 1.9K · ◷
Comment /review to run again

@github-actions github-actions Bot 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.

Verdict

I did not find a changed-line bug here that I would block on.

Notes

I focused on the new acceptance gate in validateCloudHypervisorAgentAcceptance, the regression coverage, and the paired docs changes. The restrictions are intentionally narrow, and the negative tests cover the obvious escape hatches: ambient feature flags, trigger drift, repo drift, runtime/version drift, GitHub tool enablement, and AWF argument overrides.

Static review only: I did not execute the compiler or runtime in this pass.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 83.8 AIC · ⌖ 5.67 AIC · ⊞ 12.7K
Comment /review to run again

Compare the reusable-workflow condition as parsed YAML rather than rejecting valid scalar quoting. Supply fixture-local repository configuration and the missing dispatch target, then refresh the smoke snapshot previously skipped by the native runner.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 37f16600-2538-40c8-90d4-5a3ac59ed162

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /codebase-design and /tdd (triage done directly; pr-triage agent was consulted and returned tests_only with the same files). One maintainability suggestion below; no correctness or security issues found.

📋 Key Themes & Highlights

Key Themes

  • Literal duplication: the fixed acceptance values (workflow id, if condition, repo, model, AWF version, numeric limits) are typed out independently in validateCloudHypervisorAgentAcceptance and again in the test fixture cloudHypervisorAgentAcceptanceData. Extracting them to shared constants would remove the risk of the validator and its test drifting apart when the fixture is updated.

Positive Highlights

  • Excellent negative-path coverage - TestValidateCloudHypervisorAgentAcceptance exercises 30+ rejection scenarios (wrong workflow id, ambient GH_AW_FEATURES, wrong repo/sensitivity, profile override, dynamic enclave, GitHub tools, DinD, proxy disabled, etc.) plus exact boundary testing via TestCloudHypervisorAgentAcceptanceExactLimits (+/-1 on every numeric limit).
  • The ambient-opt-in guard is well tested: t.Setenv(GH_AW_FEATURES, ...) combined with the no opt-in/false opt-in/string opt-in cases confirms GH_AW_FEATURES genuinely cannot enable the fixture, matching the PR's stated goal.
  • TestCompileCloudHypervisorAgentAcceptance is a solid end-to-end check that also asserts step ordering in the generated lock file, not just presence of fragments.
  • Docs update clearly scopes the fixture as non-production and explains why branch-built AWF host code is still required even with the compiler opt-in.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 99.9 AIC · ⌖ 13.9 AIC · ⊞ 10.1K
Comment /matt to run again

Comment thread pkg/workflow/enclaves_runtime.go Outdated
func validateCloudHypervisorAgentAcceptance(data *WorkflowData, enclave *EnclaveConfig) error {
// Require a checked-in boolean opt-in, not an ambient GH_AW_FEATURES override.
if enabled, ok := data.Features[cloudHypervisorAgentAcceptanceFeature].(bool); !ok || !enabled {
return errors.New("set features.cloud-hypervisor-agent-acceptance: true only for the official acceptance fixture")

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.

[/codebase-design] validateCloudHypervisorAgentAcceptance inlines six independent exact-match literals (workflow id, if string, repo, engine, model, AWF version) and six numeric thresholds directly as string/number comparisons, and the test fixture (cloudHypervisorAgentAcceptanceData in enclaves_agent_acceptance_test.go) re-types the same values independently. There is no single source of truth linking them.

💡 Suggestion

Extract the fixed values into named constants (e.g. alongside cloudHypervisorAgentAcceptanceFeature):

const (
	cloudHypervisorAgentAcceptanceWorkflowID = "smoke-enclave-cloud-hypervisor-copilot"
	cloudHypervisorAgentAcceptanceCondition  = "github.repository == 'github/gh-aw-firewall' && github.ref_type == 'branch'"
	cloudHypervisorAgentAcceptanceRepo       = "github/gh-aw-firewall"
	cloudHypervisorAgentAcceptanceModel      = "claude-sonnet-5"
	cloudHypervisorAgentAcceptanceAWFVersion = "v0.28.62"
)

and have the test helper reference the same constants instead of re-typing the literals. That way a future change (e.g. bumping the AWF version pin) touches one declaration instead of requiring synchronized edits across the validator and the test fixture, which is exactly the kind of drift this gate is designed to prevent.

@copilot please address this.

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.

Moved the fixture identity, condition, repository, engine, model, AWF version, and numeric limits into shared constants and reused them in the validator and test fixtures. Committed as ea00c14.

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.

🔵 Needs a closer look

The isolation-sensitive exception needs human verification against the companion runtime gate, and the compilation test still depends on live GitHub access.

1 open issue
What changed in this PR

Adds a compiler-only exception for the manual Cloud Hypervisor Copilot acceptance fixture, without enabling general runtime support.

Changes:

  • Gates acceptance on exact workflow identity, configuration, limits, and AWF version.
  • Adds compilation and negative regression tests.
  • Documents experimental restrictions and host/guest requirements.
File Description
pkg/​workflow/​enclaves_runtime.go Enforces the narrowly scoped acceptance gate.
pkg/​workflow/​enclaves_agent_acceptance_test.go Tests compilation and gate boundaries.
docs/​src/​content/​docs/​experimental/​enclaves.md Explains acceptance requirements and limitations.

Review effort: Max

Comment on lines +184 to +186
compiler := NewCompiler()
compiler.SetStrictMode(false)
require.NoError(t, compiler.CompileWorkflow(path))

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.

Seeded the compiler's test-local action cache with the expected setup-action SHA before compilation. The focused acceptance tests pass with GH_TOKEN and GITHUB_TOKEN unset. Committed as ea00c14.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/workflow/enclaves_runtime.go:104): [/codebase-design] validateCloudHypervisorAgentAcceptance inlines six independent exact-match literals (workflow id, if string, repo, engine, model, AWF version) and six numeric thresholds directly as string/number comparisons, and the test fixture (cloudHypervisorAgentAcceptanceData in enclaves_agent_acceptance_test.go) re-types the same values independently. There is no single source of truth linking them. - Allow narrowly gated Cloud Hypervisor agent acceptance fixture #69777 (comment)
  3. Review (pkg/workflow/enclaves_agent_acceptance_test.go:186): This test depends on live GitHub access to satisfy the setup-action SHA assertion at line 201. action-tag: v0.92.3 has no matching embedded or checked-in action pin, so ActionResolver.ResolveSHA falls back to gh api. If resolution fails, the compiler emits github/gh-aw-actions/setupv0.92.3, and the assertion fails even though compilation succeeds. CI's Workflow Compiler group runs this test with an empty GH_TOKEN (.github/workflows/ci.yml:325–327,465). Seed a test-local action cache before compiling so the assertion is deterministic without GitHub credentials or network access. - Allow narrowly gated Cloud Hypervisor agent acceptance fixture #69777 (comment)
  4. Fix failing check impacted-go-tests (FAILURE): https://github.com/github/gh-aw/actions/runs/39067250531/job/117497438782.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: 33bcc9e
Sous-chef work: 3a98bb3bb7802db6d520d7229e7b2cd070e22169fe81a446b8d82c2c9d7ffe47 42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac 8c4a04ed514a9e81bcd7c943130d3075ae0365b8d0b36d2d0192bac75ce1f7bb
Sous-chef state: 1fe245cd57cc81aa67cbea4cc32c092d067bffe261d431305b2e897f80ded226

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 3.87 AIC · ⌖ 8.04 AIC · ⊞ 1.1K · ◷
Comment /souschef to run again

lpcox and others added 2 commits October 17, 2026 14:05
Parse the activation condition as YAML so folded conditions retain their pre-activation gate, and assert that manual workflows without role checks have no pre-activation job or dangling dependency.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 37f16600-2538-40c8-90d4-5a3ac59ed162
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Assert the existing unavailable-context diagnostic at ParseWorkflowString, where validation now occurs, rather than requiring parsing to succeed first.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 37f16600-2538-40c8-90d4-5a3ac59ed162
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check impacted-go-tests (FAILURE): https://github.com/github/gh-aw/actions/runs/39070863133/job/117512839244.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: ea00c14
Sous-chef work: 42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac
Sous-chef state: fe418955396c29062d475ceccdbf81bf7353053609525ab946d1c776bc309119

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 2.99 AIC · ⌖ 7.53 AIC · ⊞ 1.1K · ◷
Comment /souschef to run again

@lpcox
lpcox merged commit e9aa2e5 into main Oct 17, 2026
37 of 38 checks passed
@lpcox
lpcox deleted the lpcox-cloud-hypervisor-agent-acceptance branch October 17, 2026 22:10
Copilot stopped work on behalf of gh-aw-bot due to an error October 17, 2026 22:11
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.92.5

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.

4 participants