Skip to content

feat(skills): review background learning as drafts with Skill Workshop propose mode - #181747

Merged
obviyus merged 22 commits into
mainfrom
feat/skill-workshop-draft-mode
Oct 27, 2026
Merged

obviyus merged 22 commits into
mainfrom
feat/skill-workshop-draft-mode

Conversation

@obviyus

@obviyus obviyus commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #161057 (comment) (feedback from @nikosml and @diskawrs in #181747 (comment) and #181747 (comment))

What Problem This Solves

Since #161057, background learning either changes skills on its own (auto) or does nothing (off). Users who reviewed proposals before they applied lost that workflow, and Doctor silently switched their propose config to off.

User Impact

User impact: set skills.workshop.autonomous.mode to "propose" (or pick Propose in the Control UI) and background reviews save drafts instead of changing skills. Review them either way:

  • Control UI: a Drafts list on the Skill workshop page. An update to a live skill opens as a diff against it; a new skill opens as its instructions, with its support files. Apply saves the draft through the normal versioned write (Undo works); Discard deletes it.
  • Chat: /learn drafts has the agent judge the waiting drafts together, propose what to keep, and ask before saving. Undecided drafts stay for later. /learn drafts <skill> [focus] reviews only that skill's drafts; the command picks them, not the model.

Upgrades:

  • Configs that still say mode: "propose" keep working; Doctor no longer rewrites them to "off". Legacy autonomous.enabled: true now maps to "propose".
  • Proposals Doctor already exported to workshop-skills/.archive/.retired-proposals/ move into workshop-skills/.drafts/ on the next Doctor run; new exports go straight there.
  • Users already migrated to "off" must opt in again; Doctor cannot tell them apart from users who chose "off".

Why This Change Was Made

  • Storage stays one plain folder. A draft is .drafts/<id>/SKILL.md (plus support files and an optional .reason), the same shape Doctor already exported. No SQLite table, status, approval record or rollback. Saving or discarding a draft writes no change row. Applying one is a single locked, versioned Workshop mutation: every file is validated (including the security scan) first, then the whole next skill is built in a staging copy and swapped in by rename through publishSkillBundle, the same publish path restore now uses. A refused file or failed write leaves the live skill untouched; one change row and one snapshot mean one Undo restores the skill as it was before the draft.
  • One owner. src/skills/workshop/drafts.ts lists, saves, views, applies and discards drafts. The agent tool, the Gateway methods, /learn drafts, the CLI list and Doctor all go through it.
  • Background review: in propose mode the skill_workshop tool refuses a review's live writes and accepts action=draft. Reviews cannot discard drafts. At most 50 drafts wait per agent; past that, reviews save nothing new.
  • /learn drafts: the command lists drafts itself and passes the selected ids to the turn, so a weaker model reasons only over the chosen skill. With no matching drafts it answers without a model turn.

Protocol changes (additive, approved by @obviyus):

  • skills.workshop.list result: mode gains "propose"; new optional drafts: [{ id, skillName, summary, createdAtMs }] (absent from older Gateways, which the UI treats as none).
  • skills.workshop.read params: optional draftId.
  • New methods skills.workshop.applyDraft / skills.workshop.discardDraft (operator.admin, since 2026.10). They take the skills.workshop.read params with draftId required, so no new params schema or validator is added. Apply also refuses when name is not the draft's skill, so you can only apply the draft you reviewed. Both answer SkillsWorkshopChangesResult. The UI offers them only when the Gateway advertises them.
  • No native app consumes these; Swift/Kotlin protocol checks pass unchanged.

Update behavior: Doctor's existing Skill Workshop final step also renames earlier exports (written by 2026.10.5–2026.10.7) into .drafts/. It never overwrites an existing draft: it keeps that export and records a recoverable warning, which does not block table retirement. It is skipped in update rehearsals, and nothing is deleted.

