Skip to content

feat(setup): enforce validated protocol-v4 Gateway releases - #1105

Merged
shanselman merged 1 commit into
mainfrom
feat/gateway-latest-fallback
Aug 8, 2026
Merged

shanselman merged 1 commit into
mainfrom
feat/gateway-latest-fallback

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Replace mutable npm latest and the Windows-owned LKG with an exact, reviewable release policy.
  • Install recommended Gateway 2026.6.34, protocol generation 4, using exact Node 22.22.3.
  • Keep 2026.6.11 as the explicit validated fallback and security floor. Fallback is never automatic and is offered only for typed release-addressable failures.
  • Fail closed for malformed policy, below-floor, prerelease, rejected, unattested, or unembedded candidate selections. External evidence is discovery-only and cannot authorize product setup.
  • Require exact installed CLI, Node runtime, protocol, and hello-ok.server.version checks.
  • Replace LKG bump automation with evidence-only discovery. Unembedded candidates require package/tag and provenance/tag commit binding. The existing embedded recommendation/fallback compatibility path additionally requires pinned integrity plus integrity-verified package-build/tag equality.

This is one cohesive commit rebased directly onto current main 650247d9. It preserves current-main managed-local provenance, mirrored-WSL port allocation, hybrid reload/restart recovery, credential handoff, attribution, and loopback testhost guards. It has no dependency on #1101 or deferred refactor stacks.

Release decisions

Release Status Reason
2026.6.34 Recommended Exact clean setup, protocol-v4 handshake, operator/node pairing, restart, revocation recovery, and real Gateway node invocation passed.
2026.6.11 Validated fallback and floor Distinct exact fallback. Never selected automatically.
2026.7.1 Runtime rejected Not promoted by the embedded policy.
2026.7.1-2 Evidence rejected Missing the complete candidate evidence required for promotion.

Validation

Current head: 8412451127056373f277045fe68e3c163c21cf8b

  • ./build.ps1: passed.
  • Shared tests: 3,631 passed, 32 skipped.
  • Tray tests: 2,242 passed.
  • SetupEngine tests: 773 passed.
  • Connection tests: 574 passed.
  • Focused release policy, argument, installer, workflow-contract, and pipeline tests: passed.
  • Candidate workflow YAML and PowerShell parsed successfully.
  • Test-GatewayReleaseCandidate.ps1 -Version 2026.6.34 -AllowEmbeddedPolicyEvidence: eligible; SHA-512, npm signatures, Sigstore provenance, signed extended-stable tag, package-build/tag identity, and protocol 4 verified.
  • Strict unbound-evidence control for 2026.6.34: rejected because provenance source commit differs from the tag.
  • Below-floor control 2026.3.12: rejected below embedded floor 2026.6.11.
  • scripts/validate-mxc-e2e.ps1: 17/17 passed without -AllowSkip.
  • Rubber-duck review: clean after correcting the stale FAQ release reference.
  • Structured autoreview (gpt-5.6-sol, high): two evidence-boundary P1 findings accepted and fixed; final rerun clean with 90% confidence.

Real behavior proof

Current-head disposable proof passed 4/4 in 5.88 minutes:

  • Product setup selected 2026.6.34 (recommended, protocol v4).
  • Installed CLI reported exact 2026.6.34; Node reported exact v22.22.3; hello-ok reported protocol 4 and exact server version 2026.6.34.
  • Operator and Windows node reached Ready.
  • Gateway restart reconnected operator and node.
  • Real Gateway node.invoke routed harmless system.which to Windows and resolved cmd.exe.
  • Device removal, replacement approval, shared-token reconnect, and durable recovery passed.

Strict MXC proof passed real Gateway system.run, contained direct execution, and denied writes to isolated tray data. Artifacts are under TestResults/E2E and TestResults/MxcE2E; secret-bearing gateway/settings files are excluded by the harness.

