@ontology-kit/okb 0.1.0 → 0.3.0-alpha.210

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 (97) hide show
  1. package/README.md +1 -1
  2. package/dist/check.d.ts +43 -0
  3. package/dist/check.js +83 -0
  4. package/dist/checks.d.ts +1 -1
  5. package/dist/checks.js +4 -4
  6. package/dist/cli.js +11 -705
  7. package/dist/clidocs.d.ts +0 -2
  8. package/dist/clidocs.js +5 -27
  9. package/dist/clock.js +1 -1
  10. package/dist/command-table.d.ts +134 -0
  11. package/dist/command-table.js +82 -0
  12. package/dist/commands/documents.d.ts +3 -0
  13. package/dist/commands/documents.js +250 -0
  14. package/dist/commands/getting-started.d.ts +3 -0
  15. package/dist/commands/getting-started.js +135 -0
  16. package/dist/commands/housekeeping.d.ts +3 -0
  17. package/dist/commands/housekeeping.js +203 -0
  18. package/dist/commands/modeling.d.ts +3 -0
  19. package/dist/commands/modeling.js +433 -0
  20. package/dist/commands/planning.d.ts +3 -0
  21. package/dist/commands/planning.js +212 -0
  22. package/dist/commands/reviewing.d.ts +3 -0
  23. package/dist/commands/reviewing.js +177 -0
  24. package/dist/commands/skills.d.ts +3 -0
  25. package/dist/commands/skills.js +52 -0
  26. package/dist/commands.d.ts +10 -22
  27. package/dist/commands.js +15 -622
  28. package/dist/diff.d.ts +85 -0
  29. package/dist/diff.js +323 -0
  30. package/dist/export.d.ts +1 -1
  31. package/dist/export.js +1 -1
  32. package/dist/families.d.ts +1 -1
  33. package/dist/families.js +1 -1
  34. package/dist/help.d.ts +11 -2
  35. package/dist/help.js +51 -57
  36. package/dist/kbdocs.d.ts +18 -0
  37. package/dist/kbdocs.js +393 -0
  38. package/dist/metakb.d.ts +1 -1
  39. package/dist/metakb.js +1 -1
  40. package/dist/naming.d.ts +2 -2
  41. package/dist/naming.js +2 -2
  42. package/dist/ontology-ref.d.ts +20 -0
  43. package/dist/ontology-ref.js +108 -0
  44. package/dist/ops/admin.d.ts +1 -1
  45. package/dist/ops/admin.js +24 -7
  46. package/dist/ops/classes.d.ts +1 -1
  47. package/dist/ops/classes.js +13 -5
  48. package/dist/ops/instances.d.ts +2 -1
  49. package/dist/ops/instances.js +7 -1
  50. package/dist/ops/links.d.ts +1 -1
  51. package/dist/ops/links.js +1 -1
  52. package/dist/ops/naming.d.ts +1 -1
  53. package/dist/ops/naming.js +3 -1
  54. package/dist/ops/scope.d.ts +5 -1
  55. package/dist/ops/scope.js +19 -1
  56. package/dist/ops/slots.d.ts +1 -1
  57. package/dist/ops/slots.js +15 -2
  58. package/dist/ops/values.d.ts +1 -1
  59. package/dist/ops/values.js +5 -1
  60. package/dist/provenance.d.ts +4 -2
  61. package/dist/provenance.js +58 -17
  62. package/dist/release.d.ts +52 -0
  63. package/dist/release.js +337 -0
  64. package/dist/render.d.ts +64 -1
  65. package/dist/render.js +240 -3
  66. package/dist/resync.d.ts +98 -0
  67. package/dist/resync.js +234 -0
  68. package/dist/review.d.ts +1 -1
  69. package/dist/review.js +1 -1
  70. package/dist/reviewdocs.d.ts +42 -0
  71. package/dist/reviewdocs.js +263 -0
  72. package/dist/runner.d.ts +3 -0
  73. package/dist/runner.js +79 -0
  74. package/dist/skills.js +1 -1
  75. package/dist/status.d.ts +1 -1
  76. package/dist/status.js +1 -1
  77. package/dist/types.d.ts +1 -1
  78. package/dist/types.js +1 -1
  79. package/dist/verifynote.d.ts +18 -0
  80. package/dist/verifynote.js +92 -0
  81. package/dist/workflows.d.ts +256 -0
  82. package/dist/workflows.js +223 -0
  83. package/meta-kb/data/manifest.json +2 -2
  84. package/meta-kb/data/nodes.json +8 -8
  85. package/package.json +9 -4
  86. package/schema/edge.schema.json +68 -0
  87. package/schema/edges.schema.json +9 -0
  88. package/schema/node.schema.json +893 -0
  89. package/schema/nodes.schema.json +9 -0
  90. package/schema/okb.schema.json +41 -0
  91. package/skills/build-domain-kb-from-docs/SKILL.md +20 -2
  92. package/skills/ontology-coach/SKILL.md +6 -2
  93. package/skills/ontology-maintainer/SKILL.md +152 -0
  94. package/skills/ontology-review/SKILL.md +3 -1
  95. package/skills/ontology-signoff/SKILL.md +182 -0
  96. package/templates/okb-check.yml +132 -0
  97. package/templates/pull_request_template.md +16 -0