Evidence

  • UI before/after (mock Control UI, synthetic data): feat(skills): review background learning as drafts with Skill Workshop propose mode #181747 (comment) (Drafts list, update diff, new-skill draft, applied with Undo) and the mode switch in feat(skills): review background learning as drafts with Skill Workshop propose mode #181747 (comment).
  • src/skills/workshop/drafts.test.ts (real filesystem): applying over a live skill is one write_file change that restore undoes; a multi-file draft is one change and one undo removes its support file and restores the instructions; a draft with a rejected support file changes nothing and stays in the inbox; a new-skill draft is one create; a draft identical to the live skill changes nothing and still leaves the inbox. A draft whose second file cannot be written leaves the live skill whole and records no change. A binary support asset (assets/logo.png) publishes byte for byte. The multi-file, rejected-file and failed-write cases fail on the previous per-file apply.
  • src/agents/tools/skill-workshop-tool.test.ts: in propose mode a review's patch is refused, draft saves, the live skill and change feed stay unchanged, the review cannot discard; a foreground run aborted after its draft or discard call has started (authority captured, still preparing) writes no draft and deletes nothing (the discard case fails without the final-effect authority check).
  • src/auto-reply/reply/commands-learn.test.ts: no drafts → reply without a model turn; /learn drafts deploy … selects only deploy drafts and keeps the focus; other text keeps all drafts; the prompt says not to save before the user answers.
  • ui/src/pages/skill-workshop/skill-workshop-page.test.tsx: an agent with no skills sees only its drafts on the Drafts tab; discarding the last draft outside Propose mode keeps the Drafts list open; the Drafts list opens a draft as a diff against the live skill, Apply calls skills.workshop.applyDraft and follows the skill to Active; the mode switch writes "propose".
  • src/gateway/server-methods/skills-workshop.test.ts: applyDraft and discardDraft refuse a requester whose authority is gone, and the draft stays on disk. Both methods are operator.admin in the method descriptors, so operator.read callers are refused by the shared scope gate.
  • packages/gateway-protocol/src/index.test.ts: read params accept an optional draftId and reject an empty one; src/skills/workshop/drafts.test.ts refuses applying a draft under another skill's name.
  • src/commands/doctor-skill-workshop-retire-proposals.test.ts, legacy-config-migrations.runtime.skills.test.ts, experience-review-scheduler.test.ts, src/gateway/server-methods/skills-workshop.test.ts: export/move into .drafts/, config mapping, reviews still queue in propose, list includes drafts.
  • Local: the focused suites above pass; tsgo:core, tsgo:ui and tsgo:scripts pass; changed-file oxlint, protocol-registry:check, the protocol since guard, native protocol checks and ui:i18n:verify pass. Other UI locales get the new strings from the post-merge locale refresh.
  • Real Gateway + upgrade proof: feat(skills): review background learning as drafts with Skill Workshop propose mode #181747 (comment). A real background review (Claude Sonnet 5.5, propose mode) saved a draft and changed no skill. Apply and Undo worked through the real Control UI. Rotating the Gateway token during an apply refused it (Gateway requester authority changed): no live skill, draft kept, no change row. An operator.read client is refused both draft methods. 2026.10.4 → candidate and 2026.10.4 → 2026.10.7 → candidate upgrades keep every pending/quarantined proposal as a draft.
  • Hosted CI is green on the merged head.
Simplify pass
  • Generated churn removed: a dedicated draft-params schema made the gateway validator generator renumber about 6,000 check_N functions in predicates.js. The draft methods now reuse the read params, and the generated diff is 6 lines.
  • Removed: the draft params schema, its validator and protocol test; the "+N more files" cap (draft files use the same Files-tab layout as live skills, which has no cap); separate apply/discard access flags (one canReviewDrafts).
  • Kept on purpose: the .drafts/ folder as the only draft storage; the staged-swap publish shared with restore; the Doctor move of 2026.10.5–10.7 exports; the 50-draft cap.
  • Whole-change delta vs main: production +1055/-186, tests +427/-33, docs +114/-62, mock UI +119/-4, generated +6/-4.

@clawsweeper

clawsweeper Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts commands Command implementations agents Agent runtime and tooling size: L labels Oct 23, 2026
@obviyus

obviyus commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

UI before/after (mock Control UI, synthetic data). Before (main): Off / Auto. After: Off / Propose / Auto, with Propose selected from config skills.workshop.autonomous.mode: "propose".

Before: Skill Workshop learning switch with Off and Auto