UI and manual winnode MCP proof: Not verified / blocked. An isolated run-app-local.ps1 -NoBuild -Isolated -AllowNonMain launch surfaced a Windows Security PickerHost window. Per the safety gate, the isolated tray process was stopped immediately without interaction. The disposable E2E harness did exercise isolated local MCP tool calls, but no manual UI screenshot or winnode --list-tools / --command claim is made.

No real paired Gateway, credentials, or user profile were mutated.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Codex review: found issues before merge. Reviewed August 8, 2026, 12:13 AM ET / 04:13 UTC.

ClawSweeper review

What this changes

This PR replaces the managed Gateway last-known-good pin with an exact protocol-v4 release policy, install and handshake validation, a manual fallback, and release-candidate discovery automation.

Merge readiness

⛔ Blocked by patch quality or review findings - 11 items remain

Keep open. Two prior P1 blockers remain: explicit existing Gateway versions outside the new embedded map will fail on upgrade, and the new candidate workflow gives a downloaded verifier write credentials.

Likely related people: Scott Hanselman (high confidence), Ranjesh Jaganathan (medium), and Barbara Kudiess (medium).

Priority: P1
Reviewed head: 8412451127056373f277045fe68e3c163c21cf8b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch has concrete upgrade and credential-boundary blockers despite substantial claimed validation.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is not subject to the external-contributor proof gate; its body nevertheless records that current-head UI proof for the fallback control was blocked.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is not subject to the external-contributor proof gate; its body nevertheless records that current-head UI proof for the fallback control was blocked.
Evidence reviewed 6 items Current-main compatibility contract: Current main leaves any nonempty Gateway.Version unchanged, preserving explicit user choices before applying the default LKG.
Upgrade-breaking PR path: The PR parses a legacy Version as exact, then rejects releases absent from the embedded evidence map, so a previously accepted official version can fail before setup starts.
Write-token verifier boundary: The candidate workflow grants contents and pull-request write permissions and exposes github.token to every job step; its verifier invokes an npm-downloaded Sigstore CLI.
Findings 2 actionable findings [P1] Preserve configured official Gateway versions
[P1] Remove write-token exposure from the downloaded verifier
Security Needs attention Downloaded verifier receives repository-write credentials: Global job credentials are available when the candidate script invokes the Sigstore CLI through npx, creating a supply-chain path to branch and pull-request writes.

How this fits together

Windows setup provisions a managed WSL Gateway, then pairs the tray operator and Windows node through it. The changed policy chooses the Gateway release before installation and blocks setup when the installed runtime or Gateway handshake does not match.

flowchart LR
  A[Setup configuration] --> B[Gateway release policy]
  B --> C[Exact Gateway installer]
  C --> D[CLI and Node verification]
  D --> E[Gateway protocol handshake]
  E --> F[Tray operator and Windows node]
  E --> G[Typed fallback retry]
Loading

Decision needed

Question Recommendation
Should upgrades preserve previously configured official Gateway.Version values, or intentionally fail every value not embedded in the new validation map? Preserve legacy overrides: Keep existing explicit versions working for upgrades, while applying the embedded validated policy to fresh installs and a clearly opt-in strict mode.

Why: Current main preserves explicit versions, while this PR deliberately changes that persisted configuration contract and combines the stricter policy with a write-credentialed verifier.

