Skip to content

refactor(plugins): deprecate synchronous keyed storage - #145158

Merged
steipete merged 1 commit into
mainfrom
codex/deprecate-sync-plugin-state
Sep 11, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/deprecate-sync-plugin-state

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Plugin authors need an explicit migration path away from synchronous keyed-state operations without losing existing host compatibility or atomic callback behavior.

Why This Change Was Made

The compatibility registry now names the existing synchronous store factory as the plugin-state-sync-keyed-store adapter, with a next-plugin-sdk-major removal gate. TypeScript annotations and migration documentation guide callers toward openKeyedStore and awaited operations. Removal still requires a supported external-plugin migration and explicit breaking-release approval.

User Impact

Existing synchronous methods remain available with their current signatures, errors and trust eligibility. No runtime warnings are added. Both APIs share the existing namespace data; no migration copy is needed. Updater and predicate callbacks remain synchronous within their transaction, and optional capabilities remain optional. Callback-free worker operations are a separate contract.

Evidence

Compiler token comparison confirms runtime code and public types are unchanged while all three deprecation annotations are recognized. Existing real SQLite, runtime trust, CJS/TypeScript loader, SDK type and compatibility tests pass, covering 86 cases with the final metadata recheck. Full changed-file checks and fresh Codex review pass.

Changed pages pass MDX checks. Both new migration links resolve; the global anchor audit's 54 unrelated failures exactly match the untouched baseline. No baseline or runtime behavior was changed to hide those failures.

@clawsweeper

clawsweeper Bot commented Sep 11, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation plugin: file-transfer size: S maintainer Maintainer-authored PR labels Sep 11, 2026
@steipete
steipete marked this pull request as ready for review September 11, 2026 18:53
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 11, 2026, 2:59 PM ET / 18:59 UTC.

ClawSweeper review

What this changes

The PR marks synchronous plugin storage as deprecated through editor annotations, compatibility metadata, migration documentation, and a registry test while preserving existing behavior.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains useful, protected work: current main lacks the explicit deprecation contract, and no blocking correctness defect was found. The existing synchronous API remains supported.

Priority: P3
Reviewed head: f5e4959b87e8b89bf834d0fa3816612093747094

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, compatible deprecation with clear migration guidance and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored change is limited to deprecation annotations, registry metadata, documentation, and an assertion; the ordinary external-contributor proof gate does not apply. Reported SQLite and loader checks are supplemental and were not rerun here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored change is limited to deprecation annotations, registry metadata, documentation, and an assertion; the ordinary external-contributor proof gate does not apply. Reported SQLite and loader checks are supplemental and were not rerun here.
Evidence reviewed 8 items Pinned introduction boundary: The complete supplied merge-base-to-head patch introduces documentation, comments, one compatibility record, and its assertion. The host-verified test merge retains the same introduced file set; unrelated endpoint drift is excluded.
Shared storage implementation: The Promise-returning store delegates to the existing synchronous implementation. Both openers retain their signatures and namespace handling; the introduced changes here are comments only.
Removal gate and migration contract: The record has next-plugin-sdk-major and no removeAfter date. The boundary report returns false for removal eligibility without removeAfter; documentation additionally requires external-plugin migration and explicit breaking-release approval.
Findings None None.
Security None None.

How this fits together

Plugin keyed storage saves plugin-scoped values in SQLite through synchronous or Promise-returning operations. The compatibility registry and SDK documentation tell plugin authors which interface to adopt and when older contracts may be removed.

flowchart TD
  A[Plugin storage request] --> B[Runtime trust check]
  B --> C[Synchronous interface]
  B --> D[Awaited interface]
  D --> C
  C --> E[Shared SQLite storage]
  F[Compatibility registry] --> G[Deprecation and migration guidance]
  G --> D
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +43, Tests +14, Docs +47. Total +104 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 4 46 3 +43
Tests 1 14 0 +14
Docs 3 50 3 +47
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 110 6 +104

Review metrics

Metric Value Why it matters
Compatibility contract 3 deprecation annotations; 0 removed methods; 0 dated removal deadlines The change communicates migration direction without forcing existing callers to change during upgrade.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/plugins/compat/registry-records.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep one storage implementation, guide plugins toward awaited operations, and retain synchronous compatibility until the documented migration and breaking-release conditions are met.

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

Not applicable: this PR formalizes a deprecation rather than repairing a reported runtime failure; source inspection confirms the existing operations remain intact.

Is this the best way to solve the issue?

Yes. The existing compatibility registry and shared storage implementation provide the narrowest path, and the migration guide preserves atomic callbacks and optional capabilities.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a non-breaking SDK deprecation and documentation improvement with no runtime behavior change.
  • 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 maintainer-authored change is limited to deprecation annotations, registry metadata, documentation, and an assertion; the ordinary external-contributor proof gate does not apply. Reported SQLite and loader checks are supplemental and were not rerun here.

Label justifications:

  • P3: This is a non-breaking SDK deprecation and documentation improvement with no runtime behavior change.
  • 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 maintainer-authored change is limited to deprecation annotations, registry metadata, documentation, and an assertion; the ordinary external-contributor proof gate does not apply. Reported SQLite and loader checks are supplemental and were not rerun here.

Evidence

What I checked:

  • Pinned introduction boundary: The complete supplied merge-base-to-head patch introduces documentation, comments, one compatibility record, and its assertion. The host-verified test merge retains the same introduced file set; unrelated endpoint drift is excluded. (f5e4959b87e8)
  • Shared storage implementation: The Promise-returning store delegates to the existing synchronous implementation. Both openers retain their signatures and namespace handling; the introduced changes here are comments only. (src/plugin-state/plugin-state-store.ts:172, f5e4959b87e8)
  • Removal gate and migration contract: The record has next-plugin-sdk-major and no removeAfter date. The boundary report returns false for removal eligibility without removeAfter; documentation additionally requires external-plugin migration and explicit breaking-release approval. (src/plugins/compat/registry-records.ts:15, f5e4959b87e8)
  • Current main still lacks this deprecation: The exact compatibility code is absent from the fetched main registry. Direct comparison of the three implementation/type files shows only the proposed comment changes. (src/plugins/compat/registry-records.ts, b7693bf50aa2)
  • Latest release comparison: The registry at supplied latest release v2026.9.4 also lacks this compatibility code; the proposed deprecation is not already recorded there. (src/plugins/compat/registry-records.ts, 3a9d69db306c)
  • Earlier unification is complementary: GitHub confirms refactor(state): unify synchronous and asynchronous plugin storage #117075 merged the shared synchronous/async implementation while preserving both APIs. That work does not supersede this deprecation and migration guidance. (35be8ae6c293)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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

Copy link
Copy Markdown
Contributor Author

The synchronous storage deprecation is approved with the documented external-plugin compatibility window. This change names the existing adapter and adds annotations, migration guidance, and compatibility inventory metadata. It does not remove methods, change trust eligibility or transactional callbacks, or add runtime warnings.

There is no SQLite schema or stored-format change to migrate. The compiler comparison confirms unchanged runtime/type tokens, and existing native SQLite plus loader/type tests cover sync/async coexistence. Removal remains gated on the next Plugin SDK major, a supported migration, and separate breaking-release approval. The generic data-model checkbox does not identify a remaining compatibility defect.

@steipete
steipete merged commit 3b03121 into main Sep 11, 2026
254 checks passed
@steipete
steipete deleted the codex/deprecate-sync-plugin-state branch September 11, 2026 19:45
@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

docs Improvements or additions to documentation maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: file-transfer 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