|
| 1 | +name: Mutation Weekly |
| 2 | + |
| 3 | +# Weekly mutation sweep over the enumerated decision kernels (issue #1415). |
| 4 | +# Mutation score is the mechanical answer to "is this test load-bearing or |
| 5 | +# decorative"; a full-suite sweep is unaffordable, so the scope is the kernel |
| 6 | +# registry in scripts/mutation/modules.ts and nothing else. |
| 7 | +# |
| 8 | +# Sharded one job per module: the whole sweep is ~2,150 mutants, and the selector |
| 9 | +# module alone is ~1,280 of them, so a single job would sit near the 30-minute |
| 10 | +# acceptance budget on an ubuntu runner. The shards' JSON reports are merged into |
| 11 | +# one verdict by the ratchet job (`--report-dir`), so the ratchet still sees a |
| 12 | +# full sweep. |
| 13 | +# |
| 14 | +# The lane reports; it does not commit. The proposed baseline rides in the |
| 15 | +# artifact and applying it is a reviewed `pnpm mutation:baseline` commit — a score |
| 16 | +# can never lower itself. Gating (after two consecutive stable weekly runs) is |
| 17 | +# enforced on PRs by mutation-affected.yml. |
| 18 | + |
| 19 | +on: |
| 20 | + schedule: |
| 21 | + # Sundays 05:00 UTC — after the nightly lanes, before the working week. |
| 22 | + - cron: "0 5 * * 0" |
| 23 | + workflow_dispatch: |
| 24 | + |
| 25 | +permissions: |
| 26 | + contents: read |
| 27 | + |
| 28 | +concurrency: |
| 29 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 30 | + cancel-in-progress: true |
| 31 | + |
| 32 | +jobs: |
| 33 | + shard: |
| 34 | + name: Mutants (${{ matrix.module }}) |
| 35 | + runs-on: ubuntu-latest |
| 36 | + # Budget is 30 minutes per shard; the headroom covers checkout/install so a |
| 37 | + # slow runner still reports instead of being killed mid-sweep. |
| 38 | + timeout-minutes: 45 |
| 39 | + strategy: |
| 40 | + fail-fast: false |
| 41 | + matrix: |
| 42 | + # Kept in step with KERNEL_MODULES by the shard-coverage assertion in |
| 43 | + # scripts/mutation/workflow.test.ts. |
| 44 | + module: |
| 45 | + - kernel-errors |
| 46 | + - daemon-ref-frame |
| 47 | + - interaction-settle |
| 48 | + - scroll-edge-state |
| 49 | + - selectors |
| 50 | + steps: |
| 51 | + - name: Checkout |
| 52 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 53 | + |
| 54 | + - name: Setup toolchain |
| 55 | + uses: ./.github/actions/setup-node-pnpm |
| 56 | + |
| 57 | + - name: Run mutants for ${{ matrix.module }} |
| 58 | + run: pnpm mutation:run --modules ${{ matrix.module }} |
| 59 | + |
| 60 | + - name: Upload shard report |
| 61 | + if: always() |
| 62 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 63 | + with: |
| 64 | + name: mutation-shard-${{ matrix.module }} |
| 65 | + path: .tmp/mutation/mutation.json |
| 66 | + if-no-files-found: warn |
| 67 | + |
| 68 | + ratchet: |
| 69 | + name: Mutation ratchet |
| 70 | + runs-on: ubuntu-latest |
| 71 | + needs: shard |
| 72 | + if: always() |
| 73 | + timeout-minutes: 15 |
| 74 | + steps: |
| 75 | + - name: Checkout |
| 76 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 77 | + |
| 78 | + - name: Setup toolchain |
| 79 | + uses: ./.github/actions/setup-node-pnpm |
| 80 | + |
| 81 | + - name: Ratchet self-test |
| 82 | + run: pnpm mutation:test |
| 83 | + |
| 84 | + - name: Download shard reports |
| 85 | + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 86 | + with: |
| 87 | + pattern: mutation-shard-* |
| 88 | + path: .tmp/mutation/shards |
| 89 | + |
| 90 | + # run.ts writes the markdown verdict to $GITHUB_STEP_SUMMARY when the |
| 91 | + # runner exports it, so the summary and the artifact carry the same numbers. |
| 92 | + - name: Ratchet the merged sweep and propose the next baseline |
| 93 | + run: | |
| 94 | + pnpm mutation:check --report-dir .tmp/mutation/shards --update |
| 95 | + cp mutation-baselines/decision-kernels.json .tmp/mutation/proposed-baseline.json |
| 96 | + git checkout -- mutation-baselines/decision-kernels.json |
| 97 | +
|
| 98 | + - name: Upload mutation report |
| 99 | + if: always() |
| 100 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 101 | + with: |
| 102 | + name: mutation-decision-kernels |
| 103 | + path: | |
| 104 | + .tmp/mutation/shards |
| 105 | + .tmp/mutation/proposed-baseline.json |
| 106 | + if-no-files-found: warn |
0 commit comments