pub fn fold_log(input: &str) -> StringExpand description
Folds runs of templated lines in input into a header + a JSON array of distinct templates +
one compact row (template_id then captured values) per original line. Returns input
unchanged when folding cannot help (too few lines, no shared templates, or a line contains the
placeholder char). Never panics.