wiki-graph 0.4.1 → 0.5.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.
@@ -106,36 +106,36 @@ Usage:
106
106
  {{ commandName }} {{ uri }} [--json]
107
107
 
108
108
  Notes:
109
- - The status tells whether the library index is current, dirty, missing, or disabled.
109
+ - The status tells whether the library index cache is current, dirty, or missing.
110
110
  - Library-wide object `--query` and object scope enumeration require a current library index.
111
- - Run `enable` when the status says the index needs to be built or rebuilt.
112
- {% elif target.kind == "scope" and target.objectUri == "wikg://index" and predicate == "enable" %}
111
+ - Run `sync` when the status says the index cache needs to be built or rebuilt.
112
+ {% elif target.kind == "scope" and target.objectUri == "wikg://index" and predicate == "sync" %}
113
113
  Purpose:
114
- Build or rebuild this library's aggregate search index.
114
+ Sync this library's aggregate index cache.
115
115
 
116
116
  Usage:
117
- {{ commandName }} {{ uri }} enable [--jsonl]
117
+ {{ commandName }} {{ uri }} sync [--jsonl]
118
118
 
119
119
  Notes:
120
- - This is a full rebuild from registered present archives.
120
+ - This rebuilds cache from chapter index artifacts already stored in registered present archives.
121
+ - It does not build missing artifacts and does not call an embeddings provider.
121
122
  - Missing or unreadable library archive members are skipped and reported.
122
123
  - Progress is emitted as text by default, or line-delimited events with `--jsonl`.
123
- - `--json` is not supported for enable because progress is streamed.
124
+ - `--json` is not supported for sync because progress is streamed.
124
125
  - Library indexes are local derived state under Wiki Graph staging, not files inside the library folder.
125
- - Rebuild holds the library write lock; concurrent `arc scan`, `arc add`, `path set`, `disable`, archive `path set`, or archive `remove` commands for the same library cannot run at the same time.
126
- - Archive writes can mark the aggregate index dirty; rebuild again before relying on library-wide query when status reports dirty or stale.
127
- {% elif target.kind == "scope" and target.objectUri == "wikg://index" and predicate == "disable" %}
126
+ - Sync holds the library write lock; concurrent `arc scan`, `arc add`, `path set`, `clean`, archive `path set`, or archive `remove` commands for the same library cannot run at the same time.
127
+ {% elif target.kind == "scope" and target.objectUri == "wikg://index" and predicate == "clean" %}
128
128
  Purpose:
129
- Disable this library index and remove its current local materialization.
129
+ Remove this library index cache.
130
130
 
131
131
  Usage:
132
- {{ commandName }} {{ uri }} disable [--json]
132
+ {{ commandName }} {{ uri }} clean [--json]
133
133
 
134
134
  Notes:
135
135
  - This does not delete the library registry, metadata, folder, or managed `.wikg` archives.
136
- - Library-wide object `--query` and object scope enumeration will fail until the index is enabled again.
137
- - Library indexes do not support archive-style `embed` or `external` modes.
138
- - Disable holds the library write lock and cannot run concurrently with membership changes or index rebuild for the same library.
136
+ - It deletes only local derived cache under Wiki Graph staging.
137
+ - Library-wide object `--query` and object scope enumeration will fail until the index cache is synced again.
138
+ - Clean holds the library write lock and cannot run concurrently with membership changes or index sync for the same library.
139
139
  {% elif target.kind == "scope" and predicate == "add" %}
140
140
  Purpose:
141
141
  Copy a `.wikg` archive into this library folder and register it as a managed archive member.
@@ -149,7 +149,7 @@ Notes:
149
149
  - `--to` must be a relative `.wikg` path inside the library folder.
150
150
  - Parent directories for `--to` are created as needed.
151
151
  - Existing target files are not overwritten.
152
- - Adding an archive marks the library index dirty.
152
+ - Adding an archive can make an existing library index cache stale.
153
153
  - The command holds the library write lock and cannot run concurrently with `arc scan`, library `path set`, archive path changes/removes, or index rebuild for the same library.
154
154
  {% elif target.kind == "scope" and predicate == "scan" %}
155
155
  Purpose:
@@ -162,7 +162,7 @@ Notes:
162
162
  - Scan recursively discovers `.wikg` files in the bound library folder.
163
163
  - Registered files that are no longer present remain visible as missing/stale instead of being deleted silently.
164
164
  - When a moved archive can be matched by its stable mutation token, scan preserves its archive id and updates the relative path.
165
- - Scan marks the library index dirty when membership changes.
165
+ - Scan can make an existing library index cache stale when membership changes.
166
166
  - Scan holds the library write lock and cannot run concurrently with membership changes or index rebuild for the same library.
167
167
  {% elif target.kind == "scope" and predicate == "get" %}
168
168
  Purpose:
@@ -220,7 +220,7 @@ Notes:
220
220
  - `--confirm` is required.
221
221
  - If the registered file is already missing, the command can still clean the registry entry.
222
222
  - This does not delete empty parent directories.
