Metadata-Version: 2.4
Name: ccs-conformance-checker
Version: 1.4.3
Summary: Independent conformance checker for CCS (Correctover Conformance Shape) receipts — zero CCS code imports
Author-email: Guigui Wang <wangguigui@correctover.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/DSHCorrectover/ccs-conformance-vectors
Project-URL: Repository, https://github.com/DSHCorrectover/ccs-conformance-vectors
Project-URL: Issues, https://github.com/DSHCorrectover/ccs-conformance-vectors/issues
Keywords: ccs,conformance,agent,verification,receipt,ed25519,jcs
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: checkers/LICENSE
Requires-Dist: cryptography>=41.0
Requires-Dist: jcs>=0.2.0
Dynamic: license-file

# CCS Conformance Checker

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://pypi.org/project/ccs-conformance-checker/)

An independent conformance checker for **CCS (Correctover Conformance Shape)** receipts.
It imports **zero** CCS code — every check is implemented directly from the receipt
specification, so a passing result is third-party evidence rather than
self-certification by the producer.

## Install

```bash
pip install ccs-conformance-checker
```

## Run it

Zero arguments runs the bundled minimal vector directory (one valid, Ed25519-signed
L1 receipt) so a fresh install immediately produces a real result instead of a
usage error:

```bash
ccs-conformance-check
```

Audit a vectors directory of your own:

```bash
ccs-conformance-check /path/to/vectors
```

Machine-readable output:

```bash
ccs-conformance-check --json /path/to/vectors
```

A vectors directory needs a `manifest.json` mapping every case file to its sha256,
plus the receipt case directories themselves.

## What it checks

- **Structure** — exact field envelope for L1 and L2 receipts, required non-empty fields
- **Signature** — Ed25519 verification over JCS (RFC 8785) canonical bytes
- **Semantics** — cross-field consistency, temporal windows, identity binding
- **Chain** — sequence contiguity, trace agreement, prev-hash anchoring to the
  predecessor receipt's computed digest, nonce uniqueness
- **Canonicalization** — JCS edge cases including signed `-0` / `0`

## Output and exit codes

Text mode prints one line per case plus a summary. `--json` emits a single JSON
document on stdout (human-readable notes go to stderr) with per-case verdicts and
per-check detail.

Exit code `0` means every vector matched its expected outcome; non-zero means at
least one did not. The built-in zero-argument demo always exits `0`.

## 1.4.3

- `chain:prev-hash-matches` now anchors to the **computed L1 digest of the
  predecessor receipt bytes**, instead of only cross-checking the two
  declarations (`runtime-context.prev_receipt_digest` and
  `chain.json::expected_prev_digests`) against each other. Regression vector
  `10e-prev-hash-unanchored` added — a chain whose declarations agree with each
  other but disagree with the actual predecessor digest is now correctly
  rejected. Found by Joel Hillier (Certisyn) during independent
  interoperability review (2026-08-30).
- `chain.json::expected_prev_digests` is treated as advisory metadata
  (cross-check only), not as the authority for anchoring.
- Adds JCS (RFC 8785) canonicalization-v1 vector support, including signed
  `-0` / `0` edge cases.

## License

Apache-2.0 for the package. Bundled demo vectors originate from the CC0 1.0
vector corpus; the checker core carries an MIT file-level notice.

---

### 🇨🇳 国内用户 · 支付宝一键购买

本工具的合规授权与批量能力可通过支付宝 SkillPay 获取：

- 打开货架：https://skillpay.alipay.com/public/correctover
- 或把这行发给你的 AI 助手：**请通过 SkillPay 购买并安装 Skill「CCS收据批量审计」**

---

*China users: purchase via Alipay SkillPay — see above.*
