You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In bin/tracker-tools.cjs, extractSection() extracts a named section from a markdown body using regex:
functionextractSection(body,headerPattern){constre=newRegExp(`^#{2,4}\s+(?:[^\n]*?${headerPattern}[^\n]*)\n([\s\S]*?)(?=^#{2,4}\s|$)`,'mi'// <-- BUG: 'm' flag makes $ match end-of-every-line);constmatch=body.match(re);returnmatch ? match[1].trim() : null;}
The 'm' flag in 'mi' causes $ in the lookahead (?=^#{2,4}\s|$) to match the end of every line. Since [\s\S]*? is lazy, it stops after the first character that satisfies $ (i.e., end of line 1). The section content captured is always a single line — stripping all remaining content from the section.
Impact
compile-report could not extract Activity, Status Summary, or other sections from result files — producing empty/partial report output
update-tracker could not extract the ## Tracker Updates section — so status_summary:, history_entry:, goal:, new_duplicate: directives were never found and no tracker changes were applied
Remove 'm', keep 'i', and change the anchor from ^ to (?:^|\n) so the header match still anchors to line starts:
functionextractSection(body,headerPattern){constre=newRegExp(`(?:^|\n)#{2,4}\s+(?:[^\n]*?${headerPattern}[^\n]*)\n([\s\S]*?)(?=\n#{2,4}\s|$)`,'i'// 'i' only — $ now means end-of-string; (?:^|\n) handles line starts);constmatch=body.match(re);returnmatch ? match[1].trim() : null;}
Root Cause Pattern
Both this bug and #5 share the same root cause: using the 'm' multiline flag with a $ anchor in a lookahead where the intent is end-of-string, not end-of-line. In multiline mode, $ matches after every newline, allowing lazy [\s\S]*? to stop after the first line.
Bug
In
bin/tracker-tools.cjs,extractSection()extracts a named section from a markdown body using regex:The
'm'flag in'mi'causes$in the lookahead(?=^#{2,4}\s|$)to match the end of every line. Since[\s\S]*?is lazy, it stops after the first character that satisfies$(i.e., end of line 1). The section content captured is always a single line — stripping all remaining content from the section.Impact
compile-reportcould not extract Activity, Status Summary, or other sections from result files — producing empty/partial report outputupdate-trackercould not extract the## Tracker Updatessection — sostatus_summary:,history_entry:,goal:,new_duplicate:directives were never found and no tracker changes were appliedsectionRebug), this meantupdate-trackerwas completely non-functional: it couldn't find the tracker section to update AND couldn't extract the updates to applyFix
Remove
'm', keep'i', and change the anchor from^to(?:^|\n)so the header match still anchors to line starts:Root Cause Pattern
Both this bug and #5 share the same root cause: using the
'm'multiline flag with a$anchor in a lookahead where the intent is end-of-string, not end-of-line. In multiline mode,$matches after every newline, allowing lazy[\s\S]*?to stop after the first line.Status
Fixed in session on 2026-05-07.