Skip to content

Workspaces: add stream and computed bindings#101878

Open
100yenadmin wants to merge 2 commits into
openclaw:mainfrom
100yenadmin:feat/dashboard-binding-kinds
Open

Workspaces: add stream and computed bindings#101878
100yenadmin wants to merge 2 commits into
openclaw:mainfrom
100yenadmin:feat/dashboard-binding-kinds

Conversation

@100yenadmin

@100yenadmin 100yenadmin commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Workspaces could read one-shot RPC, file, and static values, but could not express live socket-backed values or safe client-side derivations. The original #101878 implementation was tied to the superseded Dashboard stack and left its new kinds inaccessible or ambiguous on current authoring surfaces.

Why This Change Was Made

This rebuild ports only the binding-kind delta onto the Workspaces architecture landed by #104139. It adds allowlisted stream bindings, fixed-operation computed bindings, and an explicit outputBinding so rendering never depends on object insertion order.

The server returns the binding contract consumed by the UI, while the gateway seam has a real integration test to prevent drift. CLI and agent tools can author both kinds. Stream events are limited to channels visible to read-scoped clients (presence and sessions.changed); write-scoped workspace-change broadcasts are not advertised. Computed expressions use a closed operation switch and may reference only validated non-computed, non-stream sibling inputs.

User Impact

  • Workspace widgets can update from approved live events without polling when a readable event exists.
  • Widgets can derive sums, averages, minimums, maximums, counts, last values, JSON-pointer picks, and fixed-format output without eval or arbitrary code.
  • Multiple bindings require an explicit output, and existing multi-binding documents migrate their prior first-binding choice once.
  • Poll and refetch cycles preserve current stream values instead of blanking the widget.

Evidence

  • Rebased onto upstream main at a03df5fd5898e24facd38c07d9d9e60a047f0111; the second commit is patch-equivalent and the first differs only by preserving current main's private WorkspaceBindingErrorCode while retaining the stream/computed contracts.
  • Final-head focused Vitest: 8 files / 107 tests passed across schema, data reads, CLI, tools, gateway contract, UI normalization, and workspace rendering.
  • Extension and UI typechecks, scoped formatting, scoped lint with warnings denied, and git diff --check passed.
  • Repository-wide validation remains GitHub Actions' responsibility.
  • Repository autoreview: clean, no accepted/actionable findings.
  • No GitNexus refresh or reset was performed.

Closes #101150.

@100yenadmin
100yenadmin requested a review from a team as a code owner July 7, 2026 21:01
@100yenadmin

Copy link
Copy Markdown
Contributor Author

