structured-context 0.11.0 → 0.13.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 +52 -198
- package/dist/api.d.ts +17 -15
- package/dist/api.js +12 -9
- package/dist/commands/diagram.d.ts +1 -0
- package/dist/commands/diagram.js +7 -1
- package/dist/commands/docs.js +1 -0
- package/dist/commands/dump.d.ts +15 -2
- package/dist/commands/dump.js +18 -4
- package/dist/commands/providers.d.ts +4 -0
- package/dist/commands/providers.js +52 -0
- package/dist/commands/render.d.ts +4 -0
- package/dist/commands/render.js +64 -9
- package/dist/commands/schemas.d.ts +2 -2
- package/dist/commands/schemas.js +133 -22
- package/dist/commands/show.d.ts +1 -0
- package/dist/commands/show.js +7 -1
- package/dist/commands/spaces.d.ts +3 -1
- package/dist/commands/spaces.js +11 -2
- package/dist/commands/validate-file.d.ts +3 -0
- package/dist/commands/validate-file.js +24 -6
- package/dist/commands/validate.d.ts +4 -0
- package/dist/commands/validate.js +79 -23
- package/dist/config.d.ts +25 -1
- package/dist/config.js +106 -12
- package/dist/filter/augment-nodes.d.ts +3 -1
- package/dist/filter/augment-nodes.js +12 -7
- package/dist/filter/filter-nodes.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +96 -31
- package/dist/judge/context.d.ts +20 -0
- package/dist/judge/context.js +105 -0
- package/dist/judge/factory.d.ts +44 -0
- package/dist/judge/factory.js +148 -0
- package/dist/judge/index.d.ts +13 -0
- package/dist/judge/index.js +8 -0
- package/dist/judge/judge-node.d.ts +27 -0
- package/dist/judge/judge-node.js +122 -0
- package/dist/judge/prompt.d.ts +10 -0
- package/dist/judge/prompt.js +92 -0
- package/dist/judge/provider/anthropic.d.ts +17 -0
- package/dist/judge/provider/anthropic.js +43 -0
- package/dist/judge/provider/fake.d.ts +26 -0
- package/dist/judge/provider/fake.js +56 -0
- package/dist/judge/provider/jev.d.ts +37 -0
- package/dist/judge/provider/jev.js +169 -0
- package/dist/judge/provider/openai-decisions.d.ts +21 -0
- package/dist/judge/provider/openai-decisions.js +84 -0
- package/dist/judge/provider/openai.d.ts +20 -0
- package/dist/judge/provider/openai.js +53 -0
- package/dist/judge/provider/per-rule.d.ts +10 -0
- package/dist/judge/provider/per-rule.js +18 -0
- package/dist/judge/trim.d.ts +27 -0
- package/dist/judge/trim.js +62 -0
- package/dist/judge/types.d.ts +92 -0
- package/dist/judge/types.js +9 -0
- package/dist/judge/verdicts.d.ts +24 -0
- package/dist/judge/verdicts.js +82 -0
- package/dist/load-space-graph.d.ts +7 -5
- package/dist/load-space-graph.js +19 -8
- package/dist/plugins/loader.js +3 -3
- package/dist/plugins/markdown/extract-content-links.js +8 -29
- package/dist/plugins/markdown/index.js +8 -2
- package/dist/plugins/markdown/parse-embedded.d.ts +8 -0
- package/dist/plugins/markdown/parse-embedded.js +195 -24
- package/dist/plugins/markdown/read-space.js +42 -14
- package/dist/plugins/markdown/render-directory.d.ts +11 -0
- package/dist/plugins/markdown/render-directory.js +130 -0
- package/dist/plugins/markdown/template-sync.js +3 -4
- package/dist/plugins/markdown/util.d.ts +26 -5
- package/dist/plugins/markdown/util.js +56 -15
- package/dist/plugins/mermaid/render-mermaid.js +2 -1
- package/dist/plugins/miro/sync.js +7 -6
- package/dist/plugins/util.d.ts +39 -1
- package/dist/plugins/util.js +139 -0
- package/dist/read/resolve-graph-edges.d.ts +1 -1
- package/dist/read/resolve-graph-edges.js +46 -27
- package/dist/read/wikilink-utils.d.ts +17 -0
- package/dist/read/wikilink-utils.js +40 -0
- package/dist/render/render.d.ts +3 -1
- package/dist/render/render.js +2 -2
- package/dist/schema/evaluate-rule.d.ts +33 -2
- package/dist/schema/evaluate-rule.js +58 -4
- package/dist/schema/gating.d.ts +69 -0
- package/dist/schema/gating.js +253 -0
- package/dist/schema/meta-schemas.d.ts +13 -0
- package/dist/schema/meta-schemas.js +50 -0
- package/dist/schema/metadata-contract.d.ts +952 -183
- package/dist/schema/metadata-contract.js +177 -33
- package/dist/schema/rule-filter.d.ts +12 -0
- package/dist/schema/rule-filter.js +46 -0
- package/dist/schema/rule-severity.d.ts +13 -0
- package/dist/schema/rule-severity.js +33 -0
- package/dist/schema/schema.d.ts +14 -8
- package/dist/schema/schema.js +308 -199
- package/dist/schema/validate-graph.d.ts +2 -1
- package/dist/schema/validate-graph.js +40 -23
- package/dist/schema/validate-rules.d.ts +16 -3
- package/dist/schema/validate-rules.js +91 -29
- package/dist/schemas/_knowledge_wiki.json +24 -24
- package/dist/schemas/_okf.json +172 -0
- package/dist/schemas/_ost_strict.json +17 -8
- package/dist/schemas/_sctx_base.json +3 -3
- package/dist/schemas/_strategy_general.json +38 -38
- package/dist/schemas/generated/0.12.0/_structured_context_schema_meta.json +229 -0
- package/dist/schemas/generated/0.13.0/_structured_context_schema_meta.json +400 -0
- package/dist/schemas/generated/latest/_structured_context_schema_meta.json +400 -0
- package/dist/schemas/knowledge_wiki.json +10 -9
- package/dist/schemas/okf.json +8 -0
- package/dist/schemas/strategy_general.json +15 -14
- package/dist/schemas/strict_ost.json +17 -16
- package/dist/space-context.d.ts +5 -2
- package/dist/space-context.js +9 -4
- package/dist/space-graph.d.ts +9 -7
- package/dist/space-graph.js +7 -5
- package/dist/testing.d.ts +33 -0
- package/dist/testing.js +72 -0
- package/dist/types.d.ts +64 -16
- package/dist/validate.d.ts +62 -9
- package/dist/validate.js +229 -114
- package/docs/concepts.md +65 -9
- package/docs/config.md +78 -1
- package/docs/rules.md +168 -50
- package/docs/schemas.md +152 -52
- package/package.json +17 -11
- package/schemas/_knowledge_wiki.json +24 -24
- package/schemas/_okf.json +172 -0
- package/schemas/_ost_strict.json +17 -8
- package/schemas/_sctx_base.json +3 -3
- package/schemas/_strategy_general.json +38 -38
- package/schemas/generated/0.12.0/_structured_context_schema_meta.json +229 -0
- package/schemas/generated/0.13.0/_structured_context_schema_meta.json +400 -0
- package/schemas/generated/latest/_structured_context_schema_meta.json +400 -0
- package/schemas/knowledge_wiki.json +10 -9
- package/schemas/okf.json +8 -0
- package/schemas/strategy_general.json +15 -14
- package/schemas/strict_ost.json +17 -16
- package/dist/schemas/generated/_structured_context_schema_meta.json +0 -191
- package/schemas/generated/_structured_context_schema_meta.json +0 -191
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { FromSchema } from 'json-schema-to-ts';
|
|
2
|
-
|
|
2
|
+
/** The JSON Schema dialect the structured-context dialect extends. */
|
|
3
|
+
export declare const JSON_SCHEMA_DIALECT = "https://json-schema.org/draft/2020-12/schema";
|
|
4
|
+
export declare const SCHEMA_META_BASE_URL = "https://raw.githubusercontent.com/mindsocket/structured-context/main/schemas/generated";
|
|
5
|
+
export declare const SCHEMA_META_FILE = "_structured_context_schema_meta.json";
|
|
6
|
+
/** Meta-schema `$id` for a dialect version folder, e.g. `.../generated/0.12.0/_structured_context_schema_meta.json`. */
|
|
7
|
+
export declare function schemaMetaId(folder: string): string;
|
|
8
|
+
/** The URL schemas set as `$schema` to follow the newest dialect. Resolves to the newest versioned meta-schema. */
|
|
9
|
+
export declare const SCHEMA_META_ID: string;
|
|
3
10
|
/** Schema objects wrapping each prop group for type derivation via FromSchema. */
|
|
4
11
|
declare const EDGE_SCHEMA: {
|
|
5
12
|
readonly type: "object";
|
|
@@ -87,6 +94,81 @@ declare const HIERARCHY_LEVEL_SCHEMA: {
|
|
|
87
94
|
readonly required: readonly ["type"];
|
|
88
95
|
readonly additionalProperties: false;
|
|
89
96
|
};
|
|
97
|
+
/** The verdicts the evaluation reserves besides a rule's own; a verdict map may set a severity for them. */
|
|
98
|
+
export declare const RESERVED_VERDICTS: readonly ["missing-context"];
|
|
99
|
+
/** Related-node kinds a semantic rule's `scope` can add: main-hierarchy edges only. `branch` is ancestors plus descendants. */
|
|
100
|
+
export declare const SEMANTIC_SCOPES: readonly ["parent", "siblings", "children", "ancestors", "descendants", "branch"];
|
|
101
|
+
/** The semantic part of a rule: a model evaluates the node against a rubric and returns a verdict. */
|
|
102
|
+
declare const SEMANTIC_SCHEMA: {
|
|
103
|
+
readonly type: "object";
|
|
104
|
+
readonly properties: {
|
|
105
|
+
/** What the model judges the node against. Falls back to the rule's `description`. */
|
|
106
|
+
readonly rubric: {
|
|
107
|
+
readonly type: "string";
|
|
108
|
+
readonly minLength: 1;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* The closed set of verdicts the model may return. Each is a description (what the verdict means, for the
|
|
112
|
+
* model) or `{ description, guidance }`, where `guidance` is shown to the user when it fires.
|
|
113
|
+
* Defaults to `pass`/`fail`.
|
|
114
|
+
*/
|
|
115
|
+
readonly verdicts: {
|
|
116
|
+
readonly type: "object";
|
|
117
|
+
readonly additionalProperties: {
|
|
118
|
+
readonly oneOf: readonly [{
|
|
119
|
+
readonly type: "string";
|
|
120
|
+
readonly minLength: 1;
|
|
121
|
+
}, {
|
|
122
|
+
readonly type: "object";
|
|
123
|
+
readonly properties: {
|
|
124
|
+
readonly description: {
|
|
125
|
+
readonly type: "string";
|
|
126
|
+
readonly minLength: 1;
|
|
127
|
+
};
|
|
128
|
+
readonly guidance: {
|
|
129
|
+
readonly type: "string";
|
|
130
|
+
readonly minLength: 1;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
readonly required: readonly ["description"];
|
|
134
|
+
readonly additionalProperties: false;
|
|
135
|
+
}];
|
|
136
|
+
};
|
|
137
|
+
readonly minProperties: 2;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Severity per verdict in effect (declared, default or reserved). A verdict mapped to `ignore` is judged but
|
|
141
|
+
* not reported, and a verdict left out passes. Required with `verdicts`; with the default verdicts, `fail`
|
|
142
|
+
* takes the rule's own `severity` instead.
|
|
143
|
+
*/
|
|
144
|
+
readonly severity: {
|
|
145
|
+
readonly type: "object";
|
|
146
|
+
readonly additionalProperties: {
|
|
147
|
+
readonly enum: readonly ["error", "warning", "info", "ignore"];
|
|
148
|
+
};
|
|
149
|
+
readonly minProperties: 1;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Related nodes, along main-hierarchy edges, sent with the evaluated node. Additive; left out or empty means
|
|
153
|
+
* the evaluated node alone.
|
|
154
|
+
*/
|
|
155
|
+
readonly scope: {
|
|
156
|
+
readonly type: "array";
|
|
157
|
+
readonly items: {
|
|
158
|
+
readonly enum: readonly ["parent", "siblings", "children", "ancestors", "descendants", "branch"];
|
|
159
|
+
};
|
|
160
|
+
readonly uniqueItems: true;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Which node bodies are sent: `nodeOnly` (the evaluated node's), `fullScope` (it and every related node's),
|
|
164
|
+
* or `true` for `fullScope`. Left out: no bodies.
|
|
165
|
+
*/
|
|
166
|
+
readonly includeContent: {
|
|
167
|
+
readonly enum: readonly ["nodeOnly", "fullScope", true];
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
readonly additionalProperties: false;
|
|
171
|
+
};
|
|
90
172
|
declare const RULE_SCHEMA: {
|
|
91
173
|
readonly type: "object";
|
|
92
174
|
readonly properties: {
|
|
@@ -97,29 +179,211 @@ declare const RULE_SCHEMA: {
|
|
|
97
179
|
readonly category: {
|
|
98
180
|
readonly enum: readonly ["validation", "coherence", "workflow", "best-practice"];
|
|
99
181
|
};
|
|
182
|
+
/**
|
|
183
|
+
* Severity of a failed `expression` and of the default `fail` verdict. Defaults from the category.
|
|
184
|
+
*/
|
|
185
|
+
readonly severity: {
|
|
186
|
+
readonly enum: readonly ["error", "warning", "info"];
|
|
187
|
+
};
|
|
100
188
|
readonly description: {
|
|
101
189
|
readonly type: "string";
|
|
102
190
|
readonly minLength: 1;
|
|
103
191
|
};
|
|
104
|
-
|
|
192
|
+
/** JSONata test a node must pass. When the rule also has `semantic`, a failing node is reported without being evaluated by the model. */
|
|
193
|
+
readonly expression: {
|
|
194
|
+
readonly type: "string";
|
|
195
|
+
readonly minLength: 1;
|
|
196
|
+
};
|
|
197
|
+
/** Optional JSONata applicability condition, evaluated per node before the rule runs. The rule applies only when it returns true. */
|
|
198
|
+
readonly when: {
|
|
105
199
|
readonly type: "string";
|
|
106
200
|
readonly minLength: 1;
|
|
107
201
|
};
|
|
202
|
+
/** A model evaluates the node against a rubric. `{}` takes every default; `true` means the same. */
|
|
203
|
+
readonly semantic: {
|
|
204
|
+
readonly oneOf: readonly [{
|
|
205
|
+
readonly const: true;
|
|
206
|
+
}, {
|
|
207
|
+
readonly type: "object";
|
|
208
|
+
readonly properties: {
|
|
209
|
+
/** What the model judges the node against. Falls back to the rule's `description`. */
|
|
210
|
+
readonly rubric: {
|
|
211
|
+
readonly type: "string";
|
|
212
|
+
readonly minLength: 1;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* The closed set of verdicts the model may return. Each is a description (what the verdict means, for the
|
|
216
|
+
* model) or `{ description, guidance }`, where `guidance` is shown to the user when it fires.
|
|
217
|
+
* Defaults to `pass`/`fail`.
|
|
218
|
+
*/
|
|
219
|
+
readonly verdicts: {
|
|
220
|
+
readonly type: "object";
|
|
221
|
+
readonly additionalProperties: {
|
|
222
|
+
readonly oneOf: readonly [{
|
|
223
|
+
readonly type: "string";
|
|
224
|
+
readonly minLength: 1;
|
|
225
|
+
}, {
|
|
226
|
+
readonly type: "object";
|
|
227
|
+
readonly properties: {
|
|
228
|
+
readonly description: {
|
|
229
|
+
readonly type: "string";
|
|
230
|
+
readonly minLength: 1;
|
|
231
|
+
};
|
|
232
|
+
readonly guidance: {
|
|
233
|
+
readonly type: "string";
|
|
234
|
+
readonly minLength: 1;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
readonly required: readonly ["description"];
|
|
238
|
+
readonly additionalProperties: false;
|
|
239
|
+
}];
|
|
240
|
+
};
|
|
241
|
+
readonly minProperties: 2;
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Severity per verdict in effect (declared, default or reserved). A verdict mapped to `ignore` is judged but
|
|
245
|
+
* not reported, and a verdict left out passes. Required with `verdicts`; with the default verdicts, `fail`
|
|
246
|
+
* takes the rule's own `severity` instead.
|
|
247
|
+
*/
|
|
248
|
+
readonly severity: {
|
|
249
|
+
readonly type: "object";
|
|
250
|
+
readonly additionalProperties: {
|
|
251
|
+
readonly enum: readonly ["error", "warning", "info", "ignore"];
|
|
252
|
+
};
|
|
253
|
+
readonly minProperties: 1;
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* Related nodes, along main-hierarchy edges, sent with the evaluated node. Additive; left out or empty means
|
|
257
|
+
* the evaluated node alone.
|
|
258
|
+
*/
|
|
259
|
+
readonly scope: {
|
|
260
|
+
readonly type: "array";
|
|
261
|
+
readonly items: {
|
|
262
|
+
readonly enum: readonly ["parent", "siblings", "children", "ancestors", "descendants", "branch"];
|
|
263
|
+
};
|
|
264
|
+
readonly uniqueItems: true;
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* Which node bodies are sent: `nodeOnly` (the evaluated node's), `fullScope` (it and every related node's),
|
|
268
|
+
* or `true` for `fullScope`. Left out: no bodies.
|
|
269
|
+
*/
|
|
270
|
+
readonly includeContent: {
|
|
271
|
+
readonly enum: readonly ["nodeOnly", "fullScope", true];
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
readonly additionalProperties: false;
|
|
275
|
+
}];
|
|
276
|
+
};
|
|
108
277
|
readonly type: {
|
|
109
278
|
readonly type: "string";
|
|
110
279
|
readonly minLength: 1;
|
|
111
280
|
};
|
|
112
|
-
|
|
113
|
-
|
|
281
|
+
/** Run once for the whole space instead of once per node. */
|
|
282
|
+
readonly global: {
|
|
283
|
+
readonly type: "boolean";
|
|
114
284
|
};
|
|
115
285
|
readonly override: {
|
|
116
286
|
readonly type: "boolean";
|
|
117
287
|
};
|
|
288
|
+
/** Whether a failure of this rule gates (suppresses) downstream rules on the node's hierarchy subtree. Defaults to true when the failure's severity is `error`. */
|
|
289
|
+
readonly gatesDescendants: {
|
|
290
|
+
readonly type: "boolean";
|
|
291
|
+
};
|
|
118
292
|
};
|
|
119
|
-
readonly required: readonly ["id", "category", "description"
|
|
293
|
+
readonly required: readonly ["id", "category", "description"];
|
|
120
294
|
readonly additionalProperties: false;
|
|
295
|
+
readonly allOf: readonly [{
|
|
296
|
+
readonly anyOf: readonly [{
|
|
297
|
+
readonly required: readonly ["expression"];
|
|
298
|
+
}, {
|
|
299
|
+
readonly required: readonly ["semantic"];
|
|
300
|
+
}];
|
|
301
|
+
}, {
|
|
302
|
+
readonly if: {
|
|
303
|
+
readonly required: readonly ["global"];
|
|
304
|
+
readonly properties: {
|
|
305
|
+
readonly global: {
|
|
306
|
+
readonly const: true;
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
readonly then: {
|
|
311
|
+
readonly not: {
|
|
312
|
+
readonly anyOf: readonly [{
|
|
313
|
+
readonly required: readonly ["when"];
|
|
314
|
+
}, {
|
|
315
|
+
readonly required: readonly ["type"];
|
|
316
|
+
}, {
|
|
317
|
+
readonly required: readonly ["semantic"];
|
|
318
|
+
}];
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
}, {
|
|
322
|
+
readonly if: {
|
|
323
|
+
readonly required: readonly ["semantic"];
|
|
324
|
+
readonly properties: {
|
|
325
|
+
readonly semantic: {
|
|
326
|
+
readonly type: "object";
|
|
327
|
+
readonly required: readonly ["verdicts"];
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
readonly then: {
|
|
332
|
+
readonly properties: {
|
|
333
|
+
readonly semantic: {
|
|
334
|
+
readonly type: "object";
|
|
335
|
+
readonly required: readonly ["severity"];
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
}, {
|
|
340
|
+
readonly if: {
|
|
341
|
+
readonly required: readonly ["semantic"];
|
|
342
|
+
readonly properties: {
|
|
343
|
+
readonly semantic: {
|
|
344
|
+
readonly type: "object";
|
|
345
|
+
readonly not: {
|
|
346
|
+
readonly required: readonly ["verdicts"];
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
readonly then: {
|
|
352
|
+
readonly properties: {
|
|
353
|
+
readonly semantic: {
|
|
354
|
+
readonly type: "object";
|
|
355
|
+
readonly properties: {
|
|
356
|
+
readonly severity: {
|
|
357
|
+
readonly type: "object";
|
|
358
|
+
readonly not: {
|
|
359
|
+
readonly required: readonly ["fail"];
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
}, {
|
|
367
|
+
readonly if: {
|
|
368
|
+
readonly required: readonly ["semantic"];
|
|
369
|
+
readonly properties: {
|
|
370
|
+
readonly semantic: {
|
|
371
|
+
readonly type: "object";
|
|
372
|
+
readonly required: readonly ["verdicts"];
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
readonly not: {
|
|
376
|
+
readonly required: readonly ["expression"];
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
readonly then: {
|
|
380
|
+
readonly not: {
|
|
381
|
+
readonly required: readonly ["severity"];
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
}];
|
|
121
385
|
};
|
|
122
|
-
declare const
|
|
386
|
+
declare const REF_SCHEMA: {
|
|
123
387
|
readonly type: "object";
|
|
124
388
|
readonly properties: {
|
|
125
389
|
readonly $ref: {
|
|
@@ -130,9 +394,84 @@ declare const RULE_REF_SCHEMA: {
|
|
|
130
394
|
readonly required: readonly ["$ref"];
|
|
131
395
|
readonly additionalProperties: false;
|
|
132
396
|
};
|
|
397
|
+
declare const HIERARCHY_SCHEMA: {
|
|
398
|
+
readonly type: "object";
|
|
399
|
+
readonly properties: {
|
|
400
|
+
readonly name: {
|
|
401
|
+
readonly type: "string";
|
|
402
|
+
readonly minLength: 1;
|
|
403
|
+
};
|
|
404
|
+
readonly override: {
|
|
405
|
+
readonly type: "boolean";
|
|
406
|
+
};
|
|
407
|
+
readonly levels: {
|
|
408
|
+
readonly type: "array";
|
|
409
|
+
readonly minItems: 1;
|
|
410
|
+
readonly items: {
|
|
411
|
+
readonly oneOf: readonly [{
|
|
412
|
+
readonly type: "string";
|
|
413
|
+
readonly minLength: 1;
|
|
414
|
+
}, {
|
|
415
|
+
readonly type: "object";
|
|
416
|
+
readonly properties: {
|
|
417
|
+
readonly selfRef: {
|
|
418
|
+
readonly type: "boolean";
|
|
419
|
+
};
|
|
420
|
+
readonly selfRefField: {
|
|
421
|
+
readonly type: "string";
|
|
422
|
+
readonly minLength: 1;
|
|
423
|
+
};
|
|
424
|
+
readonly templateFormat: {
|
|
425
|
+
readonly enum: readonly ["heading", "list", "table", "page"];
|
|
426
|
+
};
|
|
427
|
+
readonly matchers: {
|
|
428
|
+
readonly type: "array";
|
|
429
|
+
readonly items: {
|
|
430
|
+
readonly type: "string";
|
|
431
|
+
readonly minLength: 1;
|
|
432
|
+
};
|
|
433
|
+
readonly minItems: 1;
|
|
434
|
+
};
|
|
435
|
+
readonly embeddedTemplateFields: {
|
|
436
|
+
readonly type: "array";
|
|
437
|
+
readonly items: {
|
|
438
|
+
readonly type: "string";
|
|
439
|
+
readonly minLength: 1;
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
readonly field: {
|
|
443
|
+
readonly type: "string";
|
|
444
|
+
readonly minLength: 1;
|
|
445
|
+
};
|
|
446
|
+
readonly fieldOn: {
|
|
447
|
+
readonly enum: readonly ["child", "parent"];
|
|
448
|
+
};
|
|
449
|
+
readonly multiple: {
|
|
450
|
+
readonly type: "boolean";
|
|
451
|
+
};
|
|
452
|
+
readonly type: {
|
|
453
|
+
readonly type: "string";
|
|
454
|
+
readonly minLength: 1;
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
readonly required: readonly ["type"];
|
|
458
|
+
readonly additionalProperties: false;
|
|
459
|
+
}];
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
readonly allowSkipLevels: {
|
|
463
|
+
readonly type: "boolean";
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
readonly required: readonly ["levels"];
|
|
467
|
+
readonly additionalProperties: false;
|
|
468
|
+
};
|
|
133
469
|
declare const RELATIONSHIP_SCHEMA: {
|
|
134
470
|
readonly type: "object";
|
|
135
471
|
readonly properties: {
|
|
472
|
+
readonly override: {
|
|
473
|
+
readonly type: "boolean";
|
|
474
|
+
};
|
|
136
475
|
readonly templateFormat: {
|
|
137
476
|
readonly enum: readonly ["heading", "list", "table", "page"];
|
|
138
477
|
};
|
|
@@ -176,76 +515,105 @@ declare const RELATIONSHIP_SCHEMA: {
|
|
|
176
515
|
export declare const METADATA_SCHEMA: {
|
|
177
516
|
readonly type: "object";
|
|
178
517
|
readonly properties: {
|
|
518
|
+
readonly imports: {
|
|
519
|
+
readonly type: "array";
|
|
520
|
+
readonly items: {
|
|
521
|
+
readonly type: "string";
|
|
522
|
+
readonly minLength: 1;
|
|
523
|
+
};
|
|
524
|
+
};
|
|
179
525
|
readonly hierarchy: {
|
|
180
|
-
readonly
|
|
181
|
-
|
|
182
|
-
readonly
|
|
183
|
-
readonly
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
readonly
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
readonly
|
|
200
|
-
readonly
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
readonly
|
|
204
|
-
readonly items: {
|
|
526
|
+
readonly oneOf: readonly [{
|
|
527
|
+
readonly type: "object";
|
|
528
|
+
readonly properties: {
|
|
529
|
+
readonly name: {
|
|
530
|
+
readonly type: "string";
|
|
531
|
+
readonly minLength: 1;
|
|
532
|
+
};
|
|
533
|
+
readonly override: {
|
|
534
|
+
readonly type: "boolean";
|
|
535
|
+
};
|
|
536
|
+
readonly levels: {
|
|
537
|
+
readonly type: "array";
|
|
538
|
+
readonly minItems: 1;
|
|
539
|
+
readonly items: {
|
|
540
|
+
readonly oneOf: readonly [{
|
|
541
|
+
readonly type: "string";
|
|
542
|
+
readonly minLength: 1;
|
|
543
|
+
}, {
|
|
544
|
+
readonly type: "object";
|
|
545
|
+
readonly properties: {
|
|
546
|
+
readonly selfRef: {
|
|
547
|
+
readonly type: "boolean";
|
|
548
|
+
};
|
|
549
|
+
readonly selfRefField: {
|
|
205
550
|
readonly type: "string";
|
|
206
551
|
readonly minLength: 1;
|
|
207
552
|
};
|
|
208
|
-
readonly
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
readonly
|
|
212
|
-
|
|
553
|
+
readonly templateFormat: {
|
|
554
|
+
readonly enum: readonly ["heading", "list", "table", "page"];
|
|
555
|
+
};
|
|
556
|
+
readonly matchers: {
|
|
557
|
+
readonly type: "array";
|
|
558
|
+
readonly items: {
|
|
559
|
+
readonly type: "string";
|
|
560
|
+
readonly minLength: 1;
|
|
561
|
+
};
|
|
562
|
+
readonly minItems: 1;
|
|
563
|
+
};
|
|
564
|
+
readonly embeddedTemplateFields: {
|
|
565
|
+
readonly type: "array";
|
|
566
|
+
readonly items: {
|
|
567
|
+
readonly type: "string";
|
|
568
|
+
readonly minLength: 1;
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
readonly field: {
|
|
572
|
+
readonly type: "string";
|
|
573
|
+
readonly minLength: 1;
|
|
574
|
+
};
|
|
575
|
+
readonly fieldOn: {
|
|
576
|
+
readonly enum: readonly ["child", "parent"];
|
|
577
|
+
};
|
|
578
|
+
readonly multiple: {
|
|
579
|
+
readonly type: "boolean";
|
|
580
|
+
};
|
|
581
|
+
readonly type: {
|
|
213
582
|
readonly type: "string";
|
|
214
583
|
readonly minLength: 1;
|
|
215
584
|
};
|
|
216
585
|
};
|
|
217
|
-
readonly
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
readonly multiple: {
|
|
225
|
-
readonly type: "boolean";
|
|
226
|
-
};
|
|
227
|
-
readonly type: {
|
|
228
|
-
readonly type: "string";
|
|
229
|
-
readonly minLength: 1;
|
|
230
|
-
};
|
|
231
|
-
};
|
|
232
|
-
readonly required: readonly ["type"];
|
|
233
|
-
readonly additionalProperties: false;
|
|
234
|
-
}];
|
|
586
|
+
readonly required: readonly ["type"];
|
|
587
|
+
readonly additionalProperties: false;
|
|
588
|
+
}];
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
readonly allowSkipLevels: {
|
|
592
|
+
readonly type: "boolean";
|
|
235
593
|
};
|
|
236
594
|
};
|
|
237
|
-
readonly
|
|
238
|
-
|
|
595
|
+
readonly required: readonly ["levels"];
|
|
596
|
+
readonly additionalProperties: false;
|
|
597
|
+
}, {
|
|
598
|
+
readonly type: "object";
|
|
599
|
+
readonly properties: {
|
|
600
|
+
readonly $ref: {
|
|
601
|
+
readonly type: "string";
|
|
602
|
+
readonly minLength: 1;
|
|
603
|
+
};
|
|
239
604
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
605
|
+
readonly required: readonly ["$ref"];
|
|
606
|
+
readonly additionalProperties: false;
|
|
607
|
+
}];
|
|
243
608
|
};
|
|
244
609
|
readonly relationships: {
|
|
245
610
|
readonly type: "array";
|
|
246
611
|
readonly items: {
|
|
247
612
|
readonly type: "object";
|
|
248
613
|
readonly properties: {
|
|
614
|
+
readonly override: {
|
|
615
|
+
readonly type: "boolean";
|
|
616
|
+
};
|
|
249
617
|
readonly templateFormat: {
|
|
250
618
|
readonly enum: readonly ["heading", "list", "table", "page"];
|
|
251
619
|
};
|
|
@@ -290,143 +658,358 @@ export declare const METADATA_SCHEMA: {
|
|
|
290
658
|
readonly aliases: {
|
|
291
659
|
readonly type: "object";
|
|
292
660
|
readonly additionalProperties: {
|
|
293
|
-
readonly type: "string";
|
|
294
|
-
readonly minLength: 1;
|
|
295
|
-
};
|
|
296
|
-
};
|
|
297
|
-
readonly rules: {
|
|
298
|
-
readonly type: "array";
|
|
299
|
-
readonly items: {
|
|
300
661
|
readonly oneOf: readonly [{
|
|
662
|
+
readonly type: "string";
|
|
663
|
+
readonly minLength: 1;
|
|
664
|
+
}, {
|
|
301
665
|
readonly type: "object";
|
|
302
666
|
readonly properties: {
|
|
303
|
-
readonly
|
|
667
|
+
readonly type: {
|
|
304
668
|
readonly type: "string";
|
|
305
669
|
readonly minLength: 1;
|
|
306
670
|
};
|
|
307
|
-
readonly
|
|
308
|
-
readonly
|
|
671
|
+
readonly override: {
|
|
672
|
+
readonly type: "boolean";
|
|
309
673
|
};
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
674
|
+
};
|
|
675
|
+
readonly required: readonly ["type"];
|
|
676
|
+
readonly additionalProperties: false;
|
|
677
|
+
}];
|
|
678
|
+
};
|
|
679
|
+
};
|
|
680
|
+
readonly rules: {
|
|
681
|
+
readonly type: "array";
|
|
682
|
+
readonly items: {
|
|
683
|
+
readonly type: "object";
|
|
684
|
+
readonly properties: {
|
|
685
|
+
readonly id: {
|
|
686
|
+
readonly type: "string";
|
|
687
|
+
readonly minLength: 1;
|
|
688
|
+
};
|
|
689
|
+
readonly category: {
|
|
690
|
+
readonly enum: readonly ["validation", "coherence", "workflow", "best-practice"];
|
|
691
|
+
};
|
|
692
|
+
/**
|
|
693
|
+
* Severity of a failed `expression` and of the default `fail` verdict. Defaults from the category.
|
|
694
|
+
*/
|
|
695
|
+
readonly severity: {
|
|
696
|
+
readonly enum: readonly ["error", "warning", "info"];
|
|
697
|
+
};
|
|
698
|
+
readonly description: {
|
|
699
|
+
readonly type: "string";
|
|
700
|
+
readonly minLength: 1;
|
|
701
|
+
};
|
|
702
|
+
/** JSONata test a node must pass. When the rule also has `semantic`, a failing node is reported without being evaluated by the model. */
|
|
703
|
+
readonly expression: {
|
|
704
|
+
readonly type: "string";
|
|
705
|
+
readonly minLength: 1;
|
|
706
|
+
};
|
|
707
|
+
/** Optional JSONata applicability condition, evaluated per node before the rule runs. The rule applies only when it returns true. */
|
|
708
|
+
readonly when: {
|
|
709
|
+
readonly type: "string";
|
|
710
|
+
readonly minLength: 1;
|
|
711
|
+
};
|
|
712
|
+
/** A model evaluates the node against a rubric. `{}` takes every default; `true` means the same. */
|
|
713
|
+
readonly semantic: {
|
|
714
|
+
readonly oneOf: readonly [{
|
|
715
|
+
readonly const: true;
|
|
716
|
+
}, {
|
|
717
|
+
readonly type: "object";
|
|
718
|
+
readonly properties: {
|
|
719
|
+
/** What the model judges the node against. Falls back to the rule's `description`. */
|
|
720
|
+
readonly rubric: {
|
|
721
|
+
readonly type: "string";
|
|
722
|
+
readonly minLength: 1;
|
|
723
|
+
};
|
|
724
|
+
/**
|
|
725
|
+
* The closed set of verdicts the model may return. Each is a description (what the verdict means, for the
|
|
726
|
+
* model) or `{ description, guidance }`, where `guidance` is shown to the user when it fires.
|
|
727
|
+
* Defaults to `pass`/`fail`.
|
|
728
|
+
*/
|
|
729
|
+
readonly verdicts: {
|
|
730
|
+
readonly type: "object";
|
|
731
|
+
readonly additionalProperties: {
|
|
732
|
+
readonly oneOf: readonly [{
|
|
733
|
+
readonly type: "string";
|
|
734
|
+
readonly minLength: 1;
|
|
735
|
+
}, {
|
|
736
|
+
readonly type: "object";
|
|
737
|
+
readonly properties: {
|
|
738
|
+
readonly description: {
|
|
739
|
+
readonly type: "string";
|
|
740
|
+
readonly minLength: 1;
|
|
741
|
+
};
|
|
742
|
+
readonly guidance: {
|
|
743
|
+
readonly type: "string";
|
|
744
|
+
readonly minLength: 1;
|
|
745
|
+
};
|
|
746
|
+
};
|
|
747
|
+
readonly required: readonly ["description"];
|
|
748
|
+
readonly additionalProperties: false;
|
|
749
|
+
}];
|
|
750
|
+
};
|
|
751
|
+
readonly minProperties: 2;
|
|
752
|
+
};
|
|
753
|
+
/**
|
|
754
|
+
* Severity per verdict in effect (declared, default or reserved). A verdict mapped to `ignore` is judged but
|
|
755
|
+
* not reported, and a verdict left out passes. Required with `verdicts`; with the default verdicts, `fail`
|
|
756
|
+
* takes the rule's own `severity` instead.
|
|
757
|
+
*/
|
|
758
|
+
readonly severity: {
|
|
759
|
+
readonly type: "object";
|
|
760
|
+
readonly additionalProperties: {
|
|
761
|
+
readonly enum: readonly ["error", "warning", "info", "ignore"];
|
|
762
|
+
};
|
|
763
|
+
readonly minProperties: 1;
|
|
764
|
+
};
|
|
765
|
+
/**
|
|
766
|
+
* Related nodes, along main-hierarchy edges, sent with the evaluated node. Additive; left out or empty means
|
|
767
|
+
* the evaluated node alone.
|
|
768
|
+
*/
|
|
769
|
+
readonly scope: {
|
|
770
|
+
readonly type: "array";
|
|
771
|
+
readonly items: {
|
|
772
|
+
readonly enum: readonly ["parent", "siblings", "children", "ancestors", "descendants", "branch"];
|
|
773
|
+
};
|
|
774
|
+
readonly uniqueItems: true;
|
|
775
|
+
};
|
|
776
|
+
/**
|
|
777
|
+
* Which node bodies are sent: `nodeOnly` (the evaluated node's), `fullScope` (it and every related node's),
|
|
778
|
+
* or `true` for `fullScope`. Left out: no bodies.
|
|
779
|
+
*/
|
|
780
|
+
readonly includeContent: {
|
|
781
|
+
readonly enum: readonly ["nodeOnly", "fullScope", true];
|
|
782
|
+
};
|
|
783
|
+
};
|
|
784
|
+
readonly additionalProperties: false;
|
|
785
|
+
}];
|
|
786
|
+
};
|
|
787
|
+
readonly type: {
|
|
788
|
+
readonly type: "string";
|
|
789
|
+
readonly minLength: 1;
|
|
790
|
+
};
|
|
791
|
+
/** Run once for the whole space instead of once per node. */
|
|
792
|
+
readonly global: {
|
|
793
|
+
readonly type: "boolean";
|
|
794
|
+
};
|
|
795
|
+
readonly override: {
|
|
796
|
+
readonly type: "boolean";
|
|
797
|
+
};
|
|
798
|
+
/** Whether a failure of this rule gates (suppresses) downstream rules on the node's hierarchy subtree. Defaults to true when the failure's severity is `error`. */
|
|
799
|
+
readonly gatesDescendants: {
|
|
800
|
+
readonly type: "boolean";
|
|
801
|
+
};
|
|
802
|
+
};
|
|
803
|
+
readonly required: readonly ["id", "category", "description"];
|
|
804
|
+
readonly additionalProperties: false;
|
|
805
|
+
readonly allOf: readonly [{
|
|
806
|
+
readonly anyOf: readonly [{
|
|
807
|
+
readonly required: readonly ["expression"];
|
|
808
|
+
}, {
|
|
809
|
+
readonly required: readonly ["semantic"];
|
|
810
|
+
}];
|
|
811
|
+
}, {
|
|
812
|
+
readonly if: {
|
|
813
|
+
readonly required: readonly ["global"];
|
|
814
|
+
readonly properties: {
|
|
815
|
+
readonly global: {
|
|
816
|
+
readonly const: true;
|
|
817
|
+
};
|
|
313
818
|
};
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
819
|
+
};
|
|
820
|
+
readonly then: {
|
|
821
|
+
readonly not: {
|
|
822
|
+
readonly anyOf: readonly [{
|
|
823
|
+
readonly required: readonly ["when"];
|
|
824
|
+
}, {
|
|
825
|
+
readonly required: readonly ["type"];
|
|
826
|
+
}, {
|
|
827
|
+
readonly required: readonly ["semantic"];
|
|
828
|
+
}];
|
|
317
829
|
};
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
830
|
+
};
|
|
831
|
+
}, {
|
|
832
|
+
readonly if: {
|
|
833
|
+
readonly required: readonly ["semantic"];
|
|
834
|
+
readonly properties: {
|
|
835
|
+
readonly semantic: {
|
|
836
|
+
readonly type: "object";
|
|
837
|
+
readonly required: readonly ["verdicts"];
|
|
838
|
+
};
|
|
321
839
|
};
|
|
322
|
-
|
|
323
|
-
|
|
840
|
+
};
|
|
841
|
+
readonly then: {
|
|
842
|
+
readonly properties: {
|
|
843
|
+
readonly semantic: {
|
|
844
|
+
readonly type: "object";
|
|
845
|
+
readonly required: readonly ["severity"];
|
|
846
|
+
};
|
|
324
847
|
};
|
|
325
|
-
|
|
326
|
-
|
|
848
|
+
};
|
|
849
|
+
}, {
|
|
850
|
+
readonly if: {
|
|
851
|
+
readonly required: readonly ["semantic"];
|
|
852
|
+
readonly properties: {
|
|
853
|
+
readonly semantic: {
|
|
854
|
+
readonly type: "object";
|
|
855
|
+
readonly not: {
|
|
856
|
+
readonly required: readonly ["verdicts"];
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
readonly then: {
|
|
862
|
+
readonly properties: {
|
|
863
|
+
readonly semantic: {
|
|
864
|
+
readonly type: "object";
|
|
865
|
+
readonly properties: {
|
|
866
|
+
readonly severity: {
|
|
867
|
+
readonly type: "object";
|
|
868
|
+
readonly not: {
|
|
869
|
+
readonly required: readonly ["fail"];
|
|
870
|
+
};
|
|
871
|
+
};
|
|
872
|
+
};
|
|
873
|
+
};
|
|
327
874
|
};
|
|
328
875
|
};
|
|
329
|
-
readonly required: readonly ["id", "category", "description", "check"];
|
|
330
|
-
readonly additionalProperties: false;
|
|
331
876
|
}, {
|
|
332
|
-
readonly
|
|
333
|
-
|
|
334
|
-
readonly
|
|
335
|
-
readonly
|
|
336
|
-
|
|
877
|
+
readonly if: {
|
|
878
|
+
readonly required: readonly ["semantic"];
|
|
879
|
+
readonly properties: {
|
|
880
|
+
readonly semantic: {
|
|
881
|
+
readonly type: "object";
|
|
882
|
+
readonly required: readonly ["verdicts"];
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
readonly not: {
|
|
886
|
+
readonly required: readonly ["expression"];
|
|
887
|
+
};
|
|
888
|
+
};
|
|
889
|
+
readonly then: {
|
|
890
|
+
readonly not: {
|
|
891
|
+
readonly required: readonly ["severity"];
|
|
337
892
|
};
|
|
338
893
|
};
|
|
339
|
-
readonly required: readonly ["$ref"];
|
|
340
|
-
readonly additionalProperties: false;
|
|
341
894
|
}];
|
|
342
895
|
};
|
|
343
896
|
};
|
|
344
897
|
};
|
|
345
898
|
readonly additionalProperties: false;
|
|
346
899
|
};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
readonly $
|
|
900
|
+
/** The dialect meta-schema, published under `$id`. */
|
|
901
|
+
export declare function buildDialectMetaSchema(id: string): {
|
|
902
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
903
|
+
readonly $id: string;
|
|
350
904
|
readonly title: "structured-context schema dialect";
|
|
351
|
-
readonly description: "Extends JSON Schema
|
|
905
|
+
readonly description: "Extends JSON Schema 2020-12 with top-level $metadata for imports, hierarchy, relationships, aliases and rules.";
|
|
352
906
|
readonly type: "object";
|
|
353
907
|
readonly allOf: readonly [{
|
|
354
|
-
readonly $ref: "
|
|
908
|
+
readonly $ref: "https://json-schema.org/draft/2020-12/schema";
|
|
355
909
|
}];
|
|
356
910
|
readonly properties: {
|
|
357
911
|
readonly $metadata: {
|
|
358
912
|
readonly type: "object";
|
|
359
913
|
readonly properties: {
|
|
914
|
+
readonly imports: {
|
|
915
|
+
readonly type: "array";
|
|
916
|
+
readonly items: {
|
|
917
|
+
readonly type: "string";
|
|
918
|
+
readonly minLength: 1;
|
|
919
|
+
};
|
|
920
|
+
};
|
|
360
921
|
readonly hierarchy: {
|
|
361
|
-
readonly
|
|
362
|
-
|
|
363
|
-
readonly
|
|
364
|
-
readonly
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
readonly
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
readonly
|
|
381
|
-
readonly
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
readonly
|
|
385
|
-
readonly items: {
|
|
922
|
+
readonly oneOf: readonly [{
|
|
923
|
+
readonly type: "object";
|
|
924
|
+
readonly properties: {
|
|
925
|
+
readonly name: {
|
|
926
|
+
readonly type: "string";
|
|
927
|
+
readonly minLength: 1;
|
|
928
|
+
};
|
|
929
|
+
readonly override: {
|
|
930
|
+
readonly type: "boolean";
|
|
931
|
+
};
|
|
932
|
+
readonly levels: {
|
|
933
|
+
readonly type: "array";
|
|
934
|
+
readonly minItems: 1;
|
|
935
|
+
readonly items: {
|
|
936
|
+
readonly oneOf: readonly [{
|
|
937
|
+
readonly type: "string";
|
|
938
|
+
readonly minLength: 1;
|
|
939
|
+
}, {
|
|
940
|
+
readonly type: "object";
|
|
941
|
+
readonly properties: {
|
|
942
|
+
readonly selfRef: {
|
|
943
|
+
readonly type: "boolean";
|
|
944
|
+
};
|
|
945
|
+
readonly selfRefField: {
|
|
386
946
|
readonly type: "string";
|
|
387
947
|
readonly minLength: 1;
|
|
388
948
|
};
|
|
389
|
-
readonly
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
readonly
|
|
393
|
-
|
|
949
|
+
readonly templateFormat: {
|
|
950
|
+
readonly enum: readonly ["heading", "list", "table", "page"];
|
|
951
|
+
};
|
|
952
|
+
readonly matchers: {
|
|
953
|
+
readonly type: "array";
|
|
954
|
+
readonly items: {
|
|
955
|
+
readonly type: "string";
|
|
956
|
+
readonly minLength: 1;
|
|
957
|
+
};
|
|
958
|
+
readonly minItems: 1;
|
|
959
|
+
};
|
|
960
|
+
readonly embeddedTemplateFields: {
|
|
961
|
+
readonly type: "array";
|
|
962
|
+
readonly items: {
|
|
963
|
+
readonly type: "string";
|
|
964
|
+
readonly minLength: 1;
|
|
965
|
+
};
|
|
966
|
+
};
|
|
967
|
+
readonly field: {
|
|
968
|
+
readonly type: "string";
|
|
969
|
+
readonly minLength: 1;
|
|
970
|
+
};
|
|
971
|
+
readonly fieldOn: {
|
|
972
|
+
readonly enum: readonly ["child", "parent"];
|
|
973
|
+
};
|
|
974
|
+
readonly multiple: {
|
|
975
|
+
readonly type: "boolean";
|
|
976
|
+
};
|
|
977
|
+
readonly type: {
|
|
394
978
|
readonly type: "string";
|
|
395
979
|
readonly minLength: 1;
|
|
396
980
|
};
|
|
397
981
|
};
|
|
398
|
-
readonly
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
readonly multiple: {
|
|
406
|
-
readonly type: "boolean";
|
|
407
|
-
};
|
|
408
|
-
readonly type: {
|
|
409
|
-
readonly type: "string";
|
|
410
|
-
readonly minLength: 1;
|
|
411
|
-
};
|
|
412
|
-
};
|
|
413
|
-
readonly required: readonly ["type"];
|
|
414
|
-
readonly additionalProperties: false;
|
|
415
|
-
}];
|
|
982
|
+
readonly required: readonly ["type"];
|
|
983
|
+
readonly additionalProperties: false;
|
|
984
|
+
}];
|
|
985
|
+
};
|
|
986
|
+
};
|
|
987
|
+
readonly allowSkipLevels: {
|
|
988
|
+
readonly type: "boolean";
|
|
416
989
|
};
|
|
417
990
|
};
|
|
418
|
-
readonly
|
|
419
|
-
|
|
991
|
+
readonly required: readonly ["levels"];
|
|
992
|
+
readonly additionalProperties: false;
|
|
993
|
+
}, {
|
|
994
|
+
readonly type: "object";
|
|
995
|
+
readonly properties: {
|
|
996
|
+
readonly $ref: {
|
|
997
|
+
readonly type: "string";
|
|
998
|
+
readonly minLength: 1;
|
|
999
|
+
};
|
|
420
1000
|
};
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
1001
|
+
readonly required: readonly ["$ref"];
|
|
1002
|
+
readonly additionalProperties: false;
|
|
1003
|
+
}];
|
|
424
1004
|
};
|
|
425
1005
|
readonly relationships: {
|
|
426
1006
|
readonly type: "array";
|
|
427
1007
|
readonly items: {
|
|
428
1008
|
readonly type: "object";
|
|
429
1009
|
readonly properties: {
|
|
1010
|
+
readonly override: {
|
|
1011
|
+
readonly type: "boolean";
|
|
1012
|
+
};
|
|
430
1013
|
readonly templateFormat: {
|
|
431
1014
|
readonly enum: readonly ["heading", "list", "table", "page"];
|
|
432
1015
|
};
|
|
@@ -471,54 +1054,239 @@ export declare const DIALECT_META_SCHEMA: {
|
|
|
471
1054
|
readonly aliases: {
|
|
472
1055
|
readonly type: "object";
|
|
473
1056
|
readonly additionalProperties: {
|
|
474
|
-
readonly type: "string";
|
|
475
|
-
readonly minLength: 1;
|
|
476
|
-
};
|
|
477
|
-
};
|
|
478
|
-
readonly rules: {
|
|
479
|
-
readonly type: "array";
|
|
480
|
-
readonly items: {
|
|
481
1057
|
readonly oneOf: readonly [{
|
|
1058
|
+
readonly type: "string";
|
|
1059
|
+
readonly minLength: 1;
|
|
1060
|
+
}, {
|
|
482
1061
|
readonly type: "object";
|
|
483
1062
|
readonly properties: {
|
|
484
|
-
readonly
|
|
1063
|
+
readonly type: {
|
|
485
1064
|
readonly type: "string";
|
|
486
1065
|
readonly minLength: 1;
|
|
487
1066
|
};
|
|
488
|
-
readonly
|
|
489
|
-
readonly
|
|
1067
|
+
readonly override: {
|
|
1068
|
+
readonly type: "boolean";
|
|
490
1069
|
};
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
1070
|
+
};
|
|
1071
|
+
readonly required: readonly ["type"];
|
|
1072
|
+
readonly additionalProperties: false;
|
|
1073
|
+
}];
|
|
1074
|
+
};
|
|
1075
|
+
};
|
|
1076
|
+
readonly rules: {
|
|
1077
|
+
readonly type: "array";
|
|
1078
|
+
readonly items: {
|
|
1079
|
+
readonly type: "object";
|
|
1080
|
+
readonly properties: {
|
|
1081
|
+
readonly id: {
|
|
1082
|
+
readonly type: "string";
|
|
1083
|
+
readonly minLength: 1;
|
|
1084
|
+
};
|
|
1085
|
+
readonly category: {
|
|
1086
|
+
readonly enum: readonly ["validation", "coherence", "workflow", "best-practice"];
|
|
1087
|
+
};
|
|
1088
|
+
/**
|
|
1089
|
+
* Severity of a failed `expression` and of the default `fail` verdict. Defaults from the category.
|
|
1090
|
+
*/
|
|
1091
|
+
readonly severity: {
|
|
1092
|
+
readonly enum: readonly ["error", "warning", "info"];
|
|
1093
|
+
};
|
|
1094
|
+
readonly description: {
|
|
1095
|
+
readonly type: "string";
|
|
1096
|
+
readonly minLength: 1;
|
|
1097
|
+
};
|
|
1098
|
+
/** JSONata test a node must pass. When the rule also has `semantic`, a failing node is reported without being evaluated by the model. */
|
|
1099
|
+
readonly expression: {
|
|
1100
|
+
readonly type: "string";
|
|
1101
|
+
readonly minLength: 1;
|
|
1102
|
+
};
|
|
1103
|
+
/** Optional JSONata applicability condition, evaluated per node before the rule runs. The rule applies only when it returns true. */
|
|
1104
|
+
readonly when: {
|
|
1105
|
+
readonly type: "string";
|
|
1106
|
+
readonly minLength: 1;
|
|
1107
|
+
};
|
|
1108
|
+
/** A model evaluates the node against a rubric. `{}` takes every default; `true` means the same. */
|
|
1109
|
+
readonly semantic: {
|
|
1110
|
+
readonly oneOf: readonly [{
|
|
1111
|
+
readonly const: true;
|
|
1112
|
+
}, {
|
|
1113
|
+
readonly type: "object";
|
|
1114
|
+
readonly properties: {
|
|
1115
|
+
/** What the model judges the node against. Falls back to the rule's `description`. */
|
|
1116
|
+
readonly rubric: {
|
|
1117
|
+
readonly type: "string";
|
|
1118
|
+
readonly minLength: 1;
|
|
1119
|
+
};
|
|
1120
|
+
/**
|
|
1121
|
+
* The closed set of verdicts the model may return. Each is a description (what the verdict means, for the
|
|
1122
|
+
* model) or `{ description, guidance }`, where `guidance` is shown to the user when it fires.
|
|
1123
|
+
* Defaults to `pass`/`fail`.
|
|
1124
|
+
*/
|
|
1125
|
+
readonly verdicts: {
|
|
1126
|
+
readonly type: "object";
|
|
1127
|
+
readonly additionalProperties: {
|
|
1128
|
+
readonly oneOf: readonly [{
|
|
1129
|
+
readonly type: "string";
|
|
1130
|
+
readonly minLength: 1;
|
|
1131
|
+
}, {
|
|
1132
|
+
readonly type: "object";
|
|
1133
|
+
readonly properties: {
|
|
1134
|
+
readonly description: {
|
|
1135
|
+
readonly type: "string";
|
|
1136
|
+
readonly minLength: 1;
|
|
1137
|
+
};
|
|
1138
|
+
readonly guidance: {
|
|
1139
|
+
readonly type: "string";
|
|
1140
|
+
readonly minLength: 1;
|
|
1141
|
+
};
|
|
1142
|
+
};
|
|
1143
|
+
readonly required: readonly ["description"];
|
|
1144
|
+
readonly additionalProperties: false;
|
|
1145
|
+
}];
|
|
1146
|
+
};
|
|
1147
|
+
readonly minProperties: 2;
|
|
1148
|
+
};
|
|
1149
|
+
/**
|
|
1150
|
+
* Severity per verdict in effect (declared, default or reserved). A verdict mapped to `ignore` is judged but
|
|
1151
|
+
* not reported, and a verdict left out passes. Required with `verdicts`; with the default verdicts, `fail`
|
|
1152
|
+
* takes the rule's own `severity` instead.
|
|
1153
|
+
*/
|
|
1154
|
+
readonly severity: {
|
|
1155
|
+
readonly type: "object";
|
|
1156
|
+
readonly additionalProperties: {
|
|
1157
|
+
readonly enum: readonly ["error", "warning", "info", "ignore"];
|
|
1158
|
+
};
|
|
1159
|
+
readonly minProperties: 1;
|
|
1160
|
+
};
|
|
1161
|
+
/**
|
|
1162
|
+
* Related nodes, along main-hierarchy edges, sent with the evaluated node. Additive; left out or empty means
|
|
1163
|
+
* the evaluated node alone.
|
|
1164
|
+
*/
|
|
1165
|
+
readonly scope: {
|
|
1166
|
+
readonly type: "array";
|
|
1167
|
+
readonly items: {
|
|
1168
|
+
readonly enum: readonly ["parent", "siblings", "children", "ancestors", "descendants", "branch"];
|
|
1169
|
+
};
|
|
1170
|
+
readonly uniqueItems: true;
|
|
1171
|
+
};
|
|
1172
|
+
/**
|
|
1173
|
+
* Which node bodies are sent: `nodeOnly` (the evaluated node's), `fullScope` (it and every related node's),
|
|
1174
|
+
* or `true` for `fullScope`. Left out: no bodies.
|
|
1175
|
+
*/
|
|
1176
|
+
readonly includeContent: {
|
|
1177
|
+
readonly enum: readonly ["nodeOnly", "fullScope", true];
|
|
1178
|
+
};
|
|
1179
|
+
};
|
|
1180
|
+
readonly additionalProperties: false;
|
|
1181
|
+
}];
|
|
1182
|
+
};
|
|
1183
|
+
readonly type: {
|
|
1184
|
+
readonly type: "string";
|
|
1185
|
+
readonly minLength: 1;
|
|
1186
|
+
};
|
|
1187
|
+
/** Run once for the whole space instead of once per node. */
|
|
1188
|
+
readonly global: {
|
|
1189
|
+
readonly type: "boolean";
|
|
1190
|
+
};
|
|
1191
|
+
readonly override: {
|
|
1192
|
+
readonly type: "boolean";
|
|
1193
|
+
};
|
|
1194
|
+
/** Whether a failure of this rule gates (suppresses) downstream rules on the node's hierarchy subtree. Defaults to true when the failure's severity is `error`. */
|
|
1195
|
+
readonly gatesDescendants: {
|
|
1196
|
+
readonly type: "boolean";
|
|
1197
|
+
};
|
|
1198
|
+
};
|
|
1199
|
+
readonly required: readonly ["id", "category", "description"];
|
|
1200
|
+
readonly additionalProperties: false;
|
|
1201
|
+
readonly allOf: readonly [{
|
|
1202
|
+
readonly anyOf: readonly [{
|
|
1203
|
+
readonly required: readonly ["expression"];
|
|
1204
|
+
}, {
|
|
1205
|
+
readonly required: readonly ["semantic"];
|
|
1206
|
+
}];
|
|
1207
|
+
}, {
|
|
1208
|
+
readonly if: {
|
|
1209
|
+
readonly required: readonly ["global"];
|
|
1210
|
+
readonly properties: {
|
|
1211
|
+
readonly global: {
|
|
1212
|
+
readonly const: true;
|
|
1213
|
+
};
|
|
494
1214
|
};
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
1215
|
+
};
|
|
1216
|
+
readonly then: {
|
|
1217
|
+
readonly not: {
|
|
1218
|
+
readonly anyOf: readonly [{
|
|
1219
|
+
readonly required: readonly ["when"];
|
|
1220
|
+
}, {
|
|
1221
|
+
readonly required: readonly ["type"];
|
|
1222
|
+
}, {
|
|
1223
|
+
readonly required: readonly ["semantic"];
|
|
1224
|
+
}];
|
|
498
1225
|
};
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
1226
|
+
};
|
|
1227
|
+
}, {
|
|
1228
|
+
readonly if: {
|
|
1229
|
+
readonly required: readonly ["semantic"];
|
|
1230
|
+
readonly properties: {
|
|
1231
|
+
readonly semantic: {
|
|
1232
|
+
readonly type: "object";
|
|
1233
|
+
readonly required: readonly ["verdicts"];
|
|
1234
|
+
};
|
|
502
1235
|
};
|
|
503
|
-
|
|
504
|
-
|
|
1236
|
+
};
|
|
1237
|
+
readonly then: {
|
|
1238
|
+
readonly properties: {
|
|
1239
|
+
readonly semantic: {
|
|
1240
|
+
readonly type: "object";
|
|
1241
|
+
readonly required: readonly ["severity"];
|
|
1242
|
+
};
|
|
505
1243
|
};
|
|
506
|
-
|
|
507
|
-
|
|
1244
|
+
};
|
|
1245
|
+
}, {
|
|
1246
|
+
readonly if: {
|
|
1247
|
+
readonly required: readonly ["semantic"];
|
|
1248
|
+
readonly properties: {
|
|
1249
|
+
readonly semantic: {
|
|
1250
|
+
readonly type: "object";
|
|
1251
|
+
readonly not: {
|
|
1252
|
+
readonly required: readonly ["verdicts"];
|
|
1253
|
+
};
|
|
1254
|
+
};
|
|
1255
|
+
};
|
|
1256
|
+
};
|
|
1257
|
+
readonly then: {
|
|
1258
|
+
readonly properties: {
|
|
1259
|
+
readonly semantic: {
|
|
1260
|
+
readonly type: "object";
|
|
1261
|
+
readonly properties: {
|
|
1262
|
+
readonly severity: {
|
|
1263
|
+
readonly type: "object";
|
|
1264
|
+
readonly not: {
|
|
1265
|
+
readonly required: readonly ["fail"];
|
|
1266
|
+
};
|
|
1267
|
+
};
|
|
1268
|
+
};
|
|
1269
|
+
};
|
|
508
1270
|
};
|
|
509
1271
|
};
|
|
510
|
-
readonly required: readonly ["id", "category", "description", "check"];
|
|
511
|
-
readonly additionalProperties: false;
|
|
512
1272
|
}, {
|
|
513
|
-
readonly
|
|
514
|
-
|
|
515
|
-
readonly
|
|
516
|
-
readonly
|
|
517
|
-
|
|
1273
|
+
readonly if: {
|
|
1274
|
+
readonly required: readonly ["semantic"];
|
|
1275
|
+
readonly properties: {
|
|
1276
|
+
readonly semantic: {
|
|
1277
|
+
readonly type: "object";
|
|
1278
|
+
readonly required: readonly ["verdicts"];
|
|
1279
|
+
};
|
|
1280
|
+
};
|
|
1281
|
+
readonly not: {
|
|
1282
|
+
readonly required: readonly ["expression"];
|
|
1283
|
+
};
|
|
1284
|
+
};
|
|
1285
|
+
readonly then: {
|
|
1286
|
+
readonly not: {
|
|
1287
|
+
readonly required: readonly ["severity"];
|
|
518
1288
|
};
|
|
519
1289
|
};
|
|
520
|
-
readonly required: readonly ["$ref"];
|
|
521
|
-
readonly additionalProperties: false;
|
|
522
1290
|
}];
|
|
523
1291
|
};
|
|
524
1292
|
};
|
|
@@ -528,11 +1296,12 @@ export declare const DIALECT_META_SCHEMA: {
|
|
|
528
1296
|
};
|
|
529
1297
|
};
|
|
530
1298
|
export type MetadataContract = FromSchema<typeof METADATA_SCHEMA>;
|
|
1299
|
+
export type MetadataContractHierarchy = FromSchema<typeof HIERARCHY_SCHEMA>;
|
|
531
1300
|
export type MetadataContractHierarchyLevel = FromSchema<typeof HIERARCHY_LEVEL_SCHEMA>;
|
|
532
1301
|
export type MetadataContractRelationship = FromSchema<typeof RELATIONSHIP_SCHEMA>;
|
|
533
1302
|
export type SharedEdgeFields = FromSchema<typeof EDGE_SCHEMA>;
|
|
534
1303
|
export type SharedEmbeddingFields = FromSchema<typeof EMBEDDING_SCHEMA>;
|
|
535
1304
|
export type Rule = FromSchema<typeof RULE_SCHEMA>;
|
|
536
|
-
export type
|
|
537
|
-
export type
|
|
1305
|
+
export type RuleSemantic = FromSchema<typeof SEMANTIC_SCHEMA>;
|
|
1306
|
+
export type MetadataRef = FromSchema<typeof REF_SCHEMA>;
|
|
538
1307
|
export {};
|