feat: personal notes, each person's standing instructions for how Jarvis answers them

A personalNotes tool (add, list, delete the asker's own notes) offered only
with a notes backend. The app keeps the notes in config/notes.json and sends
the asker's with every voice, chat and task reply; the reply engine puts them
in a <person_notes> fence as that person's preferences, which never permit an
action or a tool. The worker's schedule bridge becomes a shared app bridge
for schedule_action and note_action. A 사람별 지침 screen edits and deletes
any note; features.notes turns the tool and the notes off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-14 17:10:53 +09:00
parent e4b6327cf9
commit a5bd25b86f
32 changed files with 901 additions and 91 deletions

View File

@@ -24,6 +24,7 @@ Every distinct LLM call in Jarvis, what feeds it, what consumes it, and how it i
- Time + location context (re-injected each turn)
- **v2 chat channel tool**: when the voice worker's brain sets a chat backend (`turn_state.set_chat`), `chatChannels` is added to the turn's tools after routing (like `setBroadcast`) and its read/search results enter the loop inside an UNTRUSTED CHAT MESSAGES fence; without a backend it is not in the catalogue at all. Eval: `evals/test_chat_channels_tool.py`.
- **v2 schedule tool and scheduled tasks**: when the voice worker's brain sets a schedule backend (`turn_state.set_schedule`, every voice and chat reply), `schedule` is in the catalogue for the router (#7) and `prepare_intent()` (not force-offered every turn); without a backend it is not in the catalogue at all ([spec](src/jarvis/tools/builtin/schedule.spec.md)). A scheduled `task` the app fires is one more run of this loop (`reply` `via: "task"`, at the task's time, in the worker's chat lane, waiting for LLM switches like any reply): the asker's history scope, a fresh short-term memory, no prepared pick, no chat or schedule backend, `mcps={}` and `disabled_tools` widened to everything but `TASK_TOOLS` (`getWeather`, `webSearch`, `fetchWebPage`, `fetchMeals`, `toolSearchTool`), so the router, planner and loop see only those. The app waits at most 300 s for its answer and delivers it (`app/src/admin.spec.md`, "Schedules"). Eval: `evals/test_schedule_tool.py`.
- **v2 personal notes**: the app sends the asker's standing instructions with every voice, chat and task reply; `run_reply_engine(person_notes=...)` adds them to the system message (after the warm profile, before the history block) inside a `<person_notes>` fence, labelled as that person's own answer preferences that never permit an action or a tool. Only the asker's notes, at most 20 of 300 characters. The `personalNotes` tool (add, list, delete) is in the catalogue only with a notes backend (`turn_state.set_notes`, every voice and chat reply; not tasks), also for `prepare_intent()`. No extra LLM call ([spec](src/jarvis/tools/builtin/personal_notes.spec.md)). Eval: `evals/test_personal_notes.py`.
- Tool schema: native via `generate_tools_json_schema()` ([src/jarvis/tools/registry.py](src/jarvis/tools/registry.py)) or text fallback via `_text_tool_call_guidance()` ([engine.py:68](src/jarvis/reply/engine.py:68))
- Tool results from prior turns (raw or digested — see #5)
- **Output**: OpenAI-style `{content, tool_calls, thinking}`. Consumed by the tool orchestrator and TTS pipeline. Natural-language content is delivered immediately; no post-turn evaluator runs. Spoken-answer length: the persona (`system_prompt.py`) and `voice_style` (`prompts/system.py`) both constrain the reply to a SINGLE sentence — any dry aside must fold into that one sentence as a trailing clause, never a second sentence. This keeps TTS latency down (synth time scales with text length) and matches the `agents/llm.md` operator instruction.

View File

@@ -7,7 +7,8 @@
- 1 예약 알림과 정기 작업: 구현(2026-11-14). 스펙은 [schedule.spec.md](../../src/jarvis/tools/builtin/schedule.spec.md)(두뇌 도구), [admin.spec.md](../../app/src/admin.spec.md) "Schedules"(저장·시각·전달·예약 화면), [voice_worker.spec.md](../../src/voice_worker/voice_worker.spec.md) "Schedules". 음성으로 맡긴 사람이 음성 채널에 없을 때 보낼 곳은 사람마다 고르지 않고 관리 앱에서 채팅 채널 하나를 정합니다. 정기 작업이 쓸 수 있는 도구에 "수집 결과 읽기"는 아직 없습니다(두뇌가 수집 결과를 읽는 도구가 없음, 제안 2 때 함께 봄). 평가 `evals/test_schedule_tool.py`를 이 서버의 qwen3:8b(실제 모델과 같은 계열)로 v2 설정(짧은 지시문, 의도 판단, 한국어 답)에서 세 번: "5분 타이머"(전에는 도구 없이 "설정했습니다"라고만 답함), "내일 7시 회의 알림", "예약 목록"은 9번 모두 통과했고 알림 문구도 한국어였습니다. "평일마다 아침 9시에 서울 날씨"는 3번 중 1번만 작업·평일로 맞게 예약했고, 나머지는 반복을 평일로 두지 않거나 지금 날씨를 바로 답했습니다. 실제 모델(Qwen3.6-35B-A3B, 게임PC)로는 사용자가 알려 주는 GPU 시간에 돌립니다.
- 3 행동별 세 단계 권한: 판단 규칙, 설정, 관리 앱 "PC 제어" 화면 구현(2026-11-14, `app/src/permissions.rs`, 스펙 [admin.spec.md](../../app/src/admin.spec.md) "PC control permissions"). 시킬 수 있는 사람은 관리 앱에 아이디로 등록한 사람만(기본은 아무도 없음). "먼저 묻기"의 다음 말 확인과 실제 동작은 M7 PC 제어 도구에서 이 규칙을 써서 만듦.
- 5 자비스가 한 일 기록: 구현(2026-11-14, `app/src/activity.rs`, 스펙 [admin.spec.md](../../app/src/admin.spec.md) "Activity"). 채팅 채널 동작(보내기·고치기·반응·지우기·고정)과 예약 전달을 종류·대상·시킨 사람·결과만 30일 남기고 관리 앱 "한 일" 화면에서 봄. PC 제어 동작은 M7에서 더함.
- 4, 2: 그다음 차례.
- 4 사람별 지침: 구현(2026-11-14, 두뇌 도구 `personalNotes`, 스펙 [personal_notes.spec.md](../../src/jarvis/tools/builtin/personal_notes.spec.md), 앱 `app/src/notes.rs`, 스펙 [admin.spec.md](../../app/src/admin.spec.md) "Personal notes"). "앞으로 ~해"처럼 말하면 저장하고, 앱이 그 사람의 지침을 음성·채팅 답과 정기 작업에 함께 보냄. 관리 앱 "사람별 지침" 화면에서 고치고 지움. 평가 `evals/test_personal_notes.py`를 qwen3:8b로 세 번 돌려 12번 모두 통과(지침이 답에 반영됨, 지침 없이는 반영 안 됨, "앞으로 반말로" 저장, 한 번 묻는 질문은 저장 안 함).
- 2: 그다음 차례.
## dots가 하는 일 (공개 자료 기준)