structured-context 0.11.0 → 0.12.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 (87) hide show
  1. package/README.md +63 -22
  2. package/dist/api.d.ts +7 -5
  3. package/dist/api.js +4 -1
  4. package/dist/commands/diagram.d.ts +1 -0
  5. package/dist/commands/diagram.js +7 -1
  6. package/dist/commands/dump.d.ts +15 -2
  7. package/dist/commands/dump.js +18 -4
  8. package/dist/commands/render.d.ts +4 -0
  9. package/dist/commands/render.js +64 -9
  10. package/dist/commands/schemas.d.ts +2 -2
  11. package/dist/commands/schemas.js +114 -22
  12. package/dist/commands/show.d.ts +1 -0
  13. package/dist/commands/show.js +7 -1
  14. package/dist/commands/spaces.d.ts +3 -1
  15. package/dist/commands/spaces.js +11 -2
  16. package/dist/commands/validate-file.js +7 -4
  17. package/dist/commands/validate.js +38 -21
  18. package/dist/config.d.ts +18 -1
  19. package/dist/config.js +81 -10
  20. package/dist/filter/augment-nodes.d.ts +3 -1
  21. package/dist/filter/augment-nodes.js +12 -7
  22. package/dist/filter/filter-nodes.js +1 -1
  23. package/dist/index.js +39 -15
  24. package/dist/load-space-graph.d.ts +4 -2
  25. package/dist/load-space-graph.js +15 -4
  26. package/dist/plugins/loader.js +2 -2
  27. package/dist/plugins/markdown/extract-content-links.js +8 -29
  28. package/dist/plugins/markdown/index.js +8 -2
  29. package/dist/plugins/markdown/parse-embedded.d.ts +6 -0
  30. package/dist/plugins/markdown/parse-embedded.js +41 -7
  31. package/dist/plugins/markdown/read-space.js +38 -5
  32. package/dist/plugins/markdown/render-directory.d.ts +11 -0
  33. package/dist/plugins/markdown/render-directory.js +130 -0
  34. package/dist/plugins/mermaid/render-mermaid.js +2 -1
  35. package/dist/plugins/miro/sync.js +7 -6
  36. package/dist/plugins/util.d.ts +39 -1
  37. package/dist/plugins/util.js +139 -0
  38. package/dist/read/resolve-graph-edges.d.ts +1 -1
  39. package/dist/read/resolve-graph-edges.js +46 -27
  40. package/dist/read/wikilink-utils.d.ts +17 -0
  41. package/dist/read/wikilink-utils.js +40 -0
  42. package/dist/render/render.d.ts +3 -1
  43. package/dist/render/render.js +2 -2
  44. package/dist/schema/meta-schemas.d.ts +13 -0
  45. package/dist/schema/meta-schemas.js +50 -0
  46. package/dist/schema/metadata-contract.d.ts +343 -187
  47. package/dist/schema/metadata-contract.js +68 -30
  48. package/dist/schema/schema.d.ts +14 -8
  49. package/dist/schema/schema.js +277 -198
  50. package/dist/schema/validate-graph.d.ts +2 -1
  51. package/dist/schema/validate-graph.js +40 -23
  52. package/dist/schema/validate-rules.d.ts +5 -1
  53. package/dist/schema/validate-rules.js +20 -1
  54. package/dist/schemas/_knowledge_wiki.json +20 -20
  55. package/dist/schemas/_ost_strict.json +2 -2
  56. package/dist/schemas/_sctx_base.json +2 -2
  57. package/dist/schemas/_strategy_general.json +38 -38
  58. package/dist/schemas/generated/0.12.0/_structured_context_schema_meta.json +229 -0
  59. package/dist/schemas/generated/latest/_structured_context_schema_meta.json +229 -0
  60. package/dist/schemas/knowledge_wiki.json +10 -9
  61. package/dist/schemas/strategy_general.json +15 -14
  62. package/dist/schemas/strict_ost.json +17 -16
  63. package/dist/space-context.d.ts +3 -0
  64. package/dist/space-context.js +7 -2
  65. package/dist/space-graph.d.ts +9 -7
  66. package/dist/space-graph.js +7 -5
  67. package/dist/testing.d.ts +33 -0
  68. package/dist/testing.js +72 -0
  69. package/dist/types.d.ts +54 -13
  70. package/dist/validate.d.ts +3 -0
  71. package/dist/validate.js +19 -9
  72. package/docs/concepts.md +14 -4
  73. package/docs/config.md +8 -0
  74. package/docs/rules.md +49 -22
  75. package/docs/schemas.md +110 -35
  76. package/package.json +13 -8
  77. package/schemas/_knowledge_wiki.json +20 -20
  78. package/schemas/_ost_strict.json +2 -2
  79. package/schemas/_sctx_base.json +2 -2
  80. package/schemas/_strategy_general.json +38 -38
  81. package/schemas/generated/0.12.0/_structured_context_schema_meta.json +229 -0
  82. package/schemas/generated/latest/_structured_context_schema_meta.json +229 -0
  83. package/schemas/knowledge_wiki.json +10 -9
  84. package/schemas/strategy_general.json +15 -14
  85. package/schemas/strict_ost.json +17 -16
  86. package/dist/schemas/generated/_structured_context_schema_meta.json +0 -191
  87. 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";
