@schift-io/knowledge-scope 0.1.0 → 0.2.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.
@@ -47,6 +47,15 @@ export declare const StoredKnowledgeScopeSchema: z.ZodReadonly<z.ZodObject<{
47
47
  }, {
48
48
  kind: "schift_search";
49
49
  indexRef: string;
50
+ }>, z.ZodObject<{
51
+ kind: z.ZodLiteral<"local_documents">;
52
+ indexRef: z.ZodString;
53
+ }, "strict", z.ZodTypeAny, {
54
+ kind: "local_documents";
55
+ indexRef: string;
56
+ }, {
57
+ kind: "local_documents";
58
+ indexRef: string;
50
59
  }>, z.ZodObject<{
51
60
  kind: z.ZodLiteral<"web_search">;
52
61
  provider: z.ZodEnum<["customer", "schift"]>;
@@ -96,6 +105,9 @@ export declare const StoredKnowledgeScopeSchema: z.ZodReadonly<z.ZodObject<{
96
105
  }> | Readonly<{
97
106
  kind: "schift_search";
98
107
  indexRef: string;
108
+ }> | Readonly<{
109
+ kind: "local_documents";
110
+ indexRef: string;
99
111
  }> | Readonly<{
100
112
  kind: "web_search";
101
113
  provider: "customer" | "schift";
@@ -123,6 +135,9 @@ export declare const StoredKnowledgeScopeSchema: z.ZodReadonly<z.ZodObject<{
123
135
  }> | Readonly<{
124
136
  kind: "schift_search";
125
137
  indexRef: string;
138
+ }> | Readonly<{
139
+ kind: "local_documents";
140
+ indexRef: string;
126
141
  }> | Readonly<{
127
142
  kind: "web_search";
128
143
  provider: "customer" | "schift";
@@ -480,6 +495,9 @@ export declare const StoredKnowledgeScopeSchema: z.ZodReadonly<z.ZodObject<{
480
495
  }> | Readonly<{
481
496
  kind: "schift_search";
482
497
  indexRef: string;
498
+ }> | Readonly<{
499
+ kind: "local_documents";
500
+ indexRef: string;
483
501
  }> | Readonly<{
484
502
  kind: "web_search";
485
503
  provider: "customer" | "schift";
@@ -561,6 +579,9 @@ export declare const StoredKnowledgeScopeSchema: z.ZodReadonly<z.ZodObject<{
561
579
  }> | Readonly<{
562
580
  kind: "schift_search";
563
581
  indexRef: string;
582
+ }> | Readonly<{
583
+ kind: "local_documents";
584
+ indexRef: string;
564
585
  }> | Readonly<{
565
586
  kind: "web_search";
566
587
  provider: "customer" | "schift";
@@ -642,6 +663,9 @@ export declare const StoredKnowledgeScopeSchema: z.ZodReadonly<z.ZodObject<{
642
663
  }> | Readonly<{
643
664
  kind: "schift_search";
644
665
  indexRef: string;
666
+ }> | Readonly<{
667
+ kind: "local_documents";
668
+ indexRef: string;
645
669
  }> | Readonly<{
646
670
  kind: "web_search";
647
671
  provider: "customer" | "schift";
@@ -723,6 +747,9 @@ export declare const StoredKnowledgeScopeSchema: z.ZodReadonly<z.ZodObject<{
723
747
  }> | Readonly<{
724
748
  kind: "schift_search";
725
749
  indexRef: string;
750
+ }> | Readonly<{
751
+ kind: "local_documents";
752
+ indexRef: string;
726
753
  }> | Readonly<{
727
754
  kind: "web_search";
728
755
  provider: "customer" | "schift";
@@ -986,6 +1013,9 @@ export declare const StoredKnowledgeScopeSchema: z.ZodReadonly<z.ZodObject<{
986
1013
  }> | Readonly<{
987
1014
  kind: "schift_search";
988
1015
  indexRef: string;
1016
+ }> | Readonly<{
1017
+ kind: "local_documents";
1018
+ indexRef: string;
989
1019
  }> | Readonly<{
990
1020
  kind: "web_search";
991
1021
  provider: "customer" | "schift";
@@ -1101,6 +1131,9 @@ export declare const StoredKnowledgeScopeSchema: z.ZodReadonly<z.ZodObject<{
1101
1131
  }> | Readonly<{
1102
1132
  kind: "schift_search";
1103
1133
  indexRef: string;
1134
+ }> | Readonly<{
1135
+ kind: "local_documents";
1136
+ indexRef: string;
1104
1137
  }> | Readonly<{
1105
1138
  kind: "web_search";
1106
1139
  provider: "customer" | "schift";
@@ -1245,6 +1278,15 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
1245
1278
  }, {
1246
1279
  kind: "schift_search";
1247
1280
  indexRef: string;
1281
+ }>, z.ZodObject<{
1282
+ kind: z.ZodLiteral<"local_documents">;
1283
+ indexRef: z.ZodString;
1284
+ }, "strict", z.ZodTypeAny, {
1285
+ kind: "local_documents";
1286
+ indexRef: string;
1287
+ }, {
1288
+ kind: "local_documents";
1289
+ indexRef: string;
1248
1290
  }>, z.ZodObject<{
1249
1291
  kind: z.ZodLiteral<"web_search">;
1250
1292
  provider: z.ZodEnum<["customer", "schift"]>;
@@ -1294,6 +1336,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
1294
1336
  }> | Readonly<{
1295
1337
  kind: "schift_search";
1296
1338
  indexRef: string;
1339
+ }> | Readonly<{
1340
+ kind: "local_documents";
1341
+ indexRef: string;
1297
1342
  }> | Readonly<{
1298
1343
  kind: "web_search";
1299
1344
  provider: "customer" | "schift";
@@ -1321,6 +1366,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
1321
1366
  }> | Readonly<{
1322
1367
  kind: "schift_search";
1323
1368
  indexRef: string;
1369
+ }> | Readonly<{
1370
+ kind: "local_documents";
1371
+ indexRef: string;
1324
1372
  }> | Readonly<{
1325
1373
  kind: "web_search";
1326
1374
  provider: "customer" | "schift";
@@ -1678,6 +1726,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
1678
1726
  }> | Readonly<{
1679
1727
  kind: "schift_search";
1680
1728
  indexRef: string;
1729
+ }> | Readonly<{
1730
+ kind: "local_documents";
1731
+ indexRef: string;
1681
1732
  }> | Readonly<{
1682
1733
  kind: "web_search";
1683
1734
  provider: "customer" | "schift";
@@ -1759,6 +1810,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
1759
1810
  }> | Readonly<{
1760
1811
  kind: "schift_search";
1761
1812
  indexRef: string;
1813
+ }> | Readonly<{
1814
+ kind: "local_documents";
1815
+ indexRef: string;
1762
1816
  }> | Readonly<{
1763
1817
  kind: "web_search";
1764
1818
  provider: "customer" | "schift";
@@ -1840,6 +1894,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
1840
1894
  }> | Readonly<{
1841
1895
  kind: "schift_search";
1842
1896
  indexRef: string;
1897
+ }> | Readonly<{
1898
+ kind: "local_documents";
1899
+ indexRef: string;
1843
1900
  }> | Readonly<{
1844
1901
  kind: "web_search";
1845
1902
  provider: "customer" | "schift";
@@ -1921,6 +1978,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
1921
1978
  }> | Readonly<{
1922
1979
  kind: "schift_search";
1923
1980
  indexRef: string;
1981
+ }> | Readonly<{
1982
+ kind: "local_documents";
1983
+ indexRef: string;
1924
1984
  }> | Readonly<{
1925
1985
  kind: "web_search";
1926
1986
  provider: "customer" | "schift";
@@ -2184,6 +2244,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
2184
2244
  }> | Readonly<{
2185
2245
  kind: "schift_search";
2186
2246
  indexRef: string;
2247
+ }> | Readonly<{
2248
+ kind: "local_documents";
2249
+ indexRef: string;
2187
2250
  }> | Readonly<{
2188
2251
  kind: "web_search";
2189
2252
  provider: "customer" | "schift";
@@ -2299,6 +2362,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
2299
2362
  }> | Readonly<{
2300
2363
  kind: "schift_search";
2301
2364
  indexRef: string;
2365
+ }> | Readonly<{
2366
+ kind: "local_documents";
2367
+ indexRef: string;
2302
2368
  }> | Readonly<{
2303
2369
  kind: "web_search";
2304
2370
  provider: "customer" | "schift";
@@ -2414,6 +2480,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
2414
2480
  }> | Readonly<{
2415
2481
  kind: "schift_search";
2416
2482
  indexRef: string;
2483
+ }> | Readonly<{
2484
+ kind: "local_documents";
2485
+ indexRef: string;
2417
2486
  }> | Readonly<{
2418
2487
  kind: "web_search";
2419
2488
  provider: "customer" | "schift";
@@ -2529,6 +2598,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
2529
2598
  }> | Readonly<{
2530
2599
  kind: "schift_search";
2531
2600
  indexRef: string;
2601
+ }> | Readonly<{
2602
+ kind: "local_documents";
2603
+ indexRef: string;
2532
2604
  }> | Readonly<{
2533
2605
  kind: "web_search";
2534
2606
  provider: "customer" | "schift";
@@ -2648,6 +2720,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
2648
2720
  }> | Readonly<{
2649
2721
  kind: "schift_search";
2650
2722
  indexRef: string;
2723
+ }> | Readonly<{
2724
+ kind: "local_documents";
2725
+ indexRef: string;
2651
2726
  }> | Readonly<{
2652
2727
  kind: "web_search";
2653
2728
  provider: "customer" | "schift";
@@ -2767,6 +2842,9 @@ export declare const KnowledgeScopeStateSchema: z.ZodReadonly<z.ZodObject<{
2767
2842
  }> | Readonly<{
2768
2843
  kind: "schift_search";
2769
2844
  indexRef: string;
2845
+ }> | Readonly<{
2846
+ kind: "local_documents";
2847
+ indexRef: string;
2770
2848
  }> | Readonly<{
2771
2849
  kind: "web_search";
2772
2850
  provider: "customer" | "schift";
package/docs/PILOT.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Run a support-context pilot
2
2
 
3
- The pilot is for an AI application team, SI, or agency that already has support documents indexed
4
- in Schift Search. Its first task is to retrieve cited evidence for one support question and pass
5
- that evidence into its own application. Start with the [README quickstart](../README.md#quickstart).
3
+ The pilot is for an AI application team, SI, or agency with approved support documents. Its first
4
+ task is to retrieve cited evidence for one support question and pass that evidence into its own
5
+ application. Start with the [local-file quickstart](../README.md#quickstart), which needs no account
6
+ or model. Install `@schift-io/knowledge-scope@0.2.0` for this path; the older `0.1.0` requires the
7
+ [hosted Search path](../README.md#hosted-search-advanced).
6
8
 
7
9
  Success means the customer can repeat that retrieval, inspect its sources, and refuse an answer
8
10
  when evidence is insufficient. Installing the package or passing synthetic tests does not establish
@@ -10,21 +12,29 @@ customer demand, live-provider compatibility, or better retrieval accuracy.
10
12
 
11
13
  ## Choose one question and one data boundary
12
14
 
13
- Ask the customer for a repeated support question whose approved answer is present in the indexed
14
- corpus. Record the expected document and passage before running retrieval. Select the authorized
15
- organization and bucket; confirm who may read that bucket.
15
+ Ask the customer for a repeated support question whose approved answer is present in the documents.
16
+ Record the expected document and passage before running retrieval. Obtain permission to copy those
17
+ documents into local private state. Start with a small UTF-8 Markdown/text source and a new project
18
+ directory. Do not publish source snapshots, generated local bindings, or installation state.
16
19
 
17
20
  The initial path is:
18
21
 
19
22
  ```text
20
- Existing indexed support documents
21
- -> quickstart and local mount
23
+ Approved Markdown/text documents
24
+ -> quickstart --source and private local snapshot
22
25
  -> retrieve and admit cited evidence
23
26
  -> customer's application
24
27
  -> customer verifies the cited passage
25
28
  ```
26
29
 
27
- The current Search adapter uses the mounted tenant and the Search API's organization/bucket ACL.
30
+ Local retrieval is lexical and snapshot-based, not semantic search or continuous sync. Test both
31
+ source-word queries and real user phrasing; a passage match alone does not establish relevance.
32
+ Edit a source and confirm the old mount stays pinned; then create a new project/snapshot and
33
+ verify the changed passage. Filesystem access protects local state, not a multi-user ACL service.
34
+ An arbitrary local tenant label must not be presented as authentication or document authorization.
35
+
36
+ For an existing hosted corpus, select the authorized organization and bucket and confirm who may
37
+ read it. The Search adapter uses the mounted tenant and the Search API's organization/bucket ACL.
28
38
  It rejects narrower `namespace`, `subject`, and `session` requests before HTTP because the provider
29
39
  does not enforce those fields. An arbitrary tenant label is not a replacement for provider access
30
40
  control. Use an appropriately scoped bucket and installation when separate data access is required.
@@ -40,9 +50,9 @@ mounted policy and release their evidence only after combined admission succeeds
40
50
 
41
51
  1. Define the named operation and its input/result schemas. Identify its approved source and
42
52
  required evidence, including a stable record ID, revision, freshness, and citation.
43
- 2. Supply an authorized executor through the injected records port, or configure an Open Connector
44
- action in `core-dependencies/schift-connector`. The CLI does not create database connections or
45
- accept raw SQL.
53
+ 2. Supply an authorized executor through the injected records port, or configure a read-only action
54
+ in a separately operated Open Connector service. Its implementation is not included in this
55
+ repository. The CLI does not create database connections or accept raw SQL.
46
56
  3. For Open Connector, allowlist the exact connector, account alias, and read-only action. If the
47
57
  operation needs filters or narrower Scope, provide a trusted input mapper that applies those
48
58
  restrictions in the provider-native input. Without it, the adapter rejects the request.
@@ -165,11 +175,14 @@ not evidence that more infrastructure will create demand.
165
175
 
166
176
  ## Evidence status
167
177
 
168
- Release-test observation (2026-09-22): one isolated full-suite run received a non-2xx response in
169
- the local Search fixture. Its status and listener identity were not captured. A later full run,
170
- 330 repeated related tests, and 500 controlled same-port server replacements did not reproduce it.
171
- The fixture now asserts HTTP status and listener identity to make any recurrence diagnosable.
172
- The cause remains unconfirmed; no production change was made on the basis of this observation.
178
+ Release-test observation (2026-09-22): the local Search HTTP fixture failed intermittently in
179
+ isolated full-suite runs. Earlier related-test and same-port replacement probes did not reproduce
180
+ the failure. During 0.2.0 release preparation, eight subsequent full-suite runs, including a
181
+ sanitized environment and isolated release copy, passed; installed Node.js lifecycle checks also
182
+ passed. The fixture now checks captured HTTP status and listener identity outside the adapter's
183
+ error-catching boundary, so a future failure cannot hide the fixture assertion behind a generic
184
+ provider error. The intermittent failure's cause remains unconfirmed. No production behavior,
185
+ timeout, or retry policy was changed to make these tests pass.
173
186
 
174
187
  - [x] Local CE contract and adapter lifecycle have automated test coverage.
175
188
  - [x] An installable tarball and local fake-provider E2E path exist.
@@ -0,0 +1,48 @@
1
+ # Retrieve a passage without an account
2
+
3
+ Requires **0.2.0 or later** and Node.js 20 or later. This handbook is synthetic, not a customer
4
+ dataset or an accuracy benchmark.
5
+
6
+ From your application directory:
7
+
8
+ ```bash
9
+ npm install @schift-io/knowledge-scope@0.2.0
10
+ npx --no-install schift-ks quickstart ./handbook-project \
11
+ --source ./node_modules/@schift-io/knowledge-scope/examples/local-documents/support-handbook.md \
12
+ --query '환불 규정'
13
+ ```
14
+
15
+ No cloud service, token, or model is called. A successful result contains a cited passage describing
16
+ the 14-day refund window. The `schift://local-documents/...#Lx-Ly` citation identifies the source and
17
+ line range; it is not a public web URL. Preserve its `installationId`, then ask another question:
18
+
19
+ ```bash
20
+ npx --no-install schift-ks query '<installation-id>' --query '배송 기간'
21
+ ```
22
+
23
+ The delivery passage says 3 to 5 business days. For an English query, use `Refund policy`.
24
+ The local engine uses lexical matching, so these examples use wording present in the source.
25
+ Do not interpret `ready` as a guarantee of semantic relevance or a correct final answer.
26
+
27
+ ## Pass evidence to your application
28
+
29
+ Run the included SDK consumer with the default local tenant (`local-tenant`). If you supplied
30
+ `--tenant`, use that returned tenant instead:
31
+
32
+ ```bash
33
+ node node_modules/@schift-io/knowledge-scope/examples/consumer.mjs \
34
+ '<installation-id>' local-tenant '환불 규정' search
35
+ ```
36
+
37
+ It loads the same local state, invokes the mounted `search` operation, prints evidence, and does
38
+ not generate an answer. Only use `result.candidates` after `result.status === "ready"`; retain
39
+ each citation. Handle `insufficient_evidence` by asking for more information or withholding the
40
+ answer. The consumer exits with code 3 in that case.
41
+
42
+ Replace `--source` with your own UTF-8 `.md` or `.txt` file or folder and choose a new destination
43
+ directory. The private snapshot contains copied source text; do not share local state with the
44
+ portable Pack. Refresh by creating a new snapshot/mount after source edits. There is no automatic
45
+ sync, PDF/URL ingestion, or bundled MCP adapter.
46
+
47
+ See the [main guide](../../README.md#quickstart) for setup and the
48
+ [pilot guide](../../docs/PILOT.md) for real-data acceptance criteria.
@@ -0,0 +1,21 @@
1
+ # Example Shop support handbook / 고객지원 안내
2
+
3
+ Synthetic example only. These policies do not describe a real business.
4
+
5
+ ## 환불 규정 / Refund policy
6
+
7
+ 환불 규정: 구매 후 14일 이내에 사용하지 않은 상품의 환불을 요청할 수 있습니다.
8
+ 환불 신청에는 주문 번호가 필요합니다. 사용한 상품은 이 예제 정책에서 환불 대상이 아닙니다.
9
+ Refund policy: unused products may be returned within 14 days of purchase.
10
+ An order number is required. Used products are not eligible under this example policy.
11
+
12
+ ## 배송 기간 / Delivery time
13
+
14
+ 배송 기간: 주문 확인 후 영업일 기준 3일에서 5일이 걸립니다.
15
+ Delivery time: orders arrive in 3 to 5 business days after confirmation.
16
+
17
+ ## 문의 / Contact
18
+
19
+ 담당자가 주문 번호를 확인한 후 개별 주문 문의에 응답합니다.
20
+ A support representative checks the order number before responding about a specific order.
21
+ This handbook contains no actual orders or customer records.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schift-io/knowledge-scope",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Portable Knowledge Scope authoring and local control plane.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -49,7 +49,7 @@
49
49
  "license": "Apache-2.0",
50
50
  "repository": {
51
51
  "type": "git",
52
- "url": "git+https://github.com/schift-io/schift.git",
52
+ "url": "git+https://github.com/schift-io/knowledge-scope.git",
53
53
  "directory": "packages/knowledge-scope-cli"
54
54
  },
55
55
  "publishConfig": {