Skip to content

fix(github): the audit reads each workflow's latest push or scheduled run from two queries, since GitHub sometimes serves a stale runs list - #536

Merged
DrunkOnJava merged 1 commit into
mainfrom
fix/audit-main-runs
Sep 30, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
fix/audit-main-runs

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

The maintainer audit's "latest run of every workflow on main" check (#534) read a stale answer from GitHub and reported a Fuzz failure that green scheduled runs had superseded. It now asks each workflow for its latest push or scheduled run with two differently shaped queries and takes the newest across both. Nothing in the crate, the CLIs or the viewer changes.

Motivation

The check listed actions/runs?branch=main&per_page=100 and took the first run per workflow name. GitHub serves that URL from a stale index some of the time. Three calls on 2026-09-30, minutes apart, returned three different snapshots: one whose newest Fuzz run was run 34030881111 (older than 09-07), one whose newest run of any workflow was from 09-24, and one whose newest was from 09-07 (total_count 762, where the per_page=10 and exclude_pull_requests forms of the same query say 1930), while gh run list --branch main showed runs from 16:02 the same day. The first audit run, in #534's description, therefore said ok; a later one reported Fuzz: failure on run 34030881111, when the newest Fuzz run (36684905190, scheduled, 2026-09-30 07:38) was green. A tool whose job is to say whether the repository is healthy cannot depend on a query that lies in either direction.

Changes

  • tools/maintainer/audit.py: for every active workflow, ask actions/workflows/<id>/runs with branch=main&exclude_pull_requests=true&per_page=20 and with status=completed added, merge the answers, and judge the newest run whose event is push or schedule and which has finished. A stale answer only hides newer runs, so the union is at least as fresh as the fresher answer. Manual runs (a Measure experiment) and dynamic ones (CodeQL, Dependabot) say nothing about main and are skipped; a workflow with no such run is not judged. A weekly workflow is now covered, which the 100-run window could not promise.
  • CHANGELOG.md: the audit's entry says how main is read and why.

Testing

No product code changes; the tool run against the live repository, and the check against crafted answers, are the evidence.

Against the live repository: python3 tools/maintainer/audit.py prints ok for all eleven checks and exits 0.

Against crafted API answers (a scratch script that replaces the tool's gh call; two answers per case, the first stale and the second fresh where it matters):

stale answer hides a newer failure, fresh one shows it     -> FAIL   Fuzz: failure
newest scheduled run failed                                -> FAIL   Fuzz: failure
failed then fixed: newest is a success                     -> ok
a manual run failed after a green scheduled one            -> ok
the newest run is still in progress: the last finished counts -> FAIL   Fuzz: failure
no push or scheduled run at all                            -> ok
  • Required checks pass on GitHub's runners
  • Run end to end against the live repository, output above

Audit-honesty checklist

  • The script is still read-only, and says skipped, not ok, when a call is refused
  • What is not established: that both queries are fresh at once. Of 33 per-workflow queries tried on 2026-09-30 (the plain, exclude_pull_requests and status=completed forms, eleven workflows each) one answer was stale, the plain form for Changelog; the other 32 agreed. Nothing rules out both of the tool's forms being stale together
  • No emojis, private paths or PII

Legal and contribution hygiene

  • Apache-2.0
  • No Autodesk content
  • No fixtures

Breaking changes

None.

Related issues

Follows #534.

… run from two queries, since GitHub sometimes serves a stale runs list

The main-branch check listed the newest 100 runs of `branch=main` and took the
first per workflow name. GitHub answers that URL from a stale index some of
the time: three calls on 2026-09-30, minutes apart, returned three different
snapshots, the freshest six days old, so the check passed once and then
reported a Fuzz failure that green scheduled runs had long superseded (the
newest Fuzz run was green).

Now each active workflow is asked twice, with differently shaped queries
(`exclude_pull_requests`, and that plus `status=completed`), and its newest
push or scheduled run across both counts. A stale answer only hides newer
runs, so the union is never staler than the fresher of the two. Manual and
dynamic runs (a Measure experiment, CodeQL, Dependabot) say nothing about
main and are skipped, and a workflow with no push or scheduled run is not
judged. Workflows that run rarely are covered too: the old check's
100-run window could not reach a weekly one.
@DrunkOnJava DrunkOnJava added area:github Work in the github area. priority:P2 Important quality, usability, or hardening work. type:bug Correctness defect or regression. labels Sep 30, 2026
@cursor

cursor Bot commented Sep 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_1a5b9e76-aa0d-49c2-aa7a-cbc3907f544b)

