from __future__ import annotations import sys import unittest from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parent)) import agent_semantic_pack_builder as builder class AgentSemanticPackBuilderTests(unittest.TestCase): def test_build_source_catalog_finds_reusable_meta_and_selected_object_tags(self) -> None: catalog = builder.build_source_catalog() summary = catalog["summary"] self.assertGreater(summary["truth_harness_steps_total"], 0) self.assertIn("meta_scope", summary["reusable_truth_harness_tags"]) self.assertIn("selected_object_supplier", summary["reusable_truth_harness_tags"]) self.assertIn("counterparty_documents", summary["reusable_truth_harness_tags"]) def test_build_recipe_spec_creates_mixed_phase7_pack(self) -> None: catalog = builder.build_source_catalog() spec = builder.build_recipe_spec(catalog, "turnaround_11_phase7_meta_domain_mix") self.assertEqual(spec["scenario_id"], "address_truth_harness_phase7_meta_domain_mix") self.assertGreaterEqual(len(spec["steps"]), 10) all_tags = {tag for step in spec["steps"] for tag in step.get("semantic_tags", [])} self.assertIn("meta_scope", all_tags) self.assertIn("meta_capability", all_tags) self.assertIn("selected_object_supplier", all_tags) self.assertIn("same_date_restore", all_tags) self.assertIn("settlements_receivables", all_tags) if __name__ == "__main__": unittest.main()