diff --git a/bin/loop_claude/cycle/judge.py b/bin/loop_claude/cycle/judge.py index 8e62889b..d20f6457 100644 --- a/bin/loop_claude/cycle/judge.py +++ b/bin/loop_claude/cycle/judge.py @@ -94,4 +94,10 @@ def verdict_from(output) -> Verdict | Failure: def grounded(verdict, transcript) -> bool: - return verdict.evidence.strip() != "" and verdict.evidence in transcript + evidence = plain(verdict.evidence) + return evidence != "" and evidence in plain(transcript) + + +def plain(text) -> str: + # The judge drops markdown emphasis and reflows whitespace when it quotes. + return " ".join(text.replace("*", "").replace("_", "").split()) diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index 0e24e76a..c15b17d0 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -104,6 +104,10 @@ class Grounded(unittest.TestCase): self.assertFalse(judge.grounded(verdict("invented"), "the transcript")) self.assertFalse(judge.grounded(verdict(""), "the transcript")) self.assertFalse(judge.grounded(verdict(" "), "the transcript")) + transcript = "done.\n\n**Your step:**\n```\n./run.sh\n```\nRun it." + self.assertTrue(judge.grounded(verdict("Your step:\n```\n./run.sh\n```\nRun it."), transcript)) + self.assertTrue(judge.grounded(verdict("Your step: ``` ./run.sh ``` Run it."), transcript)) + self.assertFalse(judge.grounded(verdict("**"), transcript)) class Verdict(unittest.TestCase): diff --git a/todo.md b/todo.md index 55298fc2..f0e52a15 100644 --- a/todo.md +++ b/todo.md @@ -6,7 +6,6 @@ The sketches, the judges' verdicts and what to take from each: `~/code/claude-handoffs/claude-config_2026-09-28.md`. -- **Match the judge's quote in `grounded()` with markdown emphasis and whitespace ignored, as main's #155 does.** The judge drops a bold line's closing `**` when it quotes the line. `rebuild` rejects such a quote, so merging `rebuild` into main would bring back loops that stop on a correct verdict. - **Bring `rebuild` to the comprehension floor on the four-seat panel, and open its PR into main for the human.** Every dimension and the overall must reach 7.0, and none may fall below the last run. A dimension under the floor gets its places filed above this item. ⚠️ Leave the PR ready and unmerged: only the human merges it, after approving the whole rebuild. The PR deletes main's `AGENTS.md` paragraph on a rebuild chunk's larv-review, which only main holds. ## 0.2.0