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
Entity created_at resets on every edit or move #1716
An entity's created_at is reset to the time of the latest edit or move. markdown/utils.py sets model.created_at = markdown.created, and entity_parser.py takes created from the file's st_ctime. Every atomic write or rename changes the ctime, so after any edit created_at equals updated_at.
Repro: write a note, edit it a minute later, then compare entity.created_at with the original write time, or look at tail / recent_activity output.
Expected: created_at stays the time the note was first created. It should keep the existing row's value on update, and use frontmatter created when the note has one.
src/basic_memory/markdown/entity_parser.py:391-415 uses the frontmatter created value if there is one. Otherwise it falls back to a filesystem timestamp (the issue says st_ctime). Atomic writes and renames change that timestamp.
I only read these lines. I did not reproduce the bug.
Suggested direction (for whoever picks this up)
When updating an existing entity row, keep its created_at.
Use the filesystem timestamp only when creating a new row and the note has no frontmatter created.
Keep a frontmatter created value as authoritative when it is present.
Add regression tests for edit, move, and frontmatter-created cases.
Duplicates
I found no duplicate. These issues are related and already closed:
Activity
claude commentedon Oct 10, 2026
Claude finished @phernandez's task in 17s —— View job
Triage
bug)created_atis wrong. That skewsrecent_activity,tail, and any consumer that reads creation time.Findings
The code matches the report:
src/basic_memory/markdown/utils.py:70setsmodel.created_at = markdown.createdunconditionally.src/basic_memory/markdown/entity_parser.py:391-415uses the frontmattercreatedvalue if there is one. Otherwise it falls back to a filesystem timestamp (the issue saysst_ctime). Atomic writes and renames change that timestamp.I only read these lines. I did not reproduce the bug.
Suggested direction (for whoever picks this up)
created_at.created.createdvalue as authoritative when it is present.createdcases.Duplicates
I found no duplicate. These issues are related and already closed:
created/modifiedfrontmatter on BM-owned writes #684, "Auto-writecreated/modifiedfrontmatter on BM-owned writes"Whether #684 already writes
createdinto frontmatter is worth checking, because that would partly mitigate this bug for BM-written notes.No further reproduction details are needed.
fix(core): keep created_at on edits; clearer build_context and confli…
fix(core): keep created_at on edits; clearer build_context and confli…