Skip to content

Commit 6fa722b

Browse files
committed
Release 2.7.1: safer cache keys, summary none/off, Ollama UX, RU labels.
Document and harden metadata cache keys as path|mtime|size|contentHash to avoid cross-note collisions. Add summary lifecycle modes none/off (preview-only until explicit insert), configurable Ollama timeout (default 12s), status bar/panel online-offline indicator, tag relevance scores with reason tooltips, optional Apply/Cancel diff preview, and EN/RU command/settings strings. Stub glyph-mi notes adapter for a future shared confidence/sources contract without breaking the local offline path.
1 parent 4d9b17a commit 6fa722b

13 files changed

Lines changed: 835 additions & 224 deletions

README.md

Lines changed: 66 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<a href="https://obsidian.md/"><img src="https://obsidian.md/images/obsidian-logo-gradient.svg" width="72" alt="Obsidian" /></a>
33
</p>
44

5-
<h1 align="center">glyph-miO 2.7</h1>
5+
<h1 align="center">glyph-miO 2.7.1</h1>
66

77
<p align="center">
88
<strong>Metadata Intelligence for Obsidian</strong><br>
@@ -24,42 +24,52 @@
2424

2525
**glyph-miO** is an Obsidian community plugin that analyzes the **active note** and helps you organize knowledge faster:
2626

27-
- **Extractive summaries** — a compact block of key sentences inserted at the top of the note
28-
- **Tag suggestions** — ranked by relevance to title, headings, and body text
27+
- **Extractive summaries** — a compact callout block inserted at the end of the note
28+
- **Tag suggestions** — ranked by relevance to title, headings, and body, with scores/tooltips
2929
- **Offline by default** — no cloud, no API keys; optional local Ollama enhancement
3030

