Skip to content

feat(knowledge): route skills by task and keep subject pages current - #197018

Merged
jalehman merged 12 commits into
mainfrom
openclaw/mellow-barnacle
Nov 12, 2026
Merged

jalehman merged 12 commits into
mainfrom
openclaw/mellow-barnacle

Conversation

@jalehman

@jalehman jalehman commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

When agents curate or ingest Knowledge, they restructure pages that were already current, leave dated sections and Timelines in place, use the wrong layout for a page's type, and break citations when records move. They also read about 50–66K of skill references before their first write.

User Impact

User impact: consolidation leaves current pages alone and retires dated material into State. Every path that writes a subject page (ingest, meetings, capture, entities, corrections) follows its type's layout, rewrites State in place, and keeps citations reachable. Agents also load far less guidance before they start. Nothing changes until the next session, because the memory-prompt edit only affects new sessions. Trial on a vault copy before merging.

Why This Change Was Made

  • Routers, not manuals. knowledge-claim-consolidation/SKILL.md drops from 12.4K to 4.8K. It is now a rules card that survives compaction (never lose a citation or reachable evidence, read before writing, fences, leave-alone), followed by tasks that each link one reference: linking.md, retiring.md, page-review.md. Scribe runs say which task each step belongs to. knowledge-ingest, knowledge-capture, knowledge-correct and knowledge-source-ingest no longer require reading conventions.md and publication.md in full up front. They link small topic references, or sections of those files, step by step. Each skill says that references don't need rereading after compaction unless they are about to be used.
  • One layout per type. There are now layout-{project,person,company,concept}.md files, and a page review reads only the one for its page's type. The concept layout forbids project headings.
  • Leave-alone rule. profiles.md (now the subject-page rules) makes "no change" the default. A current page gets fixes only. Restructuring or splitting needs a named reason in the report, and a split needs a subject that is clearly separate and big enough to stand alone.
  • Dated material. retire-dated.md covers Timelines and dated sections. Their content is synthesized into State and kept as claims and source notes, never rearranged into new headings. Every citation in the deleted text is checked first. Source notes now have their own source-notes.md.
  • Citations. Before a cited claim is withdrawn or superseded, its citing pages are listed. Afterwards, each citing sentence is rechecked: the link is repointed only when the survivor states the same fact; otherwise the sentence is rewritten, or amended on authored documents.
  • Capture routing. In memory-prompt.ts, when a remembered decision, outcome or status change alters an existing page's State, the agent now also rewrites that State. This is stable-prompt text. It is gated on page tools and takes effect from the next session. knowledge_remember code and results are unchanged.
  • This carries over the intent of the unpushed knowledge-page-curation commits (516f9fb67ab6, 7241cff12d9b), rewritten for feat(knowledge): lean agent tool results and hash-prefix write fences #196767's lean result shapes. For example, it uses top-level nextOffset and no view/includeCards.

Evidence

Up-front load in bytes: SKILL.md plus the references required for the scenario.

Scenario Before (main) After
consolidation: before any write 49.7K 6.9K
consolidation: page review (project) 55.5K (66.4K on the curation branch) 21.2K
consolidation: page review with dated sections 55.5K 26.2K
consolidation: link + retire (scribe residue) 49.7K 15.6K
ingest: up-front / typical document 50.2K / 77.2K 9.4K / 54.9K
meeting ingest: up-front / typical meeting 14.6K / 59.0K 12.6K / 63.8K
capture: remember / update a page 42.4K / 42.4K 5.6K / 23.6K
entities: up-front / one page 7.2K / 28.0K 8.2K / 32.6K
correct: up-front / claim correction 43.9K / 43.9K 9.5K / 17.3K
source ingest: up-front 44.3K 13.0K

