Repository navigation
feat(knowledge): scribes set themselves up and maintenance finds the review scribe - #185583
Conversation
|
🦞👀 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. What this changesThis PR adds skill-driven scribe setup and repair, conversation and Memory ingestion, and automatic discovery of the review automation. Example: An owner sends the unlinked-review setup message with timezone America/Los_Angeles.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR provides useful self-configuring Knowledge scribes that current main lacks; the prior findings are resolved, and no blocking defect remains. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherKnowledge skills guide owner-authorized agent conversations; the existing automation scheduler runs them, and plugin maintenance queues review when private claims remain unlinked. flowchart TD
Owner[Owner conversation] --> Skills[Knowledge scribe skills]
Skills --> Scheduler[Automation scheduler]
Maintenance[Knowledge maintenance] --> Scheduler
Scheduler --> Authority[Live authority checks]
Authority --> Skills
Skills --> Vault[Knowledge vault]
Technical reviewBest possible solution: Use the existing skills and scheduler to configure scribes while preserving explicit reviewJobId selection, paused jobs, and live owner authority. Do we have a high-confidence way to reproduce the issue? This is a feature addition; current-main source confirms the manual review setup that the PR replaces, and supplied Gateway output demonstrates the new path. Is this the best way to solve the issue? The change fits existing owners: skills describe the workflows, maintenance discovers the job, and the scheduler retains execution authority without a new queue or storage subsystem. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 52b43f7145f9. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +26, Tests +68, Docs +372. Total +466 across 11 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed October 27, 2026, 4:37 AM ET / 08:37 UTC (Revision 4). |
|
@clawsweeper re-review Both P2 findings from the |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Added the requested negative controls to the PR body ("Negative controls" section), on the same isolated gateway: a non-owner isolated scheduled run carrying the scribe message was refused memory access before any Knowledge read or write, and the declared scribe job was refused by the scheduler's owner-authority check after its conversation was reset. The vault record count was unchanged across both. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…review scribe (openclaw#185583) * feat(knowledge): self-scheduling scribe skills and review lookup by declaration key * chore(knowledge): use a Set for scribe skill names * docs(knowledge): weekly backstop for the review scribe * fix(knowledge): scribes keep one job per key and skip the in-turn test run * fix(knowledge): scribes retarget their own job, accept a new vault, and document manual setup * fix(knowledge): report review lookup errors without a type assertion
What Problem This Solves
The Knowledge Scribes tab needs scribe conversations that set themselves up from one fixed message, and the unlinked-claims review currently requires a hand-made automation with a far-future placeholder schedule plus a
reviewJobIdconfig edit.User Impact
An owner conversation that receives
Knowledge scribe setup: <id>and its JSON options (typed by hand now; the Scribes tab in #185637 sends the same message) sets up its scribe on its own:knowledge:scribe:unlinked-review) targeting its own session and ends with aSCRIBE_RESULTline. Maintenance queues that automation automatically whenmaintenance.reviewJobIdis unset, so config edits are no longer needed.sincewindow, either once or on a schedule. A checkpoint page lets reruns skip what was already learned.MEMORY.md, daily notes andDREAMS.md. It never modifies Memory files and skips anything Knowledge already has.maintenance.reviewJobIdstill wins when set. The maintenance docs give the complete manual setup message, plus repair and recovery.Why This Change Was Made
Each scribe skill has a
Scribe setupsection. The shared steps (access check, declaring the automation by declaration key, repair, the result line) live in one shared reference copied into the two scribe skills. Declaration keys are unique per owning conversation and a declarative add does not change a job's session, so setup removes same-key jobs owned by other conversations, retargets its own job withupdatewhen needed, carries a paused state over, and reads the job back. A never-written vault reports storeunprovisionedwith writes off; setup treats that as OK, since the first write creates it. Maintenance looks up the job by declaration key once per pass through the plugin's existing cron access. It prefers an enabled job; a paused one is reported asskipped. The review job's own schedule is a weekly backstop, since maintenance already queues it nightly when claims are left.Evidence
pnpm test extensions/knowledge/src/maintenance.test.ts extensions/knowledge/src/skill-packaging.test.ts extensions/knowledge/src/storage-schema.test.ts: all passed. Tests cover: no scribe job means no review; the enabled scribe job is preferred and queued; a paused one is reportedskipped; a configuredreviewJobIdskips the lookup.node extensions/knowledge/scripts/sync-skill-references.mjs --check, oxfmt andgit diff --check: clean.Live test gateway, build
1207fe12788The head
46abc3feae0differs from the tested build only in how one caught scheduler error is formatted for the log (extensions/knowledge/src/maintenance.ts, removing a type assertion for the assertion-safety ratchet); the skill text and lookup logic are identical.Isolated gateway on fsn1 loopback, fresh state (vault never written), Knowledge in the memory slot, real model. Each setup message, in the exact contract format, was typed into a fresh owner session's Control UI chat composer.
knowledge_statusreportedstore: unprovisioned,scope: private,writesEnabled: false; setup proceeded, listed jobs, and created462a5fef…(declarationKey: knowledge:scribe:unlinked-review,sessionTarget: session:<its own key>,45 3 * * 0America/Los_Angeles, delivery none,failureAlert {after: 2}). It started no run.462a5fef…withcron.update {enabled:false}, then sent the same setup message from a second new conversation. That turn calledautomations list,remove 462a5fef…,add(targeting its own session), thenlistagain.cron.listafterwards held exactly oneknowledge:scribe:unlinked-reviewjob,9f728a26…,enabled: false, targeting the second conversation.scope: "all",since: "today", schedule0 */6 * * *: two seeded owner conversations, one then archived withsessions.patch {archived:true}. Setup created job42ee3172…targeting its own session and did no learning. An operatorcron.run {mode:"force"}(what the Scribes tab's Run now sends) queued runcron-request.72e63040…, which finishedokin the scribe's session:sessions_list {"archived":"all","excludeSubagents":true}, 2×sessions_history,knowledge_remember, checkpoint page created and updated withknowledge_edit_body. It learned the archived "Billing database choice" conversation (3 claims) and the active one (1 decision), and skipped the 4 scribe conversations.MEMORY.md,memory/2026-10-21.md,DREAMS.mdwith a grounded line, a reflection, and checked/unchecked items):knowledge_grepbefore saves, thenknowledge_remember. It saved 4 items from MEMORY.md and the daily note (the decision dated 2026-10-21), saved the DREAMS.md grounded bike fact as agent inference citing the entry, and skipped the reflection and the unconfirmed item. The three files' SHA-256 hashes were unchanged after the run.Negative controls (same gateway, build
1207fe12788)Vault record count was 10 before and after both runs.
isolatedautomation carrying the exact conversations scribe run message, forced withcron.run(cron-request.26faaf8e…). The Gateway loggedmemory audience unavailable: root session agent:main:cron:30d3add3-…:run:d3d38270-… has no durable chat type,knowledge_statuswas refused, and nothing was read or saved:sessions.reseton the conversations scribe's session, a new seed conversation added, thencron.run {mode:"force"}on its declared job42ee3172…(cron-request.98f59a26…). The run failed in 7 ms, before any agent turn:The operator authority that created this automation was refused … Scheduled operator continuation definition or conversation changed; recreate it from an authenticated turn. The new conversation was not learned.Maintenance discovery only chooses which job to enqueue; the scheduler's owner check above runs at execution and is unchanged by this PR.
On the earlier build
c5a89ae(same maintenance code as this head): withreviewJobIdunset, a scheduled maintenance pass loggedreview enqueued (9 unlinked)andmaintenance_status.lastRun.reviewshowed the scribe job and run ID; that run linked 4 claims in the scribe's own session.Found live and fixed in this PR
agent tool caller authority is no longer active). Setup no longer starts one; the first scheduled, maintenance-queued, or operator Run now run is the test.Not exercised live
maintenance.reviewJobIdstill takes precedence (unit test); existing automations and vault records are untouched.