"""Regression guard: shipped code must not reference old project names. The FabledScryer -> Roundtable -> Steward renames repeatedly left stale package imports behind in the (then separate) plugins (e.g. `from fabledscryer.models...`), silently breaking every non-host_agent plugin. Now that plugins are folded in-tree and version with core, this test fails loudly if either legacy name reappears in the shipped Python / templates / plugin manifests. """ from __future__ import annotations from pathlib import Path import pytest _ROOT = Path(__file__).resolve().parent.parent _TREES = [_ROOT / "steward", _ROOT / "plugins"] _EXTENSIONS = {".py", ".yaml", ".yml", ".html", ".j2"} _FORBIDDEN = ("scryer", "roundtable") # case-insensitive; old project names def _shipped_files(): for tree in _TREES: for path in tree.rglob("*"): if path.suffix in _EXTENSIONS and "__pycache__" not in path.parts: yield path @pytest.mark.parametrize("name", _FORBIDDEN) def test_no_legacy_project_name(name): offenders = [ str(p.relative_to(_ROOT)) for p in _shipped_files() if name in p.read_text(encoding="utf-8", errors="ignore").lower() ] assert not offenders, f"legacy name {name!r} found in shipped code: {offenders}"