# Node catalog (/docs/graph-node-catalog)



The default agent graph registers nodes through `buildDefaultAgentGraph(config)`. Which nodes wire in for a given compile depends on the executors and hooks the host supplies; the *registry* — every core name the audit script will accept — is fixed at 42 entries spread across the four lattice stages. (Plugin-contributed nodes self-declare their stage through the plugin overlay and are not part of this core registry — see the Plugin path section below.)

This page enumerates that registry. The companion page is [Edge catalog](/docs/graph-edge-catalog). Conceptual framing lives in [Graph](/docs/graph); the node-shape contract lives in [Nodes](/docs/nodes).

**Subpath:** `@pleach/core/graph/topology`

## Reading the table [#reading-the-table]

Each row is a node name the host may register. The columns:

| Column        | Meaning                                                                                                                                                                                             |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`        | The string passed to `graph.addNode("...")`. Stable public identifier — renamed only via a `Changed` changelog row.                                                                                 |
| `acceptsSeam` | The `CallClass` the node consumes — `utility`, `reasoning`, `converse`, or `synthesize` — or `null` for pure state transforms.                                                                      |
| `gated`       | `always` if the node wires unconditionally; `config.<field>` if registration requires the host to supply that executor or hook. An absent executor means an absent node — the graph still compiles. |
| `purpose`     | One-line summary of what the node does.                                                                                                                                                             |

The `gated` column is the load-bearing one. The full registry is the *upper bound*; a real compile under a minimal config registers a much smaller subset. CI asserts the compiled count is byte-identical from change to change *for the same config*, not that every change compiles every registered node.

## Stage 1 — `anchor-plan` [#stage-1--anchor-plan]

Nine registered names. Pre-LLM context shaping: anchor strings, intent classification, plan generation, model routing, skill activation. No tool dispatch and no user-visible content at this stage.

| name                 | acceptsSeam | gated                               | purpose                                                                            |
| -------------------- | ----------- | ----------------------------------- | ---------------------------------------------------------------------------------- |
| `sessionAnchor`      | `reasoning` | always                              | Builds the session-scoped anchor string consumed by synthesis.                     |
| `contextProjection`  | `null`      | always                              | Projects the data channel into the system prompt as a relevance-ranked summary.    |
| `planReconciler`     | `reasoning` | always                              | Reconciles the active plan against completed tools; writes the next planning step. |
| `planGenerator`      | `utility`   | `config.planGenerator`              | Generates a multi-step tool-execution plan.                                        |
| `intentDetector`     | `utility`   | `config.intentDetectorExecutor`     | Classifies the user's intent for the turn.                                         |
| `fileIntentDetector` | `utility`   | `config.fileIntentDetectorExecutor` | Detects file-upload intent and extracts file context.                              |
| `costRouter`         | `utility`   | `config.costRouterExecutor`         | Routes to the cost-optimal model given the classified intent.                      |
| `skillActivation`    | `utility`   | `config.skillActivationExecutor`    | Activates the skill modules relevant to the turn.                                  |
| `depthZeroNudge`     | `utility`   | always                              | Nudges the model when the previous turn produced zero tool calls despite a plan.   |

## Stage 2 — `tool-loop` [#stage-2--tool-loop]

Twenty-three registered names. The iterative decide → dispatch → inspect loop. The *decision* call here is `utility`-class and runs on a separate utility seam — it decides whether to keep looping, never owns the final user-visible synthesis, and can't reach the synthesize seam or its per-turn counter.

| name                         | acceptsSeam | gated                              | purpose                                                                                                                                                                                                                                                   |
| ---------------------------- | ----------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `llm`                        | `converse`  | always                             | The per-turn LLM decision call. Decides whether to dispatch tools or terminate the loop.                                                                                                                                                                  |
| `llmDecision`                | `utility`   | `config.llmDecisionExecutor`       | Streaming variant of the decision call with a `utility` seam threaded through — separate from the synthesize seam, so it can't bump the synthesize counter.                                                                                               |
| `tools`                      | `null`      | always                             | Dispatches pending tool calls in parallel.                                                                                                                                                                                                                |
| `subagent`                   | `null`      | always                             | Delegates to a subagent runtime; routes results back into the parent turn.                                                                                                                                                                                |
| `guard`                      | `null`      | always                             | Guards against invalid tool execution chains.                                                                                                                                                                                                             |
| `hallucination`              | `null`      | always                             | Detects hallucinated tool calls — zero-tool loops, narration-as-execution.                                                                                                                                                                                |
| `dataSilo`                   | `null`      | always                             | Silos large tool results into the data channel and replaces them with refs.                                                                                                                                                                               |
| `skillRearm`                 | `null`      | `config.skillActivationExecutor`   | Mid-loop skill re-arm — same node closure as `skillActivation`, registered in `tool-loop` so its `completedTools` subscription stays on the lattice; re-matches skills when loop progress changes what the turn needs (hard per-turn activation ceiling). |
| `enrichment`                 | `utility`   | `config.enrichmentExecutor`        | Enriches tool results with host-supplied context.                                                                                                                                                                                                         |
| `safetyReview`               | `utility`   | `config.safetyReviewExecutor`      | Pre-synthesis safety review of accumulated tool results.                                                                                                                                                                                                  |
| `quality`                    | `utility`   | `config.qualityEvaluator`          | Scores tool result quality.                                                                                                                                                                                                                               |
| `continuation`               | `converse`  | `config.continuationResolver`      | Decides whether to continue looping or escalate to synthesis.                                                                                                                                                                                             |
| `coupling`                   | `utility`   | `config.couplingResolver`          | Suggests coupled tool invocations the host can pre-bundle.                                                                                                                                                                                                |
| `fabrication`                | `null`      | `config.fabricationChecker`        | Detects and remediates fabricated tool outputs.                                                                                                                                                                                                           |
| `diagnostics`                | `utility`   | `config.diagnosticsAnalyzer`       | Logs per-turn diagnostic info.                                                                                                                                                                                                                            |
| `asyncTaskDispatch`          | `utility`   | `config.asyncTaskDispatchExecutor` | Dispatches long-running tasks for out-of-band execution.                                                                                                                                                                                                  |
| `creditBudget`               | `null`      | `config.creditBudgetExecutor`      | Enforces a per-turn credit or cost budget.                                                                                                                                                                                                                |
| `eventLogger`                | `null`      | `config.eventLogger`               | Logs completed tool execution events.                                                                                                                                                                                                                     |
| `syntheticExpansionDetector` | `null`      | always                             | Post-stream: catches the synthetic "loading additional tools" literal and sets `reResolveTools` so the runtime re-resolves tools instead of treating it as a leak.                                                                                        |
| `forceSynthesizer`           | `null`      | always                             | Routes a forced synthesis request — the `tool-loop → synthesize` transition.                                                                                                                                                                              |
| `dsmlDetector`               | `null`      | always                             | Detects and redacts domain-specific markup artifacts.                                                                                                                                                                                                     |
| `multiInvocationTracker`     | `null`      | always                             | Tracks repeated synthesis invocations per message.                                                                                                                                                                                                        |
| `loopTerminatedAnnotator`    | `null`      | always                             | Annotates the channel state when the tool loop terminates.                                                                                                                                                                                                |

## Stage 3 — `synthesize` [#stage-3--synthesize]

One registered name. The synthesis stage is a true singleton: `synthesizer` is the only node the lattice admits here, enforced by the lattice's singleton list.

| name          | acceptsSeam  | gated                | purpose                                                                   |
| ------------- | ------------ | -------------------- | ------------------------------------------------------------------------- |
| `synthesizer` | `synthesize` | `config.synthesizer` | The singleton synthesizer seam call. Owns the final user-visible content. |

<Callout title="Recovery shaping moved out of synthesize">
  Earlier revisions registered four recovery siblings in this stage —
  `recovery`, `refusalHint`, `retryNarration`, `garbleRecovery`.
  An earlier revision reclassified recovery shaping as *post-turn*
  work, not final-content synthesis, and retired all four graph
  nodes. Recovery dispatch is now a collection of post-stage
  **stream filters** — `refusalHintFilter` (priority 100),
  `retryNarrationFilter` (200), `garbleRecoveryFilter` (300), and
  `standardRecoveryFilter` (400) — that fire at stage completion via
  the `StreamObserverRegistry` rather than as nodes on the lattice.
  CI checks that recovery keeps that single dispatch surface.
  See [Stream observers](/docs/plugins/stream-observers) for the
  filter substrate they now run on.
</Callout>

## Stage 4 — `post-turn` [#stage-4--post-turn]

Nine registered names. Read-only side effects and answer inspection after the LLM decided the turn outcome: memory writes, cost rollups, citation finalization, context summary, the post-synthesis answer-sufficiency judge, plus the two content-safety guards that inspect the composed answer.

| name                  | acceptsSeam | gated                             | purpose                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| --------------------- | ----------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `citation`            | `null`      | `config.citationExtractor`        | Extracts citations from the final content back to source data.                                                                                                                                                                                                                                                                                                                                                                           |
| `garbledContentGuard` | `null`      | always                            | Detects coherence failures in the composed answer; writes its verdict channel only.                                                                                                                                                                                                                                                                                                                                                      |
| `repetitionGuard`     | `null`      | always                            | Detects phrase-repetition loops in the composed answer; writes its verdict channels only.                                                                                                                                                                                                                                                                                                                                                |
| `contextSummarizer`   | `null`      | `config.contextSummarizer`        | Summarizes the turn for next-turn insertion.                                                                                                                                                                                                                                                                                                                                                                                             |
| `memoryExtraction`    | `utility`   | `config.memoryExtractionExecutor` | Extracts facts for long-term memory storage.                                                                                                                                                                                                                                                                                                                                                                                             |
| `consolidation`       | `null`      | `config.consolidationExecutor`    | Consolidates extracted facts before the memory write.                                                                                                                                                                                                                                                                                                                                                                                    |
| `sessionMemoryWrite`  | `null`      | always                            | Async write of the turn record to session memory.                                                                                                                                                                                                                                                                                                                                                                                        |
| `costRollup`          | `null`      | always                            | Summarizes per-turn token and cost totals.                                                                                                                                                                                                                                                                                                                                                                                               |
| `answerSufficiency`   | `utility`   | always                            | Judges whether the answer covers the turn's pending steps, on a `utility` seam. The model judge is opt-in (`answerSufficiencyJudge: true`); by default the node still runs but builds no utility seam and makes no model call, applying only the deterministic backstop. Reads the synthesized `finalContent` when it exists and the provisional `draftContent` otherwise, so the verdict lands while the tool loop can still act on it. |

## The singleton invariant [#the-singleton-invariant]

`synthesizer` is the only entry in the singleton list, and — since the recovery siblings relocated to post-turn stream filters — the only node the lattice admits in the `synthesize` stage at all. CI refuses a compile that registers it more than once, and asserts the synthesizer observes the singleton `ProviderSeam<"synthesize">` reference at runtime while the `llmDecision` node observes a *separate* `ProviderSeam<"utility">` — the singleton is per call class, so the decision node can't reach the synthesize seam. The stage is exactly-one by two independent locks: membership in the singleton list and the now-empty rest of the stage.

See [Graph § singleton synthesize seam](/docs/graph#singleton-synthesize-seam) for the seam contract.

## Adding or removing nodes — three paths [#adding-or-removing-nodes--three-paths]

A developer extending the graph picks the path that matches what they own. The three paths from least to most invasive:

| Path                | What you own                                           | What you can do                                     | Edge wiring                                          |
| ------------------- | ------------------------------------------------------ | --------------------------------------------------- | ---------------------------------------------------- |
| **Config omission** | The `config` object passed to `buildDefaultAgentGraph` | Remove any gated node by not supplying its executor | Auto — chains `.filter(hasNode)`                     |
| **Plugin path**     | A `HarnessPlugin` with `extraGraphNodes()`             | Add new nodes alongside the canonical set           | Auto for chain-relative wiring; manual for new edges |
| **Custom builder**  | A raw `StateGraph` you compose from scratch            | Anything within the lattice — add, remove, rewire   | Manual everywhere                                    |

### Config omission — remove a gated node [#config-omission--remove-a-gated-node]

The `gated` column in the stage tables above tells you which nodes you can remove without forking. Any row whose `gated` cell reads `config.<field>` is opt-in — leave the field unset and the builder skips the `addNode(...)` call. The chain literals (`preLlmChain`, `postToolChain`, `terminalChain`) all run through `.filter(hasNode)`, so the skip is silent.

```typescript
const graph = buildDefaultAgentGraph({
  llmExecutor,
  toolExecutor,
  // intentDetector omitted — the anchor-plan chain
  // collapses START → costRouter → skillActivation → llm
  // safetyReview omitted — the post-tool chain skips it
})
```

A row whose `gated` cell reads `always` is structural — removing it requires the custom-builder path. The builder hardcodes the `addNode(...)` call for those nodes; there is no config field to suppress.

### Plugin path — add a node alongside the canonical set [#plugin-path--add-a-node-alongside-the-canonical-set]

`HarnessPlugin.extraGraphNodes()` returns `PluginGraphNodeRegistration[]`. The builder calls each registration's `factory(ctx)` once at compile time and registers the returned node under the plugin's namespace. This is the path for domain-specific nodes that shouldn't live in the substrate's generic builder — a retrieval node bound to a particular vector store, a tenant-specific safety pass, a post-turn writer that targets a specific event-log destination.

```typescript
import type { HarnessPlugin } from "@pleach/core"
import type {
  PluginGraphNodeRegistration,
  PluginGraphNodeContext,
} from "@pleach/core/plugins"

