Answer stability round 1: 0 🔴, 1 🟡 (0 misread); print each round's opening line, not a label read off it, and sort the allowlist entries
This commit is contained in:
@@ -3,12 +3,16 @@ import collections
|
||||
import json
|
||||
import pathlib
|
||||
import re
|
||||
import sys
|
||||
|
||||
ARCHIVE = pathlib.Path.home() / ".claude/loop-claude-transcripts"
|
||||
# The count recorded in README.md and docs/decisions.md read the reports that began before this; later ones would change it.
|
||||
UNTIL = "2026-11-12T10:50:00Z"
|
||||
# A line that opens a 🔴 or 🟡 finding, after any list, number or heading marks.
|
||||
FINDING = re.compile(r"^\s*(?:[-*]\s*|\d+\.\s*|#+\s*)*(?:\*\*)?(🔴|🟡)")
|
||||
# Wording of a finding that names a surviving mutant or a failing test. It casts wide; the hand reading decides.
|
||||
MECHANICAL = re.compile(r"surviv|mutant|fail(s|ing|ed)? (test|on)|test (fails|failed|failing)|tests? (still )?fail|\bred\b|suite (is red|fails)", re.I)
|
||||
# A report whose verdict line, at the start of a line, says BLOCK. A verdict stated mid-sentence isn't counted, so each printed round shows its opening line too.
|
||||
BLOCK = re.compile(r"^\W*(Verdict:?\s*)?\**BLOCK", re.M)
|
||||
|
||||
|
||||
@@ -48,16 +52,19 @@ def rounds() -> list[dict]:
|
||||
"at": entries[0].get("timestamp", "") if entries else "",
|
||||
"round": int(number.group(1)) if number else 0,
|
||||
"block": bool(BLOCK.search(last)),
|
||||
"opens": last.strip().split("\n")[0][:120],
|
||||
"findings": [line.strip() for line in last.splitlines() if FINDING.match(line)],
|
||||
})
|
||||
return found
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Print the totals, then each round of 2 or later whose round before reported a 🔴 and whose every 🔴 and 🟡 line reads as mechanical."""
|
||||
every = rounds()
|
||||
"""Print the totals, then each report of round 2 or later where the report before it, in the same cycle, held a 🔴 and every 🔴 and 🟡 line of that report before reads as mechanical."""
|
||||
if not ARCHIVE.is_dir():
|
||||
sys.exit(f"No archive at {ARCHIVE}: the count reads loop-claude's transcripts on the machine that ran them.")
|
||||
every = [run for run in rounds() if run["at"] < UNTIL]
|
||||
later = [run for run in every if run["round"] >= 2]
|
||||
print(f"{len(later)} reports of round 2 or later, {sum(run['block'] for run in later)} opening with BLOCK, from {len({run['project'] for run in every})} projects")
|
||||
print(f"{len(later)} reports of round 2 or later, {sum(run['block'] for run in later)} opening with BLOCK, from {len({run['project'] for run in later})} projects")
|
||||
by_cycle = collections.defaultdict(list)
|
||||
for run in every:
|
||||
by_cycle[(run["project"], run["cycle"])].append(run)
|
||||
@@ -66,7 +73,7 @@ def main() -> None:
|
||||
for before, run in zip(runs, runs[1:]):
|
||||
reds = [line for line in before["findings"] if "🔴" in line[:12]]
|
||||
if run["round"] >= 2 and reds and all(MECHANICAL.search(line) for line in before["findings"]):
|
||||
print(f"\n{run['project']} {run['at'][:16]} round {run['round']}: {'BLOCK' if run['block'] else 'approved'}")
|
||||
print(f"\n{run['project']} {run['at'][:16]} round {run['round']}, opening: {run['opens']}")
|
||||
for line in before["findings"]:
|
||||
print(f" before: {line[:300]}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user