fact-kit-facts 0.8.0 → 0.9.0-alpha.1

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 (2) hide show
  1. package/dist/index.json +1243 -35
  2. package/package.json +1 -1
package/dist/index.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "entry": ".",
6
6
  "component": "fact-kit-facts.npm",
7
7
  "describes": {
8
- "fact-kit-js": "0.13.0"
8
+ "fact-kit-js": "0.14.0-alpha.1"
9
9
  },
10
10
  "publish": {
11
11
  "target": "npm",
@@ -24,6 +24,891 @@
24
24
  "description": {
25
25
  "en": "The shape of one fact in an `index.json`."
26
26
  },
27
+ "variants": [
28
+ {
29
+ "since": "0.7.0",
30
+ "content": {
31
+ "schema": {
32
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
33
+ "$id": "urn:fact-kit:fact",
34
+ "title": "Fact",
35
+ "type": "object",
36
+ "required": [
37
+ "id",
38
+ "tool",
39
+ "topics",
40
+ "title",
41
+ "content",
42
+ "source"
43
+ ],
44
+ "$defs": {
45
+ "Since": {
46
+ "description": "When a row starts to apply: a version (a pre-release such as `0.49.0-alpha.1` is fine), `\"next\"` for the release that is not out yet, or an array with one version per release line `X.Y`. The array may end in `\"next\"`, which only a reader on `head` uses.",
47
+ "oneOf": [
48
+ {
49
+ "type": "string",
50
+ "minLength": 1
51
+ },
52
+ {
53
+ "type": "array",
54
+ "minItems": 1,
55
+ "items": {
56
+ "type": "string",
57
+ "minLength": 1
58
+ }
59
+ }
60
+ ]
61
+ },
62
+ "Text": {
63
+ "description": "A string, or one string per language. Prompts take `zh-TW` and fall back to `en`.",
64
+ "oneOf": [
65
+ {
66
+ "type": "string",
67
+ "minLength": 1
68
+ },
69
+ {
70
+ "type": "object",
71
+ "properties": {
72
+ "en": {
73
+ "type": "string",
74
+ "minLength": 1
75
+ },
76
+ "zh-TW": {
77
+ "type": "string",
78
+ "minLength": 1
79
+ }
80
+ },
81
+ "additionalProperties": false,
82
+ "minProperties": 1
83
+ }
84
+ ]
85
+ },
86
+ "JsonSchema": {
87
+ "description": "A JSON Schema 2020-12 document or subschema. Only the registered `x-` keywords are allowed.",
88
+ "type": [
89
+ "object",
90
+ "boolean"
91
+ ]
92
+ },
93
+ "Probe": {
94
+ "description": "How an observed fact is re-checked without a model.",
95
+ "oneOf": [
96
+ {
97
+ "type": "object",
98
+ "required": [
99
+ "kind",
100
+ "anchor",
101
+ "hash"
102
+ ],
103
+ "additionalProperties": false,
104
+ "properties": {
105
+ "kind": {
106
+ "const": "hash"
107
+ },
108
+ "anchor": {
109
+ "type": "string",
110
+ "minLength": 1
111
+ },
112
+ "hash": {
113
+ "type": "string",
114
+ "minLength": 1
115
+ },
116
+ "url": {
117
+ "type": "string",
118
+ "minLength": 1
119
+ }
120
+ }
121
+ },
122
+ {
123
+ "type": "object",
124
+ "required": [
125
+ "kind",
126
+ "path"
127
+ ],
128
+ "additionalProperties": false,
129
+ "properties": {
130
+ "kind": {
131
+ "const": "sample"
132
+ },
133
+ "path": {
134
+ "type": "string",
135
+ "minLength": 1
136
+ }
137
+ }
138
+ },
139
+ {
140
+ "type": "object",
141
+ "required": [
142
+ "kind",
143
+ "reason"
144
+ ],
145
+ "additionalProperties": false,
146
+ "properties": {
147
+ "kind": {
148
+ "const": "manual"
149
+ },
150
+ "reason": {
151
+ "type": "string",
152
+ "minLength": 1
153
+ }
154
+ }
155
+ }
156
+ ]
157
+ },
158
+ "Source": {
159
+ "description": "Where the fact comes from. `published` is written by the tool itself, `converted` is generated from an upstream file, `observed` is read from documentation or measured, `derived` is computed from a fact of another fact package.",
160
+ "oneOf": [
161
+ {
162
+ "type": "object",
163
+ "required": [
164
+ "kind"
165
+ ],
166
+ "additionalProperties": false,
167
+ "properties": {
168
+ "kind": {
169
+ "const": "published"
170
+ }
171
+ }
172
+ },
173
+ {
174
+ "type": "object",
175
+ "required": [
176
+ "kind",
177
+ "from",
178
+ "converter",
179
+ "upstream"
180
+ ],
181
+ "additionalProperties": false,
182
+ "properties": {
183
+ "kind": {
184
+ "const": "converted"
185
+ },
186
+ "from": {
187
+ "type": "string",
188
+ "minLength": 1,
189
+ "description": "The upstream file the fact was converted from."
190
+ },
191
+ "converter": {
192
+ "type": "string",
193
+ "minLength": 1,
194
+ "description": "The script that did the conversion."
195
+ },
196
+ "upstream": {
197
+ "type": "string",
198
+ "minLength": 1,
199
+ "description": "The upstream version or commit the conversion read."
200
+ }
201
+ }
202
+ },
203
+ {
204
+ "type": "object",
205
+ "required": [
206
+ "kind",
207
+ "from",
208
+ "version"
209
+ ],
210
+ "additionalProperties": false,
211
+ "properties": {
212
+ "kind": {
213
+ "const": "derived"
214
+ },
215
+ "from": {
216
+ "type": "string",
217
+ "minLength": 1,
218
+ "description": "The spec of the upstream index: `<package>` or `<package>/<path>`."
219
+ },
220
+ "version": {
221
+ "type": "string",
222
+ "minLength": 1,
223
+ "description": "The version of the upstream fact package that was installed when the fact was built. The fact it was computed from is in `derivedFrom`."
224
+ }
225
+ }
226
+ },
227
+ {
228
+ "type": "object",
229
+ "required": [
230
+ "kind",
231
+ "basis"
232
+ ],
233
+ "additionalProperties": false,
234
+ "properties": {
235
+ "kind": {
236
+ "const": "observed"
237
+ },
238
+ "basis": {
239
+ "enum": [
240
+ "doc",
241
+ "measured",
242
+ "spike"
243
+ ]
244
+ },
245
+ "url": {
246
+ "type": "string",
247
+ "minLength": 1
248
+ },
249
+ "fetched": {
250
+ "type": "string",
251
+ "minLength": 1,
252
+ "description": "Date the source was read. It differs from `verify.verifiedOn` when a later check kept the fact."
253
+ },
254
+ "note": {
255
+ "$ref": "#/$defs/Text",
256
+ "description": "What was observed on: environment, version and sample size of a measurement, or the sources of a document."
257
+ }
258
+ }
259
+ }
260
+ ]
261
+ }
262
+ },
263
+ "properties": {
264
+ "id": {
265
+ "type": "string",
266
+ "pattern": "^[a-z0-9][a-z0-9-]*\\.[a-z0-9][a-z0-9._-]*$",
267
+ "description": "`<tool>.<name>`, unique across all sources. It must start with `tool` and a dot."
268
+ },
269
+ "tool": {
270
+ "type": "string",
271
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
272
+ },
273
+ "topics": {
274
+ "type": "array",
275
+ "items": {
276
+ "type": "string",
277
+ "minLength": 1
278
+ }
279
+ },
280
+ "title": {
281
+ "$ref": "#/$defs/Text"
282
+ },
283
+ "description": {
284
+ "$ref": "#/$defs/Text",
285
+ "description": "What the fact does. Rationale stays in the spec docs."
286
+ },
287
+ "content": {
288
+ "type": "object",
289
+ "additionalProperties": false,
290
+ "properties": {
291
+ "value": {
292
+ "description": "Lists, constants and lookup tables."
293
+ },
294
+ "schema": {
295
+ "$ref": "#/$defs/JsonSchema",
296
+ "description": "A field shape. It may `$ref` a file under `schemas/`."
297
+ },
298
+ "statement": {
299
+ "$ref": "#/$defs/Text",
300
+ "description": "One sentence of behavior."
301
+ }
302
+ },
303
+ "oneOf": [
304
+ {
305
+ "required": [
306
+ "value"
307
+ ]
308
+ },
309
+ {
310
+ "required": [
311
+ "schema"
312
+ ]
313
+ },
314
+ {
315
+ "required": [
316
+ "statement"
317
+ ]
318
+ }
319
+ ]
320
+ },
321
+ "variants": {
322
+ "description": "Rows of a fact whose content changes by version or differs by platform. `content` then holds the latest published row, for readers of index format 1.0. Without `variants` the whole fact is one row that starts at `when.since` and has the conditions `when.platforms` and `when.os`.",
323
+ "type": "array",
324
+ "minItems": 1,
325
+ "items": {
326
+ "type": "object",
327
+ "required": [
328
+ "since",
329
+ "content"
330
+ ],
331
+ "additionalProperties": false,
332
+ "properties": {
333
+ "since": {
334
+ "$ref": "#/$defs/Since"
335
+ },
336
+ "content": {
337
+ "$ref": "#/properties/content"
338
+ },
339
+ "pending": {
340
+ "type": "string",
341
+ "minLength": 1,
342
+ "description": "Label of planned content. Only a reader on `head` that includes the label gets the row."
343
+ },
344
+ "stability": {
345
+ "enum": [
346
+ "experimental"
347
+ ],
348
+ "description": "Experimental rows are read by default and carry the mark."
349
+ },
350
+ "platforms": {
351
+ "type": "array",
352
+ "items": {
353
+ "type": "string",
354
+ "minLength": 1
355
+ },
356
+ "description": "Platforms the row applies to. A reader that names none does not get it."
357
+ },
358
+ "os": {
359
+ "type": "array",
360
+ "items": {
361
+ "enum": [
362
+ "macos",
363
+ "linux",
364
+ "windows"
365
+ ]
366
+ },
367
+ "description": "Operating systems the row applies to. A reader that names none does not get it."
368
+ }
369
+ }
370
+ }
371
+ },
372
+ "derivedFrom": {
373
+ "type": "array",
374
+ "items": {
375
+ "type": "string",
376
+ "minLength": 1
377
+ },
378
+ "description": "Locations of the facts this one is computed from: `<id>` in the same entry, `<spec>:<id>` in another entry or package. The build writes them from `relates`, `factLink` and `derive`."
379
+ },
380
+ "when": {
381
+ "type": "object",
382
+ "additionalProperties": false,
383
+ "properties": {
384
+ "platforms": {
385
+ "type": "array",
386
+ "items": {
387
+ "type": "string",
388
+ "minLength": 1
389
+ }
390
+ },
391
+ "os": {
392
+ "type": "array",
393
+ "items": {
394
+ "enum": [
395
+ "macos",
396
+ "linux",
397
+ "windows"
398
+ ]
399
+ }
400
+ },
401
+ "since": {
402
+ "$ref": "#/$defs/Since"
403
+ },
404
+ "deprecatedIn": {
405
+ "type": "string",
406
+ "minLength": 1
407
+ },
408
+ "removeIn": {
409
+ "type": "string",
410
+ "minLength": 1
411
+ },
412
+ "replacement": {
413
+ "description": "Id, or ids, of the facts that replace this one.",
414
+ "oneOf": [
415
+ {
416
+ "type": "string",
417
+ "minLength": 1
418
+ },
419
+ {
420
+ "type": "array",
421
+ "minItems": 1,
422
+ "items": {
423
+ "type": "string",
424
+ "minLength": 1
425
+ }
426
+ }
427
+ ]
428
+ },
429
+ "movedTo": {
430
+ "type": "string",
431
+ "pattern": "^(?:[^:\\s]+:)?[a-z0-9][a-z0-9-]*\\.[a-z0-9][a-z0-9._-]*$",
432
+ "description": "Where the fact lives now: `<id>` in the same entry, or `<spec>:<id>` in another package or entry."
433
+ }
434
+ }
435
+ },
436
+ "source": {
437
+ "$ref": "#/$defs/Source"
438
+ },
439
+ "verify": {
440
+ "description": "Observed facts only.",
441
+ "type": "object",
442
+ "required": [
443
+ "probe",
444
+ "verifiedOn"
445
+ ],
446
+ "additionalProperties": false,
447
+ "properties": {
448
+ "probe": {
449
+ "$ref": "#/$defs/Probe"
450
+ },
451
+ "verifiedOn": {
452
+ "type": "string",
453
+ "minLength": 1
454
+ },
455
+ "screenedThrough": {
456
+ "type": "string",
457
+ "minLength": 1
458
+ }
459
+ }
460
+ }
461
+ }
462
+ }
463
+ }
464
+ },
465
+ {
466
+ "since": "0.14.0-alpha.1",
467
+ "content": {
468
+ "schema": {
469
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
470
+ "$id": "urn:fact-kit:fact",
471
+ "title": "Fact",
472
+ "type": "object",
473
+ "required": [
474
+ "id",
475
+ "tool",
476
+ "topics",
477
+ "title",
478
+ "content",
479
+ "source"
480
+ ],
481
+ "$defs": {
482
+ "Since": {
483
+ "description": "When a row starts to apply: a version (a pre-release such as `0.49.0-alpha.1` is fine), `\"next\"` for the release that is not out yet, or an array with one version per release line `X.Y`. The array may end in `\"next\"`, which only a reader on `head` uses.",
484
+ "oneOf": [
485
+ {
486
+ "type": "string",
487
+ "minLength": 1
488
+ },
489
+ {
490
+ "type": "array",
491
+ "minItems": 1,
492
+ "items": {
493
+ "type": "string",
494
+ "minLength": 1
495
+ }
496
+ }
497
+ ]
498
+ },
499
+ "Text": {
500
+ "description": "A string, or one string per language. Prompts take `zh-TW` and fall back to `en`.",
501
+ "oneOf": [
502
+ {
503
+ "type": "string",
504
+ "minLength": 1
505
+ },
506
+ {
507
+ "type": "object",
508
+ "properties": {
509
+ "en": {
510
+ "type": "string",
511
+ "minLength": 1
512
+ },
513
+ "zh-TW": {
514
+ "type": "string",
515
+ "minLength": 1
516
+ }
517
+ },
518
+ "additionalProperties": false,
519
+ "minProperties": 1
520
+ }
521
+ ]
522
+ },
523
+ "JsonSchema": {
524
+ "description": "A JSON Schema 2020-12 document or subschema. Only the registered `x-` keywords are allowed.",
525
+ "type": [
526
+ "object",
527
+ "boolean"
528
+ ]
529
+ },
530
+ "Probe": {
531
+ "description": "How an observed fact is re-checked without a model.",
532
+ "oneOf": [
533
+ {
534
+ "type": "object",
535
+ "required": [
536
+ "kind",
537
+ "anchor",
538
+ "hash"
539
+ ],
540
+ "additionalProperties": false,
541
+ "properties": {
542
+ "kind": {
543
+ "const": "hash"
544
+ },
545
+ "anchor": {
546
+ "type": "string",
547
+ "minLength": 1
548
+ },
549
+ "hash": {
550
+ "type": "string",
551
+ "minLength": 1
552
+ },
553
+ "url": {
554
+ "type": "string",
555
+ "minLength": 1
556
+ }
557
+ }
558
+ },
559
+ {
560
+ "type": "object",
561
+ "required": [
562
+ "kind",
563
+ "path"
564
+ ],
565
+ "additionalProperties": false,
566
+ "properties": {
567
+ "kind": {
568
+ "const": "sample"
569
+ },
570
+ "path": {
571
+ "type": "string",
572
+ "minLength": 1
573
+ }
574
+ }
575
+ },
576
+ {
577
+ "type": "object",
578
+ "required": [
579
+ "kind",
580
+ "reason"
581
+ ],
582
+ "additionalProperties": false,
583
+ "properties": {
584
+ "kind": {
585
+ "const": "manual"
586
+ },
587
+ "reason": {
588
+ "type": "string",
589
+ "minLength": 1
590
+ }
591
+ }
592
+ }
593
+ ]
594
+ },
595
+ "Source": {
596
+ "description": "Where the fact comes from. `published` is written by the tool itself, `converted` is generated from an upstream file, `observed` is read from documentation or measured, `derived` is computed from a fact of another fact package.",
597
+ "oneOf": [
598
+ {
599
+ "type": "object",
600
+ "required": [
601
+ "kind"
602
+ ],
603
+ "additionalProperties": false,
604
+ "properties": {
605
+ "kind": {
606
+ "const": "published"
607
+ }
608
+ }
609
+ },
610
+ {
611
+ "type": "object",
612
+ "required": [
613
+ "kind",
614
+ "from",
615
+ "converter",
616
+ "upstream"
617
+ ],
618
+ "additionalProperties": false,
619
+ "properties": {
620
+ "kind": {
621
+ "const": "converted"
622
+ },
623
+ "from": {
624
+ "type": "string",
625
+ "minLength": 1,
626
+ "description": "The upstream file the fact was converted from."
627
+ },
628
+ "converter": {
629
+ "type": "string",
630
+ "minLength": 1,
631
+ "description": "The script that did the conversion."
632
+ },
633
+ "upstream": {
634
+ "type": "string",
635
+ "minLength": 1,
636
+ "description": "The upstream version or commit the conversion read."
637
+ }
638
+ }
639
+ },
640
+ {
641
+ "type": "object",
642
+ "required": [
643
+ "kind",
644
+ "from",
645
+ "version"
646
+ ],
647
+ "additionalProperties": false,
648
+ "properties": {
649
+ "kind": {
650
+ "const": "derived"
651
+ },
652
+ "from": {
653
+ "type": "string",
654
+ "minLength": 1,
655
+ "description": "The spec of the upstream index: `<package>` or `<package>/<path>`."
656
+ },
657
+ "version": {
658
+ "type": "string",
659
+ "minLength": 1,
660
+ "description": "The version of the upstream fact package that was installed when the fact was built. The fact it was computed from is in `derivedFrom`."
661
+ }
662
+ }
663
+ },
664
+ {
665
+ "type": "object",
666
+ "required": [
667
+ "kind",
668
+ "basis"
669
+ ],
670
+ "additionalProperties": false,
671
+ "properties": {
672
+ "kind": {
673
+ "const": "observed"
674
+ },
675
+ "basis": {
676
+ "enum": [
677
+ "doc",
678
+ "measured",
679
+ "spike"
680
+ ]
681
+ },
682
+ "url": {
683
+ "type": "string",
684
+ "minLength": 1
685
+ },
686
+ "fetched": {
687
+ "type": "string",
688
+ "minLength": 1,
689
+ "description": "Date the source was read. It differs from `verify.verifiedOn` when a later check kept the fact."
690
+ },
691
+ "note": {
692
+ "$ref": "#/$defs/Text",
693
+ "description": "What was observed on: environment, version and sample size of a measurement, or the sources of a document."
694
+ }
695
+ }
696
+ }
697
+ ]
698
+ }
699
+ },
700
+ "properties": {
701
+ "id": {
702
+ "type": "string",
703
+ "pattern": "^[a-z0-9][a-z0-9-]*\\.[a-z0-9][a-z0-9._-]*$",
704
+ "description": "`<tool>.<name>`, unique across all sources. It must start with `tool` and a dot."
705
+ },
706
+ "tool": {
707
+ "type": "string",
708
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
709
+ },
710
+ "topics": {
711
+ "type": "array",
712
+ "items": {
713
+ "type": "string",
714
+ "minLength": 1
715
+ }
716
+ },
717
+ "title": {
718
+ "$ref": "#/$defs/Text"
719
+ },
720
+ "description": {
721
+ "$ref": "#/$defs/Text",
722
+ "description": "What the fact does. Rationale stays in the spec docs."
723
+ },
724
+ "content": {
725
+ "type": "object",
726
+ "additionalProperties": false,
727
+ "properties": {
728
+ "value": {
729
+ "description": "Lists, constants and lookup tables."
730
+ },
731
+ "schema": {
732
+ "$ref": "#/$defs/JsonSchema",
733
+ "description": "A field shape. It may `$ref` a file under `schemas/`."
734
+ },
735
+ "statement": {
736
+ "$ref": "#/$defs/Text",
737
+ "description": "One sentence of behavior."
738
+ }
739
+ },
740
+ "oneOf": [
741
+ {
742
+ "required": [
743
+ "value"
744
+ ]
745
+ },
746
+ {
747
+ "required": [
748
+ "schema"
749
+ ]
750
+ },
751
+ {
752
+ "required": [
753
+ "statement"
754
+ ]
755
+ }
756
+ ]
757
+ },
758
+ "variants": {
759
+ "description": "Rows of a fact whose content changes by version or differs by platform. `content` then holds the latest published row, for readers of index format 1.0. Without `variants` the whole fact is one row that starts at `when.since` and has the conditions `when.platforms` and `when.os`.",
760
+ "type": "array",
761
+ "minItems": 1,
762
+ "items": {
763
+ "type": "object",
764
+ "required": [
765
+ "since",
766
+ "content"
767
+ ],
768
+ "additionalProperties": false,
769
+ "properties": {
770
+ "since": {
771
+ "$ref": "#/$defs/Since"
772
+ },
773
+ "content": {
774
+ "$ref": "#/properties/content"
775
+ },
776
+ "pending": {
777
+ "type": "string",
778
+ "minLength": 1,
779
+ "description": "Label of planned content. Only a reader on `head` that includes the label gets the row."
780
+ },
781
+ "stability": {
782
+ "enum": [
783
+ "experimental"
784
+ ],
785
+ "description": "Experimental rows are read by default and carry the mark."
786
+ },
787
+ "platforms": {
788
+ "type": "array",
789
+ "items": {
790
+ "type": "string",
791
+ "minLength": 1
792
+ },
793
+ "description": "Platforms the row applies to. A reader that names none does not get it."
794
+ },
795
+ "os": {
796
+ "type": "array",
797
+ "items": {
798
+ "enum": [
799
+ "macos",
800
+ "linux",
801
+ "windows"
802
+ ]
803
+ },
804
+ "description": "Operating systems the row applies to. A reader that names none does not get it."
805
+ }
806
+ }
807
+ }
808
+ },
809
+ "derivedFrom": {
810
+ "type": "array",
811
+ "items": {
812
+ "type": "string",
813
+ "minLength": 1
814
+ },
815
+ "description": "Locations of the facts this one is computed from: `<id>` in the same entry, `<spec>:<id>` in another entry or package. The build writes them from `relates`, `factLink` and `derive`."
816
+ },
817
+ "when": {
818
+ "type": "object",
819
+ "additionalProperties": false,
820
+ "properties": {
821
+ "platforms": {
822
+ "type": "array",
823
+ "items": {
824
+ "type": "string",
825
+ "minLength": 1
826
+ }
827
+ },
828
+ "os": {
829
+ "type": "array",
830
+ "items": {
831
+ "enum": [
832
+ "macos",
833
+ "linux",
834
+ "windows"
835
+ ]
836
+ }
837
+ },
838
+ "since": {
839
+ "$ref": "#/$defs/Since"
840
+ },
841
+ "deprecatedIn": {
842
+ "type": "string",
843
+ "minLength": 1
844
+ },
845
+ "removeIn": {
846
+ "type": "string",
847
+ "minLength": 1
848
+ },
849
+ "replacement": {
850
+ "description": "Id, or ids, of the facts that replace this one.",
851
+ "oneOf": [
852
+ {
853
+ "type": "string",
854
+ "minLength": 1
855
+ },
856
+ {
857
+ "type": "array",
858
+ "minItems": 1,
859
+ "items": {
860
+ "type": "string",
861
+ "minLength": 1
862
+ }
863
+ }
864
+ ]
865
+ },
866
+ "movedTo": {
867
+ "type": "string",
868
+ "pattern": "^(?:[^:\\s]+:)?[a-z0-9][a-z0-9-]*\\.[a-z0-9][a-z0-9._-]*$",
869
+ "description": "Where the fact lives now: `<id>` in the same entry, or `<spec>:<id>` in another package or entry."
870
+ }
871
+ }
872
+ },
873
+ "source": {
874
+ "$ref": "#/$defs/Source"
875
+ },
876
+ "verify": {
877
+ "description": "Observed facts only.",
878
+ "type": "object",
879
+ "required": [
880
+ "probe",
881
+ "verifiedOn"
882
+ ],
883
+ "additionalProperties": false,
884
+ "properties": {
885
+ "probe": {
886
+ "$ref": "#/$defs/Probe"
887
+ },
888
+ "verifiedOn": {
889
+ "type": "string",
890
+ "minLength": 1
891
+ },
892
+ "screenedThrough": {
893
+ "type": "string",
894
+ "minLength": 1
895
+ }
896
+ }
897
+ },
898
+ "validatedBy": {
899
+ "type": "string",
900
+ "pattern": "^(?:[^:\\s]+:)?[a-z0-9][a-z0-9-]*\\.[a-z0-9][a-z0-9._-]*$",
901
+ "description": "Optional. The location of a schema fact (`<id>` in the same entry, `<spec>:<id>` in another entry or package) that every value of this fact must fit. Only `check` runs it. See `fact-kit.validated-by`."
902
+ }
903
+ }
904
+ }
905
+ }
906
+ }
907
+ ],
908
+ "tool": "fact-kit",
909
+ "source": {
910
+ "kind": "published"
911
+ },
27
912
  "content": {
28
913
  "schema": {
29
914
  "$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -454,29 +1339,172 @@
454
1339
  "minLength": 1
455
1340
  }
456
1341
  }
457
- }
1342
+ },
1343
+ "validatedBy": {
1344
+ "type": "string",
1345
+ "pattern": "^(?:[^:\\s]+:)?[a-z0-9][a-z0-9-]*\\.[a-z0-9][a-z0-9._-]*$",
1346
+ "description": "Optional. The location of a schema fact (`<id>` in the same entry, `<spec>:<id>` in another entry or package) that every value of this fact must fit. Only `check` runs it. See `fact-kit.validated-by`."
1347
+ }
1348
+ }
1349
+ }
1350
+ }
1351
+ },
1352
+ {
1353
+ "id": "fact-kit.check-rules",
1354
+ "topics": [
1355
+ "check"
1356
+ ],
1357
+ "title": {
1358
+ "en": "What each problem code of check stands for"
1359
+ },
1360
+ "description": {
1361
+ "en": "One entry per code of `fact-kit.problem-codes`, with the rule and the input it reads. `check` exits with 0 when it finds no problem, 1 when it finds one, and 2 when it can not run because of bad settings or input."
1362
+ },
1363
+ "variants": [
1364
+ {
1365
+ "since": "0.7.0",
1366
+ "content": {
1367
+ "value": [
1368
+ {
1369
+ "code": "format",
1370
+ "rule": "A fact, index, schema file or example does not fit its meta-schema.",
1371
+ "reads": "sources and built indexes"
1372
+ },
1373
+ {
1374
+ "code": "duplicate-id",
1375
+ "rule": "Two facts have one id.",
1376
+ "reads": "sources and built indexes"
1377
+ },
1378
+ {
1379
+ "code": "id-prefix",
1380
+ "rule": "A fact id does not start with its tool and a dot.",
1381
+ "reads": "sources and built indexes"
1382
+ },
1383
+ {
1384
+ "code": "local-path",
1385
+ "rule": "A fact holds a local absolute path.",
1386
+ "reads": "sources and built indexes"
1387
+ },
1388
+ {
1389
+ "code": "unregistered-domain",
1390
+ "rule": "A fact holds a URL whose host is not in `allowedDomains`.",
1391
+ "reads": "sources and built indexes"
1392
+ },
1393
+ {
1394
+ "code": "unknown-fact-id",
1395
+ "rule": "`replacement`, `derivedFrom` or an example names a fact that does not exist.",
1396
+ "reads": "sources and built indexes"
1397
+ },
1398
+ {
1399
+ "code": "missing-schema-file",
1400
+ "rule": "A `$ref` points at a file under `schemas/` that is not there.",
1401
+ "reads": "sources and built indexes"
1402
+ },
1403
+ {
1404
+ "code": "describes",
1405
+ "rule": "`describes` names more than one component, or the entries of one package disagree (different components, or `{}` mixed with one).",
1406
+ "reads": "sources"
1407
+ },
1408
+ {
1409
+ "code": "publish",
1410
+ "rule": "The entries of one package disagree on `publish` (different targets or names, or one entry without it).",
1411
+ "reads": "sources"
1412
+ },
1413
+ {
1414
+ "code": "since-format",
1415
+ "rule": "A `since` is not a version, `next`, or an array of versions that may end in `next`.",
1416
+ "reads": "sources and built indexes"
1417
+ },
1418
+ {
1419
+ "code": "same-line",
1420
+ "rule": "A `since` array has two versions on one release line.",
1421
+ "reads": "sources and built indexes"
1422
+ },
1423
+ {
1424
+ "code": "ambiguous-rows",
1425
+ "rule": "Two rows apply to the same readers with the same bound, so a reader can not choose.",
1426
+ "reads": "sources and built indexes"
1427
+ },
1428
+ {
1429
+ "code": "relation-cycle",
1430
+ "rule": "Facts are derived from each other in a loop through `derivedFrom`.",
1431
+ "reads": "sources and built indexes"
1432
+ },
1433
+ {
1434
+ "code": "relates-foreign",
1435
+ "rule": "`relates` or `factLink` holds a fact object that is not a fact of this package, such as one imported from another package.",
1436
+ "reads": "sources"
1437
+ },
1438
+ {
1439
+ "code": "history",
1440
+ "rule": "A `history` row does not fit: a key that matches no item, a key that is already there, an array that is not keyed, a bad pointer.",
1441
+ "reads": "sources"
1442
+ },
1443
+ {
1444
+ "code": "derive",
1445
+ "rule": "`derive` finds no installed upstream package, no such fact in it, or `map` returns something that is not an object.",
1446
+ "reads": "the installed upstream package"
1447
+ },
1448
+ {
1449
+ "code": "derive-version",
1450
+ "rule": "`derived.lock.json`, or a built index passed with `--index`, records another upstream version than the one installed.",
1451
+ "reads": "the installed upstream package, `derived.lock.json`"
1452
+ },
1453
+ {
1454
+ "code": "lib-rows",
1455
+ "rule": "A row with `since` in `facts/_lib`, which holds only functions and constants.",
1456
+ "reads": "source code, parsed with oxc"
1457
+ },
1458
+ {
1459
+ "code": "since-ahead",
1460
+ "rule": "A `since` is newer than `describes`, or than the `--train` version of its component when one is given.",
1461
+ "reads": "sources, `--train`"
1462
+ },
1463
+ {
1464
+ "code": "train-next",
1465
+ "rule": "A component named by `--train` still has a row that says `next` and is not pending.",
1466
+ "reads": "sources, `--train`"
1467
+ },
1468
+ {
1469
+ "code": "pending-untested",
1470
+ "rule": "A `pending` label is not passed as `include` by any test in `testDirs`.",
1471
+ "reads": "`testDirs`, parsed with oxc"
1472
+ },
1473
+ {
1474
+ "code": "doc-unknown-id",
1475
+ "rule": "A `fact:<id>` or `fact:<spec>:<id>` in `docsDirs` names a fact that does not exist.",
1476
+ "reads": "`docsDirs`"
1477
+ },
1478
+ {
1479
+ "code": "impl-imports-facts",
1480
+ "rule": "Code in `implDirs` imports a `-facts` package.",
1481
+ "reads": "`implDirs`, parsed with oxc"
1482
+ },
1483
+ {
1484
+ "code": "impl-reads-facts-dist",
1485
+ "rule": "A string in `implDirs` code, or a fixed part of a template, holds `facts/dist` as a path part (bounded by the start, the end, `/` or `\\`). It covers an import, `require`, `readFileSync` and `new URL`. It matches the literal text, so a path built as `join('facts', 'dist')` is not found, and implementations in other languages are out of scope.",
1486
+ "reads": "`implDirs`, parsed with oxc"
1487
+ },
1488
+ {
1489
+ "code": "impl-depends-on-facts",
1490
+ "rule": "A package that is not a facts package lists a `-facts` package in `dependencies`.",
1491
+ "reads": "every package.json under `repoRoot`"
1492
+ },
1493
+ {
1494
+ "code": "top-level-content",
1495
+ "rule": "A warning. No row applies to a reader that names no platform, so the top-level content is a guess.",
1496
+ "reads": "sources and built indexes"
1497
+ },
1498
+ {
1499
+ "code": "load",
1500
+ "rule": "A source module, example or index file can not be run or parsed.",
1501
+ "reads": "sources"
1502
+ }
1503
+ ]
458
1504
  }
459
- }
460
- },
461
- "tool": "fact-kit",
462
- "source": {
463
- "kind": "published"
464
- }
465
- },
466
- {
467
- "id": "fact-kit.check-rules",
468
- "topics": [
469
- "check"
470
- ],
471
- "title": {
472
- "en": "What each problem code of check stands for"
473
- },
474
- "description": {
475
- "en": "One entry per code of `fact-kit.problem-codes`, with the rule and the input it reads. `check` exits with 0 when it finds no problem, 1 when it finds one, and 2 when it can not run because of bad settings or input."
476
- },
477
- "variants": [
1505
+ },
478
1506
  {
479
- "since": "0.7.0",
1507
+ "since": "0.8.0",
480
1508
  "content": {
481
1509
  "value": [
482
1510
  {
@@ -551,7 +1579,7 @@
551
1579
  },
552
1580
  {
553
1581
  "code": "history",
554
- "rule": "A `history` row does not fit: a key that matches no item, a key that is already there, an array that is not keyed, a bad pointer.",
1582
+ "rule": "A `history` row does not fit: a key that matches no item, a key that is already there, an array that is not keyed, a bad pointer, or a pointer that goes into an array by index. Name an item by its key, or replace the whole array.",
555
1583
  "reads": "sources"
556
1584
  },
557
1585
  {
@@ -613,12 +1641,32 @@
613
1641
  "code": "load",
614
1642
  "rule": "A source module, example or index file can not be run or parsed.",
615
1643
  "reads": "sources"
1644
+ },
1645
+ {
1646
+ "code": "builder",
1647
+ "rule": "A builder, `mf.*`, `contentOf` or `subsetOf` got input that does not fit, such as a name with a leading dot, rows whose first row is not the kind of the method, a subset whose parent is not a fact object, or a state machine, relations or sequence with an end that is not declared, or an entity, value object, aggregate or use case whose names do not match (an identity or `required` name that is not a field, a layer that is not one of three). `history` also raises it when a row makes what a builder checked invalid. The message names the row and the key. Only `check` prints the code. `build` stops with the message.",
1648
+ "reads": "sources"
1649
+ },
1650
+ {
1651
+ "code": "subset-of",
1652
+ "rule": "A list declared with `subsetOf` has, at some version boundary, a value that the list of its parent lacks, or the parent has no row that applies there. The boundaries are those of `ambiguous-rows`, taken over the rows of both facts. The message names the oldest version where it happens and the value. `build` runs this rule too.",
1653
+ "reads": "sources"
1654
+ },
1655
+ {
1656
+ "code": "ref",
1657
+ "rule": "A `ref(fact, field?)` does not resolve. At some version boundary of the two facts, the reader gets a row of the fact that writes the `ref` but no row of the target applies, the target lacks the field (a field name with a dot can not be referenced), the target is a statement and the `ref` has a field, or the target is not a schema where the `ref` is a `$ref`. Also: a field path with an empty part, `$defs` that already has the key with another schema, schemas that embed each other in a loop, a schema of another entry with a file `$ref` embedded here, a `$dynamicRef` or `$recursiveRef`, or a `$ref` to the root inside a subschema with an `$id`, in an embedded schema, which can not be moved into the schema that embeds it, and a target with several rows whose rows can not be aligned with the rows of the fact that writes the `ref`, so some reader gets a schema in `$defs` that is not the one it gets from the target. The message names the oldest version where it happens. `build` runs this rule too.",
1658
+ "reads": "sources"
1659
+ },
1660
+ {
1661
+ "code": "schema-property",
1662
+ "rule": "An `x-identity` names a field that is not in the `properties` of the same schema. It reads every schema of a fact, in every row, and every file under `schemas/`. A `required` list that builders make is checked by `builder`, not by this rule.",
1663
+ "reads": "sources and built indexes"
616
1664
  }
617
1665
  ]
618
1666
  }
619
1667
  },
620
1668
  {
621
- "since": "0.8.0",
1669
+ "since": "0.11.0",
622
1670
  "content": {
623
1671
  "value": [
624
1672
  {
@@ -733,7 +1781,7 @@
733
1781
  },
734
1782
  {
735
1783
  "code": "impl-imports-facts",
736
- "rule": "Code in `implDirs` imports a `-facts` package.",
1784
+ "rule": "Code in `implDirs` imports a `-facts` package, with or without the publish target suffix `.<target>` of `fact-kit.facts-package-naming`, as in `fact-kit-facts.npm`.",
737
1785
  "reads": "`implDirs`, parsed with oxc"
738
1786
  },
739
1787
  {
@@ -743,7 +1791,7 @@
743
1791
  },
744
1792
  {
745
1793
  "code": "impl-depends-on-facts",
746
- "rule": "A package that is not a facts package lists a `-facts` package in `dependencies`.",
1794
+ "rule": "A package that is not a facts package lists a `-facts` package in `dependencies`. A name with the publish target suffix, such as `fact-kit-facts.npm`, is a `-facts` package too.",
747
1795
  "reads": "every package.json under `repoRoot`"
748
1796
  },
749
1797
  {
@@ -775,12 +1823,22 @@
775
1823
  "code": "schema-property",
776
1824
  "rule": "An `x-identity` names a field that is not in the `properties` of the same schema. It reads every schema of a fact, in every row, and every file under `schemas/`. A `required` list that builders make is checked by `builder`, not by this rule.",
777
1825
  "reads": "sources and built indexes"
1826
+ },
1827
+ {
1828
+ "code": "policy-scope",
1829
+ "rule": "The `release-policy.json` at `repoRoot` has `access: \"restricted\"` at the top or in a unit, and no top-level `scope`. `check` reports it itself and does not leave it to the schema of the policy. A repository with no `release-policy.json` is not checked. See `fact-kit.facts-package-naming`.",
1830
+ "reads": "`release-policy.json`"
1831
+ },
1832
+ {
1833
+ "code": "facts-name",
1834
+ "rule": "In an aggregate package (the config has `aggregate`), the name of the aggregate or of a component package is not the one `fact-kit.facts-package-naming` works out from `release-policy.json`: a missing or extra `@<scope>/` prefix, a missing or extra publish target suffix, or a shared base name with no publish target to tell the packages apart. The message names the expected name. A repository with no `release-policy.json` is not checked. A component that is not found in node_modules or in the workspace, or whose facts cannot be loaded, gets a warning with code `facts-name` and is not checked.",
1835
+ "reads": "`release-policy.json`, `release-please-config.json`, the component packages and their facts sources"
778
1836
  }
779
1837
  ]
780
1838
  }
781
1839
  },
782
1840
  {
783
- "since": "0.11.0",
1841
+ "since": "0.12.0-alpha.1",
784
1842
  "content": {
785
1843
  "value": [
786
1844
  {
@@ -895,7 +1953,7 @@
895
1953
  },
896
1954
  {
897
1955
  "code": "impl-imports-facts",
898
- "rule": "Code in `implDirs` imports a `-facts` package, with or without the publish target suffix `.<target>` of `fact-kit.facts-package-naming`, as in `fact-kit-facts.npm`.",
1956
+ "rule": "Code in `implDirs` imports a `-facts` package (with or without the publish target suffix), a `.facts.ts` or `.doc.ts` file (with or without the extension), or a path inside the `factsDir` of the package by a relative or absolute specifier. A path that holds `facts/dist` is left to `impl-reads-facts-dist`. See `fact-kit.impl-rules-basis`.",
899
1957
  "reads": "`implDirs`, parsed with oxc"
900
1958
  },
901
1959
  {
@@ -947,12 +2005,37 @@
947
2005
  "code": "facts-name",
948
2006
  "rule": "In an aggregate package (the config has `aggregate`), the name of the aggregate or of a component package is not the one `fact-kit.facts-package-naming` works out from `release-policy.json`: a missing or extra `@<scope>/` prefix, a missing or extra publish target suffix, or a shared base name with no publish target to tell the packages apart. The message names the expected name. A repository with no `release-policy.json` is not checked. A component that is not found in node_modules or in the workspace, or whose facts cannot be loaded, gets a warning with code `facts-name` and is not checked.",
949
2007
  "reads": "`release-policy.json`, `release-please-config.json`, the component packages and their facts sources"
2008
+ },
2009
+ {
2010
+ "code": "facts-file-orphan",
2011
+ "rule": "A `*.facts.ts` is under no entry (no `index.ts` in its directory or above it, below the facts directory), or is in a directory whose name starts with `_` or below one. See `fact-kit.facts-file-collection`.",
2012
+ "reads": "the files under `factsDir`"
2013
+ },
2014
+ {
2015
+ "code": "split-topic",
2016
+ "rule": "The facts of one `*.facts.ts` have more than one value of `topics[0]`. Runs only when `splitRules` is `true` in the config. See `fact-kit.split-rules`.",
2017
+ "reads": "`*.facts.ts` files and `index.ts`, parsed with oxc"
2018
+ },
2019
+ {
2020
+ "code": "split-size",
2021
+ "rule": "A `*.facts.ts` holds more facts than `maxFactsPerFile`, 40 unless the config says otherwise. Runs only when `splitRules` is `true` in the config. See `fact-kit.split-rules`.",
2022
+ "reads": "`*.facts.ts` files and `index.ts`, parsed with oxc"
2023
+ },
2024
+ {
2025
+ "code": "split-index",
2026
+ "rule": "The `index.ts` of an entry that has `*.facts.ts` files holds a fact object. Runs only when `splitRules` is `true` in the config. See `fact-kit.split-rules`.",
2027
+ "reads": "`*.facts.ts` files and `index.ts`, parsed with oxc"
2028
+ },
2029
+ {
2030
+ "code": "split-tool",
2031
+ "rule": "A `tool` is written in a `*.facts.ts` anywhere but in the argument of `factsOf(`. Runs only when `splitRules` is `true` in the config. See `fact-kit.split-rules`.",
2032
+ "reads": "`*.facts.ts` files and `index.ts`, parsed with oxc"
950
2033
  }
951
2034
  ]
952
2035
  }
953
2036
  },
954
2037
  {
955
- "since": "0.12.0-alpha.1",
2038
+ "since": "0.12.1-alpha.1",
956
2039
  "content": {
957
2040
  "value": [
958
2041
  {
@@ -1052,7 +2135,7 @@
1052
2135
  },
1053
2136
  {
1054
2137
  "code": "train-next",
1055
- "rule": "A component named by `--train` still has a row that says `next` and is not pending.",
2138
+ "rule": "A component named by `--train` still has a row that says `next` and is not pending, or a `when.deprecatedIn` or `when.removeIn` that says `next`. Run `pin` first.",
1056
2139
  "reads": "sources, `--train`"
1057
2140
  },
1058
2141
  {
@@ -1149,7 +2232,7 @@
1149
2232
  }
1150
2233
  },
1151
2234
  {
1152
- "since": "0.12.1-alpha.1",
2235
+ "since": "0.14.0-alpha.1",
1153
2236
  "content": {
1154
2237
  "value": [
1155
2238
  {
@@ -1341,6 +2424,11 @@
1341
2424
  "code": "split-tool",
1342
2425
  "rule": "A `tool` is written in a `*.facts.ts` anywhere but in the argument of `factsOf(`. Runs only when `splitRules` is `true` in the config. See `fact-kit.split-rules`.",
1343
2426
  "reads": "`*.facts.ts` files and `index.ts`, parsed with oxc"
2427
+ },
2428
+ {
2429
+ "code": "validated-by",
2430
+ "rule": "A fact with `validatedBy` fails one of four ways, all reported with this one code: the package named by `validatedBy` is not installed, the named fact does not exist there, the named fact is not a schema fact, or a value of this fact does not fit the schema. Only `check` runs it, `build` does not.",
2431
+ "reads": "sources, and the installed package that `validatedBy` names (or the `--index` that holds the same spec)"
1344
2432
  }
1345
2433
  ]
1346
2434
  }
@@ -1541,6 +2629,11 @@
1541
2629
  "code": "split-tool",
1542
2630
  "rule": "A `tool` is written in a `*.facts.ts` anywhere but in the argument of `factsOf(`. Runs only when `splitRules` is `true` in the config. See `fact-kit.split-rules`.",
1543
2631
  "reads": "`*.facts.ts` files and `index.ts`, parsed with oxc"
2632
+ },
2633
+ {
2634
+ "code": "validated-by",
2635
+ "rule": "A fact with `validatedBy` fails one of four ways, all reported with this one code: the package named by `validatedBy` is not installed, the named fact does not exist there, the named fact is not a schema fact, or a value of this fact does not fit the schema. Only `check` runs it, `build` does not.",
2636
+ "reads": "sources, and the installed package that `validatedBy` names (or the `--index` that holds the same spec)"
1544
2637
  }
1545
2638
  ]
1546
2639
  }
@@ -4527,6 +5620,52 @@
4527
5620
  "split-tool"
4528
5621
  ]
