Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tests/unit/mcp/tools/test_pm_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from ouroboros.mcp.tools.pm_handler import (
_DATA_DIR,
PMInterviewHandler,
PM_UNCERTAINTY_GUIDANCE,
_check_completion,
_compute_deferred_diff,
_detect_action,
Expand Down Expand Up @@ -629,6 +630,26 @@ def test_uses_custom_data_dir(self, tmp_path: Path) -> None:
call_kwargs = mock_engine_cls.create.call_args
assert call_kwargs.kwargs["state_dir"] == tmp_path

@pytest.mark.asyncio
async def test_start_response_places_uncertainty_guidance_before_question(
self,
tmp_path: Path,
) -> None:
"""MCP start response must show PM uncertainty guidance before question text."""
engine = _make_engine_stub()
state = _make_state(interview_id="pm_guidance")
engine.ask_opening_and_start = AsyncMock(return_value=Result.ok(state))
engine.ask_next_question = AsyncMock(return_value=Result.ok("What should we build first?"))
engine.save_state = AsyncMock(return_value=Result.ok(tmp_path / "pm_guidance.json"))
handler = PMInterviewHandler(pm_engine=engine, data_dir=tmp_path)

result = await handler.handle({"initial_context": "Build a launch checklist"})

assert result.is_ok
text = result.value.text_content
assert PM_UNCERTAINTY_GUIDANCE in text
assert text.index(PM_UNCERTAINTY_GUIDANCE) < text.index("What should we build first?")


# ── Action auto-detection tests (AC 13) ───────────────────────

Expand Down