Skip to content

fix(workboard): isolate board deletion from unrelated subscriptions - #152102

Merged
steipete merged 1 commit into
mainfrom
codex/sqlite-workboard-board-cleanup-0918
Sep 18, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/sqlite-workboard-board-cleanup-0918

Conversation

@steipete

@steipete steipete commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Deleting an empty Workboard board unnecessarily loads subscriptions for every board and can fail when an unrelated board has a malformed subscription.

User Impact

Board deletion reads and decodes only that board's subscriptions. Unrelated malformed subscriptions no longer block deletion and remain untouched. Selected-row validation, deletion order, default/nonempty-board refusals, and existing partial-write behavior remain unchanged.

Why This Change Was Made

Pass the board ID to the existing scoped subscription reader: one production-line change plus an extension of the existing deletion test, moved intact into the existing subscription-scope suite to satisfy the file-length limit. This adds no schema, index, transaction, or retention change.

Evidence

  • Historical screen at cc4e89a3070e77d93c79ea794f4f474ce082fbc3: the board flow with 1,000 unrelated and three selected subscriptions returned/decoded 3 rows instead of 1,003. Facade JSON size fell from 213,625 to 625 bytes, with the same three ordered deletes. Subscription enumeration remains one call and one SELECT in both versions; this reduces transferred/materialized payload, not query count.
  • Those measurements came from an earlier two-call-site candidate. The measured board flow does not invoke its card-deletion change. That separate card change was rejected after its tiny-inventory control regressed and is absent here. These are historical board-path measurements, not fresh measurements of this final patch, native scan counts, wire-byte measurements, or a general latency/RSS claim.
  • Historical board controls checked complete persisted state and reopen results, selected malformed JSON refusal, unrelated malformed JSON isolation, and identical partial progress when the second selected deletion fails. Malformed raw SQLite TEXT equivalence was not established.
  • The final existing-test extension reproduces the original JSON decoding failure while deleting an empty board with an unrelated malformed subscription. The baseline exited 1 with the expected failure; its verification exited 0. The candidate must also preserve that unrelated raw row exactly.
  • Independent review found no actionable findings in the production change and extended test before its mechanical relocation. The retained relocation evidence verifies the complete test body and production bytes are unchanged; it does not claim the earlier review captured the final three-file hashes.
  • Final relocated candidate: 181 focused tests passed across the store, subscription-scope, and Gateway suites. Six Doctor guard tests also passed as part of the selected checks. The first 16 selected checks passed; extension typechecking then exceeded the local 4 GiB memory limit and the wrapper exited 143. This attempt is preserved as failed.
  • All ten remaining selected checks passed on the configured Blacksmith Testbox, lease tbx_01m2tzach3qtqk4zak2ssb230s, run 35385248781. Source and dependency pins remained unchanged; the lease stopped successfully and its controller joined with exit 0. Together with the first 16 retained checks, all 26 selected checks passed. Exact published-head CI run 35386522648 passed. The final ClawSweeper review found no actionable findings.

@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete steipete self-assigned this Sep 18, 2026
@steipete
steipete marked this pull request as ready for review September 18, 2026 19:32
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 3:39 PM ET / 19:39 UTC.

ClawSweeper review

What this changes

Board deletion reads only the selected board’s notification subscriptions, with regression coverage ensuring unrelated malformed subscriptions remain untouched.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main and the latest release still enumerate unrelated subscriptions during board deletion. No actionable correctness or security findings were found.

Priority: P2
Reviewed head: 4809ad21490f9fb01a81fc731229293fa9920ab6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow reuse of existing functionality with meaningful regression coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. The inspected SQLite regression covers the changed deletion owner; historical measurements are not treated as fresh runtime proof of this head.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. The inspected SQLite regression covers the changed deletion owner; historical measurements are not treated as fresh runtime proof of this head.
Evidence reviewed 7 items Introduced change is narrowly scoped: The pinned merge-base-to-head diff changes the existing subscription enumeration call, extends and relocates the deletion regression, and leaves guards and write ordering intact. The diff whitespace check passed.
Current main still contains the defect: The fetched main revision calls subscriptionStore.entries() without a board filter, so JSON decoding can fail on an unrelated subscription before board deletion proceeds.
Latest release also uses unscoped enumeration: The v2026.9.4 source enumerates all subscriptions during board deletion. The requested isolation is therefore not already supplied by the latest release.
Findings None None.
Security None None.

How this fits together

Workboard stores local task boards and notification subscriptions in SQLite. Gateway and agent-tool deletion requests pass through the board store, which checks deletion guards, removes matching subscriptions, and deletes board metadata.

flowchart TD
  A[Gateway or agent tool] --> B[Board deletion]
  B --> C{Non-default and empty?}
  C -->|No| D[Refuse deletion]
  C -->|Yes| E[Read selected board subscriptions]
  E --> F[Validate and delete matching subscriptions]
  F --> G[Delete board metadata]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +20. Total +20 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 2 45 25 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 46 26 +20

Review metrics

None.

Technical review

Best possible solution:

Reuse the existing scoped SQLite reader while preserving selected-row validation, deletion order, and unrelated persisted rows.

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

Yes, from source: deleting an empty non-default board currently decodes every subscription, so malformed JSON on another board throws before deletion. The added regression models this path; execution was not repeated in this read-only review.

Is this the best way to solve the issue?

Yes. Passing the normalized board ID to the existing reader fixes the failure at row selection without adding another implementation or changing stored data.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 58f54ff9a31b.

Labels