4529
5622
  }
5623
+ },
5624
+ {
5625
+ "since": "0.14.0-alpha.1",
5626
+ "content": {
5627
+ "value": [
5628
+ "format",
5629
+ "duplicate-id",
5630
+ "id-prefix",
5631
+ "local-path",
5632
+ "unregistered-domain",
5633
+ "unknown-fact-id",
5634
+ "missing-schema-file",
5635
+ "describes",
5636
+ "publish",
5637
+ "since-format",
5638
+ "ambiguous-rows",
5639
+ "top-level-content",
5640
+ "load",
5641
+ "history",
5642
+ "relates-foreign",
5643
+ "derive",
5644
+ "derive-version",
5645
+ "same-line",
5646
+ "relation-cycle",
5647
+ "lib-rows",
5648
+ "since-ahead",
5649
+ "train-next",
5650
+ "pending-untested",
5651
+ "doc-unknown-id",
5652
+ "impl-imports-facts",
5653
+ "impl-reads-facts-dist",
5654
+ "impl-depends-on-facts",
5655
+ "builder",
5656
+ "subset-of",
5657
+ "ref",
5658
+ "schema-property",
5659
+ "policy-scope",
5660
+ "facts-name",
5661
+ "facts-file-orphan",
5662
+ "split-topic",
5663
+ "split-size",
5664
+ "split-index",
5665
+ "split-tool",
5666
+ "validated-by"
5667
+ ]
5668
+ }
4530
5669
  }
