FUZZ-008
- Minimal template / frontmatter
\xEF\xBB\xBF\xEF\xBB\xBF--- required_variables: - name --- Hello {{name}}- Input
(none)- Expected
- Top-level boundary: raw frontmatter text and --- delimiters must never leak into rendered body output. This is precisely the BOM-frontmatter-leak class cd54074 targeted for the single-BOM case.
- Observed
- Exit 0. Rendered stdout is '\uFEFF---~required_variables:~ - name~---~Hello World' -- one BOM plus the entire raw frontmatter header leaks into the body. Root cause: parse_template_document calls strip_prefix('\u{feff}') exactly ONCE, so a second BOM defeats opening_delimiter_len and split_frontmatter returns None, treating the whole document as body. Single-BOM control renders correctly as 'Hello World'.
- Requirement / ADR
- Not a regression -- the pre-fix baseline leaks too (with both BOMs). But it means the BOM-frontmatter-leak defect CLASS is only closed for exactly one leading BOM, not closed in general.
- Requirement / ADR follow-up
- Strip all leading BOMs (loop or trim_start_matches) instead of exactly one, or fail closed on a repeated BOM prefix.
- Root cause
- parse_template_document calls strip_prefix('\u{feff}') exactly ONCE, so a second BOM defeats opening_delimiter_len and split_frontmatter returns None, treating the whole document as body. Single-BOM control renders correctly as 'Hello World'.
- Recommended fix
- Strip all leading BOMs (loop or trim_start_matches) instead of exactly one, or fail closed on a repeated BOM prefix.