feat(plugin-api): read-only read_config for module self-tuning to app settings#41
Open
ForrestThump wants to merge 1 commit into
Open
feat(plugin-api): read-only read_config for module self-tuning to app settings#41ForrestThump wants to merge 1 commit into
read_config for module self-tuning to app settings#41ForrestThump wants to merge 1 commit into
Conversation
ForrestThump
force-pushed
the
feat/plugin-api-read-config
branch
2 times, most recently
from
July 19, 2026 19:49
94282e9 to
a300442
Compare
…ings The curated plugin surface exposes only the markdown note-space: `list_notes` returns vault-relative paths, the scanner excludes `.obsidian`, and no vault root is available anywhere. A module therefore has no way to read the host app's config — e.g. the Obsidian Tasks plugin's `data.json` — so it cannot self-tune to the user's settings. Add `VaultHost::read_config(relative_path) -> Option<Vec<u8>>`, a read-only door onto the vault's non-note config space, plumbed through the `VaultApi` facade. It is a default method returning `None`, so it is non-breaking and any host that declines config reads degrades gracefully. `PluginVaultHost` implements it scoped to `.obsidian/` with the manager's existing path-traversal guard. This is a fork-local addition to the plugin boundary, flagged for upstream review before it is proposed to turbovault-core. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Suap8WwcX94Uu6E2cAL85Z
This was referenced Jul 19, 2026
Closed
Open
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.
What
Adds one read-only method to the curated plugin surface:
It lets a compiled-in module read a vault application-config file — e.g.
.obsidian/plugins/obsidian-tasks-plugin/data.json— so it can tune itself tothe user's app/plugin settings instead of duplicating them into module config.
Why
The note APIs deliberately exclude dotfolders:
list_notesreturns vault-relativepaths (no filesystem anchor) and the scanner skips
.obsidianand non-noteextensions. So there is currently no way for a module to read app config.
Without this, every module has to re-ask the user for settings the app already
stores.
Design (kept deliberately minimal)
knows (every plugin knows its own settings path). There is intentionally no
list_configs— enumeration would be an authority amplifier (discover thenread other plugins' stored secrets), and no consumer needs it. Keeping it
name-addressed makes the capability capability-safe: you can only read a path
you can already name.
.obsidian/-scoped + traversal-guarded inPluginVaultHost, reusing thevault manager's existing
resolve_pathpath-traversal detection.Ok(None)on absent, notErr— a missing file is a normal outcome (thetarget plugin may not be installed); the caller decides whether that is
recoverable or fatal.
None, so a hostthat doesn't support config reads degrades gracefully rather than erroring.
Tests
ContractProvidercontract test seeds an.obsidian/file and asserts itreads back by path, separately from the note space.
tasksmodule(see below) has a fail-closed, env-gated live test that reads a real 2648-byte
Tasks
data.jsonand self-tunes to it — resolvingtaskFormat→ emoji, the#taskglobal filter, and matching 61 real tasks, withsource == "obsidian-data"(i.e. it genuinely read the file, not a heuristic fallback).Full real-vault scan in ~0.5s. Test:
live_tasks_against_real_obsidian_vault.Context / consumer
This is the enabling capability for a
tasksmodule that self-tunes to a user'sObsidian Tasks settings (metadata format: emoji vs dataview; global filter),
rather than requiring separate configuration. The full module is not part of this
PR — it's here for reference and as end-to-end proof of the capability:
ForrestThump/turbovault @
feat/plugin-tasks.I saw
fix/plugin-api-review-followupsis in flight (SEP-986 tool-namevalidation, etc.) — happy to rebase/align this with wherever the API review
lands, or fold it into that work if you'd prefer.
🤖 Generated with Claude Code