feat(F-12): wiki-compile — grounded concept pages over RAG substrate #2

Merged
user2595 merged 7 commits from feat/F-12-wiki-compile into main 2026-06-14 05:58:25 +00:00
2 changed files with 18 additions and 0 deletions
Showing only changes of commit 60e40f6f36 - Show all commits

View File

@@ -228,6 +228,10 @@ def _parse_claims(markdown: str) -> list[Claim]:
text = match.group("text").strip()
bibkey = match.group("bibkey").strip()
locator = (match.group("locator") or "").strip()
# Skip URL-shaped bibkeys ([text](https://...)) and multi-word bibkeys
# (real BibKeys never contain spaces or start with "http")
if " " in bibkey or bibkey.startswith("http"):
continue
if text and bibkey:
claims.append(Claim(text=text, bibkey=bibkey, locator=locator))
return claims

View File

@@ -121,6 +121,20 @@ def test_parse_claims_multiple() -> None:
assert len(claims) == 2
def test_parse_claims_ignores_markdown_links() -> None:
"""Markdown hyperlinks like [text](https://example.com) are NOT parsed as claims."""
md = "See the [related work](https://example.com) for details."
claims = _parse_claims(md)
assert claims == []
def test_parse_claims_ignores_multi_word_bibkey() -> None:
"""Multi-word 'bibkeys' (spaces inside) are not treated as real citations."""
md = "Some text [not a bibkey here] and more."
claims = _parse_claims(md)
assert claims == []
# ---------------------------------------------------------------------------
# _run_grounding_guard
# ---------------------------------------------------------------------------