You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Frontmatter keys cannot be deleted through a full-document save #1768
A frontmatter key removed from a note's document is not removed from the file. A replace or overwrite keeps any key that the incoming document leaves out.
Seen in Basic Memory Cloud's web editor:
A note's frontmatter has eaccess: write.
The person deletes that line in the frontmatter editor and saves.
The full new document goes to the save path without the key.
After a reload, eaccess: write is back in the file.
Why
Core's update path merges the incoming metadata over the note's existing raw frontmatter before it dumps the YAML: services/note_preparation.py, prepare_update_entity_content (around line 465), after schema_to_markdown. A key that is absent from the new document survives from the old one.
This merge is intended for MCP write_note with overwrite=True, whose docs say: "Overwrite replaces the body but merges frontmatter: keys the existing note has and this write does not set are kept". That rule is wrong for a caller that sends the whole canonical document. An editor saving the full file means "this is the file", and the only way to delete a key should be to leave it out.
Expected
When a write supplies the complete document (frontmatter plus body), the resulting frontmatter is exactly what was supplied. Keys left out are removed. The MCP overwrite merge can stay as it is for callers that only set some fields, but a full-document replace needs a path that does not merge.
Repro
Note with frontmatter title, type, extra: 1.
Save the full document without extra through the accepted-note replace path, which is what Cloud's PUT /api/v2/notes/{id} uses.
Read the file: extra: 1 is still there.
Related
Cloud had a separate bug on the same save path: frontmatter booleans and numbers were stringified (enabled: true became enabled: 'True') because the payload was built from the normalized index metadata. That one is being fixed in Cloud. This issue is only about deleted keys coming back.
Component: Cloud-facing (the accepted-note replace path behind PUT /api/v2/notes/{id}). The defect itself is in core, in the services/note preparation layer.
Priority: Medium. A deleted frontmatter key comes back after save. That's a data-correctness problem for full-document editors, but the note body is not corrupted and there is a workaround: set the key to an empty value rather than removing it.
Complexity: Medium. The fix needs a replace path that skips the existing-frontmatter merge in prepare_update_entity_content (services/note_preparation.py), while keeping the merge for MCP write_note(overwrite=True). The main work is deciding how callers opt in to full-document semantics, plus regression tests on the accepted-note replace path.
Duplicates: I found no exact duplicate. #1653 is related: it covers write_note overwrite merge-preserving frontmatter keys and says the tool documents replacement. It looks at the same merge from the MCP side, so any decision on the merge semantics should be coordinated with it.
The issue has a clear repro and expected behavior, so I don't need more information. Per triage scope, I haven't made any code changes.
Activity
claude commentedon Oct 16, 2026
Claude finished @phernandez's task in 13s —— View job
Triage
PUT /api/v2/notes/{id}). The defect itself is in core, in the services/note preparation layer.prepare_update_entity_content(services/note_preparation.py), while keeping the merge for MCPwrite_note(overwrite=True). The main work is deciding how callers opt in to full-document semantics, plus regression tests on the accepted-note replace path.Duplicates: I found no exact duplicate. #1653 is related: it covers
write_noteoverwrite merge-preserving frontmatter keys and says the tool documents replacement. It looks at the same merge from the MCP side, so any decision on the merge semantics should be coordinated with it.The issue has a clear repro and expected behavior, so I don't need more information. Per triage scope, I haven't made any code changes.
fix(mcp): document that bm_write overwrite keeps frontmatter keys (#2111