Before merge

  • Preserve configured official Gateway versions (P1) - Current main preserves any nonempty Gateway.Version, but this path rejects every legacy value absent from the embedded map. That turns an existing explicit version into a startup failure before install; preserve the old contract or add an approved, tested migration. This is the still-unfixed compatibility finding from the prior review cycle.
  • Remove write-token exposure from the downloaded verifier (P1) - The job exposes github.token with write scopes before running Test-GatewayReleaseCandidate.ps1, which invokes npx --yes @sigstore/[email protected]. A compromised registry dependency can use the token or persisted checkout credential to push arbitrary code or open PRs. Run verification in a credentialless or read-only job and introduce write credentials only in a separate publishing step. This is the still-unfixed security finding from the prior review cycle.
  • Resolve security concern: Downloaded verifier receives repository-write credentials - Global job credentials are available when the candidate script invokes the Sigstore CLI through npx, creating a supply-chain path to branch and pull-request writes.
  • Resolve merge risk (P1) - Existing installations with a supported explicit Gateway.Version that is not in the two-entry policy map will fail setup before installation.
  • Resolve merge risk (P1) - The scheduled candidate workflow runs a registry-downloaded executable with credentials capable of pushing branches and creating pull requests.
  • Resolve merge risk (P2) - The fallback control has source and contract coverage but no current-head visible proof in its active error state; the PR body explicitly records that UI proof as blocked.
  • Complete next step (P2) - A maintainer must choose the persistent-config compatibility boundary, while the workflow credential isolation is a required mechanical repair.
  • Improve patch quality - Preserve or explicitly migrate legacy Gateway.Version configurations with regression coverage.
  • Improve patch quality - Separate candidate verification from write-capable publishing and disable persisted checkout credentials during verification.
  • Improve patch quality - Capture redacted current-head proof of the fallback button in its active error state.

Findings

  • [P1] Preserve configured official Gateway versions — src/OpenClaw.SetupEngine/GatewayReleasePolicy.cs:292-301
  • [P1] Remove write-token exposure from the downloaded verifier — .github/workflows/gateway-release-candidate.yml:26-27
  • [high] Downloaded verifier receives repository-write credentials — .github/workflows/gateway-release-candidate.yml:26
Agent review details

Security

Needs attention: The new scheduled workflow executes a downloaded npm package while holding repository-write credentials.

Review metrics

Metric Value Why it matters
Patch surface 31 files, +2,222 / -332 lines The change spans setup, WinUI, automation, documentation, and E2E coverage.
Code and test delta non-test +1,543 / -264; tests +679 / -68 Most growth is release policy and verifier automation, so the compatibility and credential boundaries warrant focused review.

Merge-risk options

Maintainer options:

  1. Resolve both P1 blockers (recommended)
    Preserve or explicitly migrate legacy versions and run candidate verification without write credentials or persisted checkout credentials before allowing publishing.
  2. Accept the strict upgrade boundary
    Maintain the rejection of legacy versions only after maintainers explicitly approve the breaking policy and its user migration path.
  3. Pause the automation portion
    Defer the candidate workflow if its credential boundary cannot be narrowed independently from release-policy work.

Technical review

Best possible solution:

Keep validated exact releases as the fresh-install default, preserve the legacy explicit-version contract unless maintainers approve a strict migration, and split candidate verification from credentialed publishing.

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

Yes for the upgrade regression: an existing config with a stable official Gateway.Version absent from the embedded map follows the legacy exact path and is rejected before installation. The token exposure is directly established by the workflow and verifier source.

Is this the best way to solve the issue?

No. The release-validation goal is sound, but the patch changes a supported persisted-version contract without an approved migration and leaves the verifier inside a write-credentialed job.

Full review comments:

  • [P1] Preserve configured official Gateway versions — src/OpenClaw.SetupEngine/GatewayReleasePolicy.cs:292-301
    Current main preserves any nonempty Gateway.Version, but this path rejects every legacy value absent from the embedded map. That turns an existing explicit version into a startup failure before install; preserve the old contract or add an approved, tested migration. This is the still-unfixed compatibility finding from the prior review cycle.
    Confidence: 0.99
  • [P1] Remove write-token exposure from the downloaded verifier — .github/workflows/gateway-release-candidate.yml:26-27
    The job exposes github.token with write scopes before running Test-GatewayReleaseCandidate.ps1, which invokes npx --yes @sigstore/[email protected]. A compromised registry dependency can use the token or persisted checkout credential to push arbitrary code or open PRs. Run verification in a credentialless or read-only job and introduce write credentials only in a separate publishing step. This is the still-unfixed security finding from the prior review cycle.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 650247d9b703.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P1: The PR can block existing managed Gateway setup during upgrade and exposes a write-capable automation credential to downloaded code.
  • merge-risk: 🚨 compatibility: Persisted Gateway.Version values that current main accepts become ineligible unless listed in the embedded policy.
  • merge-risk: 🚨 security-boundary: The new workflow executes an npm-downloaded verifier while github.token is available with repository-write permissions.
  • merge-risk: 🚨 availability: The new fail-closed selection and validation checks can stop setup before the Gateway, operator, and node can connect.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This MEMBER-authored PR is not subject to the external-contributor proof gate; its body nevertheless records that current-head UI proof for the fallback control was blocked.

