Skip to content

feat(ci): add native Gateway validation on Azure - #1788

Closed
karkarl wants to merge 1 commit into
openclaw:mainfrom
karkarl:karkarl-cloud-windows-test-lanes
Closed

karkarl wants to merge 1 commit into
openclaw:mainfrom
karkarl:karkarl-cloud-windows-test-lanes

Conversation

@karkarl

@karkarl karkarl commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Adds a controlled path for real native Gateway testing on Azure Windows guests without replacing ordinary GitHub-hosted Windows tests with hosted-runner MXC skips.

User Impact

This is a draft implementation handoff for Dallin, not a working cloud deployment or merge-ready proof. Developers keep the existing hosted Windows test lanes. After OpenClaw supplies approved broker access and a suitable Windows image, maintainers can manually run native Gateway lifecycle proof with exact-source evidence and task-owned VM cleanup.

No environment, secret, runner, VM, checkpoint or cloud resource has been created or changed. No workflow has been dispatched. Full native build/test closeout and real Azure proof remain blocked.

Why This Change Was Made

The existing ci.yml already provides ordinary Windows CI. This adds hosted negative regressions there and a separate manual-only Azure controller using the existing OpenClaw Crabbox broker, not employer Azure credentials or the release-signing identity.

The controller requires canonical main, an existing protected environment, an automation bearer credential and an approved coordinator-owned Azure OS-disk snapshot. It pins Crabbox v0.79.0 by archive digest, persists a fixed lease intent before acquisition, checks out the exact source in the guest, validates fresh evidence, and waits for lease deletion. Coordinator TTL is the runner-loss backstop, not a claim that cleanup was observed.

The guest installs an approved signed MSIX and exercises the product's package-qualified clawctl setup, prepare, start/status, restart/status, stop/status and teardown/status paths. Session capability, package identity and process/listener ownership must be real. There is no prepared-payload fixture, WSL/npm fallback, certificate installation, host repair or successful skip.

Native isolated-session package lifecycle, process BaseContainer containment, Companion pairing/UI and WSL-MXC proof are different contracts. This lane proves only the first.

Evidence

The source-level checks below exercise real controller/harness logic with explicit transport and package wire fixtures. They do not allocate resources or prove MXC runtime behavior. A regression first demonstrated rejection of Azure's capitalized Succeeded state; admission now follows Crabbox's case-insensitive readiness contract.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-wsl-mxc: Preserve the separate strict Gateway-to-Windows-node containment proof obligation. Not run here; native isolated-session package proof must not substitute for it.

Additional required evidence: real native Gateway package lifecycle on an approved Azure Windows 11 x64 snapshot. The current named pool inventory does not have a native-session-only pool. This workflow's guest result is separate from the WSL pool above and remains not verified / blocked.

Validation

Command/check Result
.\scripts\test-azure-native-gateway-proof.ps1 Passed: 128 assertions, fixtures only.
.\scripts\test-native-gateway-proof.ps1 Passed: 58 assertions, fixtures and harmless owned subprocesses only.
.\scripts\test-ci-workflow-contract.ps1 Passed. The invalid-diff warning is an intentional fail-closed fixture.
.\scripts\validate-docs.ps1 Passed: 63 Markdown files and proof-pool/flow checks.
[Management.Automation.Language.Parser]::ParseFile(...) on the seven added PowerShell sources Passed: zero parse errors.
PyYAML parse and assertions for the new workflow Passed: manual-only trigger, admission dependency, protected environment, read-only permissions.
git diff --check Passed.
.\build.ps1 Not run / blocked: shared ARM64 controller prohibits heavy builds; no approved isolated Windows target.
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore Not run / blocked by the same target restriction.
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore Not run / blocked by the same target restriction.
.\scripts\validate-mxc-e2e.ps1 Not run / blocked: no authorized WSL-MXC runtime. No -AllowSkip substitute.
.\scripts\Test-NativeGatewayProof.ps1 -SourceSha <approved-sha> -MsixPath <approved-msix> -MsixSha256 <approved-digest> -PackagingSha <approved-packaging-sha> -WxcExecPath <approved-probe> -WxcExecSha256 <approved-digest> -DisposableHost Not run / blocked: approved disposable guest and artifact inventory are unavailable.
.\scripts\Invoke-AzureNativeGatewayProof.ps1 -CrabboxPath <pinned-controller> in the manual workflow Not run / blocked: CI environment/credential, approved snapshot and runtime authority are unavailable.

