From d78a8b7ee8c03453eea4d01b497e6a241f4474fa Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 11 Sep 2026 13:57:39 +0200 Subject: [PATCH] chore: mdm_pass check reports sections that say nothing A section that promises an answer and then says 'No presentation details are available' is worse than a missing one. Reported rather than refused: a one-line prognosis is often the whole honest answer, so the length alone cannot decide it. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01TqXevQJhxFrM7jJg82cgZN --- backend/scripts/mdm_pass.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/scripts/mdm_pass.py b/backend/scripts/mdm_pass.py index 046604b..1a448c5 100644 --- a/backend/scripts/mdm_pass.py +++ b/backend/scripts/mdm_pass.py @@ -257,12 +257,24 @@ def cmd_check(args) -> int: print(f" in medical-decision-making shape: {len(good)}") print(f" still free-form : {len(with_clinical) - len(good)}") if len(good) < len(with_clinical): - from collections import Counter titles = Counter(s.get("title") for a in with_clinical if not conforms(a) for s in clinical_of(a)) print("\n commonest titles still in use:") for title, count in titles.most_common(8): print(f" {count:4d} {title}") + + # A section that says nothing is worse than a missing one: the shape + # promises an answer and then does not give it. Reported so an editor + # can find them, not refused — a one-line prognosis is often the whole + # honest answer. + placeholder = re.compile(r"^(no |none|not available|not specified|unavailable)", re.I) + thin = [(a.title, s["title"], (s.get("content") or "").strip()) + for a in good for s in clinical_of(a) + if placeholder.match((s.get("content") or "").strip())] + if thin: + print(f"\n sections with nothing in them ({len(thin)}) — for an editor:") + for title, section, body in thin[:12]: + print(f" {title} / {section}: {body[:60]}") finally: db.close() return 0