Meetings and entities grow slightly. They now load a type layout and source notes, and these replace guidance that was previously missing.

  • These pass: node extensions/knowledge/scripts/sync-skill-references.mjs --check, git diff --check and oxfmt.
  • These pass: skill-packaging, scribes-state, memory-provider-entry and the new memory-prompt.test.ts. The new test checks that the State guidance appears only when the agent can edit pages.
  • An Astra subagent ran the autoreview and found no P0 or P1 issues. It reported four P2s, all verified and fixed: the lean nextOffset, the unavailable updatedAt, the meeting gate conflicting with the ingestion retirement cap, and semantic checks before repointing citations.
  • Vault trials (isolated copies of a 4,700-record vault, gpt-6-astra, from the same pristine snapshot):
    • Run 3, this branch vs main's skills, 9 page reviews + 3 meeting ingests:
      • Dated sections went to 0 on all 9 pages (the hub had 13, release 7); main kept them.
      • Leave-alone pages kept identical headings.
      • New pages: 5 vs 56 for main.
      • Ingestion appended 0 dated headings to entity pages vs 12 for main, and created 6 new pages vs 14 (9 of them single-PR pages).
      • Context overflows: 7 vs 14.
      • Every citation removed from a page stayed reachable through a source note or claim, except one hub claim and one person link (the run-2 instructions lost the same hub claim).
      • Gap found: page reviews dropped the type sections (Key decisions, Milestones, Commitments, company Relationship) into a long State. Fixed in 84fec2a.
    • Run 4, after 84fec2a, 6 page reviews:
      • Type sections restored on ClawHub, ClawSweeper and Microsoft; State 0.6–1.2K.
      • Release went from 9.9K to 6.2K, with 0 repeated hedges and no citation runs over 4.
      • 0 unreachable citations; no splits or new pages.
      • OpenClaw ID and 1Password, the leave-alone check pages, kept State decisions and milestones in the original snapshot, so they were reorganized into their type sections with no content lost (citations 23→67 and 11→13). Accepted as intended.
    • One entry kept: release kept one unexplained Timeline entry, which the rules say to retain and report.

Turn the consolidation and ingestion skills into short routers with a rules card and per-task references, add one page-layout reference per entity type, make leave-alone the default for current pages, retire dated sections into State without losing citations, and ask agents to keep page State current when remembered claims change it.

Reapplies the intent of the unpushed knowledge-page-curation commits on current main.
Use the lean record nextOffset, drop the unavailable updatedAt, check citing sentences before repointing retired claims, and report legacy dated sections beyond the ingestion allowance instead of failing the meeting gate.
OpenClaw-Publication: 0358b549-b67e-459d-a2df-f1fd1a8e4d07
@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation plugin: knowledge size: XL labels Nov 11, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR routes Knowledge skills through task-specific references and guides agents to keep subject pages current while preserving citations.

Example: A project page contains September 23 and September 25 status sections followed by a release outcome.

  • Before: The page can retain dated reports alongside stale State text.
  • After: The guidance directs the agent to update the current explanation and preserve dated facts and citations in claims and source notes.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The source repairs both prior defects and keeps a coherent owner boundary, but the supplied artifacts do not demonstrate the changed behavior.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Knowledge pages can remain stale or accumulate dated material while agents load substantial guidance before writing.
Reason: The maintainer-authored direction addresses a concrete curation problem through existing plugin surfaces, and the generated copies retain one authoritative source.

Merge readiness

✅ Ready for maintainer review

Both earlier findings are resolved, and no new definite correctness defect was found; this useful maintainer-directed PR should remain open.

Priority: P2
Reviewed head: 9a3d130bb53833eda736069f1c684249b1bb81b2

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide an inspectable model-driven run showing page upkeep and citation/date preservation through the shipped Knowledge tools; base-red/head-green behavioral proof was not supplied.
Agent review details

How this fits together

The Knowledge plugin supplies memory prompts and bundled skills to agents, which use existing publication tools to maintain vault claims, relationships, and pages.

flowchart LR
  A[User task] --> B[Knowledge memory prompt]
  B --> C[Skill task router]
  C --> D[Task references]
  D --> E[Knowledge publication tools]
  E --> F[Vault claims and pages]
  F --> G[Knowledge record view]
Loading

Technical review

Best possible solution:

Keep task guidance in the existing shared-reference owner and publish the focused routing and page-upkeep changes once their evidence and validation gates clear.

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

Source inspection confirms the changed instruction paths, but no current-main agent reproduction was run during this read-only review.

Is this the best way to solve the issue?

