from pathlib import Path from gamemaster_copilot.config import Settings from gamemaster_copilot.schemas import ChatRequest from gamemaster_copilot.service import CopilotService def test_no_index_response_is_explicitly_ungrounded(tmp_path: Path) -> None: settings = Settings(index_dir=tmp_path / "missing-index", embedding_backend="hash", llm_provider="template") service = CopilotService(settings) response = service.chat( ChatRequest( message="Create a puzzle room based on light and shadow.", project_context="Dungeon crawler.", mode="level_design", retrieval_k=4, ) ) assert "No approved source context" in response.answer assert response.citations == [] assert response.retrieved_chunks == [] assert response.warnings