ci: shallow-checkout candidate complexity independently of trusted policy
Candidate web-complexity runs fetch the entire repository history before determining whether web files changed. In the September 20 15:30–17:30 UTC creation cohort, candidate checkout steps consumed 117.87 of 121.87 allocated runner-minutes. This PR extracts the candidate-only portion of #13171 so it can land independently of that PR's protected trusted-workflow update.
Use a depth-one checkout and fetch only the exact PR base or pre-push commit when absent. Missing or invalid comparison commits fail rather than dropping the baseline comparison. Initial pushes need no comparison fetch. The trusted workflow and checker bytes are unchanged; required-check names, events and policy remain unchanged.
The real-Git regression suite runs in the existing workflow-guard job, not every candidate complexity invocation. This also addresses the test-placement concern on #13171 without editing that PR's branch.
Validation: regression-only commit fails three of four cases; the final implementation passes all four real shallow-repository cases (older base across a multi-commit push, HEAD/history preservation, already-present commit without network, initial push and invalid/unavailable revisions). Trusted workflow isolation and merge-queue required-check topology checks pass. Bash syntax, actionlint and git diff checks pass. The canonical checkout's branch and index were preserved using a private Git index. No native build is needed for this workflow-only change; CI will validate the published head. The exposure above is not a measured latency or dollar saving for this patch.
Summary by cubic
Candidate web-complexity runs now use a shallow checkout so they no longer fetch the entire repository history before detecting web changes. The workflow fetches only the exact PR base or pre-push commit when it isn't already present, and invalid or unavailable comparison revisions fail instead of silently dropping the baseline; initial pushes skip the fetch. Trusted workflow checks, checker bytes, and required-check names are unchanged.
Adds a fetch-script regression suite that runs in the existing workflow-guard job and exercises real shallow repositories, covering older bases across multi-commit pushes, HEAD/history preservation, already-present commits without network, initial pushes, and invalid/unavailable revisions.