@gmickel/gno 2.10.1 → 2.12.0

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.
Files changed (112) hide show
  1. package/README.md +11 -11
  2. package/assets/skill/SKILL.md +27 -15
  3. package/assets/skill/cli-reference.md +6 -5
  4. package/assets/skill/examples.md +16 -12
  5. package/assets/skill/mcp-reference.md +2 -1
  6. package/assets/spa-production.json.gz +0 -0
  7. package/browser-extension/artifacts/{gno-browser-clipper-v2.10.1.zip → gno-browser-clipper-v2.12.0.zip} +0 -0
  8. package/browser-extension/artifacts/gno-browser-clipper-v2.12.0.zip.sha256 +1 -0
  9. package/browser-extension/dist/manifest.json +1 -1
  10. package/package.json +10 -5
  11. package/spec/cli.md +127 -35
  12. package/spec/evals-agentic.md +3 -1
  13. package/spec/mcp.md +36 -6
  14. package/spec/output-schemas/ask.schema.json +8 -0
  15. package/spec/output-schemas/claim-verification.schema.json +8 -2
  16. package/spec/output-schemas/context-capsule-v1.schema.json +6 -1
  17. package/spec/output-schemas/context-capsule-verification.schema.json +4 -2
  18. package/spec/output-schemas/get.schema.json +4 -0
  19. package/spec/output-schemas/metadata-summary.schema.json +60 -0
  20. package/spec/output-schemas/multi-get.schema.json +4 -0
  21. package/spec/output-schemas/search-result.schema.json +4 -0
  22. package/spec/output-schemas/search-results.schema.json +4 -0
  23. package/spec/output-schemas/status.schema.json +28 -0
  24. package/src/app/constants.ts +16 -0
  25. package/src/app/context-agent-projection.ts +10 -1
  26. package/src/app/context-format.ts +1 -0
  27. package/src/app/verified-ask.ts +2 -0
  28. package/src/cli/commands/agents/block.ts +10 -9
  29. package/src/cli/commands/agents/commands.ts +6 -5
  30. package/src/cli/commands/agents/engine.ts +15 -2
  31. package/src/cli/commands/agents/harnesses.ts +21 -14
  32. package/src/cli/commands/ask-format.ts +18 -1
  33. package/src/cli/commands/ask.ts +4 -5
  34. package/src/cli/commands/cleanup.ts +46 -6
  35. package/src/cli/commands/collection/remove.ts +1 -0
  36. package/src/cli/commands/collection/rename.ts +1 -0
  37. package/src/cli/commands/daemon.ts +5 -1
  38. package/src/cli/commands/doctor.ts +37 -0
  39. package/src/cli/commands/get.ts +11 -1
  40. package/src/cli/commands/mcp/paths.ts +2 -1
  41. package/src/cli/commands/metadata.ts +79 -0
  42. package/src/cli/commands/multi-get.ts +13 -0
  43. package/src/cli/commands/setup-semantic.ts +6 -1
  44. package/src/cli/commands/shared.ts +35 -8
  45. package/src/cli/commands/skill/paths.ts +20 -2
  46. package/src/cli/commands/status.ts +89 -15
  47. package/src/cli/format/search-results.ts +11 -0
  48. package/src/cli/options.ts +2 -0
  49. package/src/cli/program.ts +64 -3
  50. package/src/core/activation-probe-plan.ts +0 -1
  51. package/src/core/config-mutation.ts +72 -55
  52. package/src/core/context-capsule-schema.ts +2 -0
  53. package/src/core/context-capsule-verification.ts +2 -0
  54. package/src/core/context-compiler.ts +2 -5
  55. package/src/core/context-evidence.ts +1 -0
  56. package/src/core/context-verifier.ts +14 -1
  57. package/src/core/memory-remember.ts +0 -1
  58. package/src/core/metadata-discovery.ts +169 -0
  59. package/src/core/module-path.ts +33 -0
  60. package/src/core/runtime-entrypoint.ts +3 -1
  61. package/src/ingestion/file-processor.ts +6 -3
  62. package/src/ingestion/prepare-file.ts +14 -4
  63. package/src/ingestion/source-availability/root.ts +138 -0
  64. package/src/ingestion/sync.ts +35 -1
  65. package/src/ingestion/walker.ts +11 -3
  66. package/src/llm/native-worker/client.ts +8 -4
  67. package/src/llm/native-worker/errors.ts +26 -3
  68. package/src/mcp/http-egress.ts +1 -0
  69. package/src/mcp/http-transport.ts +7 -2
  70. package/src/mcp/server.ts +3 -0
  71. package/src/mcp/tool-descriptions-core.ts +3 -3
  72. package/src/mcp/tool-profile.ts +16 -1
  73. package/src/mcp/tools/get.ts +10 -0
  74. package/src/mcp/tools/index.ts +68 -4
  75. package/src/mcp/tools/multi-get.ts +15 -0
  76. package/src/mcp/tools/query.ts +5 -3
  77. package/src/mcp/tools/search.ts +5 -3
  78. package/src/mcp/tools/status.ts +17 -2
  79. package/src/mcp/tools/vsearch.ts +5 -3
  80. package/src/mcp/tools/workspace-write.ts +42 -34
  81. package/src/pipeline/answer-prompt.ts +15 -2
  82. package/src/pipeline/answer.ts +3 -0
  83. package/src/pipeline/claim-verification-schema.ts +6 -1
  84. package/src/pipeline/claim-verification.ts +54 -1
  85. package/src/pipeline/explain.ts +1 -1
  86. package/src/pipeline/fusion.ts +24 -4
  87. package/src/pipeline/hybrid.ts +5 -1
  88. package/src/pipeline/query-snippet.ts +266 -0
  89. package/src/pipeline/result-context.ts +29 -0
  90. package/src/pipeline/search.ts +154 -20
  91. package/src/pipeline/types.ts +4 -0
  92. package/src/pipeline/vsearch.ts +5 -1
  93. package/src/sdk/client.ts +46 -6
  94. package/src/sdk/documents.ts +5 -0
  95. package/src/sdk/types.ts +11 -1
  96. package/src/serve/public/components/ThoroughnessSelector.tsx +1 -1
  97. package/src/serve/public/globals.built.css +1 -1
  98. package/src/serve/public/pages/Collections.tsx +8 -0
  99. package/src/serve/public/pages/Search.tsx +9 -1
  100. package/src/serve/resident-request.ts +8 -0
  101. package/src/serve/resident-runtime.ts +25 -3
  102. package/src/serve/routes/api.ts +29 -1
  103. package/src/serve/server.ts +12 -0
  104. package/src/serve/spa-production-build.ts +7 -3
  105. package/src/serve/status-model.ts +2 -0
  106. package/src/serve/status.ts +29 -0
  107. package/src/sessions/config-refresh.ts +6 -0
  108. package/src/sessions/import-child.ts +4 -1
  109. package/src/store/sqlite/adapter.ts +241 -20
  110. package/src/store/types.ts +61 -7
  111. package/src/store/vector/variant-search.ts +112 -74
  112. package/browser-extension/artifacts/gno-browser-clipper-v2.10.1.zip.sha256 +0 -1
