@gmickel/gno 2.14.0 → 2.16.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.
- package/README.md +1 -1
- package/assets/skill/cli-reference.md +4 -2
- package/assets/spa-production.json.gz +0 -0
- package/browser-extension/artifacts/{gno-browser-clipper-v2.14.0.zip → gno-browser-clipper-v2.16.0.zip} +0 -0
- package/browser-extension/artifacts/gno-browser-clipper-v2.16.0.zip.sha256 +1 -0
- package/browser-extension/dist/manifest.json +1 -1
- package/package.json +1 -1
- package/spec/cli.md +88 -45
- package/spec/db/schema.sql +45 -0
- package/spec/output-schemas/embed-receipt.schema.json +89 -0
- package/src/cli/commands/agents/commands.ts +1 -1
- package/src/cli/commands/ask.ts +1 -1
- package/src/cli/commands/context-build.ts +1 -1
- package/src/cli/commands/embed.ts +341 -20
- package/src/cli/commands/links.ts +1 -1
- package/src/cli/commands/mcp/install.ts +2 -2
- package/src/cli/commands/mcp/status.ts +1 -1
- package/src/cli/commands/mcp/uninstall.ts +1 -1
- package/src/cli/commands/query.ts +1 -1
- package/src/cli/commands/shared.ts +4 -4
- package/src/cli/commands/skill/install.ts +1 -1
- package/src/cli/commands/skill/paths-cmd.ts +1 -1
- package/src/cli/commands/skill/uninstall.ts +1 -1
- package/src/cli/commands/status.ts +75 -58
- package/src/cli/config-cache.ts +86 -0
- package/src/cli/globals.ts +64 -0
- package/src/cli/options.ts +23 -0
- package/src/cli/program.ts +44 -37
- package/src/cli/run.ts +121 -67
- package/src/cli/runtime-health.ts +132 -122
- package/src/cli/session-binding.ts +11 -2
- package/src/config/saver.ts +8 -0
- package/src/converters/adapters/browser-export/formats.ts +25 -15
- package/src/converters/adapters/email/adapter.ts +37 -53
- package/src/converters/adapters/email/html.ts +37 -20
- package/src/converters/adapters/email/mime.ts +71 -39
- package/src/converters/adapters/ical/adapter.ts +20 -12
- package/src/converters/adapters/jsonl/adapter.ts +8 -6
- package/src/converters/adapters/shared/html-text.ts +55 -37
- package/src/converters/adapters/shared/ooxml-protection.ts +5 -13
- package/src/converters/adapters/shared/utf8-lines.ts +69 -31
- package/src/converters/adapters/transcript/adapter.ts +12 -7
- package/src/converters/adapters/xlsx/adapter.ts +10 -7
- package/src/converters/adapters/xlsx/sheet-markdown.ts +93 -50
- package/src/converters/canonicalize.ts +17 -3
- package/src/converters/native/markdown.ts +24 -17
- package/src/converters/native/plaintext.ts +5 -6
- package/src/converters/registry.ts +130 -8
- package/src/core/activation-status.ts +4 -8
- package/src/core/change-diff.ts +38 -11
- package/src/core/context-compiler.ts +17 -18
- package/src/core/context-evidence.ts +116 -25
- package/src/core/context-verifier.ts +70 -31
- package/src/core/file-lock.ts +10 -2
- package/src/core/graph-analysis.ts +3 -3
- package/src/core/link-inventory-markdown.ts +2 -2
- package/src/core/links.ts +20 -87
- package/src/core/memory-fence.ts +16 -9
- package/src/core/memory-recall.ts +168 -34
- package/src/core/path-rules.ts +143 -0
- package/src/core/section-parse.ts +16 -6
- package/src/core/typed-metadata.ts +68 -0
- package/src/core/wiki-link-syntax.ts +88 -0
- package/src/embed/backlog.ts +173 -60
- package/src/embed/batch.ts +83 -12
- package/src/embed/resume-cursor.ts +103 -0
- package/src/embed/retry.ts +41 -32
- package/src/embed/variant-backlog.ts +697 -63
- package/src/embed/variant-plan.ts +41 -45
- package/src/embed/variant-retry.ts +157 -44
- package/src/index.ts +3 -3
- package/src/ingestion/budget-error-codes.ts +13 -0
- package/src/ingestion/chunker.ts +60 -49
- package/src/ingestion/compiled-context.ts +4 -5
- package/src/ingestion/convert-file.ts +1 -1
- package/src/ingestion/document-metadata.ts +16 -9
- package/src/ingestion/excluded-ranges.ts +97 -0
- package/src/ingestion/file-processor.ts +122 -37
- package/src/ingestion/frontmatter.ts +35 -7
- package/src/ingestion/graph-reconciliation.ts +187 -51
- package/src/ingestion/language.ts +66 -61
- package/src/ingestion/position.ts +5 -5
- package/src/ingestion/prepare-file.ts +50 -29
- package/src/ingestion/record-adapter-canonical.ts +37 -26
- package/src/ingestion/record-adapter.ts +46 -26
- package/src/ingestion/record-container.ts +121 -53
- package/src/ingestion/record-path.ts +5 -2
- package/src/ingestion/source-availability/darwin-io.ts +10 -7
- package/src/ingestion/source-availability/darwin-path.ts +21 -3
- package/src/ingestion/source-availability/readers.ts +51 -0
- package/src/ingestion/strip.ts +39 -105
- package/src/ingestion/sync.ts +692 -386
- package/src/ingestion/typed-metadata.ts +10 -4
- package/src/ingestion/walker.ts +485 -158
- package/src/llm/cache.ts +128 -84
- package/src/llm/http-inference.ts +112 -35
- package/src/llm/http-policy.ts +101 -0
- package/src/llm/httpEmbedding.ts +8 -1
- package/src/llm/httpGeneration.ts +5 -1
- package/src/llm/httpRerank.ts +5 -1
- package/src/llm/inference-scope.ts +15 -2
- package/src/llm/lazy-ports.ts +33 -3
- package/src/llm/lockfile.ts +34 -7
- package/src/llm/model-cleanup.ts +24 -0
- package/src/llm/native-worker/client.ts +23 -12
- package/src/llm/native-worker/dispatcher.ts +19 -9
- package/src/llm/native-worker/embedding-identity.ts +42 -16
- package/src/llm/native-worker/entry.ts +2 -1
- package/src/llm/native-worker/owner.ts +1 -0
- package/src/llm/native-worker/ports.ts +86 -23
- package/src/llm/native-worker/protocol.ts +386 -55
- package/src/llm/nodeLlamaCpp/adapter.ts +46 -29
- package/src/llm/nodeLlamaCpp/embedding.ts +93 -40
- package/src/llm/nodeLlamaCpp/generation.ts +194 -30
- package/src/llm/nodeLlamaCpp/lifecycle.ts +2 -0
- package/src/llm/nodeLlamaCpp/rerank-capacity.ts +101 -23
- package/src/llm/nodeLlamaCpp/rerank.ts +253 -44
- package/src/llm/types.ts +14 -0
- package/src/mcp/context.ts +342 -23
- package/src/mcp/http-transport.ts +21 -3
- package/src/mcp/tool-profile-types.ts +62 -0
- package/src/mcp/tool-profile.ts +32 -56
- package/src/mcp/tools/context.ts +5 -1
- package/src/mcp/tools/index.ts +269 -191
- package/src/mcp/tools/links.ts +7 -5
- package/src/mcp/tools/query.ts +60 -37
- package/src/mcp/tools/vsearch.ts +25 -14
- package/src/pipeline/answer.ts +133 -40
- package/src/pipeline/claim-verification.ts +293 -189
- package/src/pipeline/claim-verifier.ts +6 -7
- package/src/pipeline/egress-lineage.ts +37 -26
- package/src/pipeline/exclude.ts +34 -11
- package/src/pipeline/expansion.ts +233 -19
- package/src/pipeline/filters.ts +169 -33
- package/src/pipeline/graph-retrieval.ts +117 -61
- package/src/pipeline/hybrid.ts +598 -329
- package/src/pipeline/hydration.ts +86 -24
- package/src/pipeline/intent.ts +15 -7
- package/src/pipeline/owner-fusion.ts +61 -19
- package/src/pipeline/query-language.ts +15 -2
- package/src/pipeline/rerank.ts +15 -22
- package/src/pipeline/search.ts +193 -72
- package/src/pipeline/snippet.ts +15 -2
- package/src/pipeline/temporal.ts +51 -10
- package/src/pipeline/vsearch.ts +250 -152
- package/src/publish/attachment-raster.ts +2 -16
- package/src/publish/encrypted-export.ts +15 -5
- package/src/serve/browse-tree.ts +50 -42
- package/src/serve/connectors.ts +2 -1
- package/src/serve/context.ts +13 -4
- package/src/serve/doc-events.ts +3 -0
- package/src/serve/public/app.tsx +49 -21
- package/src/serve/public/components/BrowseTreeSidebar.tsx +163 -23
- package/src/serve/public/components/CaptureModal.tsx +14 -10
- package/src/serve/public/components/ai-elements/code-block.tsx +87 -50
- package/src/serve/public/components/editor/MarkdownPreview.tsx +99 -67
- package/src/serve/public/globals.built.css +1 -1
- package/src/serve/public/globals.css +19 -0
- package/src/serve/public/hooks/useCaptureModal.tsx +23 -10
- package/src/serve/public/lib/metadata-filter.ts +234 -9
- package/src/serve/public/pages/Browse.tsx +61 -27
- package/src/serve/public/pages/DocView.tsx +44 -25
- package/src/serve/public/pages/GraphView.tsx +8 -3
- package/src/serve/resident-runtime.ts +199 -48
- package/src/serve/routes/api.ts +98 -67
- package/src/serve/routes/links.ts +18 -4
- package/src/serve/server.ts +1370 -1180
- package/src/serve/spa-bundle-source.ts +52 -27
- package/src/serve/status.ts +101 -52
- package/src/serve/watch-reconciliation-fallback.ts +11 -7
- package/src/serve/watch-reconciliation-shared.ts +42 -4
- package/src/serve/watch-reconciliation.ts +21 -8
- package/src/serve/watch-service-events.ts +7 -1
- package/src/serve/watch-service-hosts.ts +3 -1
- package/src/serve/watch-service.ts +46 -21
- package/src/serve/watch-snapshot-scan.ts +6 -15
- package/src/sessions/archive.ts +20 -8
- package/src/sessions/sanitize.ts +38 -18
- package/src/sessions/service.ts +180 -102
- package/src/store/migrations/036-vector-mirror-state.ts +83 -0
- package/src/store/migrations/037-performance-indexes.ts +56 -0
- package/src/store/migrations/index.ts +4 -0
- package/src/store/sqlite/adapter.ts +1217 -651
- package/src/store/sqlite/chunking-policy.ts +15 -1
- package/src/store/sqlite/eligibility.ts +110 -70
- package/src/store/sqlite/graph-neighbors.ts +71 -46
- package/src/store/sqlite/graph-reference-state.ts +27 -3
- package/src/store/sqlite/graph-similarity.ts +59 -12
- package/src/store/sqlite/metadata-predicate.ts +123 -28
- package/src/store/sqlite/retrieval-trace-management-store.ts +126 -33
- package/src/store/sqlite/retrieval-trace-retention.ts +88 -76
- package/src/store/sqlite/retrieval-trace-rows.ts +7 -3
- package/src/store/types.ts +32 -0
- package/src/store/vector/eligibility.ts +39 -0
- package/src/store/vector/lazy.ts +17 -0
- package/src/store/vector/partition-index.ts +49 -47
- package/src/store/vector/proof-cache.ts +103 -0
- package/src/store/vector/sqlite-vec.ts +230 -139
- package/src/store/vector/stats.ts +29 -73
- package/src/store/vector/status.ts +151 -52
- package/src/store/vector/stored-vectors.ts +131 -45
- package/src/store/vector/types.ts +10 -0
- package/src/store/vector/variant-search.ts +771 -109
- package/src/store/vector/variants.ts +785 -144
- package/browser-extension/artifacts/gno-browser-clipper-v2.14.0.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.
|
|
142
|
+
> Current source version: **v2.16.0**. See [CHANGELOG.md](./CHANGELOG.md).
|
|
143
143
|
|
|
144
144
|
<!-- /public-truth -->
|
|
145
145
|
|
|
@@ -117,9 +117,11 @@ gno collection clear-embeddings <name> [--all] [--json]
|
|
|
117
117
|
### gno embed
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
|
-
gno embed [collection] [--collection <name>] [--force] [--model <uri>] [--batch-size <n>] [--dry-run] [--new-partition]
|
|
120
|
+
gno embed [collection] [--collection <name>] [--force] [--model <uri>] [--batch-size <n>] [--max-chunks <n>] [--max-seconds <n>] [--dry-run] [--new-partition]
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
+
Default foreground `--batch-size` is `64` (background embedding is capped at `32`). Use `--max-chunks` or `--max-seconds` to process a large backlog in bounded slices.
|
|
124
|
+
|
|
123
125
|
Switching `GNO_LLAMA_GPU`, Bun version or thread count resumes the existing
|
|
124
126
|
vector partition when a measured sample of stored chunks matches. If it does
|
|
125
127
|
not, embed refuses to build a separate partition without `--new-partition`
|
|
@@ -169,7 +171,7 @@ them in a collection instead.
|
|
|
169
171
|
Generate embeddings only.
|
|
170
172
|
|
|
171
173
|
```bash
|
|
172
|
-
gno embed [--force] [--model <uri>] [--batch-size <n>] [--dry-run] [--new-partition]
|
|
174
|
+
gno embed [--force] [--model <uri>] [--batch-size <n>] [--max-chunks <n>] [--max-seconds <n>] [--dry-run] [--new-partition]
|
|
173
175
|
```
|
|
174
176
|
|
|
175
177
|
## Project Profiles
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4aacdd5ad2205fdb41b02a4ec771b875b7fc73c771a74c4342925636b18c8729 gno-browser-clipper-v2.16.0.zip
|
package/package.json
CHANGED
package/spec/cli.md
CHANGED
|
@@ -903,6 +903,9 @@ Each JSON item is the configured collection plus `effectiveWorkspaceRoot` and
|
|
|
903
903
|
[gno audit](#gno-audit). Schema:
|
|
904
904
|
[`collection-list@1.0`](./output-schemas/collection-list.schema.json).
|
|
905
905
|
|
|
906
|
+
`updateCmdTimeoutMs` (milliseconds) appears when the collection sets a limit
|
|
907
|
+
for `updateCmd`; without it the command is stopped after 10 minutes.
|
|
908
|
+
|
|
906
909
|
---
|
|
907
910
|
|
|
908
911
|
### gno collection clear-embeddings
|
|
@@ -1123,7 +1126,7 @@ Generate embeddings for indexed chunks.
|
|
|
1123
1126
|
**Synopsis:**
|
|
1124
1127
|
|
|
1125
1128
|
```bash
|
|
1126
|
-
gno embed [collection] [--collection <name>] [--force] [--model <uri>] [--batch-size <n>] [--dry-run] [--yes] [--json]
|
|
1129
|
+
gno embed [collection] [--collection <name>] [--force] [--model <uri>] [--batch-size <n>] [--dry-run] [--max-chunks <n>] [--max-seconds <n>] [--yes] [--json]
|
|
1127
1130
|
```
|
|
1128
1131
|
|
|
1129
1132
|
**Arguments:**
|
|
@@ -1136,29 +1139,80 @@ gno embed [collection] [--collection <name>] [--force] [--model <uri>] [--batch-
|
|
|
1136
1139
|
- `[collection]` and `--collection <name>` are aliases
|
|
1137
1140
|
- if provided, embedding work is scoped to that collection only
|
|
1138
1141
|
|
|
1139
|
-
|
|
1142
|
+
**Bounded runs:**
|
|
1143
|
+
|
|
1144
|
+
- `--max-chunks <n>` and `--max-seconds <n>` (positive integers) stop the run
|
|
1145
|
+
after the batch that reaches either limit. Chunks count every chunk the run
|
|
1146
|
+
submitted to the embedding provider, embedded or failed, including
|
|
1147
|
+
resubmissions: a retry after a model reset and the smaller requests of
|
|
1148
|
+
adaptive recovery (a failed batch retried in halves or one chunk at a time),
|
|
1149
|
+
and the stored chunks re-embedded to verify a changed runtime before the
|
|
1150
|
+
first batch. Verification is not interrupted: it submits at most one
|
|
1151
|
+
sample of up to eight chunks per stored partition of the model, once per
|
|
1152
|
+
runtime when its verdict is cached (a failed cache write verifies again
|
|
1153
|
+
on the next run), so it can take a run past the limit by
|
|
1154
|
+
those samples. Every run still embeds at least one batch, so a run whose
|
|
1155
|
+
verification reached the limit embeds one batch and stops.
|
|
1156
|
+
Seconds run from the start of embedding. Batches are never split, so a run
|
|
1157
|
+
can go past the limit by the submissions of one batch and its recovery.
|
|
1158
|
+
- A stopped run exits 0, also when some chunks were deferred by SQLite
|
|
1159
|
+
contention (the receipt still reports `contentionErrors`). It keeps every
|
|
1160
|
+
committed batch and releases the write lease. It skips the final
|
|
1161
|
+
vector-index activation that only a complete pass performs, does not start a
|
|
1162
|
+
model-wide vector index sync (a later run that is not stopped performs it),
|
|
1163
|
+
and the index stage marker records the run as
|
|
1164
|
+
finished, not interrupted (best effort: if the database stays busy past its
|
|
1165
|
+
timeout, the receipt is still printed and the next run only shows a resume
|
|
1166
|
+
note). The next `gno embed` continues with the remaining chunks.
|
|
1167
|
+
- A limit reached on the batch that empties the backlog is a complete run.
|
|
1168
|
+
- A bounded run starts after the position where the previous bounded run for
|
|
1169
|
+
the same scope stopped, reaches the end of the backlog and then wraps to the
|
|
1170
|
+
start, so chunks that keep failing stay pending without blocking later
|
|
1171
|
+
chunks. A run that reaches the end of its traversal clears the position.
|
|
1172
|
+
- Retries of failed chunks count toward `--max-chunks` and `--max-seconds`;
|
|
1173
|
+
retries still queued when a limit is reached stay pending for the next run.
|
|
1174
|
+
- `--dry-run` ignores both limits. Combining either limit with `--force` is a
|
|
1175
|
+
validation error (exit 1), because a forced pass restarts from the first
|
|
1176
|
+
chunk. Limit values must be positive whole numbers.
|
|
1177
|
+
- The JSON receipt of a run that embeds (not a dry run) adds `remaining`, the
|
|
1178
|
+
chunks still pending for the scope (0 when the backlog is done), and
|
|
1179
|
+
`stopped: "limit"` when a limit ended the run with work pending. Without
|
|
1180
|
+
`--json`, a stopped run adds the line "Stopped at the run limit; <n> chunks
|
|
1181
|
+
remaining. Run `gno embed` again to continue."
|
|
1140
1182
|
|
|
1141
1183
|
**Output (JSON):**
|
|
1142
1184
|
|
|
1143
1185
|
```json
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1186
|
+
{
|
|
1187
|
+
"embedded": 5024,
|
|
1188
|
+
"errors": 0,
|
|
1189
|
+
"contentionErrors": 0,
|
|
1190
|
+
"duration": 312.4,
|
|
1191
|
+
"model": "hf:org/model/model.gguf",
|
|
1192
|
+
"searchAvailable": true,
|
|
1193
|
+
"errorSamples": [],
|
|
1194
|
+
"remaining": 41210,
|
|
1195
|
+
"stopped": "limit"
|
|
1196
|
+
}
|
|
1197
|
+
```
|
|
1155
1198
|
|
|
1156
|
-
`
|
|
1157
|
-
|
|
1199
|
+
Schema: [`embed-receipt@1.0`](./output-schemas/embed-receipt.schema.json)
|
|
1200
|
+
(a failed run prints the error envelope instead).
|
|
1201
|
+
|
|
1202
|
+
`remaining` and `stopped` appear on runs that embed (not `--dry-run`);
|
|
1203
|
+
`stopped` only when a limit ended the run with work pending. `incomplete: true`
|
|
1204
|
+
appears when the run ended early because the embedding runtime changed.
|
|
1205
|
+
`suggestion` and `syncError` appear when relevant.
|
|
1158
1206
|
|
|
1159
1207
|
**Exit Codes:**
|
|
1160
1208
|
|
|
1161
|
-
- 0: Success
|
|
1209
|
+
- 0: Success, including a run stopped by `--max-chunks` or `--max-seconds`
|
|
1210
|
+
- 1: Validation error (for example a limit that is not a positive whole number,
|
|
1211
|
+
or a limit combined with `--force`)
|
|
1212
|
+
- 2: Runtime error (model, partition or index failure)
|
|
1213
|
+
- 4: Busy: the write lease is held, or some chunks were deferred by SQLite
|
|
1214
|
+
contention in a run that was not stopped by a limit (the receipt is still
|
|
1215
|
+
printed)
|
|
1162
1216
|
|
|
1163
1217
|
---
|
|
1164
1218
|
|
|
@@ -1380,7 +1434,7 @@ memory pressure prevents creating the full pool.
|
|
|
1380
1434
|
**Synopsis:**
|
|
1381
1435
|
|
|
1382
1436
|
```bash
|
|
1383
|
-
gno embed [--force] [--model <uri>] [--batch-size <n>] [--dry-run] [--yes] [--new-partition] [--json] [--lock-wait <duration>] [--no-wait]
|
|
1437
|
+
gno embed [collection] [--collection <name>] [--force] [--model <uri>] [--batch-size <n>] [--dry-run] [--max-chunks <n>] [--max-seconds <n>] [--yes] [--new-partition] [--json] [--lock-wait <duration>] [--no-wait]
|
|
1384
1438
|
```
|
|
1385
1439
|
|
|
1386
1440
|
Vector partitions are keyed on model weights, formatter, dimensions, context
|
|
@@ -1396,38 +1450,27 @@ never confirms; without confirmation embed exits 2 and writes nothing.
|
|
|
1396
1450
|
|
|
1397
1451
|
**Options:**
|
|
1398
1452
|
|
|
1399
|
-
| Option | Type | Default | Description
|
|
1400
|
-
| ------------------------ | -------- | ------- |
|
|
1401
|
-
| `--force` | boolean | false | Re-embed all chunks (ignore existing vectors)
|
|
1402
|
-
| `--model` | string | config | Override embedding model URI
|
|
1403
|
-
| `--batch-size` | integer |
|
|
1404
|
-
| `--dry-run` | boolean | false | Show what would be embedded without doing it
|
|
1405
|
-
| `--
|
|
1406
|
-
| `--
|
|
1407
|
-
| `--
|
|
1408
|
-
| `--
|
|
1409
|
-
| `--
|
|
1453
|
+
| Option | Type | Default | Description |
|
|
1454
|
+
| ------------------------ | -------- | ------- | ---------------------------------------------------------------------------- |
|
|
1455
|
+
| `--force` | boolean | false | Re-embed all chunks (ignore existing vectors) |
|
|
1456
|
+
| `--model` | string | config | Override embedding model URI |
|
|
1457
|
+
| `--batch-size` | integer | 64 | Chunks per batch (foreground default; background capped at 32) |
|
|
1458
|
+
| `--dry-run` | boolean | false | Show what would be embedded without doing it |
|
|
1459
|
+
| `--max-chunks <n>` | integer | - | Stop after the batch that reaches this many chunks (see Bounded runs above) |
|
|
1460
|
+
| `--max-seconds <n>` | integer | - | Stop after the batch that reaches this many seconds (see Bounded runs above) |
|
|
1461
|
+
| `--yes`, `-y` | boolean | false | Skip confirmation prompts (never confirms a separate vector partition) |
|
|
1462
|
+
| `--new-partition` | boolean | false | Confirm building a separate vector partition for an incompatible runtime |
|
|
1463
|
+
| `--json` | boolean | false | Output result as JSON |
|
|
1464
|
+
| `--lock-wait <duration>` | duration | `120s` | How long to wait for the index write lease. Accepts `120`, `120s`, or `2m`. |
|
|
1465
|
+
| `--no-wait` | boolean | false | Do not wait; fail immediately if another writer holds the lease |
|
|
1410
1466
|
|
|
1411
1467
|
Waits by default for the same write lease as `index` / `update` / MCP writers. `--no-wait` opts out.
|
|
1412
1468
|
|
|
1413
|
-
**Exit Codes:**
|
|
1414
|
-
|
|
1415
|
-
- 0: Success
|
|
1416
|
-
- 1: User cancelled or invalid `--lock-wait`
|
|
1417
|
-
- 2: Model not available or embedding failure
|
|
1418
|
-
- 4: Write lease busy (contention, not corruption)
|
|
1419
|
-
|
|
1420
|
-
**JSON Output:**
|
|
1469
|
+
**Exit Codes and JSON Output:**
|
|
1421
1470
|
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
"errors": 0,
|
|
1426
|
-
"duration": 45.2,
|
|
1427
|
-
"model": "hf:BAAI/bge-m3-gguf/bge-m3-q8_0.gguf",
|
|
1428
|
-
"searchAvailable": true
|
|
1429
|
-
}
|
|
1430
|
-
```
|
|
1471
|
+
See the receipt and exit codes in the first [gno embed](#gno-embed) section
|
|
1472
|
+
(including `remaining`, `stopped`, `incomplete`, limit validation and
|
|
1473
|
+
contention).
|
|
1431
1474
|
|
|
1432
1475
|
**Verbose Mode:**
|
|
1433
1476
|
|
package/spec/db/schema.sql
CHANGED
|
@@ -298,6 +298,51 @@ CREATE INDEX IF NOT EXISTS idx_vector_owners_variant ON vector_owners(variant_id
|
|
|
298
298
|
-- No chunk FK: replacing shared canonical chunks must not cascade vector loss.
|
|
299
299
|
-- The writer validates bindings against current document/chunk/formatted input.
|
|
300
300
|
-- vec_v1_<partition SHA256> uses variant_id INTEGER PRIMARY KEY and FLOAT[dims].
|
|
301
|
+
-- vec0 mirror freshness per partition (migration 036). A partition is clean
|
|
302
|
+
-- only while it has a row with dirty = 0. Triggers on vector_variants delete
|
|
303
|
+
-- the row on any change (deletes never conflict, so outer conflict clauses
|
|
304
|
+
-- cannot cancel them); the store's own writes, which update vec0 in the same
|
|
305
|
+
-- transaction, restore the previous mark; syncIndex(), a verified activation,
|
|
306
|
+
-- `gno vec sync` and `gno vec rebuild` mark it clean. The BEFORE triggers look
|
|
307
|
+
-- up each conflict by its own key, so stale statistics cannot make every write
|
|
308
|
+
-- scan the variants index.
|
|
309
|
+
CREATE TABLE IF NOT EXISTS vector_mirror_state (
|
|
310
|
+
partition_id TEXT PRIMARY KEY,
|
|
311
|
+
dirty INTEGER NOT NULL CHECK (dirty IN (0, 1))
|
|
312
|
+
);
|
|
313
|
+
CREATE TRIGGER IF NOT EXISTS vector_variants_mirror_before_insert
|
|
314
|
+
BEFORE INSERT ON vector_variants BEGIN
|
|
315
|
+
DELETE FROM vector_mirror_state WHERE partition_id IN (
|
|
316
|
+
SELECT partition_id FROM vector_variants
|
|
317
|
+
WHERE variant_id = NEW.variant_id
|
|
318
|
+
UNION ALL
|
|
319
|
+
SELECT partition_id FROM vector_variants
|
|
320
|
+
WHERE partition_id = NEW.partition_id AND input_hash = NEW.input_hash
|
|
321
|
+
);
|
|
322
|
+
END;
|
|
323
|
+
CREATE TRIGGER IF NOT EXISTS vector_variants_mirror_insert
|
|
324
|
+
AFTER INSERT ON vector_variants BEGIN
|
|
325
|
+
DELETE FROM vector_mirror_state WHERE partition_id = NEW.partition_id;
|
|
326
|
+
END;
|
|
327
|
+
CREATE TRIGGER IF NOT EXISTS vector_variants_mirror_before_update
|
|
328
|
+
BEFORE UPDATE ON vector_variants BEGIN
|
|
329
|
+
DELETE FROM vector_mirror_state WHERE partition_id IN (
|
|
330
|
+
SELECT partition_id FROM vector_variants
|
|
331
|
+
WHERE variant_id = NEW.variant_id
|
|
332
|
+
UNION ALL
|
|
333
|
+
SELECT partition_id FROM vector_variants
|
|
334
|
+
WHERE partition_id = NEW.partition_id AND input_hash = NEW.input_hash
|
|
335
|
+
);
|
|
336
|
+
END;
|
|
337
|
+
CREATE TRIGGER IF NOT EXISTS vector_variants_mirror_update
|
|
338
|
+
AFTER UPDATE ON vector_variants BEGIN
|
|
339
|
+
DELETE FROM vector_mirror_state
|
|
340
|
+
WHERE partition_id IN (OLD.partition_id, NEW.partition_id);
|
|
341
|
+
END;
|
|
342
|
+
CREATE TRIGGER IF NOT EXISTS vector_variants_mirror_delete
|
|
343
|
+
AFTER DELETE ON vector_variants BEGIN
|
|
344
|
+
DELETE FROM vector_mirror_state WHERE partition_id = OLD.partition_id;
|
|
345
|
+
END;
|
|
301
346
|
-- Its writes/deletes share the authoritative variant transaction; no best effort.
|
|
302
347
|
-- Mutation epoch fences all old and new writers, including raw SQL. Active state
|
|
303
348
|
-- records durable variant authority after initial promotion. activated_epoch
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "gno://schemas/embed-receipt@1.0",
|
|
4
|
+
"title": "GNO Embed Receipt",
|
|
5
|
+
"description": "Receipt emitted by `gno embed --json` for a run that reached a result (failures emit the error envelope instead). A dry run reports the pending chunk count as `embedded` and omits `remaining`. A run that embeds adds `remaining`; a run ended by `--max-chunks` or `--max-seconds` with work pending adds `stopped`.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"embedded",
|
|
10
|
+
"errors",
|
|
11
|
+
"contentionErrors",
|
|
12
|
+
"duration",
|
|
13
|
+
"model",
|
|
14
|
+
"searchAvailable",
|
|
15
|
+
"errorSamples"
|
|
16
|
+
],
|
|
17
|
+
"properties": {
|
|
18
|
+
"embedded": {
|
|
19
|
+
"type": "integer",
|
|
20
|
+
"minimum": 0,
|
|
21
|
+
"description": "Chunks embedded and stored by this run; for `--dry-run`, the chunks that would be embedded."
|
|
22
|
+
},
|
|
23
|
+
"errors": {
|
|
24
|
+
"type": "integer",
|
|
25
|
+
"minimum": 0,
|
|
26
|
+
"description": "Chunks that failed to embed in this run; they stay pending."
|
|
27
|
+
},
|
|
28
|
+
"contentionErrors": {
|
|
29
|
+
"type": "integer",
|
|
30
|
+
"minimum": 0,
|
|
31
|
+
"description": "Chunks deferred by SQLITE_BUSY/LOCKED - not embedding failures."
|
|
32
|
+
},
|
|
33
|
+
"duration": {
|
|
34
|
+
"type": "number",
|
|
35
|
+
"minimum": 0,
|
|
36
|
+
"description": "Seconds."
|
|
37
|
+
},
|
|
38
|
+
"model": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"minLength": 1,
|
|
41
|
+
"description": "Embedding model URI."
|
|
42
|
+
},
|
|
43
|
+
"searchAvailable": {
|
|
44
|
+
"type": "boolean",
|
|
45
|
+
"description": "False when sqlite-vec is unavailable: vectors are stored but KNN search is disabled."
|
|
46
|
+
},
|
|
47
|
+
"errorSamples": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": { "type": "string" },
|
|
50
|
+
"description": "Up to a few distinct failure messages."
|
|
51
|
+
},
|
|
52
|
+
"suggestion": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "Next step for the user, when one applies."
|
|
55
|
+
},
|
|
56
|
+
"syncError": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "Vector index sync failure after embedding."
|
|
59
|
+
},
|
|
60
|
+
"remaining": {
|
|
61
|
+
"type": "integer",
|
|
62
|
+
"minimum": 0,
|
|
63
|
+
"description": "Chunks still pending for the scope after this run (0 when the backlog is done). Present on runs that embed, absent on `--dry-run`."
|
|
64
|
+
},
|
|
65
|
+
"stopped": {
|
|
66
|
+
"const": "limit",
|
|
67
|
+
"description": "A run limit (`--max-chunks` or `--max-seconds`) ended the run with work pending. Absent otherwise."
|
|
68
|
+
},
|
|
69
|
+
"incomplete": {
|
|
70
|
+
"const": true,
|
|
71
|
+
"description": "The run ended early because the embedding runtime changed. Absent otherwise."
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"stopped": ["remaining"],
|
|
76
|
+
"incomplete": ["remaining"]
|
|
77
|
+
},
|
|
78
|
+
"if": {
|
|
79
|
+
"properties": { "stopped": { "const": "limit" } },
|
|
80
|
+
"required": ["stopped"]
|
|
81
|
+
},
|
|
82
|
+
"then": {
|
|
83
|
+
"description": "A limit stop leaves work pending and is never a runtime change.",
|
|
84
|
+
"properties": {
|
|
85
|
+
"remaining": { "type": "integer", "minimum": 1 },
|
|
86
|
+
"incomplete": false
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
package/src/cli/commands/ask.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { resolveDownloadPolicy } from "../../llm/policy";
|
|
|
22
22
|
import { resolveModelUri } from "../../llm/registry";
|
|
23
23
|
import { createVectorIndexPort } from "../../store/vector";
|
|
24
24
|
import { CliError } from "../errors";
|
|
25
|
-
import { getGlobals } from "../
|
|
25
|
+
import { getGlobals } from "../globals";
|
|
26
26
|
import {
|
|
27
27
|
createProgressRenderer,
|
|
28
28
|
createThrottledProgressRenderer,
|