Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

test(wiki): pin the retrieval-first probe contract for smalltalk turns

rubenluetke10-beepaa2fc83dfefd
diff --git a/tests/unit/brain/test_ambient_knowledge_cost_guard.py b/tests/unit/brain/test_ambient_knowledge_cost_guard.py
index 8de99184af..18a66ec486 100644
--- a/tests/unit/brain/test_ambient_knowledge_cost_guard.py
+++ b/tests/unit/brain/test_ambient_knowledge_cost_guard.py
@@ -226,7 +226,7 @@ async def test_the_per_turn_wiki_block_keeps_its_char_cap() -> None:
# ---------------------------------------------------------------------------
-# 3. The widened gate still costs nothing where it always cost nothing
+# 3. Smalltalk and world knowledge probe strictly and inject nothing
# ---------------------------------------------------------------------------
@@ -241,12 +241,21 @@ async def test_the_per_turn_wiki_block_keeps_its_char_cap() -> None:
"What is the fastest animal on earth?",
],
)
-async def test_smalltalk_and_world_knowledge_never_retrieve(utterance: str) -> None:
+async def test_smalltalk_and_world_knowledge_never_inject(utterance: str) -> None:
+ # Retrieval-first (wiki_relevance module header): these turns now RUN the
+ # single-digit-millisecond local probe instead of refusing to look, and the
+ # defense against a wrong injection moved to the STRICT coverage bar. The
+ # invariant this section pins is unchanged where it matters: an unrelated
+ # vault page never reaches the prompt on a smalltalk or world-knowledge
+ # turn — the tallest-tower case stays uninjected because nothing retrieved
+ # covers the question, not because nobody looked.
search = SpyVaultSearch([FakeHit(title="Weekend", snippet="hiking", score=0.9)])
injector = WikiContextInjector(search=search, latency_budget_ms=500)
result = await injector.maybe_inject(user_text=utterance, system_prompt=BASE_PROMPT)
- assert should_consult_memory(utterance).consult is False
- assert search.queries == [], "no retrieval, no latency, no tokens"
- assert result == BASE_PROMPT
+ verdict = should_consult_memory(utterance)
+ assert verdict.consult is True
+ assert verdict.strict is True, "smalltalk gets the strict coverage bar"
+ assert search.queries, "retrieval-first: the local probe does run"
+ assert result == BASE_PROMPT, "an uncovering hit never reaches the prompt"
diff --git a/tests/unit/ui/web/test_managed_local_realtime_routes.py b/tests/unit/ui/web/test_managed_local_realtime_routes.py
index d6315bc51a..4dfccd6b39 100644
--- a/tests/unit/ui/web/test_managed_local_realtime_routes.py
+++ b/tests/unit/ui/web/test_managed_local_realtime_routes.py
@@ -125,6 +125,9 @@ def test_status_pairs_progress_with_failclosed_probe(
"pid": None,
"owned": False,
"stale": False,
+ # Boot forensics (crash-loop verdicts, 2026-08-10): a fresh status
+ # reports no boot in flight and a clean failure streak.
+ "boot": {"failed_streak": 0, "starting": False},
}