# Node ledger

The node ledger lists what the platform did to the nodes of your
organization's clusters, when and why. One action of the platform is
one entry. An entry carries a kind, a cause code and a state for an
agent. Its `text` tells a person what the platform did and why.
Version 1 lists three kinds of action. Two are actions that the
platform started by itself: node restarts and node replacements. The
third is a Kubernetes upgrade that finished.

Where the node ledger is not available to your organization,
`tools/list` leaves `node_ledger_read` out and `tools/call` answers as
for an unknown tool.

## Reading the ledger

The MCP tool `node_ledger_read` answers the entries of your
organization's clusters, newest first. It is read only and it is on the
[MCP server](https://docs.nationalcompute.com/api/mcp.md). No REST route and no console page carry the
ledger. Every credential the MCP server accepts reads the whole
organization's ledger. An org API token cannot read the ledger: the MCP
server accepts none. The arguments are all optional. A `null` argument
reads as left out.

| Argument | Values | Effect |
|---|---|---|
| `cluster` | the id or the name of one of your organization's clusters | answers the entries of that cluster; a name matches every cluster of yours that carried it, a deleted one included |
| `node` | a node's name in its cluster | answers the entries under that node name; the answer then holds no `upgraded` entry |
| `limit` | 1 to 100, default 50 | the most entries answered |
| `before` | the `next_before` of the last answer | answers the entries older than that one |

The answer is `{"entries": [...], "coverage": "...", "next_before": ...}`:

```json
{
  "entries": [
    {"id": "e-1042", "at": "2026-11-18T19:05:00Z",
     "cluster": {"id": "5d2e…", "name": "aurora-prod"},
     "node": "aurora-prod-n2", "kind": "rebooted",
     "cause": "health_check_failed", "state": "done",
     "finished_at": "2026-11-18T19:12:00Z",
     "release": null, "cve": null,
     "text": "We restarted this node. An automatic health check on the node failed. Any workload on the node was stopped."},
    {"id": "u-8c41…", "at": "2026-11-12T08:40:00Z",
     "cluster": {"id": "5d2e…", "name": "aurora-prod"},
     "node": null, "kind": "upgraded",
     "cause": "planned_upgrade", "state": "done",
     "finished_at": "2026-11-12T08:40:00Z",
     "release": "v1.36.2+rke2r1", "cve": null,
     "text": "We upgraded Kubernetes on this cluster to v1.36.2+rke2r1. A newer Kubernetes release was due for this cluster."}
  ],
  "coverage": "This list holds two kinds of action that the platform started by itself: node restarts and node replacements. It also holds Kubernetes upgrades. Actions by our staff and moves by the market are not listed yet.",
  "next_before": null
}
```

| Key | Type | Meaning |
|---|---|---|
| `entries` | array | the entries, newest `at` first, each with the fields below |
| `coverage` | string | a short statement of what the list holds, as text for a person; the same text on every answer; [what version 1 leaves out](#what-version-1-leaves-out) holds the full list of what is missing |
| `next_before` | string or `null` | the `id` of the last entry when older entries exist; `null` on the last page |

Each entry:

| Field | Type | Meaning |
|---|---|---|
| `id` | string | the entry's id |
| `at` | string | when the platform started the action, ISO 8601 UTC; on an `upgraded` entry, when the platform recorded the upgrade as done |
| `cluster` | object | `{id, name}`: the cluster that held the node when the action started; on an `upgraded` entry, the cluster the upgrade ran on |
| `node` | string or `null` | the node's name in that cluster, as `kubectl get nodes` or `sinfo` shows it; `null` on an `upgraded` entry |
| `kind` | string | one of the three [kinds](#kinds) |
| `cause` | string | one [cause](#causes) code; every entry carries one |
| `state` | string | one of the four [states](#states) |
| `finished_at` | string or `null` | when the action finished or failed, ISO 8601 UTC; `null` on a `running` or an `unknown` entry and where the platform holds no finish time |
| `release` | string or `null` | on an `upgraded` entry, the Kubernetes release the cluster moved to; `null` on every other |
| `cve` | string or `null` | on an `upgraded` entry with the cause `security_fix`, the id of the security issue; `null` on every other |
| `text` | string | what the platform did, why and how the action stands, as sentences for a person ([the text of an entry](#the-text-of-an-entry)); it names no node, no cluster and no time |

Pass an answer's `next_before` as `before` to read the next page. The
read has no time bound: the pages reach back to the oldest entry.

An unknown `cluster`, `node` or `before` answers an empty list. A
cluster, a node or an entry of another organization reads as unknown.
The ledger covers a node only while one of your clusters holds it. An
action on a node before it joined your cluster is not in your ledger.
The ledger keeps its entries by node name. A name can pass to another
machine: a node leaves your cluster and a later node takes its name.
The ledger holds no entry for that change.

A call refuses `422 bad-request` with `field` naming the problem:

| `field` | Cause |
|---|---|
| `cluster`, `node` | not a string, or an empty one |
| `limit` | not an integer from 1 to 100 |
| `before` | not in the form of a `next_before` |
| an argument's name | an argument the tool does not take |

A call refuses `503 station-unavailable` when the platform cannot read
the ledger. It never answers an empty list in that case. A tool result
is clipped at 40,000 characters
([result size](https://docs.nationalcompute.com/api/mcp.md#the-wire)). A page of the default 50 entries
fits. A page of 100 entries can pass the clip. A clipped answer is cut
JSON and does not parse: pass a smaller `limit`.

## Kinds

| `kind` | What the platform did |
|---|---|
| `rebooted` | it restarted the node |
| `replaced` | it put another machine behind the node; the node keeps its name in your cluster |
| `upgraded` | it moved the cluster to a newer Kubernetes release ([upgrades](https://docs.nationalcompute.com/kubernetes-versions-and-maintenance.md#upgrades)) |

Data on the local disks of a replaced machine does not carry over to
the new machine: treat data on a node's local disks as ephemeral and
keep durable state off the node
([Trust Center](https://docs.nationalcompute.com/trust.md#node-sanitization)).

The entry of a restart or a replacement appears when the platform
starts the action. The entry of an upgrade appears once the upgrade is
done, whoever ran it: a member of your organization or the platform.
The ledger does not list an upgrade that is still running or paused.

## Causes

`cause` says why the platform acted. Every entry carries a cause. The
ledger lists no action whose cause the platform cannot state with
confidence.

| `cause` | `kind` | What a person reads |
|---|---|---|
| `health_check_failed` | `rebooted` | An automatic health check on the node failed. |
| `gpus_not_allocatable` | `rebooted` | The node's GPUs were not available to workloads. |
| `fault_persisted` | `replaced` | A fault on the node remained after a restart. |
| `planned_upgrade` | `upgraded` | A newer Kubernetes release was due for this cluster. |
| `security_fix` | `upgraded` | The release fixes a security issue ({cve}). |

`{cve}` prints the entry's `cve`. A code never changes its meaning. A
later version can add kinds and codes. An agent that meets a `kind` or
a `cause` it does not know shows `text` to a person.

## States

`state` says whether the action finished.

| `state` | Meaning |
|---|---|
| `running` | the action started and has not ended; an action on hold reads `running` too |
| `done` | the action finished |
| `failed` | the action did not complete |
| `unknown` | the platform holds no record that it can match to the action |

A new entry can read `unknown` for a short time. An older entry can
stay `unknown`. An `upgraded` entry always reads `done`.

## The text of an entry

`text` joins up to four parts in a fixed order: what the platform did,
why, the effect on workloads and the state. It leaves out a part that
has nothing to say.

The first part follows the state. A `done` entry opens in the past
tense. An entry in any other state never claims that the action
finished:

| `state` | `rebooted` | `replaced` |
|---|---|---|
| `done` | We restarted this node. | We replaced the machine behind this node. The node kept its name. |
| `running` | We are restarting this node. | We are replacing the machine behind this node. The node keeps its name. |
| `failed` | We tried to restart this node. | We tried to replace the machine behind this node. |
| `unknown` | We started a restart of this node. | We started to replace the machine behind this node. |

An `upgraded` entry opens "We upgraded Kubernetes on this cluster to
{release}." `{release}` prints the entry's `release`.

The [cause](#causes) sentence follows. A `done` restart or replacement
then states its effect: "Any workload on the node was stopped." No
other entry states an effect. The record of an action that is not done
does not prove what the action did to your workloads. A `running` entry
ends "This action is in progress." A `failed` entry ends "This action
did not complete."

Three entries as a person reads them:

```text
We restarted this node. An automatic health check on the node failed. Any workload on the node was stopped.
We are replacing the machine behind this node. The node keeps its name. A fault on the node remained after a restart. This action is in progress.
We upgraded Kubernetes on this cluster to v1.36.2+rke2r1. The release fixes a security issue (CVE-2026-12345).
```

## What version 1 leaves out

Every answer carries `coverage`, the ledger's own short statement of
what it holds:

```text
This list holds two kinds of action that the platform started by itself: node restarts and node replacements. It also holds Kubernetes upgrades. Actions by our staff and moves by the market are not listed yet.
```

An empty list is no proof that nothing happened to a node. `coverage`
names two things the list leaves out. Version 1 leaves out all of
these:

- A restart, a replacement or a move of a node that our staff started.
  An upgrade is the exception: the ledger lists a finished upgrade
  whoever ran it.
- An action whose cause the platform cannot state with confidence.
- A node that the market moved into or out of your cluster.
- A node that our health checks took out of service, its return to
  service and the node the market grants in its place
  ([when we take a node out of service](https://docs.nationalcompute.com/kubernetes.md#when-we-take-a-node-out-of-service)).
- A fault that a restart cannot clear. Such a fault triggers no
  automatic restart and no automatic replacement. A person takes over.
  The ledger holds no entry for the repair that follows.
- A restart or a replacement from before the ledger began to record
  them. Recording began during 17 November 2026 (UTC). Upgrades reach
  further back.
- A finished upgrade whose release name or security issue id fails the
  ledger's format check. The id must be one CVE id.
- Any node of a VM cluster.
- The pods an action stopped and the time a cluster ran short of a
  node.

Two reads sit beside the ledger. [`metrics_read`](https://docs.nationalcompute.com/api/metrics.md)
answers what the platform's monitoring saw on a node. The
[node verdicts](https://docs.nationalcompute.com/api/k8s-cluster-pages.md#node-verdicts) answer how a
node of a Kubernetes cluster stands now.