223
- - Removing an archive marks the library index dirty.
223
+ - Removing an archive can make an existing library index cache stale.
224
224
  - Remove holds the library write lock and cannot run concurrently with library scan, add, path binding, archive path changes, or index rebuild for the same library.
225
225
  {% elif target.kind == "metadata" and predicate == "set" %}
226
226
  Purpose:
@@ -153,12 +153,12 @@ Use when:
153
153
 
154
154
  Usage:
155
155
  {{ commandName }} {{ uri }} [--json]
156
- {{ commandName }} {{ uri }} enable [--jsonl]
157
- {{ commandName }} {{ uri }} disable [--json]
156
+ {{ commandName }} {{ uri }} sync [--jsonl]
157
+ {{ commandName }} {{ uri }} clean [--json]
158
158
 
159
159
  Predicate commands:
160
- - enable: rebuild this library index from registered present archives. Help: {{ commandName }} {{ uri }} enable --help
161
- - disable: remove this library index materialization. Help: {{ commandName }} {{ uri }} disable --help
160
+ - sync: rebuild this library index cache from registered present archives' artifacts. Help: {{ commandName }} {{ uri }} sync --help
161
+ - clean: remove this library index cache. Help: {{ commandName }} {{ uri }} clean --help
162
162
 
163
163
  Related help:
164
164
  - Library registry, membership, path binding, and aggregate index concepts: {{ commandName }} help library
@@ -169,8 +169,9 @@ Default behavior:
169
169
  - `{{ commandName }} {{ uri }}` reads the library-wide scope collection.
170
170
  - Use `{{ commandName }} wikg://lib/registry` to list all library registries.
171
171
  - `{{ commandName }} {{ uri }} --query <query>` searches library-wide objects through the library index.
172
+ - Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
172
173
  - `{{ commandName }} {{ uri }}/arc scan` reconciles membership with `.wikg` files currently under the library folder.
173
- - Library-wide object scopes such as `/entity` and `/triple` query one object type through the library index after it is enabled.
174
+ - Library-wide object scopes such as `/entity` and `/triple` query one object type through the library index after it is synced.
174
175
  - Archive object search must use an explicit lens such as `/entity`, `/triple`, `/chapter`, or `/chunk`.
175
176
 
176
177
  Use when:
@@ -192,6 +193,7 @@ Usage:
192
193
  {% if target.isDefault %}
193
194
  {{ commandName }} wikg://lib [--json]
194
195
  {{ commandName }} wikg://lib --query <query> [--limit <n>] [--cursor <cursor>] [--json]
196
+ {{ commandName }} wikg://lib --query <query> --skip-unindexed
195
197
  {{ commandName }} wikg://lib/chapter --query <query>
196
198
  {{ commandName }} wikg://lib/chunk --query <query>
197
199
  {{ commandName }} wikg://lib/registry add --path <folder> [--json]
@@ -206,6 +208,7 @@ Usage:
206
208
  {% else %}
207
209
  {{ commandName }} {{ uri }} [--json]
208
210
  {{ commandName }} {{ uri }} --query <query> [--limit <n>] [--cursor <cursor>] [--json]
211
+ {{ commandName }} {{ uri }} --query <query> --skip-unindexed
209
212
  {{ commandName }} {{ uri }}/chapter --query <query>
210
213
  {{ commandName }} {{ uri }}/chunk --query <query>
211
214
  {{ commandName }} {{ uri }}/arc scan [--json|--jsonl]
@@ -14,12 +14,13 @@ Purpose:
14
14
  Expand from the current chunk or entity object to nearby objects.
15
15
 
16
16
  Usage:
17
- {{ commandName }} {{ uri }} related [--query <query>] [--reverse] [--all] [--limit <n>] [--context <n>] [--cursor <token>] [--role <any|subject|object|self>] [--evidence [n]] [--json|--jsonl]
17
+ {{ commandName }} {{ uri }} related [--query <query>] [--skip-unindexed] [--reverse] [--all] [--limit <n>] [--context <n>] [--cursor <token>] [--role <any|subject|object|self>] [--evidence [n]] [--json|--jsonl]
18
18
 
19
19
  Notes:
20
20
  - Chunk targets return nearby Reading Graph chunks.
21
21
  - Entity targets return Knowledge Graph triples involving the entity.
22
- - `--query` filters and ranks related results with the current FTS index.
22
+ - `--query` filters and ranks related results with the current search index.
23
+ - Add `--skip-unindexed` only with `--query` when you intentionally want to search indexed chapters and ignore uncovered chapters.
23
24
  - Without `--query`, `--reverse` reads Document Flow order backward. See `{{ commandName }} help uri`.
24
25
  - `--role` only applies to entity targets.
25
26
  - Use `{{ commandName }} {{ uri }} evidence --help` when source grounding is the main goal.
@@ -28,11 +29,12 @@ Purpose:
28
29
  Trace the current object back to source-backed evidence.
29
30
 
30
31
  Usage:
31
- {{ commandName }} {{ uri }} evidence [--query <query>] [--reverse] [--all] [--limit <n>] [--context <n>] [--cursor <token>] [--json|--jsonl]
32
+ {{ commandName }} {{ uri }} evidence [--query <query>] [--skip-unindexed] [--reverse] [--all] [--limit <n>] [--context <n>] [--json|--jsonl]
32
33
 
