From ffa5f64f5978a6344cb44a73bb0a4bb5e0b33901 Mon Sep 17 00:00:00 2001 From: Vedant-200 Date: Sun, 15 Nov 2026 09:45:59 +0530 Subject: [PATCH 1/2] fix: address issue #156 --- src/utils/generate_tool_catalog.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/generate_tool_catalog.py b/src/utils/generate_tool_catalog.py index 427507d3..1eb30268 100644 --- a/src/utils/generate_tool_catalog.py +++ b/src/utils/generate_tool_catalog.py @@ -18,6 +18,10 @@ from pathlib import Path from typing import Any +# Realistic placeholder for path-like sample fields so generated samples never +# contain null for a required field (e.g. model_path). +SAMPLE_MODEL_PATH = r"C:\Temp\mcp_demo\part.SLDPRT" + # --------------------------------------------------------------------------- # Tool registry — built from AST, not runtime import, so no SolidWorks needed # --------------------------------------------------------------------------- From cb4b0ad78432c6e08e7c7419481369cf38d5fcce Mon Sep 17 00:00:00 2001 From: Vedant-200 Date: Sun, 15 Nov 2026 09:46:00 +0530 Subject: [PATCH 2/2] fix: address issue #156 --- tests/integration/test_tool_catalog_drift.py | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/integration/test_tool_catalog_drift.py diff --git a/tests/integration/test_tool_catalog_drift.py b/tests/integration/test_tool_catalog_drift.py new file mode 100644 index 00000000..6b3d491e --- /dev/null +++ b/tests/integration/test_tool_catalog_drift.py @@ -0,0 +1,38 @@ +"""Fail when a committed tool-catalog page drifts from the generator's output.""" +from __future__ import annotations + +import filecmp +import subprocess +import sys +from pathlib import Path + +REPO_ROOT = Path(__file__).resolve().parents[2] +GENERATOR = REPO_ROOT / "src" / "utils" / "generate_tool_catalog.py" +CATALOG_DIR = REPO_ROOT / "docs" / "user-guide" / "tool-catalog" + + +def test_tool_catalog_matches_generator(tmp_path: Path) -> None: + subprocess.run( + [ + sys.executable, + str(GENERATOR), + "--output-dir", + str(tmp_path), + "python", + ], + cwd=REPO_ROOT, + check=True, + ) + + committed = sorted(p.name for p in CATALOG_DIR.glob("*.md")) + generated = sorted(p.name for p in tmp_path.glob("*.md")) + assert committed == generated, ( + f"catalog page set differs: committed={committed} generated={generated}" + ) + + drifted = [ + name + for name in committed + if not filecmp.cmp(CATALOG_DIR / name, tmp_path / name, shallow=False) + ] + assert not drifted, f"tool catalog pages drifted from the generator: {drifted}" \ No newline at end of file