Architecture
Chronicle’s architecture is designed for real-time collaboration, temporal navigation, and auditability.System Overview
Figure 1 — Chronicle System Overview. The Next.js frontend connects to the Relay service over WebSocket. The Relay broadcasts operations to three protocol nodes: fork-node (CRDT merge), vest-node (audit proofs), and tnp-node (temporal queries). This separation ensures conflict-free editing, verifiable history, and time-travel navigation.
Trace ID Requirement Rationale Test Case CHRON-ARCH-001All document edits shall be processed as CRDT operations through fork-node Guarantees conflict-free merging without a central authority TC-CHRON-ARCH-001CHRON-ARCH-002Every operation shall generate a cryptographic proof via vest-node Provides tamper-evident auditability for all document changes TC-CHRON-ARCH-002CHRON-ARCH-003tnp-node shall reconstruct any document state from an arbitrary past timestamp Enables time-travel navigation for review and compliance TC-CHRON-ARCH-003
Core Components
Editor Package (@chronicle-hq/editor)
The editor package provides:
- EditorState - Immutable document state
- EditorView - DOM rendering and events
- Transaction - State change representation
- Selection - Cursor/selection management
- Schema - Document structure definition
Plugins
- TimelinePlugin - Temporal navigation UI
- HistoryPlugin - Local undo/redo
Adapters
- TimechainAdapter - CRDT operations via fork-node
- PresenceAdapter - Real-time presence via relay
Relay Service
The relay handles:- WebSocket Connections - Client connection management
- Operation Relay - Broadcasting CRDT operations
- Presence - Cursor and user status
- Session Management - Connection lifecycle
Protocol Integration
fork-node (CRDT)
Provides LSEQ-based CRDT operations:- Insert, delete, format operations
- Automatic conflict resolution
- Deterministic merge
vest-node (Audit)
Provides verifiable audit trail:- Cryptographic proofs for each operation
- Immutable history
- Verification endpoints
tnp-node (Temporal)
Provides temporal navigation:- Point-in-time document reconstruction
- History range queries
- Diff generation
Data Flow
Edit Operation
Timeline Navigation
Security
- aegis-node handles all authorization
- Document permissions: view, comment, edit, admin
- All operations include user identity
- Audit trail provides accountability
Scalability
- Relay instances are stateless (can scale horizontally)
- CRDT operations are order-independent
- Protocol nodes handle persistence