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

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 (109) hide show
  1. package/README.md +1 -1
  2. package/dist/check.d.ts +43 -0
  3. package/dist/check.js +102 -0
  4. package/dist/checks.d.ts +1 -1
  5. package/dist/checks.js +27 -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 +144 -0
  11. package/dist/command-table.js +85 -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 +467 -0
  20. package/dist/commands/planning.d.ts +3 -0
  21. package/dist/commands/planning.js +251 -0
  22. package/dist/commands/reviewing.d.ts +3 -0
  23. package/dist/commands/reviewing.js +234 -0
  24. package/dist/commands/skills.d.ts +3 -0
  25. package/dist/commands/skills.js +53 -0
  26. package/dist/commands.d.ts +10 -22
  27. package/dist/commands.js +15 -622
  28. package/dist/cqanswer.d.ts +51 -0
  29. package/dist/cqanswer.js +76 -0
  30. package/dist/diff.d.ts +85 -0
  31. package/dist/diff.js +323 -0
  32. package/dist/export-changes.d.ts +40 -0
  33. package/dist/export-changes.js +115 -0
  34. package/dist/export-csv.d.ts +17 -0
  35. package/dist/export-csv.js +188 -0
  36. package/dist/export-eval-cases.d.ts +38 -0
  37. package/dist/export-eval-cases.js +40 -0
  38. package/dist/export.d.ts +34 -3
  39. package/dist/export.js +70 -12
  40. package/dist/families.d.ts +1 -1
  41. package/dist/families.js +1 -1
  42. package/dist/help.d.ts +11 -2
  43. package/dist/help.js +51 -57
  44. package/dist/kbdocs.d.ts +18 -0
  45. package/dist/kbdocs.js +393 -0
  46. package/dist/metakb.d.ts +1 -1
  47. package/dist/metakb.js +1 -1
  48. package/dist/naming.d.ts +2 -2
  49. package/dist/naming.js +2 -2
  50. package/dist/ontology-ref.d.ts +20 -0
  51. package/dist/ontology-ref.js +108 -0
  52. package/dist/ops/admin.d.ts +2 -2
  53. package/dist/ops/admin.js +26 -8
  54. package/dist/ops/classes.d.ts +1 -1
  55. package/dist/ops/classes.js +15 -7
  56. package/dist/ops/common.d.ts +12 -2
  57. package/dist/ops/common.js +3 -0
  58. package/dist/ops/instances.d.ts +2 -1
  59. package/dist/ops/instances.js +9 -3
  60. package/dist/ops/links.d.ts +2 -2
  61. package/dist/ops/links.js +3 -2
  62. package/dist/ops/naming.d.ts +1 -1
  63. package/dist/ops/naming.js +3 -1
  64. package/dist/ops/scope.d.ts +14 -3
  65. package/dist/ops/scope.js +38 -4
  66. package/dist/ops/slots.d.ts +1 -1
  67. package/dist/ops/slots.js +21 -8
  68. package/dist/ops/values.d.ts +1 -1
  69. package/dist/ops/values.js +5 -1
  70. package/dist/provenance.d.ts +5 -3
  71. package/dist/provenance.js +61 -19
  72. package/dist/release.d.ts +52 -0
  73. package/dist/release.js +337 -0
  74. package/dist/render.d.ts +88 -1
  75. package/dist/render.js +265 -3
  76. package/dist/resync.d.ts +98 -0
  77. package/dist/resync.js +234 -0
  78. package/dist/review.d.ts +1 -1
  79. package/dist/review.js +1 -1
  80. package/dist/reviewdocs.d.ts +42 -0
  81. package/dist/reviewdocs.js +263 -0
  82. package/dist/runner.d.ts +3 -0
  83. package/dist/runner.js +84 -0
  84. package/dist/skills.d.ts +19 -3
  85. package/dist/skills.js +130 -14
  86. package/dist/status.d.ts +1 -1
  87. package/dist/status.js +1 -1
  88. package/dist/types.d.ts +1 -1
  89. package/dist/types.js +1 -1
  90. package/dist/verifynote.d.ts +19 -0
  91. package/dist/verifynote.js +93 -0
  92. package/dist/workflows.d.ts +283 -0
  93. package/dist/workflows.js +270 -0
  94. package/meta-kb/data/edges.json +25 -0
  95. package/meta-kb/data/manifest.json +5 -5
  96. package/meta-kb/data/nodes.json +46 -9
  97. package/package.json +9 -4
  98. package/schema/edge.schema.json +68 -0
  99. package/schema/edges.schema.json +9 -0
  100. package/schema/node.schema.json +914 -0
  101. package/schema/nodes.schema.json +9 -0
  102. package/schema/okb.schema.json +41 -0
  103. package/skills/build-domain-kb-from-docs/SKILL.md +21 -3
  104. package/skills/ontology-coach/SKILL.md +8 -4
  105. package/skills/ontology-maintainer/SKILL.md +152 -0
  106. package/skills/ontology-review/SKILL.md +4 -2
  107. package/skills/ontology-signoff/SKILL.md +182 -0
  108. package/templates/okb-check.yml +148 -0
  109. package/templates/pull_request_template.md +16 -0
