KV/RIS-Erweiterung: 614 WKO-KV-Dokumente + 59 RIS-Gesetze (D9)
- Korpus 601 -> 1274 Layer-2-Eintraege: kv-kvt-001...614 (ein Cluster kollektivvertraege, Branche als Tag) und ris-<cluster-prefix>-nn auf der bestehenden Cluster-Map + 7 neue Cluster (zvr/avr/agg/lst/abo/ nso/kvt); LAW_MAP dokumentiert die 59 Gesetz-Zuordnungen. - kv/ris-Eintraege sind quellentreu generiert (D9) - Gesetze sind amtliche Werke, KV-Lohntabellen zahlenexakt; Tool-Output in tools/ (ingest_sources.py, build_registry.py, kb_common.py), eingefrorene ID-Kataloge tools/catalogs/*.json (nur Metadaten). - kb.json/INDEX.md regeneriert (1274 Eintraege, 76 Cluster); agent/kb.py: ID-Raeume kv|ris, source akzeptiert html-only. - Tests 41 -> 49 (Konverter, LAW_MAP-Abdeckung, neue ID-Raeume, Korpus-Integrationszahl).
This commit is contained in:
+31
-2
@@ -67,8 +67,37 @@ 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}
|
||||
assert len(entries) == 601
|
||||
# 601 kuratierte (lb/wk) + 614 WKO-KV + 59 RIS-Gesetze
|
||||
assert len(entries) == 1274
|
||||
assert "lb-atz-07" in ids and "wk-akt-01" in ids
|
||||
assert "kv-kvt-001" in ids and "ris-url-01" 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)
|
||||
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 = 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"',
|
||||
'source:\n html: ".firecrawl/wko-kv/docs/test.html"',
|
||||
)
|
||||
p = tmp_path / "kv_doc.md"
|
||||
p.write_text(kv, encoding="utf-8")
|
||||
assert load_entry(p).id == "kv-kvt-001"
|
||||
|
||||
ris = DOC_ATZ.replace("id: lb-min-01", "id: ris-url-01").replace(
|
||||
'source:\n pdf: ".lexis360/Lexis360_test_atz.pdf"\n'
|
||||
' text: ".lexis360/md/test_atz.md"',
|
||||
'source:\n text: ".ris/Test.md"',
|
||||
)
|
||||
p2 = tmp_path / "ris_doc.md"
|
||||
p2.write_text(ris, encoding="utf-8")
|
||||
assert load_entry(p2).id == "ris-url-01"
|
||||
|
||||
bad = DOC_ATZ.replace("id: lb-min-01", "id: xx-min-01")
|
||||
p3 = tmp_path / "bad.md"
|
||||
p3.write_text(bad, encoding="utf-8")
|
||||
with pytest.raises(KbValidationError, match="invalid id"):
|
||||
load_entry(p3)
|
||||
Reference in New Issue
Block a user