kanthord overview

Read this page first. It says what kanthord is, names the six concepts every other page builds on, and maps the rest of the documentation.

Purpose of this page: orient you before the details. After reading it, you know what the daemon does, which words matter, and where to go next.

What kanthord is

kanthord is one long-running daemon on Node.js 24+. It stores a plan as a graph of tasks, hands those tasks to external coding-agent workers over HTTP, and records every state change in one SQLite file. An operator drives it with the kanthord CLI; workers drive it through the same HTTP API.

The daemon owns state, never execution. A worker claims a task inside a fenced lease, runs its agent loop in a git clone outside the daemon process, and reports back. The daemon serializes conflicting work, accounts attempts, and keeps an append-only event log.

Six concepts that carry everything

Plan graph

An imported document becomes nodes in three kinds — initiative, objective, task — connected by dependency edges. Waived edges are skipped.

Node lifecycle

pending → ready → running → done | partial | blocked. Only legal transitions exist, and each one appends an event.

Lease and fence

A time-limited claim on a node. The fence counter never resets, so a stale holder cannot write after a takeover.

Run and attempt

An objective run schedules task runs; a try is one attempt with a pinned model registration. The attempt limit blocks a failing task.

Workspace clone

One git clone per objective, shared by its tasks. Profile and conventions freeze at clone time.

Home

The directory holding everything that outlives the process: kanthord.db, worktrees, journal, keys.

The layered shape

Ten layers, one dependency direction: every arrow points down. Click any layer or component to open its detail page.

runtime call, top layer uses the layer below implemented by / invoked through interface declared, implementation is not-implemented persisted resource
Layer 0 Actors humans and machines outside the daemon
runs kanthord … · claims, heartbeats, reports over HTTP
buildProgram · constructs and injects every implementation
renders requests from the transport contract
route match · parse · authorize
dispatch, exactly one command or one query
validates against the domain · persists through interfaces
declared here, implemented elsewhere
implemented by, named only in main.ts
reads and writes real resources

How to read these pages

If you want to know…Read
how the layers relate and what constrains themeach layer page under Architecture, top to bottom
how a piece cooperates at runtimeFollow a request — one claim traced end to end
how tasks are selected and run in parallelScheduling & execution
what a word meansGlossary
where a rule comes fromthe source diagram and the proposal documents in the engine submodule

Invariants worth memorizing

  1. One transaction per write command: a state transition and its event append never sit in two transactions.
  2. Determinism: same input, same output, same order, same bytes. Ties break by ULID, compared bytewise.
  3. The CLI speaks HTTP only. It imports no command and no query.
  4. Startup order: load config → acquire home lock → probe git tools → open and migrate SQLite → bootstrap actor → construct services → recover home → bind handlers → listen.