Skip to content

v1.10.1 — cover triage.py's offline half, the one that has to hold

Choose a tag to compare

@CesarRivasP CesarRivasP released this 21 Sep 18:02
· 116 commits to main since this release

v1.10.0 shipped scripts/triage.py with no test. The repo has one for audit.py and one for render.py, and the omission was worst exactly here: the script's central claim is that ranking is a layer and never a dependency — that with no SDK and no key the run still prints a complete list — and that path was the untested one.

tests/test_triage.py, eight checks, none of which makes a call:

  • collect() reproduces audit.py's candidate list exactly. Compared as sequences, both ways, against the report audit.py prints — parsed out of that report rather than imported, because importing the generators would compare triage.py against itself and prove nothing. A candidate audit.py found and collect() missed is a check silently narrowed; one collect() invented is a candidate no auditor reading the report would ever see. Order is part of it: the fallback's whole promise is that it prints the list in audit.py's order.
  • The fallback prints every candidate computed. suppressed is a heading, not a filter.
  • --keep and --drop are inclusive at the boundary, and an unanswered candidate is uncertain rather than suppressed. The buckets are not symmetric in consequence: one that slides out of keep loses its place at the top, and one that slides into suppressed is the one a reader skips last.
  • 0, 1 and 2 stay distinguishable. A CI step that treats any non-zero as one case cannot tell "this machine has no ranking" from "I asked for ranking and did not get it". --check-setup exits 1 naming both gaps; --require-model exits 2 and prints no list.
  • Every generator reaches a question, check 8's fence and URL shapes get different ones, and an unknown check raises instead of ranking at 0.5.
  • line_at returns nothing out of range rather than a neighbouring line. Counting is the one thing the model is documented to get wrong, which is why the candidate's line is quoted verbatim; a helper that silently returned a neighbour would put that failure back, confidently.
  • A directory with no _facts.yml, an unknown --checks, and --drop above --keep are all refused rather than reported as a clean set.

Setup is probed with HOME redirected to an empty directory: a test whose result depends on whether the machine running it happens to have a key configured is not a test.

Every check was verified to fail against a mutation of the behaviour it covers. Two did not, on the first pass, and one of those was the test's fault — the check 8 comparison held whole question dicts against each other, and those differ either way because they embed the candidate's own what, so it would have passed even with both shapes routed to the same question. It now compares the question text alone.

A check that raises now reports as a failure instead of taking the suite down with it: seven results and a traceback is the same silent-skip shape this script exists to close.

Ranking itself is not exercised — a test that needs a key is a test that does not run. 179/179 · 2/2 · 8/8.