Architecture
mra is a pure bash CLI with zero runtime dependencies beyond jq, git, docker, and gh.
Components
mra CLI (bin/mra.sh)
|
+-- Workspace Manager
| Repo sync, dependency scan, database setup
|
+-- Project Knowledge Base (PKB)
| L0-L3 memory stack, auto-classification tags,
| tunnel linking, mtime-based incremental updates
|
+-- Code Review Engine
| Auto-strategy selection, mailbox voting debate,
| persona-based review, write-protected agents,
| model tiering, eval framework
|
+-- Claude Orchestrator
| Multi-repo context, PM/sub/reviewer dispatch,
| Docker test execution, API change detection
|
+-- Integrations
MCP server (9 tools), GitHub Actions, Federation, Slack/DiscordData flow — mra review --pr 123
- Resolve PR base ref via
gh pr view - Collect diff + changed files
- Load PKB context for the project (if generated)
- Detect API change via
lib/change-detector.sh - Select strategy based on diff size + API change
- Dispatch agent(s) in parallel with
claude -p - Synthesiser produces JSON — status, summary, inline comments
- Post to GitHub PR via
gh api - Fire
_review_pkb_auto_updatein background to refresh PKB
Safety primitives
- All review agents run with
--disallowedTools "Write,Edit,NotebookEdit" - Heredoc injection blocked via
<<'TEMPLATE'+ parameter substitution - Stderr retained on worker failure for operator inspection
- Arg validation runs before workspace resolution — usage prints outside workspaces
- Snapshots before destructive operations;
mra rollbackto restore