Documentation / Quality and governance

Gate and Governance Center

A single gate enforces the contract on every commit, push and pipeline, and the Governance Center brings the whole lifecycle together.

On this page

The quality contract states what the team requires. The gate enforces it. It is a single engine command used in exactly the same way by Git hooks, CI, the yuli-mcp gate command and agent hooks. The result doesn't depend on who invokes it.

The command

bash
agent-engine gate --project <raíz> --stage pre-commit|commit-msg|pre-push|ci \
  [--message-file <archivo>] [--base <revisión>] [--format text|json]

If you omit --project, the current folder is used. A folder without Git always passes.

Exit codeMeaning
0Passes.
1Blocked: some check failed.
2Usage error.

Try it: move a change's metrics and see how the gate responds.

Pass the gate

Adjust a change's metrics and watch how the quality contract responds.

Gate blocked89Acceptance score · limit 90
$ agent-engine gate --stage pre-push
✗ coverage 64 (70)
✗ cognitive 18 (15)
✓ cyclomatic 9 (10)
BLOCKED

What each stage checks

StageWhat it comparesChecks
pre-commitWhat is stagedAll of the ones below.
commit-msgThe commit messageOnly AI attribution and waivers.
pre-pushAgainst @{upstream} (or origin/HEAD)All of the ones below.
ciAgainst the PR or MR target branch (or HEAD~1)All of the ones below.

The checks

CheckLabel in YuliResult
Secrets in added linesSecretsBlocks. The type and line are reported, never the value.
Cheating in testsTest integrityBlocks if the profile blocks cheating; otherwise, warns.
Change sizeChange sizeBlocks with strict enforcement; otherwise, warns.
Protected files touchedProtected pathsBlocks with strict enforcement; otherwise, warns.
AI attribution in messagesAI attributionChecks that there is no Co-Authored-By from an AI.
Expired waiversWaiversWarns. Never blocks.
Existing code without testsSafety netWarns. Never blocks.

Test anti-cheating

An agent under pressure to finish may “fix” a test instead of the code. Yuli detects it.

In tests:

  • Removed assertions or deleted tests.
  • Skipped tests: @Disabled, @Ignore, .skip(, xit, #[ignore], pytest or unittest skips, t.Skip.
  • Trivial assertions, such as assertTrue(true) or expect(true).toBe(true).
  • Expected values changed so the test passes.
  • A catch-all catch inside a test.

In the build and CI:

  • Minimum coverage lowered.
  • Tests skipped in the build.
  • Ignored failures, such as npm test || true.
  • Test script replaced with an empty one.
  • Quality gate turned off or test task disabled.

Safety net

If existing code files change without characterization or unit tests, the gate warns you: the change must preserve behavior. It never blocks the commit.

Install the Git hooks

In the Governance Center, Gates tab, click Install hooks.

  1. Yuli writes .githooks/pre-commit, .githooks/commit-msg and .githooks/pre-push.
  2. It sets git config --local core.hooksPath .githooks.

Yuli installs nothing if core.hooksPath already points to another tool (for example, husky) or if there is a hook it didn't write. If the engine isn't available, the hook warns and lets the commit through: it never leaves you unable to commit.

Uninstall hooks removes the configuration and deletes only Yuli's scripts.

In CI

The pipelines generated by Create CI include the “Contract gates” step, which runs agent-engine gate --stage ci. That way CI applies the same rules as your local team.

The Governance Center

Open it from the right rail (More tools → Governance Center) or from the command palette: Open the Governance Center. It has 10 tabs.

TabWhat it contains
ContractCriticality, thresholds, protected paths, waivers, layers, SLOs, license policy, independent reviewer, data classification, FinOps budgets and history.
GatesRun the gate for a stage, install or uninstall the hooks, and the CI card.
Sensitive dataValues redacted when leaving your machine, classified fields in the code and secrets in Git history.
AnalysisRequirements (EARS patterns, ambiguity, ISO 25010 attributes, Gherkin) and glossary.
DesignDecisions (ADRs), Threats (STRIDE), APIs (OpenAPI), C4, SLOs and Legacy.
MeasurementArchitecture fitness functions, LCOM4, change coupling, bus factor, debt register, twelve-factor and feature flags.
TestsFlaky tests and quarantine, mutation, test types, race conditions and load.
Supply chainDependencies and licenses, SBOM, IaC, containers, DAST, provenance (SLSA, cosign), CODEOWNERS and history.
DeliveryCI, release, rollback, progressive deployment, runbook, post-mortems, DORA, SPACE, builds and FinOps.
AgentsContext, Review, Telemetry, Learning, Benchmark and Injection.

Documents it generates

DocumentPath
ADRs (architecture decisions)docs/architecture/adr/
STRIDE threat modeldocs/architecture/threat-model.md
C4 diagramsdocs/architecture/c4.md
SBOMdocs/reports/sbom.cdx.json and docs/reports/sbom.spdx.json
Runbookdocs/operations/runbook.md
Post-mortemsdocs/operations/postmortems/

DORA

The Delivery tab computes the four DORA metrics: deployment frequency, lead time, change failure rate and MTTR, with the Elite, High, Medium and Low bands. It uses recorded deployments or CI. Yuli doesn't see a production APM.

Independent review

A model from another family reviews the change. It never uses the same family as the model that wrote it. If none is configured, it is shown as unavailable. It is mandatory in the Regulated and Safety-critical profiles.

Context for all agents

Under Agents → Context, the “Context for all agents” section writes the same rules for each tool:

TargetFile
Claude Code (CLAUDE.md).claude/CLAUDE.md
AGENTS.md (Codex and others)AGENTS.md
Kiro (.kiro/steering).kiro/steering/yuli.md
Antigravity.agent/rules/yuli.md
Cursor (.cursor/rules).cursor/rules/yuli.mdc
GitHub Copilot.github/copilot-instructions.md
Gemini (GEMINI.md)GEMINI.md

The content goes in a managed block; anything you write outside it is preserved. By default the files are kept out of Git; turn that on with Version them in Git. Each target shows its status: Up to date, Outdated, Does not exist or Edited by hand.

Learned rules

When the same finding appears 3 or more times across at least 2 tasks within 30 days, it becomes a rule in .ai/rules/learned.md. You can reject it under Agents → Learning; it is only proposed again if its evidence doubles.

Honest limits

  • DAST (OWASP ZAP), container scanning (Trivy or Grype) and signing (cosign) only run if they are installed, and always with confirmation. If they are missing, Yuli says so and doesn't simulate the result.
  • Preventive and IaC rules are text patterns. Each finding includes its file and line so a person can confirm it.