diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b3a9c7..3c08336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,52 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.0] - 2026-07-24 + +### Fixed + +- **Signature verification against current Pipelock releases.** The v1 canonical + projection omitted nine fields the emitter signs, so every receipt produced by + a current Pipelock failed verification. `decision_phase` is emitted on ordinary + proxy decisions, which made the break total rather than partial. Restores + `decision_phase`, `defer_id`, `resolution_policy`, `resolution_source`, + `session_id`, `session_id_original`, `run_nonce`, `key_transition` and + `session_control` in the emitter's declaration order, with the nested ordering + and omitempty semantics the frozen signing projection uses. + +- **Chain hash coverage of the `ext` bag.** The receipt envelope omitted `ext`, + but the emitter's receipt hash is a digest over the marshalled receipt and + `ext` is a marshalled field. The chain hash was therefore identical with and + without `ext`, and `ext` could be attached or altered without moving the hash + the chain commits to. `ext` is now included, ordered last, and its original + bytes are preserved from the source JSON, since the emitter writes it verbatim + and re-serializing it changes key order, number spelling and escaping. + +- **Seven classes of chain that verified here and are rejected by the emitter.** + Malformed `session_control`, out-of-range `chain_seq`, unknown signed fields, + malformed nested objects, misplaced `key_transition` markers, restart opens not + bound to the prior tail, and unbounded integer counters were all accepted with + a valid signature. + +### Added + +- **Bound session-open genesis validation.** Chains anchored with the `g1:` + prefix are checked against the genesis digest the emitter computes, including + the run and open nonces, policy hash, signer key epoch, and the posture and + containment binding. + +- **A regression fixture captured from a real release binary**, covering session + open, heartbeat and close, evidence receipts, transcript root and checkpoint + records, with the root hash pinned to the value the Go verifier independently + computes. Parity is checked against genuine emitter output rather than + hand-written data that can drift alongside the code it is meant to check. + +### Note + +0.2.0 was never published to PyPI. Upgrading from 0.1.1 picks up the +EvidenceReceipt v2 support and well-known directory helpers described under +0.2.0 as well as everything above. + ## [0.2.0] - 2026-05-01 ### Added diff --git a/pipelock_verify/__init__.py b/pipelock_verify/__init__.py index f40718b..0aa551d 100644 --- a/pipelock_verify/__init__.py +++ b/pipelock_verify/__init__.py @@ -30,7 +30,7 @@ Trust anchors are opt-in. Pass ``public_key_hex`` to pin a specific signer, or leave it empty to trust the key embedded in the receipt (chain mode then -enforces signer consistency across every v1 receipt in the file). v0.2.0 +enforces signer consistency across every v1 receipt in the file). This release rejects EvidenceReceipt v2 in chain mode; verify v2 receipts individually with verify() or verify_evidence(). @@ -60,7 +60,7 @@ verify_chain, ) -__version__ = "0.2.0" +__version__ = "0.3.0" __all__ = [ "PAYLOAD_AUTHORITY", diff --git a/pipelock_verify/_evidence.py b/pipelock_verify/_evidence.py index 7ecb1fa..386a0de 100644 --- a/pipelock_verify/_evidence.py +++ b/pipelock_verify/_evidence.py @@ -502,7 +502,7 @@ def _check_fields( Python ``int`` (not str), because the Go reference emits them as typed integers and the JCS preimage byte-shape differs. - NOTE: for v0.2.0 the type guard is limited to integer-shaped count + NOTE: the type guard is currently limited to integer-shaped count fields. Full per-field type schemas (string vs list-of-string vs nested object shape) are tracked as a v0.3 follow-up. """ diff --git a/pipelock_verify/_verify.py b/pipelock_verify/_verify.py index c5d487c..a3769c9 100644 --- a/pipelock_verify/_verify.py +++ b/pipelock_verify/_verify.py @@ -1018,8 +1018,8 @@ def _verify_chain_list( if not receipts: return ChainResult(valid=True, receipt_count=0) - # v2 chain verification is a v0.3 follow-up. v0.2.0 surfaces v2 - # envelopes via verify_evidence() one at a time. If a chain contains + # v2 chain verification is not implemented. v2 envelopes are surfaced + # via verify_evidence() one at a time. If a chain contains # any v2 receipt we fail closed rather than silently treating it as # v1, which would falsely fail every v2 chain. Mixed v1/v2 chains # are blocked for the same reason: chain-hash bridging across v1 @@ -1036,7 +1036,7 @@ def _verify_chain_list( valid=False, broken_at_seq=broken, error=( - "v2 chain verification not yet implemented in v0.2.0; " + "v2 chain verification is not implemented; " "verify v2 receipts individually with verify_evidence()" ), ) diff --git a/pyproject.toml b/pyproject.toml index 56a8e40..4057785 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pipelock-verify" -version = "0.2.0" +version = "0.3.0" description = "Verify Pipelock receipts: ActionReceipt v1 chains and individual EvidenceReceipt v2 envelopes." readme = "README.md" license = "Apache-2.0" diff --git a/tests/test_regressions.py b/tests/test_regressions.py index 4e55213..cdc9c07 100644 --- a/tests/test_regressions.py +++ b/tests/test_regressions.py @@ -9,6 +9,7 @@ import hashlib import json +import re from pathlib import Path from typing import Any @@ -904,3 +905,22 @@ def test_ext_stays_out_of_the_signed_action_record_projection(): assert not result.valid assert "unknown signed field" in (result.error or "") + + +def test_dunder_version_matches_pyproject(): + """`__version__` and the packaging version must not drift apart. + + The release workflow checks the git tag against pyproject.toml, and nothing + checked pyproject.toml against `__version__`, so the package could ship + announcing a version it was not. This closes that side of the triangle. + """ + # Parsed with a regex rather than tomllib, which is 3.11+ while this + # package still supports 3.10. + pyproject = Path(__file__).resolve().parent.parent / "pyproject.toml" + match = re.search(r'^version = "([^"]+)"', pyproject.read_text(encoding="utf-8"), re.MULTILINE) + assert match is not None, "could not find the version in pyproject.toml" + declared = match.group(1) + + assert pipelock_verify.__version__ == declared, ( + f"__version__ is {pipelock_verify.__version__} but pyproject.toml says {declared}" + )