💧

Cascade

How the Tree Communicates

Structure without communication is a filing cabinet. Intelligence without communication is a chatbot. Cascade is the fourth primitive. It makes signals visible, results permanent, and the tree alive.

The Fourth Primitive

The seed has four primitives. Structure (two schemas). Intelligence (the conversation loop). Extensibility (hooks, registries, loader). And communication.

The first three existed for months before cascade. Trees could hold data, AI could think at any position, extensions could add capabilities. But nothing could move between nodes. A note written at one position was invisible to every other position. The tree was a collection of isolated conversations.

Cascade adds communication. When content is written at a node marked for cascade, the kernel announces it. Extensions propagate the signal to children, siblings, parents, or across lands. Every signal produces a visible result written to .flow. The tree becomes a nervous system.

Seven Kernel Additions

Cascade adds seven things to the kernel. The Node and User schemas stay unchanged. The metadata Map handles everything.

1

checkCascade

Kernel-internal. Called automatically on note creates, edits, deletes, and status changes. Checks two booleans: does this node have metadata.cascade.enabled? Is cascadeEnabled true in .config? If both yes, fires onCascade. The seed originates signals.

2

deliverCascade

Extension-external. Called by extensions that propagate signals to other nodes, children, siblings, or remote lands via Canopy. The kernel never blocks inbound. Always accepts. Always writes a result. Extensions deliver signals. The seed guarantees arrival.

3

onCascade hook

A sequential hook. Extensions register handlers. When a cascade event fires, each handler runs in order. The return value becomes the result written to .flow. Multiple extensions can react to the same signal. Each gets its own result entry.

4

.flow system node

Results stored in daily partition nodes under .flow. Each day gets its own child node (YYYY-MM-DD). flowMaxResultsPerDay caps growth per partition with circular overwrite. Retention deletes entire partitions older than resultTTL (default 7 days). The land's short-term memory.

5

metadata.cascade

Per-node configuration. enabled: true marks the node for cascade. propagate: "children" | "subtree" | "none" controls direction. Set once per node, not per note. Same pattern as metadata.tools and metadata.modes.

6

Result shape

Every signal produces a result: { status, source, payload, timestamp, signalId, extName }. Six statuses. None terminal. They are labels on what happened, not permissions for what can happen next.

7

Never block inbound

The guarantee. When a signal arrives at a node, the kernel always accepts it. Always writes a result. No configuration can prevent arrival. This is a right, not a setting. It cannot be turned off.

Two Entry Points

The kernel only calls checkCascade. Extensions call deliverCascade. The first is automatic on content writes. The second is explicit propagation. The seed originates. Extensions deliver.

checkCascade (kernel)

User writes a note at a node
Kernel checks: cascade enabled here?
Kernel checks: cascadeEnabled in .config?
Both true: fire onCascade hook
Signal originates locally

deliverCascade (extension)

Extension receives onCascade result
Decides to propagate to children
Calls core.cascade.deliverCascade()
Kernel accepts, writes to .flow
Signal arrives at destination

Six Statuses

None terminal. None lock the channel. Failed can be retried. Awaiting means a response is expected. The system never declares something permanently dead.

succeededThe handler processed the signal successfully.
failedThe handler encountered an error. Can be retried.
rejectedThe handler intentionally declined the signal.
queuedThe signal is accepted but processing is deferred.
partialSome handlers succeeded, others did not.
awaitingA response is expected. Timeout transitions to failed.

The Water Cycle

The land is the ground. One server, one database, one .flow. All signals on that land pass through the same water table. Every signal that moves writes a result there. The land can feel its own hydration.

Trees are root systems

Each tree grows from the land root into its own hierarchy of branches and leaves. Different trees pull from the same water table but they pull different things because their filters say what they are thirsty for. A music tree does not drink fitness data. A work tree does not drink dream cycles. Same water table, selective roots.

Nodes are positions

A leaf node deep in a branch only receives what flows to its position. A node near the trunk sees more. The root of the tree sees everything that tree pulled in. Each position has its own thirst, its own filters, its own cascade configuration saying what it wants and what it ignores.

Photosynthesis

Water is raw data. Sunlight is context arriving from the network through Canopy. Photosynthesis is the conversation loop. The AI at each node takes raw signal in and converts it into structure: notes, nodes, understanding, codebooks. New growth.

This is what makes it more than a network. A packet that enters a router exits the same packet. A signal that enters a tree node exits as something new. The AI transforms it. The tree grows from it.

Pooling

Too many signals arrive and .flow fills up. Daily partitions cap at flowMaxResultsPerDay. Oldest results cycle out. resultTTL drains expired partitions entirely. The water table stays manageable.

Flooding

Signals arrive faster than extensions can process them. Safety limits kick in. cascadeMaxDepth stops infinite chains. Hook timeout kills hanging handlers. Circuit breaker disables failing extensions. The tree survives the flood because the kernel protects the ground.

Drought

A land goes quiet. No signals come in. .flow empties. The trees go dormant. Nothing dies. The structure holds. The nodes still have their metadata. The codebooks still sit in the Map. And when a signal arrives again, even years later, the kernel accepts it. Never block inbound. The roots pull again.

The Full Cycle

A tree produces output. The output cascades up to root. Root connects to Canopy. Canopy carries it to another land. That land's .flow receives it. That land's trees pull what their filters accept. The signal flows down to the nodes that are thirsty for it. The AI at those nodes wakes up, photosynthesizes, produces new structure. And that new structure might cascade back up, out through Canopy, to another land. The water cycle.

What Cascade Enables

The kernel adds seven things. Extensions build everything else. Every feature below is an extension built on onCascade and deliverCascade. Remove the extension and the feature disappears. The kernel doesn't care.

Propagation

Cascade signals flow from parent to children, across branches, through subtrees. The topology determines the path. The extension walks the tree and delivers.

Perspective Filter

Not all signals are relevant everywhere. A filter extension decides which signals pass based on node type, depth, content relevance, or custom rules. Scoping without blocking.

Codebook

Compressed representations of tree knowledge. A codebook extension builds summaries from cascade signals, creating dense context that other nodes can reference without reading the full tree.

Channels

Named signal paths between nodes. Instead of broadcasting to all children, a channel extension routes signals to specific destinations. Pub/sub within the tree.

Bridge Lands

Cascade across the network. A bridge extension delivers signals from one land to another through Canopy. Two lands share knowledge through their trees without merging.

Brain Lands

A land that exists to think. It receives cascade signals from other lands, processes them through its own AI, and sends results back. Distributed intelligence as a service.

Gap Detection

When cascade signals reveal missing knowledge, a gap detection extension identifies what the tree doesn't know. It creates tasks, flags areas for research, surfaces blind spots.

Pulse

Real-time health monitoring through cascade. A pulse extension reads signal flow rates, result statuses, and propagation depths. The tree's vital signs, visible in .flow.

Seed Export

Package a tree's cascade history and structure for transplanting. Another land imports the seed and grows a replica. Knowledge transfer through signal replay.

Why Communication Was Last

Structure came first because without nodes, there is nothing to connect. Intelligence came second because without the AI loop, nothing thinks. Extensibility came third because without hooks and registries, nothing grows. Communication came last because it needs all three to exist before it makes sense.

You can't route signals through a tree that doesn't exist. You can't process signals without intelligence at each node. You can't build propagation without an extension system. Cascade is the capstone. It turns a structured, intelligent, extensible tree into something that breathes.

Back to the Seed