Skip to content

docs(gateway): record why Control UI admission exemptions exist - #125108

Merged
steipete merged 2 commits into
mainfrom
steipete/webui-admission-exemption-context
Aug 17, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/webui-admission-exemption-context

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Follow-up to #124971 closing its review loop. ClawSweeper twice proposed making the connect-time admission check reject the exempted pairings (dev builds, configured gateway.controlUi.root, cross-origin connections), because nothing in the code recorded why those exemptions are deliberate. This chip evaluated enforcement properly; the decisive facts were owner-confirmed skips, but they lived only in PR comments — reviewer context that evaporates.

Why This Change Was Made

The evaluation result, now recorded as an invariant comment at the admission owner:

  • Configured roots serve a non-dist build by definition; strict comparison would always reject and delete the feature.
  • dev is the ui:dev sentinel — enforcement is impossible and the workflow is deliberate.
  • Cross-origin is the load-bearing case: buildId embeds the build timestamp (version-commit-builtAt, see dist/build-info.json), so two version-identical, commit-identical source-built installs carry different ids. Cross-origin equality enforcement would hard-reject matched pairings — the common self-hosted source-built topology — and the rejection's "reload this page" guidance cannot remediate a client the Gateway did not serve.

Exempted skew fails visibly at the first missing method instead (the behavior #124971 established), per the ui/AGENTS.md "Gateway Coupling" rule.

User Impact

None — comment-only. The change prevents recurring review churn proposing enforcement that the derivation facts rule out.

Evidence

Every pairing is already contract-tested: the unit table in control-ui-build-admission.test.ts covers exact-match admitted, same-origin stale rejected (with normalized-host and explicit-port variants), differing-port/configured-root/separately-hosted/dev/absent-build admitted, non-Control-UI ignored; message-handler.control-ui-build-admission.test.ts covers admission over a real WebSocket connect. No test changes needed — the chip's "focused connect-session tests for each pairing" already ship. Production LOC +8/−0, all comment lines.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 17, 2026 06:20
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Aug 17, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 2:37 AM ET / 06:37 UTC.

ClawSweeper review

What this changes

Adds an inline explanation of why Gateway build-ID admission exempts configured-root, development, and cross-origin Control UI connections.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this maintainer PR open for normal landing: the revised invariant comment accurately records the existing Control UI admission boundary and resolves the prior wording concern.

Priority: P3
Reviewed head: 1751bd7c04e2c27e257b56d2d961b7f9aa7b0434

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused comment is accurate against the current admission, build-identity, and WebSocket test contracts.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, comment-only PR changes no observable runtime behavior requiring after-fix proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, comment-only PR changes no observable runtime behavior requiring after-fix proof.
Evidence reviewed 6 items PR-head comment: The exact PR-head file contains the revised eight-line invariant comment, including the corrected configured-root rationale.
Admission owner: Current main exempts configured roots, absent Gateway identities, the dev sentinel, and non-same-origin clients; only a differing bundled same-origin build returns a mismatch.
Caller and visible outcome: The connect-session caller rejects a mismatch before RPC, while the Control UI consumes the mismatch detail by scheduling a stale-chunk reload.
Findings None None.
Security None None.

How this fits together

The Control UI sends a build identity when it opens a Gateway WebSocket session. Gateway admission rejects a stale bundled same-origin UI before it can issue RPCs, while configured-root, development, and cross-origin paths remain outside that enforcement boundary.

flowchart LR
  Browser[Control UI browser] --> Connect[Gateway WebSocket connect]
  Connect --> Admission[Build admission]
  Admission --> Scope{Bundled same-origin?}
  Scope -->|Stale build| Reject[Reject and request reload]
  Scope -->|Match or exemption| Session[RPC-capable session]
  Config[Configured root or dev/cross-origin] --> Scope
Loading

Before merge

  • Complete next step (P2) - No repair lane is needed; this is a precise, behavior-neutral documentation update awaiting ordinary maintainer landing checks.
Agent review details

Security

None.

PR surface

Source +8. Total +8 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 8 0 +8
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 8 0 +8

Review metrics

Metric Value Why it matters
Production versus test LOC production +8, tests +0 The added lines are an owner-boundary invariant comment; they introduce no executable behavior or test surface.

Technical review

Best possible solution:

Land the concise invariant comment at the admission owner so future reviews retain the established product boundary without changing runtime behavior.

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

Not applicable: the branch changes only an explanatory comment and does not alter admission behavior.

Is this the best way to solve the issue?

Yes: recording the rationale beside the admission decision is the narrowest durable solution, and current source and tests support each stated exemption.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, comment-only PR changes no observable runtime behavior requiring after-fix proof.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is low-risk maintainability documentation for an already-tested admission decision.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, comment-only PR changes no observable runtime behavior requiring after-fix proof.

Evidence

What I checked:

Likely related people:

  • Patrick Erichsen: Git blame attributes the current admission owner and its exemption conditions to this commit. (role: current admission implementation author; confidence: high; commits: 9e4ba15f4c37; files: src/gateway/server/ws-connection/control-ui-build-admission.ts)
  • steipete: The merged policy work in refactor(webui): drop gateway-version fallbacks per version-lock decision #124971 established the cited Gateway Coupling decision, and this PR records its server-side rationale. (role: merged Control UI policy contributor; confidence: high; commits: 84f342a87e0d; files: ui/AGENTS.md, src/gateway/server/ws-connection/control-ui-build-admission.ts)

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 (1 earlier review cycle)
  • reviewed 2026-08-17T06:26:05.497Z sha 7477bb3 :: needs changes before merge. :: [P2] Describe configured roots as independently built artifacts

@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the configured-root wording finding in new head 1751bd7: the invariant now says configured roots serve an independently built artifact for which the Gateway owns no matching build identity. The imprecise “non-dist by definition” premise is removed.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Acknowledged ClawSweeper’s remaining mechanical “Complete next step” item. The exact-head review has no actionable findings; proceeding with ordinary maintainer landing after green exact-head CI and the native review/prepare/merge gates.

@steipete
steipete merged commit 29b105b into main Aug 17, 2026
220 checks passed
@steipete
steipete deleted the steipete/webui-admission-exemption-context branch August 17, 2026 06:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 2026
…claw#125108)

* docs(gateway): record why Control UI admission exemptions exist

* docs(gateway): state the configured-root exemption reason precisely
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant