Skip to content

14. Release Gate

Everything in Part II produces evidence. k11 Release Gate turns it into a decision: ship, ship with conditions, needs a person or block, with every reason and the evidence file it came from.

It is deliberately simple and deliberately strict:

  • Rules, not a model. The same evidence and policy always give the same verdict. That's what makes the decision auditable.
  • Missing evidence is never a pass. Required evidence that's missing blocks; optional evidence that's missing is listed as not tested.
  • The policy is code. A YAML file in your repository, reviewed and versioned like everything else.

How it decides

flowchart LR
    E[Collect evidence<br/>by content] --> P[Plan from the diff<br/>which kinds are needed]
    P --> R[Apply 37 rules<br/>each → an outcome]
    R --> V[Verdict:<br/>the worst outcome]
    V --> D[release-decision.md<br/>release-decision.json]
  1. Collect. Find the report files the policy points to (glob patterns per kind) and recognise each by its content: its tool field and its shape, not its name. Record its SHA-256, when it was produced and its age. A file that can't be read is kept as unreadable, never skipped.
  2. Plan (with a base ref). Match the files changed since the base against triggers to decide which kinds this change needs, on top of the policy's required list.
  3. Rules. Each of 37 rules reads the facts from one kind of evidence and produces findings, each with an outcome: block, needs_human, conditional or info.
  4. Verdict. The worst outcome wins:

    Worst finding Verdict
    block 🔴 block
    needs_human 🟠 needs a person, naming the policy's approvers
    conditional 🟡 ship with conditions
    info or nothing 🟢 ship
  5. Record. release-decision.md for people and pull requests, and release-decision.json, the audit record: verdict, counts, every finding with its evidence, every evidence file with its full SHA-256 and facts, the policy's name and SHA-256, the plan, the commit, the label and the time.

Evidence kinds

Kind Report Produced by
ui_heal heal-report.json Playwright QA, Selenium QA, Appium QA (heal-ci)
contract contract-report.json API Contract QA (contract-ci)
api_tests api-test-report.json API Functional QA
security security-report.json API Security QA
integration integration-report.json Integration QA
perf perf-report.json Performance QA
llm assessment.json LLM Assure
junit any JUnit XML pytest, Maven Surefire, Gradle, Jest, Playwright…

Default locations are in Appendix A; the full rule list is Appendix B.

The policy

k11-release-gate-mcp init writes .qa-mcp/release-policy.yaml with comments for every setting:

name: Order platform release policy
required: [api_tests, contract, junit]          # always required
max_age_hours: 24                                # older evidence → evidence.stale
critical_consumers: [critical, high]             # their breakage blocks
approvers: ["@qa-lead", "@ai-safety-lead"]       # named on a needs_human verdict
triggers:                                        # merged with the defaults, per kind
  llm: ["src/assistant/**", "prompts/**"]
rules:                                           # block | needs_human | conditional | info | off
  llm.medium: needs_human
  ui.healed: info
evidence:                                        # replaces the default locations (list every kind you use)
  api_tests: [".qa-mcp/api-test-report/api-test-report.json"]
  junit: ["test-results/**/*.xml"]
Key Default Notes
required [api_tests] A JUnit-only project must change this
max_age_hours 24 Evidence from an earlier run is stale
critical_consumers [critical, high] Contract breaks for these block
approvers none Named in the decision when a person is needed
triggers built in Per kind; yours replace that kind's defaults
rules each rule's default Make a rule stricter, softer, or off
evidence built in Replaces the whole map: list every kind you use

Unknown keys, kinds or rule names are rejected with an error, so a typo can't quietly weaken the gate. The policy's own SHA-256 is recorded in every decision.

Change-aware gating

k11-release-gate-mcp plan --base origin/main

The gate diffs the branch against the base (base...HEAD: the changes on this branch since it left the base) and requires the evidence those changes trigger. The defaults:

A change to… Requires
openapi*, swagger*, *.graphql, *.proto, asyncapi*, *.wsdl contract
api/, routes/, controllers/, handlers/, endpoints/, services/, migrations, SQL API tests
auth, permissions, policies, middleware, routes, controllers, dependency manifests, Dockerfiles security
consumers, producers, listeners, messaging, events, kafka, queues, jobs, batch, schedulers, workers, middleware, AsyncAPI integration
migrations, SQL, queries, repositories, DAOs, caches, database code, performance config performance
.tsx, .jsx, .vue, .svelte, HTML, CSS, components, pages, templates, views UI
prompts, llm/, agents/, rag/, guardrails/, chatbot/ LLM

A README change needs only what the policy always requires. The decision lists which files made each kind required, so "why was a load test needed for this release?" always has an answer.

Using it

Claude Code: /release-check collects the evidence, tells you which tool produces anything missing, evaluates and explains, without ever softening the verdict. The tools: evaluate_release, plan_checks, collect_evidence, list_rules, init_policy.

Command line:

k11-release-gate-mcp evaluate --label v2.4.0 --base origin/main
k11-release-gate-mcp rules           # every rule and its outcome under your policy
evaluate option Default
--label TEXT none
--policy PATH .qa-mcp/release-policy.yaml, or the built-in policy if missing
--base REF no change-triggered evidence
--report-dir PATH .qa-mcp/release-gate
--fail-on LEVEL block; also needs-human, conditions, never

In GitHub Actions it also writes its outputs and the job summary. Chapter 15 wraps it for pull requests.

Reading a decision

The repository's demo has two release candidates built from real tool runs. rc1 → 🔴 block with seven blockers, among them:

  • 1 UI test failed for reasons other than locators (ui.real_failures): page title changed
  • API change breaks billing-svc, checkout-web, notification-svc (contract.breaks_critical_consumer): billing-svc is critical, owner @team-billing
  • 2 server errors (5xx) in API tests (api.server_error): wrong type / missing items[0].qty
  • 6 critical and 13 high-severity LLM findings (llm.critical, llm.high)

After the fixes, rc2 → 🟠 needs a person's sign-off:

Sign-off needed from @qa-lead, @ai-safety-lead before release. - Needs a person: 1 LLM probe inconclusive (llm.inconclusive) - Condition: 1 locator healed and verified: approve the heal pull request

Everything passes, but one probe couldn't be decided automatically. The gate neither lets it through silently nor blocks the release: it asks a named person to look. That middle path is the point.