Pre-publication rubber-duck review: independent Copilot code-review subagent found no significant P0-P3 issues in the 10-file change. It independently passed 58 native contract/process assertions, 30 in-memory Azure admission/checkpoint/evidence assertions, and seven AST parses. Host: Windows_NT; model not reported. The shared Codex helper was attempted first but failed authentication with HTTP 401 and produced no accepted review. The fallback is not helper-isolated or validated machine/runtime proof.

Real Behavior Proof

  • Environment tested: Windows ARM64 controller, lightweight fixture/process checks only. No local WSL, Gateway, Companion, VM or desktop proof was launched.
  • PR head or commit tested: 96328723b71b3d750ea166146cfb4d458b5771f2. Focused checks are rerun on this committed head; no live native/cloud proof is claimed.
  • Exact steps or command run: the passed commands in Validation; no cloud or native lifecycle command was executed.
  • Evidence after fix: Azure native Gateway proof contracts: 128 passed (fixtures only; no cloud or native runtime proof). and Native Gateway proof contracts: 58 passed (fixtures only, no native runtime).
  • Observed result: source contracts pass. Actual provider/lease/run URL: none; cloud execution not run.
  • Screenshot or artifact links verified? (Yes/No/N/A) N/A. No runtime artifacts or screenshots are claimed.
  • Not verified or blocked: real Azure acquisition/transport, live native capability and Gateway lifecycle, real cancellation/cleanup, required build/Shared/Tray checks, strict WSL-MXC proof, Companion authentication/pairing and UI.

Security Impact

  • New permissions or capabilities? (Yes/No) Yes: optional authenticated broker allocation on approved manual runs; no GitHub write permissions or permanent runner registration.
  • Secrets or tokens handling changed? (Yes/No) Yes: a new environment-scoped automation credential is required, supplied on stdin to the pinned CLI. It is removed from subprocess environments; guest environment forwarding is limited to CI.
  • New or changed network calls? (Yes/No) Yes: OpenClaw's broker, pinned official Crabbox release download, and exact public source fetch on the approved guest.
  • Command or tool execution surface changed? (Yes/No) Yes: fixed controller and guest entrypoints execute the product CLI on a disposable host.
  • Data access scope changed? (Yes/No) Yes: the approved snapshot inventory and task-owned lease/package/session only.
  • If any answer is Yes, explain the risk and mitigation: cloud execution is manual, canonical-main-only, protected by reviewers and an exact deployment branch rule, and fails closed on missing configuration, identity/proof mismatch or unconfirmed cleanup. Personal GitHub sessions, release-signing credentials, admin-token fallback and arbitrary PR commands are not supported. Snapshot IDs, broker config and raw guest/CLI output are not uploaded. The workflow never installs trust certificates or enables host features.

Compatibility and Migration

  • Backward compatible? (Yes/No) Yes. Existing hosted lanes and strict WSL-MXC behavior are retained.
  • Config or environment changes? (Yes/No) Yes, only to enable this optional manual lane; nothing has been configured by this PR.
  • Migration needed? (Yes/No) No product/user-state migration.
  • If yes, list the exact upgrade steps:

Dallin handoff: setup and activation

  1. Arrange OpenClaw-owned broker automation access, approved Azure region/class/budget and a disposable Windows 11 x64 OS-disk snapshot checkpoint. Do not use employer Azure credentials, copy a personal broker login into CI, or reuse release-signing secrets.
  2. Create the native-gateway-azure GitHub environment with required reviewers, self-review disabled, admin bypass disabled and exactly one custom deployment branch policy: main, type branch.
  3. Configure these environment values. Secret values must not be pasted into this PR:
