# AIEP-GENOME-SDK

**The canonical AIEP kernel implementation — evidence, hashing, governance, divergence graph, and reasoning primitives.**

Licence: Apache 2.0  
Version: v1.2.0  
Specifications: P01R, P55, P66, P67 (kernel), plus P10, P14, P16, P37, P38, P39, P63  
Language: Python 3.9+  
Dependencies: zero (pure stdlib)

---

## What it does

The AIEP GENOME SDK is the open reference implementation of the AIEP kernel protocol. It provides the cryptographic primitives, evidence commitment lifecycle, governance gates, divergence graph, negative proof, and arbitration logic that all AIEP-compliant agents must implement.

This SDK implements:

- **P01R** — DivergenceGraph: canonical divergence tracking with arc operators
- **P14** — Evidence lifecycle hash (create → commit → archive → retract)
- **P16** — Negative proof record: cryptographically binding absence of evidence
- **P37** — NPIC arbitration: governed admissibility gate (MAX_ACTIVE_FRONTIER)
- **P55** — Feature extraction: FeatureVector, SimilarityRecord, weighted similarity
- **P63** — Canon R1–R8: SHA-256, hex-lower, length-prefixed, NFC, canonical JSON
- **P66** — Probability metadata envelope: ProbabilityEnvelope, FreshnessIndicator
- **P67** — Plausibility constraints: fail-closed admissibility (severity ≥ 4 → non-admissible)

---

## Installation

```bash
pip install aiep-genome-sdk
# or: pipx install aiep-genome-sdk
```

Or install from download:

```bash
pip install aiep_genome_sdk-1.2.0-py3-none-any.whl
```

---

## CLI

```bash
# Run canon self-test (R1–R8 verification)
aiep-genome self-test

# Hash a file or string using AIEP canonical hash
aiep-genome hash --string "hello world"
aiep-genome hash --file ./artefact.json

# Show SDK version and kernel version
aiep-genome version
```

---

## Python library

```python
from aiep_genome.kernel import (
    sha256_hex, concat_hash, canonical_json,
    evidence_commitment, lifecycle_hash,
    DivergenceGraphBuilder,
    FeatureVector, extract_feature_vector, compute_similarity,
    ProbabilityEnvelope, build_probability_envelope,
    PlausibilityConstraint, is_non_admissible,
    KERNEL_VERSION,
)

# Compute a canonical hash
h = sha256_hex(canonical_json({"key": "value"}))

# Build a divergence graph
graph = DivergenceGraphBuilder()
root = graph.add_node("root", operator="genesis", payload={"boot": True})

# Check plausibility fail-closed rule
# Any FAIL with severity >= 4 makes a page non-admissible
admissible = not is_non_admissible(constraints)
```

See the [GENOME Architectural Standard](/downloads/whitepapers/AIEP_GENOME_Architectural_Standard.md) for full integration guidance.

---

## Downloads

| File | Type | Size |
|---|---|---|
| [AIEP-GENOME-SDK-v1.2.0.zip](/downloads/repos/AIEP-GENOME-SDK-v1.2.0.zip) | Source zip | 136 KB |
| [aiep_genome_sdk-1.2.0-py3-none-any.whl](/downloads/repos/aiep_genome_sdk-1.2.0-py3-none-any.whl) | Python wheel | 40 KB |
