Documents and drives
You already know that Powerhouse stores operations, not snapshots. Now let's look at what those operations live inside — and why the container for your files is just as much a document as the files themselves.
A document is one typed thing
Every piece of content in Powerhouse is a document: an instance of a that carries both its current state and the append-only operation log that produced it.
Think of a Notion page. It has a type (the template), a body (the state), and an edit history. In Powerhouse, that last part is the canonical source — state is derived by replaying the log, not stored directly.
A to-do list, a budget ledger, an invoice — each is its own document with its own ID, its own history, and its own model type that constrains which actions are valid.
A drive is a document too
Here's the twist. A drive is a folder of documents — and it is itself a document.
Compare it to your filesystem: a folder contains files, but the folder is also an entry in the parent directory. In Powerhouse, that analogy goes one level deeper: the folder has its own full operation log. When you add a file, rename a folder, move something, or remove it, that change is an operation on the drive document — not on the file inside it.
This matters when you're reasoning about sync. Two collaborators can both add files to the same drive while offline. When they reconnect, Powerhouse merges their drive operation logs exactly as it would merge edits to any other document: no overwrites, no conflicts, just two interlaced sequences of operations.
The drive's model type is powerhouse/document-drive and its actions are structural: ADD_FILE, ADD_FOLDER, MOVE_NODE, DELETE_NODE. Every one of them is an operation appended to the drive's log.
Files live on drives
When you create a document, it gets added to a drive via an ADD_FILE action — dispatched against the drive, not conjured from thin air:
// This action is dispatched on the drive, not on the new document
addActions({
documentId: "<drive-id>",
actions: [
{
type: "ADD_FILE",
input: {
documentType: "my-org/todo-list",
name: "Shopping list",
parentFolder: null,
},
},
],
});
The new document comes into existence because the drive's reducer processed that action and appended the operation. The document's own log starts empty.