9. Brain-level config & feature flags (incl. optional auto-ADR)¶
- Status: Accepted
- Date: 2026-07-01
- Deciders: kristof (owner), Claude (orchestrator)
- Relates: ADR-0008, data-model, issues #32, #33
Context¶
Some settings belong to the whole team and should travel with the brain (feature toggles,
name, remotes) — as opposed to the per-user, per-machine scope config (~/.commonwealth/…,
ADR-0008) which must stay local. The brain already has a .commonwealth/config.json stub; it
should become the typed home for shared/global settings. First requested feature: an
optional auto-ADR — when a decision is made in a project, record it as an ADR that
lives in the brain.
Decision¶
- Two config layers, kept distinct (documented in the README):
- Per-user, local, unsynced —
~/.commonwealth/config.json: scope allow/deny (ADR-0008). - Brain-level, shared, synced —
<brain>/.commonwealth/config.json:name,remotes,curation, and a typedfeatures: Record<string, boolean>map. Because it's in the repo, feature settings apply to the whole team. @cmnwlth/coreowns brain config:loadBrainConfig(never throws; fills defaults),saveBrainConfig,setFeature,isFeatureEnabled(unknown/unset ⇒false), and aFEATURE_FLAGSregistry (name + description + default). Scaffold writes thefeaturesblock with all flags defaulted off.- auto-ADR maps onto the existing
decisionnote kind (ADR-style, indecisions/), so ADRs live in the brain by construction — no new kind. The flag isautoAdr, default off. - Enforcement is in curation:
curate()dropsdecision-kind candidates with reason"auto-adr-disabled"unlessisFeatureEnabled(brain, "autoAdr"). So even if a capture agent proposes a decision, it is only staged when the team has opted in. Decisions still pass through the staging review queue (ADR-0007) before becoming canon, and respect the per-user scope filter (ADR-0008). - Extraction (turning a session into decision candidates) is the M4b SessionEnd
capture agent's job; when
autoAdris on it is prompted to extract decisions (context / choice / rejected options / consequences).
Consequences¶
- One clear, synced place for team-wide toggles; trivial to add future flags.
- auto-ADR reuses existing machinery (decision kind + review queue + scope) — small, testable surface now; the agentic extraction lands with the M4b hook.
- Two files named
config.jsonin different roots (~/.commonwealthvs<brain>/.commonwealth); the README's Configuration section disambiguates them.
Alternatives considered¶
- A dedicated
adr/folder / new note kind — rejected; thedecisionkind already is an ADR and lives in the brain. - Auto-ADR always on — rejected; noisy and opinionated. Opt-in per team via the flag.