ci: harden cto-review.yml severity KeyError (v0.18.3)

QA (seq 43) identified a content-triggered KeyError in the CTO-Review
postprocessor: when a model returns a concerns[] item without a 'severity'
key, line 454 crashed with KeyError instead of degrading.

  sev = c[severity].upper()        # before — hard KeyError
  sev = c.get("severity", "UNKNOWN").upper()  # after — degrades gracefully

The JSON schema marks severity as required but the postprocessor does not
enforce it — a model deviating on a large diff (91K bytes for f10e177 vs
41K for 02e9aab) triggered the crash. The fix surfaces UNKNOWN-severity
concerns rather than killing the check.

No other workflow changes.

Agent-Session: prab-v0183-20260612
This commit is contained in:
peptiderepo
2026-06-12 03:52:15 +00:00
committed by peptiderepo
parent dd1c38b6cf
commit 87020736ef

View File

@@ -451,7 +451,7 @@ jobs:
if rev.get("concerns"):
lines.append("**Concerns:**")
for c in rev["concerns"]:
sev = c["severity"].upper()
sev = c.get("severity", "UNKNOWN").upper()
f = f"`{c['file']}`" if c.get("file") else ""
lines.append(f"- **{sev}** {f} — {c['issue']}")
lines.append("")