From e799b8ba088de57f44249b2db4d1668e11145ef8 Mon Sep 17 00:00:00 2001 From: Remi Antczak <140408771+remigiusz-antczak@users.noreply.github.com> Date: Fri, 13 Nov 2026 13:14:19 +0100 Subject: [PATCH] Pin perun-review.yml actions to SHAs; gates checkout drops credentials; quote train_land args perun-review.yml actions now use full commit SHAs (each verified against its tag via the GitHub API), dcr-gates.yml checkout sets persist-credentials: false, and train_land.sh quotes "${@:3}". test-ci-gates.sh gains a case that fails on the old state. Tests: 304/312 (8 environmental failures under the sandbox: pgrep/sysmond, dcr-gates opt-in, and the hermetic sentinel; new pins case passes) Co-Authored-By: Claude Opus 5.5 --- .claude/skills/agentic-delivery/scripts/train_land.sh | 2 +- .../skills/deep-code-review/templates/dcr-gates.yml | 1 + .../skills/deep-code-review/templates/perun-review.yml | 10 +++++----- SHA256SUMS | 6 +++--- scripts/test-ci-gates.sh | 7 +++++++ 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.claude/skills/agentic-delivery/scripts/train_land.sh b/.claude/skills/agentic-delivery/scripts/train_land.sh index a59e924e3..0f1ad4ffb 100755 --- a/.claude/skills/agentic-delivery/scripts/train_land.sh +++ b/.claude/skills/agentic-delivery/scripts/train_land.sh @@ -142,7 +142,7 @@ PQ=$(git rev-parse --git-common-dir)/train-push.lock PW=${PUSH_WAIT_SECS:-$((LT split=0 landed= gates=0 ALL="$*" HEADS= # HEADS = ": ..." each PR rides with, recorded in the yield ledger unl() { local n; for n in $ALL; do [[ " $landed " == *" $n "* ]] || printf '%s ' "$n"; done; } # every PR land_train did not merge split_report() { [ "$split" -eq 1 ] || return 0; local u; u=$(unl); echo "SPLIT done: landed #${landed# }; CANT (not landed) #${u% }; gates=$gates"; } -stage() { { [ "${TRAIN_STAGES:-1}" != 0 ] && [ $# -ge 3 ]; } || return 0; python3 "$HERE/merge_train.py" stage --base "$BASE_BRANCH" --stage "$1" ${2:+--eta "$2"} ${@:3} &2 || true; } # stage NAME ETA_SECS PR... +stage() { { [ "${TRAIN_STAGES:-1}" != 0 ] && [ $# -ge 3 ]; } || return 0; python3 "$HERE/merge_train.py" stage --base "$BASE_BRANCH" --stage "$1" ${2:+--eta "$2"} "${@:3}" &2 || true; } # stage NAME ETA_SECS PR... stage_end() { case $1 in 0) stage done "" $landed; stage skipped "" $(unl) ;; 4|5) stage deferred "" $(unl) ;; *) stage failed "" $(unl) ;; esac; } # EXIT: landed = done; rc 0 with PRs unlanded (SKIP/REFUSE) = skipped; DEFER = deferred; else failed trap 'stage_end $?; kill "$HB" 2>/dev/null; rm -f "$TRAIN_LAND_COPY"; [ -z "$OWNP" ] || rm -f "$LOG.pid"; [ "$gates" -eq 0 ] || python3 "$HERE/train_yield.py" record "$T" "$ALL" "$landed" "$([ -e "$LOG.red" ] && echo red || { [ ! -e "$LOG.flaky" ] || cat "$LOG.flaky"; })" "$HEADS" "$START" || true; rm -f "$LOG.red" "$LOG.flaky"; split_report; clean_union_dirs; lock_drop "$PQ" || true; python3 "$HERE/perun_policy.py" heavy-exclusive-release >/dev/null 2>&1 || true; lock_drop "$LOCK" || true' EXIT # a loud foreign-claim drop must not abort the rest of the cleanup # A landing train holds the push lock and is moving the base: wait it out before any gate work (a union composed mid-land is stale at its own land). diff --git a/.claude/skills/deep-code-review/templates/dcr-gates.yml b/.claude/skills/deep-code-review/templates/dcr-gates.yml index 521301f71..8502d8e9a 100644 --- a/.claude/skills/deep-code-review/templates/dcr-gates.yml +++ b/.claude/skills/deep-code-review/templates/dcr-gates.yml @@ -62,6 +62,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 # fix_class_gate diffs base..head; a depth-1 clone cannot resolve the range + persist-credentials: false - name: Run installed deep-code-review gates env: diff --git a/.claude/skills/deep-code-review/templates/perun-review.yml b/.claude/skills/deep-code-review/templates/perun-review.yml index d73acb979..198f3b173 100644 --- a/.claude/skills/deep-code-review/templates/perun-review.yml +++ b/.claude/skills/deep-code-review/templates/perun-review.yml @@ -5,7 +5,7 @@ name: perun-review # deep-code-review skill installed and committed on the default branch, add the # repository secret ANTHROPIC_API_KEY, commit a non-empty `.banlist.txt` (post_review.sh # fails closed without it), pin CLAUDE_CODE_VERSION below, and set the spend cap. -# Pin the `uses:` actions to full commit SHAs too (tags are mutable). +# The `uses:` actions are already pinned to full commit SHAs; bump them deliberately (tags are mutable). # # Shape: two jobs, least privilege each. # 1. `review` (contents: read) runs the review headless and read-only @@ -63,7 +63,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 @@ -98,7 +98,7 @@ jobs: assert isinstance(f, dict) and all(isinstance(f.get(k), str) for k in ("id", "severity", "title")), "malformed finding row" json.dump(d, open("findings.json", "w")) PY - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: perun-findings path: findings.json @@ -113,11 +113,11 @@ jobs: pull-requests: write checks: write steps: - - uses: actions/checkout@v4 # BASE commit only: never the PR head + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 # BASE commit only: never the PR head with: ref: ${{ github.event.pull_request.base.sha }} persist-credentials: false - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: perun-findings - name: Ground-check, post, report diff --git a/SHA256SUMS b/SHA256SUMS index 673c922d0..c72dc657e 100644 --- a/SHA256SUMS +++ b/SHA256SUMS @@ -158,7 +158,7 @@ dfc2f70740240091bccf669534afc1d8e6807a5a0ef30ba63745d75f23a3204a .claude/skills 932767b2bf59d28d44a046412c22bddb10ce9c96d99c17f75e508d1870b2e6be .claude/skills/agentic-delivery/scripts/tracker_check.py 3f736e352c91ff08e557ec79d284a4a44ba7db52cfdd300436ce91fb2801b1d8 .claude/skills/agentic-delivery/scripts/tracker_weekly_update.py 14a50980e5ec61d66c7f0b57bddc9ac1ff8bb48008521f6d233036278b89fe3d .claude/skills/agentic-delivery/scripts/train_flake.sh -2e56be00ac6a555440dfb934d79c13f60b86f20f2149421555720612887b2338 .claude/skills/agentic-delivery/scripts/train_land.sh +470a396a85ec563f965221c9534d0ede22ee18cd0f13f29ff8d975e4ff8a9008 .claude/skills/agentic-delivery/scripts/train_land.sh 07a4d5571bca4efa3545846f88084d884aabaec570cd8eae109c02601a64c9bb .claude/skills/agentic-delivery/scripts/train_yield.py 52ced8537f3c809f17722d979a447555387a62dff77afafbb7633e6eadf13d3d .claude/skills/agentic-delivery/scripts/union_overlap.py b759691e776aff3bcc2c92b422179bce1f24522728c472155b8bc227ff094686 .claude/skills/agentic-delivery/scripts/vacuous_test_gate.py @@ -426,11 +426,11 @@ b28b622d7e59fb00549141b439871f5a6c6faddcb83d2d76c7303d7efdbb2897 .claude/skills 01ce284157850e6f9b146023dbcf12a8ed014db578ee5f6f27ddf21a2a3a0b5e .claude/skills/deep-code-review/scripts/token_differ.py cbfd54a4fa86885f0c49b77327f034c2986170c3d74b4c39b2d9f2686ba87c40 .claude/skills/deep-code-review/scripts/validate_status_claims.py 12a01a5082b5c4466c40aab5f0114cd8442f271df1aa7ef8ddd186512681a7b8 .claude/skills/deep-code-review/templates/dcr-gates.sh -7878656a917c0711cc4a2ea4e9673af39f729b99c40393ed589c9cc0f19f28b6 .claude/skills/deep-code-review/templates/dcr-gates.yml +b3fee98e393c043a49a472621ea6fb914e9cc6d5845ecfaeb947e85b6b9d1143 .claude/skills/deep-code-review/templates/dcr-gates.yml 1f4f50d2aa229b8d83b36321ee472010ec4677a4f4381ac9089a6fbd0957b4ad .claude/skills/deep-code-review/templates/gitleaks.toml f31e66a322ee172e4b9621c3b70717a6e896ee64178f0e8ea77ac2088b6d0cb6 .claude/skills/deep-code-review/templates/integrator-gate.sh 1f2ae6dfa026858aa04bffa55f93d8e53995ea536e3b813dcf28a88fa6f983e2 .claude/skills/deep-code-review/templates/parity-capture.md -d84df8bbfb7e87be95446e91151f1badcc85797c07d3cb574be00c66b4f6b7c4 .claude/skills/deep-code-review/templates/perun-review.yml +630fece74ace45c8eee4bbeb31ba69cb707eaf2ffef2e6675ce824d7ef0325f8 .claude/skills/deep-code-review/templates/perun-review.yml 429b66e715e660931543b71e346f60df85dfa8df70d6caa409f51958f4202acd .claude/skills/deep-code-review/templates/pre-push-verify.sh 63addff88f3f0ee9a44fc8442dce592faf7e75ddc7477ad970b8857697b9cc58 .claude/skills/deep-code-review/templates/secret-scan.yml a82701e4893739b8451bcfab0fe6df01e130f1659cd9b4c3780f1461c874d698 .claude/skills/deep-code-review/templates/semgrep-taint/gha.yml diff --git a/scripts/test-ci-gates.sh b/scripts/test-ci-gates.sh index 6d918e951..a29c4436f 100644 --- a/scripts/test-ci-gates.sh +++ b/scripts/test-ci-gates.sh @@ -4560,6 +4560,13 @@ grep -qF 'is such a grant for push and merge only' "$ROOT/commands/perun-run.md" if [ "$_dtg" -eq 1 ]; then record 0 "drive-to-goal: rule, two spend modes and override present"; else record 1 "drive-to-goal: rule, two spend modes and override present"; fi fi + +# action pins: perun-review.yml has no tag-only `uses: x@vN`; dcr-gates.yml checkout does not persist credentials; train_land.sh quotes "${@:3}" +_pin=1 +grep -qE '^\s*-?\s*uses:\s*[^ ]+@v[0-9]' "$ROOT/.claude/skills/deep-code-review/templates/perun-review.yml" && _pin=0 +grep -qF 'persist-credentials: false' "$ROOT/.claude/skills/deep-code-review/templates/dcr-gates.yml" || _pin=0 +grep -qF '${@:3}' "$ROOT/.claude/skills/agentic-delivery/scripts/train_land.sh" && ! grep -qF '"${@:3}"' "$ROOT/.claude/skills/agentic-delivery/scripts/train_land.sh" && _pin=0 +if [ "$_pin" -eq 1 ]; then record 0 "pins: review template SHA-pinned, gates checkout persist-credentials false, train_land quotes args"; else record 1 "pins: review template SHA-pinned, gates checkout persist-credentials false, train_land quotes args"; fi # hermeticity sentinel (own lane, appended at the end by convention): nothing # above wrote outside $WORK. A regression here means some case dropped a # fixture into the real checkout instead of $WORK — exactly the kind of