From 606e345580d14975ea47af711f306cfdfe7972df Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 26 Aug 2026 19:48:50 -0400 Subject: [PATCH] Fix the rename that renamed itself MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `sed s/_reconcile_tags/_lift_and_reconcile_tags/` ran over tags.py after the new function was already written with the new name, so the definition became `_lift_and_lift_and_reconcile_tags` while all 15 call sites were correct. Twelve test modules failed to import. The check that should have caught it is the reason it got through: the verification grep piped output through `sed 's/:.*_lift/: _lift/'`, which trims to the LAST `_lift` and therefore prints a doubled name identically to a correct one. A filter that can only make wrong output look right is worse than no filter. Same sed also clobbered the docstring's historical reference — it read "it used to be `_lift_and_reconcile_tags`", naming the function after itself. Co-Authored-By: Claude Opus 5 --- src/thoughtsync/notes/tags.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/thoughtsync/notes/tags.py b/src/thoughtsync/notes/tags.py index 56bc94c..64004f1 100644 --- a/src/thoughtsync/notes/tags.py +++ b/src/thoughtsync/notes/tags.py @@ -128,13 +128,13 @@ async def _find_or_create_label(db, owner_id, name: str): return label.id -async def _lift_and_lift_and_reconcile_tags(db, note: Note) -> None: +async def _lift_and_reconcile_tags(db, note: Note) -> None: """Attach the note's tag labels, LIFT its standalone tags out of the body, and re-derive display_title if the body moved. - NAMED FOR THE MUTATION. It used to be `_lift_and_reconcile_tags` and only touched rows; - it now rewrites `note.body`, and a caller that does not expect that will compute - a display_title from text this function is about to delete. + NAMED FOR THE MUTATION. It used to be `_reconcile_tags` and only touched rows; it + now rewrites `note.body`, and a caller that does not expect that will compute a + display_title from text this function is about to delete. Which is why the lift and the re-derivation both live HERE rather than at the seven call sites that would each have to remember. Spreading a derived-value