@DrunkOnJava
DrunkOnJava merged commit bbba184 into main Sep 30, 2026
23 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/audit-main-runs branch September 30, 2026 16:29
DrunkOnJava added a commit that referenced this pull request Sep 30, 2026
…t 0.4.11 (#535)

## Summary

Raises the minimum supported Rust version from 1.85 to 1.87 and takes the two dependency updates that floor was holding back: quick-xml 0.42 (#532) and earcut 0.4.11 (#531). The PartAtom reader is moved to quick-xml 0.42's `&str` API, and nine remainder checks become `is_multiple_of`, which clippy asks for once the MSRV allows it. Nothing else in the crate changes.

## Motivation

Both updates need a newer compiler than 1.85. quick-xml 0.42 declares `rust-version = 1.86` (its changelog: "The MSRV has been raised to 1.86"; crates.io agrees). earcut declares no `rust-version`, but from 0.4.10 it calls `is_multiple_of`, stable from Rust 1.87 (RELEASES.md, Version 1.87.0), which is why `Cargo.toml` held it below 0.4.10 and noted "Lift the bound with the MSRV". Dependabot's own bump of that bound (to `<0.4.12`, in #531) failed the MSRV job with `use of unstable library feature unsigned_is_multiple_of`, and #532 does not compile: quick-xml 0.42 changed names, text and entity references from `&[u8]` to `&str`.

Holding both indefinitely would leave the dependency graph frozen at whatever 1.85 allows. The cost of moving is small: `rvt` on crates.io has 25 downloads and no reverse dependencies (crates.io API, 2026-09-30), and Rust 1.87 was released on 2025-05-15.

## Changes

- `Cargo.toml`, `rvt-py/Cargo.toml`, `tools/stream_evidence/Cargo.toml`: `rust-version = "1.87"`. `earcut = "0.4.5"` (the upper bound is gone), `quick-xml = "0.42"`. The criterion comment that named the 1.85 floor no longer does.
- `Cargo.lock`, `fuzz/Cargo.lock`: earcut 0.4.11 and quick-xml 0.42.0. The checksums are the ones Dependabot wrote into the fuzz lock and equal the crates.io API's for both versions; the dependency lists are unchanged.
- `src/part_atom.rs`: `e.name().into_inner()` instead of `from_utf8_lossy(e.name().as_ref())`, `a.key.into_inner() == "scheme"` instead of a byte comparison, and text and entity references read through the events' `Deref<Target = str>` (`decode()` was removed). `normalized_value`, `resolve_char_ref` and `resolve_predefined_entity` keep their signatures, and an entity reference's content is still the bare name (`amp`), as quick-xml's own doc example for `BytesRef` shows.
- `src/elem_table.rs`, `src/element_record_plan_profiles.rs`, `src/geometry/recovery.rs`, `src/ifc/gltf.rs`, `src/native_saved_mesh.rs`, `src/transmission_data.rs`: nine `x % n == 0` checks on unsigned integers become `x.is_multiple_of(n)`, each exactly the replacement clippy's `manual_is_multiple_of` printed on this pull request's first run (the lint applies from `rust-version` 1.87; the divisors are non-zero literals, so `is_multiple_of` and `%` agree).
- `.github/workflows/ci.yml`: the MSRV job builds on 1.87, so its check name is now `build + real files / ubuntu-latest / 1.87` (not a required check).
- README, CONTRIBUTING, RELEASE, AGENTS, `docs/install.md`, `docs/python.md`, `docs/benchmarks.md`, `.cursor/install.sh`, the bug report form's placeholder and the witness crate's comment: 1.87.
- `docs/maintaining.md`: a section on how the MSRV moves and what to do with a Dependabot pull request that fails the MSRV job.
- `CHANGELOG.md`.

## Testing

No product logic changes; the evidence is the build and the measurements on the runners, taken at 3561238. The branch was then brought up to date with `main`, which added only the audit tool's fix (#536), a docs table (#537) and their changelog line, and its required checks ran again.

- [x] Every check passes at 3561238, required or not: the MSRV job on 1.87 (`build + real files / ubuntu-latest / 1.87`), macOS and Windows, the wheel, `cargo bench --no-run`, corpus tier 2, the writer patch corpus, the IfcOpenShell validator and the release-binary builds.
- [x] Measure, head 3561238 against `main` aefc29f, [run 36743387491](https://github.com/DrunkOnJava/rvt-rs/actions/runs/36743387491): the IFC is byte-identical on all six reference models (Core Interior, Einhoven, RE1 Architecture, Electrical, Mechanical, Plumbing), and so is every scorer output, about twenty per model. This says nothing about the PartAtom parser: the exporter reads only a `PartAtom` stream, and `diagnostics.json` shows `has_part_atom: false` on all six.
- [x] The parser is measured by #538's addition to Measure, which has `rvt-info --redact --json` read every model and every Autodesk family and diffs it. Run from that branch on this one (head 3561238 against `main` aefc29f, `families=true`, [run 36744354619](https://github.com/DrunkOnJava/rvt-rs/actions/runs/36744354619)): the output and the exit status (0) are identical on all 17 files. On the eleven families (2016 to 2026) that is a PartAtom read through the migrated code (title `0610 x 0915mm`, OmniClass `23.40.20.14.17`, two categories and two taxonomies, 3.4 to 4.2 KB of XML each); on the six project models it is their `ProjectInformation` stream, which goes through the same `PartAtom::from_bytes` (`document.title` and `last_saved` are the atom's `entry_title` and `updated`, and are set on all six).
- [x] Fuzz, `fuzz_part_atom` for 300 s on this branch at 3561238 ([run 36744743660](https://github.com/DrunkOnJava/rvt-rs/actions/runs/36744743660)): 14,137,919 executions of `PartAtom::from_bytes` under libFuzzer, no crash, timeout or out-of-memory. The same run builds the fuzz workspace on nightly against quick-xml 0.42 and earcut 0.4.11 in `fuzz/Cargo.lock`.

## Audit-honesty checklist

- [x] The MSRV, in the manifests, CI and docs, moves together; the changelog says `rvt` 0.4.0 on crates.io still declares 1.85
- [x] Not established here: PartAtom streams other than these seventeen files. The reader is given a `&str`, so quick-xml 0.42's new rejection of input that is not valid UTF-8 cannot happen from `PartAtom::from_bytes`, which already returns an error for invalid UTF-8
- [x] No emojis, private paths or PII

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk content
- [x] No fixtures

## Breaking changes

The minimum supported Rust version rises from 1.85 to 1.87. The next release notes carry it.

## Related issues

Supersedes the Dependabot pull request #532 (quick-xml 0.42) and the earcut part of #531.
DrunkOnJava added a commit that referenced this pull request Sep 30, 2026
…ks that Dependabot covers every lockfile

Main's health. #536 made the check read each workflow's latest run from two
differently shaped REST queries, on the reasoning that a stale answer only
hides newer runs. Within the hour the same Fuzz failure from 2026-09-06
came back: both queries of the pair were stale at once, and a minute later
every query shape was fresh. The REST runs list, filtered by branch, cannot
be trusted in any shape, so the check now reads the check suites of main's
last 100 commits through GraphQL, which reads the primary store: a workflow
run is attached to the commit that was main's head when it ran, and each
suite carries its event, status and conclusion. Only push and scheduled runs
count, a cancelled or skipped suite says nothing, and a workflow whose last
run is older than 100 commits is not judged. Checked against seven crafted
answers (a failure, a fix after it, a cancelled run after a failure, a
manual failure, an unfinished newest run, no runs, a GraphQL error) and the
live repository.

Dependabot's coverage. New check: every Cargo.lock, npm lockfile,
Dockerfile and composite action in the repository tree must be under an
update entry in .github/dependabot.yml, or be listed in the script as
deliberately unwatched (the witness crate's exact pin). Run against main
before #544 it named exactly the two gaps #544 closes, docker/Dockerfile and
.github/actions/fetch-corpus/action.yml.
DrunkOnJava added a commit that referenced this pull request Sep 30, 2026
… through GraphQL and checks Dependabot's coverage (#545)

## Summary

Adds `tools/maintainer/clean_caches.py`, which deletes the GitHub
Actions caches nobody can use again, and gives the audit (#534, #536)
three corrections and additions: its cache check adds up the list of
caches, its check of `main`'s health reads check suites through GraphQL,
and a new check that Dependabot watches every lockfile, Dockerfile and
composite action. Nothing in the crate, the CLIs or the viewer changes.

## Motivation

Three findings from running the audit on 2026-09-30.

**The cache was at 9.1 GB of the 10 GB limit, and most of it was dead.**
GitHub evicts the least recently used cache past the limit, so a cache
that sits near it leaves no room to see a real problem. The chore was a
scratch script the first time (1,195 caches of closed pull requests, in
#529); this keeps it, and finds what that script never looked for:
`main`'s own superseded generations. rust-cache saves a cache per
toolchain and lockfile hash, so every lockfile change (every Dependabot
merge) leaves the previous generation behind, never read again, at about
200 MB each for the larger families.

| | caches | size |
|---|---|---|
| before | 1,180 | 9.1 GB |
| closed pull requests and deleted branches | 220 | 0.45 GB |
| superseded rust-cache generations on `main` (up to eight per family) |
36 | 4.49 GB |
| after | 926 | 4.2 GB |

The audit read `actions/cache/usage`, which still said 9.1 GB for
minutes after the deletions, so it now adds up the list of caches.

**The REST runs list lied twice in an hour, and #536's fix did not
hold.** #536 had the check ask each workflow for its latest run with two
differently shaped queries, on the reasoning that a stale answer only
hides newer runs. Later the same `Fuzz: failure` from 2026-09-06 (run
34030881111) came back: both queries of the pair were stale at once, and
a minute afterwards every shape of the query was fresh again. A filtered
runs list cannot be trusted in any shape. Check suites read through
GraphQL (`repository.ref.target.history.nodes.checkSuites.workflowRun`)
come from the primary store; a run is attached to the commit that was
`main`'s head when it ran, and the suite carries its event, status and
conclusion.

**Dependabot skipped two things the repository pins.** #544 adds the
`docker` ecosystem for `docker/Dockerfile` and the composite action's
directory; it was found by listing the repository's manifests by hand.
The audit now does that listing.

## Changes

- `tools/maintainer/clean_caches.py`: lists the caches, the open pull
requests and the live branches, and deletes a cache if its ref is a pull
request that is not open, a branch that no longer exists, or a
rust-cache generation on `main` older than the newest two of its family
(`--keep N`). The caches of `main`'s newest generations, of live
branches, of open pull requests and of tags are kept. A dry run unless
given `--delete`, which paces the deletions and backs off on 429 and
403.
- `tools/maintainer/audit.py`: the cache check sums `actions/caches`;
`main_green` reads the check suites of `main`'s last 100 commits through
GraphQL (only push and scheduled runs, a cancelled or skipped suite says
nothing, and a workflow whose last run is older than 100 commits is not
judged); the new `dependabot_coverage` check lists every `Cargo.lock`,
npm lockfile, `Dockerfile` and composite action in the repository tree
and fails for each that is under no entry of `.github/dependabot.yml`,
except the witness crate's lockfile, which is pinned on purpose.
- `docs/maintaining.md`: the housekeeping items name the tool and the
coverage.
- `CHANGELOG.md`.

## Testing

No product code changes. The tools run against the live repository are
the evidence.

- [x] `clean_caches.py`, dry run: `1180 caches, 9.1 GB; 256 unusable
(4.9 GB), 4.2 GB kept`; with `--delete`: `deleted 256, already gone 0,
failed 0`; dry run after: `926 caches, 4.2 GB; 0 unusable (0.0 GB), 4.2
GB kept`
- [x] `main_green` against seven crafted GraphQL answers (scratch probe,
output below): a failed scheduled run fails; a failure fixed by a later
success is ok; a cancelled run after a failed one leaves the failure
standing; a manual failure is ignored; an unfinished newest run leaves
the failure before it standing; no runs is ok; a GraphQL error is
`skipped`
- [x] `dependabot_coverage` on `main` before #544: `FAIL
docker/Dockerfile (docker) is not in .github/dependabot.yml;
.github/actions/fetch-corpus/action.yml (github-actions) is not in
.github/dependabot.yml`, exactly the two gaps #544 closes
- [x] `python3 tools/maintainer/audit.py` on this branch brought up to
date with `main` (which has #544): `12 of 12 checks ok`, including the
GraphQL check of `main` and `ok Dependabot watches every lockfile,
Dockerfile and composite action, or the audit says why not`
- [x] Required checks pass on GitHub's runners (the merge waits for
them: auto-merge is armed on them)

```
newest scheduled run failed                                    -> FAIL    Fuzz: failure
failed then fixed: the newest is a success                     -> ok
a cancelled run after a failed one: the failure still counts   -> FAIL    CI: failure
a manual run failed: not main                                  -> ok
the newest run is still in progress: the failure before it counts -> FAIL    CI: failure
no runs at all                                                 -> ok
GraphQL answers with errors                                    -> skipped boom
```

## Audit-honesty checklist

- [x] What this does not establish: that GraphQL is never stale. It was
fresh in every call made today, and `gh pr checks` reads check suites
the same way, but nothing here proves it; if it ever lies, the check
will say something false in the same way
- [x] What this does not establish: that the two newest generations of a
cache family are always enough for a build to restore from. rust-cache
restores the newest cache that matches its key prefix, and the
generations kept are the most recently accessed, but a cold family can
lose its only cache to the next run; it rebuilds, which costs minutes,
not correctness
- [x] The cleaner is destructive only with `--delete`, and only for
caches GitHub would evict first anyway
- [x] No emojis, private paths or PII

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk content
- [x] No fixtures

## Breaking changes

None.

## Related issues

Follows #534, #536 and #544.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:github Work in the github area. priority:P2 Important quality, usability, or hardening work. type:bug Correctness defect or regression.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant