Quality Gates
AI Factory quality gates keep their normal human-readable Markdown reports, then append one final machine-readable block. Handoff, AIFHub, and future orchestrators should parse only the last aif-gate-result fenced block in the final gate output instead of scraping prose.
Supported gates:
/aif-verify->gate: "verify"/aif-review->gate: "review"/aif-security-checklist->gate: "security"/aif-rules-check->gate: "rules"
The block must be valid JSON and must appear after the human summary.
Schema
{
"schema_version": 1,
"gate": "verify",
"status": "fail",
"blocking": true,
"blockers": [
{
"id": "verify-task-1",
"severity": "error",
"file": "src/example.ts",
"summary": "Required behavior is missing."
}
],
"affected_files": ["src/example.ts"],
"suggested_next": {
"command": "/aif-fix",
"reason": "Blocking implementation gaps remain."
}
}
Rules:
schema_versionis currently1.gateis one ofverify,review,security, orrules.statusis one ofpass,warn, orfail.blockingis a boolean.blockerscontains only findings that should block the current gate.blockers[].severityuseserrororwarning; securitycritical/highmaps toerror, whilemedium/lownormally remains a non-blocking human warning.affected_filesis a predictable top-level array of files the gate actually evaluated or cited. It is not limited to blocker files. Use[]when no files apply.suggested_next.commandis selected from the global allowlist:/aif-fix,/aif-rules,/aif-architecture,/aif-roadmap,/aif-commit, ornull. Individual gates may document narrower subsets.nullmeans only that no allowlisted command fits the current state. It carries no verdict of its own: whether the run may proceed is decided bystatusandblockingalone, and orchestrators read those, never the command./aif-reviewdoes not usenullto encode an unresolved finding: a review that produced(confidence: low)/(confidence: medium)markers runs its validation pass before the gate is computed, so a published block only ever reports states schema v1 can express — a confirmed critical is an ordinary blocker, a refuted one is gone. When that validation fails, the review reports the failure as afailgate with areview-validation-failedblocker;nullappears there because the recovery (re-running/aif-review +check) is not an allowlisted command, and the reason says so.
Status Examples
Pass:
{
"schema_version": 1,
"gate": "review",
"status": "pass",
"blocking": false,
"blockers": [],
"affected_files": ["skills/aif-review/SKILL.md"],
"suggested_next": {
"command": "/aif-commit",
"reason": "Review found no blocking issues."
}
}
Warn:
{
"schema_version": 1,
"gate": "rules",
"status": "warn",
"blocking": false,
"blockers": [],
"affected_files": [],
"suggested_next": {
"command": "/aif-rules",
"reason": "Rules are missing or ambiguous for the changed scope."
}
}
Fail:
{
"schema_version": 1,
"gate": "security",
"status": "fail",
"blocking": true,
"blockers": [
{
"id": "security-secret-1",
"severity": "error",
"file": "src/config.ts",
"summary": "A hardcoded secret is present."
}
],
"affected_files": ["src/config.ts"],
"suggested_next": {
"command": "/aif-fix",
"reason": "Remove the exposed secret and rotate it."
}
}
Compatibility
Manual workflows continue to read the human Markdown summaries. Existing WARN, ERROR, PASS, and FAIL labels can remain in those summaries when they are useful for people.
The machine contract is only the final fenced JSON block in actual gate output. Orchestrators should ignore earlier Markdown headings, bullets, and examples.
Ownership
Quality gates remain read-only for context artifacts by default. If a gate finds stale architecture, roadmap, or rules context, it should suggest the owner command instead of editing the artifact directly.
Exceptions stay with existing command contracts. For example, /aif-security-checklist ignore <item> may write the configured security ignored-item artifact, but normal security audit findings are report output.
See Also
- Development Workflow - where gates fit into the workflow
- Core Skills - command reference for each quality gate
- Configuration - artifact ownership and context gate defaults