provenant-cli 0.1.15

Rust scanner for ScanCode-compatible workflows, licenses, package metadata, SBOMs, and provenance data.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
// SPDX-FileCopyrightText: Provenant contributors
// SPDX-License-Identifier: Apache-2.0

//! Field metadata for license-detection, match, and license-reference surfaces.

use super::OutputFieldDoc;

pub(super) const TOP_LEVEL_LICENSE_DETECTION_FIELDS: &[OutputFieldDoc] = &[
    OutputFieldDoc {
        json_name: "identifier",
        rust_field: "identifier",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "Stable grouped-detection identifier for this top-level license detection block.",
    },
    OutputFieldDoc {
        json_name: "license_expression",
        rust_field: "license_expression",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "Grouped license expression for the top-level detection block.",
    },
    OutputFieldDoc {
        json_name: "license_expression_spdx",
        rust_field: "license_expression_spdx",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "SPDX-form grouped license expression for the top-level detection block.",
    },
    OutputFieldDoc {
        json_name: "detection_count",
        rust_field: "detection_count",
        value_shape: "integer",
        presence: "Always emitted.",
        meaning: "Number of file-level detections that contributed to this grouped top-level block.",
    },
    OutputFieldDoc {
        json_name: "detection_log",
        rust_field: "detection_log",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Grouping-time notes that explain why this top-level detection looks the way it does.",
    },
    OutputFieldDoc {
        json_name: "reference_matches",
        rust_field: "reference_matches",
        value_shape: "array<object>",
        presence: "Always emitted.",
        meaning: "Representative match/reference records retained on the top-level grouped detection block.",
    },
];

pub(super) const LICENSE_DETECTION_FIELDS: &[OutputFieldDoc] = &[
    OutputFieldDoc {
        json_name: "license_expression",
        rust_field: "license_expression",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "Grouped license expression for the detection block.",
    },
    OutputFieldDoc {
        json_name: "license_expression_spdx",
        rust_field: "license_expression_spdx",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "SPDX-form expression for the detection block.",
    },
    OutputFieldDoc {
        json_name: "matches",
        rust_field: "matches",
        value_shape: "array<object>",
        presence: "Always emitted.",
        meaning: "Match records that contributed to this grouped file- or package-level detection.",
    },
    OutputFieldDoc {
        json_name: "detection_log",
        rust_field: "detection_log",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Notes explaining post-processing or grouping decisions for this detection.",
    },
    OutputFieldDoc {
        json_name: "identifier",
        rust_field: "identifier",
        value_shape: "string | null",
        presence: "Always emitted.",
        meaning: "Stable detection identifier when available.",
    },
];

pub(super) const MATCH_FIELDS: &[OutputFieldDoc] = &[
    OutputFieldDoc {
        json_name: "license_expression",
        rust_field: "license_expression",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "License expression assigned to this individual match.",
    },
    OutputFieldDoc {
        json_name: "license_expression_spdx",
        rust_field: "license_expression_spdx",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "SPDX-form expression assigned to this individual match.",
    },
    OutputFieldDoc {
        json_name: "from_file",
        rust_field: "from_file",
        value_shape: "string | null",
        presence: "Always emitted.",
        meaning: "Origin file path associated with the match record.",
    },
    OutputFieldDoc {
        json_name: "start_line",
        rust_field: "start_line",
        value_shape: "integer",
        presence: "Always emitted.",
        meaning: "First line covered by the match.",
    },
    OutputFieldDoc {
        json_name: "end_line",
        rust_field: "end_line",
        value_shape: "integer",
        presence: "Always emitted.",
        meaning: "Last line covered by the match.",
    },
    OutputFieldDoc {
        json_name: "matcher",
        rust_field: "matcher",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Matcher kind that produced the match.",
    },
    OutputFieldDoc {
        json_name: "score",
        rust_field: "score",
        value_shape: "number",
        presence: "Always emitted.",
        meaning: "Match score on the public output scale.",
    },
    OutputFieldDoc {
        json_name: "matched_length",
        rust_field: "matched_length",
        value_shape: "integer | null",
        presence: "Emitted only when available.",
        meaning: "Matched token/text length when tracked.",
    },
    OutputFieldDoc {
        json_name: "match_coverage",
        rust_field: "match_coverage",
        value_shape: "number | null",
        presence: "Emitted only when available.",
        meaning: "Coverage ratio for the match when tracked.",
    },
    OutputFieldDoc {
        json_name: "rule_relevance",
        rust_field: "rule_relevance",
        value_shape: "integer | null",
        presence: "Emitted only when available.",
        meaning: "Rule relevance score when tracked.",
    },
    OutputFieldDoc {
        json_name: "rule_identifier",
        rust_field: "rule_identifier",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Identifier of the matched rule when available.",
    },
    OutputFieldDoc {
        json_name: "rule_url",
        rust_field: "rule_url",
        value_shape: "string | null",
        presence: "Always emitted.",
        meaning: "Rule URL when available.",
    },
    OutputFieldDoc {
        json_name: "matched_text",
        rust_field: "matched_text",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Matched text payload when text output is enabled.",
    },
    OutputFieldDoc {
        json_name: "matched_text_diagnostics",
        rust_field: "matched_text_diagnostics",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Diagnostic rendering of the matched text when enabled.",
    },
    OutputFieldDoc {
        json_name: "referenced_filenames",
        rust_field: "referenced_filenames",
        value_shape: "array<string> | null",
        presence: "Emitted only when available.",
        meaning: "Referenced filenames captured on the matched rule when applicable.",
    },
];

pub(super) const LICENSE_REFERENCE_FIELDS: &[OutputFieldDoc] = &[
    OutputFieldDoc {
        json_name: "key",
        rust_field: "key",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Primary ScanCode-style license key when one is available for the reference block.",
    },
    OutputFieldDoc {
        json_name: "language",
        rust_field: "language",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Language tag for the referenced license text when the license reference is language-specific.",
    },
    OutputFieldDoc {
        json_name: "name",
        rust_field: "name",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "Canonical human-facing name of the referenced license.",
    },
    OutputFieldDoc {
        json_name: "short_name",
        rust_field: "short_name",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "Short display name of the referenced license.",
    },
    OutputFieldDoc {
        json_name: "owner",
        rust_field: "owner",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Owning organization or steward of the referenced license, when captured.",
    },
    OutputFieldDoc {
        json_name: "homepage_url",
        rust_field: "homepage_url",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Homepage URL for the referenced license.",
    },
    OutputFieldDoc {
        json_name: "spdx_license_key",
        rust_field: "spdx_license_key",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "Primary SPDX license key associated with the referenced license.",
    },
    OutputFieldDoc {
        json_name: "other_spdx_license_keys",
        rust_field: "other_spdx_license_keys",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Additional SPDX license keys associated with the same referenced license.",
    },
    OutputFieldDoc {
        json_name: "osi_license_key",
        rust_field: "osi_license_key",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "OSI license key when the referenced license is recognized by OSI.",
    },
    OutputFieldDoc {
        json_name: "text_urls",
        rust_field: "text_urls",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "URLs to known license text sources for this referenced license.",
    },
    OutputFieldDoc {
        json_name: "osi_url",
        rust_field: "osi_url",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "OSI detail page URL for the referenced license.",
    },
    OutputFieldDoc {
        json_name: "faq_url",
        rust_field: "faq_url",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "FAQ URL for the referenced license.",
    },
    OutputFieldDoc {
        json_name: "other_urls",
        rust_field: "other_urls",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Additional URLs associated with the referenced license.",
    },
    OutputFieldDoc {
        json_name: "category",
        rust_field: "category",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "License category label, when the license data classifies it.",
    },
    OutputFieldDoc {
        json_name: "is_exception",
        rust_field: "is_exception",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the referenced license is an exception rather than a standalone license.",
    },
    OutputFieldDoc {
        json_name: "is_unknown",
        rust_field: "is_unknown",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the referenced license is treated as an unknown or placeholder license.",
    },
    OutputFieldDoc {
        json_name: "is_generic",
        rust_field: "is_generic",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the referenced license is generic rather than a specific named license.",
    },
    OutputFieldDoc {
        json_name: "notes",
        rust_field: "notes",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Additional notes carried by the referenced license record.",
    },
    OutputFieldDoc {
        json_name: "minimum_coverage",
        rust_field: "minimum_coverage",
        value_shape: "integer | null",
        presence: "Emitted only when available.",
        meaning: "Minimum coverage threshold associated with the referenced license, when specified.",
    },
    OutputFieldDoc {
        json_name: "standard_notice",
        rust_field: "standard_notice",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Standard notice text associated with the referenced license.",
    },
    OutputFieldDoc {
        json_name: "ignorable_copyrights",
        rust_field: "ignorable_copyrights",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Copyright strings considered ignorable for this referenced license.",
    },
    OutputFieldDoc {
        json_name: "ignorable_holders",
        rust_field: "ignorable_holders",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Holder strings considered ignorable for this referenced license.",
    },
    OutputFieldDoc {
        json_name: "ignorable_authors",
        rust_field: "ignorable_authors",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Author strings considered ignorable for this referenced license.",
    },
    OutputFieldDoc {
        json_name: "ignorable_urls",
        rust_field: "ignorable_urls",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "URL strings considered ignorable for this referenced license.",
    },
    OutputFieldDoc {
        json_name: "ignorable_emails",
        rust_field: "ignorable_emails",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Email strings considered ignorable for this referenced license.",
    },
    OutputFieldDoc {
        json_name: "scancode_url",
        rust_field: "scancode_url",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "ScanCode reference URL for this license, when available.",
    },
    OutputFieldDoc {
        json_name: "licensedb_url",
        rust_field: "licensedb_url",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "LicenseDB URL for this license, when available.",
    },
    OutputFieldDoc {
        json_name: "spdx_url",
        rust_field: "spdx_url",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "SPDX reference URL for this license, when available.",
    },
    OutputFieldDoc {
        json_name: "text",
        rust_field: "text",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "Canonical license text payload preserved on the reference block.",
    },
];

pub(super) const LICENSE_RULE_REFERENCE_FIELDS: &[OutputFieldDoc] = &[
    OutputFieldDoc {
        json_name: "identifier",
        rust_field: "identifier",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "Stable identifier of the referenced license rule.",
    },
    OutputFieldDoc {
        json_name: "license_expression",
        rust_field: "license_expression",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "License expression associated with the referenced rule.",
    },
    OutputFieldDoc {
        json_name: "is_license_text",
        rust_field: "is_license_text",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the rule is classified as license-text evidence.",
    },
    OutputFieldDoc {
        json_name: "is_license_notice",
        rust_field: "is_license_notice",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the rule is classified as license-notice evidence.",
    },
    OutputFieldDoc {
        json_name: "is_license_reference",
        rust_field: "is_license_reference",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the rule is classified as license-reference evidence.",
    },
    OutputFieldDoc {
        json_name: "is_license_tag",
        rust_field: "is_license_tag",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the rule is classified as license-tag evidence.",
    },
    OutputFieldDoc {
        json_name: "is_license_clue",
        rust_field: "is_license_clue",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the rule is classified as clue-only evidence.",
    },
    OutputFieldDoc {
        json_name: "is_license_intro",
        rust_field: "is_license_intro",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the rule is classified as introductory license wording.",
    },
    OutputFieldDoc {
        json_name: "language",
        rust_field: "language",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Language tag for the referenced rule when the rule is language-specific.",
    },
    OutputFieldDoc {
        json_name: "rule_url",
        rust_field: "rule_url",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Reference URL for the rule, when available.",
    },
    OutputFieldDoc {
        json_name: "is_required_phrase",
        rust_field: "is_required_phrase",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the rule is a required-phrase rule.",
    },
    OutputFieldDoc {
        json_name: "skip_for_required_phrase_generation",
        rust_field: "skip_for_required_phrase_generation",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether this rule should be excluded when deriving required-phrase rules automatically.",
    },
    OutputFieldDoc {
        json_name: "replaced_by",
        rust_field: "replaced_by",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Rule identifiers that supersede this rule.",
    },
    OutputFieldDoc {
        json_name: "is_continuous",
        rust_field: "is_continuous",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the rule expects continuous text rather than discontinuous matches.",
    },
    OutputFieldDoc {
        json_name: "is_synthetic",
        rust_field: "is_synthetic",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the rule was synthesized rather than sourced directly from curated reference text.",
    },
    OutputFieldDoc {
        json_name: "is_from_license",
        rust_field: "is_from_license",
        value_shape: "boolean",
        presence: "Always emitted.",
        meaning: "Whether the rule was derived directly from a license text record.",
    },
    OutputFieldDoc {
        json_name: "length",
        rust_field: "length",
        value_shape: "integer",
        presence: "Always emitted.",
        meaning: "Rule length on the public rule-reference surface.",
    },
    OutputFieldDoc {
        json_name: "relevance",
        rust_field: "relevance",
        value_shape: "integer | null",
        presence: "Emitted only when available.",
        meaning: "Rule relevance score, when present.",
    },
    OutputFieldDoc {
        json_name: "minimum_coverage",
        rust_field: "minimum_coverage",
        value_shape: "integer | null",
        presence: "Emitted only when available.",
        meaning: "Minimum coverage threshold associated with the rule, when specified.",
    },
    OutputFieldDoc {
        json_name: "referenced_filenames",
        rust_field: "referenced_filenames",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Referenced filenames attached to the rule metadata.",
    },
    OutputFieldDoc {
        json_name: "notes",
        rust_field: "notes",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Additional notes carried by the rule reference.",
    },
    OutputFieldDoc {
        json_name: "ignorable_copyrights",
        rust_field: "ignorable_copyrights",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Copyright strings considered ignorable for this rule.",
    },
    OutputFieldDoc {
        json_name: "ignorable_holders",
        rust_field: "ignorable_holders",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Holder strings considered ignorable for this rule.",
    },
    OutputFieldDoc {
        json_name: "ignorable_authors",
        rust_field: "ignorable_authors",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Author strings considered ignorable for this rule.",
    },
    OutputFieldDoc {
        json_name: "ignorable_urls",
        rust_field: "ignorable_urls",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "URL strings considered ignorable for this rule.",
    },
    OutputFieldDoc {
        json_name: "ignorable_emails",
        rust_field: "ignorable_emails",
        value_shape: "array<string>",
        presence: "Emitted only when non-empty.",
        meaning: "Email strings considered ignorable for this rule.",
    },
    OutputFieldDoc {
        json_name: "text",
        rust_field: "text",
        value_shape: "string | null",
        presence: "Emitted only when available.",
        meaning: "Canonical rule text payload when the reference includes it.",
    },
];

pub(super) const LICENSE_POLICY_ENTRY_FIELDS: &[OutputFieldDoc] = &[
    OutputFieldDoc {
        json_name: "license_key",
        rust_field: "license_key",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "License key this policy entry applies to.",
    },
    OutputFieldDoc {
        json_name: "label",
        rust_field: "label",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "Human-facing policy label for the license.",
    },
    OutputFieldDoc {
        json_name: "color_code",
        rust_field: "color_code",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "Color code used by policy-aware outputs or UIs.",
    },
    OutputFieldDoc {
        json_name: "icon",
        rust_field: "icon",
        value_shape: "string",
        presence: "Always emitted.",
        meaning: "Icon identifier used by policy-aware outputs or UIs.",
    },
];