teleo-infrastructure/tests/test_hermes_leoclean_skill_surfaces.py
twentyOne2x 1703232f24
Some checks are pending
CI / lint-and-test (push) Waiting to run
Add leoclean KB proposal review packets (#60)
2026-07-09 02:24:07 +02:00

44 lines
2 KiB
Python

from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
SKILL_ROOT = ROOT / "hermes-agent" / "leoclean-skills"
def test_gcp_kb_skill_uses_cloudsql_bridge_not_vps_docker() -> None:
text = (SKILL_ROOT / "gcp" / "teleo-kb-bridge" / "SKILL.md").read_text()
assert "Cloud SQL" in text
assert "answer from the Cloud SQL KB after a bounded read" in text
assert "Do not browse the public web just because the KB has evidence gaps" in text
assert "/home/teleo/.hermes/profiles/leoclean/bin/teleo-kb" in text
assert "docker exec" not in text
assert "teleo-pg" not in text
assert "on the VPS" not in text
def test_vps_kb_skill_keeps_vps_scope_explicit() -> None:
text = (SKILL_ROOT / "vps" / "teleo-kb-bridge" / "SKILL.md").read_text()
squashed = " ".join(text.split())
assert "VPS production leoclean" in text
assert "Cloud SQL" not in text
assert "/home/teleo/.hermes/profiles/leoclean/bin/teleo-kb" in text
assert "prefer the bridge over raw database access" in text
assert "Claim / Body / Concept Map Loop" in text
assert "Status: applied | pending | missing | partially applied" in text
assert "Do not call an approved proposal \"implemented\"" in text
assert "needs reviewer/operator apply tooling rather than inviting ad hoc SQL from chat" in squashed
assert "Never end a normal Telegram answer by offering to run direct `INSERT`, `UPDATE`" in text
assert "Next admin-panel action" in text
assert "draft or refresh the admin review packet" in squashed
def test_vps_live_telegram_skill_uses_systemd_for_gateway_liveness() -> None:
text = (SKILL_ROOT / "vps" / "live-leo-telegram" / "SKILL.md").read_text()
assert "systemctl is-active leoclean-gateway.service" in text
assert "systemctl show leoclean-gateway.service" in text
assert "hermes -p leoclean gateway run" in text
assert "Do not use `hermes -p leoclean gateway status` as authoritative" in text
assert "If you are currently replying in Telegram" in text