oh-my-second-brain 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@
10
10
  {
11
11
  "name": "oms",
12
12
  "description": "Oh My Second Brain convention layer for Obsidian vaults — capture, retrieve, and validate knowledge under a declared semantic convention.",
13
- "version": "0.7.0",
13
+ "version": "0.8.1",
14
14
  "author": {
15
15
  "name": "gobeumsu",
16
16
  "email": "gobeumsu@gmail.com"
@@ -37,5 +37,5 @@
37
37
  ]
38
38
  }
39
39
  ],
40
- "version": "0.7.0"
40
+ "version": "0.8.1"
41
41
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oms",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "Oh My Second Brain convention layer for Obsidian vaults — capture, retrieve, and validate knowledge under a declared semantic convention.",
5
5
  "author": {
6
6
  "name": "gobeumsu"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oms",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "Oh My Second Brain convention layer for Obsidian vaults — Codex native rules, skills, and MCP adapter.",
5
5
  "_note": "oms install writes Codex MCP config, installs ~/.codex/rules/oms.md, and installs ~/.codex/skills/oms-*.",
6
6
  "skills": "./assets/skills/",
@@ -4,6 +4,10 @@ Skills, agents, and ontology data changes belong here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.1] - 2026-08-29
8
+
9
+ ## [0.8.0] - 2026-08-29
10
+
7
11
  ## [0.7.0] - 2026-08-27
8
12
 
9
13
  ## [0.6.2] - 2026-08-27
package/CHANGELOG-cli.md CHANGED
@@ -4,6 +4,19 @@ Changes to the `oms` command surface belong here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.1] - 2026-08-29
8
+
9
+ ## [0.8.0] - 2026-08-29
10
+
11
+ ### Added
12
+
13
+ - **`oms setup --embedding-default` installs a working local embedding model in one step.** It downloads the pinned EmbeddingGemma-300M model, verifies it against the shipped SHA-256, and publishes it to the user-level cache. After that, `oms embed` and vector search work without setting `OMS_EMBEDDING_PROVIDER` or `OMS_EMBEDDING_MODEL` at all — the gap that previously forced anyone wanting native semantic search to hand-author a descriptor JSON or export a matching environment pair. Nothing changes for a vault that does not run it: with no model installed, lexical search keeps working and vector requests still fail loudly naming both variables, and the guidance now names this command as the one-step remedy.
14
+ - The three setup embedding options are mutually exclusive and now say so. Passing more than one of `--embedding-default`, `--embedding-descriptor`, or `--embedding-no-default` exits with an error naming the conflicting flags instead of silently letting one win.
15
+
16
+ ### Changed
17
+
18
+ - `oms --help` documents the setup embedding options. All three existed only in source before this; `--embedding-descriptor` and `--embedding-no-default` shipped undocumented.
19
+
7
20
  ## [0.7.0] - 2026-08-27
8
21
 
9
22
  ### Breaking
