Files
FabledSteward/tests/test_no_legacy_names.py
T
bvandeusenandClaude Opus 5.5 1878f91293
CI / lint (push) Successful in 2s
CI / integration (push) Successful in 1m27s
CI / unit (push) Successful in 1m37s
CI / publish (push) Successful in 15s
chore: the systemd unit runs Steward, not FabledNetMon
systemd/fablednetmon.service still carried the project's first name in
its user, paths, command and config location, so it couldn't start
Steward as written. It is now systemd/steward.service: user steward,
/opt/steward, `steward --config /etc/steward/config.yaml`, with a note
that /data must be writable (secret.key, safety backups) and why
Restart=on-failure brings Steward back after a web UI restore (exit 3).

The legacy-name guard now reads service units too, and forbids
"netmon" beside "scryer" and "roundtable". The 2026-04 rebrand plan and
spec under docs/superpowers keep the old names: they record the rename.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:35:41 -04:00

41 lines
1.5 KiB
Python

"""Regression guard: shipped code must not reference old project names.
The FabledNetMon -> FabledScryer -> Roundtable -> Steward renames repeatedly left
stale names behind: package imports in the (then separate) plugins (e.g. `from
fabledscryer.models...`), silently breaking every non-host_agent plugin, and a
systemd unit still running `fablednetmon` as user `fablednetmon`. This test fails
loudly if a legacy name reappears in the shipped Python, templates, plugin
manifests or service units.
"""
from __future__ import annotations
from pathlib import Path
import pytest
_ROOT = Path(__file__).resolve().parent.parent
_TREES = [_ROOT / "steward", _ROOT / "plugins", _ROOT / "systemd"]
_EXTENSIONS = {".py", ".yaml", ".yml", ".html", ".j2", ".service"}
_FORBIDDEN = ("scryer", "roundtable", "netmon") # 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
def test_the_guard_reads_the_service_units():
assert any(p.suffix == ".service" for p in _shipped_files())
@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}"