Skip to content

feat(knowledge): edit page layouts from the vocabulary - #197386

Draft
jalehman wants to merge 12 commits into
mainfrom
feat/knowledge-ontology-layouts
Draft

jalehman wants to merge 12 commits into
mainfrom
feat/knowledge-ontology-layouts

Conversation

@jalehman

Copy link
Copy Markdown
Contributor

Related: #197018 (stacked on it; retarget to main after it lands)

What Problem This Solves

Page layouts (how a project, person, company or concept page is written) lived as four Markdown files copied into every Knowledge skill, so they could not be seen or changed from the product and only four of the 19 page types had one.

User Impact

User impact: operators can read every page type's layout in Settings → Vocabulary, and edit it, add one to a type that has none, or reset it to the default. Agents read the layout for the type they are writing from the ontology, so a saved edit reaches them on their next page write.

  • Saving a layout never invalidates an in-flight write: layouts are outside the ontology fingerprint.
  • Upgrade note: the fingerprint no longer includes the manifest name and version, so every existing fingerprint changes once on upgrade. A write that read the old fingerprint before the upgrade is rejected once and must re-read it, as after any ontology change.
  • Downgrade caveat: older Knowledge versions reject manifests with layout/layouts, so a vault with a saved layout has no usable ontology in an older plugin until the keys are removed. Users don't edit ontology files by hand, so this was accepted; it is documented.

Why This Change Was Made

  • Page-type definitions get an optional layout: the question a page answers, ordered sections (heading + guidance) and optional notes. The four existing layouts are seeded into knowledge-default.yaml word for word.
  • Overriding a type normally replaces its whole definition, which would copy and freeze the type's fields, aliases and filing just to change its layout. So a manifest can also declare a layouts map by type name. A UI save is one entry in the vault's ontology.yaml. The first save creates a manifest named vault that extends knowledge-default and declares no definitions. Maps apply nearest-first. An entry for a type that no longer exists is reported as a diagnostic and does not take the ontology offline.
  • Saves go through the existing publication journal: they are fenced by the layout the editor opened, bounded to the manifest size limit, recorded in mutation history (operation layout) and committed to the vault's Git history. Saving needs operator.write; agents cannot edit layouts.
  • Agents read a type's layout from knowledge_ontology view: "definitions", and the default catalog stays lean. The skills now say "read the layout for this page's type from the ontology" instead of naming four types. Rules that apply to every type stay in the skills. The layout copies and their sync step are removed.
  • In Vocabulary, a type's details used to open inside its narrow card, which could not fit a layout. Clicking a type now opens a detail dialog with its layout, fields, search terms and examples.

Accepted edge case: a layout save that lands in the milliseconds between another write's validation and acceptance makes that write fail with "Ontology changed during validation". The caller retries it, as with any concurrent ontology edit.

Evidence

Real isolated Gateway on the Mac Studio (built from this branch and from the #197018 head), synthetic store, headless Chromium at 1280×900 and 400×860. The proof saved a project layout, saw it reopen marked Customized, and reset it to the default. It reported no console errors and no horizontal overflow on mobile.

Before (#197018 head) After
Vocabulary before Vocabulary after
Project details inside the card Project detail dialog with layout
Edit After save Type without a layout
Edit layout Customized layout Add layout
Reset Mobile editor
Reset to default Mobile editor

Checks on the Mac Studio:

  • All Knowledge tests pass (pnpm test extensions/knowledge).
  • tsgo (extensions) is clean.
  • oxlint on extensions/knowledge is clean.
  • Format check passes on all changed files.
  • sync-skill-references --check passes.
  • pnpm build passes.

New tests cover:

  • Layout map resolution and the fingerprint.
  • Shipping the default layouts.
  • Saving, replaying, resetting and fencing a layout, including the vault manifest, Git history, mutation history, the status snapshot and an unchanged fingerprint for in-flight writes.
  • Rejecting an oversized manifest without blocking the store.
  • Keeping layout editing away from agent tools.
  • The Vocabulary detail and editor views.

An independent review raised four findings, all fixed here:

  • Bound the manifest size before acceptance.
  • Fence the save to the agent and vault the editor opened.
  • Include layouts in the status snapshot so other open views refresh.
  • Give type cards their own reading-state key.

A fifth finding is an existing gap in #197018's base and is not fixed here: operator write principals don't recheck the host's live request authority after admission.

Notes
  • pnpm build reported Control UI boot-bundle budget overages (largest JS gzip +0.3 KiB) without failing. This PR changes only plugin code, not the core Control UI bundle.
  • The project layout's note keeps its original link text, ([splitting](profiles.md#the-default-is-no-change)), because the layouts were moved word for word. It shows as raw text in the UI.

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
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
OpenClaw-Publication: 33f7db40-cf86-41bf-a2ac-e2b208b1e77f
OpenClaw-Publication: 3b881ff3-dff7-4063-9258-c6fe9e482c89
OpenClaw-Publication: c624bdb4-e1e6-4f28-93b4-52df28f311d9
@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: 🚨 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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 Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the contribution. ClawSweeper is trimming this lowest-signal PR because the author is over the repository's open-PR budget.

@jalehman currently has 45 open PRs in this repository, above the budget of 15. ClawSweeper is closing this PR as one of the author's lowest-signal submissions under that budget: its overall rating is D and its real behavior proof is insufficient. Closing or finishing other PRs frees review budget, and this PR can be reopened once the author is under budget or when real proof is added.

Closing or finishing other open PRs frees review budget. This PR can be reopened once the author is under budget, or sooner when real behavior proof is added.

Review details

Best possible solution:

Close this lowest-signal PR for now. Finish or close other open PRs to free review budget, then reopen this PR once the author is under budget; adding real behavior proof also makes it eligible for reconsideration.

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

Source tracing establishes the revoked-authority save path and unchanged snapshot on an override-only reset; target code was not executed during this read-only review.

Is this the best way to solve the issue?

Moving layouts into the existing ontology and reusing journaled publication is coherent, and the obsolete Markdown copies are removed; the listed repairs fit the existing owners without another layer.

Security review:

Security review needs attention: The new layout mutation does not consume the host's live request-authority assertion at publication.

  • [high] Revoked operator authority can still alter agent guidance — extensions/knowledge/src/service.ts:533
    Persisted layouts become instructions consumed by subsequent agent page writes, so the missing live-authority check affects durable behavior beyond the originating request.
    Confidence: 0.99

AGENTS.md: found and applied where relevant.

What I checked:

  • live author budget: @jalehman has 45 open PRs in this repository; the configured budget is 15.
  • lowest-signal classification: overall PR rating is D and real behavior proof is insufficient.
  • inactivity floor: the PR and its current-head commit, status, and check-run activity are all older than 7 days.

Likely related people:

  • Josh Lehman: Raw commit 65ad180 adds extensions/knowledge/src/ontology.ts:131 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/ontology.ts)
  • Peter Steinberger: Raw commit 2762ac1 adds extensions/knowledge/src/storage-journal.ts:142 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 2762ac1c388f; files: extensions/knowledge/src/storage-journal.ts)

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

Base automatically changed from openclaw/mellow-barnacle to main November 12, 2026 09:39

This branch has not been deployed

No deployments
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 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. P2 Normal backlog priority with limited blast radius. plugin: knowledge proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant