cmdMilestoneComplete previously appended new milestone entries at the end of MILESTONES.md. Over successive milestones this produced chronological order (oldest first), which is counterintuitive — users expect the most recent milestone at the top. This fix detects the file header (h1-h3) and inserts the new entry immediately after it, pushing older entries down. Files without a recognizable header get the entry prepended. New files still get a default '# Milestones' header. Adds 2 tests: single insertion ordering assertion and three-sequential- completions verification (v1.2 < v1.1 < v1.0 in file order). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
18 KiB
18 KiB