fix(core): support type metadata in edit note - #1472
Conversation
_METADATA_IDENTITY_FIELDS drops title, type and permalink from a metadata
merge, on the grounds that all three have dedicated resolution paths in
prepare_edit_entity_content that a merge would race.
That holds for two of the three. A merged title can be overwritten by
reconcile_prepared_edit_title_from_h1, and a merged permalink can come back
suffixed from resolve_permalink, so in both cases the caller's value can
vanish without a word. type has no such second opinion. Its whole "resolution
path" is one line reading the frontmatter back out, and the note_type that
reaches the database comes from re-parsing the merged markdown - so writing
type into frontmatter feeds that path instead of fighting it.
Net effect before this change: edit_note(..., metadata={"type": "decision"})
returned success and changed nothing, with no way for the caller to tell.
Drop type from the exclusion set and leave title and permalink where they
are. Tests cover both halves: type now lands in the file's frontmatter and in
the indexed entity, and title and permalink are still refused.
Signed-off-by: samwachtel <sammy@wachtel.us>
(cherry picked from commit e301d13)
Signed-off-by: phernandez <paul@basicmachines.co>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 290fb35314
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 536c5e64a7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
Summary
edit_notecan update note type metadataNoteTypeboundaryWhy
edit_note(..., metadata={"type": ...})previously reported success without changing an existing note's type. The contributor fix correctly madetypewritable, but the complete feature also needs consistent behavior when append/prepend creates a missing note and must prevent invalid type values from entering frontmatter.Implementation
Entityused by the auto-create pathNoteTypedefinition used at API boundariesTesting
uv run pytest tests/services/test_entity_service_prepare.py test-int/mcp/test_edit_note_integration.py -q(52 passed)uv run pytest test-int/mcp/test_edit_note_integration.py -q(25 passed after review fixes)just fast-checkAttribution
Supersedes #1417 while preserving @samwachtel's original commit, authorship, sign-off, and cherry-pick provenance.