Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

All notable changes to the Codex file format specification.
All notable changes to the CDX file format specification.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

Expand All @@ -19,14 +19,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- Highlight annotation documentation in collaboration extension (Section 4.7)

#### Extensions
- **Academic** (`codex.academic`) - Theorems, proofs, exercises, algorithms, equation groups
- **Collaboration** (`codex.collaboration` v0.2) - CRDT integration, comments, change tracking, presence
- **Forms** (`codex.forms`) - Interactive form fields with validation
- **Legal** (`codex.legal`) - Citations, Table of Authorities, court captions, signature blocks
- **Phantoms** (`codex.phantoms`) - Invisible structural elements for complex layouts
- **Presentation** (`codex.presentation`) - Advanced typography, master pages, print features
- **Security** (`codex.security`) - Digital signatures, encryption, redaction, scoped signatures
- **Semantic** (`codex.semantic`) - Bibliography, footnotes, glossary, entity markup, JSON-LD
- **Academic** (`cdx.academic`) - Theorems, proofs, exercises, algorithms, equation groups
- **Collaboration** (`cdx.collaboration` v0.2) - CRDT integration, comments, change tracking, presence
- **Forms** (`cdx.forms`) - Interactive form fields with validation
- **Legal** (`cdx.legal`) - Citations, Table of Authorities, court captions, signature blocks
- **Phantoms** (`cdx.phantoms`) - Invisible structural elements for complex layouts
- **Presentation** (`cdx.presentation`) - Advanced typography, master pages, print features
- **Security** (`cdx.security`) - Digital signatures, encryption, redaction, scoped signatures
- **Semantic** (`cdx.semantic`) - Bibliography, footnotes, glossary, entity markup, JSON-LD

#### Profiles
- Simple Documents profile for recreational reading
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to Codex Document Format
# Contributing to CDX

Thank you for your interest in contributing to the Codex Document Format specification.
Thank you for your interest in contributing to the CDX specification.

## How to Contribute

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Codex Document Format
# CDX

[![Validate Schemas](https://github.com/Entrolution/codex-file-format-spec/actions/workflows/validate-schemas.yml/badge.svg)](https://github.com/Entrolution/codex-file-format-spec/actions/workflows/validate-schemas.yml)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)

**An open specification for documents that unify viewing and editing, with modern security and machine readability.**
**CDX — Content-addressed Document eXchange.** An open specification for documents that unify viewing and editing, with modern security and machine readability.

> Status: Draft Specification (v0.1)

Expand Down Expand Up @@ -85,7 +85,7 @@ This divide creates workflow friction, format conversion overhead, and lost fide

## Key Feature: Verifiable Provenance

Codex documents form a **cryptographic hash chain** — each document's identity IS its content hash, and each document can reference its parent by hash:
CDX documents form a **cryptographic hash chain** — each document's identity IS its content hash, and each document can reference its parent by hash:

```
doc-v1 (sha256:aaa) ←── doc-v2 (sha256:bbb) ←── doc-v3 (sha256:ccc)
Expand All @@ -103,7 +103,7 @@ This enables:

## Key Feature: State-Aware Presentation

Codex uses **progressive enhancement** for presentation — the level of layout precision evolves with document maturity:
CDX uses **progressive enhancement** for presentation — the level of layout precision evolves with document maturity:

| Document State | Presentation Requirement | What's Frozen |
|----------------|-------------------------|---------------|
Expand Down Expand Up @@ -164,7 +164,7 @@ The specification is modular:

### Document Structure

A Codex document is a ZIP archive with this structure:
A CDX document is a ZIP archive with this structure:

```
document.cdx
Expand Down Expand Up @@ -195,7 +195,7 @@ document.cdx

```json
{
"codex": "0.1",
"cdx": "0.1",
"id": "sha256:a1b2c3...",
"state": "draft",
"content": {
Expand All @@ -209,7 +209,7 @@ document.cdx
"type": "paragraph",
"children": [
{ "type": "text", "value": "This is a " },
{ "type": "text", "value": "Codex", "marks": ["bold"] },
{ "type": "text", "value": "CDX", "marks": ["bold"] },
{ "type": "text", "value": " document." }
]
}
Expand All @@ -221,8 +221,8 @@ document.cdx
## File Extension and MIME Type

- **Extension**: `.cdx`
- **MIME Type**: `application/vnd.codex+json` (canonical JSON form)
- **Alternative**: `application/vnd.codex` (binary/packed form)
- **MIME Type**: `application/vnd.cdx+json` (canonical JSON form)
- **Alternative**: `application/vnd.cdx` (binary/packed form)

## Roadmap

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you find a security issue in the reference implementation ([cdx-core](https:/

This security policy covers:

- The Codex Document Format specification
- The CDX specification
- JSON schemas in this repository
- Example documents in this repository

Expand Down
4 changes: 2 additions & 2 deletions docs/design-decisions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Design Decisions

This document records key design decisions made during the Codex format specification development.
This document records key design decisions made during the CDX format specification development.

## DD-001: ZIP Container Format

Expand Down Expand Up @@ -559,7 +559,7 @@ This section captures key strategic insights from early design discussions that
**Build Order**:
1. **cdx-core** (Rust library) — Foundation everything else builds on
2. **cdx-cli** — Dogfoods the core library, essential for tooling development
3. **Pandoc writer** — Markdown → Codex (the academia unlock)
3. **Pandoc writer** — Markdown → CDX (the academia unlock)
4. **Web viewer** — cdx-core compiled to WASM (zero-install demonstration)

**Why Pandoc**: Academics don't adopt new editors, they adopt new export targets. A Pandoc writer fits existing workflows with zero friction for authors.
Expand Down
4 changes: 2 additions & 2 deletions examples/academic-document/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"codex": "0.1",
"cdx": "0.1",
"id": "pending",
"state": "draft",
"created": "2025-01-28T14:00:00Z",
"modified": "2025-01-28T14:00:00Z",
"extensions": [
{
"id": "codex.academic",
"id": "cdx.academic",
"version": "0.1",
"required": false
}
Expand Down
2 changes: 1 addition & 1 deletion examples/academic-document/metadata/dublin-core.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"description": "A demonstration of academic extension features including theorems, proofs, exercises, and algorithms.",
"date": "2025-01-28",
"type": "Text",
"format": "application/vnd.codex+zip",
"format": "application/vnd.cdx+zip",
"language": "en",
"rights": "CC BY 4.0"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/collaboration-document/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"codex": "0.1",
"cdx": "0.1",
"id": "pending",
"state": "draft",
"created": "2025-01-28T14:00:00Z",
"modified": "2025-01-28T14:00:00Z",
"extensions": [
{
"id": "codex.collaboration",
"id": "cdx.collaboration",
"version": "0.2",
"required": false
}
Expand Down
2 changes: 1 addition & 1 deletion examples/collaboration-document/metadata/dublin-core.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"description": "A demonstration of collaboration extension features including comments, suggestions, reactions, and tracked changes with multiple authors.",
"date": "2025-01-28",
"type": "Text",
"format": "application/vnd.codex+zip",
"format": "application/vnd.cdx+zip",
"language": "en",
"rights": "Confidential"
}
Expand Down
16 changes: 8 additions & 8 deletions examples/comprehensive-document/content/document.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"children": [
{ "type": "text", "value": "This document demonstrates " },
{ "type": "text", "value": "all block types", "marks": ["bold"] },
{ "type": "text", "value": " supported by the Codex format. It serves as both documentation and a validation test case." }
{ "type": "text", "value": " supported by the CDX format. It serves as both documentation and a validation test case." }
]
},
{
Expand Down Expand Up @@ -273,7 +273,7 @@
{
"type": "definitionTerm",
"children": [
{ "type": "text", "value": "Codex" }
{ "type": "text", "value": "CDX" }
]
},
{
Expand Down Expand Up @@ -332,7 +332,7 @@
"children": [
{
"type": "text",
"value": "interface CodexDocument {\n version: string;\n blocks: Block[];\n}\n\nfunction validate(doc: CodexDocument): boolean {\n return doc.blocks.every(block => block.type !== undefined);\n}"
"value": "interface CdxDocument {\n version: string;\n blocks: Block[];\n}\n\nfunction validate(doc: CdxDocument): boolean {\n return doc.blocks.every(block => block.type !== undefined);\n}"
}
]
},
Expand Down Expand Up @@ -607,7 +607,7 @@
{
"type": "figcaption",
"children": [
{ "type": "text", "value": "Figure: Codex document architecture showing the relationship between content, presentation, and metadata layers." }
{ "type": "text", "value": "Figure: CDX document architecture showing the relationship between content, presentation, and metadata layers." }
]
}
]
Expand All @@ -624,8 +624,8 @@
"type": "barcode",
"id": "qr-demo",
"format": "qr",
"data": "https://codex.document/spec",
"alt": "QR code linking to Codex specification",
"data": "https://cdx.dev/spec",
"alt": "QR code linking to CDX specification",
"errorCorrection": "M",
"size": 150
},
Expand Down Expand Up @@ -701,7 +701,7 @@
"signer": {
"name": "Jane Smith",
"title": "Technical Lead",
"organization": "Codex Foundation",
"organization": "CDX Foundation",
"email": "jane.smith@example.com"
},
"timestamp": "2025-01-28T14:00:00Z",
Expand Down Expand Up @@ -905,7 +905,7 @@
"type": "paragraph",
"id": "conclusion",
"children": [
{ "type": "text", "value": "This document demonstrates all block types defined in the Codex content schema. Each block type serves a specific semantic purpose, enabling reliable machine processing and consistent rendering across implementations." }
{ "type": "text", "value": "This document demonstrates all block types defined in the CDX content schema. Each block type serves a specific semantic purpose, enabling reliable machine processing and consistent rendering across implementations." }
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion examples/comprehensive-document/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"codex": "0.1",
"cdx": "0.1",
"id": "pending",
"state": "draft",
"created": "2025-01-28T14:00:00Z",
Expand Down
6 changes: 3 additions & 3 deletions examples/comprehensive-document/metadata/dublin-core.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"version": "1.1",
"terms": {
"title": "Comprehensive Block Type Reference",
"creator": "Codex Specification Team",
"creator": "CDX Specification Team",
"subject": [
"Documentation",
"Specification",
"Block Types",
"Reference"
],
"description": "A comprehensive example document demonstrating all block types supported by the Codex format, including text content, lists, tables, code blocks, mathematics, media, measurements, signatures, and internationalization features.",
"description": "A comprehensive example document demonstrating all block types supported by the CDX format, including text content, lists, tables, code blocks, mathematics, media, measurements, signatures, and internationalization features.",
"type": "Text",
"format": "application/vnd.codex+json",
"format": "application/vnd.cdx+json",
"language": "en",
"date": "2025-01-28",
"rights": "Public Domain"
Expand Down
4 changes: 2 additions & 2 deletions examples/forms-document/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"codex": "0.1",
"cdx": "0.1",
"id": "pending",
"state": "draft",
"created": "2025-01-28T14:00:00Z",
"modified": "2025-01-28T14:00:00Z",
"extensions": [
{
"id": "codex.forms",
"id": "cdx.forms",
"version": "0.1",
"required": false
}
Expand Down
2 changes: 1 addition & 1 deletion examples/forms-document/metadata/dublin-core.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"description": "A demonstration of forms extension features including text inputs, dropdowns, checkboxes, validation, conditional validation, and signatures.",
"date": "2025-01-28",
"type": "InteractiveResource",
"format": "application/vnd.codex+zip",
"format": "application/vnd.cdx+zip",
"language": "en",
"rights": "All rights reserved"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/legal-document/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"codex": "0.1",
"cdx": "0.1",
"id": "pending",
"state": "draft",
"created": "2025-01-30T10:00:00Z",
"modified": "2025-01-30T10:00:00Z",
"extensions": [
{
"id": "codex.legal",
"id": "cdx.legal",
"version": "0.1",
"required": false
}
Expand Down
2 changes: 1 addition & 1 deletion examples/legal-document/metadata/dublin-core.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"description": "A demonstration of the legal extension features including caption, Table of Authorities, legal citations, and signature block.",
"date": "2025-01-30",
"type": "Text",
"format": "application/vnd.codex+zip",
"format": "application/vnd.cdx+zip",
"language": "en",
"rights": "Confidential - Attorney Work Product"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/phantoms-document/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"codex": "0.1",
"cdx": "0.1",
"id": "pending",
"state": "draft",
"created": "2025-01-28T14:00:00Z",
"modified": "2025-01-28T14:00:00Z",
"extensions": [
{
"id": "codex.phantoms",
"id": "cdx.phantoms",
"version": "0.1",
"required": false
}
Expand Down
2 changes: 1 addition & 1 deletion examples/phantoms-document/metadata/dublin-core.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"description": "A demonstration of phantoms extension features including annotation clusters with different scopes (shared, role-based, private), phantom connections, and nested content.",
"date": "2025-01-28",
"type": "Text",
"format": "application/vnd.codex+zip",
"format": "application/vnd.cdx+zip",
"language": "en",
"rights": "Internal Use Only"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/presentation-document/content/document.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "paragraph",
"id": "p-intro-1",
"children": [
{ "type": "text", "value": "This document demonstrates the advanced presentation features available in the Codex format. The presentation layer provides fine-grained control over typography, layout, and print output." }
{ "type": "text", "value": "This document demonstrates the advanced presentation features available in the CDX format. The presentation layer provides fine-grained control over typography, layout, and print output." }
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions examples/presentation-document/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"codex": "0.1",
"cdx": "0.1",
"id": "pending",
"state": "draft",
"created": "2025-01-29T10:00:00Z",
Expand All @@ -21,7 +21,7 @@
},
"extensions": [
{
"id": "codex.presentation",
"id": "cdx.presentation",
"version": "0.1",
"required": false
}
Expand Down
4 changes: 2 additions & 2 deletions examples/presentation-document/metadata/dublin-core.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"version": "1.1",
"terms": {
"title": "Presentation Extension Example",
"creator": "Codex Specification Team",
"creator": "CDX Specification Team",
"subject": ["Document Format", "Presentation", "Typography"],
"description": "An example document demonstrating the Presentation Extension features including master pages, typography, multi-column layout, and running headers/footers.",
"date": "2025-01-29",
"type": "Text",
"format": "application/vnd.codex+zip",
"format": "application/vnd.cdx+zip",
"language": "en"
}
}
Loading
Loading