Skip to content

The reconcile cycle

Five phases, in order, once per cycle. Each takes the previous phase's output as its input, so the order is a contract rather than a convention.

The five phases

flowchart TB
  P["Preparation"]
  H["Heartbeat"]
  I["Intake"]
  W["Assignment reconciliation"]
  C["Completion"]
  P --> H --> I --> W --> C
  C -.->|"next cycle"| P
Phase Produces
Preparation Registration state, the process's reconciled lease state, available capacity, observability state
Heartbeat The node's projected state, reported
Intake Assignments admitted into the bounded local queue
Assignment reconciliation Processed and failed counts for build, deployment, model, secret, observability and operator assignments
Completion Flushed channels, drain progress, and the cycle summary

What each phase touches on the node

flowchart LR
  subgraph PH["PHASES"]
    direction TB
    P["Preparation"]
    H["Heartbeat"]
    I["Intake"]
    W["Assignment reconciliation"]
    C["Completion"]
  end
  subgraph DUR["NODE STATE"]
    direction TB
    ID[("Registration<br/>and identity")]
    LS[("Lease state")]
    Q[("Local queue")]
    OB[("Outbox")]
  end
  P -.->|"reads"| ID
  P -->|"reconciles once<br/>per process"| LS
  I -->|"admits into"| Q
  W -->|"takes from"| Q
  W -->|"writes"| OB
  C -->|"flushes"| OB

The phases share state rather than calling one another. Intake fills the queue that the worker phase drains, and the worker phase fills the outbox that completion drains, which is why each phase's output is the next one's input.

Why the order is a contract

Preparation resolves what the later phases depend on: whether the node is registered, what it already holds, and how much capacity it has. Assignment reconciliation reads the capacity and governor limits preparation computed.

The consequence is that a node degrades from the front. A cycle that cannot prepare does not heartbeat, and one that cannot heartbeat does not take in new work, so a node with a stale view of itself stops accepting rather than acting on it.

Every phase is bounded

Each phase does a bounded amount of work, so a cycle has a bounded cost whatever the backlog. Intake admits into a queue with a limit; assignment reconciliation runs within a computed budget; completion flushes within a budget.

A backlog therefore drains over cycles rather than making one cycle unbounded. See Cycle orchestration.

The cycle reports what it did

A cycle returns a summary rather than only succeeding or failing. That summary is how a loop that is running but achieving nothing is distinguished from one that is not running, which is usually the first question about a quiet node.

What a stall in each phase means

Stalled in Means
Preparation No valid registration, or identity cannot be re-established
Heartbeat The control-plane endpoint is unreachable, or the runtime identity is stale
Intake Nothing is scheduled to this node, or its queue is already full
Assignment reconciliation Slots are occupied by long-running build or deployment work
Completion The outbox is backed up against the bucket or the ingest endpoint

For the loop that drives these phases and what it does when a cycle fails, see The run loop.