After: learning switch with Off, Propose and Auto; Propose selected

@obviyus

obviyus commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Adds Propose mode with reviewable skill drafts, Control UI Apply and Discard actions, chat review, and recovery of earlier proposal exports.

Example: A background review proposes changing deploy from “make deploy” to “make ship”.

  • Before: Auto applies the change immediately; Off saves no proposal.
  • After: Propose saves a draft for review, and Apply publishes one versioned change that Undo can restore.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Approved user value, shipped-entry-point proof, preserved upgrade state, and no open correctness or security finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied isolated Gateway evidence exercises background draft creation, Control UI Apply and Undo, an allowed admin operation, operator.read rejection, and token revocation before publication; source comparison supports reusing that proof for the reviewed head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Users who want to review background learning must currently choose between immediate automatic changes and saving no suggestions.
Reason: The maintainer author approved this direction after concrete user feedback, and the implementation restores review while preserving the simplified write owner.

Merge readiness

✅ Ready for maintainer review

This PR restores a useful, maintainer-approved review workflow that current main lacks; no actionable introduced defect remains in the reviewed diff.

Priority: P2
Reviewed head: eb416893630a21c679763726422467eeecee2e3a

Before merge

None.

Findings

None.

Agent review details

How this fits together

Skill Workshop turns conversation experience into agent-local skill instructions; this change stages background suggestions for review before the existing versioned library publishes them.

flowchart TD
  A[Conversation experience] --> B[Background review]
  B --> C[Agent draft inbox]
  D[Doctor proposal recovery] --> C
  C --> E[Control UI or chat review]
  E --> F[Versioned skill library]
  F --> G[Skill discovery and Undo]
Loading

Technical review

Best possible solution:

Land the approved draft workflow with the existing versioning, Undo, authorization, and Doctor recovery owners.

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

Current main accepts only Off and Auto, confirming that background learning cannot currently stage reviewable drafts.

Is this the best way to solve the issue?

The implementation uses one draft owner and the existing versioned publication path, restoring review without rebuilding the retired proposal database and approval machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +871, Tests +395, Docs +52, Generated 0, Other +116. Total +1434 across 56 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 32 1059 188 +871
Tests 11 427 32 +395
Docs 8 114 62 +52
Config 0 0 0 0
Generated 1 2 2 0
Other 4 121 5 +116
Total 56 1723 289 +1434

Review metrics

Metric Value Why it matters
Learning modes One additional mode; default remains Auto Propose restores optional review without silently changing existing explicit Off or Auto settings.
Gateway mutations Two additive operator.admin methods Apply and Discard reuse existing read parameters and mutation authority.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Restores a requested review workflow with limited scope and demonstrated user value.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-25T18:33:17.503Z sha b595afc :: needs real behavior proof before merge. :: [P2] Preserve the existing skill when a later draft write fails
  • reviewed 2026-10-25T18:47:03.854Z sha ddbf549 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-25T19:41:12.428Z sha eafce88 :: needs real behavior proof before merge. :: [P3] Keep the selected Drafts filter visible when its last draft is removed
  • reviewed 2026-10-25T19:56:29.546Z sha 94ec602 :: needs changes before merge. :: [P2] Preserve binary draft files when applying the bundle
  • reviewed 2026-10-25T20:08:26.423Z sha 2aada2d :: needs changes before merge. :: none
  • reviewed 2026-10-25T20:19:41.642Z sha 1dc30b8 :: needs changes before merge. :: [P3] Preserve the Drafts list when the Workshop becomes empty
  • reviewed 2026-10-25T20:29:20.802Z sha 43fb1a2 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-26T05:27:30.750Z sha 458f998 :: needs maintainer review before merge. :: none

Reviewed October 26, 2026, 9:02 PM ET / October 27, 2026, 01:02 UTC (Revision 12).

@obviyus

obviyus commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 23, 2026
@diskawrs

Copy link
Copy Markdown

@obviyus @nikosml answering the questions from #161057 here.

Thank you @obviyus, both for the quick turnaround and for asking for our input before taking it further. That's very much appreciated. Doctor leaving propose alone and the old queue coming back as drafts already fixes the part that hurt most.

