Khipu

Khipu is a highly performant, local-first version control system that decouples your codebase from the social network. It acts as a mathematically transparent, content-addressable storage engine on your local disk, while utilizing a "bring-your-own-protocol" webhook system to broadcast updates to federated networks like Bluesky, Mastodon, or any custom API.

Description

Khipu: A Transparent, Protocol-Agnostic Version Control Engine

The Problem

Modern version control is heavily centralized and structurally opaque. While standard Git is mathematically sound, its legacy plumbing is hidden behind complex, confusing commands. Furthermore, the social layer of code collaboration (issues, pull requests, identities) has been entirely captured by centralized platforms like GitHub. Newer alternatives attempt to fix this by hard-linking to specific decentralized networks (like the AT Protocol), but this merely swaps one locked-in network for another.

The Solution

Axiom is a bare-metal, local-first version control system built from scratch. It mathematically decouples cryptographic file storage from social code collaboration. It acts as a highly optimized, transparent tracker on your local disk, while utilizing a "dumb pipe" webhook architecture to broadcast repository updates to any network—be it Bluesky, Mastodon, or a local Discord server.

Core Architecture

1. The Storage Engine (Disk-as-a-Heap)

Khipu bypasses complex delta-compression algorithms in favor of pure content-addressable storage. You can think of it as a custom memory allocator, but instead of managing RAM, it manages disk space.

  • Files are treated strictly as raw byte arrays.

  • Passing a byte array through a SHA-256 function generates a cryptographic hash. This hash acts as the immutable "pointer" to that data.

  • The system writes the raw bytes to a hidden .khipu/objects store, using the hash as the filename. Identical files naturally deduplicate because their hashes will always collide and map to the same physical file block.

2. State Tracking via Merkle Trees

To capture the state of an entire project without duplicating folders, Khipu constructs a Merkle tree of your working directory.

  • It hashes individual files at the bottom layer.

  • It groups those file hashes into a formatted list representing a directory, and then hashes that list itself.

  • This recurses upward until a single "Root Hash" is generated. This root hash represents a mathematically verifiable, exact snapshot of your entire project at a specific microsecond. A "Commit" is simply a text file pointing to this Root Hash, linked to the previous commit to form a Directed Acyclic Graph (DAG).

3. The 'Glass Box' Interface

Khipu is built for developers who want to understand the theory of their tools. It features an inspection layer that explicitly exposes the underlying math. Instead of abstracting errors, Khipu allows users to query the exact tree structure, print the byte-sizes of specific blobs, and trace the cryptographic proofs of any commit hash directly in the terminal.

4. Protocol-Agnostic Webhooks (The Social Layer)

Khipu does not care where you talk about your code. When a state change (a new commit) occurs, the engine generates a lightweight, standardized JSON payload containing the timestamp, the commit message, the root hash, and the developer's local node URL.

  • This payload is pushed out via a standard HTTP webhook.

  • Users can pipe this webhook into custom scripts to announce their code updates on the AT Protocol, ActivityPub, or internal company chat tools.

5. Pure P2P Fetching

Khipu eliminates the need for dedicated middleman servers (like Git hosting platforms or Tangled Knots). Because the data is cryptographically secure by default, Axiom utilizes direct socket-to-socket transfers. A developer can temporarily expose their local .axiom store over a port, and a peer can use the Axiom CLI to recursively fetch the exact missing hash blocks directly from machine to machine.


Issues & PRs Board
No issues or pull requests added.