Add tag semantic library for 0.5.0 - #2
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a persistent “tag semantic library” that derives tag meaning/usage boundaries from real tagged-note samples, caches the results in plugin settings, and injects that cached context into tag recommendation prompts for more Vault-specific reasoning. It also updates UI, docs, tests, and release metadata for the 0.5.0 release.
Changes:
- Add semantic-library data collection (sampled notes + fingerprints), persistence/normalization, and a searchable viewer modal.
- Enhance the OpenAI-compatible client to request an exact tag count, retry once when too few valid tags are returned, and support semantic-library generation.
- Update settings/UI, documentation, release notes, versions metadata, and CI/release workflows for 0.5.0.
Reviewed changes
Copilot reviewed 19 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Adds semantic-library source file to coverage include list. |
| versions.json | Adds version-to-minAppVersion mappings for 0.4.2 and 0.5.0. |
| tests/siliconflow.test.ts | Expands client tests for exact-count prompting, retry behavior, and semantic context injection. |
| tests/semantic-library.test.ts | Adds tests for evidence sampling/fingerprints and semantic-library normalization/context formatting. |
| styles.css | Adds responsive layout improvements plus semantic-library modal styling. |
| src/tag-manager-modal.ts | Adds a dedicated modal class for updated sizing/layout. |
| src/siliconflow.ts | Adds semantic-context support, exact-count prompting + retry, and tag-semantics generation API. |
| src/settings.ts | Adds semantic-library controls (view/update/schedule) and replaces the slider with a validated numeric input. |
| src/semantic-library.ts | Introduces evidence collection, library normalization, and semantic-context formatting utilities. |
| src/semantic-library-modal.ts | Adds a searchable modal UI to view cached tag semantics. |
| src/main.ts | Integrates semantic-library lifecycle (init, manual update, scheduled refresh) and prompt injection. |
| README.md | Documents semantic library behavior, privacy implications, and updated setup steps (CN). |
| README_EN.md | Documents semantic library behavior, privacy implications, and updated setup steps (EN). |
| package.json | Bumps package version to 0.5.0. |
| package-lock.json | Updates lockfile version metadata for 0.5.0 and dependency graph changes. |
| manifest.json | Bumps plugin version to 0.5.0 and sets minAppVersion to 1.5.0. |
| docs/releases/0.5.0.md | Adds a dedicated 0.5.0 release note with screenshots and details. |
| CHANGELOG.md | Adds changelog entries for 0.5.0 and 0.4.2. |
| .github/workflows/release.yml | Updates actions versions and Node version used for releases. |
| .github/workflows/ci.yml | Updates actions versions and Node version used for CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+161
to
+164
| const allowedCount = this.getAllowedTags().length; | ||
| const entryCount = Object.keys(this.settings.semanticLibrary).filter((tag) => | ||
| this.getAllowedTags().includes(tag), | ||
| ).length; |
Comment on lines
+142
to
+145
| const line = [ | ||
| `- #${tag}`, | ||
| `内涵:${entry.meaning}`, | ||
| entry.useWhen ? `适用:${entry.useWhen}` : "", |
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 changed
Why
Short tag names do not capture how a user actually applies a tag in their own Vault. Recommendations previously matched mostly against tag text. This release learns those conventions once, persists the resulting summaries, and reuses them without rebuilding the library for every note.
User impact
The first explicit recommendation initializes the library if needed. Scheduled updates remain off by default. Refresh requests go directly to the configured OpenAI-compatible provider and send at most three titles and 800-character excerpts per changed tag. Sample text is not persisted.
Validation