Repository navigation
feat(knowledge): consolidate claims by scope and supersede snapshots by their outcome - #186266
Conversation
…by their outcome Generalize the knowledge-unlinked-claims review into a claim consolidation review over the unlinked residue, one page, or one subject since a date, and add knowledge_supersede to supersede earlier claims by an existing claim (with undo) without writing a duplicate replacement. Co-authored-by: jalehman <[email protected]>
…by their outcome Worked on by: - @jalehman Co-authored-by: jalehman <[email protected]> OpenClaw-Publication: 25b88168-87e2-40b7-a0ad-e5fb72a2b939
|
🦞👀 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: blocked before merge. What this changesThis PR extends claim consolidation to page and subject scopes and adds reversible supersession by an existing claim. Example: PR 4242 has two CI snapshots and an existing merge-outcome claim.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this maintainer-authored PR open: the consolidation feature has clear value, but supersession can hide its own replacement claim through an existing dependency. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Knowledge plugin receives scoped agent tool calls, validates claim revisions, and publishes lifecycle changes through its storage worker and durable journal; retrieval then filters inactive records and their dependents. flowchart LR
A[Agent consolidation skill] --> B[Knowledge tool contract]
B --> C[Scoped service access]
C --> D[Storage worker]
D --> E[Supersession planner]
E --> F[Publication journal]
F --> G[Vault and lifecycle guards]
G --> H[Eligible retrieval]
Technical reviewBest possible solution: Keep the existing publication owner and reject supersession when its replacement would become ineligible through any targeted claim. Do we have a high-confidence way to reproduce the issue? Source establishes the failing input: create current claims A and B on the same page with B.dependencies containing A, then supersede A by B; publication succeeds and eligible() subsequently excludes B. No target code was executed. Is this the best way to solve the issue? The feature appropriately reuses existing readers, lifecycle metadata, and journal publication; the missing replacement-dependency rejection should reuse lifecycleImpact, matching the correction path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 63113761e0c5. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +238, Tests +201, Docs +100. Total +539 across 20 files. Added test files: 1. 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 Reviewed October 27, 2026, 4:16 PM ET / 20:16 UTC. |
Picks up the raised test-lines ceiling on main so checks-fast-baseline-ratchets passes. Co-authored-by: jalehman <[email protected]>
Worked on by: - @jalehman Co-authored-by: jalehman <[email protected]> OpenClaw-Publication: 80974ccb-0d5d-45eb-871f-1a6985858716
…enance The skill now reviews claims over several scopes, not only unlinked ones. The Review unlinked claims scribe keeps its title and still reviews only the unlinked residue. Co-authored-by: jalehman <[email protected]>
Worked on by: - @jalehman Co-authored-by: jalehman <[email protected]> OpenClaw-Publication: 46dda3e4-aff5-4767-b792-553d3fee8f02
… unlinked claims The scribe follows knowledge-maintenance and now says what its scheduled run does: consolidate the claims that name no page. Its id becomes claim-consolidation; scheduled runs still cover only the unlinked residue. Co-authored-by: jalehman <[email protected]>
Worked on by: - @jalehman Co-authored-by: jalehman <[email protected]> OpenClaw-Publication: 33313b44-96b9-4414-bbdc-5e89699e4e7f
… the scribe Knowledge Consolidation The scribe keeps the claim-consolidation id and declaration key, and its scheduled runs still review only claims that name no page. Co-authored-by: jalehman <[email protected]>
Worked on by: - @jalehman Co-authored-by: jalehman <[email protected]> OpenClaw-Publication: 71007868-596b-41c0-8a9d-7ef1b7508e59
Co-authored-by: jalehman <[email protected]>
Reuse the lifecycle fixture for the supersede tests and share the repeated record and scribe fixtures, cutting this PR's test-line growth from +205 to +74 while keeping every supersede assertion. Co-authored-by: jalehman <[email protected]>
Worked on by: - @jalehman Co-authored-by: jalehman <[email protected]> OpenClaw-Publication: 2f2e33e7-3467-4dbe-8ae9-3581599e633e
Co-authored-by: jalehman <[email protected]>
main at b3aa84d counts 6,293,484 test lines against its ceiling of 6,293,407. This PR adds 74 net lines of supersede coverage, so the ceiling moves to the merged total of 6,293,558 with no extra slack. Co-authored-by: jalehman <[email protected]>
Worked on by: - @jalehman Co-authored-by: jalehman <[email protected]> OpenClaw-Publication: 3e2f5815-39c7-4e17-9513-5a8de06aab96
Resolves the test-line ceiling conflict with #184502: main at beb12fa counts 6,293,568 test lines against its ceiling of 6,293,290, and this PR adds 74, so the ceiling is the merged total of 6,293,642 with no extra slack. Co-authored-by: jalehman <[email protected]>
Worked on by: - @jalehman Co-authored-by: jalehman <[email protected]> OpenClaw-Publication: 989a8f69-607b-439d-8bba-e1b6fa3b90b7
Resolves the test-line ceiling conflict: main at 2262f3d counts 6293974 test lines against its ceiling of 6293776, and this PR adds 74, so the ceiling is the merged total of 6294048 with no extra slack. Co-authored-by: jalehman <[email protected]>
Worked on by: - @jalehman Co-authored-by: jalehman <[email protected]> OpenClaw-Publication: 015e2d74-fc67-42e7-aa5b-c97e67b94744
What Problem This Solves
Knowledge claims pile up on hub pages (one team vault's project hub page has about 1,400 linked claims, 138 of them about 62 individual PRs), but the claim review only ever looked at unlinked claims. A status snapshot replaced by a claim that already exists could only be withdrawn, or "corrected", which writes a duplicate copy of the replacement.
User Impact
User impact: agents can run one claim consolidation review over the unlinked residue, the claims on one page, or the claims about one subject since a date. The review files claims on their most specific subject page and supersedes status snapshots and replaced claims by an existing claim with the new
knowledge_supersedetool. Superseded claims leave default reads but stay readable as history, and a supersession can be undone. The scheduled scribe is now Knowledge Consolidation; its scheduled runs still review only claims that name no page.After deploying: the review skill is renamed from
knowledge-unlinked-claimstoknowledge-claim-consolidation, and the Review unlinked claims scribe becomes Knowledge Consolidation with the new idclaim-consolidation(declaration keyknowledge:scribe:claim-consolidation). There is no migration or alias. An existing Review unlinked claims scribe (the Team Gateway has one) goes stale: its automation keeps the old declaration key and a stored run message naming the old skill, and the Scribes tab no longer lists it. Remove that automation (Knowledge scribe · Review unlinked claims) from the Automations page, then turn on Knowledge Consolidation from the Scribes tab. This PR does not change saved jobs.Why This Change Was Made
knowledge-claim-consolidationand generalized, not split into a sibling skill. The procedure is about 95% of the skill and differs only by starting set, and the shared-reference sync copies every topic to every skill, so a sibling would have duplicated the whole procedure. There is no compatibility alias: the old name never shipped in a release. Step numbering is unchanged.claim-consolidation, and a blurb, purpose and run step that describe the consolidation it does (filing, new pages, superseding snapshots by their outcome, page State). Its scheduled scope is not widened: runs still review only claims that name no page, and the blurb and purpose say so. Its closing counts now include superseded claims.knowledge_relinkdry run, unchanged), one page (knowledge_connectionsdirection: "claims"), or one subject with an optional date (knowledge_timelineentity/sinceplusknowledge_grepkind: "claim"for claims filed elsewhere). Existing read tools cover all three, so no new selector tool.knowledge_supersede: one revision-fenced publication marks 1 to 25 active claims superseded by an existing current claim. It reuses the existing superseded lifecycle: each earlier claim keeps its text, evidence, attribution and history and getssuperseded_byandlifecycle_change, like a corrected original. The superseding claim is not rewritten. Validation: claims only; no self-supersession or repeated IDs;bymust be current in the caller's scope; every earlier claim must be active and share a linked page (entitiesor source page, merge redirects followed) withby. Becausebymust be current and every earlier claim active, no cycle can form.undo: truerestores claims this tool superseded by the same claim and lifts their durable supersession guards when the restore publishes. Undo rejects supersessions made byknowledge_correct. Default reads already exclude superseded records; historical reads andknowledge_historykeep them.entities) and the broad page stays only on claims that say something about it.Accepted edge cases: Recent activity does not list supersede publications, which matches merges today. Viewing the superseding claim does not list the claims it superseded; they link to it.
Coordination with #186270 (page budgets and section extraction): this PR does not touch step 5 of the skill or any budget logic. #186270 adds one bullet to step 5 of
skills/knowledge-unlinked-claims/SKILL.md; this PR moves that file toskills/knowledge-claim-consolidation/SKILL.md, so whichever PR lands second must carry the bullet to the new path and check it survived. A trial merge with #186270 ata6e323a(before the rename) otherwise conflicts only where both PRs add lines next to each other: theReceipt.operationunion,Preparedfields, the receipt block inaccept, thestorage-hostregistrations, and the tool table and count indocs/plugins/knowledge.md. Each conflict resolves by keeping both sides; whichever PR lands second sets the tool count to 37. #186270'srelinkClaimapplies the same subject rule during extraction (destination page first, source kept only when the claim names it), decided by name match inside one publication. The review decides by judgment and writes throughknowledge_annotate, so there is no server helper to share; a future bulk relink tool could reuserelinkClaim.Evidence
extensions/knowledge/src/lifecycle.test.ts, on the lifecycle suite's isolated temp-vault fixture through the real service and storage worker: supersede, then undo, of a snapshot series, with text, evidence, attribution, reason and history kept; a stale active file cannot revive a superseded claim; rejection of self-supersession, repeats, a reverse edge (cycle), other subjects, unlinked claims, pages, stale fences, already superseded or withdrawn claims, and undo of a correction.expected 'superseded' to be 'active'); with it, it passes.node scripts/run-vitest.mjs run extensions/knowledgeafter mergingmainateec15d7: 54 of 55 files and 425 of 426 tests passed. The one failure,live-state.test.ts("Expected watcher notification"), is a filesystem-watcher timing test this PR does not touch; it passed twice when rerun on its own (6 of 6 each time). Within the Knowledge plugin, the later merges ofmainatb3aa84d,beb12faand2262f3dchanged onlyextensions/knowledge/package.json.pnpm tsgo:extensionsandpnpm tsgo:extensions:testpass; oxlint clean on changed files;node extensions/knowledge/scripts/sync-skill-references.mjs --checkpasses; docs format, markdownlint andgit diff --checkare clean. No earlier skill name or scribe title or id from this PR remains in the repository.knowledge-maintenancestill appears as the id of the scheduled maintenance pass and its internal agent (maintenance.ts,access.ts), which predate this PR and are unrelated to the skill.config/test-lines-baseline.txt;mainhas 6,293,776), exactly the merged tree's counted total with no slack. Justification:mainitself is already over its own ceiling. At2262f3dit counts 6,293,974 test lines against a ceiling of 6,293,776, 198 over, so any PR that adds a test line fails the ratchet. This PR's net delta is +74 lines, all coverage for the new supersede operation, its undo, and the renamed scribe and skill: +86 inlifecycle.test.tsfor the supersede tests, offset by sharing the repeated scribe and record fixtures. The supersede tests were moved into the lifecycle suite to reuse its fixture, which cut the delta from +205; going lower would mean rewriting unrelated tests or dropping supersede coverage. On the merged tree,check-test-lines-ratchetreportsTest lines OK: 6294048; ceiling: 6294048; slack: 0.Work sessions
Worked on by