# Open Continuity Protocol 0.4

**Portable AI History — Consolidated Editor's Working Draft — 15 August 2026**

This directory is the current project-authoritative source tree for OCP 0.4 until it is superseded. A publication snapshot becomes pinned only when `release-manifest.json` records its exact members and digests. It is a working draft, not an adopted standard, production recommendation, legal conclusion, security certification, or result from independent implementations.

OCP defines a vendor-neutral way to request, approve, present, review, and transfer selected continuity context without turning that context into identity proof, authentication, a bearer credential, or authority to perform an external action.

## Start here

| Artifact | Role |
|---|---|
| `review/independent-review.md` | Independent Deliverables 1–8 assessment, including standards, schema, lifecycle, security, editorial, and revision findings. |
| `spec/OCP-v0.4-Consolidated-Editors-Working-Draft.md` | Deliverable 9: complete standalone specification source. |
| `CHANGELOG.md` | Portable AI History changes from project-authoritative 0.3 to 0.4. |
| Release companion tree rooted here | Deliverable 11: machine-readable schemas, bindings, profiles, examples, registries, mappings, conformance artifacts, reports, and tools. |
| `review/REMAINING-DECISIONS.md` | Deliverable 12: decisions that still require prototype or external evidence. |
| `review/OCP-0.4-executive-revision-summary.md` | Concise 0.4 architecture, security, and evidence summary. |
| `review/OCP-v0.4-Issue-Register.xlsx` | Native, filterable 57-issue review workbook with formula-driven summary and chart. |
| `review/issue-register.json` | Machine-readable authority for the inherited 57-issue review register. |
| `review/OCP-0.4-decision-register.json` | Machine-readable material 0.4 design decisions. |
| `review/OCP-0.4-decision-register.md` | Human-readable 0.4 decision register. |
| `review/MIGRATION.md` | Breaking wire and semantic migration rules. |
| `VALIDATION.md` | Reproduction commands, exact local results, and evidence limits. |

Generated publication files belong in `dist/`. Machine-readable source files outside `dist/` remain authoritative when a generated rendering differs.

## Protocol structure

OCP 0.4 has nine core record types: context space, source record, context item, client declaration, context request, grant receipt, context package, update proposal, and review decision. HTTP, offline archives, and provider transfer are bindings. Conversation, Artifact, and Provider Adapter are complete working-draft editorial profile packages; Erasure, Continuity Observation, and Human Interaction Boundary remain draft profiles. No profile has independent implementation-conformance evidence in this release.

The governing safety boundaries are:

- a request is inert and a `grant_receipt` is a non-secret receipt, never a bearer credential;
- operation-time authorization remains in an OAuth, GNAP, local broker, operating-system, or equivalent authorization layer;
- a runtime package is bound to one delivery client instance and separately discloses every approved plaintext processor;
- imported and packaged content is untrusted data and cannot enter instruction, policy, credential, or tool-authority channels;
- accepted context requires an immutable review decision; providers cannot silently write accepted state;
- package identifiers are package- or delivery-recipient-local and do not expose stable store identifiers;
- revocation limits future access but does not prove deletion of prior disclosures; and
- OCP context always carries `external_action_authority: "none"`.

## Source tree

| Path | Contents |
|---|---|
| `schemas/core/` | JSON Schema Draft 2020-12 definitions for shared structures and the nine core records. |
| `schema-catalog.json` | Content-pinned map from every canonical schema `$id` to its package-relative file. |
| `profiles/` | Versioned profile manifests plus compatibility schemas. Conversation, Artifact, and Provider Adapter Framework are the 0.4 Portable AI History profiles. |
| `schemas/` | Complete Conversation, Artifact, Adapter, loss-report, and bundle schemas alongside `schemas/core/`. |
| `fixtures/` | Positive, negative, hostile, round-trip, and 16-case synthetic provider-adapter suites. |
| `bindings/http/` | Discovery, RFC 9457 Problem Details, and OpenAPI 3.1 HTTP binding. |
| `bindings/offline/` | Structural offline-manifest schema and extension template. |
| `bindings/transfer/` | Loss-aware transfer-manifest schema. |
| `examples/positive/` | Complete synthetic valid examples. |
| `examples/negative/` | Single-mutation invalid examples plus expected-failure metadata. |
| `conformance/` | Assertion registry/results, availability, provider-adapter schema, and validators. |
| `registries/` | Lifecycles, events, errors, and current primary-source standards metadata. |
| `mappings/` | Exact experimental OCP 0.4 ↔ Portable AI Memory v1.0 field/lifecycle/cardinality/proof/loss mapping; informative until fixtures and independent adapters pass. |
| `review/` | Architecture, security, standards, migration, change, and decision records. |
| `tools/` | Fixture, assertion, appendix, document, and release maintenance tools, including the portable schema-catalog loader. The release archiver normalizes member order and metadata from frozen input bytes plus `SOURCE_DATE_EPOCH`; byte identity also assumes the same Python/zlib build. Evidence reports may contain run metadata. |

## Reproduce local validation

Use Node.js 20 or later and the exact dependency versions in `package-lock.json`:

```text
npm ci
npm test
```

`npm test` first verifies `schema-catalog.json`, its file sizes and SHA-256 pins, and compilation of every schema by canonical `$id`; it then runs the reference-material harness. The dependency lock resolves Ajv 8.20.0, ajv-formats 3.0.1, and canonicalize 4.0.0. The synchronized machine report records the exact Node runtime, platform, architecture, validator, formats package, and canonicalization package used for the run.

After an intentional schema-byte change, refresh the deterministic catalog and verify canonical resolution:

```text
npm run build:catalog
npm run verify:schemas
```

The catalog generator discovers only `*.schema.json` resources under `schemas/`, `profiles/`, `bindings/`, and `conformance/schemas/`; it emits no clock time or host path. `npm run check:catalog` is the read-only stale-catalog gate.

`npm run build:review` is retained as a compatibility name, but it is deliberately verifier-only in a public or extracted package. It checks the checked-in 57-issue register and the logical/hash-based feedback manifest without requiring private reviewer-input bytes or a workstation-specific path. `npm run verify:review` is the explicit equivalent.

Publication builds require Pandoc 3.9.0.2, LibreOffice 26.2.2.2, Python 3.14.6, and the exact Python dependencies in `requirements-docs.txt`. Create an isolated environment and provide the frozen snapshot epoch:

```text
python3 -m venv ../.venv-ocp-docs
../.venv-ocp-docs/bin/pip install --requirement requirements-docs.txt
export OCP_PYTHON="$PWD/../.venv-ocp-docs/bin/python"
export SOURCE_DATE_EPOCH=1786820400
npm run build:docs
npm run build:release
```

The epoch is `2026-08-15T19:00:00Z`, chosen after the namespace migration and source/report freeze. `build:docs` emits both DOCX and PDF. The DOCX postprocessor normalizes core-property and ZIP-member timestamps; the release builder uses the same instant for `generated_at` and ZIP members. DOCX and release-archive byte identity is verified for identical frozen inputs on the recorded Python/zlib toolchain. LibreOffice PDF export is rebuilt and visually/hash verified, but cross-host byte identity is not claimed because LibreOffice PDF serialization may vary with its build, fonts, and platform. Generated validation reports retain actual execution time and environment and are evidence outputs rather than timestamp-normalized source artifacts.

| Layer | Synchronized local-reference result |
|---|---:|
| JSON Schemas compiled | 37 / 37 |
| Positive examples valid | 32 / 32 |
| Negative examples rejected at their declared rule | 45 / 45 |
| Semantic reference vectors | 243 / 243 |
| Registry, OpenAPI, and evidence-accounting checks | 29 / 29 |
| Portable AI History cases | 25 / 25 |
| Assertions with one result row | 134 / 134 |
| Assertions passed against an identified implementation | 0 |

These values validate reference materials only. `system_under_test` is `null`; the split is 90 partial fixture-evidence results, four manual-required, three unavailable, and 37 not executed, with zero implementation passes and zero implementation failures. No local fixture result is an implementation-conformance claim.

## Known unavailable claims

Remote Package Security (`SEC-001`, `SEC-002`) and Offline Package Protection (`XFR-004`) are unavailable. The working draft has no registered, executable signature, recipient-confidentiality, or client-instance key-binding profile and no cryptographic vectors. The offline example demonstrates manifest structure only.

The package also does not establish deployed parser isolation, authorization-server behavior, consent comprehension or accessibility, assessor independence, downstream retention/deletion, legal compliance, independent interoperability, production security, or live human acceptance.

## Version, namespaces, and license

Wire value `ocp_version` is `0.4`; draft maturity is release metadata, not wire syntax. The canonical working-draft schema, profile, registry, binding, vocabulary, mapping, adapter, fixture, and conformance identifiers use the `https://opencontinuity.org` namespace. Publishing these identifiers under the project domain does not make the draft a stable standard or establish IANA registration. Namespace stewardship, immutable archival mirroring, redirects, and deprecation policy remain publication-governance requirements.

No final project license has been adopted. See `LICENSE-STATUS.md`. The specification proposes CC BY 4.0 and code/tooling proposes Apache-2.0, subject to steward and legal approval.
