Implement credentialed live hardening workplan

This commit is contained in:
2026-05-19 03:51:51 +02:00
parent b85f4c02f4
commit 1ccbab5c04
14 changed files with 906 additions and 37 deletions

View File

@@ -0,0 +1,29 @@
from phase_memory.troubleshooting import (
TROUBLESHOOTING_REQUIRED_CATEGORIES,
operator_troubleshooting_matrix,
validate_operator_troubleshooting_matrix,
)
def test_operator_troubleshooting_matrix_covers_required_categories() -> None:
matrix = operator_troubleshooting_matrix()
validation = validate_operator_troubleshooting_matrix(matrix)
categories = {row["category"] for row in matrix["rows"]}
assert set(TROUBLESHOOTING_REQUIRED_CATEGORIES) <= categories
assert validation["valid"] is True
assert validation["diagnostics"] == []
def test_operator_troubleshooting_matrix_validation_reports_missing_fields() -> None:
matrix = {
"schema_version": "phase_memory.operator_troubleshooting.v1",
"rows": [{"category": "credentials", "diagnostic_code": "credential_env_missing"}],
}
validation = validate_operator_troubleshooting_matrix(matrix)
codes = {diagnostic["code"] for diagnostic in validation["diagnostics"]}
assert validation["valid"] is False
assert "troubleshooting_matrix_missing_category" in codes
assert "troubleshooting_matrix_missing_field" in codes