diff --git a/CHANGELOG.md b/CHANGELOG.md index 12980eb5..08cafbdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to vouch are documented here. Format follows ## [Unreleased] ### Fixed +- **`kb.session_transcript` handler test needs a KB** : `test_handler_returns_degraded_when_absent` now chdirs into a temp KB and points Claude/Codex search roots at empty dirs, so the handler can return the degraded payload instead of raising `KBNotFoundError`. - **`kb.search` excludes retracted claims and archived pages** (#581): `search_kb` now drops `ARCHIVED` / `SUPERSEDED` / `REDACTED` claims and `ARCHIVED` pages the same way `kb.context` already does, so lifecycle diff --git a/tests/test_session_transcript.py b/tests/test_session_transcript.py index 19c0a6d9..5af1a244 100644 --- a/tests/test_session_transcript.py +++ b/tests/test_session_transcript.py @@ -196,9 +196,17 @@ def test_handler_bad_agent_is_invalid_request() -> None: assert resp["error"]["code"] == "invalid_request" -def test_handler_returns_degraded_when_absent() -> None: +def test_handler_returns_degraded_when_absent( + store: KBStore, monkeypatch: pytest.MonkeyPatch +) -> None: from vouch.jsonl_server import handle_request + # handle_request discovers the KB via cwd; point both agent search roots + # at empty dirs so the locator misses and returns the degraded payload. + monkeypatch.chdir(store.root) + monkeypatch.setenv("VOUCH_CLAUDE_PROJECTS_DIR", str(store.kb_dir / "no-claude")) + monkeypatch.setenv("CODEX_HOME", str(store.kb_dir / "no-codex")) + resp = handle_request({ "id": "3", "method": "kb.session_transcript", "params": {"session_id": "11111111-1111-1111-1111-111111111111"},