fix(gate): close the gaps in the plan-code guard, the button lists and the tooling

- planCodes: the quote and slash lookarounds let the commonest form through (a docstring or test
  title opening with a code, a slash pair); the two real exceptions (an episode titled "E1", ruff's
  E4/E7/E9) are now named and cut first, with cases that fail on the old pattern. audit_metrics
  counts by the same definition.
- button-primitive: both file lists live in the rule body, out of sight of the snapshot and the
  register; each is now pinned to its exact set of ui/ files (red when either is widened).
- check.sh --brief shows a short log whole and keeps the line before each hit, so ruff's rule and
  eslint's file path survive the excerpt.
- lint-changed runs prettier over every changed frontend file, as the gate does, not only code.
- CLAUDE.md and gates.md no longer claim the basedpyright baseline was found harmless: it was never
  triaged, and the reportOptional* entries are the likeliest real bugs.
This commit is contained in:
2026-10-05 00:19:50 +02:00
parent eecc195b7e
commit d1bbe4524c
10 changed files with 137 additions and 33 deletions
+16 -9
View File
@@ -48,16 +48,23 @@ lane() { # lane <name> <command…> — run it, remember a failure, never stop
fi
rm -f "$out"
}
# The lines that say what broke: the first 20 error-looking ones, each with the two lines after it
# (knip names the file on the line after "Unused files"); a log with none of them (a tool that
# words its failures some other way) shows its tail instead, which is where a summary sits. The test
# database's own log is left out: the DB lane provokes constraint errors on purpose, and its
# `ERROR:` lines filled the excerpt ahead of the failing test.
# What broke, in a log's own words. A short log is shown whole: a keyword filter keeps ruff's
# summary line and drops the rule and file above it, and eslint's file path sits on a line of its
# own above its errors. A long one shows its first 20 error-looking lines, each with the line before
# it and the two after (knip names the file on the line after "Unused files"); a long log with none
# of them shows its tail, which is where a summary sits. The test database's own log is left out:
# the DB lane provokes constraint errors on purpose, and its `ERROR:` lines filled the excerpt ahead
# of the failing test.
brief_excerpt() {
local hits
hits="$(grep -v -E '^testdb-[0-9]+ ' "$1" |
grep -E -i -A 2 -m 20 'error|fail|✗|×|warn|would reformat|unused|vulnerab|found [0-9]')"
if [ -n "$hits" ]; then printf '%s\n' "$hits"; else tail -n 20 "$1"; fi
local log hits
log="$(grep -v -E '^testdb-[0-9]+ ' "$1")"
if [ "$(printf '%s\n' "$log" | wc -l)" -le 60 ]; then
printf '%s\n' "$log"
return
fi
hits="$(printf '%s\n' "$log" |
grep -E -i -B 1 -A 2 -m 20 'error|fail|✗|×|warn|would reformat|unused|vulnerab|found [0-9]')"
if [ -n "$hits" ]; then printf '%s\n' "$hits"; else printf '%s\n' "$log" | tail -n 20; fi
}
# --- static lanes ------------------------------------------------------------------------------------