Repository navigation
refactor(skills): run skill library import and mutations in workers (skilllib B) - #164262
Conversation
Bind prepared selections to current library and profile authority across admission waits, including rollback and unknown native commit outcomes. Preserve private revision disclosure and worker error identity. Native import and mutations remain for the follow-up; retain the shipped synchronous SDK readers.
Reuse the shared-state writer and skill-library selection authority for synchronous worker transactions and acknowledged publication. Preserve revision CAS, quotas, upload expiry, live ownership, immutable-file recovery, and critical-scan rejection.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 8:07 AM ET / 12:07 UTC (Revision 4). ClawSweeper reviewWhat this changesMoves Skill Library saves, imports, uploads, and mutations into database workers while preserving ownership checks, revision conflicts, and publication receipts. Merge readiness✅ Ready for maintainer review This remains useful work: current main still performs library mutations synchronously. The prior ordering finding is resolved, and no blocking introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherSkill Library stores reusable skills and their immutable revisions for authenticated users and teams. Gateway requests prepare files, submit database changes, and return receipts that determine future session selections. flowchart TD
A[Gateway library request] --> B[Capture store and live authority]
B --> C[Prepare and publish immutable files]
B --> D[Database worker]
C --> D
D --> E[Check ownership and revision]
E --> F[Commit SQLite changes]
F --> G[Publish selection invalidation and receipt]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +237, Tests +318, Docs +6, Other +20. Total +581 across 26 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep library writes under the existing shared-state worker owner, with live admission and durable receipts preserving current library semantics. Do we have a high-confidence way to reproduce the issue? Not applicable as a user-facing bug reproduction; current-main source directly establishes caller-thread SQL, and the reported native boundary measurement demonstrates the intended change. Is this the best way to solve the issue? Yes. Reusing the existing worker registry and selection-authority owner avoids a competing persistence path while retaining transaction checks and recovery semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e8df9f33024f. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…skilllib B) (openclaw#164262) * refactor(skills): move library reads and selection into workers Bind prepared selections to current library and profile authority across admission waits, including rollback and unknown native commit outcomes. Preserve private revision disclosure and worker error identity. Native import and mutations remain for the follow-up; retain the shipped synchronous SDK readers. * refactor(skills): run library imports and mutations in workers Reuse the shared-state writer and skill-library selection authority for synchronous worker transactions and acknowledged publication. Preserve revision CAS, quotas, upload expiry, live ownership, immutable-file recovery, and critical-scan rejection. * fix(test): keep skill library Gateway inventory in canonical order
What Problem This Solves
Skill library import, upload, and mutation requests still execute SQLite on the Gateway thread, including ownership, quota, and revision checks.
Why This Change Was Made
Extend the typed shared-state write registry and reuse skilllib A's captured physical store and selection-authority owner. Bundle preparation and immutable file publication precede synchronous worker transactions. Transactions reread ownership, revision CAS, quotas, and upload expiry; live host grants run at transaction and commit. Native receipts settle accepted work and publish selection invalidation inside the writer FIFO without replaying uncertain writes.
User Impact
No schema, retention, permission, RPC, or update behavior changes. The critical-scan publication rejection remains intact. Failed SQL retains immutable unreferenced revision files, matching the existing recovery contract. The released synchronous SDK metadata reader remains as deprecated-SDK migration debt; bundled mutation callers await the worker.
Built on merged #164165; this PR targets
mainafter incorporating5c5700d31f6705c08ef101171693cc555c12eceewith merge commit84984878f44a778c728a6ec051fbf14dc1b4ded5, without rebasing. The main fix moves the shared error and session-provenance modules out of the forbidden import closures; this candidate preserves those boundaries. Adjacent overlaps: #163239 proposes removing critical-scan rejection (out of scope and preserved); #161057 extracts the scanner (incidental cleanup, minimal overlapping hunks).Evidence
pnpm test <files> --maxWorkers=1:These real SQLite-worker, filesystem, concurrency, and RPC contracts require their native boundaries. Cold worker compilation and the heavily loaded host dominate the wall times. Test consumers use the existing forked database-worker lanes and join cleanup. Testbox was attempted but the final lease remained queued without a runner; no Linux result is claimed. Current-head CI completed in 8,565 aggregate job seconds (run 37120915863).
node scripts/check-changed.mjs --base 9da28ad4bd0ee3a9ba9757b9d6f444a6306ac3a0passed, including core/test typechecks, full lint, unused-export scans, and repository guards. Two inherited max-lines warnings remain in untouched main files. The original merged worktree and validation candidate have identical complete Git indexes (51,990 files).OPENCLAW_*names.fc23bc864e4553c2d215e479eeec47b67a0bf943) exports none of the moved mutation/import APIs; synchronous skill-command discovery and harness tool-surface contracts are retained.Existing authoring callbacks retain their placement/session authority owner (
src/gateway/skill-library-authoring.ts:80-93). Standalone mixed-requester/profile and workspace-authoring checks at lines 37-41 and 143 remain separate migration debt; this PR introduces no SQL in host grant callbacks.Landing validation
9da28ad4bd0ee3a9ba9757b9d6f444a6306ac3a0), singly with--maxWorkers=1. This was PR-caused. Commit43cef6a03c918fixes ordering without changing membership or assertions; both suites then passed 537 tests in 313.09 s.test/scripts/runtime-process-build-graph.test.ts,src/auto-reply/reply/get-reply.imports.test.ts, allsrc/skills/librarysuites, workspace and embedded readers, and Gateway library/remote/authoring callers. Command:node scripts/run-vitest.mjs <those files> --maxWorkers=1. The wrapper built and verified native worker artifacts.5c5700d31f670: scoped-clean. Conflict resolutions retain the worker implementation and the new shared error-class identity. No oldlibrary/errorsimports remain.84984878f44a7at 2026-10-03 11:56 UTC in run 37120979955, confirmed the prior ordering finding resolved, and reported no actionable or security findings.