Repository navigation
fix(pulse): normalize parentheticals containing dashes in headingKey (#2786) - #2790
Open
isihussain wants to merge 1 commit into
Open
isihussain wants to merge 1 commit into
isihussain wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2786 where
PulseHealth.ts auditpermanently 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 tokey numbers (sample panelwhile the user heading normalized tokey 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.tsandLifeOS/install/skills/LifeOS/Tools/PulseHealth.ts.Signed-off-by: isihussain isihussain@users.noreply.github.com