Skip to content

refactor(workboard): consolidate gateway and schema helpers - #128307

Merged
steipete merged 1 commit into
mainfrom
codex/land-aug23-workboard
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/land-aug23-workboard

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Workboard's card tools and Gateway handlers repeated large schema and registration blocks. That duplication made the authorization scopes, strict input contracts, dispatch order, and response behavior harder to audit and keep synchronized.

Why This Change Was Made

This maintainer-requested refactor consolidates the repeated schema and Gateway helper plumbing inside the Workboard plugin. It preserves every existing method, scope, strict schema identity, workspace boundary, redaction rule, and dispatch outcome.

AI-assisted maintainer cleanup. I reviewed the final code, proof, and exact landing diff.

User Impact

No user-visible behavior changes. Contributors get a smaller, more coherent Workboard implementation with the same security and runtime contracts.

Evidence

  • Production LOC: +582/-935 (net -353) across exactly five Workboard files.
  • Current-main base: b977ccb21e2b4b8bff05729548ea1b1558a74a33; exact head: cee5e7b0eaca8b572b52438bdec9235d3ff8243a.
  • Exact plain and binary diff SHA-256: 31e51dce4fc43356fabfab06f02223b1c3ded70174feda51e8afad0cb27f7fec.
  • Full Workboard suite: 337/337 passed; focused Gateway and tools suites: 18/18 passed.
  • Schema equivalence: all 42 unique strict TypeBox identities preserved.
  • Gateway equivalence: all 47 ordered handlers preserved with the same scopes (10 read, 37 write) and fingerprint a4bee4b97adad54fc7e55db50c6ca0aae3cce46ee73154de49024692a445b43d.
  • Independent verification found no boundary, authority, workspace, redaction, or response-shape regression.
  • Mandatory exact-source autoreview: secret scan clean; isolated Codex review reported no actionable findings (0.99 patch-correctness confidence).

@clawsweeper

clawsweeper Bot commented Aug 23, 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 23, 2026 17:53
@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 1:48 PM ET / 17:48 UTC.

ClawSweeper review

What this changes

The PR consolidates Workboard gateway response handling and strict TypeBox tool schemas into shared plugin-local helpers without changing registered methods, scopes, or tool contracts.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: this is a maintainer-authored protected draft. The review found no actionable correctness or security defect in the behavior-preserving refactor, but it needs normal exact-head review and ready-for-review state before landing.

Priority: P3
Reviewed head: cee5e7b0eaca8b572b52438bdec9235d3ff8243a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent net-negative refactor with source-backed contract and test coverage, pending normal draft and exact-head landing gates.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal refactor is exempt from the external-contributor real-behavior-proof gate.
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 internal refactor is exempt from the external-contributor real-behavior-proof gate.
Evidence reviewed 7 items Shared response owner: The new helper awaits each result handler, emits the same explicit success response, and routes thrown errors through the existing Workboard error formatter.
Gateway equivalence: The refactored registrations retain the prior read/write scope constants and preserve workspace-sensitive registrations in their specialized module.
Workspace authority remains separate: Methods that derive and enforce workspace access retain their dedicated request-level handlers rather than entering the generic result wrapper.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs extensions/workboard/src/gateway.test.ts extensions/workboard/src/tools.test.ts

Result: PASS (completed)

node scripts/run-vitest.mjs extensions/workboard/src/gateway.test.ts extensions/workboard/src/tools.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128307-yUQLA8/target$ node scripts/run-vitest.mjs extensions/workboard/src/gateway.test.ts extensions/workboard
/src/tools.test.ts
node scripts/run-vitest.mjs extensions/workboard/src/gateway.test.ts extensions/workboard/src/tools.test.ts
[test] starting test/vitest/vitest.extensions.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128307-yUQLA8/target

 ✓  extensions  extensions/workboard/src/tools.test.ts (9 tests) 72ms
 ✓  extensions  extensions/workboard/src/gateway.test.ts (9 tests) 98ms

 Test Files  2 passed (2)
      Tests  18 passed (18)
   Start at  17:49:04
   Duration  24.94s (transform 40.35s, setup 1.99s, import 46.95s, tests 170ms, environment 0ms)




































Assertions:

  • PASS expect_output: Test Files

How this fits together

The Workboard plugin registers scoped Gateway methods that turn operator requests into card and board store operations, then returns redacted results. It also exposes agent tools whose strict TypeBox schemas constrain model-supplied inputs before those same store operations.

flowchart LR
  A[Gateway request] --> B[Workboard method registration]
  B --> C[Scoped handler]
  C --> D[Workboard store]
  D --> E[Redacted gateway response]
  F[Agent tool call] --> G[Strict input schema]
  G --> D
Loading

Before merge

  • Resolve merge risk (P1) - The draft is marked behind current main; although intervening changes do not touch Workboard, landing still needs the normal exact-head CI and review refresh.
  • Complete next step (P2) - No repair task is warranted: there is no actionable patch defect, and the remaining work is normal maintainer draft/landing review.
Agent review details

Security

None.

PR surface

Source -353. Total -353 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 5 582 935 -353
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 5 582 935 -353

Review metrics

Metric Value Why it matters
Production versus tests production +582/-935 (net -353); tests +0/-0 The refactor substantially reduces production duplication without changing test surfaces or introducing new runtime dependencies.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one private result-wrapper path for ordinary Workboard Gateway methods while retaining dedicated handlers for workspace authority and dispatch behavior.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one private result-wrapper path for ordinary Workboard Gateway methods while retaining dedicated handlers for workspace authority and dispatch behavior.

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

Not applicable: this PR is a behavior-preserving refactor, and the relevant current behavior is covered by existing Gateway and tool tests.

Is this the best way to solve the issue?

Yes. A private shared wrapper removes duplicated success/error plumbing while leaving workspace-authority and dispatch handlers specialized where their request context matters.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a behavior-preserving maintainer cleanup with no reported user-facing regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This is a behavior-preserving maintainer cleanup with no reported user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current refactor and the majority of the central Workboard history, including the recent lifecycle repair. (role: long-term Workboard contributor; confidence: high; commits: cee5e7b0eaca, 549e6349f857, 0ecbbe23825a; files: extensions/workboard/src/gateway.ts, extensions/workboard/src/gateway-helpers.ts, extensions/workboard/src/tools.ts)
  • Vincent Koc: Introduced the earlier Workboard claim-token-redaction refactor that this change continues to preserve. (role: adjacent refactor contributor; confidence: medium; commits: 13126e4bd722; files: extensions/workboard/src/gateway.ts, extensions/workboard/src/tools-card-mutations.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.

@steipete

Copy link
Copy Markdown
Contributor Author

Rank-up moves addressed before landing:

  • The PR is ready for review, and exact-head CI run 32656265056 is green, including openclaw/ci-gate.
  • Independent verification, mandatory exact-source autoreview, and the repository-native review artifacts report no actionable findings.
  • Testbox-backed scripts/pr prepare-run passed on the unchanged PR head.
  • The branch is intentionally not rebased solely for behind-main drift: current main changed no Workboard path, the PR is conflict-free, and behind-main drift is advisory under the repository landing policy.

@steipete
steipete merged commit 90a9027 into main Aug 23, 2026
166 checks passed
@steipete
steipete deleted the codex/land-aug23-workboard branch August 23, 2026 18:14
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant