{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://oss.korext.com/ai-attestation/schema", "title": "AI Attestation", "description": "Schema for .ai-attestation.yaml files. Tracks AI generated code in a repository.", "type": "object", "required": ["schema", "version", "repo", "generated", "range", "ai"], "properties": { "schema": { "type": "string", "description": "URL to the schema definition.", "const": "https://oss.korext.com/ai-attestation/schema" }, "version": { "type": "string", "description": "Schema version.", "enum": ["1.0", "1.1"] }, "repo": { "type": "object", "description": "Repository metadata.", "required": ["owner", "name"], "properties": { "owner": { "type": "string", "description": "Repository owner or organization." }, "name": { "type": "string", "description": "Repository name." }, "url": { "type": "string", "description": "Repository URL.", "format": "uri" } } }, "generated": { "type": "string", "description": "ISO 8601 timestamp when this attestation was generated.", "format": "date-time" }, "range": { "type": "object", "description": "Time range of commits analyzed.", "required": ["commits"], "properties": { "from": { "type": "string", "description": "Start of analysis range (ISO 8601).", "format": "date-time" }, "to": { "type": "string", "description": "End of analysis range (ISO 8601).", "format": "date-time" }, "commits": { "type": "integer", "description": "Total number of commits analyzed.", "minimum": 0 } } }, "ai": { "type": "object", "description": "AI tool usage data.", "required": ["assisted_commits", "percentage", "tools"], "properties": { "assisted_commits": { "type": "integer", "description": "Number of commits with detected AI tool involvement.", "minimum": 0 }, "percentage": { "type": "number", "description": "Percentage of commits that were AI assisted.", "minimum": 0, "maximum": 100 }, "tools": { "type": "array", "description": "List of detected AI tools.", "items": { "type": "object", "required": ["name", "identifier", "commit_count"], "properties": { "name": { "type": "string", "description": "Human readable tool name." }, "identifier": { "type": "string", "description": "Machine readable tool identifier.", "enum": [ "copilot", "cursor", "claude-code", "codeium", "aider", "codex-cli", "gemini-code-assist", "windsurf", "tabnine", "devin", "openhands" ] }, "first_seen": { "type": ["string", "null"], "description": "Date when tool was first detected (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "last_seen": { "type": ["string", "null"], "description": "Date when tool was last detected (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "commit_count": { "type": "integer", "description": "Number of commits attributed to this tool.", "minimum": 0 } } } }, "detection_methods": { "type": "array", "description": "Methods used to detect AI tool usage.", "items": { "type": "string", "enum": [ "co-author-trailer", "commit-message-pattern", "metadata-header", "git-config" ] } } } }, "governance": { "type": "object", "description": "Governance scanning results. Populated by governance engines.", "properties": { "engine": { "type": ["string", "null"], "description": "Name of governance engine." }, "last_scan": { "type": ["string", "null"], "description": "ISO 8601 timestamp of last governance scan.", "format": "date-time" }, "result": { "type": ["string", "null"], "description": "Scan result.", "enum": ["PASS", "WARN", "BLOCK", null] }, "score": { "type": ["integer", "null"], "description": "Governance score (0 to 100).", "minimum": 0, "maximum": 100 }, "packs": { "type": "array", "description": "Governance packs applied.", "items": { "type": "string" } }, "findings": { "type": "object", "description": "Finding counts by severity.", "properties": { "critical": { "type": "integer", "minimum": 0 }, "high": { "type": "integer", "minimum": 0 }, "medium": { "type": "integer", "minimum": 0 }, "low": { "type": "integer", "minimum": 0 } } }, "proof_bundle_url": { "type": ["string", "null"], "description": "URL to the proof bundle.", "format": "uri" }, "proof_bundle_count": { "type": "integer", "description": "Number of proof bundles generated.", "minimum": 0 } } }, "policy": { "type": "object", "description": "Repository policy configuration.", "properties": { "ai_code_requires_review": { "type": "boolean", "description": "Whether AI assisted code requires human review." }, "minimum_governance_score": { "type": ["integer", "null"], "description": "Minimum governance score to pass CI.", "minimum": 0, "maximum": 100 }, "mandatory_packs": { "type": "array", "description": "Governance packs that must be applied.", "items": { "type": "string" } }, "block_unscanned_ai_code": { "type": "boolean", "description": "Whether to block AI code that has not been governance scanned." } } }, "radar": { "type": "object", "description": "AI Code Radar opt-in configuration and metadata.", "properties": { "include_in_aggregates": { "type": "boolean", "description": "Whether to include this repository in AI Code Radar statistics.", "default": true }, "region": { "type": "string", "description": "ISO 3166-1 alpha-2 country code for regional breakdowns." }, "industry": { "type": "string", "description": "Regulated industry categorization.", "enum": ["fintech", "healthcare", "government", "education", "gaming", "infrastructure", "ecommerce", "media", "other"] }, "maturity": { "type": "string", "description": "Maturity stage of the repository.", "enum": ["prototype", "alpha", "beta", "production", "legacy"] } } } } }