Skip to content

doctor frontmatter walker doesn't exclude node_modules — false 800+ MISSING_OPEN warnings #799

@metaWuming

Description

@metaWuming

Summary

gbrain doctor reports frontmatter_integrity warnings for .md files
inside node_modules/, but gbrain sync correctly excludes them. The two
walkers should agree on what counts as "this source's content."

Reproduction

Register any code source pointing at a JS/TS repo with node_modules/:

gbrain sources add my-repo --path /path/to/repo --federated
gbrain doctor

In a real example with three federated code sources:

Source path Total .md Excluding node_modules doctor reported
checktix 173 2 81
tixtrack-pro 720 14 360
activa-ticketing 1623 34 428

Also: page_count = 0 for all three sources after last_sync, so sync
never indexed the content. The 869 doctor warnings are entirely about
files that sync deliberately skipped.

Expected

doctor's frontmatter walker should respect the same exclusion rules as
the sync walker (at minimum: node_modules/, .git/, dist/, build/,
plus .gitignore). Otherwise the warning count is meaningless on any
JS/TS project and creates pressure to "fix" third-party packages.

Actual

[WARN] frontmatter_integrity: 869 frontmatter issue(s) across 3 source(s).
gstack-code-pace-d9790bfa-acf3fd: 81 (MISSING_OPEN=81);
gstack-code-pro-5950a2b9-181902: 360 (MISSING_OPEN=360);
gstack-code-ting-e1521a71-691fc4: 428 (MISSING_OPEN=428).
Fix: gbrain frontmatter validate <source-path> --fix

The suggested fix (gbrain frontmatter generate --fix) would write
frontmatter into vendored third-party .md files. Those would be
overwritten on the next npm install, leaving stale .bak siblings.

Environment

  • gbrain v0.31.1.1-fixwave (commit ff53a4c)
  • Engine: pglite
  • Bun 1.3.13, macOS 26.3 (Darwin 25.3.0)
  • Brain: 226 pages, schema v45

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions