open-standards/jouleclaw/jouleclaw-rs/crates/jouleclaw-jcr1/conformance/vectors-v1_1.json
Transaction Science 38154aed23 jouleclaw-jcr1: implement JCR-1 v1.1 — intent in the signed core (+3 vectors)
The v1.1 proposal in `docs/JCR-1-v1.1-intent.md` shipped as a draft;
this commit lands the code path + 3 conformance vectors so a v1.1
verifier can be built against fixtures instead of prose.

## What's added

- `to_jcr1_wire_v1_1(&Receipt) -> Value` — identical to `to_jcr1_wire`
  EXCEPT `intent` is carried into the projection when present on the
  receipt: `intent: { intent: enum, classifier_id: string }`. The
  verdict's `confidence: f64` is intentionally NOT included — JCR-1
  §3.1 bars floats from the signed core.
- `canonical_signed_core_v1_1(&Receipt) -> Vec<u8>` — convenience
  wrapping the projection + det-CBOR encode.
- 3 new conformance vectors in `conformance/vectors-v1_1.json`:
  - **V11** L0 cache hit + intent=comprehension. Baseline: intent in
    the signed core with no tools_touched.
  - **V12** L3 model + intent=generation + ModelBased. Intent
    coexists with `tools_touched` and the mJ honesty floor.
  - **V13** Promoted skill collapses V5 to L1 9 µJ + intent=
    comprehension. The Priscilla 67% headline made signed-auditable.
- `examples/gen_v1_1_vectors.rs` — the generator that mints the 3
  vectors. Rerun any time the v1.1 surface changes.

## Backward compatibility

`v1_1_is_backward_compatible_with_v1_0_canonical_vectors` asserts the
10 canonical v1.0 vectors continue to verify byte-for-byte under the
v1.1 encoder — none of them carry `intent`, so v1.1 produces
identical canonical bytes to v1.0 in their absence. v1.0 verifiers
transparently include unknown fields in their re-encode (per JCR-1
§8), so they also accept v1.1 vectors with `intent` populated.

## Tests added

7 new tests on top of the 25 existing (now 32 total):

- `v1_1_vector_set_has_three_entries`
- `v1_1_vectors_re_encode_byte_identical` — the decisive byte-equal
  test for the v1.1 fixtures
- `v1_1_vectors_pass_envelope_verification`
- `v1_1_vectors_pass_honesty_consistency`
- `v1_1_projection_includes_intent_in_wire_form`
- `v1_1_projection_omits_intent_when_unset`
- `v1_1_is_backward_compatible_with_v1_0_canonical_vectors`

Workspace regression: still green.
2026-06-01 21:16:41 -04:00

90 lines
No EOL
7.4 KiB
JSON

