Files
DevRunbook-Public/schemas/repository-profile.schema.json
DevRunbook release export cfd2804e27
Managed validation / full (push) Successful in 3m18s
Publish DevRunbook source
2026-09-03 04:09:17 +02:00

157 lines
7.7 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://devrunbook.local/schemas/repository-profile.schema.json",
"title": "DevRunbook Repository Profile",
"type": "object",
"additionalProperties": false,
"required": ["apiVersion", "kind", "metadata", "spec"],
"properties": {
"apiVersion": {"const": "devrunbook.io/v1alpha1"},
"kind": {"const": "RepositoryProfile"},
"metadata": {
"type": "object",
"additionalProperties": false,
"required": ["name", "revision", "source"],
"properties": {
"name": {"type": "string", "minLength": 1, "maxLength": 120},
"revision": {"type": "integer", "minimum": 1},
"source": {"enum": ["manual", "gitea", "imported", "mixed"]},
"capturedAt": {"type": "string", "format": "date-time"},
"sourceReference": {"type": "string", "maxLength": 300},
"contentDigest": {"$ref": "#/$defs/sha256"}
}
},
"spec": {
"type": "object",
"additionalProperties": false,
"required": ["repositoryType", "stack", "commands", "paths", "policies"],
"properties": {
"repositoryType": {"enum": ["single-app", "monorepo", "library", "infrastructure", "mixed", "unknown"]},
"defaultBranch": {"type": "string", "maxLength": 200},
"stack": {
"type": "object",
"additionalProperties": false,
"required": ["languages", "frameworks", "packageManagers", "databases", "deploymentTypes", "testFrameworks"],
"properties": {
"languages": {"$ref": "#/$defs/stringSet"},
"frameworks": {"$ref": "#/$defs/stringSet"},
"packageManagers": {"$ref": "#/$defs/stringSet"},
"databases": {"$ref": "#/$defs/stringSet"},
"deploymentTypes": {"$ref": "#/$defs/stringSet"},
"testFrameworks": {"$ref": "#/$defs/stringSet"},
"services": {"$ref": "#/$defs/stringSet"},
"runtimes": {"$ref": "#/$defs/stringSet"},
"queues": {"$ref": "#/$defs/stringSet"},
"ciSystems": {"$ref": "#/$defs/stringSet"}
}
},
"commands": {
"type": "array",
"maxItems": 100,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["id", "role", "command", "workingDirectory", "platform", "shell", "source", "confirmed", "safeForAgentSuggestion"],
"properties": {
"id": {"type": "string", "pattern": "^[a-z][a-z0-9-]*$", "maxLength": 80},
"role": {"$ref": "#/$defs/commandRole"},
"command": {"type": "string", "minLength": 1, "maxLength": 1000},
"workingDirectory": {"type": "string", "minLength": 1, "maxLength": 500},
"platform": {"enum": ["any", "linux", "windows", "macos", "container"]},
"shell": {"enum": ["auto", "sh", "bash", "pwsh", "cmd"]},
"source": {"enum": ["manual", "manifest", "documentation", "gitea", "inferred"]},
"confirmed": {"type": "boolean"},
"safeForAgentSuggestion": {"type": "boolean"},
"timeoutSeconds": {"type": "integer", "minimum": 1, "maximum": 86400},
"notes": {"type": "string", "maxLength": 500},
"confidence": {"enum": ["low", "medium", "high"]},
"evidence": {"$ref": "#/$defs/stringSet"},
"observedCommand": {"type": "string", "minLength": 1, "maxLength": 1000},
"confirmedAt": {"type": "string", "format": "date-time"}
}
}
},
"paths": {
"type": "object",
"additionalProperties": false,
"required": ["applicationRoots", "testRoots", "documentationRoots", "generated", "protected", "excluded"],
"properties": {
"applicationRoots": {"$ref": "#/$defs/pathSet"},
"testRoots": {"$ref": "#/$defs/pathSet"},
"documentationRoots": {"$ref": "#/$defs/pathSet"},
"generated": {"$ref": "#/$defs/pathSet"},
"protected": {"$ref": "#/$defs/pathSet"},
"excluded": {"$ref": "#/$defs/pathSet"},
"packageRoots": {"$ref": "#/$defs/pathSet"},
"serviceRoots": {"$ref": "#/$defs/pathSet"},
"dataRuntime": {"$ref": "#/$defs/pathSet"},
"ignored": {"$ref": "#/$defs/pathSet"}
}
},
"policies": {
"type": "object",
"additionalProperties": false,
"required": ["preserveBackwardCompatibility", "newDependencies", "gitWrite", "migrations", "documentationRequired", "networkAccess", "productionDataAccess"],
"properties": {
"preserveBackwardCompatibility": {"type": "boolean"},
"newDependencies": {"enum": ["allowed", "justify", "approval-required", "forbidden"]},
"gitWrite": {"enum": ["none", "local-commit", "push-with-approval"]},
"migrations": {"enum": ["forbidden", "plan-only", "reversible-only", "allowed-with-backup"]},
"documentationRequired": {"type": "boolean"},
"networkAccess": {"enum": ["forbidden", "read-only-approved-hosts", "allowed-with-approval"]},
"productionDataAccess": {"enum": ["forbidden", "read-only-redacted", "approval-required"]},
"requiredValidationRoles": {"type": "array", "uniqueItems": true, "maxItems": 30, "items": {"$ref": "#/$defs/commandRole"}},
"branchConventions": {"$ref": "#/$defs/stringSet"},
"environmentConstraints": {"$ref": "#/$defs/stringSet"}
}
},
"sourceFacts": {
"type": "array",
"maxItems": 500,
"items": {"$ref": "#/$defs/sourceFact"}
},
"manualOverrides": {
"type": "array",
"maxItems": 200,
"items": {"$ref": "#/$defs/manualOverride"}
},
"notes": {"type": "string", "maxLength": 5000}
}
}
},
"$defs": {
"sha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
"commandRole": {"enum": ["install", "format", "format-check", "lint", "typecheck", "unit-test", "integration-test", "end-to-end-test", "build", "dev-start", "smoke-test", "migration-status", "migration-apply", "security-scan", "dependency-audit"]},
"stringSet": {"type": "array", "uniqueItems": true, "maxItems": 100, "items": {"type": "string", "minLength": 1, "maxLength": 120}},
"pathSet": {"type": "array", "uniqueItems": true, "maxItems": 200, "items": {"type": "string", "minLength": 1, "maxLength": 500}},
"sourceFact": {
"type": "object",
"additionalProperties": false,
"required": ["path", "value", "source", "evidence"],
"properties": {
"path": {"$ref": "#/$defs/jsonPointer"},
"value": {},
"source": {"enum": ["manual", "manifest", "documentation", "gitea", "inferred", "prior-profile"]},
"evidence": {"$ref": "#/$defs/evidenceSet"},
"confidence": {"enum": ["low", "medium", "high"]},
"observedAt": {"type": "string", "format": "date-time"}
}
},
"manualOverride": {
"type": "object",
"additionalProperties": false,
"required": ["path", "value", "observedValue", "evidence", "confirmedAt"],
"properties": {
"path": {"$ref": "#/$defs/jsonPointer"},
"value": {},
"observedValue": {},
"evidence": {"$ref": "#/$defs/evidenceSet"},
"confirmedAt": {"type": "string", "format": "date-time"},
"note": {"type": "string", "maxLength": 500}
}
},
"jsonPointer": {"type": "string", "pattern": "^(?:/(?:[^~/]|~0|~1)*)+$", "maxLength": 500},
"evidenceSet": {"type": "array", "minItems": 1, "maxItems": 100, "uniqueItems": true, "items": {"type": "string", "minLength": 1, "maxLength": 120}}
}
}