const myCustomNodeMetadata = {
  stageId: "post-turn",
  acceptsSeam: null,
  subscribes: ["messages", "completedTools"],
  writes: ["customSideTable"],
}

export const myPlugin: HarnessPlugin = {
  name: "my-custom-writer",
  version: "0.1.0",
  extraGraphNodes(): PluginGraphNodeRegistration[] {
    return [
      {
        name: "customSideTableWriter",
        factory: (ctx: PluginGraphNodeContext) =>
          async (state) => {
            await writeSideTable(state.completedTools, ctx.dataChannel)
            return { customSideTable: { written: true } }
          },
        metadata: myCustomNodeMetadata,
      },
    ]
  },
}
```

Three constraints hold for every plugin-registered node:

* **`stageId` must be one of the four lattice stages.** `StageId` is the closed set.
* **`name` must be unique** across all registrations — including the canonical 42-name registry. A collision throws at compile time.
* **`acceptsSeam` is either `null` or one of `utility` / `reasoning` / `converse` / `synthesize`.** When non-null, the seam binding routes through the existing holder + cap machinery — no plugin-level seam construction.

The plugin cannot bypass the singleton synthesize seam, add an out-of-lattice edge, or replace a registered node — the registration is additive. See [Plugin contract](/docs/plugin-contract) for the full `HarnessPlugin` surface and the `contributePostToolTier` slot specifically for post-tool enrichment nodes.

### Custom builder — full control [#custom-builder--full-control]

When the canonical builder's shape doesn't fit — a fundamentally different lattice traversal, a topology that registers neither `llm` nor `llmDecision`, an agent that needs to skip the tool loop entirely — compose a `StateGraph` directly. The lattice gate still applies (every node's `stageId` must be one of the four, every edge must match a row in the allowed-edge table), but you own every `addNode` and `addEdge` call.

```typescript
import { StateGraph, AnnotationRoot, Annotation } from "@pleach/core"

