#!/usr/bin/env python3 """kb-rank-lint: fail when rank or effort guidance outside the generated block cites a bench. Owner, 11-19: "Those are synthetic tests. I wouldn't use synthetic tests as the guidance... It's everyday work." A laptop bench finding was relayed as routing guidance through a hand-written ranking on a KB page. The ranking now lives only in the block render-kb-block writes between the rstack:leaderboard markers. Outside it, a line that gives rank, preference, effort or routing guidance AND cites a bench, plant, synthetic, known-answer or smoke-test source is reported. A line that says such a source never ranks is not guidance. kb-rank-lint PAGE.md [...] exit 1 and list file:line for each finding; 0 when clean """ import re import sys from pathlib import Path BEGIN, END = '', '' GUIDANCE = re.compile(r'\b(rank(s|ed|ing)?|prefer(s|red)?|effort|switch(es|ed)?|rout(e|es|ed|ing)|' r'demote[sd]?|promote[sd]?)\b', re.I) # Our own bench, not a public benchmark: a standalone "bench" (Terminal-Bench, SEC-bench and BioBasicsBench are # names of public benchmarks reported from elsewhere), planted claims, synthetic, known-answer or smoke tests. SOURCE = re.compile(r'(?