← Blog

· Hive AI

Knolo KIP-0006: A Durable Store That Never Edits an Image in Place

Knolo KIP-0006 defines the durable V5 store: an exclusive lock, verify before open, and atomic fsync-and-rename commits that never edit an image in place.

Knolo is the open-source, local-first Knowledge Image runtime and format (Apache-2.0, Knolo core on npm as @knolo/core). Knolo's V5 behaviour is written down as Knolo Improvement Proposals, or KIPs, so any implementation can be checked against the same text. KIP-0006, the durable V5 store, is marked as a foundation implementation. It answers a narrow question: how does a Knolo Knowledge Image get written to disk without ever leaving a half-written image behind?

What Knolo KIP-0006 specifies

KIP-0006 defines the Node adapter for the portable single-writer store from KIP-0005. It does not change the V5 image bytes, the transaction roots, or the browser and React Native APIs. It only says how one process owns a file and persists commits to it.

How Knolo owns an image file

DurableKnowledgeImageStoreV5.open(path, initial?) creates an exclusive path.lock file before reading or creating the image. The lock holds the writer's process id for diagnostics. A second open fails closed while the lock exists, and close() releases it.

An existing file is mounted and fully verified before open() returns. A missing file requires an initial image, which is verified by the normal V5 mount path before its first durable write. A Knolo store never starts from bytes it has not checked.

How Knolo persists a commit

For each committed transaction, the adapter:

  1. serializes the next immutable Knowledge Image to a sibling temporary file;
  2. flushes it with fsync;
  3. atomically replaces the target with rename;
  4. flushes the containing directory where supported;
  5. swaps the in-memory snapshot only after persistence succeeds.

If serialization or replacement fails, the previous committed image stays the in-memory state and the temporary file is removed. The adapter never edits an image in place; the V5 A/B superblocks remain the image-level torn-write recovery contract.

What Knolo KIP-0006 leaves out

The KIP is explicit about its limits. Stale-lock recovery and lease expiry are outside this release. So are durable multi-process coordination, sync, transactions spanning multiple files, and crash fault-injection tooling, all listed as subsequent work.

The portability line is also deliberate. The adapter is exported only from @knolo/core/node; the portable entry point has no Node filesystem imports, and browser or React Native callers bring their own persistence layer. Keeping the disk contract separate from the format is what lets other Knolo runtimes implement the same bytes without inheriting Node's file APIs.

Read the Knolo specifications

knolo · kip-0006 · specification · open-technology · open-source