Evidence

Security concerns:

  • [high] Downloaded verifier receives repository-write credentials — .github/workflows/gateway-release-candidate.yml:26
    Global job credentials are available when the candidate script invokes the Sigstore CLI through npx, creating a supply-chain path to branch and pull-request writes.
    Confidence: 0.99

What I checked:

Likely related people:

  • Scott Hanselman: Authored both the PR head and the recent current-main managed Gateway hardening commit. (role: recent setup-area contributor; confidence: high; commits: 841245112705, 01faa6419b42; files: src/OpenClaw.SetupEngine/GatewayReleasePolicy.cs, src/OpenClaw.SetupEngine/GatewayLkgVersion.cs, src/OpenClaw.SetupEngine/SetupSteps.cs)
  • Ranjesh Jaganathan: History attributes the original LKG pinning and updater-validation work to this contributor. (role: original release-pin contributor; confidence: medium; commits: 45df0763e1ca, dcc77f55e2c9; files: src/OpenClaw.SetupEngine/GatewayLkgVersion.cs, .github/workflows/gateway-lkg-update.yml)
  • Barbara Kudiess: Recent setup and recovery history includes this contributor on code adjacent to the changed setup execution path. (role: recent adjacent setup contributor; confidence: medium; commits: 603886a81d34, e9d571a9b395; files: src/OpenClaw.SetupEngine/SetupSteps.cs, src/OpenClaw.SetupEngine/Program.cs)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-08-05T22:23:34.160Z sha 66cd1c8 :: found issues before merge. :: [P2] Correct the remaining LKG guidance
  • reviewed 2026-08-06T03:03:16.679Z sha 66cd1c8 :: found issues before merge. :: [P2] Correct the remaining LKG guidance
  • reviewed 2026-08-06T05:21:10.620Z sha 66cd1c8 :: found issues before merge. :: [P2] Correct the complete gateway-version contract | [P2] Do not advertise an unavailable recovery path
  • reviewed 2026-08-06T14:56:09.329Z sha 66cd1c8 :: found issues before merge. :: [P2] Correct the remaining gateway-version contract | [P2] Implement the advertised recovery path
  • reviewed 2026-08-06T23:44:11.630Z sha 9bba2f5 :: found issues before merge. :: [P1] Preserve configured official Gateway versions | [P1] Remove write-token exposure from the downloaded verifier | [P2] Capture the fallback control in its active error state

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. label Aug 6, 2026
@shanselman
shanselman force-pushed the feat/gateway-latest-fallback branch from 66cd1c8 to 9bba2f5 Compare August 6, 2026 22:58
@shanselman
shanselman changed the base branch from bkudiess-setup-engine-owners to main August 6, 2026 22:58
@shanselman shanselman changed the title refactor(setup): install latest gateway by default feat(setup): enforce validated protocol-v4 Gateway releases Aug 6, 2026
@shanselman

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. P1 Urgent regression or broken agent/channel workflow affecting real users now. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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. labels Aug 6, 2026
@shanselman
shanselman force-pushed the feat/gateway-latest-fallback branch from 9bba2f5 to 8412451 Compare August 8, 2026 04:07
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 8, 2026
@shanselman
shanselman merged commit e295df2 into main Aug 8, 2026
38 of 40 checks passed
@shanselman
shanselman deleted the feat/gateway-latest-fallback branch August 8, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants