Metadata-Version: 2.4
Name: context-passport-conformance
Version: 1.0.0a1
Summary: Conformance test suite and runner for the Context Passport open standard.
Author: Context Passport maintainers
License: Apache-2.0
Project-URL: Homepage, https://contextpassport.com
Project-URL: Specification, https://github.com/contextpassport/spec
Project-URL: Repository, https://github.com/contextpassport/conformance-tests
Project-URL: Issues, https://github.com/contextpassport/conformance-tests/issues
Keywords: context-passport,conformance,testing,ai-agents
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE-APACHE
License-File: LICENSE-CC0
Provides-Extra: reference
Requires-Dist: context-passport>=1.0.0a2; extra == "reference"
Dynamic: license-file

# Context Passport Conformance Tests

The test suite that any Context Passport implementation can run against to verify v1.0 conformance.

**Specification:** https://github.com/contextpassport/spec

## Licensing

- **Test vectors** (everything under `vectors/`) — CC0 1.0. See `LICENSE-CC0`. Free to use, modify, redistribute.
- **Runner code** (everything under `runner/`) — Apache-2.0. See `LICENSE-APACHE`.

## What conformance means

An implementation is **Context Passport v1.0 conformant** if it passes every test in `vectors/required/`. Implementations may additionally pass tests in `vectors/signed/` or `vectors/recommended/` to claim stronger conformance levels.

## Conformance levels

| Level | Requirements |
|---|---|
| **Core** | All vectors in `vectors/required/` pass. The implementation can produce and consume passports that validate against `schema/v1.json` and compute integrity hashes correctly. |
| **Signed** | Core, plus all vectors in `vectors/signed/` pass. The implementation produces signed passports (SPEC.md section 3.2.7) and verifies signatures correctly. |
| **Full** | Signed, plus all vectors in `vectors/recommended/` pass. The implementation handles fork/merge lineage, extension namespacing, and forward compatibility correctly. |

## Vector format

Each test vector is a JSON file with three sections:

```json
{
  "name": "v01_root_commit",
  "description": "A valid root passport with no parent.",
  "input": { ... passport or chain to be evaluated ... },
  "expected": { ... expected verification result ... }
}
```

Implementations under test load the vector, perform the relevant operation, and compare output against `expected`.

## Required vectors (Core)

1. `v01_root_commit.json` — Valid root passport with no parent.
2. `v02_chained_commit.json` — Child passport with linked parent.
3. `v03_canonical_payload.json` — Two key-orderings produce identical hashes.
4. `v04_broken_chain.json` — Tampered payload is detected.
5. `v05_schema_version.json` — Missing `schema_version` is rejected.
6. `v06_unknown_extension.json` — Unknown namespaced field is accepted and ignored.

## Signed vectors

7. `v07_ed25519_valid.json` — Valid Ed25519 signature verifies.
8. `v08_ed25519_tampered.json` — Modified payload fails signature verification.
9. `v09_signature_canonicalization.json` — Signature is over canonical bytes with signature field cleared.

## Recommended vectors

10. `v10_fork_lineage.json` — Fork populates lineage fields.
11. `v11_event_types.json` — All event types accepted.
12. `v12_long_chain.json` — 100-commit chain verifies.

## Running the suite

A reference test runner in Python is published at `runner/python/run.py`. To run against an implementation:

```bash
python runner/python/run.py --implementation <module_name>
```

Implementations in other languages should ship their own runners that load each vector and report pass/fail against `expected`.

## Conformance badge

Implementations that pass all required vectors may self-declare:

```
Context Passport v1.0 Core Conformant
```

This is self-attestation. Independent verification is encouraged but not required.

## Contributing

Open a pull request adding a new vector under the appropriate directory. Vectors should:

1. Test one specific behavior
2. Include clear `expected` output
3. Be reproducible across implementations
4. Follow the naming convention `vNN_short_description.json`

See [CONTRIBUTING.md](https://github.com/contextpassport/spec/blob/main/CONTRIBUTING.md) in the spec repository for general guidelines.
