filedocs/ADR-0001-openclaw-brain-repo.md
# ADR-0001: OpenClaw brain repositories

Date: 2026-05-04  
Status: Accepted

## Context

Kompis needs durable backup repositories for workspace memory, identity, docs, and recovery material. These repositories must stay separate from application code so the assistant can be recovered cleanly if a host is lost or rebuilt.

The current brain repos are:

- `openclaw-kompis-brain` for Kompis / Be Viable AB context
- `openclaw-helmanagement-brain` for HEL Management AB context

## Decision

### 1. Brain repos contain only brain material

Brain repos may contain:

- AGENTS / SOUL / IDENTITY / USER / TOOLS files
- MEMORY and episodic memory
- policy docs and recovery docs
- safe configuration snapshots
- backup / restore helpers

Brain repos must not contain application code.

### 2. Brain repos are separate from app repos

Application projects live in their own repositories and local checkouts.

The brain repos are not source-of-truth locations for apps.

### 3. Ignore volatile local state

Generated runtime state, local checkouts, temporary exports, and cache material should be ignored rather than tracked.

Examples:

- `.openclaw/`
- `WORKSPACE.md`
- `WORKSPACE_versions/`
- `memory/.dreams/`
- local project checkouts under the brain workspace

### 4. Keep backups recoverable

Any automation used for brain backup must preserve recoverability and avoid storing secrets.

## Consequences

### Positive

- Clean recovery path
- Clear separation between cognition and product code
- Lower risk of accidental secret leakage
- Easier backup and restore

### Tradeoffs

- Extra repos to maintain
- More discipline around what belongs in the brain

## Notes

This ADR is the source of truth for brain-repo scope.

See also:

- `docs/ADR-0002-app-projects-environments-and-repos.md`
- `docs/APP-DEVELOPMENT-POLICY.md`
- `docs/PROJECT-POLICY.md`