Reference
Store format
since 0.26.0 This page is the exact shape of what rdy keeps on disk. It gives every object kind and its fields, the refs, the frame and segment layout, the index, and the FORMAT and FEATURES files. How the store behaves, and why, is in The store. Each object records its encoding version, so a new encoding of a kind never changes an object written earlier. A binary opens a store by the features it lists. A store of a scalar format, from before feature stores, is refused and moves by dump and load; the dump file is in "File formats" in the rdy documentation.
Objects and hashes
An object is one immutable record. Its id is the BLAKE3 hash of its stored bytes, and every object carries a one-byte kind. Objects are encoded with postcard, so field order is the format. A new shape of an existing kind gets a new encoding version, and every older object keeps its encoding and its bytes. An enum may gain a value at its end within one encoding. A new record type gets a new kind code.
An object's id is the hash of its stored bytes, never of a re-encoding.
Where an id is needed for an object that was read, rdy uses the frame's hash. The in-memory types below give their field order; Option fields encode as present or absent, and Vec fields as a count then the items.
Object kinds
since 0.52.0
| Kind | Code | Holds |
|---|---|---|
BLOCK | 1 | one block version |
CHANGE | 2 | one change: a set of ops with provenance |
PROPOSAL | 3 | one proposal version |
LANDING | 4 | one landing record |
SNAPSHOT | 5 | the block versions of canon at one landing |
BLOB_CHUNK | 6 | up to 1 MiB of an asset |
BLOB_MANIFEST | 7 | an asset's length and chunk hashes |
REF_UPDATE | 8 | one ref write |
TAG | 9 | one version tag |
ANSWER | 10 | one answer: a human act that no other record holds |
SIGNATURE | 11 | one signature over one statement that rdy reads off a landing or a tag, which it names as its subject |
VIEW_OP | 13 | one op of a view's chain |
BATCH_COMMIT | 14 | the marker that ends a write batch |
INTENT | 15 | one intent version |
ALT_SET | 16 | one alternative set version |
REVIEW | 17 | one review: a tension dismissal, a mention review, a verdict on a candidate pair or a check verdict |
TENSION | 18 | one version of a semantic tension |
TRANSITION | 19 | one batch's tension and suspect transitions |
REDACTION | 20 | one content removal request: its carrier change, the requester, the targets, the reason and the manifest it binds |
REDACTION_RESIDUE | 21 | what stays of one removed block version or change |
REDACTION_APPLY | 22 | the human apply record that activates one request: the request, the landing in its batch and the approved report hash |
REDACTION_CARRIED | 23 | the record of a source apply that a stopped load did not reach: its spans, which of them this store holds, and the source's approver |
PLAN | 24 | one version of a view's change plan: its answers and, at a landing, its seal |
ASSESSMENT | 25 | the readiness assessment of one ready proposal version; a propose writes it |
DISPUTE | 26 | one dispute of a landing; rdy_dispute writes it |
DISPUTE_RESOLUTION | 27 | the resolution of one dispute; rdy_dispute writes it |
CHECK_REQUEST | 28 | one request for an agent check; rdy_review and rdy review write it |
FOREIGN | 29 | one entry of the foreign log: an event from one linked project, kept outside canon |
SNAPSHOT_DELTA | 30 | one landing's map as the difference from the previous landing's map |
since 0.32.0
Code 12 is unassigned. Store format 13 adds codes 20 to 22 for redaction. Store format 14 adds code 11, SIGNATURE, for signing. Store format 15 adds no code: it adds the ref meta/store_mode and the refs of a holder. Store format 16 adds code 23, REDACTION_CARRIED, for a load that stops before a removal. Store format 17 adds code 24, PLAN, for change plans, and store format 18 adds no code: it appends the reflects justification to CHANGE. None of them changes the bytes of a value that an earlier format wrote.
since 0.32.0
Feature stores, which rdy 0.26.0 writes, add the codes 25 to 28. They give CHANGE, LANDING and REDACTION_RESIDUE encoding 1, and the four new kinds start at encoding 1. Every other kind stays at encoding 0, and no object written earlier changes its bytes. rdy reads, checks, dumps and loads the four new kinds. From rdy 0.29.0 a propose writes ASSESSMENT. From rdy 0.30.0 rdy_dispute writes DISPUTE and DISPUTE_RESOLUTION. From rdy 0.32.0 rdy_review and rdy review write CHECK_REQUEST. A redaction report scans their text and never erases them.
since 0.48.0
The feature foreign_copy adds code 29, FOREIGN, at encoding 1 only, and the store format stays 19. It also gives eight kinds an optional encoding: BLOCK 1, CHANGE 2, REVIEW 1, TENSION 1, TRANSITION 1, ANSWER 1, REDACTION 1 and ASSESSMENT 2. A record takes its optional encoding only when it holds a foreign shape. Every other record keeps its encoding, its bytes and its hash.
since 0.36.0
An ASSESSMENT is {proposal, base?, method, pack, config, policy?, facts, tensions, tensions_omitted, suspects, suspects_omitted, coverage, confidence, reach, card, scope, issues}, in that order. It names the approved proposal version and the landing it was assessed on. method is the number of the computation: rdy writes 2, and it reads a stored 1 as it is. From rdy 0.30.0 policy holds the policy version and the verdict. reach holds the blocks the version writes, the blocks its consequences and plan items name, and the sides of its tensions. When the pack has rules, reach also holds the blocks that the rules read. scope names the analyzed blocks, and it may differ from reach. Each list holds at most 100,000 rows, and each _omitted count says how many rows a cap left out. The assessment copies no block body or field. A propose writes it in the version's batch, for a ready version only. A failed freshness check writes a fresh one in a batch of its own when the version is still ready. Its base is then canon's head.
since 0.32.0
A DISPUTE is {landing, opened_by, reason, at_ms}, and a DISPUTE_RESOLUTION is {dispute, outcome, by, correction?}. outcome is upheld, dismissed or withdrawn, in that order, and correction names a landing of canon's chain. A CHECK_REQUEST is {check, subject, scope, case_hash, mode, reason?, requested_by, relayed_by?, relay?}. Its subject is {blocks, change?, version?, code?}, where code is {repo, from, to}, and mode is author or independent. check, scope and repo hold 1 to 256 bytes, and from and to hold 1 to 64. A reason holds 1 to 2000 characters, and a subject at most 100,000 sorted, distinct blocks. A run writes mode: author, and a request mode: independent. Each request goes in one batch with its ref check/<request>, and a batch holds 1 to 20 requests.
since 0.32.0
Each carried kind names other objects. rdy fsck, a stream check, a take, a load and a reindex check those links. An assessment names its proposal version, its base landing, its policy's block version, the plans of its tension answers and the reviews of its dismissals. A dispute names a landing, and a resolution names its dispute and its correction. A check request names its change and its proposal version, when it has them, and a check review names its request. A tag's closure, which a stream export sends, takes every dispute of a landing it reaches, and every resolution of those disputes. It also takes every check request that names a change or proposal version it reaches, and every check review of those requests. A broken link refuses the record with its reason, such as wrong reference kind, and changes nothing.
since 0.48.0
A FOREIGN entry is {repo, source, event}. repo is the cited project's repo id, and it is never this store's own. source is Link {link, site, at_ms}, where link is the id of the citing project's repo_link block, and the take checks only the id's form. event is Delivery {prev?, publication, set?, added, changed, removed, shells, selection}, Revoked {prev} or Removal {proof, versions}. publication is {tag, profile, profile_version?}, and set is Organization or Team with a name. An entry names its source and claims no actor.
since 0.48.0
Each of added and changed lists ForeignVersion {id, version, content, encoding, derived}, where derived is {status?, lifecycle?, superseded_by}. version names a BLOCK object that only a foreign entry names, and removed lists block ids. shells lists each planned doc or section that the profile keeps only as a shell, as {id, version} with no BLOCK object. selection is the publication's selection identity: the same bytes that a profile read reports as selection_identity.
since 0.48.0
The selection identity is the BLAKE3 hash of rdy-publication-selection-identity, a zero byte, the number 1 and the entry count. Then each entry follows in id order: the id's length, the id's UTF-8 bytes and the 32 bytes of its version. Each number is a little-endian u32. A delivery's entries are its delivered versions and its shells, and the format never changes.
since 0.48.0
A Delivery or a Revoked entry is one sealed batch of its own: its new held versions, the entry, its source's ref and its transitions. No landing, change, proposal, view op, signature or tag joins that batch, and canon never moves. Each prev names an earlier Delivery of the same source, and no two entries name the same prev. A Revoked entry ends its source's chain: no Delivery or Revoked entry follows it. A Removal entry has no prev and is on no chain, so it may come after a Revoked entry. The source's ref foreign/link/<id> names the newest Delivery or Revoked entry of the chain, never a Removal entry. A chain holds at most 100,000 entries, and a selection or a delta list at most 100,000 members. A source key holds 1 to 256 bytes with no /, and a holder holds no foreign entry.
since 0.48.0
rdy fsck checks the foreign log when the store has foreign_copy. Each source's chain keeps the rules above, and each source's ref names the newest entry of its chain. Each selection is the digest of the selection that its chain rebuilds. Each delivered version names a stored BLOCK of its id and encoding, unless an authorized erasure removed it. Only a TRANSITION, TENSION, REVIEW, ANSWER, ASSESSMENT or REDACTION may name a foreign entry, or a version that only an entry holds. Each foreign pin of a local block names the content of a version that a delivery of its repo holds.
since 0.10.0
Reviews and semantic tensions are stored because they record a judgement that rdy cannot recompute. Each batch's tension and suspect transitions are stored too, as a TRANSITION record, so the inbox reads them exactly. The open tensions and suspects stay derived, and so do review requests, events and inbox entries; rdy reindex rebuilds them. A signature is stored because rdy cannot make it again without the private key.
Block versions
since 0.26.0
A BLOCK object is one version of one block. Its hash is the block's version hash, which ops and snapshots name. A pin names the cited block's content hash instead. The content hash is the BLAKE3 hash of rdy-content-2, a zero byte, then the postcard encoding of the id, type, parent, fields, body and links. It leaves out the order key, the pins, derived fields and tracking fields.
since 0.26.0
| Field | Type | Meaning |
|---|---|---|
id | block id | the block's stable id, such as b-7KQ2M |
block_type | string | the type's name in the pack |
parent | optional block id | the containing block; absent at the top level |
order | string | the order key among its siblings; the version hash covers it, and the content hash leaves it out |
fields | map of name to value | the type's fields; a value is a string, number, boolean, list or map |
body | string | the block's text |
links | map of link type to list of {target, part} | typed links to other blocks |
pins | map of block id to content hash | the content hash of each cited block when this version was checked against it |
since 0.20.0
A decision carries the optional core field effective_from, an RFC 3339 UTC time or a date, in fields. Absent means the time the decision was recorded. The proposer sets it while the decision is proposed, and it freezes with the decision. rdy checks decided_at, recorded_at, effective_from and review_by only when a write or an import sets them, and a load reads every stored value. Blocks and their fields are in "Blocks, docs and folders" in the rdy documentation.
An accepted decision may carry the store-only field reaffirmed in fields: a map of target id to {against, reason}. against lists, sorted, the decisions that superseded or revoked the target when it was re-affirmed. It is an empty list for a target that only changed, and the text deleted for a deleted target. reason is the re-affirmation's reason, and its text adds no reference. A block with reflects may carry the store-only field reflects_at: {files, commits}. The content hash leaves both out, as it leaves out status, decided_at and lifecycle.
files is a BLAKE3 hash over rdy-reflects-files, a zero byte and one (repo, path, blob id) triple per matched file. A file matches when a linked repo holds it at HEAD and a glob matches its path. The triples are sorted by repo, then path, and each text is its byte length as a little-endian u64, then its UTF-8 bytes. commits maps each linked repo to its HEAD commit when rdy recorded it, or to null for a repo with no commit.
since 0.20.0
Only rdy writes the two fields: reaffirm writes reaffirmed, and repin with code: true or a write with reflects: {code: true} writes reflects_at. A write that sets reflects or changes its globs writes reflects_at too, when a checkout is linked. With no linked checkout, it records nothing, drops any old reflects_at, and warns with W_REFLECTS_NO_CODE. A write op may not name either field, and a pack may not define either. A write that removes reflects removes reflects_at too, and an edit that keeps the same set of globs keeps it. A reflects: {code: true} write with no linked checkout keeps each block's old reflects_at.
since 0.48.0
A block may carry a foreign part, ForeignParts {links, pins}. ForeignLink is {target, part?}, where target is {repo, id}, and ForeignPin is {content, encoding}, both as the cited side computed them. A link to a cited block lives in links, and the pin of each cited block lives in pins. A block with a foreign part takes BLOCK encoding 1: the eight fields above, then the foreign part. A block with no foreign part keeps encoding 0, its bytes and its content hash.
since 0.48.0
The content hash of a block with a foreign part is the BLAKE3 hash of rdy-content-foreign-1, a zero byte, then the fields of the content hash above and the foreign links. It leaves out the foreign pins, as it leaves out the local pins. In JSON, a foreign id is <repo>/<id>, with the repo id in 32 lowercase hex digits.
since 0.48.0
An accepted decision may carry the store-only engine field adopted_as, as it may carry reaffirmed. Its value is {content, encoding, id, repo}: the cited decision that replaces it, at a delivered content. Only rdy writes it: rdy_supersede {old, adopted_as} and rdy adopt-upstream write it on the old decision, which then reads as superseded. A write op may not name it, and a pack may not define it. The content hash leaves it out, and a version that writes it never lands under the authority policy.
Changes
A CHANGE object is the unit of writing. The store computes deps from the base versions the ops name; a writer never declares them.
since 0.32.0
| Field | Type | Meaning |
|---|---|---|
view | string | the view the change was committed to |
ops | list of op | the ops, in order; a redaction request's carrier change has none |
deps | list of change hash | the changes that produced the base versions the ops name |
provenance | provenance | who made it |
justification | optional justification | implements with a decision id, editorial with a class (typo, restructure, clarify) and a reason, or reflects with sources and code |
message | string | the writer's message |
links | change links | intent, alternative, client_nonce, imported_by, replayed_from and briefing, each optional |
An op is one of Create {block}, Update {base, block} or Delete {base, id}. base is the version hash the op was built on. A move is an update that changes parent or order. A redaction can remove the bytes of a change that embeds a removed block version. That change's residue keeps its id, its audit fields and each op, with the block named by its version hash.
A provenance is {actor, run, role, at_ms}: the actor string, an optional run, the role (reader, writer, reviewer, approver) and a millisecond timestamp. links.alternative is {set, member}: the alternative set's stable id and the member view's name. links.client_nonce is the nonce a working-copy commit sends, so a lost acknowledgement can be recovered. links.imported_by is {actor, run}: the importer, set on every change that rdy import writes.
since 0.32.0
links.replayed_from names the change that a replay copied. It is a reference only, never a dependency in deps. links.briefing is the briefing token the change cited, which is no object hash. A write that cites a current briefing records its token. A draft write with an unknown or stale token records none. rdy's own writers record their own briefing: the propose's key change, a resolve to the landed side and a repin. A replay copies its source's briefing. A replay's client_nonce is replay:<head>:<n>: the view's head before the call, and the replay's place in the call from 0.
since 0.32.0
Store format 18 appends the third justification kind, reflects, as variant 2 after implements (0) and editorial (1). It holds sources, a list of source ids without duplicates in the order cited, and code, a flag. The two earlier kinds keep their bytes, and no other record encoding changes. A dump of store format 18 is dump format 3, as the pair (3, 18).
Proposal versions
A PROPOSAL object is one version of a proposal. The first version's hash is the proposal's stable id, shown as P-<short>; a version is shown as P-x@n.
| Field | Type | Meaning |
|---|---|---|
stable | optional proposal hash | the first version's hash; absent on the first version |
prev | optional proposal hash | the version this one replaces; absent on the first version |
title | string | the proposal's title |
view | string | the view it was made from |
changes | list of change hash | the changes it carries, closed under deps |
alternative | optional {set, member} | the alternative set and the chosen member |
provenance | provenance | who proposed it |
canon_at | optional landing hash | canon's head when this version was written; absent before the first landing. The gate compares it with canon at landing |
summary | optional string | the proposer's plain-words summary that leads the approval card; absent when none was given |
Landing records
A LANDING object records one advance of canon. Landings form one chain through prev; the ref canon names the newest.
since 0.48.0
| Field | Type | Meaning |
|---|---|---|
proposal | proposal hash | the proposal version that landed |
prev | optional landing hash | the previous landing; absent on the first |
state | snapshot hash | canon after this landing |
approved_by | provenance | the approver; always a human except under policy |
changes | list of change hash | the changes this landing carried into canon |
chosen | optional {set, member} | the alternative chosen, when the proposal came from a member view |
checks | list of hash | the redaction requests that a removal landing applies, sorted and without repeats; empty on every other landing. A removal landing made before rdy 0.10.0 names none: a local check accepts it, and a portable proof refuses it |
assurance | enum | policy, relayed or local |
relayed_by | optional {actor, run} | the agent that relayed a human's approval |
relay_evidence | optional {quoted, question, session_ref} | the human's quoted words, the question they answered and a session reference |
evidence | optional {kind, options, choice, card_hash} | kind is text, card or elicited; a relayed landing carries text or card, a local landing carries card with a card hash or elicited, and elicited never carries a relay |
approved_version | optional proposal hash | the proposal version the approver named |
rebased_from | list of landing hash | the landings a replacement landing replaces |
assessment | optional assessment hash | the ASSESSMENT of the approved version; set on every landing of a proposed version, and absent on the landing of a re-affirmation card or an adopt card |
policy | optional {block, version} | the policy block version that accepted the landing; rdy_land writes it |
since 0.30.0
assurance encodes in the order policy, relayed, local, which is also its strength order; a relay is never stronger than local. relayed_by and relay_evidence are both set or both absent, and assurance is relayed exactly when they are set. rdy fsck checks both rules and that every rebased_from id names a landing. A landing that sets policy has assurance: policy and no relay fields, else rdy fsck reports policy landing fields differ. A landing at encoding 1 or later with assurance: policy has policy, else rdy fsck reports landing <l>: assurance is policy but it names no policy. An encoding 0 landing has no policy field. A landing's assessment names an assessment of its approved version, else assessment proposal differs. What each level means is in "The gate and approvals" in the rdy documentation.
since 0.18.0
A local landing carries no text evidence. It carries card evidence exactly when that evidence names a card hash. That holds for an approval on a UI page, whatever the proposal's view or the chosen label, and for the landing of a reaffirm card. A reaffirm landing has the choice They still hold, and the landed proposal's view is reaffirm- and the first 12 hex digits of that hash. An elicited approval records local, with {kind: elicited, options, choice, card_hash} and no relay fields. rdy fsck, a holder's check and a take refuse local text evidence and local card evidence with no card hash.
since 0.48.0
The landing of an adopt card has its own form too. It carries card evidence with the card hash and the choice Adopt the delivery. The landed proposal's view is adopt- and the first 12 hex digits of that hash. A relay with text evidence is refused, and an elicited approval keeps its elicited evidence.
since 0.5.0
When a landing adds an acceptance change, it lands a final proposal version that holds the request's changes then the acceptance; approved_version stays the version the approver named. A later dispute is its own object that names the landing by hash; it is not a landing field.
since 0.30.0
rdy_land writes policy landings with policy: {block, version}, the agent's provenance and no relay fields.
Snapshots
since 0.52.0
A SNAPSHOT object maps every block id in canon to its version hash at one landing. A landing's state is the id of that map's SNAPSHOT, the hash of its canonical bytes. The map is the result of one deterministic merge of the previous landing's map and the landed changes. A landing that rdy 0.52.0 writes stores its map as a delta, below, and no SNAPSHOT.
since 0.52.0
Tags
A TAG object names a landing as a version. Tags are never moved or deleted.
| Field | Type | Meaning |
|---|---|---|
name | string | the version, such as v1.2.0 |
landing | landing hash | the landing it freezes |
message | optional string | the tagger's message |
tagged_by | provenance | who tagged it |
since 0.4.0
Answers
since 0.4.0
An ANSWER object records one human act that no other record holds. It is either an answer to an item of the needs-you queue, or a relay of a person's words. An agent relays the words for a tag, a dismissal, a view act or a proposal. Its fields are, in order:
since 0.48.0
| Field | Type | Meaning |
|---|---|---|
item | string | the item ref: P-x@n, <id>@<version>, advice:P-x@n, defer:P-x@n, reaffirm:<block>@<version>, a tension id, tag:<name>, own:<view>, stale:<view>, propose:<view>, dispute:<landing>, resolve:<dispute>, verdict:<review> or adopt:<repo>@<entry> |
act | enum | what the person did: reject_proposal, later, confirm, reject_decision, answer_question, dismiss, tag, view_own, close_stale, propose, keep_suspect, accept_deferrals, refuse_deferrals, reject_reaffirm, dispute, resolve_dispute, accept_verdict, adopt or keep_pin, in that order |
option | optional string | the id of the option chosen, when the item offered options |
label | optional string | that option's label, from rdy's own card |
options | list of string | the labels shown, in order |
card_hash | optional hash | the hash of the card the person answered |
targets | list of hash | the objects the act wrote; for keep_suspect, the sorted block versions of the card's members |
person | provenance | the person, as the actor of the act |
relayed_by | optional {actor, run} | the agent that relayed the person's words |
relay_evidence | optional {quoted, session_ref, question} | the person's words, the chat session and the question they answered |
evidence_kind | optional enum | card or text with a relay; for a local answer, absent at the CLI, card on a UI page and elicited for an elicited answer |
note | optional string | the person's note, 1 to 2000 characters |
since 0.10.0
The ref answer/<item> names the latest answer to an item, for every act but later. The ref pending/<person>/<item> names the person's latest snooze, an answer of act later. Each ref holds the answer's hash. A ref name keeps : and @ as they are, and a person may hold /, so rdy never splits a ref name. Only the answer writer writes either family, and rdy refuses a plain ref write of one. A holder keeps neither family. It keeps answer/tag-object:<hash> refs, which only a take writes.
since 0.4.0
rdy fsck checks each answer and its refs:
- the answer decodes;
relayed_byandrelay_evidenceare both set or both absent;evidence_kindiscardortextwith a relay, and absent,cardorelicitedwithout one;cardandelicitedevidence carrycard_hash;- each
targetshash is an object in the log before the answer; - an
answer/orpending/ref names an answer of its own item, and apending/ref names its person; - a
pending/ref names actlater, and ananswer/ref never does.
The answer writer refuses a record that breaks one of these rules.
since 0.32.0
The acts dispute, resolve_dispute and accept_verdict have the codes 14 to 16. A relayed dispute act writes dispute or resolve_dispute. A local dispute act writes no ANSWER, because its own record holds the act. From rdy 0.32.0 a person's acceptance of a check verdict writes accept_verdict. Its option is accept_verdict:<review>:<version>, which binds the version, and the review supplies the case hash. A dispute answer's item is dispute:<landing>, and its one target is a DISPUTE of that landing. A resolve_dispute answer's item is resolve:<dispute>, and its one target is a DISPUTE_RESOLUTION of that dispute. An accept_verdict answer's item is verdict:<review>, a check review with the verdict Concern or Fail, and it has no targets. rdy fsck, a stream check, a take, a load and a reindex refuse a bad one with one of these reasons:
invalid dispute answer item;invalid dispute answer target;invalid verdict answer item;invalid verdict answer targets;accepted verdict is not a concern or fail check review.
since 0.48.0
The acts adopt and keep_pin have the codes 17 and 18, and an answer that holds one takes ANSWER encoding 1. Both answer an adopt item, adopt:<repo>@<entry>: the cited repo id in 32 hex digits, then the first 12 hex digits of the FOREIGN entry. An adopt answer has at most one target, the landing in its batch, and an optional note. A keep_pin answer has no target, and its note holds 1 to 2000 characters after trimming. rdy fsck and the answer writer refuse a bad one with one of these reasons:
invalid adopt answer item;invalid adopt answer note;invalid adopt answer targets.
since 0.29.0
Change plans
since 0.29.0
A PLAN object, kind 24, is one version of a view's change plan. Store format 17 adds the kind, the ref family plan/<view> and four ANSWER acts, and no existing record changes. Its fields are, in order:
since 0.29.0
| Field | Type | Meaning |
|---|---|---|
stable | optional plan hash | the first version's hash; absent on the first version |
prev | optional plan hash | the version this one replaces; absent on the first version |
view | string | the view whose changes the plan follows |
proposal | optional proposal hash | the proposal version this plan version belongs to; every propose batch and the landing batch set it, and an answer alone leaves it absent |
answers | list of answer | one per answered item, sorted by item; a later answer to an item replaces the earlier one |
heads | list of {repo, head} | the HEAD commit of each linked repo on the machine when rdy wrote this version, or null for a repo with no commit, sorted by repo; empty with no linked repo. A code item's close compares with the heads of the chain's first version |
provenance | provenance | who wrote this version |
seal | optional seal | set only on the version the landing batch writes |
since 0.29.0
An answer is {item, act, reason, subject, cause, by}. item is the full item hash. act is confirm, defer, done or dismiss, in that order, and a new act goes at the end. reason holds 1 to 2000 characters, or is absent for done. subject and cause are content hashes at answer time, and subject is absent for a code item. by is the provenance of the answer.
since 0.29.0
An item hash is the BLAKE3 hash of rdy-plan-item and a zero byte, then the cause id, the subject and the kind. Each of the three is followed by a zero byte except the last. The subject is a block id or <repo>:<path>. Tools show the hash as pi- and its first 16 hex digits. The kinds are update, rejustify, reaffirm, confirm, update_implementation and tension, in that order.
since 0.32.0
Each advisory tension that involves a proposal version is a tension item. Its subject is the tension's full id, 64 lowercase hex digits, and its cause is the tension's first block, by id. Its edge is tension, and its item hash follows the rule above. Tools show it as tn- and the first 12 hex digits of the tension id, in place of a pi- id. An answer to it stores no subject, and its cause is the tension's version hash, so the answer lapses when the tension's content changes. The seal check accepts a tension item whose subject is 64 lowercase hex digits.
since 0.29.0
A seal is {landing, version, decisions, items}. landing and version name the landing and the proposal version that landed. decisions lists, sorted, the decisions the landing created, superseded, revoked, refined or re-affirmed. An item is {id, kind, subject, cause, edge, outcome, answer}, sorted by id. answer names the ANSWER record that accepted a deferral, when there is one.
since 0.29.0
outcome is updated, relinked, repinned, reaffirmed, retired, committed, confirmed, done, deferred, open or dismissed, in that order. The ref plan/<view> names the view's latest plan version. Every propose batch writes a plan version that names the new proposal version, also when the plan holds no answers. The landing batch writes the sealed version after the landing record, so the seal can name the landing.
since 0.32.0
From rdy 0.29.0 rdy writes the item kind tension, the act dismiss and the outcome dismissed. A tension item seals only as updated, confirmed or dismissed, and no other kind seals as dismissed. A seal that breaks this rule is invalid seal. A dismiss answer to a sealed item of another kind is dismiss is not a tension answer.
since 0.29.0
A sealed version ends its chain: the next plan version in that view, from an answer or a propose, starts a new chain with no stable. A chain also ends when the proposal version it last bound lands with no seal. Only the plan writer writes the kind or the ref, and rdy refuses a plain write of either. A plan decodes within the bounds of a typed record, at most 16,777,216 bytes. It holds at most 100,000 answers, and a seal at most 100,000 items. A propose whose plan would seal more items is refused with E_LIMIT.
since 0.29.0
A proposal version written before store format 17 has no bound plan. When its landing writes a seal, the sealed version has no stable, no prev and no answers. Each sealed item has its computed outcome, or open, and no answer. The final version of such a landing binds no plan.
since 0.29.0
A redaction report searches every text value of a plan version for quotes, as it does for an ANSWER. These are the view name, each answer's reason, and each seal item's subject and edge. The report lists a plan version that quotes removed content. rdy does not erase that version. Answer notes follow the same rule.
since 0.29.0
The index adds four derived tables. One maps a landing to its sealed plan, and one maps a decision to the sealed plans that name it. The third maps a block and a cause to the latest accepted deferral. The fourth maps a proposal version to its plan version. rdy reindex rebuilds them from the log, and rdy fsck checks each chain and each seal. Store format 17 appends four acts to ANSWER, after propose: keep_suspect, accept_deferrals, refuse_deferrals and reject_reaffirm.
since 0.29.0
The deferral table holds one row per block and cause. The row names the latest acceptance, its log position, and the first position at which a canon transition cleared the pair. A later acceptance replaces the row, and a clear marks it, so a reopened suspect stays unaccepted. A sealed plan travels with its landing: a tag's closure carries the seal and the chain versions it names. A holder keeps PLAN objects and the four tables, but no plan/ ref.
since 0.18.0
A reaffirm card's landing is an ordinary landing. Its batch opens a view named reaffirm- and the first 12 hex digits of the card hash. rdy writes the proposal's title as Re-affirm after <block title> and its summary from the card. It writes the change, the proposal version, the landing and the sealed plan, and closes the view. The landing records the person as approved_by, with any relay and the card as evidence, as an approval does.
since 0.48.0
An adopt card's landing is an ordinary landing too. Its batch opens a view named adopt- and the first 12 hex digits of the card hash, and a view of that name already in the store is E_BAD_INPUT. rdy writes the proposal with the card's title and summary. The batch holds one change, the proposal version, the bound plan, the landing, the sealed plan when the plan has items, a close of the view and the adopt answer. The landing records the person as approved_by, with any relay and the card as evidence. The answer is the approval, so the landing checks only readiness and freshness.
View ops and view heads
Each view is a chain of VIEW_OP objects, newest first through prev. The ref view/<name> holds a small head, so a write appends one op and rewrites one head. A read of the included set walks back from the head to the latest checkpoint op, which carries the full set at that point, and applies the ops between.
A view op is {view, prev, op, actor, run, at_ms}. op is one of the kinds below, in this order.
| Op | Fields | Checkpoint |
|---|---|---|
Create | base (optional landing hash), owner (optional {actor, run}), pinned (bool) | yes: the view starts empty |
Fork | from (view name), from_head (op hash), base, changes, owner | yes: the view starts with changes |
Commit | change (change hash) | False |
Include | changes | False |
Exclude | changes | False |
Rebase | landing, dropped (changes), remaining (changes), conflicts | yes: after landing, the view holds remaining |
Undo | target (op hash) | False |
Close | reason (string) | False |
Own | owner (optional {actor, run}) | False |
The view head is {head, base, len, owner, pinned, closed, last_write_ms}: the newest op's hash, the base landing (absent for a view that floats on canon), the size of the included set, the owner, and the pinned and closed flags. A walk resolves Undo to the inverse of the op it targets, through at most 64 nested undos.
Reviews
since 0.48.0
A REVIEW object records a judgement that rdy cannot recompute. Its fields are subject, case_hash, verdict, reason, citations and provenance, in that order. citations holds the verdict's {block, note} entries, and the slot keeps its place in the positional encoding. The subject is one of four shapes:
Tension {id, vkey, kind, severity, sides, blocks}: the tension as it was when reviewed.Mention {block, entity}: an entity mention in a block's text.Pair {key, items}: a candidate pair. At encoding 0 each item is{block, content}. At encoding 1 each item is a side,Local {block, content}orForeign {target, content}, as below.Check {request}: a verdict on aCHECK_REQUEST.
The verdict is Dismiss, Restore, Tension, NoTension, Pass, Concern or Fail, in that order.
since 0.2.0
A tension takes only Dismiss, and the ref dismiss/<vkey> names that review. Nothing rewrites a dismiss/ ref. A mention takes either verdict, and the ref mention/<block>/<entity> names its latest review. Each mention review rewrites that ref, so the latest review wins.
A pair's key is the BLAKE3 hash of rdy-pair-1, a zero byte, then each item's block id and content hash as hex text. The items are sorted, and each text ends with a zero byte, so the order of the items does not change the key. An item's content is the block's content hash without tracking fields.
A pair takes Tension or NoTension, with a case hash and an empty reason. The ref pair/<key> names the verdict that settles the pair. Only a Tension verdict rewrites a pair/ ref, and only over a NoTension one. A Tension verdict writes, in the same batch, the first TENSION version and the ref semantic/<key>.
A TENSION object is one version of a semantic tension. Its fields are, in order:
keyanditems: the pair key and the two items the verdict judged.review: the verdict that opened the tension.advice: the reviewer's reason to block, when the verdict gave one.blocking: true only on a person's acceptance of the advice.relay: the person's relayed words, as{quoted, session_ref, question}.relayed_by: the agent that relayed them.prev: the version this one follows; absent on the first.provenance: who wrote the version.
A semantic tension has at most two versions. The first comes with its verdict: it has no prev, is not blocking and carries no relay. The second accepts the advice: it is blocking and keeps the first's pair, verdict and advice. The ref semantic/<key> names the latest version, and rdy fsck checks each chain against its verdict.
since 0.32.0
A check review takes only Pass, Concern or Fail, and its case_hash equals its request's. Concern and Fail need 1 to 20 citations and a reason of 1 to 2000 characters. Pass takes 0 to 20 citations, and its reason may be empty. A reason holds at most 8,000 bytes. The other subjects refuse the three new verdicts. From rdy 0.32.0 rdy_review_submit writes them, one review per request, with no ref. A verdict on a contradiction request writes a pair review instead, as a tension verdict does.
since 0.48.0
A pair side may name a block cited from a linked project, so a reviewer may pair a citing block with a cited one. A local side is {block, content}, and a foreign side is {target, content}, where target is {repo, id} at a delivered content. A REVIEW or TENSION with a foreign side takes encoding 1, and its pair key is the BLAKE3 hash of rdy-pair-2 and a zero byte, then each sorted side. A local side adds L, the block id and the content. A foreign side adds F, the repo id, the block id and the content. Each of these texts ends with a zero byte, and a pair with two local sides keeps the key above.
since 0.2.0
Transition records
since 0.2.0
A TRANSITION object records how one write batch changed the open tensions and the suspects. A batch holds at most one, as its last data frame, and only when something changed. The store never drops one as a duplicate, so two batches may log the same bytes. Its fields are, in order:
at_ms: the time of the batch's last other event, else the clock at the seal.resolvedandopened: the tension transitions, each list sorted by tension id.goneandnew: the suspect transitions, each list sorted by suspect key.
A reader applies the lists in that order.
since 0.2.0
A tension transition is {tension, kind, severity, sides, rekey, why}. kind and severity are the wire names that rdy_tensions shows. A side is {change, actor, run, landing}: an in-flight change with its author, or canon, at a landing when rdy knows it. When a tension opens, rekey names the id it replaces; when one resolves, it names the id that replaces it. A dismissal is a resolution whose cause is dismissed.
since 0.2.0
A suspect transition is {block, target, reason, writers, why}, and it records a suspect in canon. writers lists the authors, as {actor, run}, of the in-flight writes on the block at the transition, sorted and distinct. A suspect's key is the BLAKE3 hash of rdy-suspect-1, the block, the target and the reason, each followed by a zero byte except the last.
since 0.48.0
why is {cause, id, actor, run}. id names the object that made the transition, for the causes that have one. actor and run name the dismisser, and only a dismissed transition carries them. A write batch gives its transitions one cause, by priority: a foreign entry, a landing, a commit, a review, an alternative set, another view op, else written. A dismissal takes dismissed. The causes are, in this order:
since 0.48.0
| Cause | What made the transition | id |
|---|---|---|
committed | a commit in the batch | the change |
landed | a landing in the batch | the landing |
dismissed | a review that dismissed the tension | the review |
view_changed | another view op in the batch | the view op |
reviewed | another review in the batch | the review |
alt_set | an alternative set version in the batch | the version |
written | any other write | none |
pack_reload | a reload of the config or the packs | none |
reopened | a change of the pack or the rdy build while no rdy ran | none |
recheck | a full republish, such as after rdy reindex | none |
delivered | a FOREIGN entry in the batch | the entry |
since 0.2.0
A batch logs transitions only when one of its frames can change something. Blob chunks, blob manifests, tags, intents, answers and the refs under inbox/, intent/, answer/ and pending/ change nothing. A reload that changes anything writes a batch that holds only its record. The daemon does the same once after ready, with cause reopened, when the pack or the rdy build changed while no daemon ran. Without a daemon, the first batch that computes transitions logs them in its own record.
since 0.2.0
The index folds the records, in log order, into two tables: the open tensions and the open suspects. A tension opens only while it is not open, and resolves only while it is open; a suspect follows the same rule. rdy fsck folds every record again and checks the tables against the fold. Its report counts the records as transitions. It also reports unlogged_moves, the transitions a reconcile would log now, and never writes them.
since 0.48.0
A transition may name a linked project. A tension transition's side may be foreign, {repo, entry}, and a suspect transition's target may be a foreign block, {repo, id}. A foreign suspect's key is the BLAKE3 hash of rdy-suspect-foreign-1, the block, the repo, the id and the reason, each followed by a zero byte except the last. A delivery writes its suspect and tension moves in its own batch, with the cause delivered. A TRANSITION with a foreign shape takes encoding 1, and every other one keeps encoding 0.
Redaction records
since 0.48.0
A redaction writes three kinds, each encoded with postcard. A REDACTION request is {carrier, actor, targets, reason_class, reason, manifest}. carrier is the hash of its carrier change: a change with no ops and the message Request content removal.. actor is a provenance. A target is all_versions with a block id, version with {id, version}, blob with a manifest hash, or foreign_version with {repo, id, version}. A request with a foreign_version target takes encoding 1. reason_class is secret, personal, legal or retraction.
since 0.29.0
The manifest is the complete report that a request binds: {versions, blobs, shared_blobs, spans, inside, outside, quarantine, assessment}. A span is {place, kind, hash, len, residue}: one payload the removal zeroes, at {segment, offset}, with its residue's hash, if any. inside lists the affected records, outside holds one row per kind of copy, and quarantine holds store-relative names. The report hash is the BLAKE3 hash of rdy-redaction-report-v1, a zero byte, then the manifest's bytes. assessment is carried from rdy 0.26.0, and not_implemented in a report an earlier rdy recorded. So a request recorded before rdy 0.26.0 no longer matches its report, and it is E_REDACTION_STALE until it is recorded again.
since 0.6.0
A REDACTION_RESIDUE is block or change. A block residue is {version, id, block_type, parent, order, content_hash, frozen}, with no title, key, field, body, link or pin. A change residue is {change, view, ops, deps, provenance, justification, message, links}. It keeps the change's original id and every field. Each op names its block by version: create {id, version}, update {base, id, version} or delete {base, id}.
since 0.26.0
A residue of encoding 1 ends with source_encoding, the encoding of the object it replaces. Its block residue's content_hash is the content hash without the order key. A residue of encoding 0 keeps the content hash with the order key, as it was written. rdy checks each residue against the one derivation that its own encoding names, and it accepts no other. Every new residue takes encoding 1.
since 0.48.0
A REDACTION_APPLY is {request, landing, report_hash}. It shares a sealed batch with the human landing it names, after the landing and the refs, one for each request in request-hash order. That landing lists each request it applies in checks, so its hash binds the exact removal set. A sealed apply authorizes a removal, and a request alone authorizes nothing. In a foreign copy, a foreign Removal entry is an erasure authority too. A plain write of any of the three kinds is refused, because only the store's checked redaction writers write them.
since 0.10.0
A holder takes a removal from an upload by its portable proof, because a sync batch carries no source places. The proof follows object links only: the apply, its request, the request's carrier change and the human landing that lands it. That landing names the request in checks. Each span of the request's manifest becomes its logical tuple of kind, hash, length and residue. The take erases every copy of a tuple that the holder's own log holds, and it never seeks to a source place. An all-versions target never adds a version that the approved manifest does not list.
since 0.13.0
A REDACTION_CARRIED record is {request, apply, landing, approved_by, reason_class, targets, spans}, encoded with postcard like the other redaction kinds. Only a load that stops before a source apply writes it, in one carried batch after its last loaded batch. request, apply and landing are the source's hashes, and this log can lack them. approved_by is the human who approved the source landing, and the record holds no reason text. A span is {place, kind, hash, len, residue, held}, and held says whether this store holds the payload. rdy refuses a plain write of the kind.
since 0.13.0
A carried record authorizes the zero payloads of its spans with held: false, and it never authorizes an erasure. A span with held: true must hash to its frame hash, until a later apply in this store, or a later carried record with held: false for the same span, accounts for it. An apply in this store that covers a span is its proof, and the carried record is the proof only while no apply covers it. The kind stays local to dump and load: a sync stream refuses it, and a carried record is never a removal proof there.
since 0.13.0
A carried record decodes within the bounds of a typed record: at most 16,777,216 bytes and 1,000,000 decoded values. It names 1 to 100,000 spans and at most 256 targets of at most 256 bytes each, and its approver's role is Approver. Its spans are in ascending place order with no overlap. Each span is a whole BLOCK, CHANGE or BLOB_CHUNK frame of at most 64 MiB that ends before the record's batch. A block or change span names a residue sealed before the record, and a chunk span names none. Two records for one source apply must be equal, and a record that breaks a rule is E_REDACTION_CORRUPT.
since 0.48.0
A Removal entry in the foreign log records the cited project's portable proof and the versions it erased. The adapter's take_foreign_removal checks the proof by object links, as a holder's take does, against the cited repo id. A proof of another repo is E_REPO_MISMATCH. The take then seals one batch: the proof's records, the Removal entry, whose proof names the apply, then the apply. The erasure runs once that batch is durable, in the foreign copy only, for live and revoked links alike. The take reports and skips a version that the store does not hold.
since 0.48.0
A Removal entry is an erasure authority, as a sealed apply is. rdy fsck accepts the zeroed payloads of the versions it names, compaction punches them, and a follower zeroes them. Each open, load, follow and seal derives the authority again from the log alone. A proof that fails, a version the proof does not approve, or local content is E_REDACTION_CORRUPT. The proof's records stay outside canon: the index keeps them as objects only, never as landed changes.
since 0.48.0
A redaction request in the citing project may name the target foreign_version {repo, id, version}. A person names it as <alias>:<id>@<version>, with the repo link's alias and the full version hash. A REDACTION with such a target takes encoding 1. The removal reaches the foreign copy only, and it never erases local content.
Blobs
An asset is stored as BLOB_CHUNK objects of at most 1 MiB, in order, followed by one BLOB_MANIFEST {len, chunks}. The manifest's hash is the asset's id, which a figure block names. An asset is at most 64 MiB. Only the store's own blob writer produces a manifest, so no manifest whose bytes a client chose is ever read as a blob.
since 0.24.0
The store reads a blob's state from its manifest and the redaction records alone, and it reads no chunk. The state is Readable, Removed(request) when a removal masks the manifest or a chunk, or Missing when no manifest has the hash. Readable speaks for the metadata only, so a byte read can still fail on a damaged chunk. A render reads the bytes of each readable blob that it shows once per build.
Refs
A ref is a named value in the log. Each write of a ref is a REF_UPDATE object {name, value, at}, where at is the log location of the batch that set it. The index holds the current value of every ref; rdy reindex rebuilds it from the log.
since 0.53.0
| Ref | Value |
|---|---|
canon | the newest landing's hash |
tag/<name> | the tag object's hash |
view/<name> | the view head |
proposal/<stable> | the hash of the latest version of the proposal with that stable id |
open/<view> | the stable id of the view's proposal until it lands; the landing empties it; a close leaves it, and the proposal reads withdrawn |
intent/<stable> | the hash of the latest version of the intent with that stable id |
alt/<stable> | the hash of the latest version of the alternative set with that stable id |
meta/store_features | the store's feature manifest, as its canonical JSON |
meta/upgrade | the receipt of the last store upgrade, as JSON {from, to, steps, source_end, backup}; only the upgrade writes it |
meta/store_format | a scalar store format number, in ASCII decimal, as a loaded dump holds it; no rdy writes one now |
meta/repo_id | the project's repo id: 16 random bytes |
meta/origin | where a clone came from: {fork, repo_id, tag, landing}, the source's repo id, newest version and canon head; fork is true for a fork |
meta/store_mode | in a holder only: the six bytes holder, set in its first batch; a project has no such ref |
meta/sync/<remote>/... | in a project only: the sync client's state for that remote: canon, view/<name>, upload and pending; only push, pull and a URL clone write them |
dismiss/<vkey> | the review that dismissed the tension with that vkey; never rewritten |
mention/<block>/<entity> | the latest review of that mention; each review rewrites it |
pair/<key> | the verdict that settles the pair with that key; only a tension verdict over a no_tension one rewrites it |
semantic/<key> | the latest version of the semantic tension of the pair with that key |
inbox/<actor>/<run> | one session's inbox subscription: its cursor, declared areas and role |
answer/<item> | the latest answer to that item, for every act but later |
pending/<person>/<item> | the person's latest snooze of that item, an answer of act later |
answer/tag-object:<hash> | in a holder only: the relay answer of the tag object whose hash is <hash>, in 64 hex digits |
held/<landing> | in a holder with hub_canon only: keeps a chain of landings outside canon; never removed |
replaced/<hash> | marks a landing or a view op that left a chain; never removed. A holder with hub_canon has it, and from rdy 0.55.0 a project has it after a pull or a view re-chain, with no store feature |
plan/<view> | the hash of the latest version of the view's change plan; only the plan writer writes it, and a holder has none |
check/<request> | the CHECK_REQUEST with that hash, in 64 hex digits; the request's writer writes it in the request's batch, and a holder has none |
foreign/link/<id> | the newest FOREIGN entry of the repo link whose block id is <id>; only the foreign log writers write it, and a holder has none |
since 0.2.0
An inbox/<actor>/<run> ref holds {actor, run, cursor, areas, role}. The last segment of the name is empty when the session has no run. The cursor is {at, skip}: at is the end of a batch, and skip counts the items of the next batch with events that a read passed. The role is reader, writer or reviewer, and areas is sorted and distinct. Only the inbox code writes these refs, and rdy refuses a plain ref write of one. rdy fsck checks that each value decodes, names its own session and keeps these rules.
since 0.10.0
Only the store writes a meta/ ref, and rdy refuses a plain ref write of one. A new store's first batch sets meta/repo_id and meta/store_features. A load's upgrade batch sets a repo id when the dumped log has none. A clone from a project or a dump sets meta/origin in its last batch, and a fork's also sets a new meta/repo_id. A clone from a hub URL sets meta/origin and the hub repo's meta/repo_id when it makes the new project. rdy fsck refuses an unknown meta/ ref, an invalid manifest or receipt, a missing repo id and a repo id that is not 16 bytes. It also refuses an origin that does not decode, a clone's origin that names another repo id, and a fork's origin that names its own.
since 0.10.0
A holder's first batch sets meta/store_mode to the six bytes holder, beside meta/store_features and meta/repo_id. A project has no such ref. No later batch adds, changes or removes it, and a write of it is refused with store mode cannot change. Any other value reads meta/store_mode must be holder when present. A mode ref after the first batch reads holder mode must be set in the first batch.
since 0.53.0
A holder's refs are closed: meta/store_features, meta/upgrade, meta/store_format, meta/repo_id, meta/origin, meta/store_mode, tag/<name> and answer/tag-object:<hash>. A holder with the store feature hub_canon also takes canon, view/<name>, held/<landing> and replaced/<hash>. Any other ref in its log reads holder ref <name> is not allowed. An answer/tag-object: ref stands only when its tag object is in the same batch or an earlier one. Only a take writes it, and a plain write of it is refused with a holder store cannot write ref <name>. The same rules judge a write, the replay of the log into the index, an ingest and rdy fsck.
since 0.53.0
since 0.48.0
Only the foreign log writers write a foreign/ ref, and rdy refuses a plain ref write of one. A reindex rebuilds these refs from the log, as it rebuilds every ref, and it never rewrites an entry.
since 0.53.0
since 0.53.0
Segments and frames
since 0.48.0
The log is a sequence of append-only segment files in .rdy/store/segments/, named seg-000000.log, seg-000001.log and so on. A segment is at most 64 MiB. A frame is one object: a header of a 4-byte little-endian payload length, the kind byte and the 32-byte BLAKE3 hash of the payload, then the payload. Frame hashes are verified on read. A removed payload is the exception: it is all zeros, and a read returns the stub or E_REDACTED. A sealed redaction apply, a foreign Removal entry or a carried record of a stopped load authorizes each such payload.
A versioned object marks its frame: the kind byte is the object's kind with the high bit set, kind | 0x80. Its payload starts with the encoding version as a 2-byte little-endian number, then the postcard body. An unmarked kind byte means encoding 0, and a marked frame of version 0 is refused. The frame's hash covers the whole payload, the version included. Kinds stay below 128, and REF_UPDATE and BATCH_COMMIT are never marked. An object key, an index entry and the public JSON name an object by its kind without the mark.
Every write batch ends with a BATCH_COMMIT frame {start, frames, digest}: the location of the batch's first frame, its frame count, and the BLAKE3 of the batch's frame hashes in order. The batch and its marker are fsynced once, then the write is acknowledged. A segment rolls only at a batch boundary, so a batch never spans two segments, and a batch larger than a segment gets one oversized segment of its own. The marker is neither an object nor an index entry. A redaction keeps every frame header and marker, so each batch digest still verifies.
since 0.2.0
The engine holds a write's batch open. Each write in it appends and indexes its frames, with no marker and no sync. The seal then appends the batch's TRANSITION record, if there is one, writes the marker over every frame and syncs once. So a write and its transitions commit together, with one sync. No index checkpoint, verify or reindex runs while a batch is open.
since 0.2.0
A kill before the seal leaves frames with no marker, which the next open copies to a .torn- file and truncates. So the write and its record are lost together, and neither is acknowledged. A failed seal truncates the batch and stops every later write until the store reopens. The index then holds entries of frames that are gone, so the close removes it, and the next open rebuilds it from the log. A redaction's apply batch is the exception: once it is synced, a later failure never truncates it, and the next open finishes the removal.
A write is acknowledged only after its batch, marker included, is fsynced.
On open, rdy scans the last segment forward. The acknowledged boundary is the end of the last valid marker. Damage before the boundary is refused. Everything after it belongs to an unacknowledged batch: it is copied to <segment>.torn-<offset> and truncated away. A last segment with no marker is quarantined whole. A .torn- file is never read as part of the log.
The index
The index is a redb database, index.redb, in the store directory. It is derived from the log and never the source of truth. rdy reindex builds a new index in index.redb.tmp from every frame, and renames it over index.redb once it is complete and durable. A failed reindex removes the temp file and keeps the old index.
since 0.53.0
| Table | Key | Value |
|---|---|---|
objects | hash | the location of the first frame written with that hash |
typed | hash then kind byte | the location of that kind's object with that hash |
producers | version hash then change hash | empty: every change that produced that version |
view_ops | view name, a zero byte, then op hash | empty: the ops of each view |
landed | change hash | the oldest landing of canon's current chain that carries it, or that carries a replay of it through links.replayed_from; a chain that left canon lands nothing |
landing_carries | landing hash | its prev and the changes that it carries |
replays | change hash | the change that its links.replayed_from names |
carriers | change hash, then landing hash | empty: every landing that carries each change, on canon or not |
deleters | block id, a zero byte, then change hash | empty: every change that deletes that block |
refs | ref name | the ref's current value |
open_tensions | tension id | the hash of the TRANSITION record that opened it |
open_suspects | suspect key | the hash of the TRANSITION record that made it new |
open_proposals | open/<view> ref name | the proposal's stable id, while the ref names an open proposal |
redaction_carriers | carrier change hash | the hash of the first redaction request logged for it |
redaction_items | request hash, 0x00, kind byte and object hash; or request hash, 0x01 and a frame location | for an object, its residue's hash or empty; for a frame, the kind, the object hash, the payload length and the residue's hash |
redaction_objects | object hash, kind byte, then request hash | empty: the requests that name each object, applied or not |
redaction_applied | request hash | the hash of the first apply record that activated it, and that record's location |
redaction_active | object hash then kind byte | the active mask by object: the request, the apply record and its location, and the residue's hash |
redaction_spans | frame location | the active mask by frame: the apply record, or the carried record for a carried span, then the request, the kind, the object hash, the payload length and the residue's hash |
signatures | subject hash then signature hash | empty: every signature of each landing or tag |
plan_seals | landing hash | the hash and location of the first sealed plan that names that landing |
snapshot_deltas | landing hash | the hash and location of the first snapshot delta that names that landing |
plan_decisions | decision id, a zero byte, then its landing's location | the hash and location of each seal that names that decision |
plan_deferrals | block id, a zero byte, then cause id | the latest accepted deferral of that pair: its source, its position and its first clear |
plan_proposals | proposal version hash | the hash and location of the first plan version bound to that version |
assessment_proposals | proposal version hash, then the log location of an assessment | the hash of that assessment: every assessment of each version, in log order |
diagrams | the BLAKE3 hash of a diagram's normalised source, the drawing crate's version, a zero byte, then the renderer's version | the drawing's standalone SVG, or why its draw gave none; at most 64 MiB of rows, and the file can hold about twice that until the next durable commit; a reindex and an open after an unclean shutdown empty it |
meta | indexed_upto; first_briefed_change | the log location the index has applied; the location of the log's first change that records a briefing |
since 0.53.0
Every entry but landed is computed from its own frame alone. landed follows canon's chain. A rebuild reproduces each one. The index is committed to disk at a checkpoint: after 1000 frames, or after 2 seconds idle. On open, frames after indexed_upto are replayed into it. A write indexes its frames before its batch is sealed. So a reader on another thread can see a batch that a failed seal or a kill then removes. Only the writer decides on the data of an open batch; other threads read the state it published after the seal. An index that holds objects but lacks a table that this rdy reads, or keeps landed by an older rule, such as a plan table or the snapshot delta table, is outdated. rdy replaces it with an index that it rebuilds from the log when the store opens.
since 0.53.0
since 0.53.0
The store directory and FORMAT
since 0.35.0
The store lives in .rdy/store/ inside the project. It holds the segments, index.redb, the lock file that keeps a second writer process out, index.open while a process has the store open, FORMAT and FEATURES. A read-only follower also holds FOLLOWER, a private file outside the log.
since 0.26.0
FORMAT holds two fixed lines, so a released rdy of a scalar format reads a feature store as one a newer rdy wrote. Its text is exactly:
since 0.32.0
rdy store format
store_format 19since 0.26.0
FEATURES beside it mirrors the log's meta/store_features ref. It holds the line rdy store features 1, then one compact JSON object {manifest_version, features: [{name, class, required_rdy}]} on one line. A class is compatible, read_only_compatible or incompatible, and a feature name matches [a-z][a-z0-9_]{0,63}. required_rdy is a version of three numbers, such as 0.26.0. A manifest holds at most 65,536 bytes and 256 features, sorted by name and distinct. rdy writes FEATURES before FORMAT, each by rename, and a FORMAT with no FEATURES is an invalid manifest. In FORMAT, a <key> <number> line with another key is ignored, and rdy load writes both files after it writes the log.
since 0.53.0
A store opens only when this rdy knows every incompatible feature it lists; a store of a scalar format never opens.
The log's meta/store_features is the authority, and FEATURES is its mirror, so an open can refuse a store before it opens the index. A new store's first batch writes the ref. A feature's first use writes the grown manifest in the batch that uses it, then the mirror. A log whose ref lists features that FEATURES lacks is refused. A FEATURES that lists more than the sealed log is the leftover of an unsealed first use, and the open writes the mirror again.
since 0.52.0
rdy 0.26.0 registers seven features, each incompatible and each needing rdy 0.26.0. They turn on as follows:
content_hash_v2andobject_encoding: in every new store, and in the last batch of a load of a scalar store's dump;object_encoding: also at any new frame of encoding 1 or more;view_replay: aCHANGEwithlinks.replayed_from;assessment: anASSESSMENT, or aLANDINGwithassessment;plan_tension: atensionplan item, adismissplan answer or adismissedseal;dispute: aDISPUTE, aDISPUTE_RESOLUTION, or anANSWERwith the actdisputeorresolve_dispute;check_request: aCHECK_REQUEST, a check review, aPass,ConcernorFailverdict, or anANSWERwith the actaccept_verdict.
A feature never turns off, and a load of a feature store's dump keeps every feature of its manifest.
since 0.48.0
rdy 0.48.0 registers an eighth feature, foreign_copy, which is incompatible and needs rdy 0.48.0. It turns on in the batch that first writes a FOREIGN entry, a frame in its kind's optional encoding, or a repo_link block. A repo_link block turns it on in any view, before any delivery. A local or person instruction block turns on no feature. Its upgrade path is empty, because no stored object changes, and it carries no sync stream purpose. rdy 0.47.0 refuses a store that lists it, with E_STORE_FORMAT.
since 0.51.0
rdy 0.51.0 registers a ninth feature, figure_dark, which is incompatible and needs rdy 0.51.0. It turns on in the batch that first stores a figure with dark_blob, alone or in a change, in any view. A load whose records hold one turns it on too. It stays on when that figure is removed later, and a dump of the store carries it in its manifest.
An rdy without it refuses the store and its dumps with E_STORE_FORMAT, store feature figure_dark needs rdy 0.51.0, fix open the project with rdy 0.51.0 or later. So an older compaction or dump never drops a dark image. It adds no upgrade step, and the store format stays 19.
since 0.52.0
since 0.53.0
since 0.53.0
Signature statements
since 0.10.0
A SIGNATURE object, kind 11, holds one signature over one statement. The table gives its fields in their postcard order. subject is the hash of the landing or tag it covers. The blob holds the public key, so the key and its type come from it. rdy refuses a new record over 65536 bytes, or a field over its bound. rdy never stores a keybind signature.
since 0.10.0
| Field | Type | Meaning |
|---|---|---|
subject | hash, 32 bytes | the landing or tag that the statement covers |
namespace | string, at most 64 bytes | the SSHSIG namespace of the statement's kind |
statement | bytes, at most 16384 | the exact statement bytes that were signed |
sig | bytes, at most 16384 | the OpenSSH SSHSIG blob, with a sha512 prehash |
signed_by | provenance | the session that asked for the signature, with its time; its actor and its run are at most 4096 bytes each |
since 0.10.0
No landing or tag names its signatures, so a landing's hash never changes. The index table signatures maps a subject hash, then a signature hash, to nothing. rdy computes the entry from the frame alone, and rdy reindex rebuilds it. When the store opens, rdy sets aside an index without the table and rebuilds it from the log. One subject may hold several signatures, of several kinds or keys. One read returns at most 4096 signatures of one subject.
since 0.9.0
| Namespace | Kind | Signed with | Read off |
|---|---|---|---|
rdy-approval-v1 | approval | the person's key, signing.key | the landing |
rdy-relay-v1 | relay | the machine's agent key, signing.agent_key | the landing, or the tag and its ANSWER record |
rdy-tag-v1 | tag | the person's key | the tag |
rdy-keybind-v1 | keybind | the key being bound | the hub's challenge; sent to the hub, never stored |
since 0.22.0
A statement is UTF-8 text with these rules:
- Every line ends with one LF, the last line too. No CR, blank line or comment appears.
- A line is
<name>: <value>, with one space after the colon. No space leads or trails a line. - The first line is
rdy-statement: <version>, and the second iskind: <kind>. Each field follows once, in the order of its kind and version. - A value is never empty and holds no control character.
nonestands for an absent value. - A hash is 64 lowercase hex characters.
repois the 32 hex characters ofmeta/repo_id.keyisSHA256:and the fingerprint, asssh-keygen -lprints it.
No statement holds a time, so rdy rebuilds each statement from its record and the key, byte for byte.
since 0.22.0
rdy writes version 2 for a relay, and version 1 for approval, tag and keybind. Version 2 changes the relay kind only: relayed_by holds the relayer's actor alone, and a relayed_run line follows it. So a statement holds at most 10 fields. A version 2 relay keeps the namespace rdy-relay-v1, and a version 2 statement of any other kind is E_SIG_INVALID.
A check rebuilds a statement with the version that its signed bytes name. So a version 1 relay keeps its <actor>/<run> line and stays valid. In version 2, the relay's trust principal is the whole relayed_by value, so ssh-keygen -Y verify -n rdy-relay-v1 -I <relayed_by> works out of band. In version 1, the principal stays the actor part of relayed_by.
since 0.22.0
rdy reads the fields off the record:
proposal_versionis the landing'sapproved_version, else itsproposal.baseis itsprev, ornoneon the first landing.actorisapproved_by.actorfor a landing, andtagged_by.actorfor a tag.assuranceis the landing's level.- In version 2,
relayed_byis the relayer's actor, andrelayed_runis its run, ornonewithout a run. In version 1,relayed_byis<actor>/<run>, or the actor alone without a run. - A stored relay run of exactly
nonewould give the bytes of a relay with no run. So signing such a record refuses withE_BAD_INPUT,the record cannot form a signing statement. A check finds no version 2 statement for such a record, so a valid signature readsmismatch, withE_SIG_OBJECT_MISMATCH. Its version 1 statement still rebuilds. evidenceis the BLAKE3 hash of the landing'srelay_evidence, then itsevidence, as the landing stores them.- A relay of a tag has
act: tagand names the tag, its name, its landing and theANSWERrecord that holds the relay. accountandchallengecome from the hub's challenge.
The first five examples below are version 1: an approval, the two old relays, a tag and a key binding. rdy still checks the two old relays. The last two examples are version 2 relays, one with a run and one without.
rdy-statement: 1
kind: approval
repo: <repo id>
proposal_version: <hash>
base: <hash, or none>
actor: human:ana
assurance: local
key: SHA256:<fingerprint>rdy-statement: 1
kind: relay
repo: <repo id>
act: approve
proposal_version: <hash>
base: <hash, or none>
actor: human:ana
relayed_by: agent:ana/claude/<run>
evidence: <hash>
key: SHA256:<agent key fingerprint>since 0.9.0
rdy-statement: 1
kind: relay
repo: <repo id>
act: tag
tag: <hash of the TAG object>
name: v1.2.0
landing: <hash>
actor: human:ana
relayed_by: agent:ana/claude/<run>
answer: <hash of the ANSWER record>
key: SHA256:<agent key fingerprint>
rdy-statement: 1
kind: tag
repo: <repo id>
tag: <hash of the TAG object>
name: v1.2.0
landing: <hash>
actor: human:ana
key: SHA256:<fingerprint>rdy-statement: 1
kind: keybind
account: <account id>
challenge: <challenge id>
key: SHA256:<fingerprint of the key being bound>since 0.22.0
rdy-statement: 2
kind: relay
repo: <repo id>
act: approve
proposal_version: <hash>
base: <hash, or none>
actor: human:ana
relayed_by: agent:ana/claude
relayed_run: <run>
evidence: <hash>
key: SHA256:<agent key fingerprint>since 0.22.0
rdy-statement: 2
kind: relay
repo: <repo id>
act: tag
tag: <hash of the TAG object>
name: v1.2.0
landing: <hash>
actor: human:ana
relayed_by: agent:design-thread
relayed_run: none
answer: <hash of the ANSWER record>
key: SHA256:<agent key fingerprint>since 0.9.0
A signature covers its subject when four things hold. The SSHSIG verifies in the namespace of the statement's kind. The key type is ssh-ed25519 or sk-ssh-ed25519@openssh.com. The subject is a landing for an approval, or a tag for a tag, and a relay names which. The statement that rdy rebuilds from the subject equals the signed bytes. For a landing that a pull replayed, the base may instead be the prev of a landing on its rebased_from chain, and the check names that landing in carried_from. In a fork, a statement made before the fork may name the repo id of any fork origin that the log records. So a fork of a fork keeps its ancestors' signatures.
since 0.10.0
A relay of a tag names its ANSWER record. A project finds that record by the ref answer/tag:<name>, and a holder by the ref answer/tag-object:<hash> of the tag object. A holder keeps no fork history. In a holder, a valid signature may name another repo id in its statement. When the statement that rdy rebuilds for that id equals the signed bytes, the check reads foreign_repo, with that id. It shows as signed in another project (<repo id>): not verified here, and it is neither a mismatch nor damage.
since 0.53.0