mdr-kernel macrodata refinement / kernel

[ MDR / SHARED MEMORY KERNEL ] v2.0.0

The repo is the memory.

You arrive with no memory of prior shifts. Every AI agent does. They forget what was decided, trust stale chat memory, trample each other's files, and repeat the same mistake because the evidence fell out of context. mdr-kernel severs the agent from its untrustworthy private context and hands it something better: the record.

The work is the data. The data is the work.

[ MANIFEST ] What it is

A portable pattern for running multiple AI workers against one shared engineering memory.

mdr is Macrodata Refinement — in the source metaphor, the department whose workers refine data they are severed from, without the full context of what it means. kernel is the small, load-bearing core the whole system runs on. That is the pun and the thesis in one: an agent refines the work in front of it, severed from prior context, trusting the record over its own memory. The show supplied the metaphor's name only — the refinement here is engineering, not homage.

Shared record

One git-backed source of truth every model reads first and writes back to. No trusting fuzzy private memory.

Enforced coordination

A heartbeat lock and pre-commit gates make uncoordinated work difficult to commit. Single-writer on the files that matter.

Executable recall

A recall gate surfaces the trap you keep repeating before you act — memory that runs, not memory that decorates.

[ VERSION ] 2.0.0 — released 2026-11-24

The PowerShell scripts are gone. One Rust binary runs the floor.

The loop is the same: start from STATE, face the recall gate, hold the lock, close with a handoff. 2.0 moves every step into a single compiled binary for Windows and Linux and adds the commands below.

One binary

A single compiled Rust binary replaces the PowerShell script suite on Windows and Linux. It runs every lifecycle command and all four Git hooks. PowerShell 7 is no longer required.

Checksummed releases

Tagged releases ship mdr-kernel-windows-x86_64.exe and mdr-kernel-linux-x86_64 with SHA256SUMS.txt. The binary embeds a fingerprint of its own source and refuses to run against changed native/ sources until rebuilt.

A shorter contract

The generated contract block in every model's front door drops from 10.3 KB to about 3.3 KB.

Commit-ladder trailers

The commit-msg hook asks for a Least-code: trailer on new bin/ files or more than 60 added code lines, and a Least-file: trailer on new files or folders.

Quieter recall

hook-recall keeps per-session receipts, so an unchanged trap is shown once per session and re-armed when it changes.

History search

mdr-kernel find returns file and line references from STATE, decision logs, and handoffs, from a local cache outside the repo.

Retiring old files

find-stale lists ingested, superseded, and rejected documents and uncited records older than 30 days; archive-adopted moves approved ones into archive/ under the lock and redirects the index.

Read-only MCP server

mdr-kernel mcp serves recall gates, gate traps, and history search over stdio, with no Node or Bun runtime.

Full notes: release v2.0.0. Already running 0.2? Apply it with the upgrade guide; it keeps your STATE, decisions, handoffs, and gates. The write-up: Where I left off.

[ ORIENTATION ] The severed floor

Every themed name maps to a real mechanism. Toggle the view; nothing is renamed underneath.

Select a station for its dossier.

The metaphor annotates the machine. It does not rename it. Real filenames, commands, statuses, and data structures stay plain — the full mapping ships in the repo as FLOOR-GUIDE.md.

[ INTAKE ] Run the floor

A new worker arrives with no context. Run the sequence — in order.

Simulated console. The command output follows a real mdr-kernel 2.0 run, trimmed for length; the sample records are illustrative. Set up your own private repo and the sequence runs for real. Steps taken out of order are refused, as the hooks refuse them.

refiner-01 @ the severed floor
mdr-kernel simulated console. You are refiner-01. You remember nothing. That is by design.
Select a step below to run it.

[ MACRODATA ] The Loop

The refinement cycle. Each step is logged; none is skippable.

STATE.md
The live truth. If anything disagrees with it, STATE wins and the stale source gets fixed.
protocol/CONTRACT.md
The one doctrine every model receives. Claude, Codex, Gemini, local models, or any other CLI agent all start from the same rules.
mdr-kernel start-session
The only startup path. Runs the doctor, refuses unsafe pulls from a dirty tree, prints the full current STATE.
reference/INDEX.md
With STATE.md, chooses the smallest relevant file set before broad search. Generated node maps check link integrity.
mdr-kernel hook-recall
Runs before assigned work, or prepare-work as the portable fallback. On a known trap, the agent must read the evidence first.
STATE.lock
Protects coordination files. The pre-commit hook blocks protected edits unless the session holds the lock.
handoffs/ + DECISIONS.md
Handoffs record the work. Decisions separate proposals from quoted operator rulings; compiled rulings reach the next matching recall gate.

[ INTAKE ] Quick Start — the real thing

Template, private clone, binary, setup, one startup.

  1. On GitHub, choose Use this template → Create a new repository and set it to Private. Do not fork; forks of a public repository are public. No GitHub at all? Add -LocalOnly to setup and the memory stays on your machine.
  2. Clone your new private repository.
  3. Download the binary for your platform and SHA256SUMS.txt from the latest release, verify the checksum, and place it at bin/mdr-kernel (bin/mdr-kernel.exe on Windows). The README has the verify-and-install commands for both platforms.
  4. Run setup once in the clone, then the one startup:
# Linux
./bin/mdr-kernel setup-private -Model '<your model id>'
./bin/mdr-kernel start-session -Model '<your model id>'

# Windows
.\bin\mdr-kernel.exe setup-private -Model '<your model id>'
.\bin\mdr-kernel.exe start-session -Model '<your model id>'

Expected result:

STARTUP_STATUS=READY

Requires Git. The prebuilt binaries run without PowerShell or Rust; building from source needs a Rust toolchain and a C compiler. Setup refuses the public template, public repos, and forks, so your memory never grows in public.

[ EVIDENCE ] See it run

The launch video. Clone it cold, run the scripts, watch the gates fire.

Recorded at launch, on the original PowerShell scripts. 2.0 runs the same sequence through the binary. Nothing loads from YouTube until you press play. Watch there instead: youtu.be/dSPUDWEydDg

[ RATIONALE ] Why not a vector database?

Because the hard problem here is not retrieval. It is authority.

A vector store can find related notes. It does not decide which note wins, stop two agents from editing the same live state, force a model to read the trap it keeps repeating, or prove which model made a commit. Git already gives us history, diff, authorship, branches, hooks, and a shared artifact every tool can read. mdr-kernel uses git as the coordination substrate and keeps the rules small enough that a model can actually obey them.

Where an index helps, it stays subordinate to git. The node map is a generated JSON index over explicit Markdown envelopes, committed with the repo and regenerable. The find cache lives outside the repo and rebuilds itself from the source files.

[ COMPLIANCE ] Known limits

Honest edges, disclosed for the record.

A refinement floor that hides its limits is not one you should trust.

Cooperative, machine-local lock

A heartbeat file, not a distributed lease. STATE.lock is git-ignored, so two clones coordinate only through git push and pull. It is not a defense against a malicious actor.

Hooks are clone-local

A fresh clone has no hooksPath and no approved-destination pin until setup runs in it, and Git lets an operator bypass hooks. Setup, doctor, close-session, and sync-private check privacy on their own for that reason.

No auto-upgrade

Setup never overwrites an initialized memory. A new release reaches your private repo only when you apply it with the upgrade guide.

A pattern, not a product

No daemon, no service, no telemetry — one binary, git, and a contract. You adapt it to your stack rather than installing it.

[ DISSEMINATION ]

MIT licensed. Issues and adaptations welcome.

View on GitHub