Metadata-Version: 2.4
Name: vcp-governance
Version: 0.1.0
Summary: Value Context Protocol — governance layer: multi-stakeholder deliberation, M-of-N constitutional amendment, federated attestation, drift detection, insurability.
Author: Creed Space
License: Apache-2.0
Project-URL: Homepage, https://valuecontextprotocol.org
Project-URL: Repository, https://github.com/Creed-Space/vcp-governance
Project-URL: Protocol SDK, https://github.com/Creed-Space/vcp-sdk-python
Keywords: ai-safety,ai-governance,constitutional-ai,vcp,attestation,consensus,agent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: pydantic>=2
Provides-Extra: crypto
Requires-Dist: cryptography>=42; extra == "crypto"
Dynamic: license-file

# VCP — Governance Layer

The **Value Context Protocol** lets an AI agent carry a machine-readable declaration of what it
holds itself to, and lets other parties reason about it. This repository is the **governance layer**:
the types, wire formats and algorithms for deciding things *together* — multi-stakeholder
deliberation, constitutional amendment with quorum, attestation and trust chains, drift detection,
and insurability scoring.

The protocol core (tokens, CSM1 codes, VCP-Lite, context) lives in the
[VCP SDK](https://github.com/Creed-Space/vcp-sdk-python) — `pip install vcp-sdk`.
Spec and docs: <https://valuecontextprotocol.org>.

Apache-2.0.

## ⚠️ Read this before you deploy it

**Several modules here are reference implementations, and they say so in their own docstrings.**

The clearest example: `GovernanceAuthority` implements M-of-N constitutional amendment signing — and
stores its state in **module-level Python dicts**. That means every registered authority and every
in-flight amendment proposal is **lost on restart**, and a multi-instance deployment gets a
*different* store per instance, so quorum can never actually be reached.

That is deliberate. This library defines the **types, the wire format and the quorum semantics**, and
stays storage-agnostic so you can bind it to a durable, authenticated store you actually run. But if
a constitution can be amended by an M-of-N vote, the record of who signed what must outlive a
process restart — otherwise the governance is theatre.

**Do not build real constitutional governance on the in-memory stores.** Substitute a database first.

## What's in here

| Module | What it does |
|---|---|
| `consensus/` | Schulze ranked-preference voting and the deliberation lifecycle |
| `governance_authority` | M-of-N constitutional amendment with quorum |
| `attestation_authority` | Federated trust chains (SELF / PEER / AUTHORITY / CHAIN) with drift-triggered revocation |
| `drift_check` | Detects a constitution drifting from what it claimed to be |
| `insurability` / `economic` | Auditability rubric — deliberately a *rubric*, not a model, so everyone computes it the same way |
| `context_opacity` | Raw affective/somatic signals never reach the model; only a graded protection level does |
| `audit_chain` | SHA-256 hash chain over decisions |
| `identity/`, `semantics/`, `negotiation/`, `adaptation/`, `messaging/` | Identity tokens, CSM1 semantics, negotiation, adaptation, envelopes |

## Signing

VCP never touches your keys. It depends on a two-method interface:

```python
from vcp_governance.signer import Signer, Ed25519Signer

signer = Ed25519Signer(private_key_bytes=my_seed, key_id="my-issuer")   # key by INJECTION
```

Implement `Signer` yourself to back it with an HSM, a KMS, or anything else. Key custody is a
deployment concern and belongs to you, not to a protocol library.

## Defaults

`vcp_governance/defaults.py` gathers every value that points at Creed Space infrastructure, in one place,
because they are the ones you are most likely to want to change and least likely to notice.

In particular, **`ASSESSOR_ID` defaults to `creed-space`**. If you issue your own competence claims,
override it — otherwise your claims assert that *we* assessed them, which we did not.

## Install

```bash
pip install vcp-governance          # once published
pip install vcp-governance[crypto]  # + the Ed25519 reference signer
```

## Status

Extracted from the Creed Space monorepo. The public API may move before 1.0. Issues and PRs welcome.
