Repository navigation
fix(weekly-mutation): probe sharding on an empty shard, and widen the public surface scan - #121
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three follow-ups from the review of #120, the sharded weekly mutation run:
test/public-surface.test.mjsnow 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.mutate-cmd. "Check that cosyte-mutate can shard" no longer appends--helpto the end of the line. It runsmutate-cmdas written, once, withCOSYTE_MUTATE_SHARDset to8589934592/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 ofa && bsees the variable.COSYTE_MUTATE_INCREMENTAL_FILEis unset for the check, and the empty shard reports it leaves are deleted.@cosyte/vitest-config0.1.5 or later, when the command wrote amutation.json(it ran everything), is still running after 180 seconds (timeoutstops 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
--helponly at the end ofmutate-cmd, so in a compound command the first part ran a full mutation inside the check. And a tool whose help namesCOSYTE_MUTATE_SHARDbut 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 thecosyte/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 wrotemutation.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, andharness gate github-profile(actionlint 1.7.12, the tests, the dash check, the package lists) passes.Choices
mutate-cmdruns several commands; the empty shard probe needs no parsing of the command line. To undo, restore the--helpstep from fix(weekly-mutation): check the tool shards before a sharded run, and run one shard with any tool #120.PROBE_SECONDS. A tool that shards loads its config and finishes an empty shard in seconds, also across several packages; the bound caps what a tool that ignores the variable costs each shard. Not an input, so no caller-facing change. To change it, editPROBE_SECONDSand the README line.--helpis what ran a full mutation in a compound command, and the behavioural check covers every tool the help check caught. To undo, restore it from fix(weekly-mutation): check the tool shards before a sharded run, and run one shard with any tool #120.Kind: code