HSH Amends v1.5.1 — 5,645 records, signed manifest, coverage attestation, errata
Browse files- COVERAGE-ATTESTATION.json +132 -123
- COVERAGE-ATTESTATION.json.sig +1 -1
- MANIFEST.txt +0 -0
- MANIFEST.txt.sig +1 -1
- README.md +65 -36
- SAMPLE-COMPOSITION.json +65 -28
- SHA256SUMS +11 -10
- SHA256SUMS.sig +0 -0
- hsh-amends-sample-flat.csv +0 -0
- hsh-amends-sample.csv +0 -0
- hsh-amends-sample.parquet +2 -2
- reproduce_sample.py +119 -0
- verify_sample.py +264 -12
COVERAGE-ATTESTATION.json
CHANGED
|
@@ -2,165 +2,117 @@
|
|
| 2 |
"attestation": "HSH Intelligence \u2014 coverage and precision attestation",
|
| 3 |
"what_this_is": "The statements a SAMPLE CANNOT ESTABLISH, published separately and signed with the same key that signs TRUST-ROOTS.json. A subset proves nothing about its superset, so coverage, denominators and precision are attested here rather than implied by a sample.",
|
| 4 |
"what_the_interval_does_not_cover": "The intervals above are Wilson bounds on sampling error, given the denominator. Two things they do not describe. FIRST, records the verifier could not decide are excluded from the denominator rather than counted against it, so precision is measured over the records this instrument could read \u2014 the `sampled`, `confirmed`, `contradicted` and `inconclusive` counts are all published so you can recompute it either way. SECOND, an interval assumes the draw is fixed. Ours is: the sample is drawn deterministically and three consecutive runs of the instrument produced byte-identical verdicts on every stratum and every drawn record. Before 2026-09-17 that was not true, and figures published earlier are historical readings that cannot be re-derived.",
|
| 5 |
-
"release_id": "restatements-v1.5.
|
| 6 |
-
"as_of": "2026-09-
|
| 7 |
-
"released_at": "2026-09-
|
| 8 |
"records": 15326990,
|
| 9 |
"companies": 742056,
|
| 10 |
-
"manifest_sha": "
|
| 11 |
"licence": "public-domain-derived",
|
| 12 |
"instrument_version": "body-text-v1",
|
| 13 |
-
"audited_at": "2026-09-
|
| 14 |
"strata": [
|
| 15 |
-
{
|
| 16 |
-
"link_basis": "index:cik+form",
|
| 17 |
-
"base_form": "10-Q",
|
| 18 |
-
"population": 1377,
|
| 19 |
-
"frame_reachable": 0,
|
| 20 |
-
"frame_coverage_pct": 0.0,
|
| 21 |
-
"claim_type": "sampled",
|
| 22 |
-
"sampled": 300,
|
| 23 |
-
"required_sample": 0,
|
| 24 |
-
"confirmed": 59,
|
| 25 |
-
"contradicted": 102,
|
| 26 |
-
"inconclusive": 139,
|
| 27 |
-
"precision": 0.36646,
|
| 28 |
-
"interval": [
|
| 29 |
-
0.295949,
|
| 30 |
-
0.443194
|
| 31 |
-
],
|
| 32 |
-
"interval_note": "Wilson lower bound at the declared floor. It covers SAMPLING error on this denominator and nothing else \u2014 see what_the_interval_does_not_cover",
|
| 33 |
-
"floor": 0.95,
|
| 34 |
-
"verdict": "HOLD",
|
| 35 |
-
"measured_at": "2026-09-11 17:18:35",
|
| 36 |
-
"instrument_version": "body-text-v1",
|
| 37 |
-
"reading_type": "historical",
|
| 38 |
-
"historical_note": "Measured 2026-09-11 17:18:35 UTC, before the sampling draw was made deterministic on 2026-09-17. This figure is a HISTORICAL READING and cannot be re-derived: the links it describes were withdrawn and no longer sit in a state that asserts a link, so the audit no longer examines them. It is published because what was measured and withheld is evidence a buyer cannot obtain elsewhere."
|
| 39 |
-
},
|
| 40 |
-
{
|
| 41 |
-
"link_basis": "index:cik+form",
|
| 42 |
-
"base_form": "10-K",
|
| 43 |
-
"population": 1013,
|
| 44 |
-
"frame_reachable": 0,
|
| 45 |
-
"frame_coverage_pct": 0.0,
|
| 46 |
-
"claim_type": "sampled",
|
| 47 |
-
"sampled": 300,
|
| 48 |
-
"required_sample": 0,
|
| 49 |
-
"confirmed": 179,
|
| 50 |
-
"contradicted": 52,
|
| 51 |
-
"inconclusive": 69,
|
| 52 |
-
"precision": 0.774892,
|
| 53 |
-
"interval": [
|
| 54 |
-
0.716788,
|
| 55 |
-
0.824002
|
| 56 |
-
],
|
| 57 |
-
"interval_note": "Wilson lower bound at the declared floor. It covers SAMPLING error on this denominator and nothing else \u2014 see what_the_interval_does_not_cover",
|
| 58 |
-
"floor": 0.95,
|
| 59 |
-
"verdict": "HOLD",
|
| 60 |
-
"measured_at": "2026-09-11 17:18:35",
|
| 61 |
-
"instrument_version": "body-text-v1",
|
| 62 |
-
"reading_type": "historical",
|
| 63 |
-
"historical_note": "Measured 2026-09-11 17:18:35 UTC, before the sampling draw was made deterministic on 2026-09-17. This figure is a HISTORICAL READING and cannot be re-derived: the links it describes were withdrawn and no longer sit in a state that asserts a link, so the audit no longer examines them. It is published because what was measured and withheld is evidence a buyer cannot obtain elsewhere."
|
| 64 |
-
},
|
| 65 |
{
|
| 66 |
"link_basis": "index:cik+form+period",
|
| 67 |
"base_form": "10-K",
|
| 68 |
-
"population":
|
| 69 |
"frame_reachable": 19582,
|
| 70 |
-
"frame_coverage_pct":
|
|
|
|
| 71 |
"claim_type": "sampled",
|
| 72 |
"sampled": 300,
|
| 73 |
-
"required_sample":
|
| 74 |
"confirmed": 295,
|
| 75 |
"contradicted": 2,
|
| 76 |
"inconclusive": 3,
|
| 77 |
-
"precision": 0.
|
| 78 |
"interval": [
|
| 79 |
-
0.
|
| 80 |
-
0.
|
| 81 |
],
|
| 82 |
"interval_note": "Wilson lower bound at the declared floor. It covers SAMPLING error on this denominator and nothing else \u2014 see what_the_interval_does_not_cover",
|
| 83 |
"floor": 0.95,
|
| 84 |
"verdict": "SHIP",
|
| 85 |
-
"measured_at": "2026-09-17
|
| 86 |
"instrument_version": "body-text-v1",
|
| 87 |
"reading_type": "current"
|
| 88 |
},
|
| 89 |
{
|
| 90 |
"link_basis": "index:cik+form+period",
|
| 91 |
-
"base_form": "10-
|
| 92 |
-
"population":
|
| 93 |
-
"frame_reachable":
|
| 94 |
-
"frame_coverage_pct":
|
| 95 |
-
"
|
| 96 |
-
"
|
|
|
|
| 97 |
"required_sample": 73,
|
| 98 |
-
"confirmed":
|
| 99 |
-
"contradicted":
|
| 100 |
-
"inconclusive":
|
| 101 |
-
"precision":
|
| 102 |
-
"interval":
|
| 103 |
-
|
| 104 |
-
1.0
|
| 105 |
-
],
|
| 106 |
-
"interval_note": "Wilson lower bound at the declared floor. It covers SAMPLING error on this denominator and nothing else \u2014 see what_the_interval_does_not_cover",
|
| 107 |
"floor": 0.95,
|
| 108 |
"verdict": "SHIP",
|
| 109 |
-
"measured_at": "2026-09-17
|
| 110 |
"instrument_version": "body-text-v1",
|
| 111 |
"reading_type": "current"
|
| 112 |
},
|
| 113 |
{
|
| 114 |
"link_basis": "index:cik+form+period",
|
| 115 |
-
"base_form": "
|
| 116 |
-
"population":
|
| 117 |
-
"frame_reachable":
|
| 118 |
-
"frame_coverage_pct":
|
|
|
|
| 119 |
"claim_type": "sampled",
|
| 120 |
"sampled": 300,
|
| 121 |
-
"required_sample":
|
| 122 |
-
"confirmed":
|
| 123 |
"contradicted": 0,
|
| 124 |
-
"inconclusive":
|
| 125 |
"precision": 1.0,
|
| 126 |
"interval": [
|
| 127 |
-
0.
|
| 128 |
1.0
|
| 129 |
],
|
| 130 |
"interval_note": "Wilson lower bound at the declared floor. It covers SAMPLING error on this denominator and nothing else \u2014 see what_the_interval_does_not_cover",
|
| 131 |
"floor": 0.95,
|
| 132 |
"verdict": "SHIP",
|
| 133 |
-
"measured_at": "2026-09-17
|
| 134 |
"instrument_version": "body-text-v1",
|
| 135 |
"reading_type": "current"
|
| 136 |
},
|
| 137 |
{
|
| 138 |
"link_basis": "index:cik+form+period",
|
| 139 |
-
"base_form": "
|
| 140 |
-
"population":
|
| 141 |
-
"frame_reachable":
|
| 142 |
-
"frame_coverage_pct":
|
|
|
|
| 143 |
"claim_type": "census",
|
| 144 |
-
"sampled":
|
| 145 |
"required_sample": 73,
|
| 146 |
-
"confirmed":
|
| 147 |
"contradicted": 0,
|
| 148 |
-
"inconclusive":
|
| 149 |
"precision": 1.0,
|
| 150 |
"interval": null,
|
| 151 |
"interval_note": "degenerate \u2014 every member examined, so there is no sampling risk and no interval is quoted",
|
| 152 |
"floor": 0.95,
|
| 153 |
"verdict": "SHIP",
|
| 154 |
-
"measured_at": "2026-09-17
|
| 155 |
"instrument_version": "body-text-v1",
|
| 156 |
"reading_type": "current"
|
| 157 |
},
|
| 158 |
{
|
| 159 |
"link_basis": "index:cik+form+period",
|
| 160 |
"base_form": "11-K",
|
| 161 |
-
"population":
|
| 162 |
"frame_reachable": 233,
|
| 163 |
-
"frame_coverage_pct":
|
|
|
|
| 164 |
"claim_type": "census",
|
| 165 |
"sampled": 233,
|
| 166 |
"required_sample": 73,
|
|
@@ -172,51 +124,108 @@
|
|
| 172 |
"interval_note": "degenerate \u2014 every member examined, so there is no sampling risk and no interval is quoted",
|
| 173 |
"floor": 0.95,
|
| 174 |
"verdict": "SHIP",
|
| 175 |
-
"measured_at": "2026-09-17
|
| 176 |
"instrument_version": "body-text-v1",
|
| 177 |
"reading_type": "current"
|
| 178 |
},
|
| 179 |
{
|
| 180 |
"link_basis": "index:cik+form+period",
|
| 181 |
-
"base_form": "
|
| 182 |
-
"population":
|
| 183 |
-
"frame_reachable":
|
| 184 |
-
"frame_coverage_pct":
|
| 185 |
-
"
|
| 186 |
-
"
|
| 187 |
-
"
|
| 188 |
-
"
|
| 189 |
-
"
|
| 190 |
-
"
|
| 191 |
-
"
|
| 192 |
-
"
|
| 193 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
"floor": 0.95,
|
| 195 |
"verdict": "SHIP",
|
| 196 |
-
"measured_at": "2026-09-17
|
| 197 |
"instrument_version": "body-text-v1",
|
| 198 |
"reading_type": "current"
|
| 199 |
},
|
| 200 |
{
|
| 201 |
"link_basis": "index:cik+form+period",
|
| 202 |
-
"base_form": "
|
| 203 |
-
"population":
|
| 204 |
-
"frame_reachable":
|
| 205 |
-
"frame_coverage_pct":
|
|
|
|
| 206 |
"claim_type": "census",
|
| 207 |
-
"sampled":
|
| 208 |
"required_sample": 73,
|
| 209 |
-
"confirmed":
|
| 210 |
"contradicted": 0,
|
| 211 |
-
"inconclusive":
|
| 212 |
"precision": 1.0,
|
| 213 |
"interval": null,
|
| 214 |
"interval_note": "degenerate \u2014 every member examined, so there is no sampling risk and no interval is quoted",
|
| 215 |
"floor": 0.95,
|
| 216 |
"verdict": "SHIP",
|
| 217 |
-
"measured_at": "2026-09-17
|
| 218 |
"instrument_version": "body-text-v1",
|
| 219 |
"reading_type": "current"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 220 |
}
|
| 221 |
],
|
| 222 |
"how_to_read_this": {
|
|
@@ -229,13 +238,13 @@
|
|
| 229 |
"key_fingerprint_sha256": "e423f1714f11200592c98939233fde02aaf30ef8946f1c796f484d4c124c6ee8",
|
| 230 |
"key_fingerprint_is_published_at": "the HSH transparency repository, which is append-only and independent of whichever host served you this file"
|
| 231 |
},
|
| 232 |
-
"generated_at": "2026-09-
|
| 233 |
"_state_pop": {
|
| 234 |
"not_an_amendment": "13,864,746",
|
| 235 |
"unknown_subject": "1,417,391",
|
| 236 |
-
"linked": "40,
|
| 237 |
"unresolved_prior_exists": "2,608",
|
| 238 |
"no_prior_filing_in_corpus": "1,273",
|
| 239 |
-
"unverifiable_at_release": "
|
| 240 |
}
|
| 241 |
}
|
|
|
|
| 2 |
"attestation": "HSH Intelligence \u2014 coverage and precision attestation",
|
| 3 |
"what_this_is": "The statements a SAMPLE CANNOT ESTABLISH, published separately and signed with the same key that signs TRUST-ROOTS.json. A subset proves nothing about its superset, so coverage, denominators and precision are attested here rather than implied by a sample.",
|
| 4 |
"what_the_interval_does_not_cover": "The intervals above are Wilson bounds on sampling error, given the denominator. Two things they do not describe. FIRST, records the verifier could not decide are excluded from the denominator rather than counted against it, so precision is measured over the records this instrument could read \u2014 the `sampled`, `confirmed`, `contradicted` and `inconclusive` counts are all published so you can recompute it either way. SECOND, an interval assumes the draw is fixed. Ours is: the sample is drawn deterministically and three consecutive runs of the instrument produced byte-identical verdicts on every stratum and every drawn record. Before 2026-09-17 that was not true, and figures published earlier are historical readings that cannot be re-derived.",
|
| 5 |
+
"release_id": "restatements-v1.5.1",
|
| 6 |
+
"as_of": "2026-09-17 15:29:36",
|
| 7 |
+
"released_at": "2026-09-17 17:21:53",
|
| 8 |
"records": 15326990,
|
| 9 |
"companies": 742056,
|
| 10 |
+
"manifest_sha": "416d8205acd45fa22b35c2f8328880b0999dbf1312a727fcc9db3a4a53f7ee27",
|
| 11 |
"licence": "public-domain-derived",
|
| 12 |
"instrument_version": "body-text-v1",
|
| 13 |
+
"audited_at": "2026-09-17 15:37:49",
|
| 14 |
"strata": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
{
|
| 16 |
"link_basis": "index:cik+form+period",
|
| 17 |
"base_form": "10-K",
|
| 18 |
+
"population": 19582,
|
| 19 |
"frame_reachable": 19582,
|
| 20 |
+
"frame_coverage_pct": null,
|
| 21 |
+
"frame_coverage_note": "This release's bound accuracy line does not state the reachable frame separately from the population, so no coverage percentage is published for it. `population` is the denominator this release bound and `frame reachable` repeats it; they are not independent measurements here. Releases cut after 2026-09-17 bind `reach=` and report this figure.",
|
| 22 |
"claim_type": "sampled",
|
| 23 |
"sampled": 300,
|
| 24 |
+
"required_sample": null,
|
| 25 |
"confirmed": 295,
|
| 26 |
"contradicted": 2,
|
| 27 |
"inconclusive": 3,
|
| 28 |
+
"precision": 0.9933,
|
| 29 |
"interval": [
|
| 30 |
+
0.9758,
|
| 31 |
+
0.9982
|
| 32 |
],
|
| 33 |
"interval_note": "Wilson lower bound at the declared floor. It covers SAMPLING error on this denominator and nothing else \u2014 see what_the_interval_does_not_cover",
|
| 34 |
"floor": 0.95,
|
| 35 |
"verdict": "SHIP",
|
| 36 |
+
"measured_at": "2026-09-17 15:37:49",
|
| 37 |
"instrument_version": "body-text-v1",
|
| 38 |
"reading_type": "current"
|
| 39 |
},
|
| 40 |
{
|
| 41 |
"link_basis": "index:cik+form+period",
|
| 42 |
+
"base_form": "10-KT",
|
| 43 |
+
"population": 72,
|
| 44 |
+
"frame_reachable": 72,
|
| 45 |
+
"frame_coverage_pct": null,
|
| 46 |
+
"frame_coverage_note": "This release's bound accuracy line does not state the reachable frame separately from the population, so no coverage percentage is published for it. `population` is the denominator this release bound and `frame reachable` repeats it; they are not independent measurements here. Releases cut after 2026-09-17 bind `reach=` and report this figure.",
|
| 47 |
+
"claim_type": "census",
|
| 48 |
+
"sampled": 72,
|
| 49 |
"required_sample": 73,
|
| 50 |
+
"confirmed": 65,
|
| 51 |
+
"contradicted": 1,
|
| 52 |
+
"inconclusive": 6,
|
| 53 |
+
"precision": 0.9848,
|
| 54 |
+
"interval": null,
|
| 55 |
+
"interval_note": "degenerate \u2014 every member examined, so there is no sampling risk and no interval is quoted",
|
|
|
|
|
|
|
|
|
|
| 56 |
"floor": 0.95,
|
| 57 |
"verdict": "SHIP",
|
| 58 |
+
"measured_at": "2026-09-17 15:37:49",
|
| 59 |
"instrument_version": "body-text-v1",
|
| 60 |
"reading_type": "current"
|
| 61 |
},
|
| 62 |
{
|
| 63 |
"link_basis": "index:cik+form+period",
|
| 64 |
+
"base_form": "10-Q",
|
| 65 |
+
"population": 18086,
|
| 66 |
+
"frame_reachable": 18086,
|
| 67 |
+
"frame_coverage_pct": null,
|
| 68 |
+
"frame_coverage_note": "This release's bound accuracy line does not state the reachable frame separately from the population, so no coverage percentage is published for it. `population` is the denominator this release bound and `frame reachable` repeats it; they are not independent measurements here. Releases cut after 2026-09-17 bind `reach=` and report this figure.",
|
| 69 |
"claim_type": "sampled",
|
| 70 |
"sampled": 300,
|
| 71 |
+
"required_sample": null,
|
| 72 |
+
"confirmed": 295,
|
| 73 |
"contradicted": 0,
|
| 74 |
+
"inconclusive": 5,
|
| 75 |
"precision": 1.0,
|
| 76 |
"interval": [
|
| 77 |
+
0.9871,
|
| 78 |
1.0
|
| 79 |
],
|
| 80 |
"interval_note": "Wilson lower bound at the declared floor. It covers SAMPLING error on this denominator and nothing else \u2014 see what_the_interval_does_not_cover",
|
| 81 |
"floor": 0.95,
|
| 82 |
"verdict": "SHIP",
|
| 83 |
+
"measured_at": "2026-09-17 15:37:49",
|
| 84 |
"instrument_version": "body-text-v1",
|
| 85 |
"reading_type": "current"
|
| 86 |
},
|
| 87 |
{
|
| 88 |
"link_basis": "index:cik+form+period",
|
| 89 |
+
"base_form": "10-QT",
|
| 90 |
+
"population": 9,
|
| 91 |
+
"frame_reachable": 9,
|
| 92 |
+
"frame_coverage_pct": null,
|
| 93 |
+
"frame_coverage_note": "This release's bound accuracy line does not state the reachable frame separately from the population, so no coverage percentage is published for it. `population` is the denominator this release bound and `frame reachable` repeats it; they are not independent measurements here. Releases cut after 2026-09-17 bind `reach=` and report this figure.",
|
| 94 |
"claim_type": "census",
|
| 95 |
+
"sampled": 9,
|
| 96 |
"required_sample": 73,
|
| 97 |
+
"confirmed": 8,
|
| 98 |
"contradicted": 0,
|
| 99 |
+
"inconclusive": 1,
|
| 100 |
"precision": 1.0,
|
| 101 |
"interval": null,
|
| 102 |
"interval_note": "degenerate \u2014 every member examined, so there is no sampling risk and no interval is quoted",
|
| 103 |
"floor": 0.95,
|
| 104 |
"verdict": "SHIP",
|
| 105 |
+
"measured_at": "2026-09-17 15:37:49",
|
| 106 |
"instrument_version": "body-text-v1",
|
| 107 |
"reading_type": "current"
|
| 108 |
},
|
| 109 |
{
|
| 110 |
"link_basis": "index:cik+form+period",
|
| 111 |
"base_form": "11-K",
|
| 112 |
+
"population": 233,
|
| 113 |
"frame_reachable": 233,
|
| 114 |
+
"frame_coverage_pct": null,
|
| 115 |
+
"frame_coverage_note": "This release's bound accuracy line does not state the reachable frame separately from the population, so no coverage percentage is published for it. `population` is the denominator this release bound and `frame reachable` repeats it; they are not independent measurements here. Releases cut after 2026-09-17 bind `reach=` and report this figure.",
|
| 116 |
"claim_type": "census",
|
| 117 |
"sampled": 233,
|
| 118 |
"required_sample": 73,
|
|
|
|
| 124 |
"interval_note": "degenerate \u2014 every member examined, so there is no sampling risk and no interval is quoted",
|
| 125 |
"floor": 0.95,
|
| 126 |
"verdict": "SHIP",
|
| 127 |
+
"measured_at": "2026-09-17 15:37:49",
|
| 128 |
"instrument_version": "body-text-v1",
|
| 129 |
"reading_type": "current"
|
| 130 |
},
|
| 131 |
{
|
| 132 |
"link_basis": "index:cik+form+period",
|
| 133 |
+
"base_form": "20-F",
|
| 134 |
+
"population": 2112,
|
| 135 |
+
"frame_reachable": 2112,
|
| 136 |
+
"frame_coverage_pct": null,
|
| 137 |
+
"frame_coverage_note": "This release's bound accuracy line does not state the reachable frame separately from the population, so no coverage percentage is published for it. `population` is the denominator this release bound and `frame reachable` repeats it; they are not independent measurements here. Releases cut after 2026-09-17 bind `reach=` and report this figure.",
|
| 138 |
+
"claim_type": "sampled",
|
| 139 |
+
"sampled": 300,
|
| 140 |
+
"required_sample": null,
|
| 141 |
+
"confirmed": 279,
|
| 142 |
+
"contradicted": 0,
|
| 143 |
+
"inconclusive": 21,
|
| 144 |
+
"precision": 1.0,
|
| 145 |
+
"interval": [
|
| 146 |
+
0.9864,
|
| 147 |
+
1.0
|
| 148 |
+
],
|
| 149 |
+
"interval_note": "Wilson lower bound at the declared floor. It covers SAMPLING error on this denominator and nothing else \u2014 see what_the_interval_does_not_cover",
|
| 150 |
"floor": 0.95,
|
| 151 |
"verdict": "SHIP",
|
| 152 |
+
"measured_at": "2026-09-17 15:37:49",
|
| 153 |
"instrument_version": "body-text-v1",
|
| 154 |
"reading_type": "current"
|
| 155 |
},
|
| 156 |
{
|
| 157 |
"link_basis": "index:cik+form+period",
|
| 158 |
+
"base_form": "40-F",
|
| 159 |
+
"population": 290,
|
| 160 |
+
"frame_reachable": 290,
|
| 161 |
+
"frame_coverage_pct": null,
|
| 162 |
+
"frame_coverage_note": "This release's bound accuracy line does not state the reachable frame separately from the population, so no coverage percentage is published for it. `population` is the denominator this release bound and `frame reachable` repeats it; they are not independent measurements here. Releases cut after 2026-09-17 bind `reach=` and report this figure.",
|
| 163 |
"claim_type": "census",
|
| 164 |
+
"sampled": 290,
|
| 165 |
"required_sample": 73,
|
| 166 |
+
"confirmed": 282,
|
| 167 |
"contradicted": 0,
|
| 168 |
+
"inconclusive": 8,
|
| 169 |
"precision": 1.0,
|
| 170 |
"interval": null,
|
| 171 |
"interval_note": "degenerate \u2014 every member examined, so there is no sampling risk and no interval is quoted",
|
| 172 |
"floor": 0.95,
|
| 173 |
"verdict": "SHIP",
|
| 174 |
+
"measured_at": "2026-09-17 15:37:49",
|
| 175 |
"instrument_version": "body-text-v1",
|
| 176 |
"reading_type": "current"
|
| 177 |
+
},
|
| 178 |
+
{
|
| 179 |
+
"link_basis": "index:cik+form",
|
| 180 |
+
"base_form": "10-Q",
|
| 181 |
+
"population": 1377,
|
| 182 |
+
"frame_reachable": null,
|
| 183 |
+
"frame_coverage_pct": null,
|
| 184 |
+
"frame_coverage_note": "This release's bound accuracy line does not state the reachable frame separately from the population, so no coverage percentage is published for it. `population` is the denominator this release bound and `frame reachable` repeats it; they are not independent measurements here. Releases cut after 2026-09-17 bind `reach=` and report this figure.",
|
| 185 |
+
"claim_type": "sampled",
|
| 186 |
+
"sampled": 300,
|
| 187 |
+
"required_sample": null,
|
| 188 |
+
"confirmed": 59,
|
| 189 |
+
"contradicted": 102,
|
| 190 |
+
"inconclusive": 139,
|
| 191 |
+
"precision": 0.36646,
|
| 192 |
+
"interval": [
|
| 193 |
+
0.295949,
|
| 194 |
+
0.443194
|
| 195 |
+
],
|
| 196 |
+
"interval_note": "Wilson lower bound at the declared floor. It covers SAMPLING error on this denominator and nothing else \u2014 see what_the_interval_does_not_cover",
|
| 197 |
+
"floor": 0.95,
|
| 198 |
+
"verdict": "HOLD",
|
| 199 |
+
"measured_at": "2026-09-11 17:18:35",
|
| 200 |
+
"instrument_version": "body-text-v1",
|
| 201 |
+
"reading_type": "historical",
|
| 202 |
+
"historical_note": "Measured 2026-09-11 17:18:35 UTC, before the sampling draw was made deterministic on 2026-09-17. This figure is a HISTORICAL READING and cannot be re-derived: the links it describes were withdrawn and no longer sit in a state that asserts a link, so the audit no longer examines them. It is published because what was measured and withheld is evidence a buyer cannot obtain elsewhere."
|
| 203 |
+
},
|
| 204 |
+
{
|
| 205 |
+
"link_basis": "index:cik+form",
|
| 206 |
+
"base_form": "10-K",
|
| 207 |
+
"population": 1013,
|
| 208 |
+
"frame_reachable": null,
|
| 209 |
+
"frame_coverage_pct": null,
|
| 210 |
+
"frame_coverage_note": "This release's bound accuracy line does not state the reachable frame separately from the population, so no coverage percentage is published for it. `population` is the denominator this release bound and `frame reachable` repeats it; they are not independent measurements here. Releases cut after 2026-09-17 bind `reach=` and report this figure.",
|
| 211 |
+
"claim_type": "sampled",
|
| 212 |
+
"sampled": 300,
|
| 213 |
+
"required_sample": null,
|
| 214 |
+
"confirmed": 179,
|
| 215 |
+
"contradicted": 52,
|
| 216 |
+
"inconclusive": 69,
|
| 217 |
+
"precision": 0.774892,
|
| 218 |
+
"interval": [
|
| 219 |
+
0.716788,
|
| 220 |
+
0.824002
|
| 221 |
+
],
|
| 222 |
+
"interval_note": "Wilson lower bound at the declared floor. It covers SAMPLING error on this denominator and nothing else \u2014 see what_the_interval_does_not_cover",
|
| 223 |
+
"floor": 0.95,
|
| 224 |
+
"verdict": "HOLD",
|
| 225 |
+
"measured_at": "2026-09-11 17:18:35",
|
| 226 |
+
"instrument_version": "body-text-v1",
|
| 227 |
+
"reading_type": "historical",
|
| 228 |
+
"historical_note": "Measured 2026-09-11 17:18:35 UTC, before the sampling draw was made deterministic on 2026-09-17. This figure is a HISTORICAL READING and cannot be re-derived: the links it describes were withdrawn and no longer sit in a state that asserts a link, so the audit no longer examines them. It is published because what was measured and withheld is evidence a buyer cannot obtain elsewhere."
|
| 229 |
}
|
| 230 |
],
|
| 231 |
"how_to_read_this": {
|
|
|
|
| 238 |
"key_fingerprint_sha256": "e423f1714f11200592c98939233fde02aaf30ef8946f1c796f484d4c124c6ee8",
|
| 239 |
"key_fingerprint_is_published_at": "the HSH transparency repository, which is append-only and independent of whichever host served you this file"
|
| 240 |
},
|
| 241 |
+
"generated_at": "2026-09-18T09:40:29Z",
|
| 242 |
"_state_pop": {
|
| 243 |
"not_an_amendment": "13,864,746",
|
| 244 |
"unknown_subject": "1,417,391",
|
| 245 |
+
"linked": "40,384",
|
| 246 |
"unresolved_prior_exists": "2,608",
|
| 247 |
"no_prior_filing_in_corpus": "1,273",
|
| 248 |
+
"unverifiable_at_release": "588"
|
| 249 |
}
|
| 250 |
}
|
COVERAGE-ATTESTATION.json.sig
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
�����Jf�D��.7��:Wd��nek���q���(�T�=e>L�����%��S�Īw�ŜSG
|
MANIFEST.txt
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
MANIFEST.txt.sig
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
����
|
|
|
|
| 1 |
+
�2R�Paמ�;��T[��1�UA&D]w�`>�XBMpĺ��.<۸�'h5����~��I��
|
README.md
CHANGED
|
@@ -21,7 +21,7 @@ configs:
|
|
| 21 |
|
| 22 |
# HSH Amends — evaluation sample
|
| 23 |
|
| 24 |
-
**5,
|
| 25 |
|
| 26 |
> **This is a sample of a paid product.** It is published so a data team can evaluate the real thing — the real schema, the real values, the real verification chain — before any conversation about licensing. It is not open data and it is not a free tier. Licence terms are below.
|
| 27 |
|
|
@@ -31,7 +31,7 @@ configs:
|
|
| 31 |
|---|---|
|
| 32 |
| **Run the checks** | [Colab notebook](https://colab.research.google.com/github/hshintelligence/hsh-transparency/blob/main/amends/notebook/hsh-amends-verify-and-explore.ipynb) — verifies this sample against a second host, then explores it |
|
| 33 |
| **Trust anchor** | [hshintelligence/hsh-transparency](https://github.com/hshintelligence/hsh-transparency/tree/main/amends) — the signing key, its fingerprint, and the signed record of every release |
|
| 34 |
-
| **Documentation** | [Open the folder](https://drive.google.com/drive/folders/1c3qzgAFHef1lyTfRYQi5gpqIHXbCyhAn?usp=sharing) — the data dictionary, release history, schema stability note,
|
| 35 |
| **Who we are** | [hshintelligence.com](https://hshintelligence.com) |
|
| 36 |
| **Licensing** | [info@healingsunhaven.com](mailto:info@healingsunhaven.com) |
|
| 37 |
|
|
@@ -60,11 +60,12 @@ A precision figure with no denominator is a claim. One with its population, its
|
|
| 60 |
| Filings | 10,848,021 distinct accession numbers |
|
| 61 |
| Companies | 742,056 distinct CIKs |
|
| 62 |
| Date range | 2009-01-02 to 2026-08-28 |
|
| 63 |
-
| Format | Apache Parquet, 3
|
| 64 |
| Size | 1.2 GB |
|
| 65 |
-
| Release | `restatements-v1.5.
|
| 66 |
-
| Cadence |
|
| 67 |
-
|
|
|
|
|
| 68 |
|
| 69 |
## What the dataset is
|
| 70 |
|
|
@@ -78,17 +79,24 @@ An amendment index over SEC EDGAR at filing grain: one row per (filer, filing).
|
|
| 78 |
python3 verify_sample.py .
|
| 79 |
```
|
| 80 |
|
| 81 |
-
|
| 82 |
|
| 83 |
1. files against the manifest header
|
| 84 |
2. every record's payload against its payload_sha
|
| 85 |
3. the manifest signature
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
The key fingerprint is published in the [HSH transparency repository](https://github.com/hshintelligence/hsh-transparency/tree/main/amends) — a different host, append-only. Fetch the key from there rather than from here, and the two would have to collude to fool you. That is the whole design: **where you fetch from and where you anchor trust are different questions.**
|
| 88 |
|
| 89 |
A Colab notebook does all of it in order — verification first, data second: [open the notebook](https://colab.research.google.com/github/hshintelligence/hsh-transparency/blob/main/amends/notebook/hsh-amends-verify-and-explore.ipynb).
|
| 90 |
|
| 91 |
-
**The notebook is a convenience, and it is worth saying what that means.** It runs the same checks you would run by hand, but it is also the thing telling you they passed. A reader who wants certainty
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
What the two hosts DO protect is the data. If the dataset host served you an altered sample, the key and fingerprint published independently would not match it, and you would catch it. That is the claim, and it holds.
|
| 94 |
|
|
@@ -104,7 +112,7 @@ What the two hosts DO protect is the data. If the dataset host served you an alt
|
|
| 104 |
| `split` | `VARCHAR` | Machine-learning split assignment: train, validation or test |
|
| 105 |
| `payload` | `VARCHAR` | The amendment verdict for this filing, as a JSON object. Every analytical field lives here — see the payload table below |
|
| 106 |
| `payload_sha` | `VARCHAR` | SHA-256 of the `payload` string exactly as shipped. The other half of the verification pair |
|
| 107 |
-
| `tokens` | `BIGINT` |
|
| 108 |
| `cik` | `VARCHAR` | SEC's Central Index Key for the filer, unpadded |
|
| 109 |
| `cik10` | `VARCHAR` | The same CIK zero-padded to ten characters — SEC's own conventional form |
|
| 110 |
| `accession` | `VARCHAR` | SEC's accession number for the filing, canonical (digits only, no dashes). With `cik` it identifies a filing uniquely |
|
|
@@ -120,7 +128,7 @@ What the two hosts DO protect is the data. If the dataset host served you an alt
|
|
| 120 |
|
| 121 |
`payload` is a JSON object holding the analytical fields — `link_state`, `amends_accession`, `link_basis`, `link_confidence`, `version_seq`, `is_latest`, `period` and the rest. The flat CSV in this package explodes them into columns as a convenience; the Parquet schema above is the product.
|
| 122 |
|
| 123 |
-
**Full data dictionary — every column, every payload field, measured null rates and the caveats attached to each — is
|
| 124 |
|
| 125 |
## The audit, and why it is not a QA table
|
| 126 |
|
|
@@ -141,7 +149,7 @@ Two things make this different from a vendor's QA summary.
|
|
| 141 |
|
| 142 |
**It ran against the shipped Parquet**, not against the tables the Parquet was built from. A check that passes on the source and is never re-run on the artefact says nothing about the file you receive.
|
| 143 |
|
| 144 |
-
**
|
| 145 |
|
| 146 |
## Usage
|
| 147 |
|
|
@@ -192,7 +200,7 @@ print(f' period {a.period}')
|
|
| 192 |
print(f' linked by {a.basis}')
|
| 193 |
```
|
| 194 |
|
| 195 |
-
**
|
| 196 |
|
| 197 |
**Verify it.**
|
| 198 |
|
|
@@ -206,17 +214,21 @@ A subset establishes nothing about its superset. Coverage, denominators and reca
|
|
| 206 |
|
| 207 |
You can therefore check our coverage claims without us handing over the data they describe.
|
| 208 |
|
| 209 |
-
| stratum | population | frame reachable | precision | claim type |
|
| 210 |
-
|---|---:|---:|---:|---|
|
| 211 |
-
| `10-K` | 19,
|
| 212 |
-
| `10-
|
| 213 |
-
| `
|
| 214 |
-
| `
|
| 215 |
-
| `11-K` |
|
| 216 |
-
| `
|
| 217 |
-
| `
|
|
|
|
|
|
|
| 218 |
|
| 219 |
-
|
|
|
|
|
|
|
| 220 |
|
| 221 |
### What we withdrew
|
| 222 |
|
|
@@ -231,28 +243,43 @@ These are **historical readings**, and the date matters. They were measured befo
|
|
| 231 |
|
| 232 |
## What is in the sample, and how it was sized
|
| 233 |
|
| 234 |
-
**5,
|
| 235 |
|
| 236 |
The rule is: **stratified deterministic draw, census strata complete, every other stratum floored to a minimum evaluable mass, every link state represented.**
|
| 237 |
|
| 238 |
-
**The unit is the chain within a stratum, not the row.** Your smallest natural filter is a stratum — *show me 40-F/A* — and a sample becomes a screenshot the moment that filter returns too few chains to judge. So each stratum is drawn to whichever is largest of its target, the N that yields 150 units, and the N at which **every year present in that stratum has appeared**. Ordering is `md5(record_uid)` throughout and the draw is only ever extended, never hand-picked
|
|
|
|
|
|
|
| 239 |
|
| 240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
|
| 242 |
| stratum | rows | chains | years covered |
|
| 243 |
|---|---:|---:|---:|
|
| 244 |
| 10-KT (complete) | 459 | 56 | 18 of 18 |
|
| 245 |
| 10-QT (complete) | 96 | 9 | 17 of 17 |
|
| 246 |
-
| unverifiable_at_release (complete) |
|
| 247 |
| no_prior_filing_in_corpus | 689 | no links | 18 of 18 |
|
| 248 |
| unresolved_prior_exists | 250 | no links | 18 of 18 |
|
| 249 |
| 10-K linked | 350 | 350 | 18 of 18 |
|
| 250 |
| 10-Q linked | 350 | 350 | 18 of 18 |
|
| 251 |
-
| 20-F linked | 350 |
|
| 252 |
-
| 40-F linked |
|
| 253 |
-
| 11-K linked (complete) |
|
| 254 |
| unknown_subject | 900 | no links | 18 of 18 |
|
| 255 |
| not_an_amendment | 1,100 | no links | 18 of 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
|
| 257 |
Every stratum covers every year its population covers. That is the half of the rule a row count cannot show, so it is measured here rather than asserted.
|
| 258 |
|
|
@@ -260,16 +287,16 @@ It is **not a random sample** — rare states are over-represented on purpose, s
|
|
| 260 |
|
| 261 |
| link_state | in sample | in the full dataset |
|
| 262 |
|---|---:|---:|
|
| 263 |
-
| `linked` | 1,
|
| 264 |
| `not_an_amendment` | 1,556 | 13,864,746 |
|
| 265 |
| `unknown_subject` | 900 | 1,417,391 |
|
| 266 |
| `no_prior_filing_in_corpus` | 695 | 1,273 |
|
|
|
|
| 267 |
| `unresolved_prior_exists` | 252 | 2,608 |
|
| 268 |
-
| `unverifiable_at_release` | 4 | 4 |
|
| 269 |
|
| 270 |
-
**
|
| 271 |
|
| 272 |
-
That is a different property from the **4 strata the coverage attestation reports as a census** (`
|
| 273 |
|
| 274 |
## Files
|
| 275 |
|
|
@@ -282,12 +309,14 @@ That is a different property from the **4 strata the coverage attestation report
|
|
| 282 |
| `MANIFEST.txt.sig` | ed25519 signature over the manifest |
|
| 283 |
| `COVERAGE-ATTESTATION.json` | the corpus-level claims, signed |
|
| 284 |
| `HSH-SIGNING-KEY.pub` | the public key |
|
| 285 |
-
| `verify_sample.py` | the
|
|
|
|
|
|
|
| 286 |
|
| 287 |
## Licence and terms
|
| 288 |
|
| 289 |
-
This sample is provided for **evaluation**. It is not redistributable and confers no rights to the full dataset.
|
| 290 |
|
| 291 |
**Contact:** info@healingsunhaven.com
|
| 292 |
|
| 293 |
-
*Sample of `restatements-v1.5.
|
|
|
|
| 21 |
|
| 22 |
# HSH Amends — evaluation sample
|
| 23 |
|
| 24 |
+
**5,645 rows drawn from a 15,326,990-row commercial dataset.** Signed, and verifiable in about two minutes without contacting us.
|
| 25 |
|
| 26 |
> **This is a sample of a paid product.** It is published so a data team can evaluate the real thing — the real schema, the real values, the real verification chain — before any conversation about licensing. It is not open data and it is not a free tier. Licence terms are below.
|
| 27 |
|
|
|
|
| 31 |
|---|---|
|
| 32 |
| **Run the checks** | [Colab notebook](https://colab.research.google.com/github/hshintelligence/hsh-transparency/blob/main/amends/notebook/hsh-amends-verify-and-explore.ipynb) — verifies this sample against a second host, then explores it |
|
| 33 |
| **Trust anchor** | [hshintelligence/hsh-transparency](https://github.com/hshintelligence/hsh-transparency/tree/main/amends) — the signing key, its fingerprint, and the signed record of every release |
|
| 34 |
+
| **Documentation** | [Open the folder](https://drive.google.com/drive/folders/1c3qzgAFHef1lyTfRYQi5gpqIHXbCyhAn?usp=sharing) — the datasheet, data dictionary, audit report, release history, schema stability note, product due diligence questionnaire, corrections policy, legal one-pager and errata & release history |
|
| 35 |
| **Who we are** | [hshintelligence.com](https://hshintelligence.com) |
|
| 36 |
| **Licensing** | [info@healingsunhaven.com](mailto:info@healingsunhaven.com) |
|
| 37 |
|
|
|
|
| 60 |
| Filings | 10,848,021 distinct accession numbers |
|
| 61 |
| Companies | 742,056 distinct CIKs |
|
| 62 |
| Date range | 2009-01-02 to 2026-08-28 |
|
| 63 |
+
| Format | Apache Parquet, 3 parts |
|
| 64 |
| Size | 1.2 GB |
|
| 65 |
+
| Release | `restatements-v1.5.1` (as-of watermark 2026-09-17) |
|
| 66 |
+
| Cadence, observed | **7 releases between 2026-09-10 and 2026-09-17** — 7 days |
|
| 67 |
+
| Cadence, committed | Stated in the commercial terms, not here. This page reports what has been published; what will be published on what schedule is a contractual commitment and is made there. |
|
| 68 |
+
| This sample | 5,645 rows, published free for evaluation |
|
| 69 |
|
| 70 |
## What the dataset is
|
| 71 |
|
|
|
|
| 79 |
python3 verify_sample.py .
|
| 80 |
```
|
| 81 |
|
| 82 |
+
Six checks, and what each of them asks differs. Most compare the files you hold against what the signed manifest binds, and apply to the full product exactly as they do here. One is this directory's own seal, which the full product does not have. One compares the parquet's rows with the CSV's, because they are different files and only the first is what `load_dataset()` returns. And check 5 is the signing key against a host that did not serve you the sample:
|
| 83 |
|
| 84 |
1. files against the manifest header
|
| 85 |
2. every record's payload against its payload_sha
|
| 86 |
3. the manifest signature
|
| 87 |
+
4. SHA256SUMS against this directory, and its signature
|
| 88 |
+
5. the key against the fingerprint the ANCHOR publishes
|
| 89 |
+
6. the parquet's rows, which is what load_dataset() returns
|
| 90 |
|
| 91 |
The key fingerprint is published in the [HSH transparency repository](https://github.com/hshintelligence/hsh-transparency/tree/main/amends) — a different host, append-only. Fetch the key from there rather than from here, and the two would have to collude to fool you. That is the whole design: **where you fetch from and where you anchor trust are different questions.**
|
| 92 |
|
| 93 |
A Colab notebook does all of it in order — verification first, data second: [open the notebook](https://colab.research.google.com/github/hshintelligence/hsh-transparency/blob/main/amends/notebook/hsh-amends-verify-and-explore.ipynb).
|
| 94 |
|
| 95 |
+
**The notebook is a convenience, and it is worth saying what that means.** It runs the same checks you would run by hand, but it is also the thing telling you they passed. A reader who wants certainty runs them against the two hosts themselves.
|
| 96 |
+
|
| 97 |
+
`verify_sample.py` does five of the six from the files alone — files against the manifest header; every record's payload against its payload_sha; the manifest signature; SHA256SUMS against this directory, and its signature; and the parquet's rows, which is what load_dataset() returns. The one it cannot do alone is check 5, the key against the fingerprint the ANCHOR publishes: the key shipped beside the sample and the manifest it signs came from the SAME host, so neither vouches for the other. Fetch `KEY-FINGERPRINT.txt` from the transparency repository and pass it — `--fingerprint KEY-FINGERPRINT.txt` — and the script checks it. Without it, check 5 prints NOT CHECKED rather than counting as a pass.
|
| 98 |
+
|
| 99 |
+
What the script deliberately does NOT do is fetch anything. A tool that downloads both halves of a proof is one host telling you about itself again, which is the thing the second host exists to prevent. No arrangement of hosts fixes that for the notebook either: a notebook on a third host would still be the thing reporting its own result.
|
| 100 |
|
| 101 |
What the two hosts DO protect is the data. If the dataset host served you an altered sample, the key and fingerprint published independently would not match it, and you would catch it. That is the claim, and it holds.
|
| 102 |
|
|
|
|
| 112 |
| `split` | `VARCHAR` | Machine-learning split assignment: train, validation or test |
|
| 113 |
| `payload` | `VARCHAR` | The amendment verdict for this filing, as a JSON object. Every analytical field lives here — see the payload table below |
|
| 114 |
| `payload_sha` | `VARCHAR` | SHA-256 of the `payload` string exactly as shipped. The other half of the verification pair |
|
| 115 |
+
| `tokens` | `BIGINT` | An estimate of the payload's size in language-model tokens… |
|
| 116 |
| `cik` | `VARCHAR` | SEC's Central Index Key for the filer, unpadded |
|
| 117 |
| `cik10` | `VARCHAR` | The same CIK zero-padded to ten characters — SEC's own conventional form |
|
| 118 |
| `accession` | `VARCHAR` | SEC's accession number for the filing, canonical (digits only, no dashes). With `cik` it identifies a filing uniquely |
|
|
|
|
| 128 |
|
| 129 |
`payload` is a JSON object holding the analytical fields — `link_state`, `amends_accession`, `link_basis`, `link_confidence`, `version_seq`, `is_latest`, `period` and the rest. The flat CSV in this package explodes them into columns as a convenience; the Parquet schema above is the product.
|
| 130 |
|
| 131 |
+
**Full data dictionary — every column, every payload field, measured null rates and the caveats attached to each — is in the documentation folder linked under Quick links above, alongside the datasheet, the audit report and the release history. No request needed and no licence required to read it.**
|
| 132 |
|
| 133 |
## The audit, and why it is not a QA table
|
| 134 |
|
|
|
|
| 149 |
|
| 150 |
**It ran against the shipped Parquet**, not against the tables the Parquet was built from. A check that passes on the source and is never re-run on the artefact says nothing about the file you receive.
|
| 151 |
|
| 152 |
+
**What is bound by the signature, and what is not.** The manifest binds the data files, the verification kit and the per-stratum LINK-ACCURACY figures — those cannot be revised after the fact without the manifest's sha256 changing, and that sha256 is what the signed trust roots record — you can check the accuracy figures yourself in the manifest's own `# accuracy` lines. **The 8 quality checks above are NOT bound by it.** The audit report is a separate object and **no signature covers it**: the manifest digest does not, and neither do the release’s file hashes, which bind the three Parquet files, the accuracy lines and the verification kit and nothing else. It travels with a sha256 in the document index it ships beside, and that index is not signed. We would rather say which is which — and say plainly where there is nothing — than let one guarantee stand in for another.
|
| 153 |
|
| 154 |
## Usage
|
| 155 |
|
|
|
|
| 200 |
print(f' linked by {a.basis}')
|
| 201 |
```
|
| 202 |
|
| 203 |
+
**65 amendment chains close inside this sample** (81 amendment rows resolve to an original that is also here; several amendments share an original, which is why the two numbers differ) — both the amendment and the filing it amends are present. That happens in `10-KT` and `10-QT`, which are drawn on base form alone, so the originals arrive with the amendments. Every other stratum draws the amendments only, so their targets sit in the full dataset rather than here. Wherever `link_state` is `linked`, the target exists.
|
| 204 |
|
| 205 |
**Verify it.**
|
| 206 |
|
|
|
|
| 214 |
|
| 215 |
You can therefore check our coverage claims without us handing over the data they describe.
|
| 216 |
|
| 217 |
+
| stratum | population | frame reachable | examined | confirmed | contradicted | inconclusive | precision | claim type |
|
| 218 |
+
|---|---:|---:|---:|---:|---:|---:|---:|---|
|
| 219 |
+
| `10-K` | 19,582 | *not stated* | 300 | 295 | 2 | 3 | **99.33%** | sampled — [97.58, 99.82] |
|
| 220 |
+
| `10-KT` | 72 | *not stated* | 72 | 65 | 1 | 6 | **98.48%** | census — every member examined |
|
| 221 |
+
| `10-Q` | 18,086 | *not stated* | 300 | 295 | 0 | 5 | **100.00%** | sampled — [98.71, 100.00] |
|
| 222 |
+
| `10-QT` | 9 | *not stated* | 9 | 8 | 0 | 1 | **100.00%** | census — every member examined |
|
| 223 |
+
| `11-K` | 233 | *not stated* | 233 | 219 | 0 | 14 | **100.00%** | census — every member examined |
|
| 224 |
+
| `20-F` | 2,112 | *not stated* | 300 | 279 | 0 | 21 | **100.00%** | sampled — [98.64, 100.00] |
|
| 225 |
+
| `40-F` | 290 | *not stated* | 290 | 282 | 0 | 8 | **100.00%** | census — every member examined |
|
| 226 |
+
|
| 227 |
+
**`frame reachable` reads *not stated* for 7 of these strata.** This release's bound accuracy lines record a population and not a separately measured reachable frame, so we cannot tell you here how many of its rows hold a document the verifier can read. That is a gap in what this release bound — it is NOT a claim that population and reachable frame are the same number here. Releases cut after 2026-09-17 bind the frame on every line and this column reports it.
|
| 228 |
|
| 229 |
+
**`inconclusive` is examined and undecided, and it is EXCLUDED from the precision denominator rather than counted against it.** Across these strata that is **58 of 1,504 records examined** (3.9%). A precision of 100% on a stratum with inconclusives means every record that COULD be decided was confirmed — not that every record was. The column is here so you can see the size of what was set aside.
|
| 230 |
+
|
| 231 |
+
4 of these strata are reported as a **census**: every member examined, so there is no sampling risk and no interval is quoted. Quoting one would imply an inference nobody made. A census can still carry inconclusives: those members were examined and produced no verdict.
|
| 232 |
|
| 233 |
### What we withdrew
|
| 234 |
|
|
|
|
| 243 |
|
| 244 |
## What is in the sample, and how it was sized
|
| 245 |
|
| 246 |
+
**5,645 rows** across **126 base forms** (**163 form types** once amendment suffixes are counted separately), carrying **1,654 links in 1,554 distinct chains**.
|
| 247 |
|
| 248 |
The rule is: **stratified deterministic draw, census strata complete, every other stratum floored to a minimum evaluable mass, every link state represented.**
|
| 249 |
|
| 250 |
+
**The unit is the chain within a stratum, not the row.** Your smallest natural filter is a stratum — *show me 40-F/A* — and a sample becomes a screenshot the moment that filter returns too few chains to judge. So each stratum is drawn to whichever is largest of its target, the N that yields 150 units, and the N at which **every year present in that stratum has appeared**. Ordering is `md5(record_uid)` throughout and the draw is only ever extended, never hand-picked.
|
| 251 |
+
|
| 252 |
+
**You can run that claim rather than take it.** `reproduce_sample.py` rebuilds this sample from the release and the published rules and tells you whether it got the same rows:
|
| 253 |
|
| 254 |
+
python3 reproduce_sample.py /path/to/release/parquet/
|
| 255 |
+
|
| 256 |
+
It reports two verdicts, because they are different claims. **ROW SET** is the draw itself — it depends only on the release and the rules in `SAMPLE-COMPOSITION.json`, and a failure there means the sample is not what this page describes. **BYTE-EXACT** is the row set plus the CSV writer: matching our bytes also needs duckdb 1.5.1, which wrote them. Identical rows with different bytes is a quoting difference, not a data difference, and the script says which one you have.
|
| 257 |
+
|
| 258 |
+
A uniform percentage would not do this. A 1% draw is ~153,000 rows carrying roughly 404 linked rows across the 7 AUDIT strata (a different cut from the 12 sample strata tabulated below) and 18 years — about 3.2 linked ROWS per stratum-year. (Rows, not chains: this release holds 1,654 links in 1,554 distinct chains in the sample, so the two are not interchangeable.) 27 times the size of this sample and less evaluable, because a percentage is blind to where the information lives.
|
| 259 |
|
| 260 |
| stratum | rows | chains | years covered |
|
| 261 |
|---|---:|---:|---:|
|
| 262 |
| 10-KT (complete) | 459 | 56 | 18 of 18 |
|
| 263 |
| 10-QT (complete) | 96 | 9 | 17 of 17 |
|
| 264 |
+
| unverifiable_at_release (complete) | 588 | no links | 18 of 18 |
|
| 265 |
| no_prior_filing_in_corpus | 689 | no links | 18 of 18 |
|
| 266 |
| unresolved_prior_exists | 250 | no links | 18 of 18 |
|
| 267 |
| 10-K linked | 350 | 350 | 18 of 18 |
|
| 268 |
| 10-Q linked | 350 | 350 | 18 of 18 |
|
| 269 |
+
| 20-F linked | 350 | 343 | 18 of 18 |
|
| 270 |
+
| 40-F linked (complete) | 290 | 259 | 18 of 18 |
|
| 271 |
+
| 11-K linked (complete) | 233 | 187 | 18 of 18 |
|
| 272 |
| unknown_subject | 900 | no links | 18 of 18 |
|
| 273 |
| not_an_amendment | 1,100 | no links | 18 of 18 |
|
| 274 |
+
| **total drawn** | **5,655** | | |
|
| 275 |
+
|
| 276 |
+
**That column sums to 5,655, and the sample is 5,645 rows.** The strata are not disjoint, and three different counts describe that — so each is named:
|
| 277 |
+
|
| 278 |
+
- **474 rows in this sample satisfy more than one stratum rule.** The census strata are defined on base form and the state strata on link state, so a 10-KT row that is not an amendment satisfies both.
|
| 279 |
+
- **10 of those were DRAWN into two strata**, which is the whole of the difference between the column total and the sample. The draws are unioned, so the sample holds each of them once. The rest satisfy a second rule whose own draw did not reach them.
|
| 280 |
+
- The largest overlapping pair is **371 rows** that are both *10-KT, every row* and *not_an_amendment*.
|
| 281 |
+
|
| 282 |
+
The per-stratum figures are the draw sizes, and changing them to make the column add up would break the reproduction above.
|
| 283 |
|
| 284 |
Every stratum covers every year its population covers. That is the half of the rule a row count cannot show, so it is measured here rather than asserted.
|
| 285 |
|
|
|
|
| 287 |
|
| 288 |
| link_state | in sample | in the full dataset |
|
| 289 |
|---|---:|---:|
|
| 290 |
+
| `linked` | 1,654 | 40,384 |
|
| 291 |
| `not_an_amendment` | 1,556 | 13,864,746 |
|
| 292 |
| `unknown_subject` | 900 | 1,417,391 |
|
| 293 |
| `no_prior_filing_in_corpus` | 695 | 1,273 |
|
| 294 |
+
| `unverifiable_at_release` | 588 | 588 |
|
| 295 |
| `unresolved_prior_exists` | 252 | 2,608 |
|
|
|
|
| 296 |
|
| 297 |
+
**5 strata are included complete** — every row of them: `10-KT`, `10-QT`, `unverifiable_at_release`, `40-F linked` and `11-K linked`. A sample of a complete stratum is a contradiction, so those are not sampled.
|
| 298 |
|
| 299 |
+
That is a different property from the **4 strata the coverage attestation reports as a census** (`10-KT`, `10-QT`, `11-K` and `40-F`), which says the AUDIT examined every reachable row of them.
|
| 300 |
|
| 301 |
## Files
|
| 302 |
|
|
|
|
| 309 |
| `MANIFEST.txt.sig` | ed25519 signature over the manifest |
|
| 310 |
| `COVERAGE-ATTESTATION.json` | the corpus-level claims, signed |
|
| 311 |
| `HSH-SIGNING-KEY.pub` | the public key |
|
| 312 |
+
| `verify_sample.py` | the six checks, stdlib only |
|
| 313 |
+
| `SAMPLE-COMPOSITION.json` | every stratum's rule, target and draw size — the input to the reproducer |
|
| 314 |
+
| `reproduce_sample.py` | rebuilds this sample from the release and checks it matches (needs duckdb) |
|
| 315 |
|
| 316 |
## Licence and terms
|
| 317 |
|
| 318 |
+
This sample is provided for **evaluation**. It is not redistributable and confers no rights to the full dataset. Commercial terms are agreed in writing before any delivery and are available from info@healingsunhaven.com. No pricing sheet, licence agreement or order form is cited here because none has been registered with this build — we name only what we can send you today.
|
| 319 |
|
| 320 |
**Contact:** info@healingsunhaven.com
|
| 321 |
|
| 322 |
+
*Sample of `restatements-v1.5.1`, as-of watermark 2026-09-17 15:29:36. Generated 2026-09-18T09:40:29Z.*
|
SAMPLE-COMPOSITION.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"release_rows": 15326990,
|
| 3 |
-
"sample_rows":
|
| 4 |
"strata": [
|
| 5 |
{
|
| 6 |
"stratum": "census: 10-KT, every row",
|
|
@@ -43,11 +43,11 @@
|
|
| 43 |
"n_for_floor": null,
|
| 44 |
"n_for_year_range": null,
|
| 45 |
"binding": [],
|
| 46 |
-
"in_release":
|
| 47 |
-
"in_sample":
|
| 48 |
"chains_in_sample": 0,
|
| 49 |
-
"years_in_sample":
|
| 50 |
-
"years_in_release":
|
| 51 |
"complete": true
|
| 52 |
},
|
| 53 |
{
|
|
@@ -91,9 +91,9 @@
|
|
| 91 |
"target": 350,
|
| 92 |
"floor_units": 150,
|
| 93 |
"n_for_floor": 150,
|
| 94 |
-
"n_for_year_range":
|
| 95 |
"binding": [],
|
| 96 |
-
"in_release":
|
| 97 |
"in_sample": 350,
|
| 98 |
"chains_in_sample": 350,
|
| 99 |
"years_in_sample": 18,
|
|
@@ -107,9 +107,9 @@
|
|
| 107 |
"target": 350,
|
| 108 |
"floor_units": 150,
|
| 109 |
"n_for_floor": 150,
|
| 110 |
-
"n_for_year_range":
|
| 111 |
"binding": [],
|
| 112 |
-
"in_release":
|
| 113 |
"in_sample": 350,
|
| 114 |
"chains_in_sample": 350,
|
| 115 |
"years_in_sample": 18,
|
|
@@ -123,11 +123,11 @@
|
|
| 123 |
"target": 350,
|
| 124 |
"floor_units": 150,
|
| 125 |
"n_for_floor": 151,
|
| 126 |
-
"n_for_year_range":
|
| 127 |
"binding": [],
|
| 128 |
-
"in_release":
|
| 129 |
"in_sample": 350,
|
| 130 |
-
"chains_in_sample":
|
| 131 |
"years_in_sample": 18,
|
| 132 |
"years_in_release": 18,
|
| 133 |
"complete": false
|
|
@@ -138,15 +138,15 @@
|
|
| 138 |
"unit": "chain",
|
| 139 |
"target": 300,
|
| 140 |
"floor_units": 150,
|
| 141 |
-
"n_for_floor":
|
| 142 |
-
"n_for_year_range":
|
| 143 |
"binding": [],
|
| 144 |
-
"in_release":
|
| 145 |
-
"in_sample":
|
| 146 |
-
"chains_in_sample":
|
| 147 |
"years_in_sample": 18,
|
| 148 |
"years_in_release": 18,
|
| 149 |
-
"complete":
|
| 150 |
},
|
| 151 |
{
|
| 152 |
"stratum": "stratum: 11-K linked",
|
|
@@ -155,11 +155,11 @@
|
|
| 155 |
"target": 241,
|
| 156 |
"floor_units": 150,
|
| 157 |
"n_for_floor": 180,
|
| 158 |
-
"n_for_year_range":
|
| 159 |
"binding": [],
|
| 160 |
-
"in_release":
|
| 161 |
-
"in_sample":
|
| 162 |
-
"chains_in_sample":
|
| 163 |
"years_in_sample": 18,
|
| 164 |
"years_in_release": 18,
|
| 165 |
"complete": true
|
|
@@ -198,16 +198,17 @@
|
|
| 198 |
}
|
| 199 |
],
|
| 200 |
"by_state": {
|
| 201 |
-
"linked":
|
| 202 |
"not_an_amendment": 1556,
|
| 203 |
"unknown_subject": 900,
|
| 204 |
"no_prior_filing_in_corpus": 695,
|
| 205 |
-
"
|
| 206 |
-
"
|
| 207 |
},
|
| 208 |
"base_forms": 126,
|
| 209 |
-
"
|
| 210 |
-
"
|
|
|
|
| 211 |
"col_types": {
|
| 212 |
"record_uid": "VARCHAR",
|
| 213 |
"release_id": "VARCHAR",
|
|
@@ -229,7 +230,43 @@
|
|
| 229 |
"jurisdiction": "VARCHAR",
|
| 230 |
"quality_flags": "VARCHAR[]"
|
| 231 |
},
|
| 232 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
"closing_forms": [
|
| 234 |
"10-KT",
|
| 235 |
"10-QT"
|
|
|
|
| 1 |
{
|
| 2 |
"release_rows": 15326990,
|
| 3 |
+
"sample_rows": 5645,
|
| 4 |
"strata": [
|
| 5 |
{
|
| 6 |
"stratum": "census: 10-KT, every row",
|
|
|
|
| 43 |
"n_for_floor": null,
|
| 44 |
"n_for_year_range": null,
|
| 45 |
"binding": [],
|
| 46 |
+
"in_release": 588,
|
| 47 |
+
"in_sample": 588,
|
| 48 |
"chains_in_sample": 0,
|
| 49 |
+
"years_in_sample": 18,
|
| 50 |
+
"years_in_release": 18,
|
| 51 |
"complete": true
|
| 52 |
},
|
| 53 |
{
|
|
|
|
| 91 |
"target": 350,
|
| 92 |
"floor_units": 150,
|
| 93 |
"n_for_floor": 150,
|
| 94 |
+
"n_for_year_range": 56,
|
| 95 |
"binding": [],
|
| 96 |
+
"in_release": 19582,
|
| 97 |
"in_sample": 350,
|
| 98 |
"chains_in_sample": 350,
|
| 99 |
"years_in_sample": 18,
|
|
|
|
| 107 |
"target": 350,
|
| 108 |
"floor_units": 150,
|
| 109 |
"n_for_floor": 150,
|
| 110 |
+
"n_for_year_range": 146,
|
| 111 |
"binding": [],
|
| 112 |
+
"in_release": 18086,
|
| 113 |
"in_sample": 350,
|
| 114 |
"chains_in_sample": 350,
|
| 115 |
"years_in_sample": 18,
|
|
|
|
| 123 |
"target": 350,
|
| 124 |
"floor_units": 150,
|
| 125 |
"n_for_floor": 151,
|
| 126 |
+
"n_for_year_range": 63,
|
| 127 |
"binding": [],
|
| 128 |
+
"in_release": 2112,
|
| 129 |
"in_sample": 350,
|
| 130 |
+
"chains_in_sample": 343,
|
| 131 |
"years_in_sample": 18,
|
| 132 |
"years_in_release": 18,
|
| 133 |
"complete": false
|
|
|
|
| 138 |
"unit": "chain",
|
| 139 |
"target": 300,
|
| 140 |
"floor_units": 150,
|
| 141 |
+
"n_for_floor": 159,
|
| 142 |
+
"n_for_year_range": 79,
|
| 143 |
"binding": [],
|
| 144 |
+
"in_release": 290,
|
| 145 |
+
"in_sample": 290,
|
| 146 |
+
"chains_in_sample": 259,
|
| 147 |
"years_in_sample": 18,
|
| 148 |
"years_in_release": 18,
|
| 149 |
+
"complete": true
|
| 150 |
},
|
| 151 |
{
|
| 152 |
"stratum": "stratum: 11-K linked",
|
|
|
|
| 155 |
"target": 241,
|
| 156 |
"floor_units": 150,
|
| 157 |
"n_for_floor": 180,
|
| 158 |
+
"n_for_year_range": 84,
|
| 159 |
"binding": [],
|
| 160 |
+
"in_release": 233,
|
| 161 |
+
"in_sample": 233,
|
| 162 |
+
"chains_in_sample": 187,
|
| 163 |
"years_in_sample": 18,
|
| 164 |
"years_in_release": 18,
|
| 165 |
"complete": true
|
|
|
|
| 198 |
}
|
| 199 |
],
|
| 200 |
"by_state": {
|
| 201 |
+
"linked": 1654,
|
| 202 |
"not_an_amendment": 1556,
|
| 203 |
"unknown_subject": 900,
|
| 204 |
"no_prior_filing_in_corpus": 695,
|
| 205 |
+
"unverifiable_at_release": 588,
|
| 206 |
+
"unresolved_prior_exists": 252
|
| 207 |
},
|
| 208 |
"base_forms": 126,
|
| 209 |
+
"form_types": 163,
|
| 210 |
+
"sample_links": 1654,
|
| 211 |
+
"sample_chains": 1554,
|
| 212 |
"col_types": {
|
| 213 |
"record_uid": "VARCHAR",
|
| 214 |
"release_id": "VARCHAR",
|
|
|
|
| 230 |
"jurisdiction": "VARCHAR",
|
| 231 |
"quality_flags": "VARCHAR[]"
|
| 232 |
},
|
| 233 |
+
"rows_drawn_across_strata": 5655,
|
| 234 |
+
"rows_in_more_than_one_stratum": 474,
|
| 235 |
+
"double_counted_in_the_stratum_column": 10,
|
| 236 |
+
"overlapping_stratum_pairs": [
|
| 237 |
+
{
|
| 238 |
+
"a": "census: 10-KT, every row",
|
| 239 |
+
"b": "state: unverifiable_at_release, every row",
|
| 240 |
+
"rows": 4
|
| 241 |
+
},
|
| 242 |
+
{
|
| 243 |
+
"a": "census: 10-KT, every row",
|
| 244 |
+
"b": "state: no_prior_filing_in_corpus",
|
| 245 |
+
"rows": 10
|
| 246 |
+
},
|
| 247 |
+
{
|
| 248 |
+
"a": "census: 10-KT, every row",
|
| 249 |
+
"b": "state: unresolved_prior_exists",
|
| 250 |
+
"rows": 2
|
| 251 |
+
},
|
| 252 |
+
{
|
| 253 |
+
"a": "census: 10-KT, every row",
|
| 254 |
+
"b": "state: not_an_amendment",
|
| 255 |
+
"rows": 371
|
| 256 |
+
},
|
| 257 |
+
{
|
| 258 |
+
"a": "census: 10-QT, every row",
|
| 259 |
+
"b": "state: no_prior_filing_in_corpus",
|
| 260 |
+
"rows": 2
|
| 261 |
+
},
|
| 262 |
+
{
|
| 263 |
+
"a": "census: 10-QT, every row",
|
| 264 |
+
"b": "state: not_an_amendment",
|
| 265 |
+
"rows": 85
|
| 266 |
+
}
|
| 267 |
+
],
|
| 268 |
+
"rows_resolvable_in_sample": 81,
|
| 269 |
+
"chains_resolvable_in_sample": 65,
|
| 270 |
"closing_forms": [
|
| 271 |
"10-KT",
|
| 272 |
"10-QT"
|
SHA256SUMS
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
fc2273f21bf4e45eaae75870aa8c8e261490901f9c9c2cdd371486c700255377 HSH-SIGNING-KEY.pub
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
| 1 |
+
f1256d79977e5925ca1665edc47777e32f3c3e1bc7cc0be17bc48275384b2b5f COVERAGE-ATTESTATION.json
|
| 2 |
+
52f78227271aca3fd3bccbd091a1e15eac97f4a991c3af574932f7a08cfc15cd COVERAGE-ATTESTATION.json.sig
|
| 3 |
fc2273f21bf4e45eaae75870aa8c8e261490901f9c9c2cdd371486c700255377 HSH-SIGNING-KEY.pub
|
| 4 |
+
1a3741db34b2853d3b7054ef172450a96abfada2b60a0695571182bb2a744e30 MANIFEST.txt
|
| 5 |
+
a955175f8c8ea62cbcb1c4228d0903a3560efe02bbc44fabc718b117fa02290b MANIFEST.txt.sig
|
| 6 |
+
e184377ce934685cbf008adac5bd72caa03784bd96ffd9e82af4e797191f38cf README.md
|
| 7 |
+
2f05c8f646ce67fd1de4a10289a8f4a6ff5d0e495fc4a06b780a3f290ce22e63 SAMPLE-COMPOSITION.json
|
| 8 |
+
c28e4a30d76310df1c7814f1de0bd6aab2bfb126fbf579868ea79488e06f9ce8 hsh-amends-sample-flat.csv
|
| 9 |
+
cbc25c5269a45e0319801b7339f9e87a97f8672374fe662823cb84aa927bdf6d hsh-amends-sample.csv
|
| 10 |
+
b7dc00e43f8835dff1e8f286083528b311b7ac9258150ce982c6eeb9d93eaa0c hsh-amends-sample.parquet
|
| 11 |
+
360267806bf5b4b8c75a212f3c685e70d5d464baf0373a8edd758d963ef1e00a reproduce_sample.py
|
| 12 |
+
712f1622c2aea66e32e3fb2b7b9150cfb2852863130ccc6e7421a04be7f58508 verify_sample.py
|
SHA256SUMS.sig
ADDED
|
Binary file (64 Bytes). View file
|
|
|
hsh-amends-sample-flat.csv
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
hsh-amends-sample.csv
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
hsh-amends-sample.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b7dc00e43f8835dff1e8f286083528b311b7ac9258150ce982c6eeb9d93eaa0c
|
| 3 |
+
size 1117677
|
reproduce_sample.py
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""REBUILD THE HSH AMENDS SAMPLE FROM THE RELEASE.
|
| 3 |
+
|
| 4 |
+
python3 reproduce_sample.py /path/to/release/parquet/dir
|
| 5 |
+
|
| 6 |
+
The sample is a deterministic draw from `restatements-v1.5.1`. This script replays it
|
| 7 |
+
from SAMPLE-COMPOSITION.json — the same rules, the same ordering, the
|
| 8 |
+
same column list — and compares what it gets to the files in this
|
| 9 |
+
directory. It is the executable form of the sentence in README.md.
|
| 10 |
+
|
| 11 |
+
TWO VERDICTS, AND THEY ARE DIFFERENT CLAIMS.
|
| 12 |
+
|
| 13 |
+
ROW SET the draw itself. Depends only on the release and the
|
| 14 |
+
published rules. If this fails, the sample is not the
|
| 15 |
+
draw we describe.
|
| 16 |
+
BYTE-EXACT the row set PLUS the CSV writer. Reproducing our bytes
|
| 17 |
+
additionally needs duckdb 1.5.1, which is what
|
| 18 |
+
wrote them. A different duckdb may quote an embedded
|
| 19 |
+
newline differently and still hold identical rows, so a
|
| 20 |
+
row-set PASS with a byte MISMATCH is a writer difference,
|
| 21 |
+
not a data difference.
|
| 22 |
+
|
| 23 |
+
Requires: duckdb. Nothing else.
|
| 24 |
+
"""
|
| 25 |
+
import duckdb, hashlib, json, os, sys, tempfile
|
| 26 |
+
|
| 27 |
+
d = os.path.dirname(os.path.abspath(__file__))
|
| 28 |
+
rel = sys.argv[1] if len(sys.argv) > 1 else "."
|
| 29 |
+
comp = json.load(open(os.path.join(d, "SAMPLE-COMPOSITION.json")))
|
| 30 |
+
glob = os.path.join(rel, "restatements-v1.5.1-*.parquet")
|
| 31 |
+
|
| 32 |
+
con = duckdb.connect()
|
| 33 |
+
con.execute("SET memory_limit='5GB'")
|
| 34 |
+
con.execute("SET threads=3")
|
| 35 |
+
# The column list and its ORDER come from the published composition —
|
| 36 |
+
# the same dict the sample was exported with, so it cannot drift.
|
| 37 |
+
sel = ", ".join('"%s"' % c for c in comp["col_types"])
|
| 38 |
+
assert len(comp["col_types"]) == 19, "column list changed"
|
| 39 |
+
|
| 40 |
+
con.execute(f"""CREATE VIEW rel AS SELECT *,
|
| 41 |
+
json_extract_string(payload,'$.link_state') AS ls,
|
| 42 |
+
json_extract_string(payload,'$.base_form') AS bf,
|
| 43 |
+
json_extract_string(payload,'$.amends_identity') AS chain,
|
| 44 |
+
CAST(substr(CAST(filed_at AS VARCHAR), 1, 4) AS INT) AS yr
|
| 45 |
+
FROM read_parquet('{glob}')""")
|
| 46 |
+
|
| 47 |
+
n_rel = con.execute("SELECT count(*) FROM rel").fetchone()[0]
|
| 48 |
+
print(f"release {n_rel:,} rows from {glob}")
|
| 49 |
+
if n_rel != comp["release_rows"]:
|
| 50 |
+
print(f" !! the release holds {n_rel:,} rows; this sample was drawn "
|
| 51 |
+
f"from {comp['release_rows']:,}. Point at the right release.")
|
| 52 |
+
sys.exit(2)
|
| 53 |
+
|
| 54 |
+
parts = []
|
| 55 |
+
for i, st in enumerate(comp["strata"]):
|
| 56 |
+
lim = "" if st["target"] is None else "LIMIT %d" % st["in_sample"]
|
| 57 |
+
con.execute(f"CREATE OR REPLACE TEMP VIEW r{i} AS SELECT * FROM rel "
|
| 58 |
+
f"WHERE {st['rule']} ORDER BY md5(record_uid) {lim}")
|
| 59 |
+
got = con.execute(f"SELECT count(*) FROM r{i}").fetchone()[0]
|
| 60 |
+
flag = "ok" if got == st["in_sample"] else "MISMATCH"
|
| 61 |
+
print(f" {st['stratum']:44s} {got:>6,} / {st['in_sample']:<6,} {flag}")
|
| 62 |
+
parts.append(f"SELECT * FROM r{i}")
|
| 63 |
+
|
| 64 |
+
con.execute("CREATE OR REPLACE TEMP TABLE sample AS "
|
| 65 |
+
+ " UNION ".join(parts))
|
| 66 |
+
# NOT into this directory — SHA256SUMS covers it, and a scratch file
|
| 67 |
+
# here would make the seal fail for as long as the script is running.
|
| 68 |
+
out = os.path.join(tempfile.mkdtemp(prefix="hsh-repro-"),
|
| 69 |
+
"reproduced-sample.csv")
|
| 70 |
+
con.execute("COPY (SELECT " + sel + " FROM sample ORDER BY md5(record_uid))"
|
| 71 |
+
" TO '" + out + "' (FORMAT CSV, HEADER)")
|
| 72 |
+
|
| 73 |
+
def fingerprint(path):
|
| 74 |
+
"""Every FIELD of every row, not just the key.
|
| 75 |
+
|
| 76 |
+
This compared `SELECT record_uid ... ORDER BY record_uid`. So any
|
| 77 |
+
tampering that preserved the uid set — flipping a link_state from
|
| 78 |
+
`linked` to `no_prior_filing_in_corpus`, rewriting a company_name —
|
| 79 |
+
reproduced as ROW SET PASS with exit 0, on the single most
|
| 80 |
+
load-bearing claim in the product.
|
| 81 |
+
"""
|
| 82 |
+
cols = ", ".join('"%s"' % c for c in comp["col_types"])
|
| 83 |
+
nulls = ", ".join('coalesce("' + c + '", chr(0))'
|
| 84 |
+
for c in comp["col_types"])
|
| 85 |
+
return con.execute(
|
| 86 |
+
"SELECT md5(string_agg(h, '' ORDER BY h)) FROM ("
|
| 87 |
+
# duckdb's concat_ws SKIPS NULL ARGUMENTS, and an
|
| 88 |
+
# empty unquoted CSV field reads as NULL, so fields shifted
|
| 89 |
+
# across an empty column hash identically. coalesce() gives every
|
| 90 |
+
# absent field a byte of its own, so position is preserved.
|
| 91 |
+
" SELECT md5(concat_ws(chr(31), " + nulls + ")) AS h"
|
| 92 |
+
" FROM read_csv_auto(?, header=true, all_varchar=true))",
|
| 93 |
+
[path]).fetchone()[0]
|
| 94 |
+
|
| 95 |
+
pub = os.path.join(d, "hsh-amends-sample.csv")
|
| 96 |
+
same_rows = fingerprint(out) == fingerprint(pub)
|
| 97 |
+
h_new = hashlib.sha256(open(out, "rb").read()).hexdigest()
|
| 98 |
+
h_pub = hashlib.sha256(open(pub, "rb").read()).hexdigest()
|
| 99 |
+
|
| 100 |
+
print()
|
| 101 |
+
print(f"ROW SET {'PASS' if same_rows else 'FAIL'}")
|
| 102 |
+
print(f"BYTE-EXACT {'PASS' if h_new == h_pub else 'MISMATCH'}"
|
| 103 |
+
f" (yours {h_new[:16]} / ours {h_pub[:16]})")
|
| 104 |
+
if same_rows and h_new != h_pub:
|
| 105 |
+
# Only offer the writer explanation when the writer could BE the
|
| 106 |
+
# explanation. With identical duckdb versions it cannot, and the
|
| 107 |
+
# first version of this printed a self-refuting sentence naming the
|
| 108 |
+
# same version on both sides.
|
| 109 |
+
if duckdb.__version__ != "1.5.1":
|
| 110 |
+
print(" identical rows, different bytes — most likely a "
|
| 111 |
+
"CSV writer difference. Your duckdb is", duckdb.__version__,
|
| 112 |
+
"and ours was 1.5.1.")
|
| 113 |
+
else:
|
| 114 |
+
print(" every field of every row matches, but the bytes "
|
| 115 |
+
"differ on the SAME duckdb version (1.5.1).")
|
| 116 |
+
print(" That is not a writer difference. Treat it as "
|
| 117 |
+
"unexplained and tell us what you have.")
|
| 118 |
+
os.remove(out); os.rmdir(os.path.dirname(out))
|
| 119 |
+
sys.exit(0 if same_rows else 1)
|
verify_sample.py
CHANGED
|
@@ -20,6 +20,28 @@ WHAT IT CHECKS, and why each one matters:
|
|
| 20 |
The host that served you these files cannot forge this. That is the
|
| 21 |
point of fetching the key from somewhere else.
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
A sample cannot prove COVERAGE — that the corpus figures describe the whole
|
| 24 |
of it. See COVERAGE-ATTESTATION.json, signed with the same key.
|
| 25 |
"""
|
|
@@ -39,7 +61,29 @@ def sha256_file(p):
|
|
| 39 |
return h.hexdigest()
|
| 40 |
|
| 41 |
|
| 42 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
fail = []
|
| 44 |
man = os.path.join(d, "MANIFEST.txt")
|
| 45 |
if not os.path.exists(man):
|
|
@@ -67,6 +111,7 @@ def main(d):
|
|
| 67 |
print(f" {'ok ' if ok else 'BAD '} {name}")
|
| 68 |
|
| 69 |
print("\n[2] every record's payload against its payload_sha")
|
|
|
|
| 70 |
try:
|
| 71 |
import csv
|
| 72 |
n = bad = 0
|
|
@@ -74,14 +119,17 @@ def main(d):
|
|
| 74 |
encoding="utf-8") as fh:
|
| 75 |
for row in csv.DictReader(fh):
|
| 76 |
n += 1
|
|
|
|
| 77 |
if hashlib.sha256(row["payload"].encode()).hexdigest() != row["payload_sha"]:
|
| 78 |
bad += 1
|
| 79 |
if row["record_uid"] in records and \
|
| 80 |
records[row["record_uid"]] != row["payload_sha"]:
|
| 81 |
bad += 1
|
| 82 |
-
print(f" {n:,} records checked, {bad}
|
|
|
|
| 83 |
if bad:
|
| 84 |
-
fail.append(f"{bad} payload hash
|
|
|
|
| 85 |
except Exception as e:
|
| 86 |
fail.append(f"payload check could not run: {e}")
|
| 87 |
print(f" could not run: {e}")
|
|
@@ -101,23 +149,227 @@ def main(d):
|
|
| 101 |
if r.returncode != 0:
|
| 102 |
fail.append("signature did NOT verify")
|
| 103 |
else:
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
print("\n" + "=" * 62)
|
| 112 |
if fail:
|
| 113 |
-
print(f"VERIFICATION FAILED — {len(fail)}
|
|
|
|
| 114 |
for f in fail:
|
| 115 |
print(f" - {f}")
|
| 116 |
return 1
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
print("Coverage is NOT proven by a sample: see COVERAGE-ATTESTATION.json.")
|
| 119 |
return 0
|
| 120 |
|
| 121 |
|
| 122 |
if __name__ == "__main__":
|
| 123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
The host that served you these files cannot forge this. That is the
|
| 21 |
point of fetching the key from somewhere else.
|
| 22 |
|
| 23 |
+
4. SHA256SUMS covers every file here, and is itself signed.
|
| 24 |
+
The manifest covers the DATA files. This covers everything else as
|
| 25 |
+
well — this script, the dataset card, the attestation, the
|
| 26 |
+
signatures. It is what makes "a one-line edit on the host breaks
|
| 27 |
+
the checksums" a true sentence rather than a hopeful one, and it is
|
| 28 |
+
signed so that a host able to edit a file cannot edit the checksums
|
| 29 |
+
beside it.
|
| 30 |
+
|
| 31 |
+
5. The key is the key the ANCHOR publishes — only if you give it to me.
|
| 32 |
+
This is the one check that cannot be done from these files alone:
|
| 33 |
+
the key shipped here and the manifest it signs came from the same
|
| 34 |
+
host, so checking one against the other proves nothing about
|
| 35 |
+
substitution. Fetch KEY-FINGERPRINT.txt from the transparency
|
| 36 |
+
repository — a different host — and pass it:
|
| 37 |
+
|
| 38 |
+
python3 verify_sample.py . --fingerprint KEY-FINGERPRINT.txt
|
| 39 |
+
python3 verify_sample.py . --fingerprint <64-hex>
|
| 40 |
+
|
| 41 |
+
Without it, check 5 reports NOT CHECKED and says what is missing.
|
| 42 |
+
It is not treated as a pass, because "I did not look" and "I looked
|
| 43 |
+
and it matched" are different results.
|
| 44 |
+
|
| 45 |
A sample cannot prove COVERAGE — that the corpus figures describe the whole
|
| 46 |
of it. See COVERAGE-ATTESTATION.json, signed with the same key.
|
| 47 |
"""
|
|
|
|
| 61 |
return h.hexdigest()
|
| 62 |
|
| 63 |
|
| 64 |
+
def key_fingerprint(pub):
|
| 65 |
+
"""sha256 of the public key in DER — the value the anchor publishes."""
|
| 66 |
+
der = subprocess.run(["openssl", "pkey", "-pubin", "-in", pub,
|
| 67 |
+
"-outform", "DER"], capture_output=True)
|
| 68 |
+
if der.returncode != 0:
|
| 69 |
+
return None
|
| 70 |
+
return hashlib.sha256(der.stdout).hexdigest()
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
def expected_fingerprint(arg):
|
| 74 |
+
"""A 64-hex value, or the first one inside a file you were handed."""
|
| 75 |
+
if not arg:
|
| 76 |
+
return None
|
| 77 |
+
if re.fullmatch(r"[0-9a-fA-F]{64}", arg.strip()):
|
| 78 |
+
return arg.strip().lower()
|
| 79 |
+
if os.path.exists(arg):
|
| 80 |
+
m = re.search(r"[0-9a-fA-F]{64}", open(arg).read())
|
| 81 |
+
if m:
|
| 82 |
+
return m.group(0).lower()
|
| 83 |
+
return None
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def main(d, want_fp=None):
|
| 87 |
fail = []
|
| 88 |
man = os.path.join(d, "MANIFEST.txt")
|
| 89 |
if not os.path.exists(man):
|
|
|
|
| 111 |
print(f" {'ok ' if ok else 'BAD '} {name}")
|
| 112 |
|
| 113 |
print("\n[2] every record's payload against its payload_sha")
|
| 114 |
+
csv_shas = set() # kept so check 6 can compare the parquet
|
| 115 |
try:
|
| 116 |
import csv
|
| 117 |
n = bad = 0
|
|
|
|
| 119 |
encoding="utf-8") as fh:
|
| 120 |
for row in csv.DictReader(fh):
|
| 121 |
n += 1
|
| 122 |
+
csv_shas.add(row["payload_sha"])
|
| 123 |
if hashlib.sha256(row["payload"].encode()).hexdigest() != row["payload_sha"]:
|
| 124 |
bad += 1
|
| 125 |
if row["record_uid"] in records and \
|
| 126 |
records[row["record_uid"]] != row["payload_sha"]:
|
| 127 |
bad += 1
|
| 128 |
+
print(f" {n:,} records checked, {bad:,} "
|
| 129 |
+
f"mismatch{'' if bad == 1 else 'es'}")
|
| 130 |
if bad:
|
| 131 |
+
fail.append(f"{bad:,} payload hash "
|
| 132 |
+
f"mismatch{'' if bad == 1 else 'es'}")
|
| 133 |
except Exception as e:
|
| 134 |
fail.append(f"payload check could not run: {e}")
|
| 135 |
print(f" could not run: {e}")
|
|
|
|
| 149 |
if r.returncode != 0:
|
| 150 |
fail.append("signature did NOT verify")
|
| 151 |
else:
|
| 152 |
+
got = key_fingerprint(pub)
|
| 153 |
+
print(f" key fingerprint sha256: {got}")
|
| 154 |
+
|
| 155 |
+
print("\n[4] SHA256SUMS against this directory, and its signature")
|
| 156 |
+
sums = os.path.join(d, "SHA256SUMS")
|
| 157 |
+
if not os.path.exists(sums):
|
| 158 |
+
# An absent seal used to print
|
| 159 |
+
# one line and count as nothing: delete SHA256SUMS and its
|
| 160 |
+
# signature and a package with an edited README printed VERIFIED
|
| 161 |
+
# and exited 0. MANIFEST.txt covers only the three DATA files;
|
| 162 |
+
# the card, the attestation, the composition and this script
|
| 163 |
+
# itself are covered ONLY by the seal. So its absence is a
|
| 164 |
+
# RESULT, and it is the one a tampering host would arrange.
|
| 165 |
+
fail.append("SHA256SUMS is absent — the card, the attestation and "
|
| 166 |
+
"this script are covered by nothing")
|
| 167 |
+
print(" ABSENT — this copy carries no directory seal, so the")
|
| 168 |
+
print(" card, the attestation, SAMPLE-COMPOSITION.json and this")
|
| 169 |
+
print(" script itself are covered by NOTHING. The manifest")
|
| 170 |
+
print(" covers only the three data files. Re-download.")
|
| 171 |
+
else:
|
| 172 |
+
listed = {}
|
| 173 |
+
for line in open(sums):
|
| 174 |
+
h, _, fn = line.strip().partition(" ")
|
| 175 |
+
if fn:
|
| 176 |
+
listed[fn] = h
|
| 177 |
+
here = {fn for fn in os.listdir(d)
|
| 178 |
+
if fn not in ("SHA256SUMS", "SHA256SUMS.sig")}
|
| 179 |
+
probs = []
|
| 180 |
+
probs += [f"{fn}: present here and NOT in SHA256SUMS"
|
| 181 |
+
for fn in sorted(here - set(listed))]
|
| 182 |
+
probs += [f"{fn}: in SHA256SUMS and missing here"
|
| 183 |
+
for fn in sorted(set(listed) - here)]
|
| 184 |
+
# A NAME IN THE SEAL THAT IS NOT A READABLE FILE IS A FINDING,
|
| 185 |
+
# NOT A CRASH. Hashing a directory raises IsADirectoryError, so
|
| 186 |
+
# replacing a sealed file with a directory of the same name used
|
| 187 |
+
# to end this script in a traceback — before the remaining checks
|
| 188 |
+
# and the verdict printed. That still fails closed, but it tells
|
| 189 |
+
# you less than naming the file does.
|
| 190 |
+
for fn in sorted(here & set(listed)):
|
| 191 |
+
_fp = os.path.join(d, fn)
|
| 192 |
+
try:
|
| 193 |
+
if sha256_file(_fp) != listed[fn]:
|
| 194 |
+
probs.append(f"{fn}: CHANGED since the checksums "
|
| 195 |
+
f"were written")
|
| 196 |
+
except Exception as _fe:
|
| 197 |
+
probs.append(f"{fn}: listed in SHA256SUMS but cannot be "
|
| 198 |
+
f"read as a file ({type(_fe).__name__})")
|
| 199 |
+
ssig = sums + ".sig"
|
| 200 |
+
if not os.path.exists(ssig):
|
| 201 |
+
probs.append("SHA256SUMS is not signed")
|
| 202 |
+
elif not os.path.exists(pub):
|
| 203 |
+
# NOT a skip. Making the cryptographic half conditional on a
|
| 204 |
+
# file inside the directory being verified means deleting that
|
| 205 |
+
# file defeats it.
|
| 206 |
+
probs.append("the signing key is missing, so SHA256SUMS.sig "
|
| 207 |
+
"cannot be checked")
|
| 208 |
+
else:
|
| 209 |
+
rr = subprocess.run(["openssl", "pkeyutl", "-verify", "-pubin",
|
| 210 |
+
"-inkey", pub, "-rawin", "-in", sums,
|
| 211 |
+
"-sigfile", ssig], capture_output=True)
|
| 212 |
+
if rr.returncode != 0:
|
| 213 |
+
probs.append("SHA256SUMS.sig does NOT verify")
|
| 214 |
+
if probs:
|
| 215 |
+
fail.extend(probs)
|
| 216 |
+
for x in probs:
|
| 217 |
+
print(f" BAD {x}")
|
| 218 |
+
else:
|
| 219 |
+
print(f" ok {len(listed):,} "
|
| 220 |
+
f"file{'' if len(listed) == 1 else 's'}, "
|
| 221 |
+
f"signature verifies")
|
| 222 |
+
|
| 223 |
+
print("\n[5] the key against the fingerprint the ANCHOR publishes")
|
| 224 |
+
got = key_fingerprint(pub) if os.path.exists(pub) else None
|
| 225 |
+
want = expected_fingerprint(want_fp)
|
| 226 |
+
if got is None:
|
| 227 |
+
fail.append("could not read the public key to fingerprint it")
|
| 228 |
+
print(" could not read the public key")
|
| 229 |
+
elif want is None:
|
| 230 |
+
# NOT A PASS. This is the one check the files cannot answer, and
|
| 231 |
+
# reporting it as satisfied because nothing was supplied is the
|
| 232 |
+
# defect the whole kit exists to avoid.
|
| 233 |
+
print(" NOT CHECKED - no fingerprint supplied.")
|
| 234 |
+
print(" The key here and the manifest it signs arrived from the")
|
| 235 |
+
print(" same host, so they cannot vouch for each other. Fetch")
|
| 236 |
+
print(" KEY-FINGERPRINT.txt from the HSH transparency repository")
|
| 237 |
+
print(" and re-run with --fingerprint to close this.")
|
| 238 |
+
elif got == want:
|
| 239 |
+
# ══════════════════════════════════════════════════════════════
|
| 240 |
+
# "FROM A DIFFERENT HOST" IS SOMETHING THIS SCRIPT CANNOT KNOW.
|
| 241 |
+
#
|
| 242 |
+
# The value of this check is that the fingerprint came from
|
| 243 |
+
# somewhere the dataset host does not control. This script only
|
| 244 |
+
# sees a file path. If you passed the copy of KEY-FINGERPRINT.txt
|
| 245 |
+
# that travelled inside the same download, that is a real
|
| 246 |
+
# integrity check and it is NOT a cross-host one.
|
| 247 |
+
#
|
| 248 |
+
# So the line below reports what it actually did: matched the
|
| 249 |
+
# fingerprint it was given, and names where that came from.
|
| 250 |
+
# Whether that source is independent of the host that served you
|
| 251 |
+
# the sample is yours to know, and yours to decide.
|
| 252 |
+
# ══════════════════════════════════════════════════════════════
|
| 253 |
+
print(f" ok matches {want[:16]}... from {want_fp}")
|
| 254 |
+
print(" This is only a CROSS-HOST check if that file came from")
|
| 255 |
+
print(" somewhere the party who sent you the data does not")
|
| 256 |
+
print(" control. Fetched from the transparency repository it is;")
|
| 257 |
+
print(" unpacked from this same download it is not.")
|
| 258 |
+
else:
|
| 259 |
+
fail.append("key fingerprint does NOT match the anchor")
|
| 260 |
+
print(f" BAD this key is {got}")
|
| 261 |
+
print(f" the anchor publishes {want}")
|
| 262 |
+
print(" STOP. Do not trust these files.")
|
| 263 |
|
| 264 |
print("\n" + "=" * 62)
|
| 265 |
if fail:
|
| 266 |
+
print(f"VERIFICATION FAILED — {len(fail):,} "
|
| 267 |
+
f"problem{'' if len(fail) == 1 else 's'}:")
|
| 268 |
for f in fail:
|
| 269 |
print(f" - {f}")
|
| 270 |
return 1
|
| 271 |
+
# ══════════════════════════════════════════════════════════════
|
| 272 |
+
# CHECK 2 READS THE CSV. load_dataset() RETURNS THE PARQUET.
|
| 273 |
+
#
|
| 274 |
+
# The dataset card's `configs: data_files:` points at
|
| 275 |
+
# hsh-amends-sample.parquet, so following the card's first example
|
| 276 |
+
# gives you the PARQUET — while every row-level check above was
|
| 277 |
+
# measured on the CSV. Rewriting parquet rows and leaving their
|
| 278 |
+
# payload_sha alone would still have printed "0 mismatches".
|
| 279 |
+
#
|
| 280 |
+
# The parquet is covered as a whole by SHA256SUMS in check 4, so it
|
| 281 |
+
# cannot be swapped silently. What that does not establish is whether
|
| 282 |
+
# its ROWS say what the CSV's rows say. Comparing them needs pyarrow,
|
| 283 |
+
# which this script does not require you to have — so it is
|
| 284 |
+
# attempted, and when it cannot run it is REPORTED rather than
|
| 285 |
+
# skipped. An unchecked file is not a checked one.
|
| 286 |
+
# ══════════════════════════════════════════════════════════════
|
| 287 |
+
print("\n[6] the parquet's rows, which is what load_dataset() returns")
|
| 288 |
+
pq_path = os.path.join(d, "hsh-amends-sample.parquet")
|
| 289 |
+
if not os.path.exists(pq_path):
|
| 290 |
+
print(" no parquet in this directory")
|
| 291 |
+
else:
|
| 292 |
+
try:
|
| 293 |
+
import pyarrow.parquet as _pq
|
| 294 |
+
except ImportError:
|
| 295 |
+
print(" NOT CHECKED - pyarrow is not installed here.")
|
| 296 |
+
print(" Check 4 proves this file's BYTES are the ones the")
|
| 297 |
+
print(" seal covers. Its ROWS have not been compared to the")
|
| 298 |
+
print(" CSV's, and the dataset card's own example loads this")
|
| 299 |
+
print(" file, not the CSV. `pip install pyarrow` and re-run")
|
| 300 |
+
print(" to close it.")
|
| 301 |
+
else:
|
| 302 |
+
t = _pq.read_table(pq_path, columns=["payload", "payload_sha"])
|
| 303 |
+
pay = t.column("payload").to_pylist()
|
| 304 |
+
shas = t.column("payload_sha").to_pylist()
|
| 305 |
+
bad_rows = sum(
|
| 306 |
+
1 for a, b in zip(pay, shas)
|
| 307 |
+
if hashlib.sha256(a.encode()).hexdigest() != b)
|
| 308 |
+
if bad_rows:
|
| 309 |
+
fail.append(
|
| 310 |
+
f"{bad_rows:,} parquet "
|
| 311 |
+
f"row{'' if bad_rows == 1 else 's'} "
|
| 312 |
+
f"do{'es' if bad_rows == 1 else ''} not match "
|
| 313 |
+
f"{'its' if bad_rows == 1 else 'their'} own payload_sha")
|
| 314 |
+
print(f" BAD {bad_rows:,} of {len(pay):,} rows")
|
| 315 |
+
else:
|
| 316 |
+
print(f" ok {len(pay):,} rows, each payload matches "
|
| 317 |
+
f"its own payload_sha")
|
| 318 |
+
if csv_shas and set(shas) != csv_shas:
|
| 319 |
+
fail.append("the parquet and the CSV do not hold the same "
|
| 320 |
+
"records")
|
| 321 |
+
print(" BAD the parquet and the CSV disagree about "
|
| 322 |
+
"which records are here")
|
| 323 |
+
else:
|
| 324 |
+
print(" ok the parquet and the CSV hold the same "
|
| 325 |
+
"records")
|
| 326 |
+
|
| 327 |
+
# ══════════════════════════════════════════════════════════════
|
| 328 |
+
# THE PROSE SAID "NOT RUN" AND THE EXIT STATUS SAID PASS.
|
| 329 |
+
#
|
| 330 |
+
# A forged package — attacker's key, edited licence sentence,
|
| 331 |
+
# rewritten payloads with recomputed hashes, everything re-signed —
|
| 332 |
+
# is internally consistent, so every check that asks whether the
|
| 333 |
+
# package agrees with ITSELF passes. Only the fingerprint check
|
| 334 |
+
# catches it, and check 5 needs a fingerprint fetched from the other
|
| 335 |
+
# host. Without one this printed "Check 5 ... was NOT run" and then
|
| 336 |
+
# returned 0. Any CI step or script gating on the exit code accepted
|
| 337 |
+
# the forgery, and UPLOAD-THIS.md's own instruction was the bare
|
| 338 |
+
# `python3 verify_sample.py .`.
|
| 339 |
+
#
|
| 340 |
+
# Three states, because there are three:
|
| 341 |
+
# 0 every check ran and passed
|
| 342 |
+
# 1 a check FAILED - do not trust these files
|
| 343 |
+
# 2 what ran passed, and the check that catches a substituted key
|
| 344 |
+
# did not run
|
| 345 |
+
#
|
| 346 |
+
# 2 is not a failure of the package. It is a failure to have
|
| 347 |
+
# finished checking it, and a caller that cannot tell those apart
|
| 348 |
+
# from the exit code is a caller that ships the difference.
|
| 349 |
+
# ══════════════════════════════════════════════════════════════
|
| 350 |
+
if expected_fingerprint(want_fp) is None:
|
| 351 |
+
print("INCOMPLETE - files, every record hash and the signature all "
|
| 352 |
+
"verify.")
|
| 353 |
+
print("Check 5 (this key against the fingerprint the anchor "
|
| 354 |
+
"publishes) was NOT run,")
|
| 355 |
+
print("so nothing here rules out a package re-signed under a "
|
| 356 |
+
"substituted key.")
|
| 357 |
+
print("Re-run with --fingerprint to close it. Exit status 2 means "
|
| 358 |
+
"INCOMPLETE, not FAILED.")
|
| 359 |
+
print("Coverage is NOT proven by a sample: see "
|
| 360 |
+
"COVERAGE-ATTESTATION.json.")
|
| 361 |
+
return 2
|
| 362 |
+
print("VERIFIED — files, every record hash, and the signature, "
|
| 363 |
+
"against the anchor's key.")
|
| 364 |
print("Coverage is NOT proven by a sample: see COVERAGE-ATTESTATION.json.")
|
| 365 |
return 0
|
| 366 |
|
| 367 |
|
| 368 |
if __name__ == "__main__":
|
| 369 |
+
args = [a for a in sys.argv[1:]]
|
| 370 |
+
fp = None
|
| 371 |
+
if "--fingerprint" in args:
|
| 372 |
+
i = args.index("--fingerprint")
|
| 373 |
+
fp = args[i + 1] if i + 1 < len(args) else None
|
| 374 |
+
del args[i:i + 2]
|
| 375 |
+
sys.exit(main(args[0] if args else ".", fp))
|