@@ -4,6 +4,33 @@ Domain logic changes belong here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.1] - 2026-08-29
8
+
9
+ ### Fixed
10
+
11
+ - **Frontmatter YAML comments and fenced-code headings are no longer mistaken for a document title.** `documentTitle` fell back to scanning the raw document for the first ATX H1, which reads the frontmatter block too — where a YAML comment (`# rewrite this later`) is byte-identical to an H1. The same unguarded regex matched an `# heading` inside a fenced code block, so a note demonstrating markdown was titled by its own example. Because the title is prepended to *every* chunk's embedding input, one wrong title skews the vectors for the whole note, not just the chunk containing that line. The H1 scan is now confined to `parsed.body` and tracks backtick and tilde fences, closing a fence only on a run at least as long as the opener per CommonMark. A document whose frontmatter fence never closes has an empty body and is therefore untitled, which is the honest answer for a malformed document rather than a guess drawn from non-body text.
12
+
13
+ This is a title-selection fix, not a redaction: `chunkDocument` receives the raw document, so frontmatter text was and remains part of the indexed chunk text. The bug was which text got treated as the title.
14
+ - **The chunk digest can no longer be made to collide across the title boundary.** The digest joined title and text with a bare NUL separator and claimed that made the pair unambiguous. Nothing forbids a NUL in note text, so `("a", "\0b")` and `("a\0", "b")` hashed identically — meaning a crafted retitle could impersonate a body edit and suppress re-embedding. The title is now length-prefixed, making the encoding injective for every input. **This changes the digest formula again, so the first `oms embed` after upgrading re-embeds once**, on top of 0.8.0's own one-time reindex.
15
+ - **A `NaN` vector-query width is rejected instead of silently becoming the widest possible scan.** `clampVecK` treated every non-finite value alike via `!Number.isFinite(k)`, so `NaN` and `-Infinity` both saturated to the 4096 ceiling. For `NaN` that ran the most expensive ANN scan available and then returned nothing, because the subsequent `.slice(0, NaN)` yields an empty array — hiding a caller bug behind an empty page. `NaN` now throws, matching how `vecBuf` rejects a non-finite vector component; `Infinity` still saturates, since it is the honest spelling of "every candidate"; and a negative or zero request still floors to 1.
16
+
17
+ ## [0.8.0] - 2026-08-29
18
+
19
+ ### Added
20
+
21
+ - **A pinned default embedding model is now available for explicit one-step install.** `PINNED_DEFAULT_EMBEDDING_MODEL` describes EmbeddingGemma-300M (`embeddinggemma-300M-Q8_0.gguf`, 768d, 2048-token context) with its source URL and a verified SHA-256 of `b5ce9d77…90d63`. This is the same model qmd resolves from its own `DEFAULT_EMBED_MODEL_URI`, so a vault indexed by `oms embed` gets that toolchain's retrieval quality instead of a lesser stand-in. The constant is deliberately **not** a fallback: `resolveEmbeddingModel` never reaches for it, because an implicit default would defeat the E-1 no-default contract, which verifies at runtime that embedding capability stays honestly unavailable with no environment pair and an empty cache. Its only consumer is the explicit setup acquisition path, which verifies the downloaded bytes against the pinned digest before publishing them. ADR-007 P-B is unaffected — a real, explicitly installed model was never the fake fallback that principle forbids.
22
+ - **Chunks now carry their document title into the embedding input.** `Chunk.title` is resolved from frontmatter `title`, then the first ATX H1, then the literal `none`, and `EmbeddingProvider.embed(text, title?)` accepts it. A passage prefix may declare a `{title}` slot, which the GGUF and Upstage providers substitute per chunk; the pinned descriptor uses `title: {title} | text: `, reproducing qmd's `formatDocForEmbedding` byte-for-byte. This matters for retrieval rather than cosmetics: a chunk from the middle of a note is frequently ambiguous on its own, and the document title is the cheapest available disambiguating context. A prefix without the slot is prepended exactly as before, so every existing descriptor keeps its current behavior.
23
+
24
+ ### Changed
25
+
26
+ - **Chunk change-detection digests now cover the document title as well as the chunk text.** The title reaches every chunk's embedding input, so a digest over text alone reported "unchanged" for each chunk that did not itself contain the title line — leaving stored vectors that still encoded the *old* title after a retitle. The digest is now taken over title and text with a NUL separator, so no retitle can collide with a body edit. The cost is explicit: because the digest formula changed, the first `oms embed` after upgrading re-embeds every chunk once. We chose that over making the digest conditional on provider configuration, which would have coupled chunking to embedding settings and left the stale-vector bug reachable.
27
+
28
+ ### Fixed
29
+
30
+ - **Vector queries no longer fail outright on an unbounded candidate limit.** Without an explicit `candidateLimit`, the MCP facade requests `Number.MAX_SAFE_INTEGER` candidates so it retrieves the complete ranked stream and keeps `totalCount` and offset cursors accurate past the first page. FTS tolerates that, but sqlite-vec rejects any knn `k` above its own 4096 ceiling, so every vector and HyDE query failed with `k value in knn query too large`. The collection-scoped branch had the same defect from the opposite direction: it passed the *total* chunk count, which fails on any vault with more than 4096 chunks. The store — the only layer that knows the extension's constraint — now clamps `k` into the supported range, and a non-positive request collapses to 1 rather than 0 so a caller asking for "some" results never silently gets an empty page. This was unreachable in practice until now, because a vault with no embedding model never got as far as a vector query; configuring a local model exposed it immediately.
31
+
32
+ The clamp is a genuine ceiling, not a cure-all, and it moves the cost rather than removing it. In a vault with more than 4096 chunks the vector candidate stream is truncated, so a vector-derived `totalCount` and any deep page beyond that band are bounded by it; a collection-scoped query is affected more sharply, because sqlite-vec ranks before the collection predicate is applied, so a collection whose chunks all fall outside the band can be starved. Both are properties of ANN-before-predicate search in sqlite-vec. The alternative was failing every vector query outright, which is what shipped before this clamp.
33
+
7
34
  ## [0.7.0] - 2026-08-27
8
35
 
9
36
  ### Breaking
package/CHANGELOG-mcp.md CHANGED
@@ -4,6 +4,10 @@ MCP server tools and resources belong here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.1] - 2026-08-29
8
+
9
+ ## [0.8.0] - 2026-08-29
10
+
7
11
  ## [0.7.0] - 2026-08-27
