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.
Files changed (138) hide show
  1. package/README.md +52 -198
  2. package/dist/api.d.ts +17 -15
  3. package/dist/api.js +12 -9
  4. package/dist/commands/diagram.d.ts +1 -0
  5. package/dist/commands/diagram.js +7 -1
  6. package/dist/commands/docs.js +1 -0
  7. package/dist/commands/dump.d.ts +15 -2
  8. package/dist/commands/dump.js +18 -4
  9. package/dist/commands/providers.d.ts +4 -0
  10. package/dist/commands/providers.js +52 -0
  11. package/dist/commands/render.d.ts +4 -0
  12. package/dist/commands/render.js +64 -9
  13. package/dist/commands/schemas.d.ts +2 -2
  14. package/dist/commands/schemas.js +133 -22
  15. package/dist/commands/show.d.ts +1 -0
  16. package/dist/commands/show.js +7 -1
  17. package/dist/commands/spaces.d.ts +3 -1
  18. package/dist/commands/spaces.js +11 -2
  19. package/dist/commands/validate-file.d.ts +3 -0
  20. package/dist/commands/validate-file.js +24 -6
  21. package/dist/commands/validate.d.ts +4 -0
  22. package/dist/commands/validate.js +79 -23
  23. package/dist/config.d.ts +25 -1
  24. package/dist/config.js +106 -12
  25. package/dist/filter/augment-nodes.d.ts +3 -1
  26. package/dist/filter/augment-nodes.js +12 -7
  27. package/dist/filter/filter-nodes.js +1 -1
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +96 -31
  30. package/dist/judge/context.d.ts +20 -0
  31. package/dist/judge/context.js +105 -0
  32. package/dist/judge/factory.d.ts +44 -0
  33. package/dist/judge/factory.js +148 -0
  34. package/dist/judge/index.d.ts +13 -0
  35. package/dist/judge/index.js +8 -0
  36. package/dist/judge/judge-node.d.ts +27 -0
  37. package/dist/judge/judge-node.js +122 -0
  38. package/dist/judge/prompt.d.ts +10 -0
  39. package/dist/judge/prompt.js +92 -0
  40. package/dist/judge/provider/anthropic.d.ts +17 -0
  41. package/dist/judge/provider/anthropic.js +43 -0
  42. package/dist/judge/provider/fake.d.ts +26 -0
  43. package/dist/judge/provider/fake.js +56 -0
  44. package/dist/judge/provider/jev.d.ts +37 -0
  45. package/dist/judge/provider/jev.js +169 -0
  46. package/dist/judge/provider/openai-decisions.d.ts +21 -0
  47. package/dist/judge/provider/openai-decisions.js +84 -0
  48. package/dist/judge/provider/openai.d.ts +20 -0
  49. package/dist/judge/provider/openai.js +53 -0
  50. package/dist/judge/provider/per-rule.d.ts +10 -0
  51. package/dist/judge/provider/per-rule.js +18 -0
  52. package/dist/judge/trim.d.ts +27 -0
  53. package/dist/judge/trim.js +62 -0
  54. package/dist/judge/types.d.ts +92 -0
  55. package/dist/judge/types.js +9 -0
  56. package/dist/judge/verdicts.d.ts +24 -0
  57. package/dist/judge/verdicts.js +82 -0
  58. package/dist/load-space-graph.d.ts +7 -5
  59. package/dist/load-space-graph.js +19 -8
  60. package/dist/plugins/loader.js +3 -3
  61. package/dist/plugins/markdown/extract-content-links.js +8 -29
  62. package/dist/plugins/markdown/index.js +8 -2
  63. package/dist/plugins/markdown/parse-embedded.d.ts +8 -0
  64. package/dist/plugins/markdown/parse-embedded.js +195 -24
  65. package/dist/plugins/markdown/read-space.js +42 -14
  66. package/dist/plugins/markdown/render-directory.d.ts +11 -0
  67. package/dist/plugins/markdown/render-directory.js +130 -0
  68. package/dist/plugins/markdown/template-sync.js +3 -4
  69. package/dist/plugins/markdown/util.d.ts +26 -5
  70. package/dist/plugins/markdown/util.js +56 -15
  71. package/dist/plugins/mermaid/render-mermaid.js +2 -1
  72. package/dist/plugins/miro/sync.js +7 -6
  73. package/dist/plugins/util.d.ts +39 -1
  74. package/dist/plugins/util.js +139 -0
  75. package/dist/read/resolve-graph-edges.d.ts +1 -1
  76. package/dist/read/resolve-graph-edges.js +46 -27
  77. package/dist/read/wikilink-utils.d.ts +17 -0
  78. package/dist/read/wikilink-utils.js +40 -0
  79. package/dist/render/render.d.ts +3 -1
  80. package/dist/render/render.js +2 -2
  81. package/dist/schema/evaluate-rule.d.ts +33 -2
  82. package/dist/schema/evaluate-rule.js +58 -4
  83. package/dist/schema/gating.d.ts +69 -0
  84. package/dist/schema/gating.js +253 -0
  85. package/dist/schema/meta-schemas.d.ts +13 -0
  86. package/dist/schema/meta-schemas.js +50 -0
  87. package/dist/schema/metadata-contract.d.ts +952 -183
  88. package/dist/schema/metadata-contract.js +177 -33
  89. package/dist/schema/rule-filter.d.ts +12 -0
  90. package/dist/schema/rule-filter.js +46 -0
  91. package/dist/schema/rule-severity.d.ts +13 -0
  92. package/dist/schema/rule-severity.js +33 -0
  93. package/dist/schema/schema.d.ts +14 -8
  94. package/dist/schema/schema.js +308 -199
  95. package/dist/schema/validate-graph.d.ts +2 -1
  96. package/dist/schema/validate-graph.js +40 -23
  97. package/dist/schema/validate-rules.d.ts +16 -3
  98. package/dist/schema/validate-rules.js +91 -29
  99. package/dist/schemas/_knowledge_wiki.json +24 -24
  100. package/dist/schemas/_okf.json +172 -0
  101. package/dist/schemas/_ost_strict.json +17 -8
  102. package/dist/schemas/_sctx_base.json +3 -3
  103. package/dist/schemas/_strategy_general.json +38 -38
  104. package/dist/schemas/generated/0.12.0/_structured_context_schema_meta.json +229 -0
  105. package/dist/schemas/generated/0.13.0/_structured_context_schema_meta.json +400 -0
  106. package/dist/schemas/generated/latest/_structured_context_schema_meta.json +400 -0
  107. package/dist/schemas/knowledge_wiki.json +10 -9
  108. package/dist/schemas/okf.json +8 -0
  109. package/dist/schemas/strategy_general.json +15 -14
  110. package/dist/schemas/strict_ost.json +17 -16
  111. package/dist/space-context.d.ts +5 -2
  112. package/dist/space-context.js +9 -4
  113. package/dist/space-graph.d.ts +9 -7
  114. package/dist/space-graph.js +7 -5
  115. package/dist/testing.d.ts +33 -0
  116. package/dist/testing.js +72 -0
  117. package/dist/types.d.ts +64 -16
  118. package/dist/validate.d.ts +62 -9
  119. package/dist/validate.js +229 -114
  120. package/docs/concepts.md +65 -9
  121. package/docs/config.md +78 -1
  122. package/docs/rules.md +168 -50
  123. package/docs/schemas.md +152 -52
  124. package/package.json +17 -11
  125. package/schemas/_knowledge_wiki.json +24 -24
  126. package/schemas/_okf.json +172 -0
  127. package/schemas/_ost_strict.json +17 -8
  128. package/schemas/_sctx_base.json +3 -3
  129. package/schemas/_strategy_general.json +38 -38
  130. package/schemas/generated/0.12.0/_structured_context_schema_meta.json +229 -0
  131. package/schemas/generated/0.13.0/_structured_context_schema_meta.json +400 -0
  132. package/schemas/generated/latest/_structured_context_schema_meta.json +400 -0
  133. package/schemas/knowledge_wiki.json +10 -9
  134. package/schemas/okf.json +8 -0
  135. package/schemas/strategy_general.json +15 -14
  136. package/schemas/strict_ost.json +17 -16
  137. package/dist/schemas/generated/_structured_context_schema_meta.json +0 -191
  138. 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
