feat: implement institutional governance and recovery architecture
This commit is contained in:
@@ -28,6 +28,8 @@ from govoplan_release.version_alignment import candidate_catalog_version_issues
|
||||
from .evidence import (
|
||||
BoundaryEvidenceReview,
|
||||
InstalledEvidenceReview,
|
||||
PROOF_REQUIREMENTS,
|
||||
REFERENCE_READINESS_SCOPES,
|
||||
public_key_material_from_keyrings,
|
||||
review_boundary_evidence,
|
||||
review_installed_composition,
|
||||
@@ -929,9 +931,8 @@ def build_report(
|
||||
boundary_review.proof_scope
|
||||
if boundary_review is not None
|
||||
else {
|
||||
"target_environment": {"checked": False, "valid": None},
|
||||
"external_providers": {"checked": False, "valid": None},
|
||||
"production_approval": {"checked": False, "valid": None},
|
||||
scope: {"checked": False, "valid": None}
|
||||
for scope in PROOF_REQUIREMENTS
|
||||
}
|
||||
)
|
||||
proof_scope = {
|
||||
@@ -961,6 +962,24 @@ def build_report(
|
||||
**installed_scope,
|
||||
**boundary_scope,
|
||||
}
|
||||
missing_readiness = tuple(
|
||||
scope
|
||||
for scope in REFERENCE_READINESS_SCOPES
|
||||
if proof_scope.get(scope, {}).get("checked") is not True
|
||||
)
|
||||
failed_readiness = tuple(
|
||||
scope
|
||||
for scope in REFERENCE_READINESS_SCOPES
|
||||
if proof_scope.get(scope, {}).get("checked") is True
|
||||
and proof_scope.get(scope, {}).get("valid") is not True
|
||||
)
|
||||
proof_scope["reference_readiness"] = {
|
||||
"checked": not missing_readiness,
|
||||
"valid": not missing_readiness and not failed_readiness,
|
||||
"required_scopes": list(REFERENCE_READINESS_SCOPES),
|
||||
"missing_scopes": list(missing_readiness),
|
||||
"failed_scopes": list(failed_readiness),
|
||||
}
|
||||
return {
|
||||
"report_version": "0.5.0",
|
||||
"status": status,
|
||||
@@ -1043,9 +1062,8 @@ def render_review(report: dict[str, Any]) -> str:
|
||||
unchecked_boundaries = [
|
||||
label
|
||||
for key, label in (
|
||||
("target_environment", "target-environment"),
|
||||
("external_providers", "external-provider"),
|
||||
("production_approval", "production-approval"),
|
||||
(scope, scope.replace("_", "-"))
|
||||
for scope in PROOF_REQUIREMENTS
|
||||
)
|
||||
if report.get("proof_scope", {}).get(key, {}).get("checked") is not True
|
||||
]
|
||||
@@ -1057,6 +1075,18 @@ def render_review(report: dict[str, Any]) -> str:
|
||||
)
|
||||
if unchecked_boundaries:
|
||||
lines.append("No " + ", ".join(unchecked_boundaries) + " proof was performed.")
|
||||
readiness = report.get("proof_scope", {}).get("reference_readiness", {})
|
||||
if readiness.get("valid") is True:
|
||||
lines.append("Reference-readiness evidence gate: passed.")
|
||||
else:
|
||||
unresolved = [
|
||||
*readiness.get("missing_scopes", []),
|
||||
*readiness.get("failed_scopes", []),
|
||||
]
|
||||
lines.append(
|
||||
"Reference-readiness evidence gate: not established"
|
||||
+ (f" ({', '.join(dict.fromkeys(unresolved))})." if unresolved else ".")
|
||||
)
|
||||
return "\n".join(lines) + "\n"
|
||||
|
||||
|
||||
|
||||
@@ -57,11 +57,21 @@ SHA256_PATTERN = re.compile(r"^[0-9a-f]{64}$")
|
||||
POSITIVE_RESULTS = {
|
||||
"target_environment": "passed",
|
||||
"external_providers": "passed",
|
||||
"accessibility": "passed",
|
||||
"privacy": "passed",
|
||||
"security": "passed",
|
||||
"operations": "passed",
|
||||
"recovery": "passed",
|
||||
"production_approval": "approved",
|
||||
}
|
||||
NEGATIVE_RESULTS = {
|
||||
"target_environment": "failed",
|
||||
"external_providers": "failed",
|
||||
"accessibility": "failed",
|
||||
"privacy": "failed",
|
||||
"security": "failed",
|
||||
"operations": "failed",
|
||||
"recovery": "failed",
|
||||
"production_approval": "rejected",
|
||||
}
|
||||
PROOF_REQUIREMENTS = {
|
||||
@@ -75,12 +85,45 @@ PROOF_REQUIREMENTS = {
|
||||
"An independently trusted authority key permitted for external_providers proof.",
|
||||
"Opaque control IDs and content hashes; credentials and endpoint identifiers stay outside the report.",
|
||||
),
|
||||
"accessibility": (
|
||||
"Accessibility conformance results for the assessed journeys, viewports, keyboard paths, and assistive-technology profile.",
|
||||
"An independently trusted authority key permitted for accessibility proof.",
|
||||
"Opaque control IDs and content hashes for the sanitized conformance artifacts.",
|
||||
),
|
||||
"privacy": (
|
||||
"Privacy and data-protection controls evaluated against the exact assessed composition and target profile.",
|
||||
"An independently trusted authority key permitted for privacy proof.",
|
||||
"Opaque control IDs and content hashes for the sanitized review artifacts.",
|
||||
),
|
||||
"security": (
|
||||
"Security controls, scans, and bounded verification results for the exact release and target profile.",
|
||||
"An independently trusted authority key permitted for security proof.",
|
||||
"Opaque control IDs and content hashes for sanitized findings and attestations.",
|
||||
),
|
||||
"operations": (
|
||||
"Operator procedures, health checks, monitoring, alerting, and failure-response exercises for the target profile.",
|
||||
"An independently trusted authority key permitted for operations proof.",
|
||||
"Opaque control IDs and content hashes for sanitized run evidence.",
|
||||
),
|
||||
"recovery": (
|
||||
"A completed backup, restore, rollback, and reconciliation drill bound to the exact release and target profile.",
|
||||
"An independently trusted authority key permitted for recovery proof.",
|
||||
"Opaque control IDs and content hashes for drill outcomes and recovery-point/time observations.",
|
||||
),
|
||||
"production_approval": (
|
||||
"An explicit approval bound to this assessment release and installed evidence whose release origin is independently anchored.",
|
||||
"An independently provisioned authority key permitted for production_approval.",
|
||||
"An unexpired signed proof bundle; an assessment or operator cannot approve itself.",
|
||||
),
|
||||
}
|
||||
REFERENCE_READINESS_SCOPES = (
|
||||
"target_environment",
|
||||
"accessibility",
|
||||
"privacy",
|
||||
"security",
|
||||
"operations",
|
||||
"recovery",
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
@@ -1427,6 +1470,11 @@ def review_boundary_evidence(
|
||||
expected_subjects = {
|
||||
"target_environment": deployment_subject,
|
||||
"external_providers": provider_subject,
|
||||
"accessibility": deployment_subject,
|
||||
"privacy": deployment_subject,
|
||||
"security": deployment_subject,
|
||||
"operations": deployment_subject,
|
||||
"recovery": deployment_subject,
|
||||
"production_approval": deployment_subject,
|
||||
}
|
||||
scopes = _unchecked_boundary_scope(expected_subjects=expected_subjects)
|
||||
|
||||
Reference in New Issue
Block a user