Skip to content

fix(pulse): normalize parentheticals containing dashes in headingKey (#2786) - #2790

Open
isihussain wants to merge 1 commit into
danielmiessler:mainfrom
isihussain:fix/pulse-health-parenthetical-dash
Open

isihussain wants to merge 1 commit into
danielmiessler:mainfrom
isihussain:fix/pulse-health-parenthetical-dash

Conversation

@isihussain

Copy link
Copy Markdown

Summary

Fixes #2786 where PulseHealth.ts audit permanently reports template sections as missing when the heading ends in a parenthetical that contains a dash or hyphen (such as ## Key Numbers (Sample Panel — 2026-01-01), ## Trends (Sample — Two Panels Compared), and ## Daily Metrics (Sample — Wearable/App Snapshot)).

Cause

In headingKey, stripping the dash suffix first (\s*[—–-].*$) truncated headings before the closing parenthesis (Key Numbers (Sample Panel), causing the subsequent parenthetical regex (\s*\(.*\)\s*$) to fail matching. As a result, the template heading normalized to key numbers (sample panel while the user heading normalized to key number, permanently flagging drift.

Solution

Strip the trailing parenthetical before the dash suffix and once more after it so that headings with parenthetical dates/hyphens normalize symmetrically while preserving current keys for headings like Foo (a) — bar.

Updated in both LifeOS/Tools/PulseHealth.ts and LifeOS/install/skills/LifeOS/Tools/PulseHealth.ts.

Signed-off-by: isihussain isihussain@users.noreply.github.com

…anielmiessler#2786)

PulseHealth sectionDrift was failing to match template headings that
end in a parenthetical containing a dash (e.g. 'Key Numbers (Sample Panel — 2026-01-01)').
Because the dash suffix was stripped before the parenthetical, the unclosed
parenthesis failed to match the trailing bracket pattern, causing template sections
to permanently report as missing against user files with plain headings.

Dropping the trailing parenthetical both before and after the dash strip ensures
correct normalization for both template sample dates and user sections.

Fixes danielmiessler#2786

Signed-off-by: isihussain <isihussain@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant