Guardrails for AI-built softwarev0.5.0

Make greenmean something.

mido is the verification ladder between a change and shipping. Six gates over your whole workspace. One verdict bound to the revision it measured.

  • Rust
  • TypeScript
  • JavaScript
MIT licensed · Speaks MCP
mido~/acme-apilocal
targetworkspace (./)revision4f2a9c1emeasured42 files (42 rust)
[1/6]syntaxclean
[2/6]sizewithin bounds
[3/6]analysismaintainability 71
[4/6]tests214 passed
[5/6]coverage91.3%
[6/6]mutation46/49 killed · 93.8%
verdictSHIP-READY
revision stamp: 4f2a9c1e | 9c31b7d4
Illustrative run — real output is plain text and stays honest when piped.

Why mido

Code is cheap now. Proof is not.

An agent can produce a thousand lines before lunch. A green test run says one command exited zero; it does not say the change is small, covered, or actually asserted.

mido enforces the floor in cost order: the checks that are cheap to run come first, the ones that are expensive to fake come last. Nothing is measured because it changed. Everything is measured because it ships.

See what the ladder enforces
gates, one fixed order
6
languages, one contract
3
verdict bound to the revision
1
silent passes
0

The ladder

Six gates. In the only order that makes sense.

Cheap checks first, expensive proof last. Every gate has to answer. A missing tool is INCOMPLETE, never a pass.

cheap to run → expensive to fakewhole target, every time
  1. 01

    syntax

    Is it clean?

    Formatter, linter and type checker over the measured target. Any diagnostic fails the gate.

    zero diagnosticscargo fmt · clippy · cargo check / prettier · eslint · tsc
  2. 02

    size

    Can a human hold it?

    File lines, function lines, cyclomatic complexity and nesting depth across the whole target — not just the diff.

    file 300/500 · fn 40/60 · cc 10/15 · nest 3/4tokei · rust-code-analysis / eslint
  3. 03

    analysis

    Will it age well?

    Cognitive complexity and a maintainability index where the stack measures one. No invented score where it does not.

    MI ≥ 20 · cognitive ≤ 15rust-code-analysis / eslint + sonarjs
  4. 04

    tests

    Does it behave?

    The project's own suite, every command it declares. Never skip, ignore or loosen an assertion to go green.

    the suite passescargo test / <package manager> test
  5. 05

    coverage

    Do the tests reach it?

    Total line coverage against a floor, plus the drop against a baseline. An empty report is INCOMPLETE, not 100%.

    ≥ 80% · drop ≤ 0cargo-llvm-cov / vitest · jest · c8
  6. 06

    mutation

    Do the tests actually assert?

    Surviving mutants in the change. A survivor needs a real assertion or a written equivalence argument.

    ≥ 70% killedcargo-mutants / stryker

One contract, three ecosystems

It meets your stack where it is.

mido infers the language module from the repo, or takes --lang. The module owns the commands, the parsers, the measurement and the baseline.

Rust

Cargo.toml

tokei · rust-code-analysis · cargo-llvm-cov · cargo-mutants

TypeScript

tsconfig.json

prettier · eslint · tsc · vitest/jest/c8 · stryker

JavaScript

package.json

prettier · eslint · vitest/jest/c8 · stryker

A repo no module recognizes exits 2 and says why. There is no silent fallback.

Verdicts

Green needs a definition.

mido does not grade on a curve. The ladder ends in an honest answer, and a waiver is never hidden.

SHIP-READYexit 0

Every gate that ran passed.

If the config waived a gate, the verdict names it. Green for the ladder you configured, never a claim about the gate you left out.

BLOCKEDexit 1 / 2

A gate failed, or could not answer.

FAIL means the code broke the contract. INCOMPLETE means the gate never reached a verdict — missing tool, unreadable file, timeout. Neither is a pass.

SKIPPEDnamed

A waiver, in writing.

enabled = false runs nothing and reports SKIPPED. The verdict says waived: mutation — enabled = false in .mido.toml. No silent omissions.

A skipped gate is not a passed gate.

For agents

Written by one agent. Read by the next.

mido assumes an LLM wrote the change and an LLM will pick up the result. Non-interactive by contract, evidence-first by design.

  1. 01

    Exit codes, not vibes

    0 is ship-ready. 1 is a failed gate. 2 is incomplete or a setup error. --json gives the caller structure when it needs more than the code.

  2. 02

    The report is the prompt

    A failure names the gate, the contract, the evidence and the fix. It is written for the next attempt, not for a log viewer.

  3. 03

    Bound to the revision

    HEAD plus a dirty-state hash. A green run from before the last edit cannot be replayed on it.

  4. 04

    MCP-native

    mido mcp serves list_targets and run_ladder over stdio. Silent by default; the markdown report is the artifact.

The handoff artifactFAIL

BLOCKED — size=FAIL

targetworkspace (./)

[2/6] ✗ size — FAIL

summary
worst function 74 sloc / cc 1 (oversized_demo)
contract
.mido.toml [size] function_loc.fail=60, complexity.fail=15
evidence
src/size_demo.rs: oversized_demo has function_loc 74 (fail >= 60)
fix

split along a real seam — moving the code into another file does not pass this gate

MCP

Call the ladder directly.

Point an MCP-speaking agent at mido mcp. It gets the CLI's exact rules: an unknown package is a setup error, an unknown argument is rejected.

  • list_targetsName, path and kind of every target in the repo.
  • run_ladderMeasure one target silently; return the exit code and the report.
Read the MCP docs

MCP client configurationJSON

{
  "mcpServers": {
    "mido": {
      "command": "mido",
      "args": ["mcp"]
    }
  }
}

Get started

Put a gate in front of shipping.

Install the binary and run it in a repo. mido infers Rust, TypeScript or JavaScript and works from its built-in baseline before you write any config.

One-line install

v0.5.0
curl -fsSL https://github.com/alessandromalacarne/mido/releases/latest/download/install.sh | sh

Other ways in

Cargocargo install mido-guard
Nixnix develop
From sourcecargo build --release

Requires git and the tools your stack's gates call. nix develop brings all of them.

  1. 01

    Install

    The installer checks the release against SHA256SUMS and drops mido in ~/.local/bin.

  2. 02

    Run

    From the repo root: mido. It measures the whole workspace, not just the diff.

  3. 03

    Tighten

    Move a threshold in .mido.toml when you mean it. A waiver is written down and named in the verdict.

The way in

Make the next green mean something.

Six gates between your code and shipping. One verdict you can hand to the next reader.

“If you want to pass through here, you should at least equip a sword and shield!”

Mido, guarding the way into Kokiri Forest