diff --git a/CLAUDE.md b/CLAUDE.md index 5112a648..135dd880 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -161,8 +161,18 @@ something, not only sessions that touch `documentation/` — which is why it is ```bash T=$(curl -s -u "$U:$P" ".../actions/jobs?limit=1" | python3 -c 'import json,sys;print(json.load(sys.stdin)["total_count"])') - curl -s -u "$U:$P" ".../actions/jobs?limit=50&page=$(( T/50 + 1 ))" # then grep your own head_sha + for pg in $(seq 1 $(( (T+49)/50 ))); do curl -s -u "$U:$P" ".../actions/jobs?limit=50&page=$pg"; done + # then match your own head_sha across ALL of them ``` + **Two things this recipe got wrong until 2026-09-20, both measured the hard way:** + 1. **The response key is `jobs`, not `workflow_runs`.** A parser reading `workflow_runs` gets an + empty list and prints nothing — which reads exactly like "no CI run for this commit" and is not. + That is R-417's own shape (a field the API never populates) committed while checking R-417. + 2. **Job ids are NOT ordered within a page**, so `page = total/50 + 1` does not hold the newest + rows — a run can sit several pages earlier. **Scan every page** and match on `head_sha`; with a + few hundred jobs that is a handful of requests. Guessing the page produced three consecutive + false "no CI job for this commit" readings in one session. + An unchecked green is an assumption, not an observation — and so is a green read off a field the API never populates.