jcp-receipt: move an orphaned doc comment onto the test it describes #98

Closed
dcharlot wants to merge 1 commit from ci/jcp-pack into main
Owner

A paragraph headed "The migration guarantee" sits between two tests in
jcp-receipt/src/lib.rs with no item of its own, so Rust merges it into the doc
of the next item — an_absent_environment_leaves_the_bytes_untouched, a test
about environment bindings with nothing to do with legacy receipts. It reads as
documentation for a deleted test.

It also names the wrong file: "published in conformance/v1/vectors.json". The
bytes are in legacy_jcp1.json, byte-identical to the hex constant in
published_v1_receipts_still_verify (checked).

The paragraph now documents published_v1_receipts_still_verify — the test that
actually carries the guarantee — names the right file, and notes that the inlined
constant copies only the file's allow envelope while the file also carries a
deny. Both are verified against the file by jcp-conformance's
tests/pack.rs, via extract and so verify_cose_sign1, which also requires
both verdicts to be present.

Doc comments only; jcp-receipt green (21 tests).

Narrowed

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. The orphaned comment is the part main did not fix —
it is still on main at jcp-receipt/src/lib.rs:881.

🤖 Generated with Claude Code


Closed: Superseded by #209, which cherry-picks this commit onto current main. This branch sat 1063 commits behind, so its green CI no longer meant anything; #209 re-verified the claims against main (legacy_jcp1.json exists, carries both an allow and a deny, and jcp-conformance/tests/pack.rs reads it) before pushing.

A paragraph headed **"The migration guarantee"** sits between two tests in `jcp-receipt/src/lib.rs` with no item of its own, so Rust merges it into the doc of the *next* item — `an_absent_environment_leaves_the_bytes_untouched`, a test about environment bindings with nothing to do with legacy receipts. It reads as documentation for a deleted test. It also names the wrong file: "published in `conformance/v1/vectors.json`". The bytes are in **`legacy_jcp1.json`**, byte-identical to the hex constant in `published_v1_receipts_still_verify` (checked). The paragraph now documents `published_v1_receipts_still_verify` — the test that actually carries the guarantee — names the right file, and notes that the inlined constant copies only the file's **allow** envelope while the file also carries a **deny**. Both are verified against the file by `jcp-conformance`'s `tests/pack.rs`, via `extract` and so `verify_cose_sign1`, which also requires both verdicts to be present. **Doc comments only**; `jcp-receipt` green (21 tests). ### Narrowed 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. The orphaned comment is the part main did not fix — it is still on main at `jcp-receipt/src/lib.rs:881`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- **Closed:** Superseded by #209, which cherry-picks this commit onto current main. This branch sat 1063 commits behind, so its green CI no longer meant anything; #209 re-verified the claims against main (legacy_jcp1.json exists, carries both an allow and a deny, and jcp-conformance/tests/pack.rs reads it) before pushing.
jcp: read back the five published vector files nothing was reading
All checks were successful
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 1m28s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m50s
standards workspaces build + test / aac-rs (pull_request) Successful in 33s
standards workspaces build + test / arl-rs (pull_request) Successful in 1m58s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 33s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 31s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m17s
standards workspaces build + test / map-rs (pull_request) Successful in 30s
standards workspaces build + test / mesh-rs (pull_request) Successful in 24s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m19s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 2m1s
standards workspaces build + test / openpay (pull_request) Successful in 1m14s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m4s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m9s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m59s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 2m29s
standards workspaces build + test / sense-rs (pull_request) Successful in 2m9s
8c0751bc89
JCP publishes seven conformance vector files. Two were read by a test
(`action_receipt.json` and `action_receipt_meta.json`, from
`jcp-action-receipt/tests/conformance.rs`). The other five were read by
nothing: `vectors.json`, `dual_ceilings.json`, `standing.json`, `meta.json`
and `legacy_jcp1.json`.

`jcp-conformance`'s `main()` — the binary CI runs — checks the implementation
against in-code expectations and never opens the pack directory, so those five
could drift from the implementation with only the generator any the wiser.
That is how joulehook and jouledesk ended up shipping stale JCR-1 envelopes
after the receipt payload gained a field.

Everything is recomputed, not re-read: the scenarios are rebuilt from the same
fixed keys and nonces `gen-vectors` uses, and the derived ids, signatures,
wires and sealed envelopes are compared to the published bytes. Nothing was
stale — all five reproduce exactly.