To your questions, and please correct me if I've misread the draft:

For me, the nicest part of the old propose was seeing each proposal and applying or rejecting it myself. We already do a fair bit of learning by hand in chat, so if drafts only live in a folder, I'm not sure I'd get much more out of it than from off. If drafts could show in the Control UI with Apply / Reject, even a plain list, that would bring back the bit I miss. I may well be missing something in how /learn drafts is meant to be used, though.
Per-agent would be enough for my setup.
In the end it's your call, and I'll happily work with whatever you decide. It's not a dealbreaker either way. I saw the review asks for real behaviour proof. If it helps, I can run the draft on my setup (five agents on propose) and report back.

@nikosml

nikosml commented Oct 23, 2026 •

Copy link
Copy Markdown

Thank you for picking up on this, much appreciated!

Re:

/learn drafts reviews all waiting drafts together in one session. The agent compares them with the live skills, keeps only what holds up across tasks (merging related drafts), saves those through the normal versioned and undoable write, and discards the rest. You can also steer it, e.g. /learn drafts; only keep the deploy one.

Maybe I m too conservative but I 'd still like to review the proposal for a draft. Don't feel strongly about it and with the undo functionality I could always tell my agent to review the change afterward. Since I initiated the /learn session I m there anyway. On the other hand. I m there to approve it if needed. And if it stays as draft I could leave it there to be considered for the next /learn session. Just some thoughts.

I like the ability to streer the /learn command!

Another thing I was doing when I was "manually" reviewing drafts was to group them per skill. If I read the proposal well it works on all waiting drafts. Especially for people on not best models this may yield suboptimal results. So at least an optional option like /learn -s some_skill_name steer_text where the harness would programmatically filter suggestions only for some_skill_name and the model would need to reason only for them, would be appreciated.

@obviyus

obviyus commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 27, 2026
@obviyus
obviyus merged commit b073ac5 into main Oct 27, 2026
168 checks passed
@obviyus
obviyus deleted the feat/skill-workshop-draft-mode branch October 27, 2026 01:05
@obviyus

obviyus commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in b073ac5.

Propose mode is back: background reviews save drafts in workshop-skills/.drafts/ instead of changing live skills. You can review drafts in the Control UI (diff, Apply, Discard; Apply is undoable) or in chat with /learn drafts [skill] [focus], which asks before it saves. Doctor no longer turns propose into off, and proposals it already exported move into .drafts/.

Proof: real Gateway run (draft saved, Apply/Undo in the Control UI, authority revoked mid-apply refused, operator.read refused), upgrade cells from 2026.10.4 and 2026.10.7 keep every old proposal as a draft, and CI is green on the exact head.

Thank you @diskawrs and @nikosml for the feedback that shaped this. Not in this PR: a per-agent mode (the mode is still global), and counting skill use from Claude CLI's native Skill tool. That second one is next on my list. @diskawrs, your offer to try it on your five-agent setup is very welcome once it ships.

steipete added a commit that referenced this pull request Oct 27, 2026
Regenerate the Control UI locale catalogs and metadata with ui:i18n:sync
so build-artifacts no longer fails its catalog fallback baseline check.
Keep all 21 locales at zero fallback keys and preserve existing translations.

The drift follows English copy in #181747 (Workshop drafts and its config
hint), #185263 (OAuth expiry), and #185292 (Side chat selections).
Locale refresh run 40433199860 generated the updates but deferred publishing
because generator inputs changed on main during publication.