Name Kind Purpose
CRABBOX_AUTOMATION_TOKEN Secret Operator-issued automation bearer credential, with approved access for owner openclaw-windows-node-ci in org openclaw.
CRABBOX_AZURE_CHECKPOINT_ID Secret Approved coordinator-owned native Azure x64 OS-disk snapshot checkpoint.
NATIVE_GATEWAY_INPUTS_SHA256 Secret Approved digest of the guest's C:\OpenClawProof\inputs.json.
CRABBOX_AZURE_CLASS Variable Explicit approved machine class.
CRABBOX_AZURE_TTL_MINUTES Variable Approved coordinator TTL, 60 to 120 minutes.
  1. Prepare the snapshot's native SSH/archive transport, Git, PowerShell 7.4+, trusted signed Gateway MSIX, pinned wxc-exec.exe and artifact inventory. Require no current-user Gateway registration/session. Independently approve digests and packaging provenance. A Windows build number or a base-container probe is not native-session qualification. azure.image accepts Marketplace coordinates, not a local VHDX or arbitrary image resource ID; use the snapshot checkpoint path.
  2. Run the blocked required build/tests and real guest proof on an authorized isolated target. Investigate failures rather than accepting skipped/no-op output. Preserve the separate WSL-MXC obligation.
  3. Review this draft, publish/land only with maintainer approval, then manually dispatch Native Gateway Azure proof from canonical main. Verify the exact head, full real lifecycle receipt, and cloud-summary.json including confirmed provider cleanup. An unavailable/failing coordinator, image, capability or cleanup must leave the run failed. Do not describe fixture counts as a completed cloud deployment.

The maintained input schema, lifecycle contract, proof boundaries and recovery procedure are in the branch's Azure lane guide.

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

Preserve hosted Windows CI and add strict native lifecycle contracts plus
a protected, manual snapshot-backed Azure controller. Operational setup
and real native/cloud proof remain blocked and documented for handoff.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 792450a4-dcd2-45ce-b5a6-4ee4e9c33ca3
@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge.

What this changes

This PR adds a protected manual Azure workflow that validates a signed native Gateway package on a disposable Windows guest.

Example: Validate Gateway package 2026.10.20.0 on an approved Azure Windows 11 x64 snapshot.

  • Before: Hosted CI provides no equivalent real native package lifecycle run.
  • After: The proposed lane installs the package, exercises setup through teardown, records evidence, and attempts VM cleanup.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful scoped infrastructure with passing fixture checks, but the real cleanup contract is broken and cloud authority evidence is absent.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Maintainers cannot validate the real native Gateway package lifecycle through ordinary hosted Windows or WSL CI.
Reason: The collaborator-authored direction supplies a distinct validation capability while preserving existing lanes and explicitly limiting its claims to package lifecycle.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep this maintainer-authored draft open: it adds a useful native validation lane absent from main, but its cleanup command is incompatible with pinned Crabbox.

Priority: P2
Reviewed head: 96328723b71b3d750ea166146cfb4d458b5771f2

Before merge

  • Add real behavior proof - Authority-chain proof required: supplied evidence exercises fixture transports and owned subprocesses only; establish the approved controller-to-broker-to-guest lifecycle and cleanup, plus rejection of fork/non-main dispatch, revoked credentials before allocation, and another owner's lease before release, using redacted logs or terminal output. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Pass cleanup flags before the positional lease ID (P1) - After any lease acquisition, this emits crabbox stop --provider azure cbx_0123456789ab --wait. In pinned v0.79.0, stop uses Go flag parsing, which stops at the lease ID; --wait then becomes a second positional argument and triggers the usage error before any release request. Both finally cleanup and the separate workflow cleanup step therefore fail, leaving the VM until coordinator TTL and making every acquired-lease workflow fail. Use stop --provider azure --id &lt;lease-id> --wait or put all flags before the positional ID, update the documented example, and correct the fixture that currently requires the broken ordering.
  • Resolve security concern: Establish broker allocation and release authorization - The automation bearer is persisted for later allocation and cleanup calls. Supplied fixtures establish local admission checks, but do not show forbidden dispatches, revoked credentials, or another owner's lease rejected before the corresponding cloud effect; no authorization bypass is established by this review.
  • Resolve merge risk - Before enabling the shared broker credential, establish that forbidden dispatch contexts and revoked credentials cannot reach VM allocation, and that persisted cleanup authority cannot release another owner's lease.

