Skip to content

fix: prefer Markdown frontmatter titles - #770

Draft
goxl-wtf wants to merge 1 commit into
tobi:mainfrom
goxl-wtf:codex/frontmatter-title
Draft

fix: prefer Markdown frontmatter titles#770
goxl-wtf wants to merge 1 commit into
tobi:mainfrom
goxl-wtf:codex/frontmatter-title

Conversation

@goxl-wtf

Copy link
Copy Markdown

Summary

  • prefer a non-empty string title from leading YAML frontmatter
  • keep heading and filename fallbacks, excluding the metadata block from heading detection
  • support YAML --- and ... end markers, BOM/CRLF, malformed metadata fallback, and single-line title normalization
  • version title extraction in the embedding fingerprint so corrected titles are embedded on the next qmd embed
  • keep legacy empty-fingerprint vectors pending instead of bulk-adopting heterogeneous documents from one matching sample

Why this is separate from #551

#551 combines frontmatter title extraction with frontmatter-as-a-separate-chunk behavior and a new parser dependency. This PR is intentionally title-only: it uses the existing pinned yaml dependency and does not change chunk content, boundaries, or constants.

A downstream 62-case retrieval evaluation did not support changing frontmatter chunking: the stripped projection changed MRR by -0.0385 with paired p=0.810602. Keeping the concerns separate therefore makes the title correction independently reviewable and avoids bundling an unproven chunking change.

Migration behavior

Existing embeddings have old title semantics. The fingerprint bump marks named legacy vectors pending. Empty pre-fingerprint rows also remain pending because one matching sample cannot prove that documents with different frontmatter titles are current. qmd doctor reports the pending documents and the next qmd embed refreshes them.

Tests

  • full Node unit suite
  • full Bun unit suite: 890 passed, 42 skipped
  • Node and Bun store suites: 232 passed each
  • TypeScript typecheck
  • production build
  • git diff --check

Use a non-empty string title from leading YAML frontmatter before the first heading or filename fallback. Keep title output single-line and ignore metadata when falling back to a body heading.

Version title extraction in the embedding fingerprint so vector metadata is refreshed. Legacy empty fingerprints remain pending because one matching sample cannot safely validate documents with heterogeneous title semantics.

Tests: Node and Bun unit suites, store suites, typecheck, build, diff-check
@PowderAddicts

PowderAddicts commented Jul 14, 2026 via email

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants