From 9883b010b369926eb2d071ecb70cda414d0577fe Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 21 Sep 2026 16:37:10 -0400 Subject: [PATCH] docs(lessons): give the round-trip guard the measured growth, not a remembered one (#4272) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The module docstring said the defect grew the worst real body by 520 characters over ten edits. That number was recalled, not measured, and it is wrong — as was the 2500 I then got by deriving it on paper instead of running it. Replayed lesson #4207's actual stored shape through the old code: 607 characters per edit, exactly the length of the trigger's paragraphs 2 and 3 with their separators, taking the body from 1291 to 7361 over ten edits. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01821k5B3Ysecp9fNYs92Kuy --- tests/test_lesson_insight_round_trip.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_lesson_insight_round_trip.py b/tests/test_lesson_insight_round_trip.py index abc9ab7..8db7698 100644 --- a/tests/test_lesson_insight_round_trip.py +++ b/tests/test_lesson_insight_round_trip.py @@ -22,8 +22,13 @@ composer writes all of it after the marker, so paragraphs 2..n were ordinary lines that the filter had no reason to touch. They came back as "the insight", the full trigger was prepended again, and the stored lesson gained (n-1) paragraphs per update — silently, compounding, and in the half of the -document that does the retrieving. On the corpus's worst real shape it grew -the body by 520 characters over ten round trips. +document that does the retrieving. + +Measured on the one real row this damaged (lesson #4207, a three-paragraph +trigger): the body grew by exactly 607 characters per edit — the length of +paragraphs 2 and 3 with their separators — taking it from 1291 characters to +7361 over ten edits, at which point the trigger appears eleven times and the +insight is 17% of the record. WHY A MARKER COULD NOT HAVE FIXED IT. There is no end-of-trigger marker in the body and adding one would not repair a row already written without it.