Skip to content

v0.3.11 — Auto-Governance: MartinLoop Becomes Proactive

Choose a tag to compare

@Keesan12 Keesan12 released this 24 Jun 17:11

The Shift

MartinLoop was passive — agents only used it when explicitly told. Now it's proactive. Agents know when they're ungoverned, see cost estimates before work starts, and get host-native governance rules installed alongside the MCP server.

What's New

martin estimate — Know the Cost Before You Spend

Estimate cost, route, and Pre Work Burn for any objective without spending a cent:

martin estimate "Fix the auth bug" --engine claude --budget-usd 3

Returns: selected route (direct/manager/consensus), expected cost, expected pre-work burn, confidence score, and recommended budget. Available via CLI and MCP (martin_estimate tool).

martin://agent/governance-status — Proactive Awareness

New MCP resource that tells agents whether the current session is governed. Returns workflow receipt state (doctor/plan/preflight), budget remaining, unreceipted runs, and the recommended next action. Agents read this before starting work to know if they're operating blind.

Governance Hooks for Every Host

martin mcp install now outputs governance configuration alongside the MCP server config:

Host What gets installed
Claude Code PreToolUse + Stop hooks in ~/.claude/settings.json
Codex AGENTS.md governance instructions
Gemini CLI GEMINI.md governance rules
Cursor .cursor/rules/martin-governance.mdc rules file
GitHub Copilot .github/copilot-instructions.md
Continue.dev .continue/rules/martin-governance.md

What's Fixed

MCP Server Conflict in Governed Claude Runs

Spawned Claude subprocesses now pass --strict-mcp-config to prevent the child process from loading the parent's MCP servers. Previously, a MartinLoop MCP server in the user's config would get spawned inside the governed subprocess, causing "MCP server being overwritten" errors and blocking demos.

Budget Cap Enforcement Hardened

The streaming usage inspector now terminates subprocesses that receive data for 30+ seconds without emitting usage events. Previously, if Claude's stream-json event format changed, the inspector went blind and the subprocess ran unmetered past the budget cap. Byte-ceiling fallback retained as a second defense layer.

Test Coverage

68 new audit-ready tests covering auto-governance, estimate, hooks for all hosts, route classification, cost-per-outcome, prework burn policy, adapter configuration, and budget enforcement. All tests exercise real code paths — no mocks, stubs, or placeholders.

Total: 205+ CLI tests, 14 MCP tests, 40+ core tests — all passing.

Install

npm install -g martin-loop@0.3.11