feat: let JARVIS search an Obsidian vault, read-only - #24
Open
luca-71 wants to merge 2 commits into
Open
Conversation
Asked "what's my schedule today?", JARVIS reached for [ACTION:SCREEN] and described the monitor. The reason was visible in the raw completions: "[ACTION:SCREEN] Good evening, sir — let me pull up your calendar" The intent was right and the vocabulary was wrong. The calendar and mail lookups existed, but only the hardcoded English phrase table could reach them — they were never offered to the model as action tags. SCREEN was the only inspection action it had, so it substituted, and a monitor photograph came back instead of a schedule. Add [ACTION:CALENDAR] and [ACTION:MAIL], wired to the same _lookup_and_report machinery the phrase table already used, and narrow SCREEN's description to the display itself. This is not an i18n fix. English was equally broken; it was merely masked, because the phrase table intercepts the exact wordings before the model is consulted. Anything unlisted fell through — "When is my next appointment?" went to SCREEN too, and now does not. Measured over 12 phrasings x 3 runs per language, comparing the tag chosen against the tag expected: English 6/21 wrong -> 0/36 Italian 9/21 wrong -> 0/36 Also give the two actions their own acknowledgement. The model tends to write prose after the tag, which is parsed as the target and stripped, so without this the spoken line degraded to a bare "Right away, sir." Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A vault is a folder of Markdown files, so this reads the filesystem directly — no AppleScript, no TCC prompt, no plugin or REST bridge to keep running. Set OBSIDIAN_VAULT to switch it on; unset, every function returns empty and JARVIS simply has no vault. Read-only by design, following mail_access: no create, edit, move or delete function exists. A voice assistant mishearing a command must not be able to alter the user's own knowledge base. Search walks the notes rather than keeping an index, which cannot go stale and is trivially fast at vault scale. Title matches outweigh body matches ten to one, since notes are named deliberately. read_vault_note resolves its path from search results and then re-checks it against the vault root: the query arrives from a speech transcript by way of the model, and a note name is not a licence to read the disk. Exposed as [ACTION:VAULT] with the search terms as its target, alongside a status row in the settings panel. Measured 0/21 misroutes over Italian and English phrasings, including controls that must produce no tag. Also fix the lookup collision guard, which this feature exposed. It suppressed any result arriving within 3s of the last utterance — but the utterance it measured was the one that ordered the lookup, so every fast lookup silenced itself. Calendar and mail hid this by being slow; a vault search takes 30ms and was never once heard. It now compares against the requesting turn, so the guard fires only when the user has genuinely started a new one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ask "what did I write about X?" and JARVIS searches your Obsidian vault and reads the note back.
Why the filesystem
A vault is a folder of Markdown files. This reads it directly — no AppleScript, no TCC permission prompt, no Local REST API plugin to keep running, no sync daemon. It is the simplest integration in the project, and the only one that cannot be broken by a macOS update.
OBSIDIAN_VAULTswitches it on. Unset, every function returns empty and JARVIS simply has no vault; the settings panel shows the row greyed rather than red, because an unconfigured vault is opt-in, not broken.Read-only, by design
Following
mail_access: no create, edit, move, or delete function exists. Not disabled — absent. A voice assistant that mishears one word in ten must not be able to alter the user's own knowledge base.Two guards back that up:
read_vault_noteresolves its path from search results and then re-checks it against the vault root. The query arrives from a speech transcript by way of an LLM, so it is untrusted, and a note name is not a licence to read the disk. Verified against../../.ssh/id_rsa,../../../etc/passwd, and/etc/passwd— none escape..obsidian,.git,_attachments) are skipped, and oversized files are ignored.Search
Walks the notes rather than keeping an index — an index can go stale, and a vault is small enough that walking it is imperceptible (110 notes, 466KB, ~30ms). Title matches outweigh body matches ten to one, since notes are named deliberately:
memoriain a filename is a stronger signal than the same word buried in a paragraph.Exposed as
[ACTION:VAULT] search terms. Measured 0/21 misroutes across Italian and English phrasings, including conversational controls that must produce no tag at all. The extracted queries are clean: "Cosa ho scritto nelle mie note sul marketing della piramide?" →piramide marketing.A bug this exposed
The lookup collision guard suppressed any result arriving within 3s of the last utterance — but the utterance it measured was the one that ordered the lookup. Every fast lookup therefore silenced itself:
The search worked perfectly and the answer was thrown away. Calendar and mail hid this by being slow enough to fall outside the window; a 30ms vault search never once got through. The guard now compares against the requesting turn, so it fires only when the user has genuinely started a new one — which is what it was always meant to mean.
Known nit
With a lookup this fast, the result can occasionally beat the acknowledgement out of the socket, so the two arrive in the wrong order. It reads oddly but loses nothing. Fixing it properly means signalling the lookup task once the main response has been sent, which is more restructuring than the symptom justifies here.
Testing
pytest tests/gives 35 passed, 8 failed — identical to this branch's base, so no regressions. The 8 pre-existing failures are unrelated: 7 needplaywright install, andtest_browse_action_keywordsimportsACTION_KEYWORDS, a symbol that no longer exists inserver.py.tsc --noEmitclean.Verified end to end against a real 110-note vault: the disabled path, a non-existent path, path traversal, routing, and the spoken result.
🤖 Generated with Claude Code