@fortemi/core 2026.9.5 → 2026.9.7

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 (23) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +1705 -1508
  3. package/dist/index.js +2633 -675
  4. package/dist/index.js.map +1 -1
  5. package/package.json +5 -1
  6. package/schemas/lifecycle-purge/contract.receipt.json +15 -0
  7. package/schemas/lifecycle-purge/v1.conformance.json +73 -0
  8. package/schemas/metadata-search/candidate/1.0.0/README.md +36 -0
  9. package/schemas/metadata-search/candidate/1.0.0/contract.receipt.json +38 -0
  10. package/schemas/metadata-search/candidate/1.0.0/evidence-locator.schema.json +50 -0
  11. package/schemas/metadata-search/candidate/1.0.0/evidence-resolution-vectors.json +355 -0
  12. package/schemas/metadata-search/candidate/1.0.0/evidence-resolution.schema.json +25 -0
  13. package/schemas/metadata-search/candidate/1.0.0/evidence-set-vectors.json +6095 -0
  14. package/schemas/metadata-search/candidate/1.0.0/evidence-set.schema.json +21 -0
  15. package/schemas/metadata-search/candidate/1.0.0/evidence-vectors.json +1603 -0
  16. package/schemas/metadata-search/candidate/1.0.0/predicate-vectors.json +919 -0
  17. package/schemas/metadata-search/candidate/1.0.0/predicates.schema.json +287 -0
  18. package/schemas/metadata-search/candidate/1.0.0/resolution.receipt.json +44 -0
  19. package/schemas/metadata-search/candidate/1.0.0/rest.receipt.json +51 -0
  20. package/schemas/metadata-search/candidate/1.0.0/search-rest-vectors.json +28 -0
  21. package/schemas/metadata-search/candidate/1.0.0/search-rest.schema.json +318 -0
  22. package/schemas/metadata-search/candidate/1.0.0/source.receipt.json +46 -0
  23. package/schemas/metadata-search/candidate/1.0.0/sql-scope-vectors.json +894 -0
