feat: add separate Code Mode for fenced code blocks - #53
Open
TyceHerrman wants to merge 1 commit into
Open
Conversation
TyceHerrman
marked this pull request as ready for review
July 11, 2026 11:31
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.
Summary
Add an optional Code Mode that keeps prose in the existing Notes index and
embeds fenced code blocks in a separate Code index with its own model. Results
remain mode-specific; scores from different embedding spaces are never mixed.
Code Mode is off by default, so existing Notes behavior is unchanged.
Face/Transformers models with ONNX weights, Ollama, OpenAI-compatible APIs,
and Google Gemini. Recommended built-ins are
all-MiniLM-L6-v2andparaphrase-multilingual-MiniLM-L12-v2; no code-specialized model is bundled.rebuild lifecycle.
that prevent stale work from publishing results.
privacy implications.
No new runtime dependencies, IndexedDB schema-version bump, release-version
bump, or changes to existing Notes persistence names.
Closes #52.
Test plan
npm run test— 36 files, 240 testsnpm run lintnpm run buildgit diff --checkAutomated coverage includes extraction and chunking, Notes/Code partitioning,
persistence and migration, mode-specific routing and caches, transactional
rollback, stale-result suppression, teardown, and unload behavior.
Manual Obsidian verification
Verified with disposable vaults on Obsidian 1.12.7 and 1.13.1. Build artifacts
were copied manually because
install-localdelegates to a gitignored,developer-local helper that is not shipped with the repository.
Notes/Code selectors.
bottom view, and Semantic Search persist after restart.
indexes without stale results.
restores the previous usable model and index.
Disabled,selectors disappear, and Notes search again retrieves fenced-code content.
See
docs/code-mode-spec.mdfor the detailed behavior contract.