@@ -0,0 +1,914 @@
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. answer (`okb cq answer`): {query, expect[], match: exact | includes}, a declarative find/traverse/slots query and the names it must return, which `okb cq check` evaluates.",
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
+ "answer": {
261
+ "type": "object",
262
+ "required": [
263
+ "query",
264
+ "expect"
265
+ ],
266
+ "properties": {
267
+ "query": {
268
+ "type": "object"
269
+ },
270
+ "expect": {
271
+ "$ref": "#/$defs/Strings"
272
+ },
273
+ "match": {
274
+ "enum": [
275
+ "exact",
276
+ "includes"
277
+ ]
278
+ }
279
+ }
280
+ }
281
+ }
282
+ },
283
+ "Term": {
284
+ "title": "Term",
285
+ "description": "A Step-3 brainstorm term. disposition: undecided | class | slot | instance | value | synonym | out-of-scope.",
286
+ "type": "object",
287
+ "required": [
288
+ "id",
289
+ "type",
290
+ "text"
291
+ ],
292
+ "properties": {
293
+ "id": {
294
+ "type": "string",
295
+ "minLength": 1
296
+ },
297
+ "type": {
298
+ "const": "Term"
299
+ },
300
+ "createdAt": {
301
+ "type": "string",
302
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
303
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
304
+ },
305
+ "updatedAt": {
306
+ "type": "string",
307
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
308
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
309
+ },
310
+ "text": {
311
+ "type": "string"
312
+ },
313
+ "disposition": {
314
+ "enum": [
315
+ "undecided",
316
+ "class",
317
+ "slot",
318
+ "instance",
319
+ "value",
320
+ "synonym",
321
+ "out-of-scope"
322
+ ]
323
+ },
324
+ "note": {
325
+ "type": "string"
326
+ }
327
+ }
328
+ },
329
+ "ReusedOntology": {
330
+ "title": "ReusedOntology",
331
+ "description": "An existing ontology/vocabulary considered in Step 2. decision: reuse | adapt | reference | rejected.",
332
+ "type": "object",
333
+ "required": [
334
+ "id",
335
+ "type",
336
+ "name",
337
+ "decision"
338
+ ],
339
+ "properties": {
340
+ "id": {
341
+ "type": "string",
342
+ "minLength": 1
343
+ },
344
+ "type": {
345
+ "const": "ReusedOntology"
346
+ },
347
+ "createdAt": {
348
+ "type": "string",
349
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
350
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
351
+ },
352
+ "updatedAt": {
353
+ "type": "string",
354
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
355
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
356
+ },
357
+ "name": {
358
+ "type": "string"
359
+ },
360
+ "url": {
361
+ "type": "string"
362
+ },
363
+ "decision": {
364
+ "enum": [
365
+ "reuse",
366
+ "adapt",
367
+ "reference",
368
+ "rejected"
369
+ ]
370
+ },
371
+ "notes": {
372
+ "type": "string"
373
+ }
374
+ }
375
+ },
376
+ "Class": {
377
+ "title": "Class",
378
+ "description": "description, formerNames[] (earlier names, set by okb rename), synonyms[], abstract, terminological, fixedValues{slotId: value}, defaults{slotId: value}, facetOverrides{slotId: {allowedValues, minCardinality, maxCardinality}}.",
379
+ "type": "object",
380
+ "required": [
381
+ "id",
382
+ "type",
383
+ "name"
384
+ ],
385
+ "properties": {
386
+ "id": {
387
+ "type": "string",
388
+ "minLength": 1
389
+ },
390
+ "type": {
391
+ "const": "Class"
392
+ },
393
+ "createdAt": {
394
+ "type": "string",
395
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
396
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
397
+ },
398
+ "updatedAt": {
399
+ "type": "string",
400
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
401
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
402
+ },
403
+ "extracted": {
404
+ "type": "boolean"
405
+ },
406
+ "verification": {
407
+ "$ref": "#/$defs/Verification"
408
+ },
409
+ "extractionConfidence": {
410
+ "enum": [
411
+ "verbatim",
412
+ "paraphrased",
413
+ "corrected"
414
+ ]
415
+ },
416
+ "_originalDraft": {
417
+ "type": "string"
418
+ },
419
+ "name": {
420
+ "type": "string"
421
+ },
422
+ "formerNames": {
423
+ "$ref": "#/$defs/Strings"
424
+ },
425
+ "description": {
426
+ "type": "string"
427
+ },
428
+ "synonyms": {
429
+ "$ref": "#/$defs/Strings"
430
+ },
431
+ "abstract": {
432
+ "type": "boolean"
433
+ },
434
+ "terminological": {
435
+ "type": "boolean"
436
+ },
437
+ "fixedValues": {
438
+ "$ref": "#/$defs/ValueMap"
439
+ },
440
+ "defaults": {
441
+ "$ref": "#/$defs/ValueMap"
442
+ },
443
+ "facetOverrides": {
444
+ "type": "object",
445
+ "additionalProperties": {
446
+ "type": "object",
447
+ "properties": {
448
+ "allowedValues": {
449
+ "type": "array",
450
+ "items": {
451
+ "$ref": "#/$defs/Literal"
452
+ }
453
+ },
454
+ "minCardinality": {
455
+ "type": "integer",
456
+ "minimum": 0
457
+ },
458
+ "maxCardinality": {
459
+ "type": "integer",
460
+ "minimum": 0
461
+ },
462
+ "range": {
463
+ "$ref": "#/$defs/Strings"
464
+ }
465
+ }
466
+ }
467
+ }
468
+ }
469
+ },
470
+ "Slot": {
471
+ "title": "Slot",
472
+ "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).",
473
+ "type": "object",
474
+ "required": [
475
+ "id",
476
+ "type",
477
+ "name"
478
+ ],
479
+ "properties": {
480
+ "id": {
481
+ "type": "string",
482
+ "minLength": 1
483
+ },
484
+ "type": {
485
+ "const": "Slot"
486
+ },
487
+ "createdAt": {
488
+ "type": "string",
489
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
490
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
491
+ },
492
+ "updatedAt": {
493
+ "type": "string",
494
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
495
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
496
+ },
497
+ "extracted": {
498
+ "type": "boolean"
499
+ },
500
+ "verification": {
501
+ "$ref": "#/$defs/Verification"
502
+ },
503
+ "extractionConfidence": {
504
+ "enum": [
505
+ "verbatim",
506
+ "paraphrased",
507
+ "corrected"
508
+ ]
509
+ },
510
+ "_originalDraft": {
511
+ "type": "string"
512
+ },
513
+ "name": {
514
+ "type": "string"
515
+ },
516
+ "formerNames": {
517
+ "$ref": "#/$defs/Strings"
518
+ },
519
+ "description": {
520
+ "type": "string"
521
+ },
522
+ "valueType": {
523
+ "enum": [
524
+ "String",
525
+ "Integer",
526
+ "Float",
527
+ "Number",
528
+ "Boolean",
529
+ "Enumerated",
530
+ "Instance"
531
+ ]
532
+ },
533
+ "allowedValues": {
534
+ "$ref": "#/$defs/Strings"
535
+ },
536
+ "cardinality": {
537
+ "enum": [
538
+ "single",
539
+ "multiple"
540
+ ]
541
+ },
542
+ "minCardinality": {
543
+ "type": "integer",
544
+ "minimum": 0
545
+ },
546
+ "maxCardinality": {
547
+ "type": "integer",
548
+ "minimum": 0
549
+ },
550
+ "default": {
551
+ "$ref": "#/$defs/StoredValue"
552
+ },
553
+ "relType": {
554
+ "type": "string",
555
+ "pattern": "^[A-Z0-9][A-Z0-9_]*$"
556
+ },
557
+ "formerRelTypes": {
558
+ "type": "array",
559
+ "items": {
560
+ "type": "string",
561
+ "pattern": "^[A-Z0-9][A-Z0-9_]*$"
562
+ }
563
+ },
564
+ "edgeProperties": {
565
+ "type": "array",
566
+ "items": {
567
+ "type": "object",
568
+ "required": [
569
+ "name",
570
+ "valueType"
571
+ ],
572
+ "properties": {
573
+ "name": {
574
+ "type": "string"
575
+ },
576
+ "valueType": {
577
+ "enum": [
578
+ "String",
579
+ "Integer",
580
+ "Float",
581
+ "Number",
582
+ "Boolean",
583
+ "Enumerated"
584
+ ]
585
+ },
586
+ "allowedValues": {
587
+ "$ref": "#/$defs/Strings"
588
+ },
589
+ "required": {
590
+ "type": "boolean"
591
+ },
592
+ "description": {
593
+ "type": "string"
594
+ }
595
+ }
596
+ }
597
+ },
598
+ "appliesToRules": {
599
+ "type": "boolean"
600
+ }
601
+ }
602
+ },
603
+ "Instance": {
604
+ "title": "Instance",
605
+ "description": "description, formerNames[], values{slotId: value | [values]} for property (non-Instance) slots. Relationship values are edges.",
606
+ "type": "object",
607
+ "required": [
608
+ "id",
609
+ "type",
610
+ "name"
611
+ ],
612
+ "properties": {
613
+ "id": {
614
+ "type": "string",
615
+ "minLength": 1
616
+ },
617
+ "type": {
618
+ "const": "Instance"
619
+ },
620
+ "createdAt": {
621
+ "type": "string",
622
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
623
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
624
+ },
625
+ "updatedAt": {
626
+ "type": "string",
627
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
628
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
629
+ },
630
+ "extracted": {
631
+ "type": "boolean"
632
+ },
633
+ "verification": {
634
+ "$ref": "#/$defs/Verification"
635
+ },
636
+ "extractionConfidence": {
637
+ "enum": [
638
+ "verbatim",
639
+ "paraphrased",
640
+ "corrected"
641
+ ]
642
+ },
643
+ "_originalDraft": {
644
+ "type": "string"
645
+ },
646
+ "name": {
647
+ "type": "string"
648
+ },
649
+ "formerNames": {
650
+ "$ref": "#/$defs/Strings"
651
+ },
652
+ "description": {
653
+ "type": "string"
654
+ },
655
+ "values": {
656
+ "$ref": "#/$defs/ValueMap"
657
+ }
658
+ }
659
+ },
660
+ "DesignDecision": {
661
+ "title": "DesignDecision",
662
+ "description": "question, decision, rationale, alternatives[], metaRules[] (rule ids it resolves or waives), date.",
663
+ "type": "object",
664
+ "required": [
665
+ "id",
666
+ "type",
667
+ "title",
668
+ "decision"
669
+ ],
670
+ "properties": {
671
+ "id": {
672
+ "type": "string",
673
+ "minLength": 1
674
+ },
675
+ "type": {
676
+ "const": "DesignDecision"
677
+ },
678
+ "createdAt": {
679
+ "type": "string",
680
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
681
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
682
+ },
683
+ "updatedAt": {
684
+ "type": "string",
685
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
686
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
687
+ },
688
+ "extracted": {
689
+ "type": "boolean"
690
+ },
691
+ "verification": {
692
+ "$ref": "#/$defs/Verification"
693
+ },
694
+ "extractionConfidence": {
695
+ "enum": [
696
+ "verbatim",
697
+ "paraphrased",
698
+ "corrected"
699
+ ]
700
+ },
701
+ "_originalDraft": {
702
+ "type": "string"
703
+ },
704
+ "title": {
705
+ "type": "string"
706
+ },
707
+ "decision": {
708
+ "type": "string"
709
+ },
710
+ "question": {
711
+ "type": "string"
712
+ },
713
+ "rationale": {
714
+ "type": "string"
715
+ },
716
+ "alternatives": {
717
+ "$ref": "#/$defs/Strings"
718
+ },
719
+ "metaRules": {
720
+ "$ref": "#/$defs/Strings"
721
+ },
722
+ "date": {
723
+ "type": "string"
724
+ }
725
+ }
726
+ },
727
+ "Source": {
728
+ "title": "Source",
729
+ "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).",
730
+ "type": "object",
731
+ "required": [
732
+ "id",
733
+ "type",
734
+ "title"
735
+ ],
736
+ "properties": {
737
+ "id": {
738
+ "type": "string",
739
+ "minLength": 1
740
+ },
741
+ "type": {
742
+ "const": "Source"
743
+ },
744
+ "createdAt": {
745
+ "type": "string",
746
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
747
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
748
+ },
749
+ "updatedAt": {
750
+ "type": "string",
751
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
752
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
753
+ },
754
+ "title": {
755
+ "type": "string"
756
+ },
757
+ "localPath": {
758
+ "type": "string"
759
+ },
760
+ "format": {
761
+ "enum": [
762
+ "markdown",
763
+ "pdf",
764
+ "text"
765
+ ]
766
+ },
767
+ "url": {
768
+ "type": "string"
769
+ },
770
+ "repoUrl": {
771
+ "type": "string"
772
+ },
773
+ "meta": {
774
+ "type": "object"
775
+ },
776
+ "blocks": {
777
+ "type": "array",
778
+ "items": {
779
+ "$ref": "#/$defs/SourceBlock"
780
+ }
781
+ }
782
+ }
783
+ },
784
+ "SourceLocation": {
785
+ "title": "SourceLocation",
786
+ "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).",
787
+ "type": "object",
788
+ "required": [
789
+ "id",
790
+ "type",
791
+ "quote"
792
+ ],
793
+ "properties": {
794
+ "id": {
795
+ "type": "string",
796
+ "minLength": 1
797
+ },
798
+ "type": {
799
+ "const": "SourceLocation"
800
+ },
801
+ "createdAt": {
802
+ "type": "string",
803
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
804
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
805
+ },
806
+ "updatedAt": {
807
+ "type": "string",
808
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
809
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
810
+ },
811
+ "quote": {
812
+ "type": "string"
813
+ },
814
+ "locator": {
815
+ "type": "string"
816
+ },
817
+ "headingPath": {
818
+ "$ref": "#/$defs/Strings"
819
+ },
820
+ "startLine": {
821
+ "type": "integer"
822
+ },
823
+ "endLine": {
824
+ "type": "integer"
825
+ },
826
+ "lines": {
827
+ "type": "string"
828
+ },
829
+ "blockKind": {
830
+ "type": "string"
831
+ },
832
+ "sourceLink": {
833
+ "type": "string"
834
+ },
835
+ "pageLink": {
836
+ "type": "string"
837
+ },
838
+ "page": {
839
+ "type": [
840
+ "integer",
841
+ "string"
842
+ ]
843
+ }
844
+ }
845
+ },
846
+ "Rule": {
847
+ "title": "Rule",
848
+ "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.",
849
+ "type": "object",
850
+ "required": [
851
+ "id",
852
+ "type",
853
+ "modality",
854
+ "statement"
855
+ ],
856
+ "properties": {
857
+ "id": {
858
+ "type": "string",
859
+ "minLength": 1
860
+ },
861
+ "type": {
862
+ "const": "Rule"
863
+ },
864
+ "createdAt": {
865
+ "type": "string",
866
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
867
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
868
+ },
869
+ "updatedAt": {
870
+ "type": "string",
871
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
872
+ "description": "UTC to the second, e.g. 2026-11-21T14:03:22Z. Missing means unknown."
873
+ },
874
+ "extracted": {
875
+ "type": "boolean"
876
+ },
877
+ "verification": {
878
+ "$ref": "#/$defs/Verification"
879
+ },
880
+ "extractionConfidence": {
881
+ "enum": [
882
+ "verbatim",
883
+ "paraphrased",
884
+ "corrected"
885
+ ]
886
+ },
887
+ "_originalDraft": {
888
+ "type": "string"
889
+ },
890
+ "name": {
891
+ "type": "string"
892
+ },
893
+ "modality": {
894
+ "enum": [
895
+ "MUST",
896
+ "MUST_NOT",
897
+ "SHOULD",
898
+ "SHOULD_NOT",
899
+ "MAY"
900
+ ]
901
+ },
902
+ "statement": {
903
+ "type": "string"
904
+ },
905
+ "authored": {
906
+ "type": "boolean"
907
+ },
908
+ "values": {
909
+ "$ref": "#/$defs/ValueMap"
910
+ }
911
+ }
912
+ }
913
+ }
914
+ }