@@ -0,0 +1,318 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://fortemi.com/contracts/metadata-search/candidate/1.0.0/search-rest.schema.json",
4
+ "title": "Candidate canonical GET search request and response",
5
+ "description": "Producer authority candidate. Schema validation is supplemented by same-note/canonical evidence binding, exact returned totals, strict-filter aggregate count and metadata range semantics. No auth grant or complete capability promotion.",
6
+ "$defs": {
7
+ "StrictSearchFilterInput": {
8
+ "type": "object",
9
+ "description": "Decoded strict_filter JSON. Unknown keys retain legacy ignored behavior. Sum of the five list lengths must not exceed 1000; name resolution still requires current authorized storage.",
10
+ "additionalProperties": true,
11
+ "properties": {
12
+ "required_tags": {
13
+ "type": "array",
14
+ "maxItems": 1000,
15
+ "items": {
16
+ "type": "string"
17
+ },
18
+ "default": []
19
+ },
20
+ "any_tags": {
21
+ "type": "array",
22
+ "maxItems": 1000,
23
+ "items": {
24
+ "type": "string"
25
+ },
26
+ "default": []
27
+ },
28
+ "excluded_tags": {
29
+ "type": "array",
30
+ "maxItems": 1000,
31
+ "items": {
32
+ "type": "string"
33
+ },
34
+ "default": []
35
+ },
36
+ "required_schemes": {
37
+ "type": "array",
38
+ "maxItems": 1000,
39
+ "items": {
40
+ "type": "string"
41
+ },
42
+ "default": []
43
+ },
44
+ "excluded_schemes": {
45
+ "type": "array",
46
+ "maxItems": 1000,
47
+ "items": {
48
+ "type": "string"
49
+ },
50
+ "default": []
51
+ },
52
+ "min_tag_count": {
53
+ "type": ["integer", "null"],
54
+ "minimum": -2147483648,
55
+ "maximum": 2147483647
56
+ },
57
+ "include_untagged": {
58
+ "type": "boolean",
59
+ "default": true
60
+ }
61
+ }
62
+ },
63
+ "SearchRestRequest": {
64
+ "type": "object",
65
+ "description": "Decoded GET query parameters. JSON-content parameters are decoded to JSON values before this schema is applied. This is not a POST request body. Unknown query keys retain legacy ignored behavior and cannot grant tenant/archive authorization.",
66
+ "required": [
67
+ "q"
68
+ ],
69
+ "additionalProperties": true,
70
+ "properties": {
71
+ "q": {
72
+ "type": "string",
73
+ "description": "Search expression. Empty text remains accepted."
74
+ },
75
+ "limit": {
76
+ "type": "integer",
77
+ "minimum": 0,
78
+ "maximum": 1000,
79
+ "default": 20
80
+ },
81
+ "filters": {
82
+ "type": "string",
83
+ "description": "Legacy filter expression; combined with comma-separated tags."
84
+ },
85
+ "mode": {
86
+ "type": "string",
87
+ "default": "hybrid",
88
+ "description": "fts selects lexical search, semantic selects vector search. hybrid, absent and other legacy values select hybrid; failures have explicit FTS degradation."
89
+ },
90
+ "set": {
91
+ "type": "string",
92
+ "description": "Embedding-set slug resolved within the authorized memory and tenant."
93
+ },
94
+ "created_after": {
95
+ "type": "string",
96
+ "format": "date-time"
97
+ },
98
+ "created_before": {
99
+ "type": "string",
100
+ "format": "date-time"
101
+ },
102
+ "updated_after": {
103
+ "type": "string",
104
+ "format": "date-time"
105
+ },
106
+ "updated_before": {
107
+ "type": "string",
108
+ "format": "date-time"
109
+ },
110
+ "since": {
111
+ "type": "string",
112
+ "description": "Relative created-after time; explicit created_after wins. Unrecognized relative text retains legacy ignored behavior."
113
+ },
114
+ "tags": {
115
+ "type": "string",
116
+ "description": "Comma-separated tags; trimmed nonempty entries are AND requirements."
117
+ },
118
+ "strict_filter": {
119
+ "$ref": "#/$defs/StrictSearchFilterInput",
120
+ "x-fortemi-query-content": "application/json"
121
+ },
122
+ "metadata_predicates": {
123
+ "$ref": "predicates.schema.json",
124
+ "x-fortemi-query-content": "application/json",
125
+ "x-fortemi-max-encoded-utf8-bytes": 1048576
126
+ },
127
+ "diversity": {
128
+ "type": "number",
129
+ "minimum": -3.4028234663852886e38,
130
+ "maximum": 3.4028234663852886e38,
131
+ "description": "Finite f32 input, clamped to [0,1] before MMR; zero is pure relevance."
132
+ }
133
+ }
134
+ },
135
+ "SearchHitFields": {
136
+ "type": "object",
137
+ "required": [
138
+ "note_id",
139
+ "score",
140
+ "snippet"
141
+ ],
142
+ "properties": {
143
+ "note_id": {
144
+ "type": "string",
145
+ "format": "uuid"
146
+ },
147
+ "score": {
148
+ "type": "number",
149
+ "description": "Finite retrieval/fusion score, not a probability."
150
+ },
151
+ "snippet": {
152
+ "type": [
153
+ "string",
154
+ "null"
155
+ ],
156
+ "description": "Display only; not citation text or coordinates."
157
+ },
158
+ "title": {
159
+ "type": "string"
160
+ },
161
+ "tags": {
162
+ "type": "array",
163
+ "items": {
164
+ "type": "string"
165
+ }
166
+ },
167
+ "embedding_status": {
168
+ "enum": [
169
+ "ready",
170
+ "pending",
171
+ "failed",
172
+ "none"
173
+ ]
174
+ },
175
+ "evidence": {
176
+ "$ref": "evidence-set.schema.json"
177
+ }
178
+ }
179
+ },
180
+ "SearchHit": {
181
+ "type": "object",
182
+ "allOf": [
183
+ {
184
+ "$ref": "#/$defs/SearchHitFields"
185
+ }
186
+ ],
187
+ "unevaluatedProperties": false
188
+ },
189
+ "ChainSearchInfo": {
190
+ "type": "object",
191
+ "additionalProperties": false,
192
+ "required": [
193
+ "chain_id",
194
+ "original_title",
195
+ "chunks_matched",
196
+ "best_chunk_sequence",
197
+ "total_chunks"
198
+ ],
199
+ "description": "Legacy display aggregation. Index/count fields are currently heuristic, not native citation coordinates; use evidence for exact unit identity.",
200
+ "properties": {
201
+ "chain_id": {
202
+ "type": "string",
203
+ "format": "uuid"
204
+ },
205
+ "original_title": {
206
+ "type": "string"
207
+ },
208
+ "chunks_matched": {
209
+ "type": "integer",
210
+ "minimum": 0
211
+ },
212
+ "best_chunk_sequence": {
213
+ "type": "integer",
214
+ "minimum": 0,
215
+ "maximum": 4294967295
216
+ },
217
+ "total_chunks": {
218
+ "type": "integer",
219
+ "minimum": 0,
220
+ "maximum": 4294967295
221
+ }
222
+ }
223
+ },
224
+ "EnhancedSearchHit": {
225
+ "type": "object",
226
+ "allOf": [
227
+ {
228
+ "$ref": "#/$defs/SearchHitFields"
229
+ },
230
+ {
231
+ "type": "object",
232
+ "properties": {
233
+ "chain_info": {
234
+ "$ref": "#/$defs/ChainSearchInfo"
235
+ }
236
+ }
237
+ }
238
+ ],
239
+ "unevaluatedProperties": false
240
+ },
241
+ "SearchDegradation": {
242
+ "type": "object",
243
+ "additionalProperties": false,
244
+ "required": [
245
+ "code",
246
+ "effective_mode"
247
+ ],
248
+ "properties": {
249
+ "code": {
250
+ "type": "string",
251
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
252
+ },
253
+ "effective_mode": {
254
+ "const": "fts"
255
+ }
256
+ }
257
+ },
258
+ "SearchRestResponse": {
259
+ "type": "object",
260
+ "additionalProperties": false,
261
+ "required": [
262
+ "results",
263
+ "query",
264
+ "total",
265
+ "degraded"
266
+ ],
267
+ "properties": {
268
+ "results": {
269
+ "type": "array",
270
+ "maxItems": 1000,
271
+ "items": {
272
+ "$ref": "#/$defs/EnhancedSearchHit"
273
+ }
274
+ },
275
+ "query": {
276
+ "type": "string"
277
+ },
278
+ "total": {
279
+ "type": "integer",
280
+ "minimum": 0,
281
+ "maximum": 1000,
282
+ "description": "Returned hit count, exactly results.length; not total matches in storage."
283
+ },
284
+ "degraded": {
285
+ "type": "boolean"
286
+ },
287
+ "degradation": {
288
+ "$ref": "#/$defs/SearchDegradation"
289
+ }
290
+ },
291
+ "if": {
292
+ "properties": {
293
+ "degraded": {
294
+ "const": true
295
+ }
296
+ }
297
+ },
298
+ "then": {
299
+ "properties": {
300
+ "degradation": {}
301
+ },
302
+ "required": [
303
+ "degradation"
304
+ ]
305
+ },
306
+ "else": {
307
+ "not": {
308
+ "properties": {
309
+ "degradation": {}
310
+ },
311
+ "required": [
312
+ "degradation"
313
+ ]
314
+ }
315
+ }
316
+ }
317
+ }
318
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "schemaVersion": "fortemi.metadata-search-source-pin.v1",
3
+ "status": "merged-candidate-unreleased",
4
+ "authority": {
5
+ "repository": "Fortemi/fortemi",
6
+ "issue": 1091,
7
+ "commit": "e99e4723293d12e76862ea83fda86ed70d3573c8",
8
+ "path": "contracts/metadata-search/candidate/1.0.0/",
9
+ "files": {
10
+ "predicates.schema.json": "e325707ce20abb88ef3a8f4bbb0d02ab09501b1ffe9b48b0c92a96e97dda00c3",
11
+ "predicate-vectors.json": "df9e129cab4708db71c3e22f87efd252fbcac144daa45a53ee1716f4a1a05ae7",
12
+ "sql-scope-vectors.json": "dcd35298a3bc485a6f1c87c6c87f136ee98121dad3f2b1c8b590b2e5381aa4d5",
13
+ "evidence-locator.schema.json": "cd8427c507bca1a08bdb68da0a5d2759d1d7805401db3c00372ab249652efb7a",
14
+ "evidence-vectors.json": "b532a4fa7697bdfc87e8541575fcee7c94a5b5ac53e4a6472438c49247e6b266",
15
+ "evidence-set.schema.json": "da7e5d41bd563cb2cfe424cf7dfa92007a865ee0e1a9a4832ef669039d80717e",
16
+ "evidence-set-vectors.json": "b84061ee252d2ee25d744111d2a04dfcd2c490274d4285bac31f4bd0e91e47d7",
17
+ "search-rest.schema.json": "df4bdf5c61187a66cc90b760ce9ebc71d062688d67858ed519fbd27141db9470",
18
+ "search-rest-vectors.json": "eac3b3739aedf037671be4cbd4a89f336d405de8cf06ea7ddebae9d1e4e288f2",
19
+ "evidence-resolution.schema.json": "92c0cd616d26fad83e56e602d8393a8b6135175c849284d97721da146d923723",
20
+ "evidence-resolution-vectors.json": "3d217a489a29be0eb152a8efb4f569e7942d4ae2af921218e295c0dba8a38aea"
21
+ },
22
+ "openapi": {
23
+ "path": "contracts/openapi/openapi.yaml",
24
+ "sha256": "0dd9b77e6d42c73197a489c575107c66d8f66755a2f8141a6788c7f4295c3cf1"
25
+ },
26
+ "documentation": {
27
+ "path": "contracts/metadata-search/candidate/1.0.0/README.md",
28
+ "sha256": "8156468f6a09ac51d9d6169941dbfa3bc19f1fb9c558ec4ce49de16b1f6bb1b1"
29
+ }
30
+ },
31
+ "consumer": {
32
+ "repository": "Fortemi/fortemi-react",
33
+ "issue": 405
34
+ },
35
+ "historicalReceipts": {
36
+ "contract.receipt.json": "970335ba6c711de51ef03cb852044f25b596c1fdfcc85272cb6da62751a0a536",
37
+ "rest.receipt.json": "79634446d7b33551595e0acf4d5947550cdb2e2db1680ab5d1eebf0dd648cfb7",
38
+ "resolution.receipt.json": "5739c26964b67846d451e105d27a374cd733c7d5a9cbedde37069561ecd77927"
39
+ },
40
+ "claims": {
41
+ "contractPromoted": false,
42
+ "fullIssueAcceptance": false,
43
+ "publishedRuntimeAcceptance": false,
44
+ "suiteParity": false
45
+ }
46
+ }