Skip to main content
API reference sections

Schema

RevisionRequirement

One write a query wants included - see [TaskQuery::covering].

The workspace rides with it: the query's scope is workspaces, and a document the projector has never seen (the first native task's own task-list document) has no projection row to place it by. Scope is answered against the workspace, and an unprojected document is simply uncovered. A scoped receipt: the one operation the caller is waiting for.

This used to be the document's whole version vector, and that was a bug with a delay fuse on it. A version vector holds one entry per writer the document has ever had, and Loro mints a fresh writer id per session - so the requirement grew by ~21 hex characters every time any process opened the document, and once it crossed [MAX_COVERING]'s sibling length limit the store refused every task query naming a write. Measured: 100 writers encode to 2 126 hex characters, 200 to 4 220. The surfaces then had no way to wait, so every optimistic row snapped back - the tick that un-ticks itself.

What a surface actually needs to know is has the projection seen my write, and that is one operation, not a census of everybody who ever touched the document. peer is the writing session and counter is the exclusive end of its own operations at the moment the mutation committed, which is exactly VersionVector::get(peer).

Bounded by construction: two integers, whatever the document's history. That is the property the old shape could not have at any limit.

Multi-operation writes need nothing extra. A command that writes five operations still ends at one counter, and one peer's operations are contiguous - so covering the end covers all of them. A command that wrote nothing produces no receipt at all; see [TaskQuery::covering].

Type object

Shape

FieldTypeDescription
workspacerequiredWorkspaceId
documentrequiredDocumentId

DocumentId - a client-minted v4 UUID, hyphenated and lowercase. Immutable, and never derived from a name or a path.

peerrequiredstring

The writing session's Loro peer id. A String because it is a u64 and JSON numbers are f64 - the id would lose its low bits above 2^53 in any JavaScript client, and these ids are random across the range.

counterrequiredinteger (int64)

The exclusive end of that peer's own operations when the write committed. Covered when the projection has applied at least this many of them.

Example
{
  "workspace": "00000000-0000-4000-8000-000000000000",
  "document": "00000000-0000-4000-8000-000000000000",
  "peer": "string",
  "counter": 0
}

The contract has no example values, so example bodies are generated from each schema: every field is shown with a placeholder of its type.

Generated from contract version 1. Last updated .

Privacy choices

Choose which optional tools Koru may use on this site. Your choice is saved in a cookie in this browser for 12 months. Privacy policy

Privacy choices

Keep you signed in, protect forms and remember your language and this choice.

Always on

PostHog and Google Analytics 4 measure page views and actions such as downloads, using cookies or local storage.

PostHog records how pages are used, with form inputs masked and private pages excluded. Needs Analytics.

Ahrefs Web Analytics measures visits and where they come from, and Google Ads measures whether our ads led to a visit or download.