{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://devora.dev/schema/v2/state.schema.json", "title": "Devora v2 project state", "type": "object", "required": [ "schema_version", "state_revision", "devora_version", "integration", "artifact_language", "active_change", "history", "capabilities", "governance", "quality", "continuity", "install", "created_at", "updated_at" ], "properties": { "schema_version": { "const": 6 }, "state_revision": { "type": "integer", "minimum": 1 }, "devora_version": { "type": "string" }, "integration": { "type": ["string", "null"] }, "artifact_language": { "enum": ["auto", "en", "zh-CN"] }, "active_change": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/change" }] }, "history": { "type": "array", "items": { "$ref": "#/$defs/history" } }, "capabilities": { "type": "object", "additionalProperties": { "$ref": "#/$defs/capability" } }, "governance": { "$ref": "#/$defs/governance" }, "quality": { "$ref": "#/$defs/quality" }, "continuity": { "$ref": "#/$defs/continuity" }, "install": { "type": "object" }, "created_at": { "type": "string" }, "updated_at": { "type": "string" } }, "additionalProperties": false, "$defs": { "slug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }, "hex": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "stringMap": { "type": "object", "additionalProperties": { "type": "string" } }, "hexMap": { "type": "object", "additionalProperties": { "$ref": "#/$defs/hex" } }, "finding": { "type": "object", "required": [ "id", "category", "statement", "evidence", "evidence_fingerprints", "confidence", "target", "risk_level", "relations", "validation_requirements", "mandatory", "outcome", "conclusion", "created_at", "resolved_at" ], "properties": { "id": { "$ref": "#/$defs/slug" }, "category": { "enum": ["knowledge", "technical_risk", "business_risk"] }, "statement": { "type": "string", "minLength": 1 }, "evidence": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }, "evidence_fingerprints": { "type": "object", "additionalProperties": { "oneOf": [{ "$ref": "#/$defs/hex" }, { "type": "null" }] } }, "confidence": { "enum": ["observed", "inferred"] }, "target": { "enum": [ "product", "engineering", "architecture", "rules", "risks", "decisions" ] }, "risk_level": { "enum": ["L1", "L2", "L3", "L4", null] }, "relations": { "type": "array", "items": { "type": "object", "required": ["type", "finding_id"], "properties": { "type": { "enum": [ "supports", "conflicts_with", "depends_on", "supersedes" ] }, "finding_id": { "$ref": "#/$defs/slug" } }, "additionalProperties": false } }, "validation_requirements": { "type": "array", "items": { "$ref": "#/$defs/slug" } }, "mandatory": { "type": "boolean" }, "outcome": { "enum": [ "fact", "rule", "exception", "unknown", "corrected", "rejected", null ] }, "conclusion": { "type": ["string", "null"] }, "created_at": { "type": "string" }, "resolved_at": { "type": ["string", "null"] } }, "additionalProperties": false }, "clarification": { "type": "object", "required": [ "id", "finding_id", "category", "target", "observation", "question", "question_key", "impact", "recommendation", "answer", "outcome", "created_at", "resolved_at" ,"revisit_after" ], "properties": { "id": { "$ref": "#/$defs/slug" }, "finding_id": { "oneOf": [{ "$ref": "#/$defs/slug" }, { "type": "null" }] }, "category": { "enum": ["knowledge", "technical_risk", "business_risk"] }, "target": { "enum": [ "product", "engineering", "architecture", "rules", "risks", "decisions" ] }, "observation": { "type": "string" }, "question": { "type": "string" }, "question_key": { "$ref": "#/$defs/hex" }, "impact": { "type": "string" }, "recommendation": { "type": ["string", "null"] }, "answer": { "type": ["string", "null"] }, "outcome": { "enum": ["fact", "rule", "exception", "unknown", "corrected", null] }, "created_at": { "type": "string" }, "resolved_at": { "type": ["string", "null"] }, "revisit_after": { "type": ["string", "null"] } }, "additionalProperties": false }, "control": { "type": "object", "required": [ "id", "finding_id", "kind", "statement", "status", "evidence", "mandatory", "created_at", "updated_at" ], "properties": { "id": { "$ref": "#/$defs/slug" }, "finding_id": { "$ref": "#/$defs/slug" }, "kind": { "enum": ["prevent", "detect", "recover", "approve"] }, "statement": { "type": "string" }, "status": { "enum": ["planned", "verified", "unavailable", "waived"] }, "evidence": { "type": "array", "items": { "type": "string" } }, "mandatory": { "type": "boolean" }, "created_at": { "type": "string" }, "updated_at": { "type": "string" } }, "additionalProperties": false }, "scope": { "type": "object", "required": [ "profile", "required_targets", "status", "readiness", "drift_status", "findings", "clarifications", "controls", "baseline_snapshot", "baseline_symlinks", "created_at", "updated_at" ], "properties": { "profile": { "enum": ["focused", "module", "project"] }, "required_targets": { "type": "array", "items": { "type": "string" } }, "status": { "enum": ["in_progress", "complete"] }, "readiness": { "enum": ["ready", "limited", null] }, "drift_status": { "enum": ["clean", "changed"] }, "findings": { "type": "array", "items": { "$ref": "#/$defs/finding" } }, "clarifications": { "type": "array", "items": { "$ref": "#/$defs/clarification" } }, "controls": { "type": "array", "items": { "$ref": "#/$defs/control" } }, "baseline_snapshot": { "$ref": "#/$defs/hex" }, "baseline_symlinks": { "type": "array", "items": { "type": "string" } }, "created_at": { "type": "string" }, "updated_at": { "type": "string" } }, "additionalProperties": false }, "governance": { "type": "object", "required": ["scan", "scopes"], "properties": { "scan": { "type": ["object", "null"] }, "scopes": { "type": "object", "additionalProperties": { "$ref": "#/$defs/scope" } } }, "additionalProperties": false }, "scenarioResult": { "type": "object", "required": ["result", "evidence", "validated_at"], "properties": { "result": { "enum": ["passed", "failed", "blocked"] }, "evidence": { "type": "array", "minItems": 1, "items": { "type": "string" } }, "validated_at": { "type": "string" } }, "additionalProperties": false }, "capability": { "type": "object", "required": [ "path", "digest", "status", "source", "revision", "dependencies", "required_scenarios", "scenario_definitions", "scenarios", "validated_at" ], "properties": { "path": { "type": "string" }, "digest": { "$ref": "#/$defs/hex" }, "status": { "enum": ["active", "pending_validation", "validation_failed", "stale"] }, "source": { "type": "string" }, "revision": { "type": ["string", "null"] }, "dependencies": { "type": "object", "required": [ "scopes", "findings", "controls", "mandatory_findings", "organization_policies", "feedback" ], "properties": { "scopes": { "$ref": "#/$defs/stringMap" }, "findings": { "$ref": "#/$defs/stringMap" }, "controls": { "$ref": "#/$defs/stringMap" }, "mandatory_findings": { "$ref": "#/$defs/stringMap" }, "organization_policies": { "$ref": "#/$defs/stringMap" }, "feedback": { "$ref": "#/$defs/stringMap" } }, "additionalProperties": false }, "required_scenarios": { "type": "array", "items": { "$ref": "#/$defs/slug" } }, "scenario_definitions": { "$ref": "#/$defs/stringMap" }, "scenarios": { "type": "object", "additionalProperties": { "$ref": "#/$defs/scenarioResult" } }, "validated_at": { "type": "string" } }, "additionalProperties": false }, "baseline": { "type": "object", "required": [ "snapshot", "files", "symlinks", "errors", "truncated", "max_files" ], "properties": { "snapshot": { "$ref": "#/$defs/hex" }, "files": { "$ref": "#/$defs/stringMap" }, "symlinks": { "type": "array", "items": { "type": "string" } }, "internal_symlinks": { "$ref": "#/$defs/stringMap" }, "errors": { "type": "array", "items": { "type": "string" } }, "truncated": { "type": "boolean" }, "max_files": { "type": "integer", "minimum": 1 } }, "additionalProperties": false }, "qualityCapability": { "type": "object", "required": ["id", "category", "provider", "evidence", "commands"], "properties": { "id": { "type": "string" }, "category": { "type": "string" }, "provider": { "type": "string" }, "evidence": { "type": "array", "items": { "type": "string" } }, "commands": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false }, "qualityBaseline": { "type": "object", "required": [ "quality_schema_version", "snapshot", "capability_digest", "status", "file_count", "truncated", "max_files", "capabilities", "categories", "gaps", "skipped_symlinks", "errors", "scanned_at" ], "properties": { "quality_schema_version": { "const": 1 }, "snapshot": { "$ref": "#/$defs/hex" }, "capability_digest": { "$ref": "#/$defs/hex" }, "status": { "enum": ["complete", "limited"] }, "file_count": { "type": "integer", "minimum": 0 }, "truncated": { "type": "boolean" }, "max_files": { "type": "integer", "minimum": 1 }, "capabilities": { "type": "object", "additionalProperties": { "$ref": "#/$defs/qualityCapability" } }, "categories": { "type": "array", "items": { "type": "string" } }, "gaps": { "type": "array", "items": { "type": "string" } }, "skipped_symlinks": { "type": "array", "items": { "type": "string" } }, "errors": { "type": "array", "items": { "type": "string" } }, "scanned_at": { "type": "string" } }, "additionalProperties": false }, "quality": { "type": "object", "required": ["baseline", "updated_at"], "properties": { "baseline": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/qualityBaseline" }] }, "updated_at": { "type": "string" } }, "additionalProperties": false }, "continuity": { "type": "object", "required": [ "drift", "policies", "policy_sources", "exceptions", "repositories", "contracts", "feedback", "decisions", "question_memory" ], "properties": { "drift": { "type": "object", "required": ["last_scan", "issues"], "properties": { "last_scan": { "type": ["string", "null"] }, "issues": { "type": "array", "items": { "type": "object" } } }, "additionalProperties": false }, "policies": { "type": "object", "additionalProperties": { "type": "object" } }, "policy_sources": { "type": "object", "additionalProperties": { "type": "object" } }, "exceptions": { "type": "object", "additionalProperties": { "type": "object" } }, "repositories": { "type": "object", "additionalProperties": { "type": "object" } }, "contracts": { "type": "object", "additionalProperties": { "type": "object" } }, "feedback": { "type": "array", "items": { "type": "object" } }, "decisions": { "type": "array", "items": { "type": "object" } }, "question_memory": { "type": "object", "additionalProperties": { "type": "object" } } }, "additionalProperties": false }, "validation": { "type": "object", "required": [ "kind", "check_type", "execution", "providers", "available", "required", "sources", "risk_links", "control_links", "target_paths", "result", "command", "environment", "provider", "evidence", "artifact_refs", "updated_at" ], "properties": { "kind": { "enum": [ "unit", "integration", "contract", "security", "business", "recovery", "manual" ] }, "check_type": { "type": "string" }, "execution": { "enum": ["automatic", "manual", "external"] }, "providers": { "type": "array", "items": { "type": "string" } }, "available": { "type": "boolean" }, "required": { "type": "boolean" }, "sources": { "type": "array", "items": { "type": "string" } }, "risk_links": { "type": "array", "items": { "type": "string" } }, "control_links": { "type": "array", "items": { "type": "string" } }, "target_paths": { "type": "array", "items": { "type": "string" } }, "result": { "enum": [ "passed", "failed", "blocked", "not_run", "not_applicable", null ] }, "command": { "type": ["string", "null"] }, "environment": { "type": ["string", "null"] }, "provider": { "type": ["string", "null"] }, "evidence": { "type": "array", "items": { "type": "string" } }, "artifact_refs": { "type": "array", "items": { "type": "string" } }, "updated_at": { "type": ["string", "null"] } }, "additionalProperties": false }, "requirementSource": { "type": "object", "required": [ "id", "kind", "location", "status", "summary", "revision", "digest", "created_at", "updated_at" ], "properties": { "id": { "$ref": "#/$defs/slug" }, "kind": { "enum": [ "text", "file", "directory", "url", "image", "design", "ticket", "api" ] }, "location": { "type": "string", "minLength": 1 }, "status": { "enum": ["pending", "read", "unavailable"] }, "summary": { "type": ["string", "null"] }, "revision": { "type": ["string", "null"] }, "digest": { "oneOf": [{ "$ref": "#/$defs/hex" }, { "type": "null" }] }, "created_at": { "type": "string" }, "updated_at": { "type": "string" } }, "additionalProperties": false }, "requirementClarification": { "type": "object", "required": [ "id", "kind", "summary", "source_ids", "impact", "material", "status", "resolution", "resolved_by", "created_at", "resolved_at", "updated_at" ], "properties": { "id": { "$ref": "#/$defs/slug" }, "kind": { "enum": ["conflict", "gap", "ambiguity"] }, "summary": { "type": "string", "minLength": 1 }, "source_ids": { "type": "array", "items": { "$ref": "#/$defs/slug" } }, "impact": { "type": "string", "minLength": 1 }, "material": { "type": "boolean" }, "status": { "enum": ["open", "resolved"] }, "resolution": { "type": ["string", "null"] }, "resolved_by": { "type": ["string", "null"] }, "created_at": { "type": "string" }, "resolved_at": { "type": ["string", "null"] }, "updated_at": { "type": "string" } }, "additionalProperties": false }, "requirementBaseline": { "type": "object", "required": [ "status", "summary", "acceptance_criteria", "source_signatures", "confirmed_by", "confirmed_at" ], "properties": { "status": { "enum": [ "not_required", "collecting", "clarification_required", "confirmed" ] }, "summary": { "type": ["string", "null"] }, "acceptance_criteria": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "source_signatures": { "$ref": "#/$defs/hexMap" }, "confirmed_by": { "type": ["string", "null"] }, "confirmed_at": { "type": ["string", "null"] } }, "additionalProperties": false }, "requirements": { "type": "object", "required": ["sources", "clarifications", "baseline", "updated_at"], "properties": { "sources": { "type": "object", "additionalProperties": { "$ref": "#/$defs/requirementSource" } }, "clarifications": { "type": "object", "additionalProperties": { "$ref": "#/$defs/requirementClarification" } }, "baseline": { "$ref": "#/$defs/requirementBaseline" }, "updated_at": { "type": ["string", "null"] } }, "additionalProperties": false }, "change": { "type": "object", "required": [ "name", "profile", "module", "governance_scopes", "skills", "risk_level", "change_types", "quality_baseline_snapshot", "quality_baseline_status", "organization_policies", "policy_exceptions", "contracts", "requirements", "allowed_paths", "excluded_paths", "parent", "baseline_note", "baseline", "scope_audit", "validation_matrix", "expansions", "path", "status", "workflow", "stage", "stages", "artifacts", "created_at", "updated_at" ], "properties": { "name": { "$ref": "#/$defs/slug" }, "profile": { "enum": ["implementation", "validation-only", "governance-only"] }, "module": { "oneOf": [{ "$ref": "#/$defs/slug" }, { "type": "null" }] }, "governance_scopes": { "$ref": "#/$defs/stringMap" }, "skills": { "type": "array", "items": { "$ref": "#/$defs/slug" } }, "risk_level": { "enum": ["L1", "L2", "L3", "L4"] }, "change_types": { "type": "array", "items": { "type": "string" } }, "quality_baseline_snapshot": { "$ref": "#/$defs/hex" }, "quality_baseline_status": { "enum": ["complete", "limited"] }, "organization_policies": { "$ref": "#/$defs/stringMap" }, "policy_exceptions": { "type": "array", "items": { "$ref": "#/$defs/slug" } }, "contracts": { "type": "array", "items": { "$ref": "#/$defs/slug" } }, "requirements": { "$ref": "#/$defs/requirements" }, "allowed_paths": { "type": "array", "items": { "type": "string" } }, "excluded_paths": { "type": "array", "items": { "type": "string" } }, "parent": { "oneOf": [{ "$ref": "#/$defs/slug" }, { "type": "null" }] }, "baseline_note": { "type": ["string", "null"] }, "baseline": { "$ref": "#/$defs/baseline" }, "scope_audit": { "type": ["object", "null"] }, "validation_matrix": { "type": "object", "additionalProperties": { "$ref": "#/$defs/validation" } }, "expansions": { "type": "array", "items": { "type": "object" } }, "path": { "type": "string" }, "status": { "type": "string" }, "workflow": { "enum": ["quick", "tracked"] }, "stage": { "enum": ["design", "build", "review", null] }, "stages": { "type": "object" }, "artifacts": { "type": "array", "items": { "type": "string" } }, "created_at": { "type": "string" }, "updated_at": { "type": "string" } }, "additionalProperties": false }, "history": { "type": "object", "required": [ "name", "module", "result", "profile", "risk_level", "change_types", "quality_baseline_snapshot", "quality_baseline_status", "organization_policies", "policy_exceptions", "contracts", "requirements", "parent", "skills", "expansions", "validation", "release_decision", "record", "details", "closed_at" ], "properties": { "name": { "$ref": "#/$defs/slug" }, "module": { "oneOf": [{ "$ref": "#/$defs/slug" }, { "type": "null" }] }, "result": { "enum": ["completed", "approved", "closed", "abandoned"] }, "profile": { "enum": ["implementation", "validation-only", "governance-only"] }, "risk_level": { "enum": ["L1", "L2", "L3", "L4"] }, "change_types": { "type": "array", "items": { "type": "string" } }, "quality_baseline_snapshot": { "$ref": "#/$defs/hex" }, "quality_baseline_status": { "enum": ["complete", "limited"] }, "organization_policies": { "$ref": "#/$defs/stringMap" }, "policy_exceptions": { "type": "array", "items": { "$ref": "#/$defs/slug" } }, "contracts": { "type": "array", "items": { "$ref": "#/$defs/slug" } }, "requirements": { "$ref": "#/$defs/requirements" }, "parent": { "oneOf": [{ "$ref": "#/$defs/slug" }, { "type": "null" }] }, "skills": { "type": "array", "items": { "$ref": "#/$defs/slug" } }, "expansions": { "type": "array", "items": { "type": "object" } }, "validation": { "enum": ["passed", "pending", "failed", "blocked"] }, "release_decision": { "enum": ["ready", "pending", "blocked", "awaiting_approval"] }, "record": { "type": "string" }, "details": { "type": ["string", "null"] }, "closed_at": { "type": "string" } }, "additionalProperties": false } } }