Findings

  • [P1] Pass cleanup flags before the positional lease ID — scripts/AzureNativeGatewayProof.psm1:103
  • [medium] Establish broker allocation and release authorization — scripts/Invoke-AzureNativeGatewayProof.ps1:34

Tests

  • Missing end-to-end proof: No supplied production-path run demonstrates broker authorization, native package lifecycle, or confirmed cleanup; fixtures accept the invalid cleanup argument order.
Agent review details

How this fits together

GitHub Actions supplies approved source and artifact identities to a Crabbox controller, which leases an Azure guest, invokes package-qualified clawctl commands, and returns filtered evidence.

flowchart TD
  A[Manual main dispatch] --> B[Protected environment admission]
  B --> C[Crabbox controller]
  C --> D[Azure Windows guest]
  D --> E[Signed Gateway package]
  E --> F[Lifecycle receipt]
  F --> C
  C --> G[Evidence and lease cleanup]
Loading

Technical review

Best possible solution:

Retain the scoped manual lane, correct the cleanup arguments and fixture, and establish its authorization boundary before activation.

Do we have a high-confidence way to reproduce the issue?

The emitted cleanup arguments and pinned Crabbox parser establish rejection before release; no runtime reproduction was executed.

Is this the best way to solve the issue?

A separate manual controller using existing broker and package owners fits the stated scope, but its cleanup adapter must honor the actual CLI contract.

Full review comments:

  • [P1] Pass cleanup flags before the positional lease ID — scripts/AzureNativeGatewayProof.psm1:103
    After any lease acquisition, this emits crabbox stop --provider azure cbx_0123456789ab --wait. In pinned v0.79.0, stop uses Go flag parsing, which stops at the lease ID; --wait then becomes a second positional argument and triggers the usage error before any release request. Both finally cleanup and the separate workflow cleanup step therefore fail, leaving the VM until coordinator TTL and making every acquired-lease workflow fail. Use stop --provider azure --id &lt;lease-id> --wait or put all flags before the positional ID, update the documented example, and correct the fixture that currently requires the broken ordering.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8dfedf9616c5.

Merge-risk options

Maintainer options:

  1. Verify broker authority before activation (recommended)
    Keep the draft until an authorized production-path run establishes allowed allocation, rejection of forbidden or revoked authority before allocation, and rejection of an unrelated lease before release.
  2. Pause the cloud lane
    Leave the draft parked until approved broker access and a disposable Windows snapshot are available.

Provenance checked

  • Hosted Windows validation keeps the original intent (d090a81: Native source-build validation supports development beside the Store Gateway; the added fixture checks preserve that existing lane.)
  • Latest versus packaged Gateway testing keeps the original intent (66343f7: Development channels and WSL Latest validation serve different contracts from native package execution; this PR keeps them separate.)
  • Native package proof boundary keeps the original intent (dba8121: Existing guidance requires genuine session and package evidence and distinguishes lifecycle from Companion integration; the new guide retains those limits.)

Testing

Proof path: unit tests only.

Security

Needs attention: Source shows deliberate credential isolation, but the new cloud authority boundary lacks final-effect validation.

Evidence

Security concerns:

  • [medium] Establish broker allocation and release authorization — scripts/Invoke-AzureNativeGatewayProof.ps1:34
    The automation bearer is persisted for later allocation and cleanup calls. Supplied fixtures establish local admission checks, but do not show forbidden dispatches, revoked credentials, or another owner's lease rejected before the corresponding cloud effect; no authorization bypass is established by this review.
    Confidence: 0.98

