Skip to content
Chapter 8

The brain sees the others

March 19, 2026

Chapter 8 — The brain sees the others

Verified sources: git log 2026-03-19 (28 commits) Key commits: 20618e9 (100 claims migrated) · dbdffb8 (ADR-036 BSI out of git) · a190732 (remove claims/) · dcc8a14 (ADR-041 brain-pair) · 6ffad58 (scope overlap detection) · 115642b (passive awareness)


Day 8 is calmer. 28 commits instead of 130. But each one carries weight.


The great migration

The night begins with housekeeping — hardcoded paths, PATHS.md placeholders. Then at 02:37, the real work opens.

6193cf3 — feat(bsi-db): endpoints BSI dans server.py — claims CRUD + locks acquire/release + schema v3 (“feat(bsi-db): BSI endpoints in server.py — claims CRUD + locks acquire/release + schema v3”)

brain-engine gets a complete API for the BSI. No more reading YAML files — claims, locks, everything goes through endpoints. Create a claim, close it, acquire a lock, release it. The API.

At 02:44, three scripts are migrated to brain.db. At 02:48:

20618e9 — feat(bsi-db): script migration one-shot claims/*.yml → brain.db — 100 claims migrés (“feat(bsi-db): one-shot migration script claims/.yml → brain.db — 100 claims migrated”)*

100 claims. Every session trace since day 3 — every opening, every closing, every signal — migrated from YAML files to SQLite in a single script run. Not a migration plan. A migration. Done.

At 03:02, cross-machine discovery: /bsi/network and /bsi/claims?include_peers=true. The brain can now query the claims of another instance.

At 03:42:

dbdffb8 — feat(ADR-036): BSI hors git — claims/locks → brain.db + peer discovery multi-machine (“feat(ADR-036): BSI out of git — claims/locks → brain.db + multi-machine peer discovery”)

ADR-036 settles it: git is for code and knowledge. Session state goes into SQLite. Separation of concerns. Claims no longer pollute the git log. The git log becomes readable again — only code, only decisions.


Multi-machine

The brain runs on the desktop. Now there is a second one — the laptop. How do two brains see each other?

At 04:06:

5705579 — feat(ADR-037-v1): tracking hit_count + last_queried_at + shadow indexing + permanent flag

Embedding curation. Not all of the brain’s content has the same value. Some files are queried constantly — agents, kernel docs. Others are never touched after creation. Tracking begins. The brain learns which parts of itself matter.

At 04:12:

e96fd20 — feat: brain-sync-replica.sh — réplication master→replica embeddings (Option B) (“feat: brain-sync-replica.sh — master→replica embeddings replication (Option B)”)

The desktop computes, the laptop receives. Master/replica, not bidirectional. A conscious choice. The desktop has the GPU cycles. The laptop has portability. Different roles, same brain.

At 04:21:

e0ec14d — feat: brain-start-laptop.sh — startup complet après reboot (ollama + engine + peer check + sync status) (“feat: brain-start-laptop.sh — full startup after reboot (ollama + engine + peer check + sync status)”)

One script. One boot. The laptop becomes a first-class citizen.

At 04:29, the fix that reveals a real coordination bug:

b4599f2 — fix(bsi): lock acquire vérifie les peers AVANT le lock local (“fix(bsi): lock acquire checks the peers BEFORE the local lock”)

The locking system checked local locks first, then the peers. If two machines grabbed the same file at the same time — both succeeded locally before discovering the remote conflict. Reversed: check the peers first, then local. Distributed systems 101, learned by building.

The session closes at 06:03 with a commit that sums it all up: session-close: marathon BSI-db + 6 ADRs + multi-machine + story.tetardtek.com. The origin story gets its first deployment. The brain is no longer content to exist. It tells its own story.


The afternoon — the cleanup that changes everything

Ten hours of silence. The brain sleeps. At 18:17, it wakes up.

At 18:54, the most destructive commit of the day — and the most liberating:

a190732 — kernel: remove claims/ — source unique brain.db (ADR-042) (“kernel: remove claims/ — single source brain.db (ADR-042)”)

The claims/ directory. The one that had held every session trace for four and a half days. 102 YAML files. Deleted. brain.db is now the single source of truth. Claims, locks, signals, sessions — all queryable, all in one place.

ADR-042 is written right after: the single source is brain.db. Not git. Not BRAIN-INDEX.md. The database.

At 19:08, ADR-040: brain-secrets-sync.sh — a secrets registry with status, audit, sync, diff. The brain knows which secrets exist, which are missing, and how to sync them between machines.


Passive awareness

At 19:34:

25355de — feat: bsi-query.sh peers — découverte claims inter-instances via SSH (“feat: bsi-query.sh peers — cross-instance claims discovery via SSH”)

Manual discovery — query the other machine, read its database, report what is open. Simple. Brutal. Effective.

Then at 19:41:

115642b — feat: bsi-peer-poll.sh — conscience passive inter-instances (cron 5min → live-states.md) (“feat: bsi-peer-poll.sh — cross-instance passive awareness (cron 5min → live-states.md)”)

Passive awareness. A cron job, every five minutes, that queries the other machine and writes the results into live-states.md. The brain does not need to be told that another instance exists — it checks. Automatically.


brain-pair

At 19:50, the ambitious one:

dcc8a14 — feat: ADR-041 brain-pair — pairing multi-machine type Bluetooth (code 6 chiffres + LAN broadcast) (“feat: ADR-041 brain-pair — Bluetooth-style multi-machine pairing (6-digit code + LAN broadcast)”)

brain-pair. A pairing protocol inspired by Bluetooth — six-digit code, LAN broadcast, mutual authentication. Not just seeing the other brain. Recognizing it. Establishing trust. Knowing that the instance on the other side is legitimate.


Self-defense

The day ends at 20:09 with the last piece:

6ffad58 — feat: bsi-claim.sh scope overlap detection — soft warning project, hard block kernel

Scope overlap detection. bsi-claim.sh now checks whether another session, on any machine, claims the same scope. Soft warning for projects — you can continue, but you are warned. Hard block for the kernel — two brains cannot modify the kernel at the same time.

“soft warning project, hard block kernel”

The brain has learned to protect itself from itself.


28 commits. A calm day. But between morning and evening, the brain migrated 100 claims, deleted an entire directory, established a single source of truth, learned to sync its embeddings between machines, to detect its peers on the network, to recognize them through a pairing protocol, and to refuse scope conflicts.

Day 8 is calmer. But every commit carries weight.


What was built

  • BSI-db endpoints — claims CRUD + locks in server.py (6193cf3, 02:37)
  • 100 claims migrated — one-shot YAML → brain.db (20618e9, 02:48)
  • ADR-036 — BSI out of git, claims/locks in brain.db (dbdffb8, 03:42)
  • ADR-037 — embedding curation, hit_count, shadow indexing (5705579, 04:06)
  • brain-sync-replica.sh — master/replica embeddings desktop→laptop (e96fd20, 04:12)
  • brain-start-laptop.sh — full one-command boot (e0ec14d, 04:21)
  • Peer-first locking — check the remote ones before the local ones (b4599f2, 04:29)
  • ADR-042 — remove claims/, single source brain.db (a190732, 18:54)
  • ADR-040 — brain-secrets-sync, secrets registry (0390015, 19:08)
  • bsi-query.sh peers — cross-instance SSH discovery (25355de, 19:34)
  • bsi-peer-poll.sh — passive awareness cron 5min (115642b, 19:41)
  • ADR-041 — brain-pair, Bluetooth-style pairing (dcc8a14, 19:50)
  • Scope overlap detection — soft warning project, hard block kernel (6ffad58, 20:09)
  • Origin story deployed — story.tetardtek.com first deploy

Key decisions

  • ADR-036: git ≠ session state. Git is for code. SQLite is for state. The separation makes the git log readable and the claims queryable.
  • ADR-042: single source. brain.db is the truth. Not git. Not BRAIN-INDEX.md. One source, not two.
  • Master/replica sync. The desktop computes, the laptop receives. Not bidirectional — by design. Clear roles.
  • Peer-first locking. Distributed systems 101: check the remote ones first. Learned by building, not by reading.
  • ADR-041: explicit trust. brain-pair does not trust by default. Six-digit code. LAN broadcast. Mutual recognition. Trust is earned.
  • Soft warning / hard block. Projects can coexist. The kernel cannot. The protection level follows criticality.