Merged
Conversation
Keep non-managed frontmatter fields during import while preserving LeafWiki-managed metadata on write. Add regression coverage for planner title precedence, importer execution, disk persistence, and node store merging of raw markdown with frontmatter.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the markdown import pipeline to preserve non-LeafWiki frontmatter fields (e.g., title, aliases, custom keys) while ensuring LeafWiki-managed metadata is still controlled on write, and adds regression tests around title precedence and persistence.
Changes:
- Preserve non-managed frontmatter during import execution instead of stripping all frontmatter.
- Update
NodeStore.UpsertContentto accept raw markdown (with optional frontmatter) while keeping LeafWiki-managed fields authoritative. - Add regression coverage for planner title precedence, executor/importer behavior, and disk persistence of preserved frontmatter.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/importer/planner_test.go | Adds regression test ensuring leafwiki_title takes precedence over title. |
| internal/importer/importer_service_test.go | Updates/extends importer service tests to verify preserved frontmatter and disk persistence. |
| internal/importer/executor_test.go | Updates executor tests to assert preserved non-internal frontmatter behavior. |
| internal/importer/executor.go | Implements frontmatter-preserving import content construction. |
| internal/core/tree/node_store_test.go | Adds test validating raw frontmatter extras are merged while managed fields are enforced. |
| internal/core/tree/node_store.go | Switches UpsertContent to parse raw content and preserve extras while syncing managed frontmatter. |
| internal/core/markdown/markdown.go | Adds helper to set raw markdown while preserving managed frontmatter and replacing extras. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use shared markdown frontmatter serialization for importer extra fields and add regression coverage for distinct preserved values. This removes duplicated YAML encoding logic and avoids behavior drift between importer and markdown write paths.
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.
Keep non-managed frontmatter fields during import while preserving LeafWiki-managed metadata on write.
Add regression coverage for planner title precedence, importer execution, disk persistence, and node store merging of raw markdown with frontmatter.