feat(kb): ingest rechtsprechung corpus

This commit is contained in:
2026-09-15 15:27:28 +02:00
parent 1594aa9cbd
commit 5209539ba3
365 changed files with 33112 additions and 51 deletions
+13 -4
View File
@@ -67,17 +67,17 @@ def test_real_corpus_loads_and_matches_registry():
"""Integrationstest gegen die echte Wissensbasis (Gate inklusive)."""
entries = load_kb("wissensbasis", verify_registry=True)
ids = {e.id for e in entries}
# 601 kuratierte (lb/wk) + 614 WKO-KV + 59 RIS-Gesetze
assert len(entries) == 1274
# 601 kuratierte (lb/wk) + 614 WKO-KV + 59 RIS-Gesetze + 348 Rechtsprechungsquellen
assert len(entries) == 1622
assert "lb-atz-07" in ids and "wk-akt-01" in ids
assert "kv-kvt-001" in ids and "ris-url-01" in ids
assert "kv-kvt-001" in ids and "ris-url-01" in ids and "rj-rjs-001" in ids
atz = [e for e in entries if e.id == "lb-atz-07"][0]
assert atz.topic == "altersteilzeit"
assert any(s.title.startswith("Kernwerte") for s in atz.sections)
def test_new_id_spaces_and_html_source(tmp_path):
"""kv-/ris-IDs und html-only-Quellenangabe sind gültig; Unbekanntes nicht."""
"""kv-/ris-/rj-IDs und html-/text-Quellenangaben sind gültig; Unbekanntes nicht."""
kv = DOC_ATZ.replace("id: lb-min-01", "id: kv-kvt-001").replace(
'source:\n pdf: ".lexis360/Lexis360_test_atz.pdf"\n'
' text: ".lexis360/md/test_atz.md"',
@@ -96,6 +96,15 @@ def test_new_id_spaces_and_html_source(tmp_path):
p2.write_text(ris, encoding="utf-8")
assert load_entry(p2).id == "ris-url-01"
rj = DOC_ATZ.replace("id: lb-min-01", "id: rj-rjs-001").replace(
'source:\n pdf: ".lexis360/Lexis360_test_atz.pdf"\n'
' text: ".lexis360/md/test_atz.md"',
'source:\n text: ".rechtsprechung/originale/Test.md"',
)
p3 = tmp_path / "rj_doc.md"
p3.write_text(rj, encoding="utf-8")
assert load_entry(p3).id == "rj-rjs-001"
bad = DOC_ATZ.replace("id: lb-min-01", "id: xx-min-01")
p3 = tmp_path / "bad.md"
p3.write_text(bad, encoding="utf-8")