Skip to content

[FP] graph_coverage 0% on markdown-only brains (code-edge metric structurally inapplicable) #530

@mayazbay

Description

@mayazbay

Summary

gbrain doctor's graph_coverage check reports Entity link coverage 0%, timeline 0% on brains that contain only markdown content (no code chunks). The metric is calibrated for Cathedral II code-edge coverage (code_edges_chunk and code_edges_symbol tables introduced in v0.21.0/v27), which is structurally 0% when SELECT COUNT(*) FROM content_chunks WHERE chunk_source = 'code' returns 0.

Reproduce

$ sudo -u postgres psql -d gbrain -c "SELECT COUNT(*) FROM content_chunks WHERE chunk_source = 'code';"
 count
-------
     0

$ sudo -u postgres psql -d gbrain -c "SELECT COUNT(*) FROM links;"
 count
-------
  6086    # real wikilink data, fully populated

$ gbrain doctor 2>&1 | grep graph_coverage
[WARN] graph_coverage: Entity link coverage 0%, timeline 0%. Run: gbrain link-extract && gbrain timeline-extract

Why this is a FP for markdown-only brains

  • Real wikilinks are populated correctly (6086 rows in links table, 1964 rows in timeline_entries)
  • gbrain extract all produces 0 entries because extract operates on code-edges (Cathedral II symbol-graph), not markdown frontmatter wikilinks
  • The doctor's hint Run: gbrain link-extract && gbrain timeline-extract references commands that no longer exist (renamed to gbrain extract in v0.22)
  • Brain owners cannot satisfy this check without indexing code (which they may not have)

Suggested fix

Skip or mark "n/a" when code_chunks_count = 0. Or split the metric into code_graph_coverage and markdown_graph_coverage, computing each only when relevant chunks exist.

Alternative: include markdown wikilinks in the metric numerator so a fully-linked markdown brain reports >0%.

Impact

  • Brain owners with markdown-only brains (notes/wiki/journals) cannot reach Health 100/100
  • Doctor's stale hint (gbrain link-extract) misleads troubleshooting
  • Adds noise to compliance/health automation that gates on doctor exit code

Environment

  • gbrain v0.22.16
  • Source: src/commands/doctor.ts graph_coverage check
  • Surfaced via Nous AGaaS substrate audit (markdown-wiki brain, 2438 pages, 100% embedded, 6086 real links — but graph_coverage: 0%)

Cross-reference

Related: this brain is a 100% markdown wiki (Garry's original LLM-Wiki use case). The check designed for Cathedral II code-graph extraction shouldn't gate health on markdown-only brains.

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