Repository navigation
Description
Agent Brief
Type: Task
Summary: Move the post-merge mutation lane's two repeated pre-model leg steps, "Set the diff target" and "Stage the plugin and the prompt", into two scripts under .github/scripts/post-merge-test-mutation/, and drop the dead credit-marker rm -rf lines (part of restructuring pass #15695).
Current behavior:
Line numbers are at ba7bb0da37. The mutation lane has six model legs: generate, generate-subscription, generate-fallback, triage, triage-subscription and triage-fallback.
-
"Set the diff target" has the same 19-line
run:body in all six legs:post-merge-test-mutation.yml:273-297,:602-626,:881-905,:1313-1337,:1671-1695,:1977-2001.- Its
env:is the same in each:BEFOREandAFTERfromneeds.prep.outputs. - The body checks that
AFTERis on main and picks the range or commit target. - It appends three exclusions to the checkout's git exclude file (
post-merge-test-mutation.yml:288), writes the local diff-target settings file the mutation-testing plugin reads, checks the tree is clean, and writesmodeandtargettoGITHUB_OUTPUT.
- Its
-
"Stage the plugin and the prompt" has one 16-line body per stage:
- in the generate legs it reads
generate.prompt.mdandgenerate.schema.json(:325-351,:658-684,:936-962); - in the triage legs it reads
triage.prompt.mdandtriage.schema.json(:1392-1418,:1752-1778,:2057-2083).
The two forms differ only in those two file names.
- in the generate legs it reads
-
No
${{ }}expression appears in either body. Both steps run before the model step, after "Check out main's tools", which checks main out to.basein full at the event's commit (:262-267). -
The workflow runs on
workflow_run, so main's file runs. -
No test names either step (
git grepover*.test.mjsand*.test.sh: 0 hits)..github/scripts/post-merge-test-mutation/credential-legs.test.mjs:53-60and.github/actions/resolve-config/callers.test.mjs:10162-10197compare the legs with one another, so equal edits keep them equal. -
"Write the key's credit-stop marker" opens with a dead
rm -rf "${RUNNER_TEMP:?}/key-credit-stop"at:440and:1509:- no earlier step of those jobs names the directory;
- the runner empties
runner.tempat the start of each job (https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#runner-context).
Desired behavior:
- New
.github/scripts/post-merge-test-mutation/set-diff-target.sh, mode 100755 with a#!/usr/bin/env bashline (as.github/scripts/lib/handoff-evidence.shhas), called withbashfrom the workspace root. It holds the "Set the diff target" body verbatim, including its# shellcheck disable=SC2016reason, and readsBEFOREandAFTERfrom the environment. - New
.github/scripts/post-merge-test-mutation/stage-plugin-prompt.sh, mode 100755 with a#!/usr/bin/env bashline (as.github/scripts/lib/handoff-evidence.shhas), called withbashand takinggenerateortriageas its one argument. It refuses any other argument with exit 2. It holds the staging body, with<stage>.prompt.mdand<stage>.schema.jsonpicked by the argument, and readsHEAD_SHA,DIFF_TARGET,PROMPT_FILE,SCHEMA_FILEandMODELfrom the environment. - Each of the twelve steps keeps its name,
id,if:andenv:. Itsrun:becomes one line:bash .base/.github/scripts/post-merge-test-mutation/set-diff-target.sh, orbash .base/.github/scripts/post-merge-test-mutation/stage-plugin-prompt.sh generate(ortriage). - The two
rm -rflines are gone; each marker step keeps itsmkdir -pandecholines.
Files:
.github/scripts/post-merge-test-mutation/set-diff-target.sh(new).github/scripts/post-merge-test-mutation/stage-plugin-prompt.sh(new)- the twelve steps and two marker lines at
post-merge-test-mutation.yml:273,:325,:440,:602,:658,:881,:936,:1313,:1392,:1509,:1671,:1752,:1977,:2057
Key interfaces:
- The
targetandpromptstep outputs (mode,target,lint), every error and warning line, the prompt and schema files, the exclusions and the settings file: byte-identical for the same inputs. - Token scope and log shape: each step stays one
runstep reading main's checkout, before any model step, with no new token, permission or composite action.
Acceptance criteria:
- The diff-target logic exists once, in
set-diff-target.sh, and the staging logic once, instage-plugin-prompt.sh; all twelve leg steps call them. - No credit-marker step in the mutation lane removes the marker directory before writing it.
- Every step name,
id,if:,env:key, job id, trigger, permission and workflow file name is unchanged. - Behavior is unchanged: the same outputs, exit codes and written files for the same inputs.
- The diff edits only the listed files and the lines of a test that assert on them when the change breaks that assertion.
- The pull request stays within 400 changed lines and 15 hand-edited files.
- Both scripts pass the repository's shellcheck and shfmt checks.
- ci-status is green.
Out of scope:
- The leg steps after the model step (for example "Fail the leg unless it handed off or a limit stopped it"), which run after model code may have touched the workspace. Also the three-leg structure, other duplication, eval cases, fixtures, and skill and agent text.
Metadata
Metadata
Assignees
Labels
Type
Fields
Work status
Priority
Activity