Knotrel Docs

ADR 0018: additive core API in 1.x

Status: Accepted on 2026-11-30 (knotrel/knotrel#239). Maintainer decision of 2026-11-30: new, non-breaking knotrel-core APIs may be added; changes to existing APIs require 2.0.0. Supersedes the “no public item” clause of ADR 0015 decision 2. Issues: #157 (snapshots), #234 (first use).

Related: ADR 0016 (snapshots), compatibility policy.

Context

ADR 0015 kept knotrel-core free of new dependencies and public items in v1.3.0, so that the runtime refactor could not change the core’s contract. A snapshot (ADR 0016) has to copy every node and edge of a graph, but today the ett, hdt and cluster-forest engines cannot list their edges through the public API. Without a core addition, snapshots would work only on compact-bfs and the lifecycle graph.

Decision

  1. In 1.x the core may gain new public items when they are purely additive under section 3 of the compatibility policy: new inherent methods, new types, new variants of #[non_exhaustive] enums or fields of #[non_exhaustive] structs, new optional configuration. They start as Experimental and are classified in stability and the public API snapshot, like any other addition.
  2. Changing an existing public item requires 2.0.0. This covers removals, renames, narrowed signatures, added trait bounds, new required trait methods, and changes to documented behavior or error contracts.
  3. The rest of ADR 0015 decision 2 stands: the core gains no new dependency, stays synchronous and keeps no knowledge of the runtime or server.

Alternatives considered

Consequences