operationalize_design.py: _stamp_project_header inserts mid-bullet when a header field wraps onto a second physical line nf-d5qv ← Beads

closed priority 2 task unassigned

Twinned from https://github.com/cfsh/ninefold/issues/951 by tools/beads/import_github.py's reconcile pass.

Found while running \--apply\ for design 008 T4 (#939)'s 006a backfill.

\_stamp_project_header\ (\design_docs/tools/operationalize_design.py:145\) finds where to insert \- **Project:** <url>\ by matching \_REFS_LINE_RE\ against each line and inserting right after the first physical line that matches. That's correct when a doc's \- **Refs:**\ bullet is one line, but 006a's wraps onto a second physical line (continuation lines are indented, no leading \-\):

\\\` - Refs: design doc 006 · issues #733 · #768 · #676 · #677 · #761 · #771 · PRs #810 · #827 · #830 · #838 · #874 · \notes/graphite.md\ \\\`

\--apply\ inserted the \**Project:**\ line between those two physical lines, splitting the \Refs\ bullet's wrap and breaking the markdown list structure. Caught and hand-fixed in #942's follow-up PR for 006a; \_locate_task_table\/the parser don't care about header formatting so this doesn't block \--apply\ itself, but it silently produces a broken doc header on any doc whose \- **Refs:**\ (or whichever header bullet \_stamp_project_header\ falls back to) wraps.

Fix: track the *last line of the bullet* (keep advancing past continuation lines — ones that don't start a new \- **\ bullet — before inserting) rather than the first line that matches.

Unclaimed — filing per CLAUDE.md's "strategic uplifts: file them, don't claim them."

Dependencies

None.

Comments

No comments.

Add a comment