fix(memory-wiki): ignore code spans during wikilink lint#97987
fix(memory-wiki): ignore code spans during wikilink lint#97987ly-wang19 wants to merge 2 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close: this PR is a redundant Memory Wiki extractor landing candidate because an open sibling PR already covers the same code-span/fenced-code wikilink false-positive bug with broader regression coverage and before/after CLI proof. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Use #97977 as the canonical landing path, and lift any useful nested-fence or Markdown-link test cases from this branch if maintainers want them. So I’m closing this here and keeping the remaining discussion on #97977. Review detailsBest possible solution: Use #97977 as the canonical landing path, and lift any useful nested-fence or Markdown-link test cases from this branch if maintainers want them. Do we have a high-confidence way to reproduce the issue? Yes. Current main extracts links from markdown after removing only the managed related block, and lint turns unmatched extracted targets into Is this the best way to solve the issue? No for this branch as the landing path. The implementation is plausible, but the best current path is the open proof-positive sibling PR that covers the same bug with broader edge-case coverage and real CLI output. Security review: Security review cleared: No concrete security or supply-chain issue was found; the diff is limited to Memory Wiki markdown parsing and colocated tests. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 54b09580f61b. |
|
Closing as duplicate: the underlying issue #97945 was fixed on main by #97954 (commit c896718), which strips fenced code blocks and inline code before wikilink extraction in This matches the rationale maintainer @vincentkoc applied to the canonical sibling #97977: keeping this open would just create duplicate cleanup churn since main already covers the code-span/fenced-code false-positive bug. If a distinct markdown edge case not covered by main surfaces, I'll reopen as a focused follow-up against current main. |
Closes #97945
What Problem This Solves
Fixes an issue where
openclaw wiki lintreported falseBroken wikilink targetwarnings for[[...]]text inside fenced code blocks and inline code spans. Real vaults with Bash, Scala, or Markdown examples could receive noisy link diagnostics for code that was never meant to be a Memory Wiki link.Why This Change Was Made
The Memory Wiki extractor now masks Markdown fenced code blocks and inline code before collecting Obsidian-style wikilinks and Markdown links. The change is scoped to link extraction: real links outside code are still collected, and the existing related-block masking remains in place.
The fence handling also requires a closing fence line to contain only the matching fence delimiter plus optional whitespace. That keeps common Markdown examples, such as an outer Markdown code block containing a literal fenced snippet line like
```ts, from closing the mask early.User Impact
Memory Wiki lint output is quieter and more trustworthy. Users can keep Bash conditionals, Scala generics, and Markdown examples in wiki pages without those code samples producing broken-link warnings, while genuine broken links outside code continue to be reported.
Evidence
extensions/memory-wiki/src/markdown.test.tscovers extractor behavior for real links outside code, inline code, fenced Bash/Scala samples, and nested-fence Markdown examples.extensions/memory-wiki/src/lint.test.tscovers the user-visible lint path so code-only[[...]]text no longer becomes abroken-wikilinkwarning.node scripts/run-vitest.mjs extensions/memory-wiki/src/markdown.test.ts extensions/memory-wiki/src/lint.test.ts-> passed.git diff --check-> passed..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main-> clean, no accepted/actionable findings.