editing-traces icon indicating copy to clipboard operation
editing-traces copied to clipboard

Re-playable Event Graph (REG) storage format specification

Open streamich opened this issue 7 months ago • 6 comments

This is a proposal to formalize and document serialization formats for Re-playable Event Graphs (REGs).

What are REGs? I am not an expert on REGs, but essentially it is a way to represents a sequence of all editing events in a format like this:

export interface ConcurrentTrace {
  kind: 'concurrent';
  endContent: 'string';
  numAgents: number;
  txns: ConcurrentTraceTransaction[];
}

export interface ConcurrentTraceTransaction {
  parents: number[];
  numChildren: number;
  agent: number;
  patches: [position: number, remove: number, insert: string][];
}

The key here is that:

  1. The full editing history is stored.
  2. The operations are stored in the local form [position: number, remove: number, insert: string]. (There is no CRDT metadata.)
  3. Full causal graph is stored, i.e. each transaction has a list of parents: [], which is a set of operations that this transaction depends on (knows about at the time of creation).

What I would like to get from this issue:

  1. Firstly, I would like to see if there is any interest for having a shared formal specification for the REG serialization format.
  2. Requirements: what would be a list of requirements for a REG serialization format?
  3. Implementation details: any tricks/gotchas/suggestions of the low-level implementation details?

cc @josephg @ept @dmonad @mweidner037 @gritzko @archagon @zxch3n

streamich avatar Dec 02 '23 11:12 streamich