{
"canonical_cbor": "RFC 8949 §4.2.1 length-first key order",
"envelope": "COSE_Sign1 (RFC 9052), EdDSA/Ed25519",
"signed_core_adds_v1_1": [
"intent.intent",
"intent.classifier_id"
],
"signed_core_excludes": [
"token_attributions"
],
"spec": "JCR-1",
"spec_revision": "v1.1-draft",
"vector_count": 3,
"vectors": [
{
"cose_sign1_hex": "d284582fa201270458296469643a6b6572693a454a397465737453746577617264414944303030303030303030303030303030a059011fa962696469726370742d303031316474696572624c3066696e74656e74a266696e74656e746d636f6d70726568656e73696f6e6d636c61737369666965725f69646c6865757269737469633a7631677374657761726478296469643a6b6572693a454a39746573745374657761726441494430303030303030303030303030303069636c6f7365645f617474323032362d30352d33315431383a30343a32325a696a6f756c65735f756a026a696e7075745f686173687840386338313134656664623964373030303333376465353162656438663930363164326634343163333538396366386138306639653635376139623237343433346a6a635f72656365697074613171656e657267795f70726f76656e616e63656748775368756e74584076dfa7617f03bd96a6613ea88279a7a361003d35e699371cbaf51865176ded7366b777c3b004cd654e60a57b38fc2ea634e9c497b0b1a205244ba8e0dbfc8b05",
"description": "L0 cache hit + intent=comprehension. JCR-1 v1.1 baseline: intent in signed core.",
"n": 11,
"receipt": {
"closed_at": "2026-05-31T18:04:22Z",
"energy_provenance": "HwShunt",
"id": "rcpt-0011",
"input_hash": "8c8114efdb9d7000337de51bed8f9061d2f441c3589cf8a80f9e657a9b274434",
"intent": {
"classifier_id": "heuristic:v1",
"intent": "comprehension"
},
"jc_receipt": "1",
"joules_uj": 2,
"steward": "did:keri:EJ9testStewardAID000000000000000",
"tier": "L0"
},
"signed_core_cbor_hex": "a962696469726370742d303031316474696572624c3066696e74656e74a266696e74656e746d636f6d70726568656e73696f6e6d636c61737369666965725f69646c6865757269737469633a7631677374657761726478296469643a6b6572693a454a39746573745374657761726441494430303030303030303030303030303069636c6f7365645f617474323032362d30352d33315431383a30343a32325a696a6f756c65735f756a026a696e7075745f686173687840386338313134656664623964373030303333376465353162656438663930363164326634343163333538396366386138306639653635376139623237343433346a6a635f72656365697074613171656e657267795f70726f76656e616e63656748775368756e74"
},
{
"cose_sign1_hex": "d284582fa201270458296469643a6b6572693a454a397465737453746577617264414944303030303030303030303030303030a059017eaa62696469726370742d303031326474696572624c3366696e74656e74a266696e74656e746a67656e65726174696f6e6d636c61737369666965725f69646c6865757269737469633a7631677374657761726478296469643a6b6572693a454a39746573745374657761726441494430303030303030303030303030303069636c6f7365645f617474323032362d30352d33315431383a30343a32325a696a6f756c65735f756a1a0033e1406a696e7075745f686173687840323265333462643961666163656534643630313834346430623863616235313734323763356130316534383466366166313835376230383765646161303664366a6a635f7265636569707461316d746f6f6c735f746f756368656481a367746f6f6c5f6964766d6f64656c3a67656d6d61342d39622d71355f6b5f6d696a6f756c65735f756a1a0033e14071656e657267795f70726f76656e616e63656a4d6f64656c426173656471656e657267795f70726f76656e616e63656a4d6f64656c42617365645840846be540c3c8a8423dfff0c7056a252b8bb7b55f7314f2ecf8cb308424ab02c5a00cd9e3e133fd49f6e39bccfda6469a1d853c12df83b4d3406ca84c4e19270f",
"description": "L3 model + intent=generation + ModelBased; mJ floor + intent coexist in signed core.",
"n": 12,
"receipt": {
"closed_at": "2026-05-31T18:04:22Z",
"energy_provenance": "ModelBased",
"id": "rcpt-0012",
"input_hash": "22e34bd9afacee4d601844d0b8cab517427c5a01e484f6af1857b087edaa06d6",
"intent": {
"classifier_id": "heuristic:v1",
"intent": "generation"
},
"jc_receipt": "1",
"joules_uj": 3400000,
"steward": "did:keri:EJ9testStewardAID000000000000000",
"tier": "L3",
"tools_touched": [
{
"energy_provenance": "ModelBased",
"joules_uj": 3400000,
"tool_id": "model:gemma4-9b-q5_k_m"
}
]
},
"signed_core_cbor_hex": "aa62696469726370742d303031326474696572624c3366696e74656e74a266696e74656e746a67656e65726174696f6e6d636c61737369666965725f69646c6865757269737469633a7631677374657761726478296469643a6b6572693a454a39746573745374657761726441494430303030303030303030303030303069636c6f7365645f617474323032362d30352d33315431383a30343a32325a696a6f756c65735f756a1a0033e1406a696e7075745f686173687840323265333462643961666163656534643630313834346430623863616235313734323763356130316534383466366166313835376230383765646161303664366a6a635f7265636569707461316d746f6f6c735f746f756368656481a367746f6f6c5f6964766d6f64656c3a67656d6d61342d39622d71355f6b5f6d696a6f756c65735f756a1a0033e14071656e657267795f70726f76656e616e63656a4d6f64656c426173656471656e657267795f70726f76656e616e63656a4d6f64656c4261736564"
},
{
"cose_sign1_hex": "d284582fa201270458296469643a6b6572693a454a397465737453746577617264414944303030303030303030303030303030a059016faa62696469726370742d303031336474696572624c3166696e74656e74a266696e74656e746d636f6d70726568656e73696f6e6d636c61737369666965725f69646c6865757269737469633a7631677374657761726478296469643a6b6572693a454a39746573745374657761726441494430303030303030303030303030303069636c6f7365645f617474323032362d30352d33315431383a30343a32325a696a6f756c65735f756a096a696e7075745f686173687840643564336535333732346636376339663862363061623933363531396639613339626361656536623531326461626334393034363861643963663539653737656a6a635f7265636569707461316d746f6f6c735f746f756368656481a367746f6f6c5f69647270726f6d6f7465643a63616368652e686974696a6f756c65735f756a0971656e657267795f70726f76656e616e63656748775368756e7471656e657267795f70726f76656e616e63656748775368756e745840ee2fcc60de1f04de909cec07bd1bed090de6d318d2e6fa191ca05840d6f93a0826004a969c7323ec46967463b75d69980383c60c9af89e82469bdf7b08c76403",
"description": "Promoted skill collapses V5 to L1 9 µJ; intent=comprehension records the workload mix.",
"n": 13,
"receipt": {
"closed_at": "2026-05-31T18:04:22Z",
"energy_provenance": "HwShunt",
"id": "rcpt-0013",
"input_hash": "d5d3e53724f67c9f8b60ab936519f9a39bcaee6b512dabc490468ad9cf59e77e",
"intent": {
"classifier_id": "heuristic:v1",
"intent": "comprehension"
},
"jc_receipt": "1",
"joules_uj": 9,
"steward": "did:keri:EJ9testStewardAID000000000000000",
"tier": "L1",
"tools_touched": [
{
"energy_provenance": "HwShunt",
"joules_uj": 9,
"tool_id": "promoted:cache.hit"
}
]
},
"signed_core_cbor_hex": "aa62696469726370742d303031336474696572624c3166696e74656e74a266696e74656e746d636f6d70726568656e73696f6e6d636c61737369666965725f69646c6865757269737469633a7631677374657761726478296469643a6b6572693a454a39746573745374657761726441494430303030303030303030303030303069636c6f7365645f617474323032362d30352d33315431383a30343a32325a696a6f756c65735f756a096a696e7075745f686173687840643564336535333732346636376339663862363061623933363531396639613339626361656536623531326461626334393034363861643963663539653737656a6a635f7265636569707461316d746f6f6c735f746f756368656481a367746f6f6c5f69647270726f6d6f7465643a63616368652e686974696a6f756c65735f756a0971656e657267795f70726f76656e616e63656748775368756e7471656e657267795f70726f76656e616e63656748775368756e74"
}
]
}