8
12
 
9
13
  ### Breaking
@@ -4,6 +4,10 @@ Per-host adapter and installer changes belong here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.1] - 2026-08-29
8
+
9
+ ## [0.8.0] - 2026-08-29
10
+
7
11
  ## [0.7.0] - 2026-08-27
8
12
 
9
13
  ### Changed
package/CHANGELOG.md CHANGED
@@ -10,6 +10,51 @@ This aggregate changelog contains changes that span multiple layers.
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.8.1] - 2026-08-29
14
+
15
+ ### Fixed
16
+
17
+ - **A note could be given the wrong title, degrading semantic search across that whole note.** 0.8.0 started mixing each note's title into every one of its chunks when embedding, which is what makes a mid-note passage findable by what the note is *about*. But the title was picked from the first `#` line anywhere in the file, and `#` means "comment" in frontmatter and "heading" in Markdown. So a frontmatter comment like `# rewrite this later`, or an `# Example` heading shown inside a fenced code block, could be adopted as the note's title and then mixed into every chunk of it — pulling the entire note toward the wrong topic. Titles are now read only from frontmatter `title` or a real heading in the note body, with code fences skipped. A note affected by either case had no real title to begin with, so it is now correctly untitled.
18
+
19
+ To be clear about what this does and does not change: frontmatter text has always been part of what gets indexed, and still is. This fixes which text is treated as the *title*, not what is stored.
20
+
21
+ **If you ran `oms embed` on 0.8.0, re-run it.** Affected notes are corrected automatically, but only once you sync again.
22
+
23
+ ### Changed
24
+
25
+ - **This release re-embeds your vault once, for the last time in this series.** Fixing the title bug above required changing how OMS fingerprints a chunk, which invalidates the fingerprints written by 0.8.0. Combined with 0.8.0's own one-time reindex, that is two full re-embeds across two consecutive releases — not a pattern, and worth taking now while the affected code is one release old rather than carrying a known-wrong fingerprint forward.
26
+
27
+ ### Documentation
28
+
29
+ - **The limits of the 0.8.0 vector-search fix are now stated where users read.** That release described vector search as fixed without noting the ceiling it works under: results come from at most 4096 candidates, so on a vault larger than that a vector-derived result count and any deep page are bounded by it, and a collection-scoped vector search can miss matches whose documents rank outside that band globally. This is a property of how the vector index ranks before filtering, not something the fix introduced — but it belonged in the release note and was only in the kernel changelog.
30
+ - The pinned default model's decision record now documents why an explicit, opt-in `--embedding-default` command is not the automatic default-model acquisition that `docs/measurements/model-default-deferral.md` withholds, and states plainly that the model's retrieval quality rests on matching the reference toolchain rather than on a measurement in this project's own harness.
31
+
32
+ ## [0.8.0] - 2026-08-29
33
+
34
+ ### Added
35
+
36
+ - **Semantic search now has a one-step setup.** `oms setup --embedding-default` downloads EmbeddingGemma-300M, verifies it against a pinned SHA-256, and installs it under your user cache — not in the vault. After that, `oms embed` and vector search work with no environment variables at all:
37
+
38
+ ```bash
39
+ oms setup --embedding-default
40
+ oms embed
41
+ oms semantic vsearch "what should I retrieve?"
42
+ ```
43
+
44
+ Until now, native semantic search worked only if you hand-authored a model descriptor JSON or exported a matching `OMS_EMBEDDING_PROVIDER` + `OMS_EMBEDDING_MODEL` pair. The model runs locally through `node-llama-cpp`, needs no API key, and embeds at its full 768 dimensions with no folding.
45
+
46
+ Choosing your own model is unchanged: set both environment variables, or pass `oms setup --embedding-descriptor <path>`. Setting only one of the pair is still an error naming both, never a silent fallback. Installing no model is still fine — lexical search, graph retrieval, and convention validation all keep working, and only vector and HyDE requests are refused.
47
+
48
+ ### Changed
49
+
50
+ - **Note titles now inform semantic search results.** A chunk from the middle of a note is often ambiguous on its own, so each chunk's embedding now includes its document title (frontmatter `title`, else the first `# heading`). A note titled "Kubernetes Pod Scheduling" whose body only says "the controller assigns each pending item to the best-fit node" is now findable by searching for Kubernetes.
51
+
52
+ **One-time cost when you upgrade:** because the title is part of what gets embedded, it is also part of how OMS detects changes — otherwise renaming a note would leave most of its chunks holding vectors that still encode the old title. That changes the change-detection digest, so the first `oms embed` after upgrading re-embeds your vault once. Subsequent runs are incremental again.
53
+
54
+ ### Fixed
55
+
56
+ - **Vector search was completely broken and now works.** Every vector or HyDE query failed with `k value in knn query too large`, because the search layer asks for an unbounded candidate set and the vector index rejects any request above its own 4096-result ceiling. Collection-scoped vector queries had the same defect from the other direction, failing on any vault with more than 4096 chunks. This affected anyone who had configured an embedding model; without one, queries never reached the vector path at all. No reindex is needed for this fix.
57
+
13
58
  ## [0.7.0] - 2026-08-27
