Skip to content

verify: update notes at their original path#5

Open
mconsalvo95-tech wants to merge 1 commit into
Wynelson94:mainfrom
mconsalvo95-tech:codex/verify-update-original-note-path
Open

verify: update notes at their original path#5
mconsalvo95-tech wants to merge 1 commit into
Wynelson94:mainfrom
mconsalvo95-tech:codex/verify-update-original-note-path

Conversation

@mconsalvo95-tech

Copy link
Copy Markdown

Fixes #1.

This keeps verify --update from creating a second note file when the note's current filename does not match the canonical {id}-{topic}.md name.

The update path already knows which file was checked through NoteStatus.path, but the healed note was being written through write_note(), which derives the output filename from the note frontmatter. This now writes the updated frontmatter/body back to the same note file that was checked.

I also added a regression test that renames a note file, drifts its reference, runs verify --update, and asserts that only the renamed file remains and a follow-up verify --check is clean.

Checks:

  • uv run --extra dev pytest tests\test_cli_v09_update.py::TestUpdateWritesOriginalNotePath::test_update_keeps_mismatched_note_filename -q
  • uv run --extra dev pytest tests\test_cli_v09_update.py -q
  • uv run --extra dev ruff check
  • uv run --extra dev ruff format --check
  • uv run --extra dev pytest -q (local Windows: 322 passed, 1 pre-existing executable-bit assertion failure in tests/test_githook.py::TestInstallGitHook::test_fresh_install)
  • uv run --extra dev fieldnotes verify --check (local Windows checkout reports pre-existing stale fieldnotes; same result before this change)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: verify --update forks a note when its filename doesn't match {id}-{topic}.md

1 participant