Validation: ui:i18n:check reproduced the baseline failure before generation
and passed afterward; tsgo:ui passed; independent autoreview found no
P0-P2 issues. Generated locale artifacts only: 694 additions, 211 removals.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
…p propose mode (openclaw#181747)

Related: openclaw#161057 (comment) (feedback from @nikosml and @diskawrs in openclaw#181747 (comment) and openclaw#181747 (comment))

## What Problem This Solves

Since openclaw#161057, background learning either changes skills on its own (`auto`) or does nothing (`off`). Users who reviewed proposals before they applied lost that workflow, and Doctor silently switched their `propose` config to `off`.

## User Impact

User impact: set `skills.workshop.autonomous.mode` to `"propose"` (or pick **Propose** in the Control UI) and background reviews save drafts instead of changing skills. Review them either way:

- **Control UI:** a **Drafts** list on the Skill workshop page. An update to a live skill opens as a diff against it; a new skill opens as its instructions, with its support files. **Apply** saves the draft through the normal versioned write (Undo works); **Discard** deletes it.
- **Chat:** `/learn drafts` has the agent judge the waiting drafts together, propose what to keep, and **ask before saving**. Undecided drafts stay for later. `/learn drafts <skill> [focus]` reviews only that skill's drafts; the command picks them, not the model.

Upgrades:

- Configs that still say `mode: "propose"` keep working; Doctor no longer rewrites them to `"off"`. Legacy `autonomous.enabled: true` now maps to `"propose"`.
- Proposals Doctor already exported to `workshop-skills/.archive/.retired-proposals/` move into `workshop-skills/.drafts/` on the next Doctor run; new exports go straight there.
- Users already migrated to `"off"` must opt in again; Doctor cannot tell them apart from users who chose `"off"`.

## Why This Change Was Made

- **Storage stays one plain folder.** A draft is `.drafts/<id>/SKILL.md` (plus support files and an optional `.reason`), the same shape Doctor already exported. No SQLite table, status, approval record or rollback. Saving or discarding a draft writes no change row. Applying one is a single locked, versioned Workshop mutation: every file is validated (including the security scan) first, then the whole next skill is built in a staging copy and swapped in by rename through `publishSkillBundle`, the same publish path `restore` now uses. A refused file or failed write leaves the live skill untouched; one change row and one snapshot mean one Undo restores the skill as it was before the draft.
- **One owner.** `src/skills/workshop/drafts.ts` lists, saves, views, applies and discards drafts. The agent tool, the Gateway methods, `/learn drafts`, the CLI list and Doctor all go through it.
- **Background review:** in `propose` mode the `skill_workshop` tool refuses a review's live writes and accepts `action=draft`. Reviews cannot discard drafts. At most 50 drafts wait per agent; past that, reviews save nothing new.
- **`/learn drafts`:** the command lists drafts itself and passes the selected ids to the turn, so a weaker model reasons only over the chosen skill. With no matching drafts it answers without a model turn.

**Protocol changes (additive, approved by @obviyus):**

- `skills.workshop.list` result: `mode` gains `"propose"`; new optional `drafts: [{ id, skillName, summary, createdAtMs }]` (absent from older Gateways, which the UI treats as none).
- `skills.workshop.read` params: optional `draftId`.
- New methods `skills.workshop.applyDraft` / `skills.workshop.discardDraft` (`operator.admin`, since `2026.10`). They take the `skills.workshop.read` params with `draftId` required, so no new params schema or validator is added. Apply also refuses when `name` is not the draft's skill, so you can only apply the draft you reviewed. Both answer `SkillsWorkshopChangesResult`. The UI offers them only when the Gateway advertises them.
- No native app consumes these; Swift/Kotlin protocol checks pass unchanged.

**Update behavior:** Doctor's existing Skill Workshop final step also renames earlier exports (written by 2026.10.5–2026.10.7) into `.drafts/`. It never overwrites an existing draft: it keeps that export and records a recoverable warning, which does not block table retirement. It is skipped in update rehearsals, and nothing is deleted.

## Evidence

- UI before/after (mock Control UI, synthetic data): openclaw#181747 (comment) (Drafts list, update diff, new-skill draft, applied with Undo) and the mode switch in openclaw#181747 (comment).
- `src/skills/workshop/drafts.test.ts` (real filesystem): applying over a live skill is one `write_file` change that `restore` undoes; a multi-file draft is one change and one undo removes its support file and restores the instructions; a draft with a rejected support file changes nothing and stays in the inbox; a new-skill draft is one `create`; a draft identical to the live skill changes nothing and still leaves the inbox. A draft whose second file cannot be written leaves the live skill whole and records no change. A binary support asset (`assets/logo.png`) publishes byte for byte. The multi-file, rejected-file and failed-write cases fail on the previous per-file apply.
- `src/agents/tools/skill-workshop-tool.test.ts`: in `propose` mode a review's `patch` is refused, `draft` saves, the live skill and change feed stay unchanged, the review cannot discard; a foreground run aborted after its `draft` or `discard` call has started (authority captured, still preparing) writes no draft and deletes nothing (the discard case fails without the final-effect authority check).
- `src/auto-reply/reply/commands-learn.test.ts`: no drafts → reply without a model turn; `/learn drafts deploy …` selects only `deploy` drafts and keeps the focus; other text keeps all drafts; the prompt says not to save before the user answers.
- `ui/src/pages/skill-workshop/skill-workshop-page.test.tsx`: an agent with no skills sees only its drafts on the Drafts tab; discarding the last draft outside Propose mode keeps the Drafts list open; the Drafts list opens a draft as a diff against the live skill, Apply calls `skills.workshop.applyDraft` and follows the skill to Active; the mode switch writes `"propose"`.
- `src/gateway/server-methods/skills-workshop.test.ts`: `applyDraft` and `discardDraft` refuse a requester whose authority is gone, and the draft stays on disk. Both methods are `operator.admin` in the method descriptors, so `operator.read` callers are refused by the shared scope gate.
- `packages/gateway-protocol/src/index.test.ts`: read params accept an optional `draftId` and reject an empty one; `src/skills/workshop/drafts.test.ts` refuses applying a draft under another skill's name.
- `src/commands/doctor-skill-workshop-retire-proposals.test.ts`, `legacy-config-migrations.runtime.skills.test.ts`, `experience-review-scheduler.test.ts`, `src/gateway/server-methods/skills-workshop.test.ts`: export/move into `.drafts/`, config mapping, reviews still queue in `propose`, list includes drafts.
- Local: the focused suites above pass; `tsgo:core`, `tsgo:ui` and `tsgo:scripts` pass; changed-file oxlint, `protocol-registry:check`, the protocol since guard, native protocol checks and `ui:i18n:verify` pass. Other UI locales get the new strings from the post-merge locale refresh.
- **Real Gateway + upgrade proof:** openclaw#181747 (comment). A real background review (Claude Sonnet 5.5, propose mode) saved a draft and changed no skill. Apply and Undo worked through the real Control UI. Rotating the Gateway token during an apply refused it (`Gateway requester authority changed`): no live skill, draft kept, no change row. An `operator.read` client is refused both draft methods. 2026.10.4 → candidate and 2026.10.4 → 2026.10.7 → candidate upgrades keep every pending/quarantined proposal as a draft.
- Hosted CI is green on the merged head.

<details><summary>Simplify pass</summary>

- **Generated churn removed:** a dedicated draft-params schema made the gateway validator generator renumber about 6,000 `check_N` functions in `predicates.js`. The draft methods now reuse the read params, and the generated diff is 6 lines.
- **Removed:** the draft params schema, its validator and protocol test; the "+N more files" cap (draft files use the same Files-tab layout as live skills, which has no cap); separate apply/discard access flags (one `canReviewDrafts`).
- **Kept on purpose:** the `.drafts/` folder as the only draft storage; the staged-swap publish shared with `restore`; the Doctor move of 2026.10.5–10.7 exports; the 50-draft cap.
- **Whole-change delta vs `main`:** production +1055/-186, tests +427/-33, docs +114/-62, mock UI +119/-4, generated +6/-4.

</details>

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
Regenerate the Control UI locale catalogs and metadata with ui:i18n:sync
so build-artifacts no longer fails its catalog fallback baseline check.
Keep all 21 locales at zero fallback keys and preserve existing translations.

The drift follows English copy in openclaw#181747 (Workshop drafts and its config
hint), openclaw#185263 (OAuth expiry), and openclaw#185292 (Side chat selections).
Locale refresh run 40433199860 generated the updates but deferred publishing
because generator inputs changed on main during publication.

Validation: ui:i18n:check reproduced the baseline failure before generation
and passed afterward; tsgo:ui passed; independent autoreview found no
P0-P2 issues. Generated locale artifacts only: 694 additions, 211 removals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui clawsweeper:intake:feature Preliminary submission classification; full source review pending. cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts security-sensitive-changed size: XL 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.

3 participants