Skip to content

fix(mcp): one code-file count and real repo summaries in the workspace views - #4216

Merged
swati510 merged 1 commit into
mainfrom
fix/overview-trust-counts
Oct 19, 2026
Merged

swati510 merged 1 commit into
mainfrom
fix/overview-trust-counts

Conversation

@RaghavChamadiya

@RaghavChamadiya RaghavChamadiya commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

What

  • One file count. With repo="all", the count for a repo used to differ from the count in that repo's own overview. Each repo row now states code_files from the same population as code_health.code_files in the single-repo overview. That population is every code file health read, scored or not, after the health exclude rules. total_files becomes total_code_files.
  • Real summaries. Each repo="all" row now has the overview essay's first sentence (up to 140 characters) instead of its heading, which was "Project Summary" for every repo.
  • list_repos stays current. When list_repos re-reads the workspace config, it applies the workspace state sync in memory. It then reports each repo's own state.json values without waiting for a CLI command to rewrite the config.

Why

The count for a repo used to include external package nodes, so one repo showed three different totals depending on where you looked: 6,622, 6,036 and 5,868 on a nine-package monorepo. The summary field never carried a sentence.

How

  • A new crud helper, count_health_files, counts the health population without loading the rows.
  • Before health has run, a repo row falls back to the graph's code-language files.
  • _lead_sentence skips headings, tables, lists, quotes and code fences before it takes the first sentence.

Verification

Before After
repo="all" size (chars) 1,384 1,760
Monorepo count: repo="all" / its overview 6,622 / 5,868 5,884 / 5,884
Python service: repo="all" / its overview 1,552 / 698 1,156 / 1,156
  • Tests are added for count agreement, lead-sentence extraction and the list_repos state sync.
  • pytest tests/unit/server tests/unit/workspace passes (7,601 tests).
  • ruff check . is clean.

…e views

repo="all" counted graph file nodes, external packages included, while the single-repo overview counted health's code files, so the same repo showed different totals; both now state code_files from one population. Each repo's summary is the overview essay's first sentence instead of its heading. list_repos applies the workspace state sync in memory when it re-reads the config, so it reports each repo's state.json values without a CLI run.
@swati510
swati510 merged commit f78b506 into main Oct 19, 2026
10 checks passed
@swati510
swati510 deleted the fix/overview-trust-counts branch October 19, 2026 13:37
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