Section walker primitives for briefing-highlight.ts.
Extracted as a sibling leaf module so the public extractor surface stays
below the 600-line drift-guard cap (see
test/unit/source-file-size.test.js). The walkers are pure — every
function takes (markdown body, section-needle list, language) and returns
a structural fragment with no I/O or upward imports.
Three walker shapes are exported:
extractFirstSubsectionUnderSection — first ### … heading +
paragraph inside the first matched ## … block (used by the
Strategic-synthesis and Top-findings extractors).
extractFirstParagraphUnderSection — first prose paragraph
inside the matched ## … block, ignoring ### … sub-headings
(used by Reader-Briefing paragraph fallbacks and Strategic-paragraph
derivation).
extractFirstNumberedItemUnderSection — first 1. **Label**: … list item inside the matched ## … block (used by the
May-2026 Reader-Briefing priority-list style).
The stripTradecraftLabels helper is exported too — both this
module and briefing-highlight.ts need it to normalize sub-headings
before they reach the headline / description surface.
Description
Section walker primitives for briefing-highlight.ts. Extracted as a sibling leaf module so the public extractor surface stays below the 600-line drift-guard cap (see
test/unit/source-file-size.test.js). The walkers are pure — every function takes (markdown body, section-needle list, language) and returns a structural fragment with no I/O or upward imports.Three walker shapes are exported:
### …heading + paragraph inside the first matched## …block (used by the Strategic-synthesis and Top-findings extractors).## …block, ignoring### …sub-headings (used by Reader-Briefing paragraph fallbacks and Strategic-paragraph derivation).1. **Label**: …list item inside the matched## …block (used by the May-2026 Reader-Briefing priority-list style).The stripTradecraftLabels helper is exported too — both this module and
briefing-highlight.tsneed it to normalize sub-headings before they reach the headline / description surface.