fix(governance): enforce P2-105 redaction guard
All checks were successful
Code Review / ai-code-review (push) Successful in 21s
CD Pipeline / tests (push) Successful in 1m50s
CD Pipeline / build-and-deploy (push) Successful in 6m31s
CD Pipeline / post-deploy-checks (push) Successful in 2m44s

This commit is contained in:
Your Name
2026-06-13 02:02:16 +08:00
parent f71c2779a8
commit a9b95f99eb
3 changed files with 45 additions and 1 deletions

View File

@@ -112,6 +112,16 @@ def test_rejects_candidate_route_write(tmp_path):
load_latest_ai_agent_critic_reviewer_result_capture(tmp_path)
def test_rejects_forbidden_display_terms(tmp_path):
data = load_latest_ai_agent_critic_reviewer_result_capture()
bad = copy.deepcopy(data)
bad["agent_scorecards"][0]["failure_if_missing"] = "不得顯示工作視窗對話內容"
_write_snapshot(tmp_path, bad)
with pytest.raises(ValueError, match="forbidden display terms"):
load_latest_ai_agent_critic_reviewer_result_capture(tmp_path)
def test_rejects_rollup_mismatch(tmp_path):
data = load_latest_ai_agent_critic_reviewer_result_capture()
bad = copy.deepcopy(data)