Skip to content

fix(lint): drop missing-page findings for pages that already exist#565

Merged
nashsu merged 1 commit into
nashsu:mainfrom
chuenchen309:fix/537-missing-page-existing-entity
Jul 15, 2026
Merged

fix(lint): drop missing-page findings for pages that already exist#565
nashsu merged 1 commit into
nashsu:mainfrom
chuenchen309:fix/537-missing-page-existing-entity

Conversation

@chuenchen309

Copy link
Copy Markdown
Contributor

Why

runSemanticLint passed the LLM's missing-page findings straight to the Review tab without validating them against the actual page set. The LLM doesn't reliably cross-reference the file list, so it flags entities whose page already exists — especially in non-English wikis, where its free-form titles (维特根斯坦, 阿德勒实体页缺失, 缺失页面:X) don't match a fixed prefix. The reporter saw 30 of 41 missing-page findings as false positives, drowning out the 11 genuine ones.

On the reported root-cause guesses in #537: the scan already covers entities/ (every wiki/*.md except log.md is summarized), so it isn't a "only scans concepts/" problem — the findings come from the LLM and simply weren't filtered against existing pages.

What

While summarizing pages, collect the set of existing page names (basename + frontmatter title, NFKC-normalized). Drop a missing-page finding when a known page name matches its title exactly or appears within it.

Fixes #537

Review notes

  • Match strategy / over-match guard: exact match handles bare names; a substring fallback (guarded to names ≥ 2 chars) handles free-form/suffixed titles like 阿德勒实体页缺失. The substring pass could in principle drop a genuine missing-page whose title happens to contain a short existing page name. I chose the more permissive version because the reported problem is over-reporting — but if you'd prefer a stricter rule (exact-match only, or a higher length threshold), I'm glad to adjust.
  • NFKC normalization folds full-width/compatibility forms so CJK/full-width variants compare equal.
  • Only missing-page findings are filtered; other semantic types are untouched.

Tests

Added a regression test in lint.test.ts: an entity page exists but the (mocked) LLM reports it as missing-page with free-form Chinese titles — asserts the false positives are dropped and a genuinely-missing entity is kept. Fails before the change, passes after. Full unit suite: 1609 passed.


Disclosure: this change was produced by an AI agent (Claude Code) — root-cause analysis, fix, and regression test included. It's covered by the new test and the full unit suite passes; flagging for maintainer review.

runSemanticLint passed the LLM's `missing-page` findings straight through
without checking them against the actual page set. The LLM does not reliably
cross-reference the file list, so it flags entities whose page already
exists — especially in non-English wikis, where its free-form titles
("维特根斯坦", "阿德勒实体页缺失") don't match a fixed prefix. This flooded the
Review tab with false positives (reporter saw 30 of 41).

Collect existing page names (basename + frontmatter title, NFKC-normalized)
and drop a `missing-page` finding when a known page name matches exactly or
appears within the finding title.

Fixes nashsu#537
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.

【Bug】lint 的 missing-page 检测误报:entities/ 目录下的实体页已存在但报告未建立

2 participants