`legacy_jcp1.json` is the one that could not be re-derived, and should not be.
Those envelopes were sealed under the superseded `jcp/1` profile before
`payload_hash` existed, so they are *verified* instead, which is the guarantee
the file exists to defend. This was only partly covered before:
`published_v1_receipts_still_verify` checks the **allow** receipt from a hex
constant pasted into the test body, while the file carries **two**. The deny
receipt was published and never verified, and nothing tied the in-code copy to
the file a third party downloads. They are byte-identical today; now the file
is what is checked, and both receipts are.

Also moves an orphaned doc comment in `jcp-receipt`. The paragraph beginning
"**The migration guarantee**" sat between two tests with no item of its own, so
Rust merged it into the doc of `an_absent_environment_leaves_the_bytes_untouched`
— a test about a different thing entirely. It now documents
`published_v1_receipts_still_verify`, where it belongs, and names
`legacy_jcp1.json` rather than `vectors.json`, where those bytes actually live.
Reading it as a description of a missing test is what sent me looking; it
should not send the next person the same way.

Falsified, each assertion separately: corrupting a published envelope,
signature, pubkey or spend figure fails its test, and neutering the tamper flip
fails the tamper test. The one that matters most is behavioural rather than
byte-level — disabling the foreign-currency refusal in `jcp-runtime` (i.e.
inventing an exchange rate) fails the dual-ceiling test, so these bind to what
the implementation does and not merely to file-against-file agreement. The pack
was restored afterwards and is byte-identical to main.

Unrelated and pre-existing, confirmed on a branch that does not touch jcp:
`jcp-energy`'s `cumulative_advances_after_cpu_burn` fails on this Mac
(`before=0 after=0`), and `jcp-schema` does not pass `clippy -D warnings`.
Neither is reached by CI — the first is `cfg(target_os = "macos")` while
`jcp-rs` runs on the linux runner, and there is no clippy step.

Co-Authored-By: Claude Opus 5 <[email protected]>
dcharlot force-pushed ci/jcp-pack from 8c0751bc89
All checks were successful
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 1m28s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m50s
standards workspaces build + test / aac-rs (pull_request) Successful in 33s
standards workspaces build + test / arl-rs (pull_request) Successful in 1m58s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 33s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 31s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m17s
standards workspaces build + test / map-rs (pull_request) Successful in 30s
standards workspaces build + test / mesh-rs (pull_request) Successful in 24s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m19s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 2m1s
standards workspaces build + test / openpay (pull_request) Successful in 1m14s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m4s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m9s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m59s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 2m29s
standards workspaces build + test / sense-rs (pull_request) Successful in 2m9s
to b2abc5aa4f
Some checks failed
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 4s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m49s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 2m13s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m48s
standards workspaces build + test / arl-rs (pull_request) Successful in 5m23s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m57s
standards workspaces build + test / aac-rs (pull_request) Successful in 4m3s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m8s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 4m12s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m53s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m20s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 2m8s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 14s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 7m58s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 40s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 1m24s
standards workspaces build + test / map-rs (pull_request) Successful in 1m42s
standards workspaces build + test / mesh-rs (pull_request) Successful in 33s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 6m8s
standards workspaces build + test / openpay (pull_request) Successful in 2m23s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 1m29s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 52s
standards workspaces build + test / sense-rs (pull_request) Successful in 8m10s
standards workspaces build + test / macOS energy backend (jcp-energy) (pull_request) Successful in 17m53s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 15m47s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 14m33s
WAI conformance / cargo-class corpora · windows (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · windows (pull_request) Has been cancelled
2026-09-29 01:24:27 -04:00
Compare
dcharlot changed title from jcp: read back the five published vector files nothing was reading to jcp-receipt: move an orphaned doc comment onto the test it describes 2026-09-29 01:24:35 -04:00
dcharlot closed this pull request 2026-10-10 17:20:25 -04:00
Some checks failed
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 4s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m49s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 2m13s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m48s
standards workspaces build + test / arl-rs (pull_request) Successful in 5m23s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m57s
standards workspaces build + test / aac-rs (pull_request) Successful in 4m3s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m8s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 4m12s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m53s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m20s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 2m8s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 14s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 7m58s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 40s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 1m24s
standards workspaces build + test / map-rs (pull_request) Successful in 1m42s
standards workspaces build + test / mesh-rs (pull_request) Successful in 33s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 6m8s
standards workspaces build + test / openpay (pull_request) Successful in 2m23s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 1m29s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 52s
standards workspaces build + test / sense-rs (pull_request) Successful in 8m10s
standards workspaces build + test / macOS energy backend (jcp-energy) (pull_request) Successful in 17m53s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 15m47s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 14m33s
WAI conformance / cargo-class corpora · windows (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · windows (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!98
No description provided.