# MemoryUnit Extension & Registry Specification (Draft 1.0.0)

## 1. Purpose

Defines the process for registering domain payload schemas, event types, relation types, and anchor types used alongside the MemoryUnit Core Specification.

## 2. Registry Artifacts

- `registry/schemas.v1.json` – domain schema entries
- (Future) `registry/event-types.v1.json`
- (Future) `registry/relation-types.v1.json`
- (Future) `registry/anchor-types.v1.json`

## 3. Schema Registry Entry Structure

Each entry (object) contains:

- `id` (string, REQUIRED): Absolute URL (preferred) or URN.
- `version` (string, REQUIRED): Schema semantic version.
- `hash` (string, REQUIRED): `sha256:<hex>` of raw schema file.
- `kind` (string, REQUIRED): e.g. `domain`, `trust`, `legal`, `market`.
- `status` (enum): `active` | `deprecated` | `experimental` (default `active`).
- `description` (string): Human readable.
- `replaces` (string): Prior schema id if superseding.
- `deprecatedAt` (string date-time): If status is deprecated.

## 4. Submission Process

1. Open a pull request adding entry to registry file.
2. Include:
   - Schema file added under `schemas/` or resolvable external public URL
   - Computed SHA-256 hash (script provided) and evidence (log snippet)
3. Automated CI MUST validate hash & uniqueness of `id`+`version`.
4. A maintainer review ensures naming conventions.

## 5. Event Type Namespacing

Pattern: `segment[.segment]*` where `segment` = `[a-z0-9_]+`.
Recommended top-level segments: `market`, `trust`, `ml`, `legal`, `data`, `impact`, `audit`.
Experimental types MAY append `~exp` suffix.

## 6. Deprecation Workflow

- Mark entry `status: deprecated` and set `deprecatedAt`.
- Provide `replacedBy` pointer or guidance in description.
- Implementations SHOULD warn when ingesting deprecated schema IDs.

## 7. Integrity

- Hash mismatches on retrieval MUST be treated as integrity failure.
- Registries SHOULD be periodically snapshotted & anchored (Merkle root in transparency log or blockchain anchor).

## 8. Relation Types (Preview)

Initial recommended set:

- `derivesFrom`
- `supersedes`
- `attestsTo`
- `references`
- `includes`

## 9. Anchor Types (Preview)

Format: `<namespace>:<type>` e.g. `ethereum:tx`, `ipfs:cid`, `rekor:entry`.

## 10. Future Evolution

Minor structural changes (additional optional fields) do not break registry version; major format change increments filename suffix (e.g. `schemas.v2.json`).

---

END