Label changes:

  • add P2: This fixes a bounded Workboard deletion failure caused by malformed subscriptions on another board.
  • 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: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. The inspected SQLite regression covers the changed deletion owner; historical measurements are not treated as fresh runtime proof of this head.

Label justifications:

  • P2: This fixes a bounded Workboard deletion failure caused by malformed subscriptions on another board.
  • 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: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. The inspected SQLite regression covers the changed deletion owner; historical measurements are not treated as fresh runtime proof of this head.

Evidence

What I checked:

  • Introduced change is narrowly scoped: The pinned merge-base-to-head diff changes the existing subscription enumeration call, extends and relocates the deletion regression, and leaves guards and write ordering intact. The diff whitespace check passed. (extensions/workboard/src/store-core.ts:397, 4809ad21490f)
  • Current main still contains the defect: The fetched main revision calls subscriptionStore.entries() without a board filter, so JSON decoding can fail on an unrelated subscription before board deletion proceeds. (extensions/workboard/src/store-core.ts:397, 58f54ff9a31b)
  • Latest release also uses unscoped enumeration: The v2026.9.4 source enumerates all subscriptions during board deletion. The requested isolation is therefore not already supplied by the latest release. (extensions/workboard/src/store-core.ts, 3a9d69db306c)
  • Existing reader preserves the storage contract: The subscription reader applies a bound board_id predicate before decoding and retains created_at/id ordering. The runtime facade and SQLite worker forward the options unchanged. Board IDs are normalized before this call; the patch introduces no schema, public API, authorization, or transaction change. (extensions/workboard/src/sqlite-store-kernel.ts:536, 4809ad21490f)
  • Regression exercises the real SQLite store boundary: The relocated test retains default-board and nonempty-board refusals, corrupts an unrelated subscription’s JSON, deletes the selected empty board, checks its subscriptions are gone, and compares the unrelated raw row before and after. Tests were inspected but not executed during this read-only review. (extensions/workboard/src/store-subscription-scope.test.ts:103, 4809ad21490f)
  • Merged reader work is adjacent, not a replacement: GitHub verifies improve(workboard): narrow notification subscription reads #147780 as merged at this commit. Its description explicitly retained unscoped deletion reads, while its patch added the scoped reader now reused here. Local history identified this commit; unavailable historical blobs prevented some deeper local comparisons, and GitHub supplied the commit patch and parent metadata. (extensions/workboard/src/store-core.ts:120, b1e0c716a70d)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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
steipete merged commit 691a442 into main Sep 18, 2026
165 of 166 checks passed
@steipete
steipete deleted the codex/sqlite-workboard-board-cleanup-0918 branch September 18, 2026 20:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 18, 2026
…/current-conversation-binding-row

* commit 'f5276e5a54c088dd23475f08479acd9738d959bd': (46 commits)
  perf(plugins): combine runtime and tool call scopes (#152101)
  test(memory): seed restart fixtures with the Gateway stopped (#152038)
  perf(gateway): avoid session list stalls on broad updates (#152074)
  fix: preserve model failure causes and worker fallback runtime (#152028)
  perf(logging): reduce Gateway hot-path info log volume (#152080)
  improve(gateway): reduce duplicate worker data fetched from SQLite (#151878)
  improve: format messages with many links faster (#152112)
  perf(cron): avoid unused SQL binding in config projections (#152029)
  fix: explain cloud worker startup failures (#152043)
  refactor(discord): share Markdown edit projection (#149214)
  refactor(media): remove unreachable geometry metadata backfills (#149272)
  chore(autoreview): sync mirror to agent-skills a7e91e1 (#152039)
  fix(ui): restore sidebar and chat test collection (#152099)
  fix(clickclack): finish SQLite cleanup between persistence tests (#152061)
  fix(workboard): isolate board deletion from unrelated subscriptions (#152102)
  refactor(agents): unify tool availability and plugin work ownership (#152073)
  fix: session group moves lag while requests are pending (#151689)
  fix(agents): preserve active cleanup during requester settlement (#151907)
  perf(sessions): keep deletion responsive under disk pressure (#152092)
  fix: preserve successful direct replies without serializing bookkeeping keys (#151870)
  ...
vincentkoc added a commit that referenced this pull request Sep 18, 2026
…pr-149282-proof-20260918

* refs/remotes/origin/main:
  fix(clickclack): finish SQLite cleanup between persistence tests (#152061)
  fix(workboard): isolate board deletion from unrelated subscriptions (#152102)
  refactor(agents): unify tool availability and plugin work ownership (#152073)
  fix: session group moves lag while requests are pending (#151689)
  fix(agents): preserve active cleanup during requester settlement (#151907)
  perf(sessions): keep deletion responsive under disk pressure (#152092)
  fix: preserve successful direct replies without serializing bookkeeping keys (#151870)
  fix(gateway): keep the previous plugin generation serving when a replacement stalls on admitted work (#151273)
  fix(agents): resume parent tasks after provider retries (#151879)
  perf(skills): silence identical collisions across workspaces (#152062)
  fix: reduce Doctor preparation time for large fleets (#151366)
  perf(ui): reuse session snapshots for roster updates (#152067)
  perf(tasks): skip SQLite admission for transient agent events (#152088)
  fix: await initial task persistence before Gateway activation (#151634)
  test: keep Vitest prototype ownership on execFile mocks (#152064)
  fix(pr): recover interrupted checkouts and isolate allocation state (#152069)
  fix(test): keep quota observer armed during Codex prewarm (#152090)
  fix(cron): keep scheduled jobs alive after their creating request ends (#152051)
  refactor(shared): reduce immutable graph traversal allocations (#152077)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. plugin: workboard rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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