Gates reference
Gates are the truth source for "done" in Midcore. They are defined in `.maestro/gates.yaml` and run via `midcore gates run`. Each gate produces a result (pass, fail, warn) and evidence is recorded in the evidence ledger.
Quick reference
In plain language, gates typically do: lint (code style and quality), test (unit and integration tests), contract check (API and schema validation), security (secrets, RBAC, tenancy), and build & deploy readiness (build integrity, rollback, rehearsal). Your `gates.yaml` defines the exact commands and order.
Concepts
- Gate — A single check (e.g. lint, tests, contract validation). Defined by an ID and a command or script.
- Evidence ledger — Append-only log of gate runs (when, scope, command hash, result). Used for audit and compliance.
- Delivery tier — Your
intent.yamltier (prototype, pilot, production) can affect which gates are required. Stricter tiers require more gates to pass.
Running gates
# Run all gates defined for the current project
midcore gates run
# Run a single gate by ID (see your gates.yaml for IDs)
midcore gates run --gate <gate-id>Gates typically run in dependency order. If a required gate fails, downstream gates may be skipped. Check your project’s `.maestro/gates.yaml` for the exact list and IDs.
Gate categories
Gates are often grouped by purpose. Common categories (names may vary in your repo):
| Category | Purpose |
|---|---|
| Intake | Validate intent and scope before work starts |
| Contract | API and schema contracts are defined and met |
| Security | Secrets, RBAC, and security invariants |
| Tenancy | No cross-tenant data access |
| Capability passport | Proof that a capability ships with contracts, tests, and evidence |
| Build & deploy | Build integrity, rollback, rehearsal |
Your project
Evidence
Each gate run can write an evidence entry: gate ID, timestamp, scope, command hash, and result. The ledger is append-only. Use it to prove that gates passed at release time for compliance and audit. See Gates & evidence for the concept overview.