Summary
After generating a wiki through /remember plus /compile, running engram9 migrate-okf --write converts legacy frontmatter successfully, but engram9 validate --strict still fails because generated internal links are broken.
Reproduction
- Start engram9 with a valid OpenAI-compatible model.
./engram9 -addr :9090 \
-data ./claude-notes/catstock-stock-wiki \
-model deepseek-v4-pro \
-compile-interval 0
-
Import multiple source documents through /remember.
-
Wait for integrations to finish, then compile.
curl -sS -X POST http://127.0.0.1:9090/compile \
-H "Content-Type: application/json" \
-d "{}"
- Migrate the generated wiki to OKF.
./engram9 migrate-okf --write ./claude-notes/catstock-stock-wiki/wiki
- Validate strictly.
./engram9 validate --strict ./claude-notes/catstock-stock-wiki/wiki
Actual Result
Migration succeeds, but strict validation fails with broken internal links only.
OKF migration wrote: 94 file(s), 91 change(s)
OKF validation failed: 94 file(s), 0 error(s), 130 warning(s); strict mode treats warnings as failure
Examples:
warning semantic/index.md: broken internal link: semantic/companies/spacex.md
warning episodic/index.md: broken internal link: episodic/2026-06-24/samsung-400b-buyback.md
warning semantic/ai/anthropic-distillation-report.md: broken internal link: companies/anthropic.md
Expected Result
After migrate-okf --write, engram9 validate --strict <wiki> should pass, or at minimum generated structural indexes should not contain invalid relative links.
Suspected Causes
RebuildIndex() writes category sub-index links using paths relative to the wiki root even when writing wiki/semantic/index.md or wiki/episodic/index.md.
Current code in internal/storage/fs.go:
lines = append(lines, fmt.Sprintf("- [%s](%s) — %s", filepath.Base(p.relPath), p.relPath, p.desc))
For wiki/semantic/index.md, a link like semantic/companies/spacex.md resolves as wiki/semantic/semantic/companies/spacex.md, which is invalid.
- Agent prompts still instruct legacy
[[...]] links and do not require link targets to exist, so the LLM can emit links to missing pages such as semantic/companies/changxin-memory.md or semantic/commodities/oil.md.
Suggested Fix
- Generate sub-index links relative to the sub-index file directory.
- Add a regression test for
RebuildIndex() that validates root index.md and category index.md links with engram9 validate --strict.
- Consider constraining agent prompts or write tools so internal links point only to existing pages unless a matching page is created in the same operation.
Summary
After generating a wiki through
/rememberplus/compile, runningengram9 migrate-okf --writeconverts legacy frontmatter successfully, butengram9 validate --strictstill fails because generated internal links are broken.Reproduction
Import multiple source documents through
/remember.Wait for integrations to finish, then compile.
Actual Result
Migration succeeds, but strict validation fails with broken internal links only.
Examples:
Expected Result
After
migrate-okf --write,engram9 validate --strict <wiki>should pass, or at minimum generated structural indexes should not contain invalid relative links.Suspected Causes
RebuildIndex()writes category sub-index links using paths relative to the wiki root even when writingwiki/semantic/index.mdorwiki/episodic/index.md.Current code in
internal/storage/fs.go:For
wiki/semantic/index.md, a link likesemantic/companies/spacex.mdresolves aswiki/semantic/semantic/companies/spacex.md, which is invalid.[[...]]links and do not require link targets to exist, so the LLM can emit links to missing pages such assemantic/companies/changxin-memory.mdorsemantic/commodities/oil.md.Suggested Fix
RebuildIndex()that validates rootindex.mdand categoryindex.mdlinks withengram9 validate --strict.