- export declare const SCHEMA_META_ID = "https://raw.githubusercontent.com/mindsocket/structured-context/main/schemas/generated/_structured_context_schema_meta.json";
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
- readonly check: {
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
- readonly scope: {
113
- readonly enum: readonly ["global"];
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", "check"];
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 RULE_REF_SCHEMA: {
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 type: "object";
181
- readonly properties: {
182
- readonly levels: {
183
- readonly type: "array";
184
- readonly minItems: 1;
185
- readonly items: {
186
- readonly oneOf: readonly [{
187
- readonly type: "string";
188
- readonly minLength: 1;
189
- }, {
190
- readonly type: "object";
191
- readonly properties: {
192
- readonly selfRef: {
193
- readonly type: "boolean";
194
- };
195
- readonly selfRefField: {
196
- readonly type: "string";
197
- readonly minLength: 1;
198
- };
199
- readonly templateFormat: {
200
- readonly enum: readonly ["heading", "list", "table", "page"];
201
- };
202
- readonly matchers: {
203
- readonly type: "array";
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 minItems: 1;
209
- };
210
- readonly embeddedTemplateFields: {
211
- readonly type: "array";
212
- readonly items: {
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 field: {
218
- readonly type: "string";
219
- readonly minLength: 1;
220
- };
221
- readonly fieldOn: {
222
- readonly enum: readonly ["child", "parent"];
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 allowSkipLevels: {
238
- readonly type: "boolean";
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
- readonly required: readonly ["levels"];
242
- readonly additionalProperties: false;
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 id: {
667
+ readonly type: {
304
668
  readonly type: "string";
305
669
  readonly minLength: 1;
306
670
  };
307
- readonly category: {
308
- readonly enum: readonly ["validation", "coherence", "workflow", "best-practice"];
671
+ readonly override: {
672
+ readonly type: "boolean";
309
673
  };
310
- readonly description: {
311
- readonly type: "string";
312
- readonly minLength: 1;
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
- readonly check: {
315
- readonly type: "string";
316
- readonly minLength: 1;
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
- readonly type: {
319
- readonly type: "string";
320
- readonly minLength: 1;
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
- readonly scope: {
323
- readonly enum: readonly ["global"];
840
+ };
841
+ readonly then: {
842
+ readonly properties: {
843
+ readonly semantic: {
844
+ readonly type: "object";
845
+ readonly required: readonly ["severity"];
846
+ };
324
847
  };
325
- readonly override: {
326
- readonly type: "boolean";
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 type: "object";
333
- readonly properties: {
334
- readonly $ref: {
335
- readonly type: "string";
336
- readonly minLength: 1;
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
- export declare const DIALECT_META_SCHEMA: {
348
- readonly $schema: "http://json-schema.org/draft-07/schema#";
349
- readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context/main/schemas/generated/_structured_context_schema_meta.json";
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 Draft-07 with top-level $metadata for hierarchy and rule metadata.";
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: "http://json-schema.org/draft-07/schema#";
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 type: "object";
362
- readonly properties: {
363
- readonly levels: {
364
- readonly type: "array";
365
- readonly minItems: 1;
366
- readonly items: {
367
- readonly oneOf: readonly [{
368
- readonly type: "string";
369
- readonly minLength: 1;
370
- }, {
371
- readonly type: "object";
372
- readonly properties: {
373
- readonly selfRef: {
374
- readonly type: "boolean";
375
- };
376
- readonly selfRefField: {
377
- readonly type: "string";
378
- readonly minLength: 1;
379
- };
380
- readonly templateFormat: {
381
- readonly enum: readonly ["heading", "list", "table", "page"];
382
- };
383
- readonly matchers: {
384
- readonly type: "array";
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 minItems: 1;
390
- };
391
- readonly embeddedTemplateFields: {
392
- readonly type: "array";
393
- readonly items: {
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 field: {
399
- readonly type: "string";
400
- readonly minLength: 1;
401
- };
402
- readonly fieldOn: {
403
- readonly enum: readonly ["child", "parent"];
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 allowSkipLevels: {
419
- readonly type: "boolean";
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
- readonly required: readonly ["levels"];
423
- readonly additionalProperties: false;
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 id: {
1063
+ readonly type: {
485
1064
  readonly type: "string";
486
1065
  readonly minLength: 1;
487
1066
  };
488
- readonly category: {
489
- readonly enum: readonly ["validation", "coherence", "workflow", "best-practice"];
1067
+ readonly override: {
1068
+ readonly type: "boolean";
490
1069
  };
491
- readonly description: {
492
- readonly type: "string";
493
- readonly minLength: 1;
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
- readonly check: {
496
- readonly type: "string";
497
- readonly minLength: 1;
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
- readonly type: {
500
- readonly type: "string";
501
- readonly minLength: 1;
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
- readonly scope: {
504
- readonly enum: readonly ["global"];
1236
+ };
1237
+ readonly then: {
1238
+ readonly properties: {
1239
+ readonly semantic: {
1240
+ readonly type: "object";
1241
+ readonly required: readonly ["severity"];
1242
+ };
505
1243
  };
506
- readonly override: {
507
- readonly type: "boolean";
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 type: "object";
514
- readonly properties: {
515
- readonly $ref: {
516
- readonly type: "string";
517
- readonly minLength: 1;
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 RuleRef = FromSchema<typeof RULE_REF_SCHEMA>;
537
- export type RuleEntry = Rule | RuleRef;
1305
+ export type RuleSemantic = FromSchema<typeof SEMANTIC_SCHEMA>;
1306
+ export type MetadataRef = FromSchema<typeof REF_SCHEMA>;
538
1307
  export {};