@@ -97,6 +104,9 @@ declare const RULE_SCHEMA: {
97
104
  readonly category: {
98
105
  readonly enum: readonly ["validation", "coherence", "workflow", "best-practice"];
99
106
  };
107
+ readonly severity: {
108
+ readonly enum: readonly ["error", "warning", "info"];
109
+ };
100
110
  readonly description: {
101
111
  readonly type: "string";
102
112
  readonly minLength: 1;
@@ -119,7 +129,7 @@ declare const RULE_SCHEMA: {
119
129
  readonly required: readonly ["id", "category", "description", "check"];
120
130
  readonly additionalProperties: false;
121
131
  };
122
- declare const RULE_REF_SCHEMA: {
132
+ declare const REF_SCHEMA: {
123
133
  readonly type: "object";
124
134
  readonly properties: {
125
135
  readonly $ref: {
@@ -130,9 +140,84 @@ declare const RULE_REF_SCHEMA: {
130
140
  readonly required: readonly ["$ref"];
131
141
  readonly additionalProperties: false;
132
142
  };
143
+ declare const HIERARCHY_SCHEMA: {
144
+ readonly type: "object";
145
+ readonly properties: {
146
+ readonly name: {
147
+ readonly type: "string";
148
+ readonly minLength: 1;
149
+ };
150
+ readonly override: {
151
+ readonly type: "boolean";
152
+ };
153
+ readonly levels: {
154
+ readonly type: "array";
155
+ readonly minItems: 1;
156
+ readonly items: {
157
+ readonly oneOf: readonly [{
158
+ readonly type: "string";
159
+ readonly minLength: 1;
160
+ }, {
161
+ readonly type: "object";
162
+ readonly properties: {
163
+ readonly selfRef: {
164
+ readonly type: "boolean";
165
+ };
166
+ readonly selfRefField: {
167
+ readonly type: "string";
168
+ readonly minLength: 1;
169
+ };
170
+ readonly templateFormat: {
171
+ readonly enum: readonly ["heading", "list", "table", "page"];
172
+ };
173
+ readonly matchers: {
174
+ readonly type: "array";
175
+ readonly items: {
176
+ readonly type: "string";
177
+ readonly minLength: 1;
178
+ };
179
+ readonly minItems: 1;
180
+ };
181
+ readonly embeddedTemplateFields: {
182
+ readonly type: "array";
183
+ readonly items: {
184
+ readonly type: "string";
185
+ readonly minLength: 1;
186
+ };
187
+ };
188
+ readonly field: {
189
+ readonly type: "string";
190
+ readonly minLength: 1;
191
+ };
192
+ readonly fieldOn: {
193
+ readonly enum: readonly ["child", "parent"];
194
+ };
195
+ readonly multiple: {
196
+ readonly type: "boolean";
197
+ };
198
+ readonly type: {
199
+ readonly type: "string";
200
+ readonly minLength: 1;
201
+ };
202
+ };
203
+ readonly required: readonly ["type"];
204
+ readonly additionalProperties: false;
205
+ }];
206
+ };
207
+ };
208
+ readonly allowSkipLevels: {
209
+ readonly type: "boolean";
210
+ };
211
+ };
212
+ readonly required: readonly ["levels"];
213
+ readonly additionalProperties: false;
214
+ };
133
215
  declare const RELATIONSHIP_SCHEMA: {
134
216
  readonly type: "object";
135
217
  readonly properties: {
218
+ readonly override: {
219
+ readonly type: "boolean";
220
+ };
136
221
  readonly templateFormat: {
137
222
  readonly enum: readonly ["heading", "list", "table", "page"];
138
223
  };
@@ -176,76 +261,105 @@ declare const RELATIONSHIP_SCHEMA: {
176
261
  export declare const METADATA_SCHEMA: {
177
262
  readonly type: "object";
178
263
  readonly properties: {
264
+ readonly imports: {
265
+ readonly type: "array";
266
+ readonly items: {
267
+ readonly type: "string";
268
+ readonly minLength: 1;
269
+ };
270
+ };
179
271
  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: {
272
+ readonly oneOf: readonly [{
273
+ readonly type: "object";
274
+ readonly properties: {
275
+ readonly name: {
276
+ readonly type: "string";
277
+ readonly minLength: 1;
278
+ };
279
+ readonly override: {
280
+ readonly type: "boolean";
281
+ };
282
+ readonly levels: {
283
+ readonly type: "array";
284
+ readonly minItems: 1;
285
+ readonly items: {
286
+ readonly oneOf: readonly [{
287
+ readonly type: "string";
288
+ readonly minLength: 1;
289
+ }, {
290
+ readonly type: "object";
291
+ readonly properties: {
292
+ readonly selfRef: {
293
+ readonly type: "boolean";
294
+ };
295
+ readonly selfRefField: {
205
296
  readonly type: "string";
206
297
  readonly minLength: 1;
207
298
  };
208
- readonly minItems: 1;
209
- };
210
- readonly embeddedTemplateFields: {
211
- readonly type: "array";
212
- readonly items: {
299
+ readonly templateFormat: {
300
+ readonly enum: readonly ["heading", "list", "table", "page"];
301
+ };
302
+ readonly matchers: {
303
+ readonly type: "array";
304
+ readonly items: {
305
+ readonly type: "string";
306
+ readonly minLength: 1;
307
+ };
308
+ readonly minItems: 1;
309
+ };
310
+ readonly embeddedTemplateFields: {
311
+ readonly type: "array";
312
+ readonly items: {
313
+ readonly type: "string";
314
+ readonly minLength: 1;
315
+ };
316
+ };
317
+ readonly field: {
318
+ readonly type: "string";
319
+ readonly minLength: 1;
320
+ };
321
+ readonly fieldOn: {
322
+ readonly enum: readonly ["child", "parent"];
323
+ };
324
+ readonly multiple: {
325
+ readonly type: "boolean";
326
+ };
327
+ readonly type: {
213
328
  readonly type: "string";
214
329
  readonly minLength: 1;
215
330
  };
216
331
  };
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
- }];
332
+ readonly required: readonly ["type"];
333
+ readonly additionalProperties: false;
334
+ }];
335
+ };
336
+ };
337
+ readonly allowSkipLevels: {
338
+ readonly type: "boolean";
235
339
  };
236
340
  };
237
- readonly allowSkipLevels: {
238
- readonly type: "boolean";
341
+ readonly required: readonly ["levels"];
342
+ readonly additionalProperties: false;
343
+ }, {
344
+ readonly type: "object";
345
+ readonly properties: {
346
+ readonly $ref: {
347
+ readonly type: "string";
348
+ readonly minLength: 1;
349
+ };
239
350
  };
240
- };
241
- readonly required: readonly ["levels"];
242
- readonly additionalProperties: false;
351
+ readonly required: readonly ["$ref"];
352
+ readonly additionalProperties: false;
353
+ }];
243
354
  };
244
355
  readonly relationships: {
245
356
  readonly type: "array";
246
357
  readonly items: {
247
358
  readonly type: "object";
248
359
  readonly properties: {
360
+ readonly override: {
361
+ readonly type: "boolean";
362
+ };
249
363
  readonly templateFormat: {
250
364
  readonly enum: readonly ["heading", "list", "table", "page"];
251
365
  };
@@ -290,143 +404,179 @@ export declare const METADATA_SCHEMA: {
290
404
  readonly aliases: {
291
405
  readonly type: "object";
292
406
  readonly additionalProperties: {
293
- readonly type: "string";
294
- readonly minLength: 1;
295
- };
296
- };
297
- readonly rules: {
298
- readonly type: "array";
299
- readonly items: {
300
407
  readonly oneOf: readonly [{
408
+ readonly type: "string";
409
+ readonly minLength: 1;
410
+ }, {
301
411
  readonly type: "object";
302
412
  readonly properties: {
303
- readonly id: {
304
- readonly type: "string";
305
- readonly minLength: 1;
306
- };
307
- readonly category: {
308
- readonly enum: readonly ["validation", "coherence", "workflow", "best-practice"];
309
- };
310
- readonly description: {
311
- readonly type: "string";
312
- readonly minLength: 1;
313
- };
314
- readonly check: {
315
- readonly type: "string";
316
- readonly minLength: 1;
317
- };
318
413
  readonly type: {
319
414
  readonly type: "string";
320
415
  readonly minLength: 1;
321
416
  };
322
- readonly scope: {
323
- readonly enum: readonly ["global"];
324
- };
325
417
  readonly override: {
326
418
  readonly type: "boolean";
327
419
  };
328
420
  };
329
- readonly required: readonly ["id", "category", "description", "check"];
330
- readonly additionalProperties: false;
331
- }, {
332
- readonly type: "object";
333
- readonly properties: {
334
- readonly $ref: {
335
- readonly type: "string";
336
- readonly minLength: 1;
337
- };
338
- };
339
- readonly required: readonly ["$ref"];
421
+ readonly required: readonly ["type"];
340
422
  readonly additionalProperties: false;
341
423
  }];
342
424
  };
343
425
  };
426
+ readonly rules: {
427
+ readonly type: "array";
428
+ readonly items: {
429
+ readonly type: "object";
430
+ readonly properties: {
431
+ readonly id: {
432
+ readonly type: "string";
433
+ readonly minLength: 1;
434
+ };
435
+ readonly category: {
436
+ readonly enum: readonly ["validation", "coherence", "workflow", "best-practice"];
437
+ };
438
+ readonly severity: {
439
+ readonly enum: readonly ["error", "warning", "info"];
440
+ };
441
+ readonly description: {
442
+ readonly type: "string";
443
+ readonly minLength: 1;
444
+ };
445
+ readonly check: {
446
+ readonly type: "string";
447
+ readonly minLength: 1;
448
+ };
449
+ readonly type: {
450
+ readonly type: "string";
451
+ readonly minLength: 1;
452
+ };
453
+ readonly scope: {
454
+ readonly enum: readonly ["global"];
455
+ };
456
+ readonly override: {
457
+ readonly type: "boolean";
458
+ };
459
+ };
460
+ readonly required: readonly ["id", "category", "description", "check"];
461
+ readonly additionalProperties: false;
462
+ };
463
+ };
344
464
  };
345
465
  readonly additionalProperties: false;
346
466
  };
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";
467
+ /** The dialect meta-schema, published under `$id`. */
468
+ export declare function buildDialectMetaSchema(id: string): {
469
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
470
+ readonly $id: string;
350
471
  readonly title: "structured-context schema dialect";
351
- readonly description: "Extends JSON Schema Draft-07 with top-level $metadata for hierarchy and rule metadata.";
472
+ readonly description: "Extends JSON Schema 2020-12 with top-level $metadata for imports, hierarchy, relationships, aliases and rules.";
352
473
  readonly type: "object";
353
474
  readonly allOf: readonly [{
354
- readonly $ref: "http://json-schema.org/draft-07/schema#";
475
+ readonly $ref: "https://json-schema.org/draft/2020-12/schema";
355
476
  }];
356
477
  readonly properties: {
357
478
  readonly $metadata: {
358
479
  readonly type: "object";
359
480
  readonly properties: {
481
+ readonly imports: {
482
+ readonly type: "array";
483
+ readonly items: {
484
+ readonly type: "string";
485
+ readonly minLength: 1;
486
+ };
487
+ };
360
488
  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: {
489
+ readonly oneOf: readonly [{
490
+ readonly type: "object";
491
+ readonly properties: {
492
+ readonly name: {
493
+ readonly type: "string";
494
+ readonly minLength: 1;
495
+ };
496
+ readonly override: {
497
+ readonly type: "boolean";
498
+ };
499
+ readonly levels: {
500
+ readonly type: "array";
501
+ readonly minItems: 1;
502
+ readonly items: {
503
+ readonly oneOf: readonly [{
504
+ readonly type: "string";
505
+ readonly minLength: 1;
506
+ }, {
507
+ readonly type: "object";
508
+ readonly properties: {
509
+ readonly selfRef: {
510
+ readonly type: "boolean";
511
+ };
512
+ readonly selfRefField: {
386
513
  readonly type: "string";
387
514
  readonly minLength: 1;
388
515
  };
389
- readonly minItems: 1;
390
- };
391
- readonly embeddedTemplateFields: {
392
- readonly type: "array";
393
- readonly items: {
516
+ readonly templateFormat: {
517
+ readonly enum: readonly ["heading", "list", "table", "page"];
518
+ };
519
+ readonly matchers: {
520
+ readonly type: "array";
521
+ readonly items: {
522
+ readonly type: "string";
523
+ readonly minLength: 1;
524
+ };
525
+ readonly minItems: 1;
526
+ };
527
+ readonly embeddedTemplateFields: {
528
+ readonly type: "array";
529
+ readonly items: {
530
+ readonly type: "string";
531
+ readonly minLength: 1;
532
+ };
533
+ };
534
+ readonly field: {
535
+ readonly type: "string";
536
+ readonly minLength: 1;
537
+ };
538
+ readonly fieldOn: {
539
+ readonly enum: readonly ["child", "parent"];
540
+ };
541
+ readonly multiple: {
542
+ readonly type: "boolean";
543
+ };
544
+ readonly type: {
394
545
  readonly type: "string";
395
546
  readonly minLength: 1;
396
547
  };
397
548
  };
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
- }];
549
+ readonly required: readonly ["type"];
550
+ readonly additionalProperties: false;
551
+ }];
552
+ };
553
+ };
554
+ readonly allowSkipLevels: {
555
+ readonly type: "boolean";
416
556
  };
417
557
  };
418
- readonly allowSkipLevels: {
419
- readonly type: "boolean";
558
+ readonly required: readonly ["levels"];
559
+ readonly additionalProperties: false;
560
+ }, {
561
+ readonly type: "object";
562
+ readonly properties: {
563
+ readonly $ref: {
564
+ readonly type: "string";
565
+ readonly minLength: 1;
566
+ };
420
567
  };
421
- };
422
- readonly required: readonly ["levels"];
423
- readonly additionalProperties: false;
568
+ readonly required: readonly ["$ref"];
569
+ readonly additionalProperties: false;
570
+ }];
424
571
  };
425
572
  readonly relationships: {
426
573
  readonly type: "array";
427
574
  readonly items: {
428
575
  readonly type: "object";
429
576
  readonly properties: {
577
+ readonly override: {
578
+ readonly type: "boolean";
579
+ };
430
580
  readonly templateFormat: {
431
581
  readonly enum: readonly ["heading", "list", "table", "page"];
432
582
  };
@@ -471,68 +621,74 @@ export declare const DIALECT_META_SCHEMA: {
471
621
  readonly aliases: {
472
622
  readonly type: "object";
473
623
  readonly additionalProperties: {
474
- readonly type: "string";
475
- readonly minLength: 1;
476
- };
477
- };
478
- readonly rules: {
479
- readonly type: "array";
480
- readonly items: {
481
624
  readonly oneOf: readonly [{
625
+ readonly type: "string";
626
+ readonly minLength: 1;
627
+ }, {
482
628
  readonly type: "object";
483
629
  readonly properties: {
484
- readonly id: {
485
- readonly type: "string";
486
- readonly minLength: 1;
487
- };
488
- readonly category: {
489
- readonly enum: readonly ["validation", "coherence", "workflow", "best-practice"];
490
- };
491
- readonly description: {
492
- readonly type: "string";
493
- readonly minLength: 1;
494
- };
495
- readonly check: {
496
- readonly type: "string";
497
- readonly minLength: 1;
498
- };
499
630
  readonly type: {
500
631
  readonly type: "string";
501
632
  readonly minLength: 1;
502
633
  };
503
- readonly scope: {
504
- readonly enum: readonly ["global"];
505
- };
506
634
  readonly override: {
507
635
  readonly type: "boolean";
508
636
  };
509
637
  };
510
- readonly required: readonly ["id", "category", "description", "check"];
511
- readonly additionalProperties: false;
512
- }, {
513
- readonly type: "object";
514
- readonly properties: {
515
- readonly $ref: {
516
- readonly type: "string";
517
- readonly minLength: 1;
518
- };
519
- };
520
- readonly required: readonly ["$ref"];
638
+ readonly required: readonly ["type"];
521
639
  readonly additionalProperties: false;
522
640
  }];
523
641
  };
524
642
  };
643
+ readonly rules: {
644
+ readonly type: "array";
645
+ readonly items: {
646
+ readonly type: "object";
647
+ readonly properties: {
648
+ readonly id: {
649
+ readonly type: "string";
650
+ readonly minLength: 1;
651
+ };
652
+ readonly category: {
653
+ readonly enum: readonly ["validation", "coherence", "workflow", "best-practice"];
654
+ };
655
+ readonly severity: {
656
+ readonly enum: readonly ["error", "warning", "info"];
657
+ };
658
+ readonly description: {
659
+ readonly type: "string";
660
+ readonly minLength: 1;
661
+ };
662
+ readonly check: {
663
+ readonly type: "string";
664
+ readonly minLength: 1;
665
+ };
666
+ readonly type: {
667
+ readonly type: "string";
668
+ readonly minLength: 1;
669
+ };
670
+ readonly scope: {
671
+ readonly enum: readonly ["global"];
672
+ };
673
+ readonly override: {
674
+ readonly type: "boolean";
675
+ };
676
+ };
677
+ readonly required: readonly ["id", "category", "description", "check"];
678
+ readonly additionalProperties: false;
679
+ };
680
+ };
525
681
  };
526
682
  readonly additionalProperties: false;
527
683
  };
528
684
  };
529
685
  };
530
686
  export type MetadataContract = FromSchema<typeof METADATA_SCHEMA>;
687
+ export type MetadataContractHierarchy = FromSchema<typeof HIERARCHY_SCHEMA>;
531
688
  export type MetadataContractHierarchyLevel = FromSchema<typeof HIERARCHY_LEVEL_SCHEMA>;
532
689
  export type MetadataContractRelationship = FromSchema<typeof RELATIONSHIP_SCHEMA>;
533
690
  export type SharedEdgeFields = FromSchema<typeof EDGE_SCHEMA>;
534
691
  export type SharedEmbeddingFields = FromSchema<typeof EMBEDDING_SCHEMA>;
535
692
  export type Rule = FromSchema<typeof RULE_SCHEMA>;
536
- export type RuleRef = FromSchema<typeof RULE_REF_SCHEMA>;
537
- export type RuleEntry = Rule | RuleRef;
693
+ export type MetadataRef = FromSchema<typeof REF_SCHEMA>;
538
694
  export {};