-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
refactor: canonicalize correctness-critical UI and channel contracts #102258
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PRmaturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PRmaturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
Summary
Canonicalize the three correctness-critical type contracts identified by the repository-wide type-surface audit: channel account status, Control UI gateway frames/payloads, and Workboard's plugin-to-UI model.
Problem to solve
OpenClaw currently maintains parallel hand-written descriptions of runtime contracts across core, gateway protocol, plugins, and Control UI:
The duplication creates correctness and credential-redaction risk, permits silent drift, and forces changes to be synchronized across multiple mutable type owners.
Proposed solution
Deliver three independently reviewable contract consolidations in dependency order:
Each PR must inspect current main first, preserve runtime behavior unless a documented drift is being corrected, stay net-negative where practical, include focused proof, and avoid compatibility aliases unless a shipped public contract is demonstrated.
Alternatives considered
common-typespackage: rejected because ownership and dependency direction differ across channel protocol, Control UI, and Workboard.Impact
Affected: channel/plugin maintainers, Control UI maintainers, Workboard maintainers, and contributors changing gateway/status contracts.
Severity: High correctness and maintainability risk; the channel status boundary also carries credential-redaction sensitivity.
Frequency: Every change to these contracts currently requires manual synchronization across owners.
Consequence: silent DTO drift, unsafe casts, inconsistent UI behavior, redundant review surface, and increased risk of credential-shaped data reaching status projections.
Evidence/examples
Audit surfaces:
src/channels/plugins/types.core.ts,src/channels/account-snapshot-fields.ts,packages/gateway-protocol/src/schema/channels.ts,ui/src/api/types.ts,ui/src/pages/channels/view.tsui/src/api/gateway.ts,ui/src/api/types.ts,packages/gateway-protocol/src/schema/frames.ts,packages/gateway-protocol/src/schema/types.tsextensions/workboard/src/types.ts,ui/src/lib/workboard/index.tsConservative expected reduction for this wave: approximately 485-535 net lines after canonical owners and necessary tests/build wiring.
Existing-solutions preflight on July 8, 2026 found no overlapping open implementation PR or issue. The repository's existing gateway protocol schema, plugin package seams, and source/build resolution mechanisms are the intended solution boundaries.
Additional information
Execution order: