@sanning/proof 0.15.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -4
- package/dist/agent-proof.js +50 -23
- package/dist/case-file.d.ts +24 -4
- package/dist/case-file.js +62 -5
- package/dist/case.d.ts +104 -8
- package/dist/case.js +195 -53
- package/dist/cli.d.ts +105 -2
- package/dist/cli.js +664 -123
- package/dist/compose.js +32 -0
- package/dist/declaration.d.ts +1 -1
- package/dist/declaration.js +182 -3
- package/dist/evidence.js +108 -38
- package/dist/file-match.d.ts +64 -5
- package/dist/file-match.js +113 -22
- package/dist/grading.d.ts +7 -0
- package/dist/grading.js +14 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/merkle.js +13 -7
- package/dist/verifier.js +24 -19
- package/dist/zip-reader.d.ts +7 -0
- package/dist/zip-reader.js +7 -0
- package/package.json +2 -2
- package/src/agent-proof.ts +53 -27
- package/src/case-file.ts +61 -8
- package/src/case.ts +293 -64
- package/src/cli.ts +703 -132
- package/src/compose.ts +33 -0
- package/src/declaration.ts +186 -3
- package/src/evidence.ts +109 -43
- package/src/file-match.ts +160 -26
- package/src/grading.ts +15 -2
- package/src/index.ts +6 -0
- package/src/merkle.ts +13 -7
- package/src/verifier.ts +26 -22
- package/src/zip-reader.ts +7 -0
- package/vectors/README.md +5 -1
- package/vectors/case-file-index.json +88 -2
- package/vectors/file-match.json +135 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"rule": "case-file-index",
|
|
3
|
-
"ruleVersion":
|
|
4
|
-
"statement": "How a reader compares a case file's index, contents.json, with the folder it sits at the root of (evidence-bundle.md §5.6.3 v1.20, A25). The index is never an input to the case reading, and no finding here moves a verdict, a note, a contribution or an exit code. Findings come in this order: case_index_unreadable (and nothing else), case_index_pack_missing, case_index_pack_unlisted, case_index_file_missing, case_index_file_unlisted, case_index_file_differs, case_index_names_absent; within a kind by the UTF-8 bytes of the ref or path, and names_absent in the index's own order. Only files under a listed pack's folder or under report/ are reported as unlisted.",
|
|
3
|
+
"ruleVersion": 2,
|
|
4
|
+
"statement": "How a reader compares a case file's index, contents.json, with the folder it sits at the root of (evidence-bundle.md §5.6.3 v1.20, A25). The index is never an input to the case reading, and no finding here moves a verdict, a note, a contribution or an exit code. Findings come in this order: case_index_unreadable (and nothing else), case_index_pack_missing, case_index_pack_unlisted, case_index_file_missing, case_index_file_unlisted, case_index_file_differs, case_index_file_too_large, case_index_names_absent; within a kind by the UTF-8 bytes of the ref or path, and names_absent in the index's own order. Only files under a listed pack's folder or under report/ are reported as unlisted.",
|
|
5
5
|
"howToUse": "Call readCaseFileIndex / read_case_file_index with the bytes of index_hex (null: no index in the folder) and `files`, and compare the result with `expected`. A finding lists only the fields it carries.",
|
|
6
6
|
"rows": [
|
|
7
7
|
{
|
|
@@ -465,6 +465,92 @@
|
|
|
465
465
|
]
|
|
466
466
|
}
|
|
467
467
|
},
|
|
468
|
+
{
|
|
469
|
+
"id": "file-too-large",
|
|
470
|
+
"why": "A file the index lists is here and was too large for the caller to hash (the caller passes {path, too_large: true} in place of a digest). It is neither a match nor missing: one case_index_file_too_large finding, and no differs or missing for it. Every other file is compared as usual.",
|
|
471
|
+
"index_hex": "7b22616273656e74223a5b5d2c22636173655f6964223a22636173652d346231396465222c22636f6e74656e74735f76657273696f6e223a2273616e6e696e672e636173652d66696c652f7631222c227061636b73223a5b7b2266696c6573223a5b7b2270617468223a227061636b732f612f62756e646c652e6a736f6e222c22736861323536223a2263386261656230383636353834333538646464303634316264353938626239623862383838303935336232613135356366363235303062386338396137333463227d2c7b2270617468223a227061636b732f612f6c6f67732f782e6a736f6e222c22736861323536223a2235303431626631663731336466323034373834333533653832663661346135333539333163623634663166346234613561656166666362373230393138623232227d5d2c22726566223a2261227d2c7b2266696c6573223a5b7b2270617468223a227061636b732f622f62756e646c652e6a736f6e222c22736861323536223a2230653834326632353331333234373838636138353663616264363733306438623432663935373031616535323862313061623165643332343132356231356365227d5d2c22726566223a2262227d5d2c227265706f7274223a5b7b2270617468223a227265706f72742f524541444d452e747874222c22736861323536223a2230316563313839373665373637653831346165653962316361363966366239643331323963343336393063626234623434383463396539323331366362666437227d5d7d",
|
|
472
|
+
"files": [
|
|
473
|
+
{
|
|
474
|
+
"path": "HOW-TO-VERIFY.txt",
|
|
475
|
+
"sha256": "76b25bc6207548c6bd05b1ab2e364ff8c493f6fb04e6a69d731a6f158482b7d9"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"path": "contents.json",
|
|
479
|
+
"sha256": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"path": "report/README.txt",
|
|
483
|
+
"sha256": "01ec18976e767e814aee9b1ca69f6b9d3129c43690cbb4b4484c9e92316cbfd7"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"path": "packs/b/bundle.json",
|
|
487
|
+
"sha256": "0e842f2531324788ca856cabd6730d8b42f95701ae528b10ab1ed324125b15ce"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"path": "packs/a/logs/x.json",
|
|
491
|
+
"too_large": true
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"path": "packs/a/bundle.json",
|
|
495
|
+
"sha256": "c8baeb0866584358ddd0641bd598bb9b8b8880953b2a155cf62500b8c89a734c"
|
|
496
|
+
}
|
|
497
|
+
],
|
|
498
|
+
"expected": {
|
|
499
|
+
"index": "read",
|
|
500
|
+
"case_id": "case-4b19de",
|
|
501
|
+
"findings": [
|
|
502
|
+
{
|
|
503
|
+
"kind": "case_index_file_too_large",
|
|
504
|
+
"path": "packs/a/logs/x.json"
|
|
505
|
+
}
|
|
506
|
+
]
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"id": "unlisted-file-too-large",
|
|
511
|
+
"why": "A file under report/ that the index does not list, too large to hash. Unlisted needs no digest, so it is reported as unlisted, exactly as a file of any size would be; nothing else is said of it.",
|
|
512
|
+
"index_hex": "7b22616273656e74223a5b5d2c22636173655f6964223a22636173652d346231396465222c22636f6e74656e74735f76657273696f6e223a2273616e6e696e672e636173652d66696c652f7631222c227061636b73223a5b7b2266696c6573223a5b7b2270617468223a227061636b732f612f62756e646c652e6a736f6e222c22736861323536223a2263386261656230383636353834333538646464303634316264353938626239623862383838303935336232613135356366363235303062386338396137333463227d2c7b2270617468223a227061636b732f612f6c6f67732f782e6a736f6e222c22736861323536223a2235303431626631663731336466323034373834333533653832663661346135333539333163623634663166346234613561656166666362373230393138623232227d5d2c22726566223a2261227d2c7b2266696c6573223a5b7b2270617468223a227061636b732f622f62756e646c652e6a736f6e222c22736861323536223a2230653834326632353331333234373838636138353663616264363733306438623432663935373031616535323862313061623165643332343132356231356365227d5d2c22726566223a2262227d5d2c227265706f7274223a5b7b2270617468223a227265706f72742f524541444d452e747874222c22736861323536223a2230316563313839373665373637653831346165653962316361363966366239643331323963343336393063626234623434383463396539323331366362666437227d5d7d",
|
|
513
|
+
"files": [
|
|
514
|
+
{
|
|
515
|
+
"path": "HOW-TO-VERIFY.txt",
|
|
516
|
+
"sha256": "76b25bc6207548c6bd05b1ab2e364ff8c493f6fb04e6a69d731a6f158482b7d9"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"path": "contents.json",
|
|
520
|
+
"sha256": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
"path": "report/README.txt",
|
|
524
|
+
"sha256": "01ec18976e767e814aee9b1ca69f6b9d3129c43690cbb4b4484c9e92316cbfd7"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"path": "packs/b/bundle.json",
|
|
528
|
+
"sha256": "0e842f2531324788ca856cabd6730d8b42f95701ae528b10ab1ed324125b15ce"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"path": "packs/a/logs/x.json",
|
|
532
|
+
"sha256": "5041bf1f713df204784353e82f6a4a535931cb64f1f4b4a5aeaffcb720918b22"
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"path": "packs/a/bundle.json",
|
|
536
|
+
"sha256": "c8baeb0866584358ddd0641bd598bb9b8b8880953b2a155cf62500b8c89a734c"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"path": "report/huge.bin",
|
|
540
|
+
"too_large": true
|
|
541
|
+
}
|
|
542
|
+
],
|
|
543
|
+
"expected": {
|
|
544
|
+
"index": "read",
|
|
545
|
+
"case_id": "case-4b19de",
|
|
546
|
+
"findings": [
|
|
547
|
+
{
|
|
548
|
+
"kind": "case_index_file_unlisted",
|
|
549
|
+
"path": "report/huge.bin"
|
|
550
|
+
}
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
},
|
|
468
554
|
{
|
|
469
555
|
"id": "no-index",
|
|
470
556
|
"why": "A folder with no contents.json is a folder of packs, with no finding.",
|