You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4bd8859
Browse filesBrowse the repository at this point in the historyBrowse files
fix(skills): record skill usage again and retire dead curator tables (#129769)
* fix(scripts): see SAFETY comments after template substitutions
The assertion ratchet scanned each file with a raw ts.createScanner, which
reads the `}` closing a template-literal substitution as a block close. The
scanner desynced there, so every `// SAFETY:` comment after a file's first
`${...}` was invisible and its annotated assertions were counted as bare.
Track substitution brace depth and rescan the closing brace the way the parser
does. The fix uncovers already-annotated assertions in eight files, so the
baseline shrinks accordingly.
* fix(skills): record skill usage again and retire dead curator tables
Skill lifecycle curation shipped in 2026.7.1 with two producers: a trusted
`skill.used` consumer writing `skill_usage`, and a daily sweep aging skills
into `skill_lifecycle`. The weekly collection review (#121653) replaced that
policy and deleted both producers, but left every reader in place. Since then
`skill_usage` has had no writer, so curator status reported `lastUsedAtMs:
null` and `useCount: 0` forever, and `skill_lifecycle` had no writer either, so
pin/unpin/restore either threw "not found" on fresh installs or, worse,
"succeeded" on upgraded ones while gating nothing at all.
`skill_workshop_proposal_origin_runs` was never read in any revision; proposal
provenance is authoritative in `record_json`.
Restore the usage producer at its owner and retire what has no owner:
- `skill.used` events populate `skill_usage` again, registered with the
collection-review maintenance it belongs beside. Curator status derives
curated skills from applied Workshop create proposals and reports real usage.
- Weekly review receives bounded `useCount` / `lastUsedDaysAgo` evidence, with
prompt text stating usage supports keeping a procedure and never alone
justifies a drop.
- State schema 10 drops `skill_lifecycle` and
`skill_workshop_proposal_origin_runs`. Previously archived skills return to
the active collection, where review judges them by content; the migration
logs how many. Reconcile now clears usage only for skills it actually drops.
- `skills.curator.pin`/`unpin`/`restore` stay registered for existing clients
but fail with an explicit retirement message instead of silently doing
nothing.
Retirement code moves to openclaw-state-db-table-retirements.ts to keep the
schema-repair module under max-lines; that split is a pure relocation.
Production delta is +23 raw: about -46 for the change itself, +44 for the file
split, +25 for the ratchet fix in the previous commit.
Copy file name to clipboardExpand all lines: docs/cli/skills.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,7 +151,8 @@ Notes:
151
151
|`curator --json`| Accepted before or after a Curator leaf command, for example `curator --json status` or `curator status --json`. |
152
152
|`list`| Default action when no subcommand is provided. |
153
153
|`list`/`info`/`check` output | Rendered output goes to stdout. With `--json`, the machine-readable payload stays on stdout for pipes and scripts. |
154
-
|`curator status --json`| Returns legacy age-based lifecycle state written by older releases. Weekly collection review does not use this state. |
154
+
|`curator status --json`| Reports live Workshop skill usage recorded from trusted `skill.used` events and the latest collection and experience review outcomes per workspace. |
155
+
|`curator pin`/`unpin`/`restore`| Retired commands remain registered but return an error explaining that weekly collection review manages the skill collection. |
155
156
156
157
Community ClawHub skill installs and updates check trust before downloading.
157
158
Versioned community archive releases use exact-release trust metadata.
Schema 11 removes the `skill_lifecycle` and `skill_workshop_proposal_origin_runs` tables. Archived-skill lifecycle state is discarded during the upgrade: previously archived Workshop skills return to the active collection, where weekly collection review judges them by content. The origin-run rows were a never-read projection; canonical proposal provenance stays in `skill_workshop_proposals.record_json`. Recorded skill usage and collection-review state are preserved.
130
135
131
136
### State schema 9
132
137
@@ -183,6 +188,60 @@ The general procedure is:
183
188
3. Set `PRAGMA user_version` and `schema_meta.schema_version` to the target version.
184
189
4. Run the target release's full database verification before starting the Gateway.
185
190
191
+
### Example: state schema 11 to 10
192
+
193
+
Schema 11 removed the retired skill lifecycle table and the never-read proposal
194
+
origin-run projection. A schema 10 build still requires both canonical tables, so
195
+
a manual downgrade must recreate their exact empty schemas and lifecycle indexes
196
+
before lowering the version.
197
+
198
+
Run equivalent SQL against the global state database after inspecting the exact
199
+
schema that wrote it:
200
+
201
+
```sql
202
+
BEGIN IMMEDIATE;
203
+
204
+
CREATETABLEskill_lifecycle (
205
+
skill_file TEXTNOT NULLPRIMARY KEY,
206
+
skill_key TEXTNOT NULL,
207
+
skill_name TEXTNOT NULL,
208
+
state TEXTNOT NULLCHECK (state IN ('active', 'stale', 'archived')),
FOREIGN KEY (proposal_id) REFERENCES skill_workshop_proposals(proposal_id) ON DELETE CASCADE
228
+
) STRICT;
229
+
230
+
PRAGMA user_version =10;
231
+
UPDATE schema_meta
232
+
SET schema_version =10,
233
+
updated_at = unixepoch('now') *1000
234
+
WHERE meta_key ='primary';
235
+
236
+
COMMIT;
237
+
```
238
+
239
+
Both recreated tables start empty. The upgrade discarded archived-skill
240
+
lifecycle state, so those skills returned to the active collection and a manual
241
+
downgrade cannot recover their previous archived state. Proposal origin-run
242
+
rows were never read; authoritative provenance remains in each proposal's
243
+
`record_json`. A botched downgrade means restore from the verified backup.
244
+
186
245
### Example: state schema 10 to 9
187
246
188
247
Schema 10 removed six dead shared-state tables. A schema 9 build still requires those canonical tables and indexes, so a manual downgrade must recreate their exact empty schemas before lowering the version.
0 commit comments