The change uses the existing skills, reference generator, and publication tools without introducing a competing runtime owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Claim consolidation and subject routing keeps the original intent (e665f5b: Generalize claim review across scopes and file claims on their most specific subject before superseding snapshots.)
  • Derived Timelines and source notes keeps the original intent (cffc912: Prevent written Timelines from exhausting page budgets while retaining dated history in records.)
  • Page-size recovery keeps the original intent (ff2d718: Bound page growth and extract independently meaningful sections without losing information.)
  • Page prose replacement changes intended behavior with a stated reason (e665f5b: Prefer local edits and preserve existing claim links; this PR explains broader section rewrites as current-state synthesis with explicit fact and citation preservation.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Raw commit 65ad180 adds extensions/knowledge/src/memory-prompt.ts:45 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 65ad18005286; files: extensions/knowledge/src/memory-prompt.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove merge-risk: 🚨 session-state: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This improves an optional Knowledge curation workflow with limited blast radius.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 (2 earlier review cycles)
  • reviewed 2026-11-11T04:13:47.566Z sha 81c024b :: needs changes before merge. :: [P2] Link page-scoped claims before retiring them | [P2] Check event dates before skipping an existing source note
  • reviewed 2026-11-12T09:21:42.664Z sha f20743c :: needs changes before merge. :: [P2] Link page-scoped claims before retiring them | [P2] Check event dates before skipping an existing source note

Reviewed November 12, 2026, 4:31 AM ET / 09:31 UTC (Revision 3).

Layout fails when decisions, milestones or commitments sit in State or a supported leading section is missing; prose fails on repeated hedges or more than about three citations per sentence. State is the short current picture.
OpenClaw-Publication: 5572e2f3-2ecf-46a4-8967-bb0ba89f29bb
@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 11, 2026
@jalehman
jalehman marked this pull request as ready for review November 11, 2026 15:05
@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 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. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@jalehman

Copy link
Copy Markdown
Contributor Author

Fixed both P2 findings in 9a3d130:

  • One-page scope now moves claims about a more specific subject before retiring (superseded/withdrawn claims cannot be relinked; storage-edits.ts rejects entity changes on historical records).
  • Timeline retirement reuses an existing source note only when the grouped row's date is the entry's date; a differently dated entry still gets its own event claim before the section is deleted.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@jalehman
jalehman merged commit 239b496 into main Nov 12, 2026
112 checks passed
@jalehman

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@jalehman
jalehman deleted the openclaw/mellow-barnacle branch November 12, 2026 09:39
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
…penclaw#197018)

* feat(knowledge): route skills by task and keep subject pages current

Turn the consolidation and ingestion skills into short routers with a rules card and per-task references, add one page-layout reference per entity type, make leave-alone the default for current pages, retire dated sections into State without losing citations, and ask agents to keep page State current when remembered claims change it.

Reapplies the intent of the unpushed knowledge-page-curation commits on current main.

* fix(knowledge): address skill review findings

Use the lean record nextOffset, drop the unavailable updatedAt, check citing sentences before repointing retired claims, and report legacy dated sections beyond the ingestion allowance instead of failing the meeting gate.

* feat(knowledge): route skills by task and keep subject pages current

OpenClaw-Publication: 0358b549-b67e-459d-a2df-f1fd1a8e4d07

* fix(knowledge): fail page reviews that bury type sections in State

Layout fails when decisions, milestones or commitments sit in State or a supported leading section is missing; prose fails on repeated hedges or more than about three citations per sentence. State is the short current picture.

* Publish openclaw/mellow-barnacle

OpenClaw-Publication: 5572e2f3-2ecf-46a4-8967-bb0ba89f29bb

* test(knowledge): fold page-State prompt check into provider entry suite

* Publish openclaw/mellow-barnacle

OpenClaw-Publication: 33f7db40-cf86-41bf-a2ac-e2b208b1e77f

* test(knowledge): pass a join separator in the prompt check

* Publish openclaw/mellow-barnacle

OpenClaw-Publication: 3b881ff3-dff7-4063-9258-c6fe9e482c89

* test(knowledge): allocate test lines for the page-State prompt check

* Publish openclaw/mellow-barnacle

OpenClaw-Publication: c624bdb4-e1e6-4f28-93b4-52df28f311d9

* fix(knowledge): move page claims before retiring them and keep distinctly dated Timeline entries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. plugin: knowledge rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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.

1 participant