<!-- page:3113 -->
# A tree, not a folder

<!-- block:37127 -->
## The unit is a node

A wiki here is not a set of [markdown](page:4402) documents in a folder. It is one tree of nodes, each holding a title and a body, and a page is simply the node its children hang from. Two surfaces project that tree: a browser for humans, an [MCP](page:4409) API for agents.

The difference shows the moment you work on it. In a folder, the unit is the file: you open it whole, edit it whole, and the structure inside it is punctuation. Here the unit is the node, and the structure is the tree itself.

<!-- block:39329 -->
### A heading is a node's place, not a line in the body

What a heading level means here is depth: an h2 is a child of the page, an h3 a child of that block. Nothing in a body decides it, and the renderer works the level out from where the node sits.

Typing `##` into a body is not the shortcut it looks like, and the tools refuse it outright, along with the run of bold paragraphs an agent reaches for next. The refusal is cheap where the alternative is not: a heading written in prose would be invisible to `get_outline`, unreachable by any link, movable only by editing text, and every change under it would land in one undivided diff.

<!-- block:39330 -->
## What the tree buys

A node has an id, a parent and a history of its own. Everything a tree buys over a folder falls out of those three.

<!-- block:39331 -->
### An address that survives a rename

Every node has an id, and `block:N` points at the node rather than at the words in its heading. Retitle it, rewrite it, move it under another parent, and the link still lands. A `#some-heading` anchor in a file dies the day someone improves the heading, which is why link rot is normal there and absent here.

<!-- block:39332 -->
### Backlinks nobody maintains

Because a link names a node, the engine knows which nodes name any given one. The list of pages that lead here is read out of that, on the page and in the stitched document, and it is right by construction. In a folder the same list is a grep somebody has to remember to re-run.

<!-- block:39333 -->
### Moving is an operation, not a rewrite

`move_node` changes a node's parent and the whole subtree comes with it, heading levels recomputed from the new depth. `migrate` carries a subtree into another wiki and repoints the links that led into it. Order among siblings is a `sort_key`, so putting a block between two others touches neither of them.

The folder equivalents are a file move, a find-and-replace over every document that linked to it, and a manual renumbering of headings.

<!-- block:39334 -->
### History per node, not per document

Each node carries its own versions and its own `updated_at`, so a change to one paragraph is a change to one node. Edit a `.md` file and the diff is the document; the log tells you the page moved, not which claim did.

<!-- block:39335 -->
### Read the outline, then the blocks you need

`get_outline` returns titles, ids and token counts without bodies, which is a map of a wiki for a fraction of its text. From there a reader takes the blocks the task needs. A folder offers no such view: the cheapest way to learn what a file holds is to read it.

<!-- block:39326 -->
### A tree that behaves like a graph

Parentage is one relation; a link is another. Cross-links between blocks (`page:N`, `block:N`) and the back-references they generate turn the tree into a graph wherever the subject deserves one, without giving up the single place each node lives in.

<!-- block:39336 -->
## Still one document

None of this takes the document away. A page is stitched back into one markdown text on demand, so the tree is how it is written and edited, not a form the reader is made to work in.

<!-- block:39337 -->
### The same page, read as markdown

A browser renders the page as one document with its headings in place. An agent asks [`get_page_markdown`](block:27066) and gets the same text, each node preceded by a comment carrying its id, so a passage read in the document is edited back at the node it came from. A public wiki serves that text at its [`.md` address](block:27066) as well.

So reading loses nothing to the structure, and writing gains an address for every part of what was read.

<!-- block:39338 -->
### Nothing to escape from

Bodies are markdown and the tools are MCP, both public formats. A wiki reads out as plain documents whenever you want it elsewhere, which is what keeps the tree a way of working rather than a place content is held.

---

## Links here

- [Wikilayer authoring guide](/smee-again/wikilayer-howto)
- [Markdown support](page:4402)
- [Rules](page:39339)