package/README.md CHANGED
@@ -139,7 +139,7 @@ See the [guide](docs/COMPILED-CONTEXT.md).
139
139
 
140
140
  <!-- public-truth:current-version -->
141
141
 
142
- > Current source version: **v2.10.1**. See [CHANGELOG.md](./CHANGELOG.md).
142
+ > Current source version: **v2.12.0**. See [CHANGELOG.md](./CHANGELOG.md).
143
143
 
144
144
  <!-- /public-truth -->
145
145
 
@@ -580,12 +580,12 @@ Full guide: [SDK docs](https://gno.sh/docs/sdk)
580
580
 
581
581
  ## Search Modes
582
582
 
583
- | Command | Mode | Best For |
584
- | :----------------- | :------------------ | :---------------------------------------- |
585
- | `gno search` | Document-level BM25 | Exact phrases, code identifiers |
586
- | `gno vsearch` | Contextual Vector | Natural language, concepts |
587
- | `gno query` | Hybrid | Best accuracy (BM25 + vector + reranking) |
588
- | `gno ask --answer` | RAG | Direct answers with citations |
583
+ | Command | Mode | Best For |
584
+ | :----------------- | :------------------ | :------------------------------------------ |
585
+ | `gno search` | Document-level BM25 | Exact phrases, code identifiers |
586
+ | `gno vsearch` | Contextual Vector | Similar concepts, different wording |
587
+ | `gno query` | Hybrid | Natural-language questions (`--fast` first) |
588
+ | `gno ask --answer` | RAG | Direct answers with citations |
589
589
 
590
590
  **BM25** indexes full documents (not chunks) with Snowball stemming, so "running" matches "run".
591
591
  **Vector** embeds chunks with document titles for context awareness.
@@ -715,10 +715,10 @@ Connect GNO to Claude Desktop, Cursor, Raycast, and more:
715
715
 
716
716
  ![GNO MCP](./assets/screenshots/mcp.jpg)
717
717
 
718
- GNO exposes 37 tools by default via [Model Context Protocol](https://modelcontextprotocol.io),
718
+ GNO exposes 38 tools by default via [Model Context Protocol](https://modelcontextprotocol.io),
719
719
  including the core retrieval tools below. Starting MCP with `--enable-write`
720
720
  adds 21 opt-in mutation tools and the read-only `gno_request_status` lookup,
721
- for 59 total.
721
+ for 60 total.
722
722
 
723
723
  | Tool | Description |
724
724
  | :------------------- | :---------------------------------------------- |
@@ -1109,7 +1109,7 @@ graph TD
1109
1109
  0. **Strong Signal Check**: Skip expansion if BM25 has confident match (saves 1-3s)
1110
1110
  1. **Query Expansion**: LLM generates lexical variants, semantic rephrases, and a [HyDE](https://arxiv.org/abs/2212.10496) passage
1111
1111
  2. **Parallel Retrieval**: Document-level BM25 + chunk-level vector search on all variants
1112
- 3. **Fusion**: RRF with 2× weight for original query, tiered bonus for top ranks
1112
+ 3. **Fusion**: RRF over documents (each list counts a document once, at its best chunk's rank), 2× weight for original query, tiered bonus for top ranks
1113
1113
  4. **Reranking**: Qwen3-Reranker scores best chunk per document (4K), blended with fusion
1114
1114
 
1115
1115
  > **Deep dive**: [How Search Works](https://gno.sh/docs/how-search-works)
@@ -1129,7 +1129,7 @@ graph TD
1129
1129
  | **Local LLM** | AI answers via llama.cpp, no API keys |
1130
1130
  | **Remote Inference** | Optional HTTP endpoints for embedding, reranking, expansion, and generation |
1131
1131
  | **Privacy First** | Fail-closed per-collection egress policy; no telemetry; explicit network use |
1132
- | **MCP Server** | 10 automatic client targets; 37 read-only tools, 59 with writes enabled |
1132
+ | **MCP Server** | 10 automatic client targets; 38 read-only tools, 60 with writes enabled |
1133
1133
  | **Integrity Audits** | Offline link, declared-provenance, and freshness reports with stable IDs |
1134
1134
  | **Knowledge Delta** | Bounded metadata history, structural diffs, and dependency impact paths |
1135
1135
  | **Context Capsules** | Deterministic evidence bundles plus saved-file freshness reverification |
@@ -136,17 +136,25 @@ Open without fetching content via `gno get`:
136
136
 
137
137
  ## Search Modes
138
138
 
139
- | Command | Speed | Best For |
140
- | ---------------------- | ------- | ----------------------------------- |
141
- | `gno search` | instant | Exact keyword matching |
142
- | `gno vsearch` | ~0.5s | Finding similar concepts |
143
- | `gno query --fast` | ~0.7s | Quick lookups |
144
- | `gno query` | ~2-3s | Balanced (default) |
145
- | `gno query --thorough` | ~5-8s | Best recall, complex queries |
146
- | `gno ask --answer` | ~3-5s | AI-generated answer with citations |
147
- | `gno ask --verify` | varies | Closed-Capsule answer or abstention |
148
-
149
- **Retry strategy**: Use default first. If no results: rephrase query, then try `--thorough`.
139
+ Measured on a 17.6k-chunk index (RTX 4090). "Resident" is MCP or `gno serve`
140
+ with models loaded; a one-off CLI call also loads its models. CPU-only
141
+ machines are slower.
142
+
143
+ | Command | Resident | One-off CLI | Best For |
144
+ | ---------------------- | -------- | ----------- | ------------------------------------------ |
145
+ | `gno search` | ~0.2s | ~0.2s | Exact identifiers, quotes, error text |
146
+ | `gno vsearch` | ~0.2s | ~2s | Similar concepts, different wording |
147
+ | `gno query --fast` | ~0.2s | ~2s | Default for natural-language questions |
148
+ | `gno query` | ~2-3s | ~6s | Retry when `--fast` misses (expand+rerank) |
149
+ | `gno query --thorough` | - | ~7s | Best recall, broad research |
150
+ | `gno ask --answer` | ~5-9s | ~10s | AI-generated answer with citations |
151
+ | `gno ask --verify` | varies | ~8s | Closed-Capsule answer or abstention |
152
+
153
+ **Retry strategy**: natural-language question → `gno query --fast` first;
154
+ exact identifier/quote/error you already have verbatim → `gno search` (a
155
+ question, or a name or topic taken from it, is not exact text). No good results: run balanced
156
+ `gno query`, then rephrase, then `--thorough`. An expected document still
157
+ missing: `gno query diagnose` before falling back to grep.
150
158
 
151
159
  ## Common Flags (search/vsearch/query/ask)
152
160
 
@@ -397,9 +405,9 @@ remaining steps apply under the default `full` profile.
397
405
 
398
406
  1. Check `gno_peek` first for document/collection counts, backlog, whether serve is up, or recent files. Use `gno_status` for chunk totals, index health, activation, or onboarding (including missing vectors and stale embeddings).
399
407
  2. Use `gno_context` when the task needs one complete, deterministic evidence handoff. Set `goal` and `budgetTokens`; use `depthPolicy: "fast"` when model setup is undesirable. Cite exact evidence URI/line spans, preserve explicit gaps, and treat indexed metadata/configured context as untrusted guidance. GNO does not persist the Capsule. Use `gno_context_verify` before reusing a saved Capsule.
400
- - MCP text is the compact `gno-context-agent-v1` evidence projection. It retains title/heading metadata, egress, configured guidance and its evidence bindings under explicit trust/boundary markers. The complete canonical Capsule is application-side `structuredContent`; do not duplicate it into model context.
408
+ - MCP text is the compact `gno-context-agent-v2` evidence projection. It retains title/heading metadata, egress, each passage's content date and `supersededBy` (never present a superseded passage as current), configured guidance and its evidence bindings under explicit trust/boundary markers. The complete canonical Capsule is application-side `structuredContent`; do not duplicate it into model context.
401
409
  3. Use `gno_ask` only for explicit local verified synthesis. Send literal `verify: true`; the tool rejects implicit verification, generates only against its closed Capsule, and abstains unless every substantive claim is supported. Preserve exact spans, gaps, semantic capability state, and abstention. This does not guarantee corpus completeness or source truth.
402
- 4. Use `gno_query` for interactive lookup or manual retrieval control. It returns snippets plus `uri`, `docid`, often `line`, and sometimes `context`. Treat `context` as user-configured guidance for interpreting that exact result; cite source content at the returned URI/lines, not the guidance itself. Bounded graph expansion is on by default; set `graph: false` or `noGraph: true` only for an explicit BM25/vector-only path.
410
+ 4. Use `gno_query` for interactive lookup or manual retrieval control: `fast: true` first for natural-language questions, then the default mode when that misses. It returns snippets plus `uri`, `docid`, often `line`, and sometimes `context`. Treat `context` as user-configured guidance for interpreting that exact result; cite source content at the returned URI/lines, not the guidance itself. Bounded graph expansion is on by default; set `graph: false` or `noGraph: true` only for an explicit BM25/vector-only path.
403
411
  5. Use graph/link expansion for relationship context: `gno_graph_query` for typed relationship traversal, `gno_graph_neighbors` for nearby documents, `gno_graph_path` for "how are X and Y connected?", `gno_links`/`gno_backlinks` for one-document link expansion, and `gno_similar` for semantic neighbors. Prefer explicit or typed edges over inferred, ambiguous, or similarity edges when confidence matters. Plain `[[Note]]` links resolve across collections of the same vault (link workspace), so backlinks and impact can name other collections; pass `collection`/`collections` to keep results inside the user's scope. Never tell users to rewrite links into `[[collection:Note]]` to make them resolve.
404
412
  6. Use `gno_query_diagnose` when a known target document should have appeared but did not; it reports BM25/vector/fusion/graph/rerank stage presence and filter state.
405
413
  7. Use `gno_get` with `fromLine`/`lineCount` for targeted reads, or `gno_multi_get` to batch top refs.
@@ -598,6 +606,8 @@ existing notes. They work only on a collection with `memoryManaged: true`.
598
606
  re-stored as a new fact.
599
607
  - `remember` without a decision returns candidates and writes nothing; decide
600
608
  with `--add` or `--supersede <uri> --predecessor-hash <hash>` from recall.
609
+ - A result, document or citation with `supersededBy` is a replaced fact: use
610
+ the fact at that URI, never present the old one as current.
601
611
  - Details, error codes, and the fence's paraphrase limit: `docs/MEMORY.md`,
602
612
  [cli-reference.md](cli-reference.md), [mcp-reference.md](mcp-reference.md).
603
613
 
@@ -740,8 +750,10 @@ MCP-equivalent write tool:
740
750
 
741
751
  Use fixed flags for existing collection/tag/date/author/category fields. Custom
742
752
  fields must be indexed from nested YAML `gno.metadata`; arbitrary frontmatter
743
- keys are not automatically custom fields. CLI retrieval accepts `--filter`
744
- JSON; MCP/SDK/REST accept the same `filter` object:
753
+ keys are not automatically custom fields. Run `gno metadata --collection <c>`
754
+ (MCP `gno_list_metadata`) first to see which keys, types and values exist.
755
+ CLI retrieval accepts `--filter` JSON; MCP/SDK/REST accept the same `filter`
756
+ object:
745
757
 
746
758
  ```json
747
759
  {
@@ -424,11 +424,11 @@ gno query <query> [options]
424
424
 
425
425
  **Search modes** (pick one):
426
426
 
427
- | Flag | Time | Description |
428
- | ------------ | ----- | ------------------------------ |
429
- | `--fast` | ~0.7s | Skip expansion, graph, rerank |
430
- | (default) | ~2-3s | Balanced, graph + reranking |
431
- | `--thorough` | ~5-8s | Wider expansion + graph/rerank |
427
+ | Flag | Time | Description |
428
+ | ------------ | ------------------------ | ------------------------------ |
429
+ | `--fast` | ~2s CLI / ~0.2s resident | Skip expansion, graph, rerank |
430
+ | (default) | ~6s CLI / ~2-3s resident | Balanced, graph + reranking |
431
+ | `--thorough` | ~7s CLI | Wider expansion + graph/rerank |
432
432
 
433
433
  Additional options:
434
434
 
@@ -1203,6 +1203,7 @@ gno completion output <bash|zsh|fish>
1203
1203
  ## Custom metadata filters
1204
1204
 
1205
1205
  ```bash
1206
+ gno metadata --collection docs --values 20 # keys, types, counts, common values
1206
1207
  gno search "rollout" --filter '{"op":"eq","key":"status","value":"approved"}'
1207
1208
  gno query diagnose "rollout" --target gno://docs/decision.md --filter '{"op":"gte","key":"confidence","value":0.8}'
1208
1209
  ```
@@ -397,18 +397,22 @@ gno --config ~/gno-sessions/archive.yml --index sessions get "gno://sessions-wor
397
397
 
398
398
  ### Search Modes
399
399
 
400
- | Command | Time | Use When |
401
- | ---------------------- | ------- | ---------------------------- |
402
- | `gno search` | instant | Exact keyword matching |
403
- | `gno vsearch` | ~0.5s | Finding similar concepts |
404
- | `gno query --fast` | ~0.7s | Quick lookups |
405
- | `gno query` | ~2-3s | Default, balanced |
406
- | `gno query --thorough` | ~5-8s | Best recall, complex queries |
407
-
408
- **Agent retry strategy**: Use default mode first. If no results:
409
-
410
- 1. Rephrase the query (free, often helps)
411
- 2. Try `--thorough` for better recall
400
+ | Command | Resident | One-off CLI | Use When |
401
+ | ---------------------- | -------- | ----------- | ----------------------------------- |
402
+ | `gno search` | ~0.2s | ~0.2s | Exact identifiers, quotes, errors |
403
+ | `gno vsearch` | ~0.2s | ~2s | Finding similar concepts |
404
+ | `gno query --fast` | ~0.2s | ~2s | First try for any question |
405
+ | `gno query` | ~2-3s | ~6s | `--fast` missed; expansion + rerank |
406
+ | `gno query --thorough` | - | ~7s | Best recall, complex queries |
407
+
408
+ Measured on a 17.6k-chunk index (RTX 4090); resident means MCP or `gno serve`
409
+ with models loaded.
410
+
411
+ **Agent retry strategy**: `gno query --fast` first. If no good results:
412
+
413
+ 1. Run balanced `gno query` (adds expansion and reranking)
414
+ 2. Rephrase the query (free, often helps)
415
+ 3. Try `--thorough` for better recall
412
416
 
413
417
  ### Output formats
414
418
 
@@ -105,7 +105,8 @@ default `full` profile. Pick the profile once per client at install time with
105
105
  switch an existing registration); `gno mcp status` shows the profile each
106
106
  registration carries.
107
107
 
108
- For normal questions, start with `gno_query`, then read targeted snippets with
108
+ For normal questions, start with `gno_query` and `fast: true`; when that
109
+ misses, call it again without `fast`. Then read targeted snippets with
109
110
  `gno_get` or batch refs with `gno_multi_get`. Use `gno_context` for one bounded,
110
111
  exact evidence handoff. Use `gno_ask` only when a local closed-evidence answer
111
112
  is specifically useful, and pass the literal boolean `verify: true`; it
Binary file
@@ -0,0 +1 @@
1
+ af41e9b6f20acb402696b5d05f2901b50a7454669f3b9b89f44e1370004ff411 gno-browser-clipper-v2.12.0.zip
@@ -21,5 +21,5 @@
21
21
  "content_security_policy": {
22
22
  "extension_pages": "script-src 'self'; object-src 'none'; connect-src http://127.0.0.1:*"
23
23
  },
24
- "version": "2.10.1"
24
+ "version": "2.12.0"
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmickel/gno",
3
- "version": "2.10.1",
3
+ "version": "2.12.0",
4
4
  "description": "Local semantic search for your documents. Index Markdown, PDF, and Office files with hybrid BM25 + vector search.",
5
5
  "keywords": [
6
6
  "embeddings",
@@ -91,6 +91,7 @@
91
91
  "test:watcher:filesystem": "bun test test/serve/watch-service-filesystem.test.ts test/serve/resident-runtime.test.ts",
92
92
  "bench:watcher-reconciliation": "bun scripts/watcher-reconciliation-benchmark.ts",
93
93
  "bench:session-import": "bun scripts/session-import-benchmark.ts",
94
+ "bench:vector-search": "bun scripts/vector-search-benchmark.ts",
94
95
  "soak": "bun scripts/soak/index.ts",
95
96
  "smoke:watcher-reconciliation": "bun scripts/watcher-reconciliation-smoke.ts",
96
97
  "bench:code-embeddings": "bun scripts/code-embedding-benchmark.ts",
@@ -100,6 +101,7 @@
100
101
  "bench:cpu-embeddings": "bun scripts/cpu-embed-autoresearch.ts",
101
102
  "bench:cpu-embeddings:native-batch-probe": "bun scripts/native-embedding-batch-probe.ts",
102
103
  "bench:cjk-lexical": "bun scripts/cjk-lexical-benchmark.ts",
104
+ "eval:ranking-ablation": "bun scripts/ranking-ablation.ts",
103
105
  "eval:retrieval-candidates": "bun scripts/retrieval-candidate-benchmark.ts",
104
106
  "eval:retrieval-candidates:write": "bun scripts/retrieval-candidate-benchmark.ts --write",
105
107
  "eval:agentic": "bun evals/agentic/cli.ts",
@@ -168,8 +170,8 @@
168
170
  "@codemirror/lang-markdown": "6.5.2",
169
171
  "@codemirror/theme-one-dark": "6.1.3",
170
172
  "@joplin/turndown-plugin-gfm": "1.0.67",
171
- "@modelcontextprotocol/client": "2.0.0",
172
- "@modelcontextprotocol/server": "2.0.0",
173
+ "@modelcontextprotocol/client": "2.3.1",
174
+ "@modelcontextprotocol/server": "2.3.1",
173
175
  "@radix-ui/react-collapsible": "1.1.20",
174
176
  "@radix-ui/react-dialog": "1.1.23",
175
177
  "@radix-ui/react-dropdown-menu": "2.1.24",
@@ -221,7 +223,7 @@
221
223
  "react-markdown": "10.1.0",
222
224
  "rehype-sanitize": "6.0.0",
223
225
  "remark-gfm": "4.0.1",
224
- "sharp": "0.35.4",
226
+ "sharp": "0.35.5",
225
227
  "shiki": "4.4.3",
226
228
  "sqlite-vec": "0.1.9",
227
229
  "streamdown": "2.6.0",
@@ -258,7 +260,7 @@
258
260
  "playwright": "1.63.0",
259
261
  "pptxgenjs": "4.0.1",
260
262
  "ultracite": "7.1.5",
261
- "vitest": "4.1.10",
263
+ "vitest": "4.1.11",
262
264
  "web-tree-sitter": "0.26.13"
263
265
  },
264
266
  "peerDependencies": {
@@ -271,6 +273,9 @@
271
273
  "engines": {
272
274
  "bun": ">=1.4.1"
273
275
  },
276
+ "patchedDependencies": {
277
+ "evalite@1.0.0-beta.16": "patches/evalite@1.0.0-beta.16.patch"
278
+ },
274
279
  "trustedDependencies": [
275
280
  "bun",
276
281
  "node-llama-cpp"
package/spec/cli.md CHANGED
@@ -108,7 +108,7 @@ equivalent files fail closed as ambiguous.
108
108
  | models clear | no | no | no | no | no | terminal |
109
109
  | models path | yes | no | no | no | no | terminal |
110
110
  | publish export | yes | no | no | no | no | terminal |
111
- | cleanup | no | no | no | no | no | terminal |
111
+ | cleanup | yes | no | no | no | no | terminal |
112
112
  | doctor | yes | no | no | yes | no | terminal |
113
113
  | mcp | no | no | no | no | no | stdio |
114
114
  | mcp install | yes | no | no | no | no | terminal |
@@ -241,11 +241,15 @@ the model with `id`, `model`, `dimensions`, `state` (`active`|`shadow`),
241
241
  `compatibleRuntimes` (runtimes that read it) and `incompatibleRuntimes`.
242
242
  Terminal output prints a `Vector partitions:` block
243
243
  unless there is exactly one healthy partition. `collections`, `totalDocuments`
244
- and `totalChunks` cover configured collections only: a collection removed from
245
- config is not reported even while its rows remain in the index until the next
246
- command that syncs collections (`gno update`, `gno index`, `gno cleanup`). The
244
+ and `totalChunks` cover configured collections only. Opening an index never
245
+ deletes a collection that has documents: one the config does not list (removed
246
+ by hand, or a different config opened this index) is reported in
247
+ `staleCollections` (`name`, `documents`; omitted when empty) and under
248
+ `Collections not in this config` in text and Markdown, and every command other
249
+ than `status`, `doctor`, `cleanup` and `collection remove/rename` exits with an
250
+ error naming it until it is added back or `gno cleanup` deletes it. The
247
251
  embedding backlog likewise counts chunks of configured collections only.
248
- `gno collection remove` syncs at once, so no rows remain. `totalChunks` counts the
252
+ `gno collection remove` deletes the collection's documents at once. `totalChunks` counts the
249
253
  distinct chunks of active documents; chunks left by deleted documents do not
250
254
  count. Per-collection chunk totals remain deduplicated by canonical chunk;
251
255
  embedded counts require matching current inputs for every active owner within
@@ -363,6 +367,30 @@ Semantic and connector stages remain independent; passive status never starts a
363
367
  model runtime or connector process. `gno status` still exits 0 when activation
364
368
  is unhealthy so scripts can inspect the structured state.
365
369
 
370
+ Status checks every configured collection root when it runs, so the report
371
+ reflects the folder now, not the last sync. A root is unavailable when it
372
+ cannot be listed (the check `gno update` uses before proving a file deleted:
373
+ open the directory and read one entry). For `sourceAvailability: local`
374
+ collections the root is checked without listing it (`stat` as a directory, then
375
+ read and search permission via `access`), so status never lists, and so never
376
+ materializes, a dataless cloud folder; a partially present
377
+ cloud folder is not reported. The checks run concurrently and add no timeout
378
+ of their own. An unavailable root adds `rootError` to that collection:
379
+
380
+ ```json
381
+ "rootError": {
382
+ "code": "SOURCE_AVAILABILITY_UNKNOWN",
383
+ "message": "Collection root is missing or unreadable (ENOENT: no such file or directory); indexed documents were kept"
384
+ }
385
+ ```
386
+
387
+ The message names the filesystem error but never the path (`path` carries it,
388
+ and is omitted for remote REST/HTTP MCP callers). The collection's documents
389
+ stay indexed and counted, and `healthy` is false (terminal `Health: DEGRADED`).
390
+ Terminal output prints `Root unavailable: <path>` and `[<code>] <message>`
391
+ under the collection line; Markdown output adds a `Root unavailable` line after
392
+ the collections table. The key is absent while the root is available.
393
+
366
394
  JSON output also includes `resident` using
367
395
  `gno://schemas/resident-status@1.0`. Direct `gno status` is intentionally
368
396
  truthful about its lifecycle: `mode:"direct-cli"`, `resident:false`, no
@@ -1498,6 +1526,16 @@ Important notes:
1498
1526
  - hyphenated compounds such as `real-time`, `gpt-4`, and `DEC-0054` are handled intentionally
1499
1527
  - malformed lexical syntax returns exit code `1`
1500
1528
 
1529
+ **Snippets:**
1530
+
1531
+ Ranking never builds snippets. After the final rows are chosen, each default
1532
+ snippet is a window of about 32 words from the stored chunk that best covers
1533
+ the positive query terms (rarer terms count more; ties go to the earliest
1534
+ chunk), with matching words wrapped in `<mark>`/`</mark>` and `...` where the
1535
+ window cuts the chunk. `snippetRange` and `line` name that chunk's line span
1536
+ (after any leading frontmatter is skipped). With `--intent`, the steered chunk
1537
+ is used. `--full` and `--line-numbers` return raw text without markers.
1538
+
1501
1539
  **Output (JSON):**
1502
1540
  See [Output Schemas](./output-schemas/search-results.schema.json)
1503
1541
 
@@ -1697,7 +1735,7 @@ active with `sourceCount: 1`.
1697
1735
  [explain] bm25: 45 candidates
1698
1736
  [explain] vector: 38 candidates
1699
1737
  [explain] graph: seeds=5, candidates=4/20, explicit=3, inferred=1, ambiguous=0, similarity=0
1700
- [explain] fusion: RRF k=60, 52 unique candidates
1738
+ [explain] fusion: RRF k=60, 52 unique documents (best rank per list)
1701
1739
  [explain] rerank: top 20 reranked
1702
1740
  [explain] result 1: score=0.92 (bm25=0.85, vec=0.78, rerank=0.95)
1703
1741
  ```
@@ -2965,13 +3003,19 @@ included, is refused. JSON output is
2965
3003
 
2966
3004
  ### gno cleanup
2967
3005
 
2968
- Remove documents of collections no longer in the config, then orphaned
2969
- content, chunks, and vectors not referenced by active documents.
3006
+ Delete the documents of indexed collections the config does not list, then
3007
+ orphaned content, chunks, and vectors not referenced by active documents.
3008
+ Before deleting, cleanup writes the collections it is about to delete to
3009
+ stderr: `Deleting collections not in this config:` and one
3010
+ `<name>: <n> document(s)` line each, or `{"deleting":[{"name","documents"}]}`
3011
+ with `--json`. With `--json`, stdout is
3012
+ `{"droppedCollections":[{"name","documents"}],"orphanedContent","orphanedChunks","orphanedVectors","expiredCache"}`.
3013
+ This is the only command that deletes collections the config omits.
2970
3014
 
2971
3015
  **Synopsis:**
2972
3016
 
2973
3017
  ```bash
2974
- gno cleanup [--lock-wait <duration>] [--no-wait]
3018
+ gno cleanup [--json] [--lock-wait <duration>] [--no-wait]
2975
3019
  ```
2976
3020
 
2977
3021
  **Exit Codes:**
@@ -3077,6 +3121,13 @@ start it again, or, for a resident started by another GNO version (which
3077
3121
  `--stop` refuses), `kill <pid>` (`taskkill /PID <pid>` on Windows) and start it
3078
3122
  again.
3079
3123
 
3124
+ The `collection-roots` check applies the `gno status` root check to every
3125
+ configured collection. It is `ok` when all roots are available and `warn`
3126
+ otherwise: the message lists the collections, and `details` holds one line
3127
+ per collection (`<name>: <path> [<code>] <message>`) plus the repair
3128
+ (reconnect or restore the folder; if it moved, change the collection's path
3129
+ and run `gno update`). The warning keeps exit 0 but makes `healthy` false.
3130
+
3080
3131
  The `findings-pass` check reports the daemon's scheduled findings pass from
3081
3132
  its persisted run state: `ok` when disabled or the last run succeeded, `warn`
3082
3133
  on `skipped_lease` / `overdue` / no recorded run, `error` on `failed` or a
@@ -3462,15 +3513,22 @@ gno skill install [--scope <project|user>] [--target <claude|codex|opencode|open
3462
3513
 
3463
3514
  **Options:**
3464
3515
 
3465
- | Option | Type | Default | Description |
3466
- | ---------- | ------- | ------- | ------------------------------------------------------------- |
3467
- | `--scope` | string | project | `project` (.claude/skills/) or `user` (~/.claude/skills/) |
3468
- | `--target` | string | claude | `claude`, `codex`, `opencode`, `openclaw`, `hermes`, or `all` |
3469
- | `--force` | boolean | false | Overwrite existing skill without prompting |
3516
+ | Option | Type | Default | Description |
3517
+ | ---------- | ------- | ------- | --------------------------------------------------------------------------------------------------- |
3518
+ | `--scope` | string | project | `project` (.claude/skills/) or `user` (~/.claude/skills/, or `$CLAUDE_CONFIG_DIR/skills/` when set) |
3519
+ | `--target` | string | claude | `claude`, `codex`, `opencode`, `openclaw`, `hermes`, or `all` |
3520
+ | `--force` | boolean | false | Overwrite existing skill without prompting |
3470
3521
 
3471
3522
  **Behavior:**
3472
3523
 
3473
- 1. Resolves target path based on scope and target
3524
+ 1. Resolves target path based on scope and target. At user scope the Claude
3525
+ target uses `$CLAUDE_CONFIG_DIR/skills/gno` and the Codex target
3526
+ `$CODEX_HOME/skills/gno` when the variable is set (trimmed; empty means
3527
+ unset; a relative path is a validation error, exit 1), validated exactly
3528
+ as `gno agents` does. `GNO_SKILLS_HOME_OVERRIDE` suppresses both variables;
3529
+ `CLAUDE_SKILLS_DIR`/`CODEX_SKILLS_DIR` take precedence over everything.
3530
+ The same resolution applies to `skill uninstall` and `skill paths`, and the
3531
+ output prints the resolved directory.
3474
3532
  2. If skill exists and not `--force`/`--yes`: error
3475
3533
  3. Atomically installs skill directory (temp + rename)
3476
3534
  4. Copies SKILL.md, reference files, and nested recipe files
@@ -3685,6 +3743,8 @@ gno agents install [--target <claude|codex|cursor|opencode|grok|hermes|openclaw|
3685
3743
  same real file are written once (`covered via <target> (same file)`).
3686
3744
  6. `GNO_AGENTS_HOME_OVERRIDE` overrides the home directory (testing/sandboxed
3687
3745
  verification); any home override suppresses harness config-dir env vars.
3746
+ `CLAUDE_CONFIG_DIR`/`CODEX_HOME` are trimmed, an empty value counts as
3747
+ unset, and a relative path is a validation error.
3688
3748
 
3689
3749
  **Output (JSON):**
3690
3750
 
@@ -3716,7 +3776,8 @@ gno agents install [--target <claude|codex|cursor|opencode|grok|hermes|openclaw|
3716
3776
  ```
3717
3777
 
3718
3778
  `action` is one of `install`, `update`, `current`, `covered`, `not-detected`,
3719
- `error` (and `remove`, `absent` for uninstall). A covered row's `path` is the
3779
+ `error` (and `remove` for uninstall; `absent` for update and uninstall when
3780
+ the file holds no block). A covered row's `path` is the
3720
3781
  file the harness actually reads (its covering target's file). With
3721
3782
  `--dry-run`, a `diffs` array of unified diffs is included. When
3722
3783
  any target failed on install/update, `manualBlock` carries the complete block
@@ -3736,8 +3797,13 @@ text to paste. Schema: `spec/output-schemas/agents-mutation.schema.json`
3736
3797
  ### gno agents update
3737
3798
 
3738
3799
  Refresh an installed block in place (block-version migration). Same options,
3739
- output, and exit codes as `agents install`; both verbs converge the block to
3740
- the current release — `update` exists for operator intent clarity.
3800
+ output, and exit codes as `agents install`, and an existing block converges
3801
+ to the current release exactly as with install. Unlike install, `update`
3802
+ never adds a block: a target whose file has no GNO agents block (or does not
3803
+ exist) is reported `absent` with the detail
3804
+ ``no GNO agents block to refresh; run `gno agents install` to add one``,
3805
+ and the file is left untouched (no write, no backup, no file created). An
3806
+ `absent` row is not a failure (exit 0).
3741
3807
 
3742
3808
  ```bash
3743
3809
  gno agents update [--target <...>] [--extra-dir <path>]... [--dry-run] [--json]
@@ -3812,6 +3878,32 @@ gno agents uninstall [--target <...>] [--extra-dir <path>]... [--dry-run] [--jso
3812
3878
 
3813
3879
  ---
3814
3880
 
3881
+ ### gno metadata
3882
+
3883
+ List the typed metadata keys active documents carry.
3884
+
3885
+ **Synopsis:**
3886
+
3887
+ ```bash
3888
+ gno metadata [-c, --collection <name>] [--values <n>] [--json] [--md]
3889
+ ```
3890
+
3891
+ **Options:**
3892
+
3893
+ | Option | Type | Description |
3894
+ | ------------------ | ------- | ------------------------------------------------ |
3895
+ | `-c, --collection` | string | Only documents in this collection |
3896
+ | `--values` | integer | Common values listed per key (1-100, default 10) |
3897
+ | `--json` | flag | JSON output (`gno://schemas/metadata-summary`) |
3898
+ | `--md` | flag | Markdown output |
3899
+
3900
+ **Exit Codes:**
3901
+
3902
+ - 0: Success
3903
+ - 1: `--values` out of range
3904
+
3905
+ ---
3906
+
3815
3907
  ### gno tags list
3816
3908
 
3817
3909
  List all tags with document counts.
@@ -4801,23 +4893,23 @@ Write-lease contention on `index` / `update` / `embed` does not use the generic
4801
4893
 
4802
4894
  ## Environment Variables
4803
4895
 
4804
- | Variable | Description |
4805
- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
4806
- | `GNO_CONFIG_DIR` | Override config directory |
4807
- | `GNO_DATA_DIR` | Override data directory (DB location) |
4808
- | `GNO_CACHE_DIR` | Override cache directory (models) |
4809
- | `NO_COLOR` | Disable colored output (standard) |
4810
- | `PAGER` | Pager for long output (default: less -R on Unix, built-in on Windows) |
4811
- | `GNO_SKILLS_HOME_OVERRIDE` | Override home dir for skill user scope (testing) |
4812
- | `GNO_MEMORY_CALLER` | Default `--caller` identity for `gno remember` / `gno recall` |
4813
- | `GNO_MEMORY_SESSION` | Default `--session` identity for `gno remember` / `gno recall` |
4814
- | `CLAUDE_SKILLS_DIR` | Override Claude skills directory |
4815
- | `CODEX_SKILLS_DIR` | Override Codex skills directory |
4816
- | `CLAUDE_CONFIG_DIR` | Claude Code config dir; `gno agents` resolves Claude's instruction file under it (suppressed by an explicit home override); `gno sessions discover` also checks its `projects/` |
4817
- | `CODEX_HOME` | Codex config dir; same rule as `CLAUDE_CONFIG_DIR`; `gno sessions discover` checks its `sessions/` |
4818
- | `OPENCLAW_STATE_DIR` | OpenClaw state dir checked by `gno sessions discover` (else `$OPENCLAW_HOME/.openclaw` or `~/.openclaw`) |
4819
- | `HERMES_HOME` | Hermes home checked by `gno sessions discover` (else `~/.hermes`) |
4820
- | `GNO_SESSIONS_HOOKS` | `off` or `0` makes every installed `gno sessions hook` return immediately without admitting work |
4896
+ | Variable | Description |
4897
+ | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
4898
+ | `GNO_CONFIG_DIR` | Override config directory |
4899
+ | `GNO_DATA_DIR` | Override data directory (DB location) |
4900
+ | `GNO_CACHE_DIR` | Override cache directory (models) |
4901
+ | `NO_COLOR` | Disable colored output (standard) |
4902
+ | `PAGER` | Pager for long output (default: less -R on Unix, built-in on Windows) |
4903
+ | `GNO_SKILLS_HOME_OVERRIDE` | Override home dir for skill user scope (testing) |
4904
+ | `GNO_MEMORY_CALLER` | Default `--caller` identity for `gno remember` / `gno recall` |
4905
+ | `GNO_MEMORY_SESSION` | Default `--session` identity for `gno remember` / `gno recall` |
4906
+ | `CLAUDE_SKILLS_DIR` | Override Claude skills directory |
4907
+ | `CODEX_SKILLS_DIR` | Override Codex skills directory |
4908
+ | `CLAUDE_CONFIG_DIR` | Claude Code config dir; `gno agents` resolves Claude's instruction file and `gno skill --scope user` the Claude skill dir under it (suppressed by an explicit home override); `gno sessions discover` also checks its `projects/` |
4909
+ | `CODEX_HOME` | Codex config dir; same rule as `CLAUDE_CONFIG_DIR` (instruction file and user-scope skill dir); `gno sessions discover` checks its `sessions/` |
4910
+ | `OPENCLAW_STATE_DIR` | OpenClaw state dir checked by `gno sessions discover` (else `$OPENCLAW_HOME/.openclaw` or `~/.openclaw`) |
4911
+ | `HERMES_HOME` | Hermes home checked by `gno sessions discover` (else `~/.hermes`) |
4912
+ | `GNO_SESSIONS_HOOKS` | `off` or `0` makes every installed `gno sessions hook` return immediately without admitting work |
4821
4913
 
4822
4914
  ---
4823
4915
 
@@ -268,7 +268,9 @@ accounting, temp paths, and oracle data are excluded from both the agent history
268
268
  and its UTF-8 byte count.
269
269
 
270
270
  For Capsule evidence bundles, `content` is byte-for-byte the production MCP
271
- `gno-context-agent-v1` text projection. Exact evidence is not duplicated in the
271
+ `gno-context-agent-v2` text projection. Promotion also accepts recorded
272
+ `gno-context-agent-v1` receipts, whose evidence tuples end at the egress
273
+ position (11 positions instead of 13). Exact evidence is not duplicated in the
272
274
  normalized evidence field. The benchmark charges the complete normalized
273
275
  agent-visible envelope containing that text once; the full canonical Capsule
274
276
  in MCP `structuredContent` is application-only and excluded. This target models