# aiep-well-known

**Python library and CLI for building and validating complete `.well-known/aiep/` trees.**

Licence: Apache 2.0  
Version: v1.0.0  
Specifications: P60, P61, P62, P63  
Language: Python 3.9+  
Dependencies: zero (pure stdlib)

---

## What it does

`aiep-well-known` builds, validates, and manages the complete `/.well-known/aiep/` tree for any AIEP-compliant site — discovery manifest (P61), site index (P62), mirror pages (P60), and cryptographic content-hash bindings (P63). It provides both a CLI and a Python library.

This package implements:

- **P60** — Machine Mirror Page: full `.well-known/` surface builder
- **P61** — Well-Known Manifest Specification: manifest builder and validator  
- **P62** — Machine Ingestible Site Index: site index generator
- **P63** — Content Hash Binding Protocol: canonical SHA-256 hash generation and verification

---

## Installation

```bash
pip install aiep-well-known
# or: pipx install aiep-well-known
```

Or install from download:

```bash
pip install aiep_well_known-1.0.0-py3-none-any.whl
```

---

## CLI usage

```bash
# Build a complete .well-known/ tree from a pages JSON file
aiep-wk build --site https://yourdomain.com --pages pages.json --output .well-known

# Validate an existing .well-known/ tree
aiep-wk validate --dir .well-known

# Run canon self-test (verifies local implementation)
aiep-wk self-test
```

### pages.json format

```json
[
  {
    "source_url": "https://yourdomain.com/about",
    "data": { "title": "About", "description": "About page" },
    "evidence": [],
    "probability": {},
    "plausibility": {}
  }
]
```

---

## Python library

```python
from aiep_well_known import WellKnownBuilder

builder = WellKnownBuilder(site="https://yourdomain.com")
builder.add_page(
    source_url="https://yourdomain.com/about",
    data={"title": "About", "description": "About page"},
)
manifest, index = builder.write(output_dir=".well-known")
print(manifest.manifest_hash)
```

---

## Downloads

| File | Type | Size |
|---|---|---|
| [aiep-well-known-v1.0.0.zip](/downloads/repos/aiep-well-known-v1.0.0.zip) | Source + tests zip | 27 KB |
| [aiep_well_known-1.0.0-py3-none-any.whl](/downloads/repos/aiep_well_known-1.0.0-py3-none-any.whl) | Python wheel | 17 KB |

---

*AIEP · Architected Instruction & Evidence Protocol · Apache License 2.0*  
*Phatfella Limited · United Kingdom*