What I checked:

  • Introduced change and current-main boundary: The pinned introduction contains ten additive files or edits; current main retains hosted Windows and WSL lanes without this Azure controller. (.github/workflows/native-gateway-azure.yml:1, 96328723b71b)
  • Cleanup invocation: Both the controller's finally block and the separate workflow cleanup step call the helper that places --wait after the positional lease ID; the fixture explicitly accepts that ordering. (scripts/AzureNativeGatewayProof.psm1:103, 96328723b71b)
  • Executed dependency establishes cleanup failure: The workflow executes digest-pinned Crabbox v0.79.0. Its stop command uses standard flag parsing and rejects more than one remaining positional argument; its Kong adapter passes arguments through unchanged. Consequently, a lease ID followed by --wait is rejected before release. (internal/cli/run.go:5186, 6c9681db5a25)
  • Authoritative package protocol: The guest directly executes the package's clawctl protocol, making packaging an applicable dependency contract; its JSON owner defines the isolated-session integration, build identity, Companion preparation, and listener ownership fields consumed here. (src/OpenClaw.Launcher/ClawCtlJson.cs:9, 403e5ba39385)
  • Full body and discussion: The full fetched body identifies this as a draft handoff for Dallin and expressly reports no cloud allocation or native lifecycle execution; discussion contains only bot status comments and no additional behavior evidence. (96328723b71b)
  • Validation and inspection limits: Exact-head CI passed both added fixture checks. The UI test job failed, but its annotations identify no test cause and its log download was blocked by the network allowlist, so attribution remains unresolved. No target code, builds, tests, or review helper ran during this review; the checkout remains clean. Some older blobs were unavailable to local show/blame, while file history and current-main ownership evidence remained readable. (.github/workflows/ci.yml:174, 96328723b71b)

Likely related people:

  • Dallin Romney: Raw commit c57002c adds .github/workflows/ci.yml:9 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c57002c5c3ba; files: .github/workflows/ci.yml)
  • Karen: Raw commit dba8121 adds docs/TEST_COVERAGE.md:181 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dba81213371c; files: docs/TEST_COVERAGE.md)
  • Pedro Larroy: Raw commit d090a81 adds .github/workflows/ci.yml:101 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d090a8110fa3; files: .github/workflows/ci.yml)
  • Barbara Kudiess: Raw commit 3977f82 adds scripts/ProofEvidence.ps1:4 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 3977f8206ed4; files: scripts/ProofEvidence.ps1)

Review metrics

Metric Value Why it matters
Added scope 621 controller/guest PowerShell lines, 105 workflow lines, 389 test lines, 140 documentation lines The growth implements separate cloud orchestration and package lifecycle contracts; the transport fixtures currently miss the real CLI parsing failure.

Labels

Label changes:

  • add P2: This optional validation improvement has a concrete cleanup defect but does not alter an active product runtime.
  • add merge-risk: 🚨 security-boundary: The workflow introduces a persisted shared credential capable of cloud allocation and release without final-effect authorization evidence.
  • add merge-risk: 🚨 automation: Every acquired-lease run reaches a rejected cleanup command, preventing the new workflow from passing and leaving VM reclamation to TTL.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: This optional validation improvement has a concrete cleanup defect but does not alter an active product runtime.
  • merge-risk: 🚨 automation: Every acquired-lease run reaches a rejected cleanup command, preventing the new workflow from passing and leaving VM reclamation to TTL.
  • merge-risk: 🚨 security-boundary: The workflow introduces a persisted shared credential capable of cloud allocation and release without final-effect authorization evidence.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 20, 2026, 3:51 PM ET / 19:51 UTC.

@shanselman

Copy link
Copy Markdown
Collaborator

Hi @karkarl, I'm a GitHub Copilot triage bot helping with repository housekeeping, not Scott. I see this is an intentional Azure validation handoff for Dallin, with approved broker/image prerequisites still needed. Is that handoff still planned, and do you expect to move this forward against current main? If it has moved elsewhere or the plan has changed, you're welcome to close the draft with a pointer. If it's simply waiting on access or ownership, a short status note is plenty. No request to provision anything, and no automatic closure.

@karkarl karkarl closed this Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants