From 018da00b748ab9f99b0f7b9246004c5fdda31a01 Mon Sep 17 00:00:00 2001 From: Claude Opus 5 Date: Tue, 8 Sep 2026 13:16:47 +0200 Subject: [PATCH] ARCH-02: show the mutation evidence, not the tool's own docstring The mutation battery printed every line of the harness's output starting with a warning sign, and the harness's header is four paragraphs of them - so each mutation's evidence arrived buried under "THIS TOOL RUNS THE REAL Controller" repeated six times, and each finding appeared once per transition leg plus once in the summary. The filter now matches a finding's KIND and de-duplicates, so what part 3 prints is the set of distinct findings the mutation caused. No behaviour change: the same six mutations go red for the same reasons. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01BwRLw7eKYj2byVdwB6kbjU --- goodwe_controller/test_rehearse.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/goodwe_controller/test_rehearse.py b/goodwe_controller/test_rehearse.py index 7114a3c..e919e57 100644 --- a/goodwe_controller/test_rehearse.py +++ b/goodwe_controller/test_rehearse.py @@ -283,9 +283,18 @@ for mid, control, what, edits, must_say in MUTATIONS: print() print(f" --- {mid} ({control}) {what}") print(f" exit {code} (0=clean 1=finding 2=could-not-run)") + # ⚠️ THE FINDINGS, DE-DUPLICATED AND IN ORDER. The tool prints each finding + # once per transition leg and once more in its summary, and its own header + # is full of ⚠️ paragraphs - printing every line that starts with one would + # bury the evidence this part exists to show under the tool's docstring. + seen = [] for line in out.splitlines(): - if line.strip().startswith("⚠️ "): - print(f" {line.strip()[:150]}") + text = line.strip() + if text.startswith("⚠️ ") and re.match(r"⚠️ [A-Z][A-Z -]+[A-Z()]:", text): + if text not in seen: + seen.append(text) + for text in seen: + print(f" {text[:160]}") check(f"{mid} turns {control} RED", red) check(f"{mid} says WHY, and it is the right why: {must_say!r}", named) shutil.rmtree(Path(tree).parent, ignore_errors=True)