feat: complete catalog-driven preprocessing
Publish documentation / publish (push) Successful in 2m12s
Publish documentation / publish (push) Successful in 2m12s
This commit is contained in:
@@ -93,6 +93,39 @@ def test_v2_valid_materialized_corpus_is_validated_before_preprocessing(monkeypa
|
||||
assert calls[:2] == [("validate", tmp_path), ("vector", True)]
|
||||
|
||||
|
||||
def test_clear_removes_only_derived_paths_and_preserves_memory(monkeypatch, tmp_path):
|
||||
import tht.cli.preprocess_cmd as command
|
||||
|
||||
monkeypatch.setenv("THT_PROFILE", "server")
|
||||
config = _runtime_config(tmp_path)
|
||||
for path in (
|
||||
tmp_path / ".tht-dwh",
|
||||
tmp_path / ".tht-jobs",
|
||||
tmp_path / "corpus",
|
||||
tmp_path / "indexes" / "lsh",
|
||||
):
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
(path / "derived").write_text("generated", encoding="utf-8")
|
||||
physical = tmp_path / "artifacts" / "mschema" / "physical.yaml"
|
||||
physical.parent.mkdir(parents=True)
|
||||
physical.write_text("generated", encoding="utf-8")
|
||||
memory = tmp_path / "memory" / "registry.jsonl"
|
||||
memory.parent.mkdir()
|
||||
memory.write_text("durable", encoding="utf-8")
|
||||
|
||||
class Store:
|
||||
def clear_reference(self):
|
||||
return True
|
||||
|
||||
monkeypatch.setattr("tht.adapters.factory.build_vector_store", lambda *_args, **_kwargs: Store())
|
||||
counts = command.clear_from_config(config)
|
||||
|
||||
assert counts == {"referenceCollections": 1, "derivedPaths": 5}
|
||||
assert memory.read_text(encoding="utf-8") == "durable"
|
||||
assert not (tmp_path / ".tht-dwh").exists()
|
||||
assert not (tmp_path / "indexes" / "lsh").exists()
|
||||
|
||||
|
||||
def test_preprocess_evidence_json_is_pristine(monkeypatch, tmp_path):
|
||||
import tht.cli.preprocess_cmd as command
|
||||
|
||||
|
||||
Reference in New Issue
Block a user