fix: Handle null, empty, and string 'None' title in markdown frontmatter (#387) - #389
Conversation
…ter (#387) This fixes a bug where entities with invalid title values in frontmatter caused SQL INSERT failures due to NOT NULL constraint violations. The parser now properly falls back to the filename stem when title is: - None/null (YAML null value) - Empty string - The string "None" (common in user templates) This matches the existing pattern used for type field validation. Co-authored-by: Paul Hernandez <phernandez@users.noreply.github.com>
|
Claude finished @phernandez's task —— View job Code Review Complete ✓I've reviewed this PR against the Basic Memory team checklist. Overall, this is a well-executed bug fix with excellent test coverage. The implementation is clean, follows project conventions, and properly addresses issue #387. Code Quality & Standards ✓Strengths:
Implementation Review (entity_parser.py:133-138): # Handle title - use default if missing, None/null, empty, or string "None"
if not title or "None":
metadata["title"] = absolute_path.stem
else:
metadata["title"] = titleThe logic is sound and handles all the edge cases:
This mirrors the existing Testing & Documentation ✓Excellent test coverage:
Minor documentation note: Basic Memory Architecture ✓Architectural alignment:
Knowledge graph consistency: Security & Performance ✓Security:
Performance:
Error handling:
Recommendations✅ All Clear - Ready to Merge This PR demonstrates best practices:
No blocking issues found. Team Checklist SummaryCode Quality & Standards
Testing & Documentation
Basic Memory Architecture
Security & Performance
Great work on this fix! The approach is clean, well-tested, and follows all project conventions. This will prevent the SQL INSERT failures that were occurring in production. |
Fixes #387
This PR fixes a bug where entities with invalid title values in frontmatter caused SQL INSERT failures. The parser now properly falls back to the filename stem when title is None, empty, or the string "None".
Changes
Generated with Claude Code