On the dependency-guard check: stacked on the not-yet-merged Wave 1 (#101098), inheriting its single new-plugin pnpm-lock.yaml importer entry. No new dependency. Verified by the submitting orchestrator's own gate + security review: node scripts/test-projects.mjs extensions/dashboard 89 passed, vitest src/lib/dashboard 103 passed, ui:build + full type-aware oxlint clean. Security: stream is an allowlist over existing gateway broadcast events (no new socket); computed is a fixed op switch (no eval); the command: binding is deliberately deferred to its own reviewed PR.

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Jul 7, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh /allow-dependencies-change comment after the guard blocks that new head SHA.

  • Current SHA: 68d4869fc655e41183bc451748fcf4e7e75dcadd

@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 8:37 AM ET / 12:37 UTC.

Summary
Adds allowlisted live-event and fixed-operation computed bindings to Workspaces, explicit widget output selection, persisted-document migration, authoring support, UI resolution, tests, and documentation.

PR surface: Source +662, Tests +515, Docs +24. Total +1201 across 19 files.

Reproducibility: not applicable. This PR adds new Workspaces capabilities rather than fixing a reproducible current-main bug. Source and tests establish the proposed behavior, but not an existing failure.

Review metrics: 2 noteworthy metrics.

  • Binding contract surface: 2 binding kinds added, 1 output selector added. These become authoring, persistence, gateway, and UI contracts rather than an isolated rendering change.
  • Persisted migration paths: 1 on-load document rewrite added. Existing multi-binding workspace documents can be modified during ordinary runtime loading, requiring explicit upgrade proof and ownership.

Stored data model
Persistent data-model change detected: database schema: ui/src/pages/plugin/workspace-view.test.ts, serialized state: extensions/workspaces/src/store.ts, unknown-data-model-change: extensions/workspaces/src/schema.test.ts, unknown-data-model-change: extensions/workspaces/src/schema.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #101150
Summary: This PR is a candidate partial implementation of the canonical binding-kinds issue, covering stream and computed bindings while deliberately leaving command bindings unresolved.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add a redacted recording or screenshots with diagnostic/live output showing stream updates and computed rendering in a real Control UI session.
  • Show an existing SQLite workspace with multiple bindings upgrading, reloading, undoing, and rendering without data or output-selection drift.
  • Obtain Workspaces-owner approval for the event allowlist, migration ownership, and narrower canonical-issue scope.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR provides tests and CI but no inspectable after-fix Workspaces recording/live output or existing-SQLite upgrade proof; add redacted UI evidence and an upgrade transcript, update the PR body to trigger review, or ask a maintainer for @clawsweeper re-review.

Risk before merge

  • [P1] The on-load migration rewrites existing workspace documents and changes multi-binding interpretation; tests do not demonstrate a real existing-SQLite upgrade, undo, reload, and subsequent render cycle.
  • [P1] Allowing declarative widgets to consume gateway broadcasts expands the data-flow boundary into trusted UI and potentially approved custom-widget rendering, so the exact event allowlist needs explicit owner acceptance.
  • [P1] Closing Dashboard: new data-binding kinds — stream, command, computed #101150 with this PR would hide the still-unimplemented command-binding portion of that request.
  • [P1] The branch is behind current main, so its exact-head review and proof should be refreshed after rebasing even though the supplied state reports it as mergeable.

Maintainer options:

  1. Narrow, approve, and prove (recommended)
    Retain stream/computed support, correct the canonical-issue closure scope, settle the migration owner, and add real Control UI and existing-database upgrade evidence before merge.
  2. Accept the runtime migration
    A Workspaces owner may explicitly accept on-load document rewriting and the event allowlist after reviewing the upgrade and data-exposure consequences.
  3. Defer the binding expansion
    Pause or close the PR if the permanent binding API and event-exposure contract are not currently sponsored.

Next step before merge

  • [P1] The contributor should add real UI and upgrade proof, then the Workspaces owner must decide the event-exposure, migration, and partial canonical-issue contracts; no narrow autonomous code repair is currently established.

Maintainer decision needed

  • Question: Should Workspaces permanently expose allowlisted gateway events and client-side computed operations as a persisted binding contract, while leaving command bindings for separate review?
  • Rationale: The choice expands a plugin API and browser data-flow boundary, changes persisted workspace interpretation, and only partially fulfills the canonical issue; tests cannot determine whether that permanent product and upgrade contract is desired.
  • Likely owner: steipete — The current Workspaces architecture and its persistence, gateway, and UI boundaries originate from the merged integration work associated with this owner.
  • Options:
    • Sponsor the narrow contract (recommended): Approve stream and computed bindings only, keep command bindings separately tracked, require an owner-approved migration shape, and obtain real UI and upgrade proof before merge.
    • Complete the canonical scope: Hold this PR until command bindings have an explicitly approved security model and the complete canonical request can be reviewed together.
    • Pause the feature: Close or defer this PR and keep the canonical issue open until Workspaces binding extensibility becomes a confirmed roadmap priority.

Security
Cleared: No concrete exploit or supply-chain regression is evident: streams use a closed read-event allowlist, computed operations avoid arbitrary evaluation, and the diff adds no dependency or executable download path.

Review details

Best possible solution:

Keep the capability plugin-owned and narrowly allowlisted, preserve the broader command-binding issue or split it into a dedicated follow-up, use an owner-approved migration path, and land only after real Control UI plus existing-SQLite upgrade proof.

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

Not applicable: this PR adds new Workspaces capabilities rather than fixing a reproducible current-main bug. Source and tests establish the proposed behavior, but not an existing failure.

Is this the best way to solve the issue?

Unclear: the closed operation set, event allowlist, and explicit output selection are maintainable choices, but runtime migration ownership and closure of the broader command-binding issue need resolution before this is the best final shape.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a substantial optional Workspaces improvement with bounded plugin and Control UI impact, not an urgent regression.
  • merge-risk: 🚨 compatibility: The PR changes persisted multi-binding interpretation and rewrites existing workspace documents during load.
  • merge-risk: 🚨 security-boundary: The PR makes selected gateway event payloads available through a new declarative widget data path that needs owner approval beyond green CI.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides tests and CI but no inspectable after-fix Workspaces recording/live output or existing-SQLite upgrade proof; add redacted UI evidence and an upgrade transcript, update the PR body to trigger review, or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +662, Tests +515, Docs +24. Total +1201 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 10 691 29 +662
Tests 8 525 10 +515
Docs 1 29 5 +24
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 1245 44 +1201

What I checked:

  • Current-main gap: Current main contains the Workspaces foundation from the merged integration PR, while the stream/computed binding additions remain unique to this open branch. (extensions/workspaces/src/schema.ts:23, 68d4869fc655)
  • Binding security boundary: The branch restricts stream inputs to presence and sessions.changed and restricts computed bindings to eight fixed operations rather than arbitrary expressions. (extensions/workspaces/src/binding-contract.ts:25, 68d4869fc655)
  • Persisted upgrade path: Workspace loading rewrites existing SQLite documents through migrateWorkspaceDoc when the new explicit output binding is needed, making upgrade behavior merge-critical. (extensions/workspaces/src/store.ts:155, 68d4869fc655)
  • Cross-surface implementation: The branch exposes the new kinds through CLI and agent-tool schemas and consumes the server-advertised binding contract in Control UI. (extensions/workspaces/src/tools.ts:107, 68d4869fc655)
  • UI lifecycle coverage: The UI adds computed resolution, event subscriptions, retained stream values, and subscription teardown, with focused unit and rendering tests in adjacent files. (ui/src/pages/plugin/workspace-view.ts:94, 68d4869fc655)
  • Validation evidence: The PR reports 107 focused tests plus type, lint, format, and integration-seam checks, and the latest supplied check context shows broad CI success; these remain supplemental rather than real runtime proof. (68d4869fc655)

Likely related people:

  • steipete: Authored and merged the current Workspaces architecture that owns the plugin schema, SQLite store, gateway surface, and Control UI integration extended by this PR. (role: introduced current Workspaces implementation; confidence: high; commits: 0af846713749; files: extensions/workspaces/src/schema.ts, extensions/workspaces/src/store.ts, extensions/workspaces/src/gateway.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (15 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-08T00:00:55.973Z sha 1717e4a :: needs real behavior proof before merge. :: [P2] Expose stream and computed bindings in tool schemas | [P2] Select an explicit widget output binding | [P2] Move dashboard workspace state into approved storage | [P3] Add dashboard paths to the web UI labeler
  • reviewed 2026-07-08T04:32:37.281Z sha 1717e4a :: needs real behavior proof before merge. :: [P2] Expose stream and computed bindings in tool schemas | [P2] Select an explicit widget output binding | [P2] Move dashboard workspace state into approved storage | [P3] Add the dashboard surface to the labeler
  • reviewed 2026-07-09T23:33:35.925Z sha 4ffd0d7 :: needs real behavior proof before merge. :: [P2] Expose stream and computed bindings in tool schemas | [P2] Select an explicit widget output binding | [P2] Move dashboard workspace state into approved storage | [P3] Add dashboard paths to the labeler
  • reviewed 2026-07-10T08:48:22.128Z sha a2b18b4 :: needs real behavior proof before merge. :: [P2] Expose stream and computed bindings in tool schemas | [P2] Select an explicit widget output binding | [P2] Move dashboard workspace state into approved storage | [P3] Add dashboard paths to the web UI labeler
  • reviewed 2026-07-12T20:36:35.543Z sha d0c0f3c :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-13T02:24:17.446Z sha 37010f4 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-13T07:22:32.235Z sha d3e2554 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-13T09:49:40.333Z sha 46a23f9 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 7, 2026
@100yenadmin
100yenadmin force-pushed the feat/dashboard-binding-kinds branch from a2b18b4 to d0c0f3c Compare July 12, 2026 20:29
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label Jul 12, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation dependencies-changed PR changes dependency-related files plugin: workspaces Agent-composable Workspaces plugin labels Jul 12, 2026
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label Jul 12, 2026
@100yenadmin 100yenadmin changed the title Dashboard: stream + computed data-binding kinds Workspaces: add stream and computed bindings Jul 12, 2026
@100yenadmin
100yenadmin force-pushed the feat/dashboard-binding-kinds branch from d0c0f3c to 37010f4 Compare July 13, 2026 02:14
@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 Jul 13, 2026
@100yenadmin
100yenadmin force-pushed the feat/dashboard-binding-kinds branch 2 times, most recently from d3e2554 to 46a23f9 Compare July 13, 2026 09:04
@100yenadmin
100yenadmin force-pushed the feat/dashboard-binding-kinds branch from 46a23f9 to a07c779 Compare July 13, 2026 11:27
@100yenadmin
100yenadmin force-pushed the feat/dashboard-binding-kinds branch from a07c779 to 68d4869 Compare July 13, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. plugin: workspaces Agent-composable Workspaces plugin rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL 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.

Dashboard: new data-binding kinds — stream, command, computed

1 participant