Skip to content

Add memory-wiki-strict schema variant #104

@mindsocket

Description

@mindsocket

Context

From the memory-wiki comparison (issue #100). A memory-wiki-strict schema variant would allow spaces to enforce memory-wiki-compatible frontmatter conventions via sctx's schema validation. This is useful for teams interoperating with openclaw/memory-wiki tooling, or for any space that wants stricter epistemic discipline than the default knowledge_wiki schema.

Decision: add as a new top-level schema file that builds on _knowledge_wiki.json with extra required fields.

Schema design

New file: schemas/memory_wiki_strict.json

Builds on _knowledge_wiki partial and enforces:

Field Requirement Notes
id Required on all types Stable machine identifier, e.g. entity.alpha
confidence Required on concept, entity, synthesis Page-level confidence score (0–1)
updatedAt Required on all types ISO 8601 datetime for freshness tracking

pageType compatibility: memory-wiki uses pageType instead of type for page kind. Spaces using this schema with openclaw-sourced content should configure the markdown plugin's fieldMap in space config to map pageTypetype. Document this in the schema description.

The id, confidence, and updatedAt requirements should be expressed as additional required constraints layered on top of the _knowledge_wiki $defs, or via a new set of $defs that extend them.

Potential structure

{
  "$id": "sctx://memory_wiki_strict",
  "title": "Memory Wiki Strict",
  "description": "...",
  "allOf": [{ "$ref": "sctx://_knowledge_wiki" }],
  "oneOf": [
    { "$ref": "#/$defs/source" },
    { "$ref": "#/$defs/concept" },
    // ...
  ],
  "$defs": {
    // Each $def extends the _knowledge_wiki version with additional required fields
    "concept": {
      "allOf": [
        { "$ref": "sctx://_knowledge_wiki#/$defs/concept" },
        { "required": ["id", "confidence", "updatedAt"] }
      ]
    },
    // ...
  }
}

Acceptance criteria

  • memory_wiki_strict.json is a valid top-level sctx schema
  • Pages missing id, confidence (on concept/entity/synthesis), or updatedAt fail validation
  • knowledge_wiki.json is unaffected (no required field changes there)
  • Schema description documents the fieldMap config pattern for pageType compatibility
  • Smoke test or fixture covers the strict schema

Reference

docs/memory-wiki-research.md — "Is a memory-wiki schema worth adding?" section and decision note

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions