Skip to content

v1.10.0 — rank audit.py's candidates so the real ones read first

Choose a tag to compare

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

v1.9.1 cut the four candidate generators down to what they should report. That fixed over-reporting, not reading order: a candidate list is still read top to bottom in the order audit.py emitted it, and the one that matters is as likely to sit last as first.

scripts/triage.py is an optional step over exactly those candidates. It asks one bounded question per candidate — is this the real thing, or one of the exempt shapes the protocol names in prose — and sorts them into keep / uncertain / suppressed:

python3 scripts/triage.py docs/features/<slug>/ [--checks 4,8] [--json]

--checks defaults to 4,8; 3 and 13 are opt-in. --keep (0.70) and --drop (0.30) are the thresholds.

What it deliberately does not do. It writes no finding and assigns no severity — audit.py owns ## Findings, and every one of them cites a concrete mismatch. A probability is triage, never a verdict. It hides nothing: suppressed candidates are printed too, because a list nobody is told to read rebuilds the silent-skip failure REQUIRES A HUMAN PASS exists to close, one level down. And it re-derives nothing — it imports audit.py, so the candidate text a reader sees is the same object the audit printed, by construction. A check implemented twice is the defect this skill exists to prevent; a candidate described twice is the same defect wearing a different hat.

Ranking is a layer, never a dependency. With no typesafe-sdk and no API key, the run prints the same candidates unranked:

# triage — candidates, unranked

Ranking unavailable — this machine is missing a TypeSafe API key. `audit.py` runs
offline and so does the human pass, so the candidates below are complete.
...
Nothing is missing from the list below — `audit.py` computed it offline and ranking
only reorders it. Candidates in its order:

  check 4
      · 01-master-plan.md:5: names doc `04`, which `_facts.yml docs[]` does not list
      · 01-master-plan.md:10: §2.9 is unqualified, so it reads as local to `01`, where
        no such section exists — it resolves in `02` instead

That is a complete answer, not a degraded one. audit.py is python3 + PyYAML and computes the candidates before any call is made, so what is lost with no key is reading order — not a check, not a finding, not coverage. Offline is this skill's baseline; the model sits on top of it.

Three exits, three meanings. --no-model takes the offline path deliberately and exits 0. --require-model exits 2 rather than fall back, for a caller that needs to know ranking did not happen. --check-setup exits 1 reporting what is installed and what is missing — both gaps at once, so a machine missing both is told both once instead of round the loop twice. Nothing reads the key's value into a message, only whether it was found and from which source.

The split between script and model is fixed: counting, arithmetic, dates, path resolution and line ranges stay in code permanently, and audit.py already settles all of them. The model is only ever asked the one thing a regex cannot — whether a reader would follow this ref, whether this fence describes an interface the system owns.