fix(memory-wiki): gracefully handle unparsable YAML frontmatter in vault scans (#96125)#97177
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 30, 2026, 8:17 PM ET / 00:17 UTC. Summary PR surface: Source +68, Tests +432. Total +500 across 10 files. Reproducibility: yes. Source inspection on current main shows malformed frontmatter reaches YAML.parse, then readPageSummaries uses errorMode stop and rethrows through compileMemoryWikiVault; I did not run a local repro because this review is read-only. Review metrics: 2 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land the scan-boundary fix only after preserving empty-frontmatter compatibility, keeping scalar and sequence roots strict, and refreshing current-head redacted terminal proof. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main shows malformed frontmatter reaches YAML.parse, then readPageSummaries uses errorMode stop and rethrows through compileMemoryWikiVault; I did not run a local repro because this review is read-only. Is this the best way to solve the issue? No, not yet. The scan-boundary approach is the right layer, but the current non-mapping guard is too broad for empty frontmatter and the latest head still needs real behavior proof. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5e572dcf781a. Label changesLabel justifications:
Evidence reviewedPR surface: Source +68, Tests +432. Total +500 across 10 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper automerge |
|
🦞🧹
Draft PRs stay fix-only until GitHub marks them ready for review. Pause with Automerge progress:
|
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
022f37b to
50c353e
Compare
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
…in vault scans (openclaw#96125) toWikiPageSummary now catches YAML parse errors during vault-wide scans (compile/lint/query/status) and returns a degraded WikiPageSummary with frontmatterError set instead of letting the error propagate through readPageSummaries -> compileMemoryWikiVault, which previously caused one bad page to crash the entire vault. Edit paths (apply, chatgpt-import) still throw on bad frontmatter to prevent silent metadata loss on write. - markdown.ts: add frontmatterError field to WikiPageSummary, extract splitWikiFrontmatterBlock, catch YAML.parse in toWikiPageSummary - lint.ts: add invalid-frontmatter lint code, skip frontmatter-derived checks when frontmatterError is present - markdown.test.ts: test degraded parse preserves body, empty frontmatter - lint.test.ts: test invalid-frontmatter lint on broken page, healthy page unaffected Related to openclaw#96125 Co-Authored-By: Claude Opus 4.8 <[email protected]>
50c353e to
31f68c1
Compare
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
|
Land-ready maintainer proof for exact head
Result: malformed YAML is isolated from compile/query/lint/status derived state, including parseable non-mapping roots, while ordinary pages, apply targets, dashboards, lint reports, and root/directory index writes remain fail-closed. No known proof gaps. |
|
Merged via squash.
|
…ult scans (openclaw#96125) (openclaw#97177) * [AI] fix(memory-wiki): gracefully handle unparsable YAML frontmatter in vault scans (openclaw#96125) toWikiPageSummary now catches YAML parse errors during vault-wide scans (compile/lint/query/status) and returns a degraded WikiPageSummary with frontmatterError set instead of letting the error propagate through readPageSummaries -> compileMemoryWikiVault, which previously caused one bad page to crash the entire vault. Edit paths (apply, chatgpt-import) still throw on bad frontmatter to prevent silent metadata loss on write. - markdown.ts: add frontmatterError field to WikiPageSummary, extract splitWikiFrontmatterBlock, catch YAML.parse in toWikiPageSummary - lint.ts: add invalid-frontmatter lint code, skip frontmatter-derived checks when frontmatterError is present - markdown.test.ts: test degraded parse preserves body, empty frontmatter - lint.test.ts: test invalid-frontmatter lint on broken page, healthy page unaffected Related to openclaw#96125 Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(memory-wiki): isolate invalid frontmatter scans * fix(memory-wiki): keep malformed lint reports fail-closed * fix(memory-wiki): reject non-mapping frontmatter * fix(memory-wiki): validate generated index targets --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…ult scans (openclaw#96125) (openclaw#97177) * [AI] fix(memory-wiki): gracefully handle unparsable YAML frontmatter in vault scans (openclaw#96125) toWikiPageSummary now catches YAML parse errors during vault-wide scans (compile/lint/query/status) and returns a degraded WikiPageSummary with frontmatterError set instead of letting the error propagate through readPageSummaries -> compileMemoryWikiVault, which previously caused one bad page to crash the entire vault. Edit paths (apply, chatgpt-import) still throw on bad frontmatter to prevent silent metadata loss on write. - markdown.ts: add frontmatterError field to WikiPageSummary, extract splitWikiFrontmatterBlock, catch YAML.parse in toWikiPageSummary - lint.ts: add invalid-frontmatter lint code, skip frontmatter-derived checks when frontmatterError is present - markdown.test.ts: test degraded parse preserves body, empty frontmatter - lint.test.ts: test invalid-frontmatter lint on broken page, healthy page unaffected Related to openclaw#96125 Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(memory-wiki): isolate invalid frontmatter scans * fix(memory-wiki): keep malformed lint reports fail-closed * fix(memory-wiki): reject non-mapping frontmatter * fix(memory-wiki): validate generated index targets --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…ult scans (openclaw#96125) (openclaw#97177) * [AI] fix(memory-wiki): gracefully handle unparsable YAML frontmatter in vault scans (openclaw#96125) toWikiPageSummary now catches YAML parse errors during vault-wide scans (compile/lint/query/status) and returns a degraded WikiPageSummary with frontmatterError set instead of letting the error propagate through readPageSummaries -> compileMemoryWikiVault, which previously caused one bad page to crash the entire vault. Edit paths (apply, chatgpt-import) still throw on bad frontmatter to prevent silent metadata loss on write. - markdown.ts: add frontmatterError field to WikiPageSummary, extract splitWikiFrontmatterBlock, catch YAML.parse in toWikiPageSummary - lint.ts: add invalid-frontmatter lint code, skip frontmatter-derived checks when frontmatterError is present - markdown.test.ts: test degraded parse preserves body, empty frontmatter - lint.test.ts: test invalid-frontmatter lint on broken page, healthy page unaffected Related to openclaw#96125 Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(memory-wiki): isolate invalid frontmatter scans * fix(memory-wiki): keep malformed lint reports fail-closed * fix(memory-wiki): reject non-mapping frontmatter * fix(memory-wiki): validate generated index targets --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…ult scans (openclaw#96125) (openclaw#97177) * [AI] fix(memory-wiki): gracefully handle unparsable YAML frontmatter in vault scans (openclaw#96125) toWikiPageSummary now catches YAML parse errors during vault-wide scans (compile/lint/query/status) and returns a degraded WikiPageSummary with frontmatterError set instead of letting the error propagate through readPageSummaries -> compileMemoryWikiVault, which previously caused one bad page to crash the entire vault. Edit paths (apply, chatgpt-import) still throw on bad frontmatter to prevent silent metadata loss on write. - markdown.ts: add frontmatterError field to WikiPageSummary, extract splitWikiFrontmatterBlock, catch YAML.parse in toWikiPageSummary - lint.ts: add invalid-frontmatter lint code, skip frontmatter-derived checks when frontmatterError is present - markdown.test.ts: test degraded parse preserves body, empty frontmatter - lint.test.ts: test invalid-frontmatter lint on broken page, healthy page unaffected Related to openclaw#96125 Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(memory-wiki): isolate invalid frontmatter scans * fix(memory-wiki): keep malformed lint reports fail-closed * fix(memory-wiki): reject non-mapping frontmatter * fix(memory-wiki): validate generated index targets --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…ult scans (openclaw#96125) (openclaw#97177) * [AI] fix(memory-wiki): gracefully handle unparsable YAML frontmatter in vault scans (openclaw#96125) toWikiPageSummary now catches YAML parse errors during vault-wide scans (compile/lint/query/status) and returns a degraded WikiPageSummary with frontmatterError set instead of letting the error propagate through readPageSummaries -> compileMemoryWikiVault, which previously caused one bad page to crash the entire vault. Edit paths (apply, chatgpt-import) still throw on bad frontmatter to prevent silent metadata loss on write. - markdown.ts: add frontmatterError field to WikiPageSummary, extract splitWikiFrontmatterBlock, catch YAML.parse in toWikiPageSummary - lint.ts: add invalid-frontmatter lint code, skip frontmatter-derived checks when frontmatterError is present - markdown.test.ts: test degraded parse preserves body, empty frontmatter - lint.test.ts: test invalid-frontmatter lint on broken page, healthy page unaffected Related to openclaw#96125 Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(memory-wiki): isolate invalid frontmatter scans * fix(memory-wiki): keep malformed lint reports fail-closed * fix(memory-wiki): reject non-mapping frontmatter * fix(memory-wiki): validate generated index targets --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit 1289abd)
…ult scans (openclaw#96125) (openclaw#97177) * [AI] fix(memory-wiki): gracefully handle unparsable YAML frontmatter in vault scans (openclaw#96125) toWikiPageSummary now catches YAML parse errors during vault-wide scans (compile/lint/query/status) and returns a degraded WikiPageSummary with frontmatterError set instead of letting the error propagate through readPageSummaries -> compileMemoryWikiVault, which previously caused one bad page to crash the entire vault. Edit paths (apply, chatgpt-import) still throw on bad frontmatter to prevent silent metadata loss on write. - markdown.ts: add frontmatterError field to WikiPageSummary, extract splitWikiFrontmatterBlock, catch YAML.parse in toWikiPageSummary - lint.ts: add invalid-frontmatter lint code, skip frontmatter-derived checks when frontmatterError is present - markdown.test.ts: test degraded parse preserves body, empty frontmatter - lint.test.ts: test invalid-frontmatter lint on broken page, healthy page unaffected Related to openclaw#96125 Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(memory-wiki): isolate invalid frontmatter scans * fix(memory-wiki): keep malformed lint reports fail-closed * fix(memory-wiki): reject non-mapping frontmatter * fix(memory-wiki): validate generated index targets --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit 1289abd)
Related to #96125. Supersedes #96177.
What Problem This Solves
A single memory-wiki page with malformed YAML frontmatter caused vault-wide compile, query, lint, status, and apply workflows to throw. Returning a degraded empty-metadata summary would avoid the crash but contaminate derived indexes, digests, counts, and query results, and could let writers erase metadata.
Why This Change Was Made
The final implementation separates tolerant scans from strict writes:
scanWikiPageSummaryreturns a closed valid / invalid-frontmatter / ignored result.parseWikiMarkdownremains strict for direct edits, dashboards, lint reports, and generated root/directory indexes, preserving malformed targets byte-for-byte.This keeps one bad page from disabling read-only vault workflows without manufacturing a valid-looking page or weakening write safety.
User Impact
Evidence
node scripts/run-vitest.mjs extensions/memory-wiki/src/markdown.test.ts extensions/memory-wiki/src/compile.test.ts extensions/memory-wiki/src/lint.test.ts extensions/memory-wiki/src/query.test.ts extensions/memory-wiki/src/status.test.ts extensions/memory-wiki/src/apply.test.ts— 6 files, 98 tests passed.tbx_01kwdez3sef8w1dqe4m4v40c6j:env CI=1 corepack pnpm test extensions/memory-wiki— 31 files, 209 tests passed.env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 corepack pnpm check:changed— passed extension typecheck/lint and repository guards.cbx_06c4ea5d0f42, runrun_64bc6a1334b3: real CLI init/compile/search/lint/status/apply scenario passed, including malformed-target byte preservation.e9d0dccff3— no findings; patch correct at 0.94 confidence.What Was Not Tested
No external provider credentials or network service are involved in this plugin-local parser and filesystem behavior. No proof gap remains for the changed surface.