33
34
  Notes:
34
35
  - Evidence is for grounding, verification, and citation support.
35
- - `--query` filters and ranks evidence with the current FTS index.
36
+ - `--query` filters and ranks evidence with the current search index.
37
+ - Add `--skip-unindexed` only with `--query` when you intentionally want to search indexed chapters and ignore uncovered chapters.
36
38
  - Without `--query`, `--reverse` reads Document Flow order backward. See `{{ commandName }} help uri`.
37
39
  - Evidence previews include nearby source context by default; use `--context 0` for exact cited ranges.
38
40
  - Source and scope URIs are not evidence targets.
@@ -96,11 +98,32 @@ Usage:
96
98
 
97
99
  Notes:
98
100
  - Run this before broad Reading Graph, Reading Summary, or Knowledge Graph work.
99
- - The report includes content counts, FTS index readiness, generation coverage, retrieval guidance, recommended next commands, planning estimates, and concurrency hints.
101
+ - The report includes content counts, search index readiness, generation coverage, retrieval guidance, recommended next commands, planning estimates, and concurrency hints.
100
102
  - Use `--json` for a machine-readable report with the same recommendations.
101
103
  {% if libraryContext.isArchiveShortcut %}
102
104
  - This library archive shortcut inspects one managed archive's readiness; it is not a library-level health report.
103
105
  {% endif %}
106
+ {% elif predicate == "build" and target.name == "chapter-index-artifact" %}
107
+ Purpose:
108
+ Queue a job to build or replace this chapter index artifact.
109
+
110
+ Usage:
111
+ {{ commandName }} {{ uri }} build [--json]
112
+
113
+ Notes:
114
+ - This command enqueues work; it does not wait for the artifact to be built.
115
+ - A queued response means the artifact is not ready yet. Use the returned job id with `{{ commandName }} wikg://local/job/<job-id> watch` to follow progress.
116
+ {% if "/index/fts" in uri %}
117
+ - FTS artifacts are local compilation work and do not call a provider.
118
+ {% else %}
119
+ - Source and summary embedding artifacts require `wikg://local/config/embeddings` and may call the configured provider.
120
+ - Building an embedding artifact can immediately enqueue or run provider-backed work and may incur provider cost.
121
+ {% endif %}
122
+ - Direct artifact build is an explicit build request; it does not use `--accept-cost`.
123
+ {% if "/index/embedding/summary" in uri %}
124
+ - Summary embedding artifacts require an existing non-empty chapter summary.
125
+ {% endif %}
126
+ - After artifacts change, sync the archive or library index cache before library query; archive-level query can create a missing archive cache from current artifacts on first use.
104
127
  {% elif predicate == "add" and target.name == "chapter-collection-scope" %}
105
128
  Purpose:
106
129
  Add a chapter to the archive.
@@ -115,13 +138,17 @@ Notes:
115
138
  - Source input must not be empty when `--input` is used.
116
139
  {% elif predicate == "add" and target.name == "job-collection-scope" %}
117
140
  Purpose:
118
- Add a local generation job.
141
+ Add a local build job.
119
142
 
120
143
  Usage:
121
- {{ commandName }} {{ uri }} add --input <archive-uri|chapter-uri> --task reading-graph|reading-summary|knowledge-graph --accept-cost [--depth <N>] [--boost] [--llm <json>] [--prompt <text>]
144
+ {{ commandName }} {{ uri }} add --input <archive-uri|chapter-uri> --task index-fts|index-embedding-source|index-embedding-summary|reading-graph|reading-summary|knowledge-graph [--accept-cost] [--depth <N>] [--boost] [--llm <json>] [--prompt <text>]
122
145
 
123
146
  Notes:
124
- - Generation jobs may call an LLM provider and incur cost.
147
+ - `index-fts` builds chapter FTS artifacts locally and does not require `--accept-cost`.
148
+ - `index-embedding-source` and `index-embedding-summary` build Dense artifacts with `wikg://local/config/embeddings` and require `--accept-cost`.
149
+ - Reading Graph, Reading Summary, and Knowledge Graph jobs may call an LLM provider and require `--accept-cost`.
150
+ - Reading Graph and Knowledge Graph jobs require a current FTS artifact for the chapter.
151
+ - Summary embedding jobs require an existing non-empty summary.
125
152
  - Archive input adds jobs for all eligible chapters; chapter input expands to the chapter subtree by default.
126
153
  - Use `--depth <N>` with archive or chapter input to limit affected chapters. For archive input, depth is measured from the archive's root chapters; for chapter input, it is measured from the specified chapter. `--depth 0` means only the relevant root chapters or specified chapter.
127
154
  - `--llm <json>` stores a job-local LLM object; it does not update `wikg://local/config/llm`.
@@ -261,6 +288,23 @@ Notes:
261
288
  - If current output shows `"apiKey":"****"`, passing the same masked value preserves the existing secret.
262
289
  - To add or replace the secret, use `{{ commandName }} {{ uri }} put apiKey --secret`.