@@ -0,0 +1,893 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ontology-kit.dev/schema/okb-lpg-3/node.schema.json",
4
+ "title": "An okb node (okb-lpg/3): one line of nodes.jsonl",
5
+ "description": "Which keys a node may have depends on its type. Keys not listed are allowed (okb keeps them). Whether an edge's ends exist, ids are unique and the ontology follows the rules is checked by `okb validate`, not by this schema.",
6
+ "oneOf": [
7
+ {
8
+ "$ref": "#/$defs/Ontology"
9
+ },
10
+ {
11
+ "$ref": "#/$defs/CompetencyQuestion"
12
+ },
13
+ {
14
+ "$ref": "#/$defs/Term"
15
+ },
16
+ {
17
+ "$ref": "#/$defs/ReusedOntology"
18
+ },
19
+ {
20
+ "$ref": "#/$defs/Class"
21
+ },
22
+ {
23
+ "$ref": "#/$defs/Slot"
24
+ },
25
+ {
26
+ "$ref": "#/$defs/Instance"
27
+ },
28
+ {
29
+ "$ref": "#/$defs/DesignDecision"
30
+ },
31
+ {
32
+ "$ref": "#/$defs/Source"
33
+ },
34
+ {
35
+ "$ref": "#/$defs/SourceLocation"
36
+ },
37
+ {
38
+ "$ref": "#/$defs/Rule"
39
+ }
40
+ ],
41
+ "$defs": {
42
+ "Literal": {
43
+ "type": [
44
+ "string",
45
+ "number",
46
+ "boolean"
47
+ ]
48
+ },
49
+ "StoredValue": {
50
+ "anyOf": [
51
+ {
52
+ "$ref": "#/$defs/Literal"
53
+ },
54
+ {
55
+ "type": "array",
56
+ "items": {
57
+ "$ref": "#/$defs/Literal"
58
+ }
59
+ }
60
+ ]
61
+ },
62
+ "ValueMap": {
63
+ "type": "object",
64
+ "additionalProperties": {
65
+ "$ref": "#/$defs/StoredValue"
66
+ }
67
+ },
68
+ "Strings": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "string"
72
+ }
73
+ },
74
+ "SourceBlock": {
75
+ "type": "object",
76
+ "required": [
77
+ "hash",
78
+ "kind",
79
+ "headingPath",
80
+ "preview"
81
+ ],
82
+ "properties": {
83
+ "hash": {
84
+ "type": "string"
85
+ },
86
+ "kind": {
87
+ "type": "string"
88
+ },
89
+ "headingPath": {
90
+ "$ref": "#/$defs/Strings"
91
+ },
92
+ "rowKey": {
93
+ "type": "string"
94
+ },
95
+ "preview": {
96
+ "type": "string"
97
+ }
98
+ }
99
+ },
100
+ "Verification": {
101
+ "type": "object",
102
+ "required": [
103
+ "status"
104
+ ],
105
+ "properties": {
106
+ "status": {
107
+ "enum": [
108
+ "SUPPORTED",
109
+ "OVERREACH",
110
+ "UNSUPPORTED"
111
+ ]
112
+ },
113
+ "checkedAgainst": {
114
+ "$ref": "#/$defs/Strings"
115
+ },
116
+ "note": {
117
+ "type": "string"
118
+ },
119
+ "ref": {
120
+ "type": "string",
121
+ "pattern": "^[hH][tT][tT][pP][sS]?://\\S+$"
122
+ },
123
+ "approvedAfter": {
124
+ "enum": [
125
+ "SUPPORTED",
126
+ "OVERREACH",
127
+ "UNSUPPORTED"
128
+ ]
129
+ }
130
+ }
131
+ },
132
+ "Ontology": {
133
+ "title": "Ontology",
134
+ "description": "Exactly one per ontology (id 'ontology'). Holds scope (domain, purpose, users, maintainers, outOfScope), conventions, reuseReviewed, and kind ('application' or 'terminological').",
135
+ "type": "object",
136
+ "required": [
137
+ "id",
138
+ "type",
139
+ "name"
140
+ ],
141
+ "properties": {
142
+ "id": {
143
+ "type": "string",
144
+ "minLength": 1
145
+ },
146
+ "type": {
147
+ "const": "Ontology"
148
+ },
149
+ "createdAt": {
150
+ "type": "string",
151
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
152
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
153
+ },
154
+ "updatedAt": {
155
+ "type": "string",
156
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
157
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
158
+ },
159
+ "name": {
160
+ "type": "string"
161
+ },
162
+ "domain": {
163
+ "type": "string"
164
+ },
165
+ "purpose": {
166
+ "type": "string"
167
+ },
168
+ "users": {
169
+ "$ref": "#/$defs/Strings"
170
+ },
171
+ "maintainers": {
172
+ "$ref": "#/$defs/Strings"
173
+ },
174
+ "outOfScope": {
175
+ "$ref": "#/$defs/Strings"
176
+ },
177
+ "kind": {
178
+ "enum": [
179
+ "application",
180
+ "terminological"
181
+ ]
182
+ },
183
+ "reuseReviewed": {
184
+ "type": "boolean"
185
+ },
186
+ "conventions": {
187
+ "type": "object",
188
+ "properties": {
189
+ "classCase": {
190
+ "type": "string"
191
+ },
192
+ "slotCase": {
193
+ "type": "string"
194
+ },
195
+ "instanceCase": {
196
+ "type": [
197
+ "string",
198
+ "null"
199
+ ]
200
+ },
201
+ "classNumber": {
202
+ "enum": [
203
+ "singular",
204
+ "plural"
205
+ ]
206
+ },
207
+ "slotAffix": {
208
+ "enum": [
209
+ "none",
210
+ "has-prefix",
211
+ "of-suffix"
212
+ ]
213
+ },
214
+ "source": {
215
+ "enum": [
216
+ "chosen",
217
+ "default"
218
+ ]
219
+ }
220
+ }
221
+ }
222
+ }
223
+ },
224
+ "CompetencyQuestion": {
225
+ "title": "CompetencyQuestion",
226
+ "description": "A question the ontology must answer. status: draft | answerable.",
227
+ "type": "object",
228
+ "required": [
229
+ "id",
230
+ "type",
231
+ "text"
232
+ ],
233
+ "properties": {
234
+ "id": {
235
+ "type": "string",
236
+ "minLength": 1
237
+ },
238
+ "type": {
239
+ "const": "CompetencyQuestion"
240
+ },
241
+ "createdAt": {
242
+ "type": "string",
243
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
244
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
245
+ },
246
+ "updatedAt": {
247
+ "type": "string",
248
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
249
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
250
+ },
251
+ "text": {
252
+ "type": "string"
253
+ },
254
+ "status": {
255
+ "enum": [
256
+ "draft",
257
+ "answerable"
258
+ ]
259
+ }
260
+ }
261
+ },
262
+ "Term": {
263
+ "title": "Term",
264
+ "description": "A Step-3 brainstorm term. disposition: undecided | class | slot | instance | value | synonym | out-of-scope.",
265
+ "type": "object",
266
+ "required": [
267
+ "id",
268
+ "type",
269
+ "text"
270
+ ],
271
+ "properties": {
272
+ "id": {
273
+ "type": "string",
274
+ "minLength": 1
275
+ },
276
+ "type": {
277
+ "const": "Term"
278
+ },
279
+ "createdAt": {
280
+ "type": "string",
281
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
282
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
283
+ },
284
+ "updatedAt": {
285
+ "type": "string",
286
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
287
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
288
+ },
289
+ "text": {
290
+ "type": "string"
291
+ },
292
+ "disposition": {
293
+ "enum": [
294
+ "undecided",
295
+ "class",
296
+ "slot",
297
+ "instance",
298
+ "value",
299
+ "synonym",
300
+ "out-of-scope"
301
+ ]
302
+ },
303
+ "note": {
304
+ "type": "string"
305
+ }
306
+ }
307
+ },
308
+ "ReusedOntology": {
309
+ "title": "ReusedOntology",
310
+ "description": "An existing ontology/vocabulary considered in Step 2. decision: reuse | adapt | reference | rejected.",
311
+ "type": "object",
312
+ "required": [
313
+ "id",
314
+ "type",
315
+ "name",
316
+ "decision"
317
+ ],
318
+ "properties": {
319
+ "id": {
320
+ "type": "string",
321
+ "minLength": 1
322
+ },
323
+ "type": {
324
+ "const": "ReusedOntology"
325
+ },
326
+ "createdAt": {
327
+ "type": "string",
328
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
329
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
330
+ },
331
+ "updatedAt": {
332
+ "type": "string",
333
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
334
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
335
+ },
336
+ "name": {
337
+ "type": "string"
338
+ },
339
+ "url": {
340
+ "type": "string"
341
+ },
342
+ "decision": {
343
+ "enum": [
344
+ "reuse",
345
+ "adapt",
346
+ "reference",
347
+ "rejected"
348
+ ]
349
+ },
350
+ "notes": {
351
+ "type": "string"
352
+ }
353
+ }
354
+ },
355
+ "Class": {
356
+ "title": "Class",
357
+ "description": "description, formerNames[] (earlier names, set by okb rename), synonyms[], abstract, terminological, fixedValues{slotId: value}, defaults{slotId: value}, facetOverrides{slotId: {allowedValues, minCardinality, maxCardinality}}.",
358
+ "type": "object",
359
+ "required": [
360
+ "id",
361
+ "type",
362
+ "name"
363
+ ],
364
+ "properties": {
365
+ "id": {
366
+ "type": "string",
367
+ "minLength": 1
368
+ },
369
+ "type": {
370
+ "const": "Class"
371
+ },
372
+ "createdAt": {
373
+ "type": "string",
374
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
375
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
376
+ },
377
+ "updatedAt": {
378
+ "type": "string",
379
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
380
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
381
+ },
382
+ "extracted": {
383
+ "type": "boolean"
384
+ },
385
+ "verification": {
386
+ "$ref": "#/$defs/Verification"
387
+ },
388
+ "extractionConfidence": {
389
+ "enum": [
390
+ "verbatim",
391
+ "paraphrased",
392
+ "corrected"
393
+ ]
394
+ },
395
+ "_originalDraft": {
396
+ "type": "string"
397
+ },
398
+ "name": {
399
+ "type": "string"
400
+ },
401
+ "formerNames": {
402
+ "$ref": "#/$defs/Strings"
403
+ },
404
+ "description": {
405
+ "type": "string"
406
+ },
407
+ "synonyms": {
408
+ "$ref": "#/$defs/Strings"
409
+ },
410
+ "abstract": {
411
+ "type": "boolean"
412
+ },
413
+ "terminological": {
414
+ "type": "boolean"
415
+ },
416
+ "fixedValues": {
417
+ "$ref": "#/$defs/ValueMap"
418
+ },
419
+ "defaults": {
420
+ "$ref": "#/$defs/ValueMap"
421
+ },
422
+ "facetOverrides": {
423
+ "type": "object",
424
+ "additionalProperties": {
425
+ "type": "object",
426
+ "properties": {
427
+ "allowedValues": {
428
+ "type": "array",
429
+ "items": {
430
+ "$ref": "#/$defs/Literal"
431
+ }
432
+ },
433
+ "minCardinality": {
434
+ "type": "integer",
435
+ "minimum": 0
436
+ },
437
+ "maxCardinality": {
438
+ "type": "integer",
439
+ "minimum": 0
440
+ },
441
+ "range": {
442
+ "$ref": "#/$defs/Strings"
443
+ }
444
+ }
445
+ }
446
+ }
447
+ }
448
+ },
449
+ "Slot": {
450
+ "title": "Slot",
451
+ "description": "description, formerNames[], formerRelTypes[] (edge types before renames), valueType (String|Integer|Float|Number|Boolean|Enumerated|Instance), allowedValues[], cardinality (single|multiple), minCardinality, maxCardinality, default, relType (Instance slots only: the edge type its values are stored as), appliesToRules (Boolean, property slots only: the slot applies to every Rule).",
452
+ "type": "object",
453
+ "required": [
454
+ "id",
455
+ "type",
456
+ "name"
457
+ ],
458
+ "properties": {
459
+ "id": {
460
+ "type": "string",
461
+ "minLength": 1
462
+ },
463
+ "type": {
464
+ "const": "Slot"
465
+ },
466
+ "createdAt": {
467
+ "type": "string",
468
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
469
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
470
+ },
471
+ "updatedAt": {
472
+ "type": "string",
473
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
474
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
475
+ },
476
+ "extracted": {
477
+ "type": "boolean"
478
+ },
479
+ "verification": {
480
+ "$ref": "#/$defs/Verification"
481
+ },
482
+ "extractionConfidence": {
483
+ "enum": [
484
+ "verbatim",
485
+ "paraphrased",
486
+ "corrected"
487
+ ]
488
+ },
489
+ "_originalDraft": {
490
+ "type": "string"
491
+ },
492
+ "name": {
493
+ "type": "string"
494
+ },
495
+ "formerNames": {
496
+ "$ref": "#/$defs/Strings"
497
+ },
498
+ "description": {
499
+ "type": "string"
500
+ },
501
+ "valueType": {
502
+ "enum": [
503
+ "String",
504
+ "Integer",
505
+ "Float",
506
+ "Number",
507
+ "Boolean",
508
+ "Enumerated",
509
+ "Instance"
510
+ ]
511
+ },
512
+ "allowedValues": {
513
+ "$ref": "#/$defs/Strings"
514
+ },
515
+ "cardinality": {
516
+ "enum": [
517
+ "single",
518
+ "multiple"
519
+ ]
520
+ },
521
+ "minCardinality": {
522
+ "type": "integer",
523
+ "minimum": 0
524
+ },
525
+ "maxCardinality": {
526
+ "type": "integer",
527
+ "minimum": 0
528
+ },
529
+ "default": {
530
+ "$ref": "#/$defs/StoredValue"
531
+ },
532
+ "relType": {
533
+ "type": "string",
534
+ "pattern": "^[A-Z0-9][A-Z0-9_]*$"
535
+ },
536
+ "formerRelTypes": {
537
+ "type": "array",
538
+ "items": {
539
+ "type": "string",
540
+ "pattern": "^[A-Z0-9][A-Z0-9_]*$"
541
+ }
542
+ },
543
+ "edgeProperties": {
544
+ "type": "array",
545
+ "items": {
546
+ "type": "object",
547
+ "required": [
548
+ "name",
549
+ "valueType"
550
+ ],
551
+ "properties": {
552
+ "name": {
553
+ "type": "string"
554
+ },
555
+ "valueType": {
556
+ "enum": [
557
+ "String",
558
+ "Integer",
559
+ "Float",
560
+ "Number",
561
+ "Boolean",
562
+ "Enumerated"
563
+ ]
564
+ },
565
+ "allowedValues": {
566
+ "$ref": "#/$defs/Strings"
567
+ },
568
+ "required": {
569
+ "type": "boolean"
570
+ },
571
+ "description": {
572
+ "type": "string"
573
+ }
574
+ }
575
+ }
576
+ },
577
+ "appliesToRules": {
578
+ "type": "boolean"
579
+ }
580
+ }
581
+ },
582
+ "Instance": {
583
+ "title": "Instance",
584
+ "description": "description, formerNames[], values{slotId: value | [values]} for property (non-Instance) slots. Relationship values are edges.",
585
+ "type": "object",
586
+ "required": [
587
+ "id",
588
+ "type",
589
+ "name"
590
+ ],
591
+ "properties": {
592
+ "id": {
593
+ "type": "string",
594
+ "minLength": 1
595
+ },
596
+ "type": {
597
+ "const": "Instance"
598
+ },
599
+ "createdAt": {
600
+ "type": "string",
601
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
602
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
603
+ },
604
+ "updatedAt": {
605
+ "type": "string",
606
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
607
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
608
+ },
609
+ "extracted": {
610
+ "type": "boolean"
611
+ },
612
+ "verification": {
613
+ "$ref": "#/$defs/Verification"
614
+ },
615
+ "extractionConfidence": {
616
+ "enum": [
617
+ "verbatim",
618
+ "paraphrased",
619
+ "corrected"
620
+ ]
621
+ },
622
+ "_originalDraft": {
623
+ "type": "string"
624
+ },
625
+ "name": {
626
+ "type": "string"
627
+ },
628
+ "formerNames": {
629
+ "$ref": "#/$defs/Strings"
630
+ },
631
+ "description": {
632
+ "type": "string"
633
+ },
634
+ "values": {
635
+ "$ref": "#/$defs/ValueMap"
636
+ }
637
+ }
638
+ },
639
+ "DesignDecision": {
640
+ "title": "DesignDecision",
641
+ "description": "question, decision, rationale, alternatives[], metaRules[] (rule ids it resolves or waives), date.",
642
+ "type": "object",
643
+ "required": [
644
+ "id",
645
+ "type",
646
+ "title",
647
+ "decision"
648
+ ],
649
+ "properties": {
650
+ "id": {
651
+ "type": "string",
652
+ "minLength": 1
653
+ },
654
+ "type": {
655
+ "const": "DesignDecision"
656
+ },
657
+ "createdAt": {
658
+ "type": "string",
659
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
660
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
661
+ },
662
+ "updatedAt": {
663
+ "type": "string",
664
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
665
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
666
+ },
667
+ "extracted": {
668
+ "type": "boolean"
669
+ },
670
+ "verification": {
671
+ "$ref": "#/$defs/Verification"
672
+ },
673
+ "extractionConfidence": {
674
+ "enum": [
675
+ "verbatim",
676
+ "paraphrased",
677
+ "corrected"
678
+ ]
679
+ },
680
+ "_originalDraft": {
681
+ "type": "string"
682
+ },
683
+ "title": {
684
+ "type": "string"
685
+ },
686
+ "decision": {
687
+ "type": "string"
688
+ },
689
+ "question": {
690
+ "type": "string"
691
+ },
692
+ "rationale": {
693
+ "type": "string"
694
+ },
695
+ "alternatives": {
696
+ "$ref": "#/$defs/Strings"
697
+ },
698
+ "metaRules": {
699
+ "$ref": "#/$defs/Strings"
700
+ },
701
+ "date": {
702
+ "type": "string"
703
+ }
704
+ }
705
+ },
706
+ "Source": {
707
+ "title": "Source",
708
+ "description": "Provenance: a document content was extracted from (`okb source add`). localPath (checked by okb validate), format (markdown | pdf | text), url (rendered page), repoUrl (GitHub file URL, for line links), meta (markdown frontmatter), blocks[] (hash, kind, headingPath, rowKey, preview of each quotable block the KB last saw, so `okb source refresh --all` can list new and changed blocks).",
709
+ "type": "object",
710
+ "required": [
711
+ "id",
712
+ "type",
713
+ "title"
714
+ ],
715
+ "properties": {
716
+ "id": {
717
+ "type": "string",
718
+ "minLength": 1
719
+ },
720
+ "type": {
721
+ "const": "Source"
722
+ },
723
+ "createdAt": {
724
+ "type": "string",
725
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
726
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
727
+ },
728
+ "updatedAt": {
729
+ "type": "string",
730
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
731
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
732
+ },
733
+ "title": {
734
+ "type": "string"
735
+ },
736
+ "localPath": {
737
+ "type": "string"
738
+ },
739
+ "format": {
740
+ "enum": [
741
+ "markdown",
742
+ "pdf",
743
+ "text"
744
+ ]
745
+ },
746
+ "url": {
747
+ "type": "string"
748
+ },
749
+ "repoUrl": {
750
+ "type": "string"
751
+ },
752
+ "meta": {
753
+ "type": "object"
754
+ },
755
+ "blocks": {
756
+ "type": "array",
757
+ "items": {
758
+ "$ref": "#/$defs/SourceBlock"
759
+ }
760
+ }
761
+ }
762
+ },
763
+ "SourceLocation": {
764
+ "title": "SourceLocation",
765
+ "description": "Provenance: a verbatim passage (`okb quote add`). locator (heading path, or p.N for PDFs), headingPath[], startLine/endLine/lines, blockKind, sourceLink (GitHub ?plain=1#Lx-Ly), pageLink (rendered heading anchor), page (PDFs).",
766
+ "type": "object",
767
+ "required": [
768
+ "id",
769
+ "type",
770
+ "quote"
771
+ ],
772
+ "properties": {
773
+ "id": {
774
+ "type": "string",
775
+ "minLength": 1
776
+ },
777
+ "type": {
778
+ "const": "SourceLocation"
779
+ },
780
+ "createdAt": {
781
+ "type": "string",
782
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
783
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
784
+ },
785
+ "updatedAt": {
786
+ "type": "string",
787
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
788
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
789
+ },
790
+ "quote": {
791
+ "type": "string"
792
+ },
793
+ "locator": {
794
+ "type": "string"
795
+ },
796
+ "headingPath": {
797
+ "$ref": "#/$defs/Strings"
798
+ },
799
+ "startLine": {
800
+ "type": "integer"
801
+ },
802
+ "endLine": {
803
+ "type": "integer"
804
+ },
805
+ "lines": {
806
+ "type": "string"
807
+ },
808
+ "blockKind": {
809
+ "type": "string"
810
+ },
811
+ "sourceLink": {
812
+ "type": "string"
813
+ },
814
+ "pageLink": {
815
+ "type": "string"
816
+ },
817
+ "page": {
818
+ "type": [
819
+ "integer",
820
+ "string"
821
+ ]
822
+ }
823
+ }
824
+ },
825
+ "Rule": {
826
+ "title": "Rule",
827
+ "description": "A domain rule: a requirement on any implementation (prescriptive), e.g. 'Buttons meet a 24px minimum touch target'. Extracted from documentation or authored by the ontology owner (`okb rule add`). authored (Boolean: written by the owner, not extracted; still cites a quote and is verified), extracted, extractionConfidence, verification{status, checkedAgainst}, _originalDraft, values{slotId: value | [values]} for qualifier slots that apply to Rules (e.g. condition, inputModality). Not inherited through REFINES.",
828
+ "type": "object",
829
+ "required": [
830
+ "id",
831
+ "type",
832
+ "modality",
833
+ "statement"
834
+ ],
835
+ "properties": {
836
+ "id": {
837
+ "type": "string",
838
+ "minLength": 1
839
+ },
840
+ "type": {
841
+ "const": "Rule"
842
+ },
843
+ "createdAt": {
844
+ "type": "string",
845
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
846
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
847
+ },
848
+ "updatedAt": {
849
+ "type": "string",
850
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
851
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
852
+ },
853
+ "extracted": {
854
+ "type": "boolean"
855
+ },
856
+ "verification": {
857
+ "$ref": "#/$defs/Verification"
858
+ },
859
+ "extractionConfidence": {
860
+ "enum": [
861
+ "verbatim",
862
+ "paraphrased",
863
+ "corrected"
864
+ ]
865
+ },
866
+ "_originalDraft": {
867
+ "type": "string"
868
+ },
869
+ "name": {
870
+ "type": "string"
871
+ },
872
+ "modality": {
873
+ "enum": [
874
+ "MUST",
875
+ "MUST_NOT",
876
+ "SHOULD",
877
+ "SHOULD_NOT",
878
+ "MAY"
879
+ ]
880
+ },
881
+ "statement": {
882
+ "type": "string"
883
+ },
884
+ "authored": {
885
+ "type": "boolean"
886
+ },
887
+ "values": {
888
+ "$ref": "#/$defs/ValueMap"
889
+ }
890
+ }
891
+ }
892
+ }
893
+ }