4531
5670
  ],
4532
5671
  "tool": "fact-kit",
@@ -4572,7 +5711,8 @@
4572
5711
  "split-topic",
4573
5712
  "split-size",
4574
5713
  "split-index",
4575
- "split-tool"
5714
+ "split-tool",
5715
+ "validated-by"
4576
5716
  ]
4577
5717
  }
4578
5718
  },
@@ -7551,19 +8691,87 @@
7551
8691
  "description": {
7552
8692
  "en": "The paths `--index` takes, and how each is read."
7553
8693
  },
7554
- "when": {
7555
- "since": "0.7.0"
8694
+ "variants": [
8695
+ {
8696
+ "since": "0.7.0",
8697
+ "content": {
8698
+ "value": {
8699
+ "repeatable": "`--index <path>` may be given any number of times, and `check` reads every path in one run. In the config the same paths are `indexFiles`.",
8700
+ "reads": "A path that is a directory is read as `<dir>/index.json`, and any other path is read as the index file itself. The `schemas/` directory next to the index file is read too.",
8701
+ "unreadable": "A file that can not be read or parsed as JSON exits with 2."
8702
+ }
8703
+ }
8704
+ },
8705
+ {
8706
+ "since": "0.14.0-alpha.1",
8707
+ "content": {
8708
+ "value": {
8709
+ "repeatable": "`--index <path>` may be given any number of times, and `check` reads every path in one run. In the config the same paths are `indexFiles`.",
8710
+ "reads": "A path that is a directory is read as `<dir>/index.json`, and any other path is read as the index file itself. The `schemas/` directory next to the index file is read too.",
8711
+ "unreadable": "A file that can not be read or parsed as JSON exits with 2.",
8712
+ "validatedByFallback": "A fact with `validatedBy` reads the spec it names from `--index` when one of the paths holds that spec. When no `--index` holds it, `check` reads the installed package from the `node_modules` of the current directory."
8713
+ }
8714
+ }
8715
+ }
8716
+ ],
8717
+ "tool": "fact-kit",
8718
+ "source": {
8719
+ "kind": "published"
7556
8720
  },
7557
8721
  "content": {
7558
8722
  "value": {
7559
8723
  "repeatable": "`--index <path>` may be given any number of times, and `check` reads every path in one run. In the config the same paths are `indexFiles`.",
7560
8724
  "reads": "A path that is a directory is read as `<dir>/index.json`, and any other path is read as the index file itself. The `schemas/` directory next to the index file is read too.",
7561
- "unreadable": "A file that can not be read or parsed as JSON exits with 2."
8725
+ "unreadable": "A file that can not be read or parsed as JSON exits with 2.",
8726
+ "validatedByFallback": "A fact with `validatedBy` reads the spec it names from `--index` when one of the paths holds that spec. When no `--index` holds it, `check` reads the installed package from the `node_modules` of the current directory."
7562
8727
  }
8728
+ }
8729
+ },
8730
+ {
8731
+ "id": "fact-kit.validated-by",
8732
+ "topics": [
8733
+ "check",
8734
+ "fact",
8735
+ "schema"
8736
+ ],
8737
+ "title": {
8738
+ "en": "validatedBy: a fact whose value must fit a schema of another fact"
8739
+ },
8740
+ "description": {
8741
+ "en": "The `validatedBy` field of a fact, which schema it names, how `check` finds it, and what it reports."
7563
8742
  },
8743
+ "variants": [
8744
+ {
8745
+ "since": "0.14.0-alpha.1",
8746
+ "content": {
8747
+ "value": {
8748
+ "field": "validatedBy",
8749
+ "format": "A fact location, `<spec>:<id>`. `<spec>` is `<package name>[/<entry>]`, as in `derivedFrom`. An `<id>` with no `<spec>` names a fact of the same entry. A value with a space or any other shape that is not a fact location is a `format` problem.",
8750
+ "target": "The `content.schema` at the top level of the named fact. When the named fact has `variants`, the top-level `content` is read, which is the latest published content.",
8751
+ "variants": "When the fact that writes `validatedBy` has `variants`, every row is checked: the `value` of each row must fit the schema. A row with no `value` is skipped.",
8752
+ "refs": "When the named schema uses a relative `$ref` (`schemas/<file>`), `check` reads the `schemas/` directory next to the `index.json` of the named package.",
8753
+ "resolution": "Only the packages named by `validatedBy` are read. `check` reads them from the `node_modules` of the current directory. When an `--index` already holds the same spec, `check` uses that one first.",
8754
+ "scope": "`check` runs the rule on the facts built from the sources. The facts of an `--index` are not checked, because a published index can not be fixed from here. `build` does not run the rule, although it also calls the check functions, so a `validatedBy` problem never stops a build.",
8755
+ "problems": "Four failures, all with the one problem code `validated-by`: the named package is not installed, the named fact does not exist, the named fact is not a schema fact, and a value does not fit the schema."
8756
+ }
8757
+ }
8758
+ }
8759
+ ],
7564
8760
  "tool": "fact-kit",
7565
8761
  "source": {
7566
8762
  "kind": "published"
8763
+ },
8764
+ "content": {
8765
+ "value": {
8766
+ "field": "validatedBy",
8767
+ "format": "A fact location, `<spec>:<id>`. `<spec>` is `<package name>[/<entry>]`, as in `derivedFrom`. An `<id>` with no `<spec>` names a fact of the same entry. A value with a space or any other shape that is not a fact location is a `format` problem.",
8768
+ "target": "The `content.schema` at the top level of the named fact. When the named fact has `variants`, the top-level `content` is read, which is the latest published content.",
8769
+ "variants": "When the fact that writes `validatedBy` has `variants`, every row is checked: the `value` of each row must fit the schema. A row with no `value` is skipped.",
8770
+ "refs": "When the named schema uses a relative `$ref` (`schemas/<file>`), `check` reads the `schemas/` directory next to the `index.json` of the named package.",
8771
+ "resolution": "Only the packages named by `validatedBy` are read. `check` reads them from the `node_modules` of the current directory. When an `--index` already holds the same spec, `check` uses that one first.",
8772
+ "scope": "`check` runs the rule on the facts built from the sources. The facts of an `--index` are not checked, because a published index can not be fixed from here. `build` does not run the rule, although it also calls the check functions, so a `validatedBy` problem never stops a build.",
8773
+ "problems": "Four failures, all with the one problem code `validated-by`: the named package is not installed, the named fact does not exist, the named fact is not a schema fact, and a value does not fit the schema."
8774
+ }
7567
8775
  }
7568
8776
  },
7569
8777
  {