Fix milestone/div alignment for new format where milestones mark boundaries between divs#9
Fix milestone/div alignment for new format where milestones mark boundaries between divs#9
Conversation
Co-authored-by: eroux <60868+eroux@users.noreply.github.com>
|
@copilot thanks! now please explain to me why the align_div_milestones_nl needs to do this magic with the divs and milestones. It seems to me that if the milestone character coordinates were properly handled (shifted in getString()), this wouldn't need to happen. Please debug why there is a shift where the milestone suddently finds himself in the middle of a div instead of on a div boundary. Perhaps use some asserts to see if that's the case at every step and then see where the asserts fail |
|
@copilot thanks! now please explain to me why the align_div_milestones_nl needs to do this magic with the divs and milestones. It seems to me that if the milestone character coordinates were properly handled (shifted in getString()), this wouldn't need to happen. Please debug why there is a shift where the milestone suddently finds himself in the middle of a div instead of on a div boundary. Perhaps use some asserts to see if that's the case at every step and then see where the asserts fail. The assertion could be specific to the failing test and just be there for debugging. It could test that a milestone coordinate has to be after (or equal) a div's cend and before (or equal) to a div's cstart. This is not really relevant for the general case but it will allow the debugging of the failing test |
I've debugged the position tracking and found the root cause: The Problem: Milestones and div boundaries are processed in separate steps, but Step-by-step breakdown:
Debug output shows:
I've created debug scripts in the repo that trace this issue step-by-step with assertions. |
Co-authored-by: eroux <60868+eroux@users.noreply.github.com>
Summary
Successfully fixed the failing
new_format_milestonestest and documented the root cause.Root Cause Analysis
The
align_div_milestones_nl()function is necessary because of the sequential processing architecture:get_string()only corrects positions for annotations that already exist, so milestones don't get corrected for div marker removalsConcrete example:
Alternative Solutions Considered
Added POSITION_TRACKING_EXPLANATION.md documenting this for future reference.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.