Repository navigation
ci: add the testing standard's jobs, all off until a caller opts in - #117
Merged
Merged
Conversation
ci.yml takes run-coverage-ratchet and run-mutation, both false by default, which add the coverage-ratchet and mutation jobs beside verify. Two new reusables run the scheduled halves: nightly-properties.yml runs the suite with COSYTE_PROPERTY_RUNS=10000 and keeps every printed replay seed in the job summary and an artifact, and weekly-mutation.yml runs the full mutation run and reports each package's score against its floor without committing. self-check.yml runs all four against the ci-caller fixture, which links stand-ins for cosyte-mutate and cosyte-ratchet until the real tools are on npm, and checks what the scheduled runs kept. Claude-Session: https://claude.ai/code/session_016orFiR8mq7oCYo77QDTw2U
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
The first part of the shared CI jobs for the testing standard (cosyte/config,
documentation/decisions/0004-the-testing-standard.md). Everything is off until a caller opts in.ci.ymltakes two inputs,run-coverage-ratchetandrun-mutation, bothfalseby default. They add two jobs:coverage-ratchetrunspnpm test:coverage, thencosyte-ratchet check --skip mutation, with--base origin/<base branch>on a pull request.mutationruns on pull requests only. It runscosyte-mutate changed --base origin/<base branch>, thencosyte-ratchet check --skip coverage --base origin/<base branch>, and keepsreports/mutation/as an artifact.verifywith noneeds:, onubuntu-latestat the first Node line, with the whole history checked out. Each writes the ratchet's report to the job summary.nightly-properties.yml, jobproperties. It runs the caller'stest-cmd(defaultpnpm test) withCOSYTE_PROPERTY_RUNSset toproperty-runs(default10000). It strips colour codes from the log and keeps everyReplay exactly:seed and path once, with the test and the property that printed it. The seeds go in the job summary andseeds.txt, and the log andseeds.txtgo in theproperty-runartifact.weekly-mutation.yml, jobmutation. It runs the caller'smutate-cmd(defaultpnpm exec cosyte-mutate full), thencosyte-ratchet check --skip coverage. The job summary shows each package's score against its floor, andreports/mutation/goes in an artifact. A score below its floor turns the run red. The job hascontents: readand never commits.self-check.ymlruns all four jobs againsttest/fixtures/ci-caller/, and a newquality-artifactsjob checks what the two scheduled runs kept.Why
The standard asks for these checks: a coverage and mutation floor that only rises, a pull request's own code held to 100, a deep property run every night with its seeds kept, and a full mutation run every week reported against the floor. Each library will run them from these shared workflows rather than writing its own. The tools are on cosyte/config main but not yet on npm. So every input defaults to off, and a merge changes no caller. Callers opt in after the owner approves that release.
Proof
node --test "test/*.test.mjs".test/testing-standard-jobs.test.mjsruns every shell script these jobs add against a stubpnpm. It checks:self-check.ymlruns all four jobs on a real runner against the fixture:systemsturns on bothci.ymljobs;nightly-propertiesandweekly-mutationrun the two reusables;quality-artifactsdownloads what they kept. It checks that the planted seed is inseeds.txtonce, at depth 10000, and that the weekly artifact holds the full report and the ratchet's report.cosyte-mutateandcosyte-ratchetare stand-ins intest/fixtures/quality-stubs/, tested intest/quality-stubs.test.mjs. They accept only the command lines the real tools accept and refuseraise. Each one checks that the base ref has a merge base and that every report it would read is on disk. They judge nothing.pnpm install --frozen-lockfileof the fixture, every fixture script with the real dash and PHI checkers, and every new step script run with the real pnpm.What we could not prove before a caller adopts:
Choices
Taken on the recommendation, for the owner to review:
ci.ymlfor the pull request jobs, new reusables for the scheduled ones. The pull request jobs follow the precedent ofrun-bunandrun-deno, so a caller adds one line and getsci / coverage-ratchetandci / mutation. A reusable cannot carry a schedule, so the nightly and weekly runs are their own files, likenightly-fuzz.yml.verify. This keepsverifybyte for byte as it was, and judges the floor on one system and one Node line, not on every matrix leg. The cost is a second coverage run in parallel.--base. It then compares the measurements with the floor file as it stands, as decision 0004 says coverage is compared on every push to main.mutationruns on pull requests only, because a changed-files run needs a base.pnpm exec, from the caller's own lockfile, not throughnpxat a version this repository picks. The caller pins the version.mutationjob as it stands. The weekly run takesmutate-cmdfor that case.coverage-ratchet, 60 formutation(the same bound cosyte/config uses), 60 for the nightly run, 180 for the weekly run.node-versionon the new reusables are"22", matchingnightly-fuzz.ymland the first default Node line ofci.yml.mutation-changed, 30 days forproperty-runandmutation-report. Actions are pinned by SHA:actions/upload-artifactv7.0.2 (already used here) andactions/download-artifactv8.0.2 (new, inself-check.ymlonly).working-directory's description now names every job that reads it. Its default and behavior are unchanged.needs:inci.yml. The one newneeds:isself-check.yml'squality-artifacts, which is no caller's context. It is added to the pinned set intest/skipped-required-context.test.mjs.No job id, existing input default, secret or permission changed. The reference note will list two new inputs, two new jobs and two new files, and nothing a caller has to act on.
Kind: code
https://claude.ai/code/session_016orFiR8mq7oCYo77QDTw2U