Autonomous Architectural Decision Record (ADR) Ledger extension for the Pi coding agent.
docs/adr/
├── .index.json # Lightweight fast index (titles, tags, constraints)
├── 2026-03-30-ADR-001-*.md # 5-line MADR record
└── 2026-03-30-ADR-002-*.md
When you work alone across conflicting technology realms (legacy Lotus Notes 9, strict Rust lifecycles, Android SDK migrations, C FFI bridges), the biggest threat is context switching and forgetting why a critical workaround was chosen 4 months ago.
pi-solo-radar passively monitors coding sessions, generates 5-line MADR drafts upon detecting architectural pivots or legacy workarounds, and automatically injects bounded active constraints into subsequent Pi sessions.
-
Passive Change Detection at
agent_settled:- Detects triggers (
refactor,workaround,pivot,override,fix(legacy),deprecated,breaking change). - Generates a structured 5-line draft with zero disruption.
- Prompts for human confirmation before writing to disk.
- Detects triggers (
-
Minimalist 5-Line MADR Schema:
- Stores standardized records under
docs/adr/(standard MADR / GitHub location). - Concise format: Context, Decision, Consequences.
- Stores standardized records under
-
Bounded Context Injection:
- Injects a compact summary of active architectural constraints into
before_agent_start. - Zero linear prompt bloat: stays under bounded token ceilings while preventing architectural regression.
- Injects a compact summary of active architectural constraints into
-
Atomic Storage & Auto-Healing Index:
- Uses atomic file writes (
.tmp+ rename) to protect against unexpected termination. - Automatically heals or rebuilds
.index.jsonif markdown files are created or modified manually.
- Uses atomic file writes (
All decisions adhere to this format in docs/adr/YYYY-MM-DD-ADR-NNN-<slug>.md:
# ADR-001: Bridge Notes 9 C-API with Node N-API
- **Date:** 2026-03-30 14:22:10
- **Status:** active
- **Context:** Notes 9 C-API binary 32-bit only; modern runner runs 64-bit Node.
- **Decision:** Spawn isolated 32-bit IPC worker subprocess with named pipes.
- **Consequences:** Slight IPC overhead (~2ms); eliminates memory crash risk in main process.| Command | Description |
|---|---|
/adr list |
Interactive TUI directory explorer with live status indicators and selector. |
/adr show <id> [--read|--raw] |
Display decision in clean Reading Mode (syntax stripped) or Syntax Highlighting. |
/adr new <title> |
Interactive wizard to manually draft and record a new ADR. |
/adr search <query> |
Fast keyword search across historical constraints and titles. |
/adr model [name] |
Configure or view the translation model (e.g. openrouter/google/gemini-2.5-flash). |
/adr routing [on|off] |
Toggle auto-routing ADRs to nearest subproject root repository. |
/adr status |
Report radar status, active constraints count, and storage paths. |
/adr help |
Display complete command and MADR schema reference. |
- Clean Reading Mode (Default): Strips raw markdown syntax elements (
#,**,`, bullets) and applies terminal typography (clean section headers, status badges, bullet glyphs). - Syntax Highlighting Mode: Colorizes raw markdown tokens and MADR fields.
- Interactive Toggles:
m(orr): Toggle between Clean Reading Mode and Raw Syntax Highlighting Mode.t(orl): Language translation loop — 1st press translates to Czech ([🇨🇿 Čeština]) via OpenRouter, 2nd press loops back to English original ([🇬🇧 English]). Instant response via memory cache.
record_adr({ title, context, decision, consequences, status })— Allows the agent to autonomously record decisions upon your request.search_adrs({ query })— Allows the agent to query past constraints and historical doctrine.
Place pi-solo-radar inside your project:
git clone <repo> .pi/extensions/pi-solo-radarOr install globally into your user Pi configuration:
cp -r . ~/.pi/agent/extensions/pi-solo-radarnpm install
npm run build
npm test- Zero fluff: Zero external runtime dependencies; uses Node.js standard built-ins (
node:fs/promises,node:path,node:crypto). - Cross-platform: Tested on Windows, Linux, and macOS.