You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guard every job against reading a pipeline script after it detaches
The sibling guard checked one span of the yml, captured by a lazy regex that
began at the first `- pwsh: |` in the file and therefore audited 85 steps
across 1017 lines rather than the one step it named. Narrowing it with a
tempered `(?!- pwsh: \|)` confines the capture to 90 lines and 0 nested steps
-- but the broad form was measured to be doing real work, so it does not ship
alone.
The replacement is a pipeline-wide invariant: for every `- job:`, no step may
read a script from `$(Build.SourcesDirectory)/.github/scripts` after that job
runs `git checkout --detach`. All 5 worktree script reads in the pipeline
today occur before their job's detach, so the invariant holds; the realistic
defect shape (the resolver loaded from the worktree instead of the trusted
capture) kills 6 tests.
A pipeline-wide zero assertion passes vacuously when the scan is broken, so a
proof-of-firing test applies the mutation in memory and requires both
CopilotReview and RunUITests to be named. It is the only test that kills the
job-segmentation mutant.
The separator pattern had two copies, which is a fork of the truth; it now
lives once in the file-level BeforeAll. Both forms were measured to agree
exactly on today's pipeline, so the wider one is adopted: for a test-suite
guard the error modes invert a production gate's -- a false positive is a red
test a human resolves in a minute, a false negative is a step reading a script
from a detached checkout, which is a lost run nobody is told about.
`return , $findings` emits an empty array as one object, so a clean scan
reported one nameless finding. Every call site already wraps with `@()`.
Suite 4117 -> 4121, both sides measured in the same session by stash; the 35
failures are pre-existing and all in the review half. Mutation: 6 killed, 0
survivors.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 735ac9a2-7bec-4baa-ad19-c298e5bc795a
0 commit comments