# aiep-hub-validator

**TypeScript endpoint validator for AIEP Mirror surfaces — 15 checks, SSRF guard, zero runtime dependencies.**

Licence: Apache 2.0  
Version: v2.0.0  
Specifications: P60, P61, P62, P63

---

## What it does

`aiep-hub-validator` validates that a live AIEP Mirror endpoint conforms to the full specification. It performs 15 structural checks against the `.well-known/aiep/` surface, verifies JSON schema compliance, checks canonical hash fields, and protects against SSRF with a built-in guard. It has zero runtime dependencies — a single TypeScript file can be deployed anywhere.

This repository implements:

- **P60** — Machine Mirror Page Standard: validates the complete surface structure
- **P61** — Well-Known Manifest Specification: validates `metadata.json` and `index.json` required fields
- **P62** — Machine Ingestible Site Index: validates discovery index linking conventions
- **P63** — Content Hash Binding Protocol: validates `sha256:<hex>` canonical hash fields

## Installation

```bash
npm install aiep-hub-validator
```

## Usage

```bash
# Validate a remote endpoint
npx aiep-hub-validator https://example.com

# Validate with verbose output
npx aiep-hub-validator https://example.com --verbose

# Validate a local .well-known/ tree
npx aiep-hub-validator --local ./.well-known/aiep/
```

## Checks performed

The validator checks for 15 required properties across the discovery surface, including:
- `index.json` present and parseable
- `metadata.json` present with `aiep_version` and `publisher` fields
- Certification claim consistency (fail-closed: if `certified: true`, certificate fields must be present)
- Schema references are resolvable
- Hash fields match the canonical `sha256:<hex>` format

## Download

[aiep-hub-validator-v2.0.0.zip](/downloads/repos/aiep-hub-validator-v2.0.0.zip)

---

*AIEP · Architected Instruction & Evidence Protocol · Apache License 2.0*  
*Phatfella Limited · United Kingdom*
