feat(memory-wiki): index canon/ directory in bridge (supersedes #10, with Anvil repair)#16
Merged
LightDriverCS merged 2 commits intoApr 28, 2026
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.
…ests Surfaced by Codex Anvil (PR #10 smoke 20260428T145529Z): 1. **Vault init missed `canon/`** — compile groups added `canon` but `vault.ts` `INITIAL_DIRS` didn't, so `compileMemoryWikiVault` failed with `ENOENT ... canon/index.md` on freshly-initialized vaults. Reproduced with the existing compile test before fix. 2. **Status text omitted canon count** — the `pageCounts.canon` data field existed but the text status renderer + root-index count summary didn't include it. Fixed in `status.ts` + `compile.ts`. 3. **Repair didn't scan canon** — `structure-repair.ts` didn't walk `canon/`, so `wiki repair` left canon pages structurally inconsistent. Plus regression tests across markdown, query, status, compile, memory-palace, structure-repair, and vault. Also rebased onto main to pick up the dreaming bundler stub from openclaw#15 (5bb2d95) so `pnpm build` clears. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
4 tasks
3 tasks
LightDriverCS
added a commit
that referenced
this pull request
Apr 28, 2026
PR #16 accidentally committed ~7.4 MB / 98 files of local Codex Anvil smoke artifacts (codex-anvil-{prompt,report,log}.md, anvil-repair.patch, etc.) under artifacts/anvil/. The smoke script writes to repo_root/artifacts/anvil/ but only `.artifacts/` (with dot prefix) was gitignored, not `artifacts/` (no prefix). Adds `artifacts/anvil/` to .gitignore and untracks the existing files. The data stays in git history (no force-push); future smokes won't add new files to the index. Co-authored-by: Cory Shelton <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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
Supersedes #10 with the original canon-kind indexing work + Codex Anvil repair pass + rebase onto current main.
Original work (squashed into commit 1)
Indexes the
canon/directory as a first-class memory-wiki page kind. Without this,wiki.search/wiki.get/wiki.status/the compile pipeline ignored daily canon roll-ups (canon/<date>.md) written by reflective-dreaming agents.Touches:
markdown.ts(WIKI_PAGE_KINDS + inferWikiPageKind),query.ts(QUERY_DIRS),status.ts(pageCounts initializers + dirs loop),compile.ts(COMPILE_PAGE_GROUPS + buildPageCounts),memory-palace.ts(PALACE_KIND_ORDER + PALACE_KIND_LABELS).Anvil repair (commit 2)
Codex 5.5 xhigh smoke (artifact) found 3 real bugs the original PR missed:
canon/dir — compile groups addedcanon, butvault.tsINITIAL_DIRSdidn't, socompileMemoryWikiVaultfailed withENOENT canon/index.mdon freshly-initialized vaults. Reproduced before fix.pageCounts.canonfield existed but rendering didn't include it. Fixed instatus.ts+compile.ts.wiki repairdidn't scan canon —structure-repair.tsdidn't walkcanon/, leaving canon pages structurally inconsistent.Plus regression tests across
markdown.test.ts,query.test.ts,status.test.ts,compile.test.ts,memory-palace.test.ts,structure-repair.test.ts.Why a new PR vs. force-pushing #10
The repair required rebasing #10 onto current
main(to pick up #15's bench-reflective-dreaming bundler stub sopnpm buildclears). Rather than force-push rewritten history to a 3-day-old PR, this opens a clean replacement — close #10 once this lands.Verification (Codex)
pnpm test extensions/memory-wiki/src→ 22 files, 109 tests passpnpm check→ passpnpm build→ pass after rebase (was failing on missing dreaming stub before chore(dreaming): commit bench-reflective-dreaming bundler stub #15 landed)ENOENT canon/index.mdfailure; post-repair it passes.Anvil Handoff
extensions/memory-wiki/src/{markdown,query,status,compile,memory-palace,vault,structure-repair}.ts+ matching.test.tsfiles.INSTANCE_ID_PATTERNregex in feat(memory-wiki): scope vault path to instanceId (Phase D2.1) #13 is local copy of zod-schema regex — same drift risk applies to canon naming if we ever add validation. None active here.wiki repairactually walks canon now (smoke command in test file).🤖 Generated with Claude Code