# Content Verification Service

Provides decentralized provenance, notarization, and dispute tracking for Lilith
content revisions. The service orchestrates hashing, signature collection,
multi-chain anchoring, IPFS manifest storage, provenance logging, and compliance
audit hooks.

## Pipeline

1. **Content registry** – supplies revision metadata and persists
   notarization/update records.
2. **Hash calculator** – emits deterministic digests for content, metadata, and
   manifests.
3. **Authority signature service** – gathers and validates signatures from
   high-reputation verifiers.
4. **IPFS gateway** – pins manifest payloads for tamper-proof retrieval.
5. **Anchor providers** – notarize manifest roots across configured blockchains.
6. **Provenance store** – appends notarization, update, and dispute events for
   audit trails.
7. **Dispute registry** – records raised disputes and optional resolutions.
8. **Audit log** – captures structured events for compliance visibility.

## Usage

```ts
import { createContentVerificationService } from './service';

const service = createContentVerificationService({
  registry,
  hashCalculator,
  signatureService,
  ipfsGateway,
  anchorProviders: {
    primary: ethereumAnchor,
    secondary: solanaAnchor,
  },
  provenanceStore,
  disputeRegistry,
  auditLog,
});

const notarization = await service.notarizeContent({
  contentId: 'teaching-emerald-light',
  revisionId: 'rev-3',
  snapshot: {
    body: '...latest manuscript...',
    metadata: { tradition: 'emerald-order', language: 'en' },
  },
  notarizedBy: 'archivist-aurelia',
});

const verification = await service.verifyIntegrity({
  contentId: 'teaching-emerald-light',
  revisionId: 'rev-3',
  snapshot: {
    body: '...latest manuscript...',
    metadata: { tradition: 'emerald-order', language: 'en' },
  },
});
```

## Tests

```bash
cd apps/lilith/svc-content-verification && npm test
```