14
59
 
15
60
  ### Breaking
package/README.md CHANGED
@@ -103,14 +103,19 @@ oms hook Vault guard hooks (Claude Code pre/post tool-use)
103
103
 
104
104
  ## Semantic search (optional)
105
105
 
106
- Semantic retrieval requires a real embedding model — there is no fake/hash fallback (ADR-007). Configure embeddings explicitly with `OMS_EMBEDDING_PROVIDER` + `OMS_EMBEDDING_MODEL` (`gguf` with a local GGUF model path, or `upstage` with a model id and `UPSTAGE_API_KEY`), then sync and query:
106
+ Semantic retrieval requires a real embedding model — there is no fake/hash fallback (ADR-007). The quickest path is the pinned local default:
107
107
 
108
108
  ```bash
109
- oms semantic sync --vault /path/to/vault --collection vault
110
- oms semantic query "what should I retrieve?" --vault /path/to/vault
109
+ oms setup --vault /path/to/vault --yes --embedding-default
110
+ oms embed --vault /path/to/vault
111
+ oms semantic vsearch "what should I retrieve?" --vault /path/to/vault
111
112
  ```
112
113
 
113
- Without a configured model, graph-based retrieval and convention validation still work.
114
+ `--embedding-default` downloads EmbeddingGemma-300M (~318 MB), verifies it against a pinned SHA-256, and installs it under your user cache — not in the vault. It runs locally through `node-llama-cpp`, needs no API key, and embeds at the model's full 768 dimensions with no folding. After that, `oms embed` and vector search need no environment variables.
115
+
116
+ To choose your own model instead, set `OMS_EMBEDDING_PROVIDER` + `OMS_EMBEDDING_MODEL` (`gguf` with a local GGUF path, or `upstage` with a model id and `UPSTAGE_API_KEY`). Setting only one of the pair is an error naming both, never a silent fallback.
117
+
118
+ Without any model, lexical search, graph-based retrieval, and convention validation all still work; only vector and HyDE requests are refused, and they say which variables to set.
114
119
 
115
120
  ## Development
116
121
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oms",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "Oh My Second Brain convention layer for Obsidian vaults — Hermes skill bundle and MCP adapter.",
5
5
  "_note": "oms install writes ~/.hermes/config.yaml mcp_servers.oms and installs skills under ~/.hermes/skills/knowledge-management/oms/."
6
6
  }
@@ -24,6 +24,8 @@ export interface ParsedCliArgs {
24
24
  readonly conventionNote: boolean;
25
25
  readonly embeddingDescriptorPath: string | undefined;
26
26
  readonly embeddingNoDefault: boolean;
27
+ /** setup: install the pinned default embedding model. */
28
+ readonly embeddingDefault: boolean;
27
29
  readonly unknownFlags: readonly string[];
28
30
  readonly error: CliArgumentError | undefined;
29
31
  }
