Issue #1055: Add minimal frontmatter parser for memory files#1119
Issue #1055: Add minimal frontmatter parser for memory files#1119Meh10t wants to merge 12 commits intooraios:mainfrom
Conversation
|
This is a draft, right? |
Yes, this is a draft. This PR only introduces the minimal frontmatter parser as the first step for issue #1055. |
|
Pls keep in mind our specification. In particular, any kind of frontmatter is allowed. So
Is not correct |
Thanks for the clarification! I updated the parser so it now accepts any frontmatter key/value pairs instead of restricting it to "summary". Let me know if this aligns better with the specification. |
src/serena/util/frontmatter.py
Outdated
| from typing import Tuple, Dict | ||
|
|
||
|
|
||
| def parse_frontmatter(content: str) -> Tuple[Dict[str, str], str]: |
There was a problem hiding this comment.
Serena is an object-oriented codebase. Please consistently use OOP principles.
There was a problem hiding this comment.
Serena is an object-oriented codebase. Please consistently use OOP principles.
Thanks for the feedback! I refactored the frontmatter parsing into an OOP-style FrontmatterParser while keeping parse_frontmatter as a backward-compatible wrapper.
634715b to
1c3ac4f
Compare
This PR starts work on issue #1055.
It introduces a minimal frontmatter parser for memory files, supporting arbitrary YAML-like fields.
Currently supported:
Example supported format:
summary: Some short description
This is the memory content...
This is the first step towards supporting opt-in frontmatter tools (MemoryAddFrontmatterTool and MemoryGetFrontmatterTool).
Next steps: