feat(memory-wiki): index canon/ directory in bridge#10
Closed
LightDriverCS wants to merge 1 commit into
Closed
Conversation
Add `canon` as a recognized WikiPageKind so files in the vault's canon/ directory are indexed by wiki.search, wiki.get, wiki.status, and the compile pipeline. Until now the bridge only walked entities/, concepts/, sources/, syntheses/, and reports/ — files written directly into the vault by reflective dreaming agents (canon/<date>.md daily roll-ups) were invisible to MCP queries despite being valid wiki pages. Changes: - markdown.ts: add "canon" to WIKI_PAGE_KINDS + canon/ branch in inferWikiPageKind so toWikiPageSummary can classify these pages. - query.ts: add "canon" to QUERY_DIRS so listWikiMarkdownFiles + resolveQueryableWikiPageByLookup pick up canon pages. - status.ts: add canon: 0 to both pageCounts initializers (live and vault-missing fallback) + extend dirs loop in collectVaultCounts. - compile.ts: add canon entry to COMPILE_PAGE_GROUPS so readPageSummaries walks canon/ during compile and writeAgentDigestArtifacts persists canon pages into the agent digest. Add canon counter to buildPageCounts. - memory-palace.ts: add canon to PALACE_KIND_ORDER + PRIMARY_PALACE_KINDS + PALACE_KIND_LABELS so canon shows up alongside syntheses/entities/ concepts in the palace view. - status.test.ts: update vault-missing fixture for the new field. Verified locally on Mac mini: wiki.status reports canon: 4, wiki.get returns full canon content with kind: "canon", and wiki.search returns canon hits ranked above memory-corpus matches for queries that match canon body text.
2 tasks
LightDriverCS
added a commit
that referenced
this pull request
Apr 28, 2026
Phase D2.1 — threads appConfig.instanceId into resolveMemoryWikiConfig and resolveDefaultMemoryWikiVaultPath. Vault becomes ~/.openclaw/wiki/{instanceId}/ when set; falls back to main/ otherwise. Path-traversal inputs safely fall back. Orthogonal to #10.
Codex Anvil (gpt-5.5 xhigh) verdict: REPAIR. Repair applied: updated cli-metadata.test.ts to assert the new {instanceId} second-arg; updated README + docs/plugins/memory-wiki.md + openclaw.plugin.json to omit hardcoded vault.path examples that would override the new instance-scoped default.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
|
Superseded by #16, which includes:
Closing this in favor of #16 once it merges. Anvil artifact: |
LightDriverCS
added a commit
that referenced
this pull request
Apr 28, 2026
…with Anvil repair) (#16) Indexes the canon/ directory as a first-class memory-wiki page kind. Without this, daily canon roll-ups written by reflective-dreaming agents were invisible to wiki.search / wiki.get / wiki.status / compile pipeline. Includes Codex Anvil 5.5 xhigh repair (verdict REPAIR → applied): - Vault init now creates canon/ (was crashing compileMemoryWikiVault with ENOENT) - Status text + root-index count include canon - wiki repair scans canon for structure consistency - Regression tests across 7 test files Supersedes #10. Rebased onto post-#15 main so pnpm build clears. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
canonas a recognizedWikiPageKindso files in the vault'scanon/directory are indexed bywiki.search,wiki.get,wiki.status, and the compile pipeline. Until now the bridge only walkedentities/,concepts/,sources/,syntheses/, andreports/— daily canon roll-ups (canon/<date>.md) written directly into the vault by reflective dreaming agents were invisible to MCP queries despite being valid wiki pages.Why
Reflective-dreaming agents write
canon/<date>.mddaily roll-ups directly to the vault. They aren'tMemoryPluginPublicArtifacts (which the existingbridge.tsdispatcher handles), so they bypassed the import path entirely. The vault-walker side (QUERY_DIRS,COMPILE_PAGE_GROUPS,collectVaultCounts) didn't know about thecanon/directory either, so:wiki.get canon/2026-04-25.mdreturnednullwiki.searchfor canon body text returned 0 hits from the wiki corpuswiki.status.pageCountshad nocanonfieldChanges
markdown.ts: add"canon"toWIKI_PAGE_KINDS+ canon/ branch ininferWikiPageKindsotoWikiPageSummarycan classify these pages.query.ts: add"canon"toQUERY_DIRSsolistWikiMarkdownFiles+resolveQueryableWikiPageByLookuppick up canon pages.status.ts: addcanon: 0to bothpageCountsinitializers (live and vault-missing fallback) + extenddirsloop incollectVaultCounts.compile.ts: add canon entry toCOMPILE_PAGE_GROUPSsoreadPageSummarieswalkscanon/during compile andwriteAgentDigestArtifactspersists canon pages into the agent digest. Add canon counter tobuildPageCounts.memory-palace.ts: add canon toPALACE_KIND_ORDER+PRIMARY_PALACE_KINDS+PALACE_KIND_LABELSso canon shows up alongside syntheses/entities/concepts in the palace view.status.test.ts: update vault-missing fixture for the new field.Test plan
wiki.statusreportscanon: 4,wiki.get canon/2026-04-25.mdreturns full content withkind: "canon",wiki.searchreturns canon hits ranked above memory-corpus matches for queries that match canon body text,openclaw wiki compileregenerates the digest with canon entries.Related
Patches the same area as the dist-side patches in
~/.openclaw/patches/apply-memory-bridge-fixes.shFix 5 (which retires once this lands).