package/dist/cli/args.js CHANGED
@@ -32,6 +32,7 @@ export function parseCliArgs(argv, cwd = process.cwd()) {
32
32
  let conventionNote = true;
33
33
  let embeddingDescriptorPath;
34
34
  let embeddingNoDefault = false;
35
+ let embeddingDefault = false;
35
36
  const unknownFlags = [];
36
37
  for (let i = 1; i < argv.length; i++) {
37
38
  const arg = argv[i];
@@ -111,6 +112,9 @@ export function parseCliArgs(argv, cwd = process.cwd()) {
111
112
  else if (arg === "--embedding-no-default") {
112
113
  embeddingNoDefault = true;
113
114
  }
115
+ else if (arg === "--embedding-default") {
116
+ embeddingDefault = true;
117
+ }
114
118
  else if (arg !== undefined) {
115
119
  unknownFlags.push(arg);
116
120
  }
@@ -136,6 +140,7 @@ export function parseCliArgs(argv, cwd = process.cwd()) {
136
140
  conventionNote,
137
141
  embeddingDescriptorPath,
138
142
  embeddingNoDefault,
143
+ embeddingDefault,
139
144
  unknownFlags,
140
145
  error: undefined,
141
146
  };
@@ -161,6 +166,7 @@ export function parseCliArgs(argv, cwd = process.cwd()) {
161
166
  conventionNote,
162
167
  embeddingDescriptorPath,
163
168
  embeddingNoDefault,
169
+ embeddingDefault,
164
170
  unknownFlags,
165
171
  error: new CliArgumentError(message),
166
172
  };
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,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;YACb,OAAO;YACP,cAAc;YACd,uBAAuB;YACvB,kBAAkB;YAClB,gBAAgB;YAChB,YAAY;YACZ,KAAK,EAAE,IAAI,gBAAgB,CAAC,OAAO,CAAC;SACrC,CAAC;IACJ,CAAC;AACH,CAAC"}
package/dist/cli/oms.js CHANGED
@@ -7,6 +7,7 @@ import { runPreToolUse } from "../vendors/claude/hook/pre-tool-use.js";
7
7
  import { resolveEffectiveVault } from "../kernel/link/link.js";
8
8
  import { runMcpServer } from "../mcp/server.js";
9
9
  import { resolveBundledAssetPaths } from "../kernel/runtime/assets.js";
10
+ import { PINNED_DEFAULT_EMBEDDING_MODEL } from "../kernel/engine/embed/model.js";
10
11
  import { parseCliArgs } from "./args.js";
11
12
  import { runAudit } from "./audit.js";
12
13
  import { runDoctor, runLint } from "./doctor-lint.js";
@@ -42,7 +43,7 @@ async function main() {
42
43
  process.exitCode = 1;
43
44
  return;
44
45
  }
45
- let { command, vault, vaultExplicit, yes, apply, installClaude, suggestFields, runtime, dryRun, executeExternal, checkUpdate, timeoutMs, agentVault, verbose, json, maxPerConcept, folders, conventionNote, embeddingDescriptorPath, embeddingNoDefault, unknownFlags, } = parsedArgs;
46
+ let { command, vault, vaultExplicit, yes, apply, installClaude, suggestFields, runtime, dryRun, executeExternal, checkUpdate, timeoutMs, agentVault, verbose, json, maxPerConcept, folders, conventionNote, embeddingDescriptorPath, embeddingNoDefault, embeddingDefault, unknownFlags, } = parsedArgs;
46
47
  // `mcp` keeps the FULL resolution result: the write surface trusts every
47
48
  // source except `cwd`, so the server needs the source, not just the path.
48
49
  let mcpTarget;
@@ -72,10 +73,23 @@ async function main() {
72
73
  vault = (await resolveEffectiveVault(process.cwd(), process.env)).vault;
73
74
  }
74
75
  if (command === "setup") {
76
+ const embeddingChoices = [
77
+ embeddingDescriptorPath !== undefined ? "--embedding-descriptor" : undefined,
78
+ embeddingDefault ? "--embedding-default" : undefined,
79
+ embeddingNoDefault ? "--embedding-no-default" : undefined,
80
+ ].filter((flag) => flag !== undefined);
81
+ if (embeddingChoices.length > 1) {
82
+ console.error(`[oms] Choose one embedding option, not ${embeddingChoices.join(" and ")}.`);
83
+ process.exitCode = 1;
84
+ return;
85
+ }
75
86
  let embeddingDescriptor;
76
87
  if (embeddingDescriptorPath !== undefined) {
77
88
  embeddingDescriptor = JSON.parse(readFileSync(embeddingDescriptorPath, "utf8"));
78
89
  }
90
+ else if (embeddingDefault) {
91
+ embeddingDescriptor = PINNED_DEFAULT_EMBEDDING_MODEL;
92
+ }
79
93
  else if (embeddingNoDefault) {
80
94
  embeddingDescriptor = null;
81
95
  }
@@ -1 +1 @@
1
- {"version":3,"file":"oms.js","sourceRoot":"","sources":["../../src/cli/oms.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,GAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EA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,CAAC,CAAC;QACzC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
package/dist/cli/usage.js CHANGED
@@ -1,6 +1,14 @@
1
1
  import { harnessSurfaceRegistry } from "../kernel/harness/surface-registry.js";
2
2
  const MAIN_USAGE_COMMANDS = [
3
- { name: "setup", line: " setup Adopt an existing vault into the Oh My Second Brain convention." },
3
+ {
4
+ name: "setup",
5
+ line: " setup Adopt an existing vault into the Oh My Second Brain convention.",
6
+ detailLines: [
7
+ " --embedding-default Install the pinned local embedding model (EmbeddingGemma-300M, 768d).",
8
+ " --embedding-descriptor <path> Install an operator-supplied model descriptor instead.",
9
+ " --embedding-no-default Waive model installation; vector search stays unavailable.",
10
+ ],
11
+ },
4
12
  { name: "install", line: " install Install Oh My Second Brain host adapters and MCP registration." },
5
13
  { name: "uninstall", line: " uninstall Remove Oh My Second Brain host adapters and MCP registration." },
6
14
  { name: "update", line: " update Check for or apply an explicit package update, then refresh host adapters." },
@@ -61,6 +69,7 @@ oh-my-second-brain — Oh My Second Brain convention layer for Obsidian vaults
61
69
 
62
70
  Usage:
63
71
  oh-my-second-brain setup [--vault <path>] [--yes] [--suggest-fields] [--install-claude]
72
+ [--embedding-default | --embedding-descriptor <path> | --embedding-no-default]
64
73
  oh-my-second-brain install [--vault <path>] [--runtime <${runtime}>] [--dry-run] [--execute] [--yes] [--json]
65
74
  oh-my-second-brain uninstall [--runtime <all|${registry.hosts.map((host) => host.runtime).join("|")}>] [--dry-run] [--execute] [--yes] [--json]
66
75
  oh-my-second-brain update [--check] [--dry-run] [--yes] [--runtime <${runtime}>] [--vault <path>]
@@ -94,6 +103,14 @@ Options:
94
103
  --apply linkify: rewrite notes in place; must be combined with --yes.
95
104
  --no-convention-note
96
105
  link: skip writing the managed OMS usage block to AGENTS.md.
106
+ --embedding-default
107
+ setup: download and verify the pinned EmbeddingGemma-300M model into the
108
+ user-level cache, then select it for \`oms embed\` and vector search without
109
+ requiring OMS_EMBEDDING_PROVIDER / OMS_EMBEDDING_MODEL.
110
+ --embedding-descriptor <path>
111
+ setup: install an operator-supplied model descriptor (SHA-256 verified).
112
+ --embedding-no-default
113
+ setup: explicitly install no model; lexical search still works.
97
114
  `;
98
115
  }
99
116
  export function printUsage() {
@@ -1 +1 @@
1
- {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/cli/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAS/E,MAAM,mBAAmB,GAAgC;IACvD,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,4EAA4E,EAAE;IACrG,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,2EAA2E,EAAE;IACtG,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,2EAA2E,EAAE;IACxG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,uFAAuF,EAAE;IACjH,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,qGAAqG,EAAE;IAC/H;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,qFAAqF;QAC3F,WAAW,EAAE;YACX,iFAAiF;YACjF,+EAA+E;YAC/E,yFAAyF;SAC1F;KACF;IACD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4EAA4E,EAAE;IACpG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qFAAqF,EAAE;IAC7G;QACE,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,+FAA+F;QACrG,WAAW,EAAE;YACX,4FAA4F;YAC5F,kGAAkG;SACnG;KACF;IACD,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,gEAAgE,EAAE;IAC5F,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,oDAAoD,EAAE;IAC3E;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,+EAA+E;QACrF,WAAW,EAAE;YAC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AAI,OAAO,CAAC,WAAW,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,QAAgC;IACtD,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,WAAmC,sBAAsB;IACpF,MAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IACzC,OAAO;;;;;;4DAMmD,OAAO;iDAClB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;wEAC7B,OAAO;;;;;;;;;;;;;;EAc7E,YAAY,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAyBvB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;AAC9B,CAAC"}
@@ -14,8 +14,9 @@ import type { Chunk, ChunkerOptions } from "../types.js";
14
14
  * - vault-relative `docPath`
15
15
  * - zero-based `ordinal` within the document
16
16
  * - raw `text`
17
+ * - `title` — the document title, prepended to this chunk's embedding input
17
18
  * - `headingPath` — breadcrumb from doc root to the chunk's section
18
- * - `sha` — SHA-256 hex digest of `text` for change-detection
19
+ * - `sha` — SHA-256 digest of `title` + `text` for change-detection
19
20
  *
20
21
  * When a section exceeds `maxTokens`, it is further split line by line until
21
22
  * each emitted chunk fits the budget. Overlap lines from the previous flush
@@ -6,6 +6,8 @@
6
6
  * zero verbatim code. See ACKNOWLEDGMENTS.md for attribution.
7
7
  */
8
8
  import { createHash } from "node:crypto";
9
+ import { parseNote } from "../../conventions/frontmatter.js";
10
+ import { UNTITLED_DOCUMENT_TITLE } from "../types.js";
9
11
  const DEFAULT_MAX_TOKENS = 900;
10
12
  const DEFAULT_OVERLAP_RATIO = 0.15;
11
13
  // ---------------------------------------------------------------------------
@@ -45,9 +47,81 @@ function isCjk(cp) {
45
47
  (cp >= 0x20000 && cp <= 0x2fa1f) // CJK Ext B–F + compatibility supplement
46
48
  );
47
49
  }
48
- /** SHA-256 hex digest of text for change-detection. */
49
- function sha256(text) {
50
- return createHash("sha256").update(text).digest("hex");
50
+ /**
51
+ * SHA-256 change-detection digest over everything that reaches the embedding
52
+ * input: the document title AND the chunk text.
53
+ *
54
+ * The title must be inside the digest. It is prepended to every chunk's
55
+ * embedding input, so a digest over `text` alone would report "unchanged" for
56
+ * each chunk that does not itself contain the title line — leaving vectors that
57
+ * still encode the OLD title after a retitle.
58
+ *
59
+ * The title is length-prefixed rather than merely separated. A bare separator is
60
+ * only unambiguous while the inputs cannot contain it, and nothing forbids a NUL
61
+ * in note text: with a plain separator, `("a", "\0b")` and `("a\0", "b")` hash
62
+ * identically, so a crafted retitle could impersonate a body edit and suppress
63
+ * re-embedding. The length prefix makes the encoding injective for every input.
64
+ */
65
+ function chunkDigest(title, text) {
66
+ return createHash("sha256")
67
+ .update(`${title.length}\u0000${title}\u0000${text}`)
68
+ .digest("hex");
69
+ }
70
+ /**
71
+ * Find the first ATX H1 in a markdown body, ignoring fenced code blocks.
72
+ *
73
+ * A `# ...` line inside a fence is sample content, not the document's heading.
74
+ * Scanning without fence tracking would let a README-style note that shows a
75
+ * markdown example be titled by that example. Both backtick and tilde fences
76
+ * count, and a fence closes only on a run of the same character at least as
77
+ * long as the one that opened it, so a fence containing a shorter run stays
78
+ * open as CommonMark specifies.
79
+ */
80
+ function firstHeadingTitle(body) {
81
+ let fence = null;
82
+ for (const line of body.split("\n")) {
83
+ const fenceMatch = /^ {0,3}(`{3,}|~{3,})/.exec(line);
84
+ if (fenceMatch !== null) {
85
+ const run = fenceMatch[1];
86
+ const char = run[0];
87
+ if (fence === null) {
88
+ fence = { char, length: run.length };
89
+ }
90
+ else if (char === fence.char && run.length >= fence.length) {
91
+ fence = null;
92
+ }
93
+ continue;
94
+ }
95
+ if (fence !== null)
96
+ continue;
97
+ const heading = /^#\s+(.+)$/.exec(line);
98
+ const title = heading?.[1]?.trim();
99
+ if (title !== undefined && title !== "")
100
+ return title;
101
+ }
102
+ return undefined;
103
+ }
104
+ /**
105
+ * The document title carried into every chunk's embedding input.
106
+ *
107
+ * Frontmatter `title` wins, then the first ATX H1 in the body, else the
108
+ * untitled literal. Reuses the shared convention parser rather than
109
+ * re-deriving frontmatter here.
110
+ *
111
+ * The H1 scan is deliberately confined to `parsed.body`. Scanning the raw
112
+ * document would read frontmatter too, where a YAML comment (`# note to self`)
113
+ * is syntactically indistinguishable from an H1 — which would embed private
114
+ * metadata as though it were the note's title. A document whose frontmatter
115
+ * fence never closes therefore has an empty body and is untitled: `none` is the
116
+ * honest answer for a malformed document, and preferable to guessing from a
117
+ * region that is not body text.
118
+ */
119
+ function documentTitle(rawText) {
120
+ const parsed = parseNote(rawText);
121
+ const declared = parsed.frontmatter["title"];
122
+ if (typeof declared === "string" && declared.trim() !== "")
123
+ return declared.trim();
124
+ return firstHeadingTitle(parsed.body) ?? UNTITLED_DOCUMENT_TITLE;
51
125
  }
52
126
  /**
53
127
  * Update a mutable heading-path array given a newly encountered ATX heading.
@@ -69,8 +143,9 @@ function applyHeading(current, level, title) {
69
143
  * - vault-relative `docPath`
70
144
  * - zero-based `ordinal` within the document
71
145
  * - raw `text`
146
+ * - `title` — the document title, prepended to this chunk's embedding input
72
147
  * - `headingPath` — breadcrumb from doc root to the chunk's section
73
- * - `sha` — SHA-256 hex digest of `text` for change-detection
148
+ * - `sha` — SHA-256 digest of `title` + `text` for change-detection
74
149
  *
75
150
  * When a section exceeds `maxTokens`, it is further split line by line until
76
151
  * each emitted chunk fits the budget. Overlap lines from the previous flush
@@ -83,6 +158,7 @@ export function chunkDocument(docPath, rawText, opts = {}) {
83
158
  const overlapLineCount = Math.max(1, Math.round(10 * overlapRatio));
84
159
  const lines = rawText.split("\n");
85
160
  const chunks = [];
161
+ const title = documentTitle(rawText);
86
162
  let ordinal = 0;
87
163
  let buffer = [];
88
164
  let headingPath = [];
@@ -96,8 +172,9 @@ export function chunkDocument(docPath, rawText, opts = {}) {
96
172
  docPath,
97
173
  ordinal: ordinal++,
98
174
  text,
175
+ title,
99
176
  headingPath: headingPath.slice(),
100
- sha: sha256(text),
177
+ sha: chunkDigest(title, text),
101
178
  });
102
179
  // Carry the last N lines as overlap into the next chunk
103
180
  buffer = buffer.slice(-overlapLineCount);
@@ -122,8 +199,9 @@ export function chunkDocument(docPath, rawText, opts = {}) {
122
199
  docPath,
123
200
  ordinal: ordinal++,
124
201
  text: remaining,
202
+ title,
125
203
  headingPath: headingPath.slice(),
126
- sha: sha256(remaining),
204
+ sha: chunkDigest(title, remaining),
127
205
  });
128
206
  }
129
207
  return chunks;
@@ -1 +1 @@
1
- {"version":3,"file":"chunker.js","sourceRoot":"","sources":["../../../../src/kernel/engine/embed/chunker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E;;;;;;;;;;GAUG;AACH,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,KAAK,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;QACtB,QAAQ,IAAI,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,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E,KAAK,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElB,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC;YACjD,KAAK,EAAE,CAAC;QACV,CAAC;IACH,CAAC;IAED,4BAA4B;IAC5B,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3C,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,CAAC,IAAI,CAAC;YACV,OAAO;YACP,OAAO,EAAE,OAAO,EAAE;YAClB,IAAI,EAAE,SAAS;YACf,KAAK;YACL,WAAW,EAAE,WAAW,CAAC,KAAK,EAAE;YAChC,GAAG,EAAE,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC;SACnC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -3,6 +3,32 @@ export declare const EMBEDDING_PROVIDER_ENV: "OMS_EMBEDDING_PROVIDER";
3
3
  export declare const EMBEDDING_MODEL_ENV: "OMS_EMBEDDING_MODEL";
4
4
  export declare const INSTALLED_DEFAULT_DESCRIPTOR = "default-model.json";
5
5
  export declare const CAPABILITY_RECEIPT = "capability-receipt.json";
6
+ /**
7
+ * The one pinned default embedding model, offered by `oms setup --embedding-default`.
8
+ *
9
+ * This is the same model qmd resolves from its own `DEFAULT_EMBED_MODEL_URI`
10
+ * (`hf:ggml-org/embeddinggemma-300M-GGUF/embeddinggemma-300M-Q8_0.gguf`), so a
11
+ * vault indexed by `oms embed` gets that toolchain's retrieval quality rather
12
+ * than a lesser stand-in. `dimensions` is the model's native width and is
13
+ * stored unfolded (ADR-007 P-A); `mrlDim: 0` records that no Matryoshka
14
+ * truncation is applied.
15
+ *
16
+ * This constant is NOT a fallback. `resolveEmbeddingModel` never reaches for
17
+ * it, because an implicit default would defeat the E-1 no-default contract in
18
+ * `src/kernel/measurement/no-default-contract.ts`: with no environment pair and
19
+ * an empty cache, embedding capability must stay honestly unavailable. The only
20
+ * consumer is the explicit setup acquisition path, which verifies `sha256`
21
+ * against the downloaded bytes before publishing them.
22
+ *
23
+ * `prefixScheme` reproduces EmbeddingGemma's asymmetric prompts byte-for-byte
24
+ * as qmd formats them in `formatQueryForEmbedding` / `formatDocForEmbedding`,
25
+ * including the document title: `{title}` is substituted per chunk, matching
26
+ * qmd's `title: <title> | text: <text>` document prompt.
27
+ */
28
+ export declare const PINNED_DEFAULT_EMBEDDING_MODEL: EmbeddingModelDescriptor & {
29
+ readonly url: string;
30
+ readonly sha256: string;
31
+ };
6
32
  /** Metadata needed to use an installed embedding model. */
7
33
  export interface EmbeddingModelDescriptor {
8
34
  readonly provider: string;