test(notes): prepare the pick with the app's offer and require it to be reused

The partial-transcript eval now offers chat, schedule, notes and screen as
voice_worker/brain.py does, sets those backends for the reply, and fails
when the intent judge made no pick or the pick lacks personalNotes, so it
cannot pass by re-routing the final text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-18 02:30:49 +09:00
parent 59a9277613
commit 59c3f33c2c

View File

@@ -47,11 +47,23 @@ def _run(mock_config, eval_db, eval_dialogue_memory, query, notes=None, partial=
from jarvis.reply.engine import prepare_intent
from voice_worker.brain import similar
assert similar(partial, query)
kw = {"intent_judge": True, "prepared_tools": prepare_intent(
mock_config, partial, eval_dialogue_memory, False, notes_available=True)}
# The same offer as the app (voice_worker/brain.py): chat, schedule, notes and screen.
prepared = prepare_intent(mock_config, partial, eval_dialogue_memory, True,
schedule_available=True, notes_available=True, screen_available=True)
print(f"\n notes [{JUDGE_MODEL}] prepared on {partial!r}: {prepared}")
assert prepared is not None, "the intent judge made no pick, so nothing would be reused"
assert "personalNotes" in prepared, prepared
kw = {"intent_judge": True, "prepared_tools": prepared}
turn_state.reset()
turn_state.set_user("100")
turn_state.set_notes(backend)
if partial is not None:
from test_chat_channels_tool import FakeChat
from test_schedule_tool import FakeSchedules
from test_screen_view_tool import FakeScreen
turn_state.set_chat(FakeChat())
turn_state.set_schedule(FakeSchedules())
turn_state.set_screen(FakeScreen())
try:
reply = run_reply_engine(db=eval_db, cfg=mock_config, tts=None, text=query,
dialogue_memory=eval_dialogue_memory, history=HistoryContext(),