Skip to content

Commit 08858ad

Browse files
committed
test: remove the last raw-byte fixture pin, keep the framing check
every_vector_file_is_byte_frozen in admission_tests.rs was the same sha256(raw file bytes) == literal pattern deleted repo-wide in 0c6e192 -- it escaped that sweep by wearing a different name. Byte-freezing in-repo fixtures is git's job, and CI now enforces v1/v2 as append-only by path. What the suite genuinely owes its fixtures is framing, so the test survives as every_vector_file_is_one_canonical_record: each file must hold exactly one canonical JSON record with one trailing LF. The ten EXPECTED_*_RAW_SHA256 literals and the raw_sha256 helper are gone; the derivation goldens (EXPECTED_SOURCE_FACT_ID and friends), which pin the system's own canonicalization rather than file bytes, stay untouched. Kept deliberately: vector_suite_is_byte_frozen_and_advertises_every_ pinned_digest in ledger_epoch_tests.rs -- despite its name it is a golden canonicalization test (encode_canonical(expected) == fixture), and its digests are field values of the vector, not raw-byte pins. Claude-Session: https://claude.ai/code/session_01BxEBa1v242Fo1AJJGftFnZ
1 parent b92a0c7 commit 08858ad

1 file changed

Lines changed: 15 additions & 48 deletions

File tree

src/evidence_ledger/admission_tests.rs

Lines changed: 15 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,6 @@ const VECTOR_SUITE: &[u8] =
5050
/// Exact canonical redacted bytes every vector in this suite refers to.
5151
const CANONICAL_PAYLOAD: &[u8] = br#"{"provider_event":"push","revision":"sha256:abc"}"#;
5252

53-
const EXPECTED_CANDIDATE_RAW_SHA256: &str =
54-
"3993c4ef269c25c82e8f8da840f9bb10e9f1af701502bfdbb9d7f0b3e6ef3d8d";
55-
const EXPECTED_LOCATORS_RAW_SHA256: &str =
56-
"243f8a6d465932aa9d4aef517dddaaaa2330525f84906647b93a10a0ae82eff2";
57-
const EXPECTED_STATEMENT_RAW_SHA256: &str =
58-
"1306a29f3ff3a5f82224d73343a2ab18db4f81f7aa8bd4fc806168ed63c225d8";
59-
const EXPECTED_NEGATIVE_SCOPE_RAW_SHA256: &str =
60-
"62f9b93b6031d38fd760442616c7628d9fd7167601306b752acf29302717c315";
61-
const EXPECTED_NEGATIVE_CONNECTOR_RAW_SHA256: &str =
62-
"141358f379b04a2cc3d08d2c2d1c6bd6dce6a855136bcbba6a1a79208486ca2c";
63-
const EXPECTED_NEGATIVE_RESOURCE_RAW_SHA256: &str =
64-
"fe4039fea1c23d00e02960e575286302569a4fdbc85b63135512347bab593feb";
65-
const EXPECTED_NEGATIVE_STORAGE_RAW_SHA256: &str =
66-
"14cf85256fa89ca907bf237dccdb8b39613cd671ee467cedda2527ad1a6c1a55";
67-
const EXPECTED_NEGATIVE_CLOCK_RAW_SHA256: &str =
68-
"3692a95e2ffa55125927e7d36cb97cb69418fa2ac24fb9bbcf83b6689923edea";
69-
const EXPECTED_NEGATIVE_PRIVATE_RAW_SHA256: &str =
70-
"25b79ca655d9b2768aec7c4f149f0cf9a48d9e4ff7d03c3149f6f2f58ff18bbe";
71-
const EXPECTED_VECTOR_SUITE_RAW_SHA256: &str =
72-
"041dc592fc3ce73c786fff2a3b11b71b50cd17c916a1e430839108c6adf242a8";
73-
7453
const EXPECTED_SOURCE_FACT_ID: &str =
7554
"22fa8ce6eb7eeaf3cd0514d91ef1b0a47acd89668587f44b82ff5683b1936cab";
7655
const EXPECTED_REPRESENTATION_KEY: &str =
@@ -92,10 +71,6 @@ fn record(artifact: &'static [u8]) -> &'static [u8] {
9271
body
9372
}
9473

95-
fn raw_sha256(artifact: &[u8]) -> String {
96-
hex::encode(Sha256::digest(artifact))
97-
}
98-
9974
fn target_package() -> SemanticallyClosedStage4Package {
10075
let manifest = ManifestVerifiedRegistryPackage::decode(
10176
record(TARGET_PACKAGE),
@@ -382,30 +357,22 @@ fn the_frozen_vectors_admit_to_the_frozen_statement() {
382357
}
383358

384359
#[test]
385-
fn every_vector_file_is_byte_frozen() {
386-
for (artifact, expected) in [
387-
(INGRESS_CANDIDATE, EXPECTED_CANDIDATE_RAW_SHA256),
388-
(INGRESS_LOCATORS, EXPECTED_LOCATORS_RAW_SHA256),
389-
(ADMITTED_STATEMENT, EXPECTED_STATEMENT_RAW_SHA256),
390-
(NEGATIVE_PAYLOAD_SCOPE, EXPECTED_NEGATIVE_SCOPE_RAW_SHA256),
391-
(
392-
NEGATIVE_FOREIGN_CONNECTOR,
393-
EXPECTED_NEGATIVE_CONNECTOR_RAW_SHA256,
394-
),
395-
(
396-
NEGATIVE_RESOURCE_IDENTITY,
397-
EXPECTED_NEGATIVE_RESOURCE_RAW_SHA256,
398-
),
399-
(
400-
NEGATIVE_STORAGE_IDENTITY,
401-
EXPECTED_NEGATIVE_STORAGE_RAW_SHA256,
402-
),
403-
(NEGATIVE_CLOCK_INVERSION, EXPECTED_NEGATIVE_CLOCK_RAW_SHA256),
404-
(NEGATIVE_PRIVATE_RAW, EXPECTED_NEGATIVE_PRIVATE_RAW_SHA256),
405-
(VECTOR_SUITE, EXPECTED_VECTOR_SUITE_RAW_SHA256),
360+
fn every_vector_file_is_one_canonical_record() {
361+
// Byte-freezing these fixtures is git's job (and CI enforces v1/v2 as
362+
// append-only by path). What this suite owes them is FRAMING: each file
363+
// must hold exactly one canonical JSON record with one trailing LF.
364+
for artifact in [
365+
INGRESS_CANDIDATE,
366+
INGRESS_LOCATORS,
367+
ADMITTED_STATEMENT,
368+
NEGATIVE_PAYLOAD_SCOPE,
369+
NEGATIVE_FOREIGN_CONNECTOR,
370+
NEGATIVE_RESOURCE_IDENTITY,
371+
NEGATIVE_STORAGE_IDENTITY,
372+
NEGATIVE_CLOCK_INVERSION,
373+
NEGATIVE_PRIVATE_RAW,
374+
VECTOR_SUITE,
406375
] {
407-
assert_eq!(raw_sha256(artifact), expected);
408-
// One canonical record and exactly one framing LF.
409376
let _ = record(artifact);
410377
}
411378
}

0 commit comments

Comments
 (0)