System
Working copy
A person who prefers an editor to a chat edits the documentation as files. The working copy is the project root as a tree of YAML files, bound to a view. You edit the files, stage them and commit them, as in git. Nothing reaches the store until you commit. This page describes the files, the commands, and what the files hold and what stays in the store. It also says why the file path is for people.
- Working copy
- The working copy is the project root as an editable tree of YAML files bound to a view: folders are directories with
_folder.yaml, docs are<name>.yaml. It is for people: humans edit it in an editor and enter edits withrdy addandrdy commit, and agents use tool calls. Nothing in it reaches the store until committed, and the site can be built from it alone.
The files
The project root is the working tree, with .rdy/ beside it. The layout is the doc tree of an export, at the root. A folder is a directory with a _folder.yaml inside it. A doc is a <name>.yaml file. The file system decides folder and doc names and parents. Figure files live in _blobs/<hash>.<ext> at the root. "File formats" in the rdy documentation gives the exact file format.
- _blobs/
_blobs/<hash>.<ext>holds figure files in the working copy, named by content hash. A figure block written with a relative image path is stored as a blob at commit and rewritten to the hash form.
Only these belong to the tree: directories that hold _folder.yaml and the *.yaml files directly inside them, *.yaml files that read as docs, and _blobs/. Everything else is ignored and never an error. That covers dot entries such as .rdy/ and .git/, files that are not YAML, directories without _folder.yaml, *.theirs.yaml files and anything .rdyignore matches. A *.yaml file may sit where a doc could be and still not read as a doc. rdy status lists it as untracked, with a hint to run rdy check on it. It is never committed by accident.
Local state lives in .rdy/wc/ and is never a store object. It holds the bound view, the version of every block as checked out, the staged files, the conflicts and the write-back journal. An advisory lock keeps two commands in one checkout from racing. A state file that does not read is E_IO, and the fix says to delete it and check out again.
A doc file, _folder.yaml, an import tree or an edit buffer with an unknown key is refused, with a did-you-mean. An edit buffer is kept, so nothing typed is lost.
Checkout writes a removed block as a notice entry. The entry keeps the block's id, type and place, and its body is Content removed.. It has no fields, links or pins. A removed doc's file and a removed folder's directory are named by the block's id. A working copy checked out before the removal keeps the old text until rdy update.
A figure keeps its blob hash when its blob lost a chunk to a redaction. The chunk may be the blob's own, or one it shares with a removed blob. Checkout and rdy update write no file in _blobs/ for that blob. They write every other file and go on.
For people, not agents
The working copy is for people. A human edits the files in an editor and enters the edits with rdy add and rdy commit. An agent reads and writes through tool calls, because the briefing and the consequences live there. The agent guide gives agents the rule in their own terms.
Agents read and write through rdy's tools, never through the working-copy files.
Nothing prevents an agent from writing a file. The guidance lives in what rdy setup installs and in the guide that rdy_instructions delivers, not in enforcement. One safety net stays. A commit by an agent session must cite a current briefing for every stable block it touches, as the write tools require. There are no agent worktrees; every extra checkout is a human one.
Checkout, status, add, commit, update
Five commands move content between the files and the store. Every one supports --json. "CLI" in the rdy documentation has every flag.
- Add
rdy add <path>…stages files and directories for the next commit, deletions and renames included.
- Checkout
rdy checkout <view>binds the working copy to a view and writes its files. It refuses to overwrite uncommitted edits or untracked files unless forced.
- Commit
rdy commit -m <msg>validates the staged files and records them as one atomic change in the bound view. Each op's base is the version checked out, and a block that moved in the view refuses the commit untilrdy update. Commit prints the consequences and cites the recorded briefing token for stable blocks.
- Update
rdy updatebrings into the working copy the bound view's changes made elsewhere and its rebases onto new canon. A block changed both locally and in the store is a conflict listed byrdy status.
| Command | What it does |
|---|---|
rdy checkout <view> | Binds the tree to a view and writes its files. It refuses to overwrite uncommitted edits or an untracked file unless you force it. |
rdy status | Lists modified, added, deleted, moved and renamed docs and folders, staged or not, plus unresolved conflicts. |
rdy add <path>… | Stages files and directories, including deletions and renames. |
rdy commit -m <msg> | Validates the staged files and records them as one atomic change in the bound view. A justification goes on the command as it does on rdy_write. |
rdy update | Brings in the view's changes made elsewhere, and its rebases onto new canon. |
rdy new folder and rdy new doc also write the new file when a working copy exists. rdy check lints the working copy and prints each problem as path, line, column, code, message and fix.
The edit loop on the file path: brief, edit the files, add, commit; rdy validates, records one change in the bound view, writes the files back in canonical form and prints the consequences; update brings in changes from elsewhere.
Diagram source
flowchart LR
A["rdy brief"] --> B["edit files"]
B --> C["rdy add"]
C --> D["rdy commit"]
D --> E["one change in the view"]
E --> F["write-back + consequences"]
G["rdy update"] -.-> BHow a commit works
Commit reads the staged files and compares each block, by id, with the version checked out. A changed block is an update. A block missing from every file is a delete. A block found in another file is a move. A renamed or moved file or directory renames or moves that doc or folder. Ids in the files make every edit exact: mv on a file is a rename of the same doc, so links survive it. A block with no id is new and gets one at commit.
- Write-back
- Write-back is the rewrite of every committed file in canonical form after the daemon acknowledges a commit, with new ids filled in and comments dropped. Keys are written back only for refs typed as keys.
Validation is rdy check on the staged files plus the engine's write validation. Any error refuses the commit with E_WC_INVALID and the diagnostics. Each op's base is the version checked out. If the bound view moved for a block the commit touches, commit refuses with E_WC_STALE and asks you to run rdy update first. Commit refuses while any conflict is unresolved. See "Errors and warnings" in the rdy documentation.
After the daemon acknowledges the change, rdy writes every committed file back in canonical form, with new ids filled in. Canonical form normalizes the layout and drops YAML comments, as gofmt does; the store never held comments. Keys are written back only into refs the author typed as keys. A journal makes a lost acknowledgement safe. If the connection drops mid-commit, the next command finds the journal and asks the view whether the change exists. If it does, the command finishes the write-back. If not, the files stay staged.
A figure enters through a file. You write the figure block with a relative path to an image anywhere in the tree. Commit stores the image as a blob, copies it to _blobs/ and rewrites the reference to the hash form. A block keeps its id when you change its type in place.
Briefings on commit
The edit loop is the same on the file path as in the tools. Before you edit, rdy brief <file|dir|block> prints the briefing: what governs the covered blocks, what depends on them, what will go stale, open suspects and work in flight. It records the briefing token in .rdy/wc/briefs.yaml, keyed by the covered ids. After a commit, rdy prints the consequences, exactly as a write tool returns them.
A human never takes an extra step. The CLI fetches the briefing itself, prints it before the commit and commits with its token. A write to stable content must cite a current briefing, and the rule holds on the file path as in the tools.
A commit by an agent session that touches stable content cites a current briefing token, or it is refused with E_BRIEF_REQUIRED or E_BRIEF_STALE.
The refusal prints the fresh briefing and records its token, so a second rdy commit goes through. On a draft no token is needed; a stale recorded token prints W_BRIEF_STALE.
The metadata split
A doc file holds what a reader needs, and the store alone holds what rdy reasons with. The test of the split is this: the site can be built from the folder tree alone.
- Metadata split
- The metadata split is the rule for what a doc file holds and what stays in the store. The file holds content and presentation fields, inline refs, reader links, structure and the folder path. The store alone holds version pins, provenance, landings, approvals, justification links such as
decided_byandimplements, suspects, tensions, reviews and intents. A store-only field in a staged file is refused.
| In the doc file | Store only |
|---|---|
| Content and presentation fields | Version pins |
Inline {{id}} references | Provenance, landings, approvals |
Links a reader follows: describes, see-also, figure and asset refs | Justification links: decided_by, implements, reflects, any link to a decision, question, finding or source |
| Structure: parent, order, folder path | Suspects, tensions, reviews, intents |
rdy checkout and rdy update write only the left column. A store-only field or link kind in a staged file is refused with E_WC_INVALID. The diagnostic names the tool to use instead, such as rdy_write with links. Pack-added fields follow the class of their type, so a decision's fields are store-only too.
Supporting blocks stay out of files
Every block type is a doc asset or a supporting type. Decisions, questions, rationale, reviews, tensions, intents, findings and sources are supporting. They never appear in the working tree. A supporting block whose parent is a doc block stays in the store under that parent; the file does not show it. A decision, a question, a finding or a source may also sit directly in a folder or at the project root. It stays in the store there too, and no file shows it.
A commit never deletes a supporting block; "missing from every file" means a delete only for doc-asset blocks.
A supporting block written into a file is refused with E_WC_INVALID. The fix names rdy_decide for decisions and questions, or rdy_write. For a finding or a source, the fix reads record it with rdy_write or rdy new <type>, then remove the entry from the file, with finding or source as <type>.
Links are never dropped
A link kind missing from a file means "not stated", never "deleted". Commit builds each update per link kind. A reader-owned kind present in the file replaces that kind. A reader-owned kind that is checked out but missing from the file is sent as an empty list, because you removed it. A store-only link kind is never named by a file, so it is always kept, with its version pins.
- Store-only link
- A store-only link is a link kind the working copy never writes, such as
decided_byorimplements. A link kind missing from a file means "not stated", never "deleted", so a commit never drops it.
A commit of a file with every reader link removed keeps the block's decided_by and implements links.
Conflicts
rdy update compares the bound view with the checked-out versions and your files. A block changed only in the store is written into its file. A block changed only by you is kept. A block changed on both sides is a conflict. Your <doc>.yaml stays as it is. The store's version of the whole doc is written beside it as <doc>.theirs.yaml, and rdy status lists the conflict. To resolve it, edit the doc, delete the .theirs.yaml file and stage the doc. The commit then uses the store's current versions as its bases.
- .theirs.yaml
<doc>.theirs.yamlis the store's version of a doc thatrdy updatewrites beside a doc changed on both sides. To resolve it, you edit the doc, delete the.theirs.yamlfile and stage the doc.
A folder renamed differently on both sides keeps your name on disk. The store's name and parent are written to _folder.theirs.yaml inside it, and rdy status shows both names. You rename the directory or leave it, delete the file and stage the directory. The name at commit wins. A doc rename works the same way.
Worktrees
rdy worktree add <dir> <view> creates an extra checkout of the same project, bound to its own view. It holds a .rdy-worktree file that points at the project and keeps its own state under .rdy/worktrees/<name>/. rdy worktree ls lists checkouts, and rdy worktree rm <dir> removes the checkout and never the view. Every worktree is a human checkout. rdy worktree rm refuses a directory that is not a worktree of this project, such as a copy of one, and refuses over uncommitted edits unless --force. A .rdy-worktree file that does not parse is an error; rdy never falls back to the main checkout.
- Worktree
- A worktree is an extra human checkout of the same project, bound to its own view, created with
rdy worktree add.
.rdyignore
.rdyignore at the project root lists files that import and the working copy skip, in gitignore syntax. A matched file is never untracked and never an error. The working copy never treats .rdyignore or .rdy.yaml as docs. Configuration describes the project's other files.
- .rdyignore
.rdyignoreat the project root, in gitignore syntax, lists files that import and the working copy skip.
Editing one block
rdy edit <block> opens one block's YAML in $EDITOR, validates it on save and commits it to the view directly. It fetches the briefing itself and shows it in the editor. A block or conflict that changed while the editor was open refuses the edit, and the edited file is kept. A working copy bound to that view sees the change on its next rdy update. The two paths share the file reader and the engine write, not a staging area.