Problem
Organization-required reusable security workflows currently produce synthetic-merge evidence for pull requests instead of scanning the exact submitted head.
Fresh reproduction on ContextualWisdomLab/g7#1 on 2026-08-22:
- exact PR head:
4a1773f604b3971478f486557dac137d4202086c
- GitHub synthetic merge:
8fb41406de757dd2c8edf7a7006c8bd4c68bb29f
Security Scan run 32558956134 checked out the synthetic merge ref;
SAST Semgrep run 32558956167 checked out the same synthetic merge ref;
- the current central
sast-semgrep.yml checkout has no explicit PR-head ref;
- the current central
security-scan.yml Trivy/dependency-review checkout paths likewise do not bind the scan to the submitted head.
This violates the organization merge-evidence contract: synthetic merge, predecessor-head, queued, skipped-required, or otherwise non-exact evidence must never be promoted to exact-current-head proof.
The g7 canary also shows why the distinction matters operationally: the reusable scans currently fail on broad repository/base findings (Trivy dependency findings and 234 Semgrep warning/error findings), so the leaf readiness PR must not absorb unrelated remediation simply to manufacture a passing gate.
Responsibility boundary
Fix this in the organization-central reusable workflow layer. Do not duplicate or weaken the gate in downstream repositories and do not change leaf application code to compensate for checkout semantics.
Required design
For pull-request runs, resolve and verify the immutable target repository plus pull_request.head.sha before scanning. Preserve the repository's normal default ref for protected-branch pushes and other explicitly supported events. Where a scanner legitimately compares base and head, materialize both immutable revisions and make the evidence labels unambiguous rather than treating a synthetic merge ref as the submitted head.
SARIF attribution, job summaries, logs, artifacts, and any machine-readable evidence should record the target repository, exact submitted head SHA, base SHA where relevant, and the actual checked-out commit. Fail closed if those identities disagree.
Acceptance criteria
Downstream dependency
g7#1 must remain unmerged while its exact-current-head CI/security/review/protection contract is incomplete. Its broad pre-existing dependency/SAST baseline should be handled as separate security-owner work rather than mixed into the bounded readiness change.
Problem
Organization-required reusable security workflows currently produce synthetic-merge evidence for pull requests instead of scanning the exact submitted head.
Fresh reproduction on
ContextualWisdomLab/g7#1on 2026-08-22:4a1773f604b3971478f486557dac137d4202086c8fb41406de757dd2c8edf7a7006c8bd4c68bb29fSecurity Scanrun32558956134checked out the synthetic merge ref;SAST Semgreprun32558956167checked out the same synthetic merge ref;sast-semgrep.ymlcheckout has no explicit PR-headref;security-scan.ymlTrivy/dependency-review checkout paths likewise do not bind the scan to the submitted head.This violates the organization merge-evidence contract: synthetic merge, predecessor-head, queued, skipped-required, or otherwise non-exact evidence must never be promoted to exact-current-head proof.
The g7 canary also shows why the distinction matters operationally: the reusable scans currently fail on broad repository/base findings (Trivy dependency findings and 234 Semgrep warning/error findings), so the leaf readiness PR must not absorb unrelated remediation simply to manufacture a passing gate.
Responsibility boundary
Fix this in the organization-central reusable workflow layer. Do not duplicate or weaken the gate in downstream repositories and do not change leaf application code to compensate for checkout semantics.
Required design
For pull-request runs, resolve and verify the immutable target repository plus
pull_request.head.shabefore scanning. Preserve the repository's normal default ref for protected-branch pushes and other explicitly supported events. Where a scanner legitimately compares base and head, materialize both immutable revisions and make the evidence labels unambiguous rather than treating a synthetic merge ref as the submitted head.SARIF attribution, job summaries, logs, artifacts, and any machine-readable evidence should record the target repository, exact submitted head SHA, base SHA where relevant, and the actual checked-out commit. Fail closed if those identities disagree.
Acceptance criteria
github.event.pull_request.head.shafrom the correct target/head repository, notrefs/pull/*/merge.git rev-parse HEAD == pull_request.head.shain SAST and Security Scan evidence.Downstream dependency
g7#1must remain unmerged while its exact-current-head CI/security/review/protection contract is incomplete. Its broad pre-existing dependency/SAST baseline should be handled as separate security-owner work rather than mixed into the bounded readiness change.