{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "urn:awoooi:source-control-primary-rollback-adr-v1", "title": "Source Control Primary Rollback ADR v1", "description": "定義 GitHub primary cutover 前必備的 rollback ADR 草案、回退觸發條件、逐 repo owner review 與仍然禁止事項。此契約不授權 primary switch、refs sync 或 repo 修改。", "type": "object", "required": [ "schema_version", "status", "date", "mode", "runtime_execution_authorized", "source_indexes", "summary", "rollback_principles", "cutover_preconditions", "repo_rollback_plans", "rollback_triggers", "validation_windows", "acceptance_rules", "forbidden_actions" ], "properties": { "schema_version": { "const": "source_control_primary_rollback_adr_v1" }, "status": { "type": "string", "enum": ["draft_waiting_owner_review"] }, "date": { "type": "string" }, "mode": { "type": "string", "enum": ["rollback_adr_only"] }, "runtime_execution_authorized": { "type": "boolean", "const": false }, "source_indexes": { "type": "array", "items": {"type": "string"}, "minItems": 1 }, "summary": { "type": "object", "required": [ "candidate_repo_count", "in_scope_repo_count", "external_scope_count", "repo_rollback_plan_count", "owner_approved_count", "dry_run_completed_count", "active_cutover_count", "rollback_execution_authorized", "github_primary_switch_authorized", "gitea_disable_authorized", "action_buttons_allowed" ], "properties": { "candidate_repo_count": {"type": "integer", "minimum": 0}, "in_scope_repo_count": {"type": "integer", "minimum": 0}, "external_scope_count": {"type": "integer", "minimum": 0}, "repo_rollback_plan_count": {"type": "integer", "minimum": 0}, "owner_approved_count": {"type": "integer", "minimum": 0}, "dry_run_completed_count": {"type": "integer", "minimum": 0}, "active_cutover_count": {"type": "integer", "minimum": 0}, "rollback_execution_authorized": {"type": "boolean", "const": false}, "github_primary_switch_authorized": {"type": "boolean", "const": false}, "gitea_disable_authorized": {"type": "boolean", "const": false}, "action_buttons_allowed": {"type": "boolean", "const": false} }, "additionalProperties": false }, "rollback_principles": { "type": "array", "items": {"type": "string"}, "minItems": 1 }, "cutover_preconditions": { "type": "array", "items": { "type": "object", "required": [ "gate_id", "title", "required_evidence", "current_status", "execution_authorized" ], "properties": { "gate_id": {"type": "string"}, "title": {"type": "string"}, "required_evidence": { "type": "array", "items": {"type": "string"}, "minItems": 1 }, "current_status": { "type": "string", "enum": ["missing", "draft_only", "waiting_owner_review", "blocked"] }, "execution_authorized": {"type": "boolean", "const": false} }, "additionalProperties": false }, "minItems": 1 }, "repo_rollback_plans": { "type": "array", "items": { "type": "object", "required": [ "repo_key", "github_repo", "source_key", "scope_status", "risk", "rollback_state", "primary_ready", "fallback_role", "required_owner_decisions", "rollback_evidence_required", "rollback_triggers", "manual_recovery_outline", "execution_authorized", "still_forbidden" ], "properties": { "repo_key": {"type": "string"}, "github_repo": {"type": "string"}, "source_key": {"type": "string"}, "scope_status": { "type": "string", "enum": ["in_scope", "external_scope_review"] }, "risk": { "type": "string", "enum": ["LOW", "MEDIUM", "HIGH"] }, "rollback_state": { "type": "string", "enum": [ "draft_waiting_owner_review", "scope_review_only" ] }, "primary_ready": {"type": "boolean", "const": false}, "fallback_role": {"type": "string"}, "required_owner_decisions": { "type": "array", "items": {"type": "string"} }, "rollback_evidence_required": { "type": "array", "items": {"type": "string"}, "minItems": 1 }, "rollback_triggers": { "type": "array", "items": {"type": "string"}, "minItems": 1 }, "manual_recovery_outline": { "type": "array", "items": {"type": "string"}, "minItems": 1 }, "execution_authorized": {"type": "boolean", "const": false}, "still_forbidden": { "type": "array", "items": {"type": "string"}, "minItems": 1 } }, "additionalProperties": false }, "minItems": 1 }, "rollback_triggers": { "type": "array", "items": {"type": "string"}, "minItems": 1 }, "validation_windows": { "type": "array", "items": { "type": "object", "required": [ "window_id", "title", "required_checks", "failure_handling", "execution_authorized" ], "properties": { "window_id": {"type": "string"}, "title": {"type": "string"}, "required_checks": { "type": "array", "items": {"type": "string"}, "minItems": 1 }, "failure_handling": {"type": "string"}, "execution_authorized": {"type": "boolean", "const": false} }, "additionalProperties": false }, "minItems": 1 }, "acceptance_rules": { "type": "array", "items": {"type": "string"}, "minItems": 1 }, "forbidden_actions": { "type": "array", "items": {"type": "string"}, "minItems": 1 } }, "additionalProperties": false }