Problem
gbrain lint aborts the entire pass with opts.title.toLowerCase is not a function when it hits a page whose frontmatter title is a purely numeric value that YAML parses as a number instead of a string.
companies/222.md:
opts.title.toLowerCase is not a function. (In 'opts.title.toLowerCase()', 'opts.title.toLowerCase' is undefined)
Because the crash is unguarded, lint stops early and never scans the rest of the tree — on a 209K-page brain it was silently aborting after a few thousand pages, so doctor's lint count and all downstream lint-fix automation were running on a fraction of the corpus.
Root cause
A page with frontmatter like:
---
type: company
title: 222
---
YAML parses title: 222 as the number 222, not the string "222". The lint code calls opts.title.toLowerCase() assuming it's always a string. Numbers (and missing titles → undefined) both throw.
Confirmed on 3 real pages in a production brain: titles 222, 8189165238, 1458 (the latter two are date-stamped note filenames that became numeric titles).
Fix
Coerce defensively before .toLowerCase():
const title = String(opts.title ?? '').toLowerCase();
Or normalize at frontmatter-parse time: always cast title to a string. A numeric or missing title should never crash a full-tree maintenance pass — at worst it's a lint finding (e.g. "title should be quoted"), not a hard abort.
Severity
Medium-high: silent. The pass exits 0 and prints partial results, so nothing signals that 95% of the brain went unscanned. Any brain with a single numeric-title page has been getting incomplete lint + doctor lint counts.
Environment
- gbrain 0.42.26.0
- 209,481-page brain; aborted early until the 3 numeric-title pages were manually quoted
Problem
gbrain lintaborts the entire pass withopts.title.toLowerCase is not a functionwhen it hits a page whose frontmattertitleis a purely numeric value that YAML parses as a number instead of a string.Because the crash is unguarded, lint stops early and never scans the rest of the tree — on a 209K-page brain it was silently aborting after a few thousand pages, so
doctor's lint count and all downstream lint-fix automation were running on a fraction of the corpus.Root cause
A page with frontmatter like:
YAML parses
title: 222as the number222, not the string"222". The lint code callsopts.title.toLowerCase()assuming it's always a string. Numbers (and missing titles →undefined) both throw.Confirmed on 3 real pages in a production brain: titles
222,8189165238,1458(the latter two are date-stamped note filenames that became numeric titles).Fix
Coerce defensively before
.toLowerCase():Or normalize at frontmatter-parse time: always cast
titleto a string. A numeric or missing title should never crash a full-tree maintenance pass — at worst it's a lint finding (e.g. "title should be quoted"), not a hard abort.Severity
Medium-high: silent. The pass exits 0 and prints partial results, so nothing signals that 95% of the brain went unscanned. Any brain with a single numeric-title page has been getting incomplete lint + doctor lint counts.
Environment