from jarvis_gateway.registry import get_module_registry


def test_registry_contains_five_modules() -> None:
    registry = get_module_registry()
    assert len(registry) == 5
    assert {item.module_id for item in registry} == {"finance", "health", "autoshorts", "family", "system"}


def test_actions_disabled_for_all_modules() -> None:
    assert all(item.actions_enabled is False for item in get_module_registry())


def test_registry_has_no_hardcoded_private_hosts_or_runtime_paths() -> None:
    serialized = "\n".join(item.model_dump_json() for item in get_module_registry())
    forbidden = ["100.", "/home/agent", "tailscale", "jarvis_runtime", "health" + "_data.db", "finance" + ".sqlite"]
    for item in forbidden:
        assert item not in serialized


def test_health_detail_links_are_blocked_by_default() -> None:
    health = next(item for item in get_module_registry() if item.module_id == "health")
    assert health.actions_enabled is False
    assert "detail links blocked" in " ".join(health.notes).lower()
