v0.3.8 — Budget Safety & Engine Discovery
What's in this release
Budget Circuit Breaker (Critical Fix)
The streaming usage inspector previously only matched type=assistant events from Claude's stream-json output. When the event shape didn't match, the inspector silently did nothing — the subprocess ran to completion with no mid-stream budget check. In production, this caused a $28 spend on a $1.50 budget.
Now fixed:
- Matches usage fields on any event type, not just
assistant - Checks
total_cost_usdon every event for authoritative mid-stream cost - Triggers at 80% of cap to bound single-turn overshoot
- Falls back to a byte-ceiling kill switch when no usage events arrive
Shell Operators in Verify Commands
bun run lint && bun run test was tokenized literally — the && was passed as an argument. Commands with shell operators (&&, ||, ;, |) now route through the platform shell automatically.
Engine Auto-Discovery
If claude, codex, or gemini isn't on PATH, the CLI now searches common install directories (npm global, homebrew, .local/bin, nvm, scoop) before reporting unavailable. When truly missing, prints a copy-pasteable install command.
Verification Diagnostic Hints
Failed attempts now carry specific context into the next attempt's prompt: which tool is missing, which module failed to resolve, how many assertions broke. Replaces the previous generic "Verification did not pass" message.
Other Improvements
- Git operations retry once after 500ms for lock-file contention
git restorefalls back togit checkouton failure- Invalid
--profilewarns and defaults tominimalinstead of crashing - Default verifier timeout increased to 120s (from 60s)
Install
npm install -g martin-loop@0.3.8