31-
It pairs naturally with [**glyph-sO**](https://github.com/FlokeStudio/glyph-sO): search finds notes across the vault; glyph-miO understands the note you’re working on right now.
31+
It pairs naturally with [**glyph-sO**](https://github.com/FlokeStudio/glyph-sO): search finds notes across the vault; glyph-miO understands the note you’re working on right now. Long-term UI chrome aims to share a **glyph-ui** styling kit with sO.
3232

33-
### What’s new in 2.7
33+
### What’s new in 2.7.1
3434

35-
**Service-based architecture** — core logic split into focused modules:
35+
- **Safer metadata cache key** — always includes vault path plus mtime, size, and a short content hash (documented in `services/metadata.js`)
36+
- **Summary mode `none` / `off`** — preview in the MI panel only; write when you Insert / run summarize explicitly
37+
- **Ollama timeout setting** — configurable seconds (default **12**), used for generate calls
38+
- **Tag explainability** — relevance % on chips + tooltip (title / heading / body / frontmatter)
39+
- **Ollama status** — status bar + panel pill (online / offline fallback / disabled)
40+
- **Optional diff preview** — Apply / Cancel modal before insert or replace
41+
- **RU labels** — commands and settings follow Obsidian language when set to Russian
42+
- **Adapter stub**`services/glyph-mi-notes-adapter.js` ready to consume glyph-mi `notes` without breaking the local offline path
43+
44+
### What’s in 2.7
45+
46+
**Service-based architecture** — core logic in focused modules:
3647

3748
| Service | Responsibility |
3849
|---------|----------------|
39-
| `services/metadata.js` | Weighted tag scoring, stop-word filtering, analysis cache |
40-
| `services/summary.js` | Sentence extraction, summary block formatting, marker lifecycle |
50+
| `services/metadata.js` | Weighted tag scoring, stop-words, cache key |
51+
| `services/summary.js` | Sentence extraction, block formatting, lifecycle modes |
52+
| `services/i18n.js` | EN/RU strings for commands and settings |
53+
| `services/glyph-mi-notes-adapter.js` | Stub toward shared glyph-mi `notes` contract |
4154

42-
**Weighted metadata scoring** — tags are ranked using multiple signals:
55+
**Weighted metadata scoring** — tags ranked by:
4356

4457
- Matches in the note title (highest weight)
4558
- Frequency in headings
4659
- Density in body paragraphs
47-
- Existing frontmatter / inline tags (boost)
48-
49-
Results are **cached** by note path, modification time, and content size — re-analysis is instant when nothing changed.
60+
- Existing frontmatter tags (boost)
5061

5162
**Summary lifecycle modes:**
5263

5364
| Mode | Behavior |
5465
|------|----------|
55-
| `append` | Each summarize action adds a new `<!-- glyph-mi summary -->` block |
66+
| `append` | Each summarize/insert adds a new `<!-- glyph-miO-summary -->` block |
5667
| `replace-latest` | Updates the most recent summary block in place (default) |
57-
58-
**Cleaner UI** — refined panel spacing and typography for a minimalist Obsidian-native feel.
68+
| `none` / `off` | Do not auto-write; show draft in the panel; insert only via Insert / summarize command |
5969

6070
### Install
6171

62-
1. Download the latest release from [Releases](https://github.com/FlokeStudio/glyph-miO/releases).
72+
1. Download the latest release from [Releases](https://github.com/FlokeStudio/glyph-miO/releases) (or clone `main`).
6373
2. Extract into your vault:
6474

6575
```
@@ -69,20 +79,22 @@ Results are **cached** by note path, modification time, and content size — re-
6979
├── styles.css
7080
└── services/
7181
├── metadata.js
72-
└── summary.js
82+
├── summary.js
83+
├── i18n.js
84+
└── glyph-mi-notes-adapter.js
7385
```
7486

7587
3. Enable **glyph-miO** in **Settings → Community plugins**.
7688

7789
### Commands
7890

79-
| Command | What it does |
80-
|---------|--------------|
81-
| **Glyph: open MI panel** | Interactive panel with tags and summary preview |
82-
| **Glyph: summarize note** | Insert or update the summary block |
83-
| **Glyph: jump to MI summary** | Cursor jumps to the `<!-- glyph-mi summary -->` marker |
84-
| **Glyph: analyze active note** | Run analysis without opening the panel |
85-
| **Glyph: suggest tags** | Apply top-ranked tag suggestions to the note |
91+
| Command (EN) | Command (RU) | What it does |
92+
|--------------|--------------|--------------|
93+
| **Glyph: open MI panel** | **Glyph: открыть панель MI** | Interactive panel with tags and summary preview |
94+
| **Glyph: summarize note** | **Glyph: пересказ заметки** | Insert or update the summary block (respects mode + diff preview) |
95+
| **Glyph: jump to MI summary** | **Glyph: перейти к саммари MI** | Cursor jumps to the summary marker |
96+
| **Glyph: analyze active note** | **Glyph: анализ активной заметки** | Run analysis without opening the panel |
97+
| **Glyph: suggest tags** | **Glyph: предложить теги** | Show top-ranked tags with relevance % |
8698

8799
### Settings
88100

@@ -91,69 +103,69 @@ Results are **cached** by note path, modification time, and content size — re-
91103
| **Enable Ollama** | Try local LLM for JSON-structured summaries (default: on) |
92104
| **Ollama URL** | Base URL, default `http://127.0.0.1:11434` |
93105
| **Model** | Ollama model name, default `llama3.2` |
94-
| **Summary block mode** | `append` or `replace-latest` |
106+
| **Ollama timeout (seconds)** | Abort generation after N seconds (default **12**), then offline fallback |
107+
| **Summary block mode** | `append`, `replace-latest`, `none`, or `off` |
108+
| **Diff preview before Apply** | Show before/after modal (Apply / Cancel) before writing |
95109

96110
### How analysis works
97111

98-
1. **Offline path (always available):** the plugin tokenizes the note, scores tag candidates, selects key sentences for the summary, and formats a marked block.
99-
2. **Ollama path (optional):** if Ollama responds within the timeout, the plugin requests a JSON summary with tags. On failure or timeout, it **falls back** to the offline algorithm — no error dialogs, no broken workflow.
112+
1. **Offline path (always available):** tokenize → score tags with reasons → pick key sentences → format marked block.
113+
2. **Ollama path (optional):** if Ollama responds within the configured timeout, request JSON summary + tags. On failure or timeout, **fall back** to the offline algorithm.
114+
115+
### Architecture note (local vs glyph-mi)
116+
117+
MI logic for this plugin currently lives in local **`services/*`**. Roadmap: consume the shared [glyph-mi](https://github.com/krwg/glyph-mi) **`notes`** module for a common contract (`confidence` / `sources`) via the thin adapter stub — without removing the offline path. Shared **glyph-ui** styling with glyph-sO is a parallel goal.
100118

101119
### Example summary block
102120

103121
```markdown
104-
<!-- glyph-mi summary -->
105-
**Summary:** This note covers project planning for Q3, including milestone
106-
definitions and resource allocation across three teams.
122+
---
123+
<!-- glyph-miO-summary -->
124+
> [!summary] Glyph MI-O
125+
> This note covers project planning for Q3, including milestone
126+
> definitions and resource allocation across three teams.
107127
108-
**Tags:** #projects #planning #q3
109-
<!-- /glyph-mi summary -->
128+
#projects #planning #q3
110129
```
111130

112131
---
113132

114133
## GitHub / Dev section
115134

116-
### Architecture (2.7)
135+
### Architecture (2.7.1)
117136

118137
```
119-
main.js # Obsidian plugin: UI, Ollama client, commands
120-
services/metadata.js # computeMetadataCached, weighted scoring
121-
services/summary.js # extractiveSummary, buildSummaryBlock, SUMMARY_MARKER
122-
styles.css # .glyph-mio-panel styles
138+
main.js # Plugin UI, Ollama client, commands, status bar
139+
services/metadata.js # computeMetadataCached, cache key, tagDetails
140+
services/summary.js # extractiveSummary, buildSummaryBlock, none/off
141+
services/i18n.js # EN/RU labels
142+
services/glyph-mi-notes-adapter.js # stub → future glyph-mi notes module
143+
styles.css # panel, status, diff modal
123144
```
124145

125146
### Metadata cache key
126147

127-
`computeMetadataCached(doc, settings)` keys the cache by:
148+
`keyForDoc(file, body)` is always:
128149

129-
- File path
130-
- `stat.mtime` (modification time)
131-
- Content length
150+
```text
151+
${path}|${mtime}|${size}|${contentHash}
152+
```
132153

133-
Cache invalidates automatically when the note is edited.
154+
Path is mandatory (collision-safe across notes). See JSDoc in `services/metadata.js`.
134155

135156
### Ollama integration
136157

137158
- Health check: `GET /api/tags`
138159
- Generation: `POST /api/generate` with `format: "json"`
139-
- Timeout: 12 seconds (configurable in code)
160+
- Timeout: settings **Ollama timeout (seconds)** (default 12)
161+
- Status: status bar item + MI panel pill
140162
- Graceful fallback to `extractiveSummary()` on any failure
141163

142-
### Project layout
143-
144-
| Path | Role |
145-
|------|------|
146-
| `main.js` | Plugin class, panel modal, settings tab, command registration |
147-
| `services/metadata.js` | Tag scoring engine with `STOP_WORDS` filter |
148-
| `services/summary.js` | Sentence splitting, summary block builder |
149-
| `.github/workflows/release.yml` | Packages `services/` into release zip |
150-
| `.github/workflows/pages.yml` | Deploys `docs/` to GitHub Pages |
151-
152164
### Related repositories
153165

154166
| Repo | Role |
155167
|------|------|
156-
| [glyph-mi](https://github.com/krwg/glyph-mi) | Universal MI core (Senza, Cultiva modules) |
168+
| [glyph-mi](https://github.com/krwg/glyph-mi) | Universal MI core (Senza, Cultiva, future `notes`) |
157169
| [glyph-sO](https://github.com/FlokeStudio/glyph-sO) | Full-text search for Obsidian |
158170
| [glyph-s](https://github.com/FlokeStudio/glyph-s) | Shared search engine |
159171

0 commit comments

Comments
 (0)