263
290
  - To remove the secret, use `{{ commandName }} {{ uri }} delete apiKey`.
291
+ {% elif "/embeddings" in uri %}
292
+ Schema:
293
+ {
294
+ "provider": "openai|openai-compatible",
295
+ "model": "<embedding-model-name>",
296
+ "baseURL": "<url>",
297
+ "name": "<display-name>",
298
+ "dimensions": 1536
299
+ }
300
+
301
+ Notes:
302
+ - Allowed keys: provider, model, baseURL, name, dimensions, apiKey.
303
+ - `apiKey` is sensitive and cannot be set from JSON.
304
+ - If current output shows `"apiKey":"****"`, passing the same masked value preserves the existing secret.
305
+ - To add or replace the secret, use `{{ commandName }} {{ uri }} put apiKey --secret`.
306
+ - To remove the secret, use `{{ commandName }} {{ uri }} delete apiKey`.
307
+ - `dimensions` must be a positive integer and is sent only to providers/models that support dimension control.
264
308
  {% elif "/wikispine" in uri %}
265
309
  Schema:
266
310
  {
@@ -287,6 +331,10 @@ Examples:
287
331
  {{ commandName }} {{ uri }} set '{"provider":"openai","model":"gpt-4.1"}'
288
332
  {{ commandName }} {{ uri }} set --json-input '{"provider":"openai-compatible","model":"model-name"}'
289
333
  {{ commandName }} {{ uri }} set '{"provider":"google","model":"gemini-2.5-pro"}' --json
334
+ {% elif "/embeddings" in uri %}
335
+ {{ commandName }} {{ uri }} set '{"provider":"openai","model":"text-embedding-3-small"}'
336
+ {{ commandName }} {{ uri }} set --json-input '{"provider":"openai-compatible","model":"embedding-model","baseURL":"https://api.example.com/v1"}'
337
+ {{ commandName }} {{ uri }} put dimensions 1536
290
338
  {% elif "/wikispine" in uri %}
291
339
  {{ commandName }} {{ uri }} set '{"provider":"fetch"}'
292
340
  {{ commandName }} {{ uri }} set '{"provider":"cli"}'
@@ -337,112 +385,50 @@ Notes:
337
385
  Notes:
338
386
  - This predicate is only available on URI targets that explicitly support clearing.
339
387
  {% endif %}
340
- {% elif predicate == "enable" %}
341
- {% if target.name == "index-object" and libraryContext.isLibraryWide %}
388
+ {% elif predicate == "sync" and target.name == "index-object" %}
389
+ {% if libraryContext.isLibraryWide %}
342
390
  Purpose:
343
- Build or rebuild this library's aggregate search index.
391
+ Sync this library index cache from registered archives' chapter index artifacts.
344
392
 
345
393
  Usage:
346
- {{ commandName }} {{ uri }} enable [--jsonl]
394
+ {{ commandName }} {{ uri }} sync [--jsonl]
347
395
 
348
396
  Notes:
349
- - This is a full rebuild from registered present archives.
397
+ - This is a cache rebuild from artifacts already stored inside member `.wikg` archives.
398
+ - It does not build missing chapter artifacts and does not call an embeddings provider.
350
399
  - Missing or unreadable library archive members are skipped and reported.
351
400
  - Progress is emitted as text by default, or line-delimited events with `--jsonl`.
352
- - `--json` is not supported for enable because progress is streamed.
401
+ - `--json` is not supported for sync because progress is streamed.
353
402
  - Library indexes are local derived state under Wiki Graph staging, not files inside the library folder.
354
- - Rebuild holds the library write lock; concurrent `arc scan`, `arc add`, `path set`, `disable`, archive `path set`, or archive `remove` commands for the same library cannot run at the same time.
355
- - Archive writes can mark the aggregate index dirty; rebuild again before relying on library-wide query when status reports dirty or stale.
356
- {% else %}
357
- Purpose:
358
- Enable searchable FTS index support for this archive on this machine.
359
-
360
- Usage:
361
- {{ commandName }} {{ uri }} enable [--jsonl]
362
-
363
- Notes:
364
- - This initializes or repairs the local searchable index and may take time on large archives.
365
- - After the index is enabled, CLI archive writes keep it synchronized automatically.
366
- - Do not run this after every generation job; run it when `inspect` says query support is unavailable or the index needs repair.
367
- - By default the index is stored as local cache outside the `.wikg` archive. Use `embed` when the index should travel with the archive.
368
- - Enabling uses local CPU and disk only; it does not call an LLM provider.
369
- - Text success output is a short status summary.
370
- - With `--jsonl`, progress is emitted as line-delimited event records such as step/status/error records.
371
- - After enable succeeds, `--query`, `related --query`, and `evidence --query` become available.
372
- {% endif %}
373
- {% elif predicate == "disable" %}
374
- {% if target.name == "index-object" and libraryContext.isLibraryWide %}
375
- Purpose:
376
- Disable this library index and remove its current local materialization.
377
-
378
- Usage:
379
- {{ commandName }} {{ uri }} disable [--json]
380
-
381
- Notes:
382
- - This does not delete the library registry, metadata, folder, or managed `.wikg` archives.
383
- - Library-wide object `--query` and object scope enumeration will fail until the index is enabled again.
384
- - Library indexes do not support archive-style `embed` or `external` modes.
385
- - Disable holds the library write lock and cannot run concurrently with membership changes or index rebuild for the same library.
386
- {% else %}
387
- Purpose:
388
- Disable searchable FTS index support for this archive and remove the current index materialization.
389
-
390
- Usage:
391
- {{ commandName }} {{ uri }} disable [--json]
392
-
393
- Notes:
394
- - Disabling removes the current local or embedded index materialization.
395
- - After disable succeeds, `--query`, `related --query`, and `evidence --query` are unavailable until `enable` or `embed` is run again.
396
- - Use this when intentionally dropping index state, not as routine cleanup after generation.
397
- {% endif %}
398
- {% elif predicate == "embed" %}
399
- {% if target.name == "index-object" and libraryContext.isLibraryWide %}
400
- Purpose:
401
- This library index does not support embedded archive index storage.
402
-
403
- Usage:
404
- {{ commandName }} {{ uri }} enable --help
405
-
406
- Notes:
407
- - Library indexes are local derived state under Wiki Graph staging.
408
- - Use `enable` to build the library index or `disable` to remove it.
403
+ - Sync holds the library write lock; concurrent `arc scan`, `arc add`, `path set`, `clean`, archive `path set`, or archive `remove` commands for the same library cannot run at the same time.
404
+ - Library query requires a current library index cache.
409
405
  {% else %}
410
406
  Purpose:
411
- Use an archive-embedded searchable FTS index.
407
+ Sync this archive index cache from chapter index artifacts.
412
408
 
413
409
  Usage:
414
- {{ commandName }} {{ uri }} embed [--json]
410
+ {{ commandName }} {{ uri }} sync [--jsonl] [--skip-unindexed]
415
411
 
416
412
  Notes:
417
- - This switches the index storage policy to the `.wikg` archive and ensures the embedded index is current.
418
- - After embedding, CLI archive writes keep the embedded index synchronized automatically.
419
- - This makes the archive more portable, but increases archive size.
420
- - Use it when distributing a `.wikg` with keyword retrieval ready for another machine.
413
+ - This initializes or repairs the local `index.db` cache outside the `.wikg` archive.
414
+ - It reads chapter index artifacts from the archive and does not call an embeddings provider.
415
+ - If required chapter artifacts are missing, sync reports that artifact readiness problem instead of building them.
416
+ - Add `--skip-unindexed` only when you intentionally want the cache to include indexed chapters and ignore uncovered chapters.
417
+ - Archive-level query can create a missing cache from current artifacts on first use, but explicit sync avoids the first-query delay.
418
+ - If query reports a missing or outdated cache, run this sync command before retrying.
419
+ - With `--jsonl`, progress is emitted as line-delimited event records.
421
420
  {% endif %}
422
- {% elif predicate == "external" %}
423
- {% if target.name == "index-object" and libraryContext.isLibraryWide %}
424
- Purpose:
425
- This library index does not support archive externalization.
426
-
427
- Usage:
428
- {{ commandName }} {{ uri }} enable --help
429
-
430
- Notes:
431
- - Library indexes are already local derived state under Wiki Graph staging.
432
- - Use `enable` to build the library index or `disable` to remove it.
433
- {% else %}
421
+ {% elif predicate == "clean" and target.name == "index-object" %}
434
422
  Purpose:
435
- Use external local-cache storage for the searchable FTS index.
423
+ Delete this index cache.
436
424
 
437
425
  Usage:
438
- {{ commandName }} {{ uri }} external [--json]
426
+ {{ commandName }} {{ uri }} clean [--json]
439
427
 
440
428
  Notes:
441
- - This switches the index storage policy back to local cache outside the `.wikg` archive.
442
- - The archive no longer carries embedded index data.
443
- - Externalizing does not guarantee a current local materialization on this machine.
444
- - Run `{{ commandName }} {{ uri }} enable` to build or repair local query support after switching to external storage.
445
- {% endif %}
429
+ - This removes local `index.db` cache data only.
430
+ - It does not delete chapter index artifacts, Knowledge Graph, Reading Graph, Summary, source text, or library membership.
431
+ - Archive query can recreate an archive cache from artifacts when the selected scope supports lazy cache creation.
446
432
  {% elif predicate == "clean" %}
447
433
  Purpose:
448
434
  Remove completed local generation jobs.
@@ -475,6 +461,11 @@ Purpose:
475
461
 
476
462
  Usage:
477
463
  {{ commandName }} {{ uri }} resume
464
+
465
+ Notes:
466
+ - Paused jobs move back to queued.
467
+ - Queued jobs are already resumable work; `resume` leaves them queued and asks the local worker to pick up the queue.
468
+ - Finished, failed, canceled, and canceling jobs cannot be resumed.
478
469
  {% elif predicate == "cancel" %}
479
470
  Purpose:
480
471
  Cancel this local job.
@@ -522,6 +513,14 @@ Keys:
522
513
  - baseURL: non-empty provider base URL string
523
514
  - name: non-empty display name
524
515
  - apiKey: secret; use `--secret`
516
+ {% elif "/embeddings" in uri %}
517
+ Keys:
518
+ - provider: openai or openai-compatible
519
+ - model: non-empty embedding model name
520
+ - baseURL: non-empty provider base URL string
521
+ - name: non-empty display name
522
+ - dimensions: positive integer; numeric strings are normalized to numbers
523
+ - apiKey: secret; use `--secret`
525
524
  {% elif "/wikispine" in uri %}
526
525
  Keys:
527
526
  - provider: fetch or cli
@@ -535,14 +534,24 @@ Notes:
535
534
  - Positional `<value>` is stored as a string.
536
535
  - `--json-input` stores a JSON value and is useful for numeric config sections.
537
536
  - `--json` controls output shape; it is not JSON input.
538
- {% if "/llm" in uri %}
537
+ {% if "/llm" in uri or "/embeddings" in uri %}
539
538
  - `--secret` reads the value from an interactive terminal without echoing it; use it for `apiKey`.
540
539
  {% endif %}
541
540
  - Success output is the full section JSON with sensitive values masked.
542
541
  {% endif %}
543
542
  {% endif %}
544
543
  {% elif predicate == "delete" %}
545
- {% if target.name == "metadata-object" %}
544
+ {% if target.name == "chapter-index-artifact" %}
545
+ Purpose:
546
+ Delete this chapter index artifact.
547
+
548
+ Usage:
549
+ {{ commandName }} {{ uri }} delete [--json]
550
+
551
+ Notes:
552
+ - This deletes the stored artifact from the `.wikg` archive.
553
+ - It does not clean external `index.db` cache by itself; sync or clean the archive/library index cache after deleting artifacts.
554
+ {% elif target.name == "metadata-object" %}
546
555
  Purpose:
547
556
  Delete one metadata key.
548
557
 
@@ -584,6 +593,7 @@ Notes:
584
593
  - This does not contact an external service.
585
594
  {% else %}
586
595
  - For `llm`, this sends a small request to the configured model.
596
+ - For `embeddings`, this sends a small embedding request and reports the returned vector dimensions.
587
597
  - For `wikispine`, this checks the built-in fetch service or local `wikispine` command.
588
598
  {% endif %}
589
599
  - Text success output is intentionally short.
@@ -598,7 +608,7 @@ Notes:
598
608
  Library context:
599
609
  - This predicate runs through a library URI, not a standalone `.wikg` locator.
600
610
  {% if libraryContext.isLibraryWide %}
601
- - Library-wide object predicates use the aggregate library index and may fail when that index is missing, dirty, or stale.
611
+ - Library-wide object predicates use the aggregate library index and may fail when that index is missing, stale, or not ready.
602
612
  - Interpret results with the returned archive/member provenance; cite the specific returned evidence or member.
603
613
  {% endif %}
604
614
  {% if target.name == "chapter-collection-scope" or target.name == "chapter-scope" or target.name == "chapter-source-object" or target.name == "chapter-summary-object" or target.name == "chapter-title-object" or target.name == "chapter-tree-object" or target.name == "chapter-state-object" %}
@@ -619,7 +629,7 @@ Library context:
619
629
  Related help:
620
630
  - {{ commandName }} {{ uri }} --help
621
631
  - {{ commandName }} help uri
622
- {% if predicate == "related" or predicate == "evidence" or predicate == "pack" or predicate == "enable" or predicate == "disable" or predicate == "embed" or predicate == "external" or target.name == "index-object" or target.name == "job-collection-scope" %}
632
+ {% if predicate == "related" or predicate == "evidence" or predicate == "pack" or target.name == "index-object" or target.name == "chapter-index-artifact" or target.name == "job-collection-scope" %}
623
633
  - {{ commandName }} help readiness
624
634
  {% endif %}
625
635
  {% if predicate == "create" or predicate == "export" %}
@@ -22,7 +22,7 @@ Knowledge-base contents:
22
22
  - Reading Graph: attention chunks that preserve source-backed reading context.
23
23
  - Summaries: compressed reading outputs for chapters or archive scopes.
24
24
  - Source text: original chapter content and source ranges.
25
- These structures are URI-addressed and can be retrieved efficiently with keywords.
25
+ These structures are URI-addressed and can be retrieved through the search index.
26
26
 
27
27
  Required first step for Agents:
28
28
  If you receive an unfamiliar archive, inspect it before querying, generating, or editing:
@@ -12,7 +12,9 @@ URI type:
12
12
 
13
13
  Default behavior:
14
14
  - `{{ commandName }} {{ uri }}` enumerates archive-level objects.
15
- - `{{ commandName }} {{ uri }} --query <query>` applies keyword retrieval across archive scopes.
15
+ - `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval across archive scopes.
16
+ - Broad query results are bucketed by object family: chapter/title hits, graph objects, chunks, then text streams.
17
+ - Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
16
18
 
17
19
  Use when:
18
20
  - You need the archive entry point before narrowing to chapters, chunks, entities, triples, source, or summaries.
@@ -28,7 +30,8 @@ URI type:
28
30
 
29
31
  Default behavior:
30
32
  - `{{ commandName }} {{ uri }}` enumerates chapters.
31
- - `{{ commandName }} {{ uri }} --query <query>` applies keyword retrieval to chapter objects.
33
+ - `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval to chapter objects.
34
+ - Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
32
35
  - Chapter collection scope covers the full chapter tree by default; use `--depth 0` for root-level chapters only.
33
36
  - Chapter path URIs are the public CLI handles; internal chapter ids are not command targets.
34
37
 
@@ -40,7 +43,9 @@ URI type:
40
43
 
41
44
  Default behavior:
42
45
  - `{{ commandName }} {{ uri }}` enumerates objects inside this chapter subtree.
43
- - `{{ commandName }} {{ uri }} --query <query>` applies keyword retrieval inside this chapter subtree.
46
+ - `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval inside this chapter subtree.
47
+ - Broad query results are bucketed by object family: chapter/title hits, graph objects, chunks, then text streams.
48
+ - Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
44
49
  - Use `--depth 0` to restrict the scope to this chapter only; `--depth 1` includes direct children.
45
50
  - The path in this URI is the public CLI handle for the chapter; internal chapter ids are not command targets.
46
51
 
@@ -52,7 +57,8 @@ URI type:
52
57
 
53
58
  Default behavior:
54
59
  - `{{ commandName }} {{ uri }}` enumerates Reading Graph chunks.
55
- - `{{ commandName }} {{ uri }} --query <query>` applies keyword retrieval to chunks in this scope.
60
+ - `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval to chunks in this scope.
61
+ - Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
56
62
  {% if uriContext.isChapterQualified %}
57
63
  - This chapter-qualified scope covers the selected chapter subtree by default.
58
64
  - Use `--depth 0` for only the selected chapter, or `--depth 1` for the selected chapter plus direct children.
@@ -69,7 +75,8 @@ URI type:
69
75
 
70
76
  Default behavior:
71
77
  - `{{ commandName }} {{ uri }}` enumerates Knowledge Graph entities.
72
- - `{{ commandName }} {{ uri }} --query <query>` applies keyword retrieval to entities in this scope.
78
+ - `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval to entities in this scope.
79
+ - Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
73
80
  {% if uriContext.isChapterQualified %}
74
81
  - This chapter-qualified scope covers the selected chapter subtree by default.
75
82
  - Use `--depth 0` for only the selected chapter, or `--depth 1` for the selected chapter plus direct children.
@@ -86,7 +93,8 @@ URI type:
86
93
 
87
94
  Default behavior:
88
95
  - `{{ commandName }} {{ uri }}` enumerates Knowledge Graph triples matching this scope or pattern.
89
- - `{{ commandName }} {{ uri }} --query <query>` applies keyword retrieval to triples in this scope.
96
+ - `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval to triples in this scope.
97
+ - Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
90
98
  {% if uriContext.isChapterQualified %}
91
99
  - This chapter-qualified scope covers the selected chapter subtree by default.
92
100
  - Use `--depth 0` for only the selected chapter, or `--depth 1` for the selected chapter plus direct children.
@@ -129,6 +137,7 @@ Default behavior:
129
137
  - Summary range fragments such as `#4..8` read sentence numbers 4 through 8, inclusive.
130
138
  - Range sentence numbers are 1-based. `#1` is the first sentence; `#1..2` is the first two sentences.
131
139
  - Whole summary reads are plain text streams and do not support `--json`; summary range fragments are structured range objects and support `--json`.
140
+ - Summary readiness means a summary object exists and is current for the chapter source. It does not guarantee the prose answers every question about the chapter.
132
141
 
133
142
  Use when:
134
143
  - You need compact readable prose before tracing source evidence.
@@ -170,6 +179,17 @@ Default behavior:
170
179
 
171
180
  Use when:
172
181
  - You need to know whether source, Reading Graph, Reading Summary, or Knowledge Graph data exists for a chapter.
182
+ {% elif target.name == "chapter-index-artifact" %}
183
+ URI type:
184
+ Chapter index artifact object
185
+
186
+ Default behavior:
187
+ - `{{ commandName }} {{ uri }}` reads this chapter index artifact status and summary.
188
+
189
+ Use when:
190
+ - You need to build or delete one chapter-level index artifact stored in the `.wikg` archive.
191
+ - Use `/index/fts` for lexical retrieval, `/index/embedding/source` for Dense source retrieval, or `/index/embedding/summary` for Dense summary retrieval.
192
+ - Build enqueues a local job; read the returned job status or watch the job before assuming the artifact is ready.
173
193
  {% elif target.name == "chunk-object" %}
174
194
  URI type:
175
195
  Chunk object
@@ -217,20 +237,21 @@ Use when:
217
237
  - You need to redirect or pipe the cover resource.
218
238
  {% elif target.name == "index-object" %}
219
239
  URI type:
220
- Index object
240
+ Index cache object
221
241
 
222
242
  Default behavior:
223
- - `{{ commandName }} {{ uri }}` reads archive FTS index status, readiness, storage policy, and materialization state.
224
- - Use this page when `inspect`, `--query`, `related`, or `evidence` reports missing, stale, or unavailable index support.
243
+ - `{{ commandName }} {{ uri }}` reads index cache status and capabilities.
244
+ - Chapter-level `/index/...` URIs manage index artifacts. Archive and library `/index` URIs manage derived cache.
225
245
 
226
246
  Use when:
227
- - You need to inspect currentness, enable, disable, embed, or externalize searchable FTS index support.
247
+ - You need to inspect, sync, or clean query cache materialization.
228
248
  {% elif target.name == "job-collection-scope" %}
229
249
  URI type:
230
250
  Local job collection scope
231
251
 
232
252
  Default behavior:
233
253
  - `{{ commandName }} {{ uri }}` shows local generation jobs.
254
+ - Use `--json` for a machine-readable job list. Job list does not support `--jsonl`; `watch --jsonl` is the streaming job interface.
234
255
 
235
256
  Use when:
236
257
  - You need to inspect, add, or clean local generation jobs.
@@ -268,6 +289,7 @@ Use when:
268
289
 
269
290
  Sections:
270
291
  - `{{ commandName }} wikg://local/config/llm --help`
292
+ - `{{ commandName }} wikg://local/config/embeddings --help`
271
293
  - `{{ commandName }} wikg://local/config/concurrent --help`
272
294
  - `{{ commandName }} wikg://local/config/wikispine --help`
273
295
  {% elif target.name == "local-config-section" %}
@@ -279,6 +301,9 @@ Default behavior:
279
301
 
280
302
  Use when:
281
303
  - You need to read, replace, edit, clear, or test local configuration.
304
+ {% if "/embeddings" in uri %}
305
+ - This section is used by Dense embedding artifact builds and Dense query embeddings.
306
+ {% endif %}
282
307
  {% if "/wikispine" in uri %}
283
308
 
284
309
  WikiSpine runtime guide:
@@ -357,10 +382,16 @@ Predicate commands:
357
382
  {% endif %}
358
383
  {% elif predicate == "boost" %}
359
384
  - boost: move a waiting job forward. Help: {{ commandName }} {{ uri }} boost --help
385
+ {% elif predicate == "build" %}
386
+ - build: build or replace this chapter index artifact. Help: {{ commandName }} {{ uri }} build --help
360
387
  {% elif predicate == "cancel" %}
361
388
  - cancel: cancel a local job. Help: {{ commandName }} {{ uri }} cancel --help
362
389
  {% elif predicate == "clean" %}
390
+ {% if target.name == "index-object" %}
391
+ - clean: remove derived index cache materialization. Help: {{ commandName }} {{ uri }} clean --help
392
+ {% else %}
363
393
  - clean: remove completed local jobs. Help: {{ commandName }} {{ uri }} clean --help
394
+ {% endif %}
364
395
  {% elif predicate == "clear" %}
365
396
  {% if target.name == "metadata-object" %}
366
397
  - clear: clear this metadata map. Help: {{ commandName }} {{ uri }} clear --help
@@ -370,23 +401,19 @@ Predicate commands:
370
401
  {% elif predicate == "create" %}
371
402
  - create: create the archive; use `--replace` only when discarding an existing archive. Help: {{ commandName }} {{ uri }} create --help
372
403
  {% elif predicate == "delete" %}
373
- {% if target.name == "metadata-object" %}
404
+ {% if target.name == "chapter-index-artifact" %}
405
+ - delete: delete this chapter index artifact. Help: {{ commandName }} {{ uri }} delete --help
406
+ {% elif target.name == "metadata-object" %}
374
407
  - delete: delete one metadata key. Help: {{ commandName }} {{ uri }} delete --help
375
408
  {% else %}
376
409
  - delete: delete a config key. Help: {{ commandName }} {{ uri }} delete --help
377
410
  {% endif %}
378
- {% elif predicate == "disable" %}
379
- - disable: disable searchable index support and remove index materialization. Help: {{ commandName }} {{ uri }} disable --help
380
- {% elif predicate == "embed" %}
381
- - embed: use archive-embedded searchable index storage. Help: {{ commandName }} {{ uri }} embed --help
382
- {% elif predicate == "enable" %}
383
- - enable: enable searchable index support and bring it to current. Help: {{ commandName }} {{ uri }} enable --help
384
411
  {% elif predicate == "evidence" %}
385
412
  - evidence: trace this object to source-backed evidence; supports `--reverse` without `--query`. Help: {{ commandName }} {{ uri }} evidence --help
386
413
  {% elif predicate == "export" %}
387
414
  - export: export an archive projection. Help: {{ commandName }} {{ uri }} export --help
388
- {% elif predicate == "external" %}
389
- - external: use local-cache searchable index storage. Help: {{ commandName }} {{ uri }} external --help
415
+ {% elif predicate == "sync" %}
416
+ - sync: rebuild derived index cache from chapter index artifacts. Help: {{ commandName }} {{ uri }} sync --help
390
417
  {% elif predicate == "inspect" %}
391
418
  - inspect: inspect archive readiness. Help: {{ commandName }} {{ uri }} inspect --help
392
419
  {% elif predicate == "move" %}