Skip to content

fix(weekly-mutation): probe sharding on an empty shard, and widen the public surface scan - #121

Merged
NSchatz merged 1 commit into
mainfrom
fix/sharded-weekly-followups
Nov 10, 2026
Merged

NSchatz merged 1 commit into
mainfrom
fix/sharded-weekly-followups

Conversation

@NSchatz

@NSchatz NSchatz commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

What

Three follow-ups from the review of #120, the sharded weekly mutation run:

  1. The public surface scan is wider. test/public-surface.test.mjs now flags the planning folder after a slash, a dot or a hyphen too (a path into another checkout, a relative path), and decision ids of one to four digits, not only two or three. No tracked file trips the wider patterns.
  2. The shard check never runs a full mutation for a compound mutate-cmd. "Check that cosyte-mutate can shard" no longer appends --help to the end of the line. It runs mutate-cmd as written, once, with COSYTE_MUTATE_SHARD set to 8589934592/8589934592: the tool puts a file in shard k of n when its 32-bit FNV-1a hash mod n is k - 1, and with n = 2^33 no hash reaches n - 1, so the shard holds no file. Every part of a && b sees the variable. COSYTE_MUTATE_INCREMENTAL_FILE is unset for the check, and the empty shard reports it leaves are deleted.
  3. A tool that names the variable but ignores it is caught before the full run. The check fails, saying sharding needs @cosyte/vitest-config 0.1.5 or later, when the command wrote a mutation.json (it ran everything), is still running after 180 seconds (timeout stops it and its process group), exits non-zero, or wrote no shard report.

README.md ("The sharded weekly run"), the workflow comments and CHANGELOG.md say the same. CHANGELOG.md also moves #120's lines under the reference its merge published, workflows-2026-11-10-27aa79969b26.

Inputs and their defaults, job ids, outputs, secrets and permissions are unchanged. The one-shard path, the shard step and the merge are untouched, so the result the release gate reads is unchanged.

Why

The review of #120 found three gaps. The public surface test skipped a planning path after a slash, dot or hyphen, and missed one and four digit decision ids. The shard check put --help only at the end of mutate-cmd, so in a compound command the first part ran a full mutation inside the check. And a tool whose help names COSYTE_MUTATE_SHARD but ignores it passed the check and was caught only after hours of mutating on every shard.

Proof

Red on the base (27aa799), with the new tests and the old code:

  • test/public-surface.test.mjs: "the planning folder pattern catches the folder wherever a path puts it" failed on the cosyte/ prefix; "the decision id pattern catches ids of one to four digits" failed on a one digit id.
  • test/testing-standard-jobs.test.mjs: "the probe never runs a full mutation for a compound mutate command" failed with "a full run happened inside the probe" (the first command wrote mutation.json); "the probe fails a tool whose help names the shard variable but which ignores it" failed because the old check passed it ("cosyte-mutate can shard"). The other new probe tests failed on the old messages.

Green after the change: node --test "test/*.test.mjs" passes, and harness gate github-profile (actionlint 1.7.12, the tests, the dash check, the package lists) passes.

Choices

Kind: code

… public surface scan

The shard check ran `<mutate-cmd> --help`, so a compound command ran a
full mutation in its first part, and a tool whose help named
COSYTE_MUTATE_SHARD but ignored it passed. It now runs the command as
written, once, on a shard no file can be in (n = 2^33), and fails on a
mutation.json, on 180 seconds without finishing, on a non-zero exit, or
on no shard report. The public surface test now flags the planning
folder after a slash, dot or hyphen, and decision ids of one to four
digits.
@NSchatz
NSchatz merged commit 51ae075 into main Nov 10, 2026
40 checks passed
@NSchatz
NSchatz deleted the fix/sharded-weekly-followups branch November 10, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant