From b1686e1fc50c6c9a190f3704b33ab81b8fe6f890 Mon Sep 17 00:00:00 2001 From: Transaction Science Date: Tue, 29 Sep 2026 01:24:24 -0400 Subject: [PATCH] jcp-receipt: move an orphaned doc comment onto the test it describes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A paragraph headed "**The migration guarantee**" sits between two tests in `jcp-receipt/src/lib.rs` with no item of its own. Rust therefore merges it into the doc of the *next* item, `an_absent_environment_leaves_the_bytes_untouched` — a test about environment bindings, which has nothing to do with legacy receipts. It reads as documentation for a deleted test, and that is exactly how I first read it. It also names the wrong file. It says the bytes are "published in `conformance/v1/vectors.json`"; they are in `conformance/v1/legacy_jcp1.json`, and are byte-identical to the hex constant in `published_v1_receipts_still_verify` (checked). The paragraph now documents `published_v1_receipts_still_verify`, which is the test that actually carries the guarantee, names `legacy_jcp1.json`, and notes that the inlined constant is a copy of the file's **allow** envelope while the file also carries a **deny** — both of which `jcp-conformance`'s `tests/pack.rs` verifies against the file itself, via `extract` and so `verify_cose_sign1`, requiring both verdicts to be present. Doc comments only; `jcp-receipt` green. This PR originally also added a `jcp-conformance/tests/pack.rs` reading the five pack files nothing read. Main closed that independently in 1b3e3907, reading the same files and reaching the same legacy-deny finding, so that half is dropped rather than merged alongside. This correction is the part main did not make. Co-Authored-By: Claude Opus 5.5 --- jcp/jcp-rs/crates/jcp-receipt/src/lib.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/jcp/jcp-rs/crates/jcp-receipt/src/lib.rs b/jcp/jcp-rs/crates/jcp-receipt/src/lib.rs index 2f3892c5e..8446364cc 100644 --- a/jcp/jcp-rs/crates/jcp-receipt/src/lib.rs +++ b/jcp/jcp-rs/crates/jcp-receipt/src/lib.rs @@ -878,12 +878,6 @@ mod tests { (allow_f, grant, allow_d, deny_d) } - /// **The migration guarantee.** These are the REAL bytes published in - /// `conformance/v1/vectors.json` before `payload_hash` existed, sealed under - /// `jcp/1`. They MUST still verify — version dispatch recomputes the legacy - /// preimage — or the bump silently invalidated every receipt in the wild. - - /// Absent, the field changes nothing: the same bytes, so every receipt /// sealed before this existed and every published vector still verifies. #[test] @@ -956,6 +950,17 @@ mod tests { assert!(environment_of(&wire).is_none(), "an unparseable id is not a claim"); } + /// **The migration guarantee.** These are the REAL bytes published in + /// `conformance/v1/legacy_jcp1.json`, sealed under `jcp/1` before + /// `payload_hash` existed. They MUST still verify — version dispatch + /// recomputes the legacy preimage — or the bump silently invalidated every + /// receipt already in the wild. + /// + /// The constant below is a copy of that file's **allow** envelope, kept so this + /// crate's own suite can stand alone. The published file carries an allow *and* + /// a deny, and both are verified against the file itself by + /// `jcp-conformance`'s `tests/pack.rs` — which is what a third party actually + /// downloads, and what should be believed if the two ever disagree. #[test] fn published_v1_receipts_still_verify() { const V1_ALLOW: &str = "d284581fa201270458196469643a6578616d706c653a6a63702d7265666572656e6365a05901d2ae65747275737467636f6e74726f6c66616374696f6e64726561646669737375657278386469643a6b65793a7a364d6b6f6e334e656364364e6b6b79666f476f48786964327a6e476335394c55334b376d756261526346624c664c5867636f73745f756a181e677374657761726478196469643a6578616d706c653a6a63702d7265666572656e6365677375626a65637478386469643a6b65793a7a364d6b6f39685467674d776a535445614a615055664536747163793278765536426e4e713365336f38715642697948677665726469637465616c6c6f77686772616e745f6964784033623161356139636262373831353134636637353162613030376530373765383038333937376234663037623130346433366565393034643932383939386334687265736f75726365784030663766623535636565393361623937373738323936303865383531666133316536386531326462396466633061383032366164323938333134636633663932696275646765745f756a18646a6672616d655f6b696e6469746f6f6c2d63616c6c6b6a63705f72656365697074656a63702f3171656e657267795f70726f76656e616e63656748775368756e74736275646765745f72656d61696e696e675f756a184658405a7be56b33956c069d4e23127baa7b090e5028b9704dff6ca5ac46da546534e667151f80d7d7a605bcc31ea2bb33ec971e3e8b8794f7248a18b34c33bc438509"; -- 2.54.0 (Apple Git-157)