Repository navigation
Add a scheduled seed-set rotation job - #154
Conversation
Submission Rules §4.6 publishes a new seed set every two cohorts, each adoptable for four, so two are normally adoptable at once. In practice seedset.yaml has never been rotated: it carries one set and one file-level cohort-id, and rotation is entirely manual. tools/rotate_seed_sets.py appends a set with fresh uint64 seeds and an explicit adoption window, and .github/workflows/rotate-seed-sets.yml runs it every Wednesday, publishing one week before the cohort a set becomes adoptable in so there is time to review it. The rules set no lead time — §4.6 is silent — so the week is an operational convention. Three things the registry's shape forces: - Every set gets its own `cohorts:` list. The checker applies the file-level cohort-id to any set lacking one, so appending under a bumped cohort-id would silently re-key older sets and keep retired ones adoptable. - Sets are only ever appended, never removed. A submission stays bound to its set for the full Pareto-update window, and seed-set-membership fails a submission whose set is absent from the file. - The audit validates the uint64 range and parses each cohort id. The checker str()-casts window entries without validating them, so a typo silently never matches. Nothing is pushed to main: a due rotation opens a draft PR. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
arekay-nv
left a comment
There was a problem hiding this comment.
Local review found one blocking workflow issue, reproduced with the actual Rotate step under bash -e. The year-long publication calendar check, post-rotation registry audit, seed preservation, and opening-day idempotence checks passed.
arekay-nv
left a comment
There was a problem hiding this comment.
Thanks @arav-agarwal2 !
There was a problem hiding this comment.
🟡 Changes recommended
A successful rotation returns 1, triggering Bash errexit before status capture and causing every due rotation to fail before a PR can be opened.
4 open issues
What changed in this PR
Adds automated seed-set rotation for the §4.6 cadence, proposing new registry entries through draft PRs one week before adoption begins.
Changes:
- Adds registry auditing, seed generation, and explicit per-set adoption windows while retaining historical sets.
- Adds a weekly workflow with manual overrides, schedule checks, duplicate-PR detection, and overdue reminders.
- Includes generated PR guidance for review and the separate checker-data update.
| File | Description |
|---|---|
tools/rotate_seed_sets.py |
Implements cohort scheduling, registry validation, and append-only seed-set generation. |
.github/workflows/rotate-seed-sets.yml |
Schedules rotation and manages draft PR publication and reminders. |
Review effort: Balanced
- Rotate: capture the exit status with `|| RC=$?` so bash -e does not end the step when a set is published (exit 1). - Any open seed-rotation PR now blocks a new rotation, not only one for the current target cohort; the overdue nudge goes to that pending PR. - Push the rotation branch with --force-with-lease so a branch left by a failed run or an unmerged closed PR does not block the retry. - Backfill `cohorts: null` as well as a missing window. - Exit 2 on an unexpected error: Python's default exit 1 read as "published" to the workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| read -r number cohort < <(gh pr list --repo "$GITHUB_REPOSITORY" --state open \ | ||
| --limit 100 --json number,headRefName --jq ' | ||
| [.[] | select(.headRefName | test("^seed-rotation/[0-9]{4}-[0-9]{2}-C[01]$"))] | ||
| | sort_by(.number) | .[0] // empty | ||
| | "\(.number) \(.headRefName | ltrimstr("seed-rotation/"))"') || true |
There was a problem hiding this comment.
Confirmed at eec4c23: [P2] Abort the run when the pending-PR lookup fails.
Reproduced locally under bash -euo pipefail: when the producer in read -r number cohort < <(gh pr list ...) || true exits nonzero, the step still succeeds with both variables empty. A transient GitHub API failure therefore passes the existing.number == '' guard and generates fresh seeds.
If the target cohort already has a pending rotation PR, the later git ls-remote obtains that branch's current SHA and git push --force-with-lease succeeds against it, replacing the seeds already under review. The lease does not prevent this because it uses the freshly fetched SHA.
Please capture gh pr list output in a separate checked command substitution before parsing it. A successful empty response should mean no pending PR; a failed query should stop the job before generation or push.
|
|
||
| def next_set_id(existing: set[str]) -> str: | ||
| """The next unused single-letter set id.""" | ||
| for code in range(ord("A"), ord("Z") + 1): |
There was a problem hiding this comment.
Is this long term enough?
There was a problem hiding this comment.
This should be enough for two years, i guess in between that itself new version would be released? so i guess thats fine?
Also maybe we need to revisit how id in a seed-set is populated. Maybe we could replace having A,B,C,... with latest-cohort-id:A? @arekay-nv
There was a problem hiding this comment.
I think rotating between A,B,C should be fine and we can discuss that async since that would not be an issue until we generate a new set after C - in the meanwhile, we can merge this PR and generate a PR for B today and then fixup the workflow.
Fix JSON query syntax for PR listing in workflow. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>


§4.6 publishes a new seed set every two cohorts, each adoptable for four, so two are
normally adoptable at once. In practice
seedset.yamlhas never been rotated — itcarries a single set
Aunder one file-levelcohort-id, and rotation is entirelymanual. Right now only one set is adoptable where §4.6 expects two.
This adds
tools/rotate_seed_sets.pyand.github/workflows/rotate-seed-sets.yml.The job runs every Wednesday and publishes one week before the cohort a set
becomes adoptable in, so the working group gets a review window instead of being
asked to merge a rules artifact on the morning it takes effect. The rules set no lead
time (§4.6 is silent), so the week is an operational convention, not a rule.
Nothing is ever pushed to
main: a due rotation opens a draft PR.Why each set carries its own
cohorts:windowThe checker applies the file-level
cohort-idto every set that lacks an explicitwindow. Appending a new set under a bumped
cohort-idwould therefore silently re-keyset
Atoo, extending its adoption window and letting new submissions bind to aretired set. The loader already supports a per-set override, so the job writes one for
every set and backfills
Aon the first run.Equally load-bearing: sets are only ever appended, never removed. A submission
stays bound to its set for the full Pareto-update window, and
seed-set-membershipfails any submission whose set is missing from this file. The file grows; that is
correct.
Verified against the real checker
The rotated file was loaded through
submission_checker.seed_sets.load_seed_sets, notjust the generator's own view:
The schedule is asserted in CI across a year of Wednesdays (12 publications, each
exactly 7 days early). Publishing is idempotent: once a set lands, the run on the
cohort date itself reports
elapsed 0 -> not due, and if the PR is still open when thecohort opens the job comments on it rather than publishing a duplicate.
Manual control
workflow_dispatchtakescohort(publish a specific cycle, e.g.2026-11-C0),force(publish off-cadence),ready(open ready-for-review instead of draft) anddry_run.Two things for the working group
§4.6 reads two ways. On
maina set is keyed by the cohort it is published in;on
feat/change-cohort-selectionit is keyed to the first cohort that may adopt it.Publishing ahead of time is only coherent under the second reading — which is also what
the checker implements (
seed_sets.pyderives the window as that cohort plus the nextthree). Only
main's prose lags. Worth settling, but no behaviour here depends on it.The checker's copy is separate. It reads its own bundled
src/submission_checker/data/seed_sets.yaml, so a merged set is not usable until thatcopy is updated. Automating the mirror is deliberately left for separate work; each
generated PR carries the reminder.
🤖 Generated with Claude Code