// `START` / `END` have no published import path yet — they alias the
// string literals below. See Graph § the seven unpublished symbols.
const START = "__start__"
const END = "__end__"

const StateSchema = AnnotationRoot({
  messages: Annotation<Message[]>({ reducer: messagesReducer, default: () => [] }),
})

// Author each node's metadata as a standalone const — the same shape the
// `*_NODE_METADATA` exports in @pleach/core's graph nodes use.
const sessionAnchorMeta = {
  stageId: "anchor-plan",
  acceptsSeam: "reasoning",
  subscribes: ["messages"],
  writes: ["messages"],
}
const llmMeta = {
  stageId: "tool-loop",
  acceptsSeam: "converse",
  subscribes: ["messages"],
  writes: ["messages"],
}

const graph = new StateGraph(StateSchema)
  .addNode("sessionAnchor", sessionAnchorFn, sessionAnchorMeta)
  .addNode("llm", llmFn, llmMeta)
  .addEdge(START, "sessionAnchor")
  .addEdge("sessionAnchor", "llm")
  .addEdge("llm", END)
  .compile()
```

The custom path is the only one that lets you *remove* a non-gated node from the canonical set. The trade-off is that you give up the canonical builder's chain-relative wiring, the post-tool-tier enrichment slots, and every gated node — the four-stage lattice is the only thing you inherit.

## Where the pieces are exported [#where-the-pieces-are-exported]

`buildDefaultAgentGraph` is a thin orchestrator over per-node factories and per-stage wiring. The lattice layer is readable on its own: `NODE_STAGE_MAP` and the allowed/forbidden edge tables come from `@pleach/core/graph/topology`. Seam holders come from `@pleach/core/graph/seams`, and the nine [contribution namespaces](/docs/plugins/namespaces) are documented on their own page.

## Adding a node to the default graph [#adding-a-node-to-the-default-graph]

A node that belongs in the default graph, rather than in a plugin, is
a change to `@pleach/core` itself. See [Contributing](/docs/contributing).
For your own nodes, follow the
[new-node checklist](/docs/nodes#new-node-checklist).

## Where to go next [#where-to-go-next]

<Cards>
  <Card title="Edge catalog" href="/docs/graph-edge-catalog" description="The nine allowed and seven forbidden cross-stage edge patterns, plus the chain skeleton and the three conditional routers that wire the registered nodes together." />

  <Card title="Graph" href="/docs/graph" description="How the registered nodes compose into a StateGraph — the lattice as a whole." />

  <Card title="Nodes" href="/docs/nodes" description="The node-shape contract — metadata, seam consumption, determinism rule." />

  <Card title="Release checks" href="/docs/audit-gates" description="What Pleach's CI checks on the default graph and the rest of the packages." />
</Cards>
