# The MOCA specification

> The MOCA specification at 0.6.0: the package format, Reader contract and interface, attestations, sidecar indexes, AG-UI citations, schemas and the corpus.

Source: https://openmoca.org/spec/

MOCA (Modular Ontology, Content & Attestation) is defined by six documents, a
set of JSON Schemas, and a conformance corpus that every Reader must pass. They
are versioned together: these pages describe **0.6.0**, before 1.0
([versioning](/spec/versioning/)). The source of every page is the
[moca-spec repository](https://github.com/openmoca/moca-spec).

## The specifications

| Document | What it defines | Status |
| --- | --- | --- |
| [Package specification](/spec/package/) | The package: manifest, OKF content, evidence, locales, trust fields, structure, members, relations, the digest, profiles and capabilities | 0.6.0 |
| [Reader contract](/spec/reader-contract/) | What every Reader must conclude: reading, verifying, citation records, the retrieval policy, search, structure and diagnostics | 0.6.0 |
| [Reader interface](/spec/reader-interface/) | The operations and objects every Reader offers, named for each language | 0.6.0 |
| [Attestations](/spec/attestations/) | Package and review attestations, signing modes, trust roots and verification outcomes | 0.6.0 |
| [Sidecar index](/spec/sidecar-index/) | Portable lexical and semantic indexes beside a package, bound to its digest | 0.6.0 |
| [Citations over AG-UI](/spec/ag-ui-citations/) | One AG-UI event that carries an answer's citation records to a user interface | 0.6.0 |

Extensions are [profiles](/spec/profiles/); the [ontology profile](/spec/profiles/ontology/)
is a draft.

## Schemas

Each schema is published at its `$id`, so validators can fetch it:

| Schema | For |
| --- | --- |
| [`manifest.schema.json`](/schemas/v1/manifest.schema.json) | `moca.json` |
| [`node.schema.json`](/schemas/v1/node.schema.json) | A page's frontmatter |
| [`structure.schema.json`](/schemas/v1/structure.schema.json) | `structure.json`, the view of `structure.ttl` |
| [`citation-record.schema.json`](/schemas/v1/citation-record.schema.json) | A citation record |
| [`search-hit.schema.json`](/schemas/v1/search-hit.schema.json) | A backend's search hit |
| [`sidecar-index.schema.json`](/schemas/v1/sidecar-index.schema.json) | A sidecar's `index.json` |
| [`review-predicate.schema.json`](/schemas/v1/review-predicate.schema.json) | A review attestation's predicate |
| [`trust-root.schema.json`](/schemas/v1/trust-root.schema.json) | A reader's trust root |
| [`ag-ui-citations.schema.json`](/schemas/v1/ag-ui-citations.schema.json) | The AG-UI citations event |
| [`profile.schema.json`](/profiles/ontology/v1/profile.schema.json) | The ontology profile's data |

## Conformance

The [conformance corpus](/spec/conformance/) is 196 cases, each with a package,
options and the conclusions every Reader must reach. All three Readers, in
TypeScript, .NET and Python, pass all of them. Each release attaches the corpus
as `moca-conformance-<version>.tar.gz`, so an implementation can pin it.
