wiki notes with unquoted colon in title: produce invalid YAML frontmatter (8 files found) #90

Open
opened 2026-07-27 12:29:29 +00:00 by mathias · 0 comments
Owner

Found while repairing #86's stacked-frontmatter bug. Independent of stacking — these files already had a single frontmatter block, but their title: (or other scalar) line contains an unescaped : and isn't quoted, so yaml.safe_load chokes with "mapping values are not allowed here".

Example (wiki/homelab/failures/dispatch-headless-bash-denied-git-via-gitea-mcp.md):

title: Headless dispatch runs: Bash is denied — use gitea MCP for all git ops, CI is the only test signal

8 files repo-wide currently affected (ran a YAML-parse pass over every wiki/**/*.md frontmatter block in mathias/brain):

  • wiki/homelab/failures/dispatch-headless-bash-denied-git-via-gitea-mcp.md
  • wiki/homelab/failures/dispatch-headless-go-race-needs-gcc-cgo.md
  • wiki/homelab/hypotheses/ecosystem-consistency-audit-2026-07.md
  • wiki/hyperguild/decisions/retro-skill-semantic-read-after-write-staleness-constraint.md
  • (4 more — re-run the scan below to get the current list, some of these were written after this issue was filed)

Root cause

buildFrontmatter (ingestion internal/pipeline/build.go) already quotes title/aliases via yamlScalar() for LLM-extracted pages. These 8 are hand-written or promoted notes where the frontmatter was authored directly (not through BuildPages), so nothing enforced quoting.

Suggested scope

  • Add a frontmatter-quoting lint check (or auto-fix) that brain-gardener (or a similar CI-time pass) can run — same idea as its existing fix(malformed)/fix(stale-date) classes.
  • Repair the 8 existing files.

Repro / verification script

import yaml, glob
bad = []
for f in glob.glob('wiki/**/*.md', recursive=True):
    with open(f, encoding='utf-8') as fh:
        text = fh.read()
    lines = text.split('\n')
    if not lines or lines[0].strip() != '---':
        continue
    i = 1
    while i < len(lines) and lines[i].strip() != '---':
        i += 1
    try:
        yaml.safe_load('\n'.join(lines[1:i]))
    except Exception:
        bad.append(f)
print(bad)
Found while repairing #86's stacked-frontmatter bug. Independent of stacking — these files already had a single frontmatter block, but their `title:` (or other scalar) line contains an unescaped `:` and isn't quoted, so `yaml.safe_load` chokes with "mapping values are not allowed here". Example (`wiki/homelab/failures/dispatch-headless-bash-denied-git-via-gitea-mcp.md`): ```yaml title: Headless dispatch runs: Bash is denied — use gitea MCP for all git ops, CI is the only test signal ``` 8 files repo-wide currently affected (ran a YAML-parse pass over every `wiki/**/*.md` frontmatter block in `mathias/brain`): - wiki/homelab/failures/dispatch-headless-bash-denied-git-via-gitea-mcp.md - wiki/homelab/failures/dispatch-headless-go-race-needs-gcc-cgo.md - wiki/homelab/hypotheses/ecosystem-consistency-audit-2026-07.md - wiki/hyperguild/decisions/retro-skill-semantic-read-after-write-staleness-constraint.md - (4 more — re-run the scan below to get the current list, some of these were written after this issue was filed) ## Root cause `buildFrontmatter` (ingestion `internal/pipeline/build.go`) already quotes title/aliases via `yamlScalar()` for LLM-extracted pages. These 8 are hand-written or promoted notes where the frontmatter was authored directly (not through `BuildPages`), so nothing enforced quoting. ## Suggested scope - Add a frontmatter-quoting lint check (or auto-fix) that brain-gardener (or a similar CI-time pass) can run — same idea as its existing `fix(malformed)`/`fix(stale-date)` classes. - Repair the 8 existing files. ## Repro / verification script ```python import yaml, glob bad = [] for f in glob.glob('wiki/**/*.md', recursive=True): with open(f, encoding='utf-8') as fh: text = fh.read() lines = text.split('\n') if not lines or lines[0].strip() != '---': continue i = 1 while i < len(lines) and lines[i].strip() != '---': i += 1 try: yaml.safe_load('\n'.join(lines[1:i])) except Exception: bad.append(f) print(bad) ```
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/hyperguild#90